ZURSULUS L2

Watching Eyes

ID
601
Название
Watching Eyes
start_npcs_json
[31683]
npc_ids_json
[]
constants_json
{"PROOF_OF_AVENGER":7188}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00601_WatchingEyes/Q00601_WatchingEyes.java

NPC квеста

Записей нет.

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

if (player.getLevel() < 71)

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

giveAdena(player, element[1], true);
giveItems(player, element[0], 5);
addExpAndSp(player, 120000, 10000);
giveItems(partyMember, PROOF_OF_AVENGER, 1);

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

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

[31683-01.htm] Eye of Argos: Even after my friends, the giants, perished, and the gods tore my body asunder and imprisoned me here, I stayed quiet. Now, to add insult to injury, they've posted their disciples as guards to watch over me, to humiliate what's left of me! I can't stand it any more! I'm not as evil as you the children of the world think. On the contrary, I love peace! I beseech you! If I attack the guards I'll be severely tortured! Would you and your soldiers help me? "We'll help you." [31683-02.htm] Eye of Argos: My dear soldier, I'm grateful for your enthusiasm, but I'm afraid that you're not ready to face the wrath of Einhasad! (This quest may only be undertaken by a character of level 71 or above.) [31683-03.htm] Eye of Argos: Punish the wicked disciples and then return to me! They're called the Disciples of Protection, the Disciples of Punishment and the Disciples of Authority. [31683-04.htm] Eye of Argos: Weren't you going to bring me the marks of disciple? Now you're telling me you won't do it? How dare you insult the mighty Argos! [31683-05.htm] Eye of Argos: You haven't collected 100 marks of disciple yet? You must kill them to soothe my anger! Save me from my own fury, brave warrior! [31683-06.htm] Eye of Argos: Thanks to you, my brave soldier, the darkness in my heart is lifting! Give me the proofs you've collected. "Here are the marks of disciple." [31683-07.htm] Eye of Argos: Your scruffy appearance belies the passionate sense of justice in your heart, brave warrior! Good deeds often go unnoticed and unrewarded, but over the millenia, your simple good deed will be returned a thousand-fold!
Исходник условий и наград (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.Q00601_WatchingEyes;

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 Q00601_WatchingEyes extends Quest
{
	// Items
	private static final int PROOF_OF_AVENGER = 7188;
	
	// Rewards
	private static final int[][] REWARDS =
	{
		// @formatter:off
		{6699, 90000, 20},
		{6698, 80000, 40},
		{6700, 40000, 50},
		{0, 230000, 100}
		// @formatter:on
	};
	
	public Q00601_WatchingEyes()
	{
		super(601, "Watching Eyes");
		registerQuestItems(PROOF_OF_AVENGER);
		addStartNpc(31683); // Eye of Argos
		addTalkId(31683);
		addKillId(21306, 21308, 21309, 21310, 21311);
	}
	
	@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-03.htm"))
		{
			if (player.getLevel() < 71)
			{
				htmltext = "31683-02.htm";
			}
			else
			{
				st.startQuest();
			}
		}
		else if (event.equals("31683-07.htm"))
		{
			takeItems(player, PROOF_OF_AVENGER, -1);
			
			final int random = getRandom(100);
			for (int[] element : REWARDS)
			{
				if (random < element[2])
				{
					giveAdena(player, element[1], true);
					if (element[0] != 0)
					{
						giveItems(player, element[0], 5);
						addExpAndSp(player, 120000, 10000);
					}
					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 = (hasQuestItems(player, PROOF_OF_AVENGER)) ? "31683-05.htm" : "31683-04.htm";
				}
				else if (cond == 2)
				{
					htmltext = "31683-06.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 (getRandomBoolean())
		{
			giveItems(partyMember, PROOF_OF_AVENGER, 1);
			if (getQuestItemsCount(partyMember, PROOF_OF_AVENGER) < 100)
			{
				playSound(partyMember, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
			else
			{
				st.setCond(2, true);
			}
		}
	}
}