ZURSULUS L2

Shadow of Light

ID
602
Название
Shadow of Light
start_npcs_json
[31683]
npc_ids_json
[]
constants_json
{"EYE_OF_DARKNESS":7189}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00602_ShadowOfLight/Q00602_ShadowOfLight.java

NPC квеста

Записей нет.

Условия уровней: выражения из Java

if (player.getLevel() < 68)

Выдача предметов, адены и опыта: выражения из Java

giveAdena(player, element[1], true);
giveItems(player, element[0], 3);
addExpAndSp(player, element[2], element[3]);
giveItems(partyMember, EYE_OF_DARKNESS, 1);

Квесты содержат динамические условия Java. Выражения выдачи включают промежуточные предметы, варианты и случайные награды; это не гарантированная награда. Константы приведены выше. Полные условия — в исходнике.

Тексты квеста

[31683-01.htm] Eye of Argos: Long ago, when I still had a complete body, my 1000 eyes told me everything that occurred in the world. It was I who told Einhasad of the relationship between Shilen and Gran Kain. When Eva abdicated as the goddess of water and went into hiding, it was I who exposed her. But with the creation of the four races, the world became much too complex for me to watch everything that happened. I began opening only 500 of my eyes per day. This led to a sharp division within my personality. Half of my mind concentrated on darker events in the world - war, murder, betrayal and corruption. This part of my mind became dark and depressed, and longed to purge the rampant evil from the world. The other half of my mind focused on the brighter side of the world - love, art, courage and fealty. This part of my personality fell in love with all the noble things in the world. During the brutal war between gods and giants, I refused to disclose the hiding places of giants. Einhasad responded by ripping my body into pieces and pulling out my eyes! She then threw my remains into this valley. Slowly, my two largest eyes became aware of light and darkness. I am the eye that is conscious of light. Daimon the White-Eyed inherited the dark world view of Argos. He's determined to purify this world, and has brainwashed the monsters of this valley to help him realize his goal. Brave warrior! Help stop Daimon! "I'll do it!" [31683-02.htm] Eye of Argos: Your courage may yet save the world! Daimon the White-Eyed uses his underlings to transform monsters into slaves. Once they've been transformed, they're beyond redemption. Kill them so they can rest in peace. You can get the eyes of darkness if you kill Buffalo Slaves and Grendel Slaves. When you get 100 eyes of darkness, visit me again. [31683-02a.htm] Eye of Argos: Your courage is commendable, brave warrior, but you're not yet ready to confront Daimon and his evil forces. Improve your skills and come back! (This quest may only be undertaken by a character of level 68 and above.) [31683-03.htm] Eye of Argos: No one can hide from the allseeing eye! Bring me 100 eyes of darkness! [31683-04.htm] Eye of Argos: Don't get too full of yourself, young warrior! Darkness grows stronger even as we speak! If you're truly concerned about the wellbeing of this world, defeat the forces of darkness! "Here are the eyes of darkness." [31683-05.htm] Eye of Argos: Your shouts of vengeance could be heard all the way over here! Excellent job, brave warrior! [31683-06.htm] Eye of Argos: Why haven't you collected 100 eyes of darkness yet? Act quickly or Daimon will become much more dangerous and powerful!
Исходник условий и наград (Java)
/*
 * Copyright (c) 2013 L2jMobius
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
 * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
package quests.Q00602_ShadowOfLight;

import org.l2jmobius.gameserver.entity.actor.Npc;
import org.l2jmobius.gameserver.entity.actor.Player;
import org.l2jmobius.gameserver.mechanics.script.Quest;
import org.l2jmobius.gameserver.mechanics.script.QuestSound;
import org.l2jmobius.gameserver.mechanics.script.QuestState;
import org.l2jmobius.gameserver.mechanics.script.State;

public class Q00602_ShadowOfLight extends Quest
{
	private static final int EYE_OF_DARKNESS = 7189;
	private static final int[][] REWARDS =
	{
		// @formatter:off
		{6699, 40000, 120000, 20000, 20},
		{6698, 60000, 110000, 15000, 40},
		{6700, 40000, 150000, 10000, 50},
		{0, 100000, 140000, 11250, 100}
		// @formatter:on
	};
	
	public Q00602_ShadowOfLight()
	{
		super(602, "Shadow of Light");
		registerQuestItems(EYE_OF_DARKNESS);
		addStartNpc(31683); // Eye of Argos
		addTalkId(31683);
		addKillId(21299, 21304);
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		String htmltext = event;
		final QuestState st = getQuestState(player, false);
		if (st == null)
		{
			return htmltext;
		}
		
		if (event.equals("31683-02.htm"))
		{
			if (player.getLevel() < 68)
			{
				htmltext = "31683-02a.htm";
			}
			else
			{
				st.startQuest();
			}
		}
		else if (event.equals("31683-05.htm"))
		{
			takeItems(player, EYE_OF_DARKNESS, -1);
			
			final int random = getRandom(100);
			for (int[] element : REWARDS)
			{
				if (random < element[4])
				{
					giveAdena(player, element[1], true);
					
					if (element[0] != 0)
					{
						giveItems(player, element[0], 3);
					}
					
					addExpAndSp(player, element[2], element[3]);
					break;
				}
			}
			
			st.exitQuest(true, true);
		}
		
		return htmltext;
	}
	
	@Override
	public String onTalk(Npc npc, Player player)
	{
		String htmltext = getNoQuestMsg(player);
		final QuestState st = getQuestState(player, true);
		
		switch (st.getState())
		{
			case State.CREATED:
			{
				htmltext = "31683-01.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				if (cond == 1)
				{
					htmltext = "31683-03.htm";
				}
				else if (cond == 2)
				{
					htmltext = "31683-04.htm";
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState qs = getRandomPartyMemberState(player, 1, 3, npc);
		if (qs == null)
		{
			return;
		}
		
		final Player partyMember = qs.getPlayer();
		final QuestState st = getQuestState(partyMember, false);
		if (st == null)
		{
			return;
		}
		
		if (getRandom(100) < (npc.getId() == 21299 ? 45 : 50))
		{
			giveItems(partyMember, EYE_OF_DARKNESS, 1);
			if (getQuestItemsCount(partyMember, EYE_OF_DARKNESS) < 100)
			{
				playSound(partyMember, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
			else
			{
				st.setCond(2, true);
			}
		}
	}
}