ZURSULUS L2

Slay the enemy commander!

ID
614
Название
Slay the enemy commander!
start_npcs_json
[31377]
npc_ids_json
[25302,31377]
constants_json
{"ASHAS":31377,"TAYR":25302,"TAYR_HEAD":7241,"WISDOM_FEATHER":7230,"VARKA_ALLIANCE_FOUR":7224,"MIN_LEVEL":75}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00614_SlayTheEnemyCommanderVarka/Q00614_SlayTheEnemyCommanderVarka.java

NPC квеста

IDНазваниеСтарт квестаУровень
25302Ketra's Commander TayrНет84
31377Ashas Varka DuraiДа70

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

private static final int MIN_LEVEL = 75;
htmltext = (player.getLevel() >= MIN_LEVEL) ? (hasQuestItems(player, VARKA_ALLIANCE_FOUR)) ? "31377-01.htm" : "31377-02.htm" : "31377-03.htm";

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

giveItems(player, TAYR_HEAD, 1);
giveItems(player, WISDOM_FEATHER, 1);
addExpAndSp(player, 10000, 0);

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

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

[31377-01.htm] Chief Ashas Varka Durai: The time has come for the Varka to strike back! If we are to prevail, we must first slay the commander of Ketra Orcs! Who will step forward to kill this beast? I'll do it! [31377-02.htm] Chief Ashas Varka Durai: The time has not yet come. If we are to achieve victory, we must have patience. A superior strategist waits patiently for just the right moment... and when that moment comes... he strikes! (Only characters who possess the mark of Varka's friend - 4th level can undertake this quest.) [31377-03.htm] Chief Ashas Varka Durai: You're not quite ready. Go improve your skills! (This quest may only be undertaken by characters of level 75 or above.) [31377-04.htm] Chief Ashas Varka Durai: Are you ready? You've already defeated Hekaton, hero of the Ketra, you should be able to defeat Tayre as well! Tayre is the commander of Ketra forces. He's a typical savage, little more than a beast! He has cruelly massacred hundreds of Varka soldiers! He must be stopped! Kill Tayre, cut off his head and bring it to me! Bear this in mind! Commander Tayre is every bit as powerful as Hekaton! You're strong but you can't fight him alone! Take some friends with you! [31377-05.html] Chief Ashas Varka Durai: Dear friend of Varka, have you brought the Head of Tayre, the commander of the Ketras? "Here's Tayre's head." [31377-06.html] Chief Ashas Varka Durai: I await the news of your victory! You are very brave! Kill Tayre, the commander of the Ketra forces and bring back his head! [31377-07.html] Chief Ashas Varka Durai: Is this the Head of Tayre? Ugly bastard, wasn't he? I'm very proud of you! Take this Feather of Wisdom in recognition your outstanding military achievements. This is the Feather of Wisdom. It's the custom of the Varka to give this to the our most respected friends! Congratulations!
Исходник условий и наград (Java)
/*
 * This file is part of the L2J Mobius project.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package quests.Q00614_SlayTheEnemyCommanderVarka;

import org.l2jmobius.gameserver.config.PlayerConfig;
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.QuestState;
import org.l2jmobius.gameserver.mechanics.script.State;
import org.l2jmobius.gameserver.util.LocationUtil;

/**
 * Slay the Enemy Commander! (Varka) (614)
 * @author malyelfik
 */
public class Q00614_SlayTheEnemyCommanderVarka extends Quest
{
	// NPC
	private static final int ASHAS = 31377;
	
	// Monster
	private static final int TAYR = 25302;
	
	// Items
	private static final int TAYR_HEAD = 7241;
	private static final int WISDOM_FEATHER = 7230;
	private static final int VARKA_ALLIANCE_FOUR = 7224;
	
	// Misc
	private static final int MIN_LEVEL = 75;
	
	public Q00614_SlayTheEnemyCommanderVarka()
	{
		super(614, "Slay the enemy commander!");
		addStartNpc(ASHAS);
		addTalkId(ASHAS);
		addKillId(TAYR);
		registerQuestItems(TAYR_HEAD);
	}
	
	@Override
	public void actionForEachPlayer(Player player, Npc npc, boolean isSummon)
	{
		final QuestState qs = getQuestState(player, false);
		if ((qs != null) && qs.isCond(1) && LocationUtil.checkIfInRange(PlayerConfig.ALT_PARTY_RANGE, npc, player, false))
		{
			giveItems(player, TAYR_HEAD, 1);
			qs.setCond(2, true);
		}
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		final QuestState qs = getQuestState(player, false);
		if (qs == null)
		{
			return null;
		}
		
		String htmltext = event;
		switch (event)
		{
			case "31377-04.htm":
			{
				qs.startQuest();
				break;
			}
			case "31377-07.html":
			{
				if (hasQuestItems(player, TAYR_HEAD) && qs.isCond(2))
				{
					giveItems(player, WISDOM_FEATHER, 1);
					addExpAndSp(player, 10000, 0);
					qs.exitQuest(true, true);
				}
				else
				{
					htmltext = getNoQuestMsg(player);
				}
				break;
			}
			default:
			{
				htmltext = null;
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player killer, boolean isSummon)
	{
		executeForEachPlayer(killer, npc, isSummon, true, false);
	}
	
	@Override
	public String onTalk(Npc npc, Player player)
	{
		final QuestState qs = getQuestState(player, true);
		String htmltext = getNoQuestMsg(player);
		switch (qs.getState())
		{
			case State.CREATED:
			{
				htmltext = (player.getLevel() >= MIN_LEVEL) ? (hasQuestItems(player, VARKA_ALLIANCE_FOUR)) ? "31377-01.htm" : "31377-02.htm" : "31377-03.htm";
				break;
			}
			case State.STARTED:
			{
				htmltext = (qs.isCond(2) && hasQuestItems(player, TAYR_HEAD)) ? "31377-05.html" : "31377-06.html";
				break;
			}
		}
		
		return htmltext;
	}
}