ZURSULUS L2

War with Ketra Orcs

ID
612
Название
War with Ketra Orcs
start_npcs_json
[31377]
npc_ids_json
[31377]
constants_json
{"ASHAS":31377,"SEED":7187,"MOLAR":7234,"MIN_LEVEL":74,"MOLAR_COUNT":100}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00612_BattleAgainstKetraOrcs/Q00612_BattleAgainstKetraOrcs.java

NPC квеста

IDНазваниеСтарт квестаУровень
31377Ashas Varka DuraiДа70

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

private static final int MIN_LEVEL = 74;
htmltext = (player.getLevel() >= MIN_LEVEL) ? "31377-01.htm" : "31377-02.htm";

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

giveItems(player, SEED, 20);
giveItems(member, MOLAR, 1);

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

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

[31377-01.htm] Chief Ashas Varka Durai: Our ancient battle against the Ketra Orcs continues to this very day. We must defeat them once and for all and reclaim our promised land! Who will join our fight? "I will fight the Ketra Orcs." [31377-02.htm] Chief Ashas Varka Durai: Your courage is admirable, but you're not quite ready for the fight. Improve your skills and come back. (This quest may only be undertaken by characters of level 74 or above.) [31377-03.htm] Chief Ashas Varka Durai: Excellent! Raid the advance base of Ketra Orcs and kill as many as you can! Bring back their molars as proof of victory. Bring back 100 of them and I'll give you a prize of valor! [31377-04.html] Chief Ashas Varka Durai My colleague, have you slaughtered many enemies, those barbarian Orcs of Ketra? Did you place the shadow of humiliation and disgrace upon them? "I will come back after killing more enemies." "I brought 100 molars for a start." "I'm going to quit fighting." [31377-05.html] Chief Ashas Varka Durai: Drive the Ketra Orcs from the promised land of the Varka! Don't let a single invader escape! Kill them all! [31377-06.html] Chief Ashas Varka Durai: The fight continues! Onward to victory! [31377-07.html] Chief Ashas Varka Durai: Excellent job, my friend! Today's was a stellar victory! You're our hero! You shall be well rewarded! At one time, this Buffalo horn was given only to soldiers of our tribe. It's quite valuable! You could trade it for something you really need! "I want to go back to the battlefield." "I have more molars." "I want to quit." [31377-08.html] Chief Ashas Varka Durai: Didn't I ask for at least 100 molars of Ketra Orcs! Return to the battlefield now! [31377-09.html] Chief Ashas Varka Durai: Even an invincible warrior must rest occasionally! You've done a noble service! Come back when you're rested!
Исходник условий и наград (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.Q00612_BattleAgainstKetraOrcs;

import java.util.HashMap;
import java.util.Map;

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;

/**
 * Battle against Ketra Orcs (612)
 * @author malyelfik
 */
public class Q00612_BattleAgainstKetraOrcs extends Quest
{
	// NPC
	private static final int ASHAS = 31377;
	
	// Monsters
	private static final Map<Integer, Integer> MOBS = new HashMap<>();
	static
	{
		MOBS.put(21324, 500); // Ketra Orc Footman
		MOBS.put(21327, 510); // Ketra Orc Raider
		MOBS.put(21328, 522); // Ketra Orc Scout
		MOBS.put(21329, 519); // Ketra Orc Shaman
		MOBS.put(21331, 529); // Ketra Orc Warrior
		MOBS.put(21332, 529); // Ketra Orc Lieutenant
		MOBS.put(21334, 539); // Ketra Orc Medium
		MOBS.put(21336, 548); // Ketra Orc White Captain
		MOBS.put(21338, 558); // Ketra Orc Seer
		MOBS.put(21339, 568); // Ketra Orc General
		MOBS.put(21340, 568); // Ketra Orc Battalion Commander
		MOBS.put(21342, 578); // Ketra Orc Grand Seer
		MOBS.put(21343, 664); // Ketra Commander
		MOBS.put(21345, 713); // Ketra's Head Shaman
		MOBS.put(21347, 738); // Ketra Prophet
	}
	
	// Items
	private static final int SEED = 7187;
	private static final int MOLAR = 7234;
	
	// Misc
	private static final int MIN_LEVEL = 74;
	private static final int MOLAR_COUNT = 100;
	
	public Q00612_BattleAgainstKetraOrcs()
	{
		super(612, "War with Ketra Orcs");
		addStartNpc(ASHAS);
		addTalkId(ASHAS);
		addKillId(MOBS.keySet());
		registerQuestItems(MOLAR);
	}
	
	@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-03.htm":
			{
				qs.startQuest();
				break;
			}
			case "31377-06.html":
			{
				break;
			}
			case "31377-07.html":
			{
				if (getQuestItemsCount(player, MOLAR) < MOLAR_COUNT)
				{
					return "31377-08.html";
				}
				
				takeItems(player, MOLAR, MOLAR_COUNT);
				giveItems(player, SEED, 20);
				break;
			}
			case "31377-09.html":
			{
				qs.exitQuest(true, true);
				break;
			}
			default:
			{
				htmltext = null;
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player killer, boolean isSummon)
	{
		final Player member = getRandomPartyMember(killer, 1);
		if ((member != null) && (getRandom(1000) < MOBS.get(npc.getId())))
		{
			giveItems(member, MOLAR, 1);
			playSound(member, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
	}
	
	@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) ? "31377-01.htm" : "31377-02.htm";
				break;
			}
			case State.STARTED:
			{
				htmltext = (hasQuestItems(player, MOLAR)) ? "31377-04.html" : "31377-05.html";
				break;
			}
		}
		
		return htmltext;
	}
}