ZURSULUS L2

The Zero Hour

ID
640
Название
The Zero Hour
start_npcs_json
[31554]
npc_ids_json
[31554]
constants_json
{"KAHMAN":31554,"FANG_OF_STAKATO":8085}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00640_TheZeroHour/Q00640_TheZeroHour.java

NPC квеста

IDНазваниеСтарт квестаУровень
31554KahmanДа70

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

if (player.getLevel() < 66)

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

rewardItems(player, reward[1], reward[2]);

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

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

[31554-00.htm] Mercenary Kahman: Hate to say it, but you don't have the skills to work with me. Run along before you get hurt! (This quest may only be undertaken by a character of level 66 and above.) [31554-01.htm] Mercenary Kahman: Welcome back! We'd never have found that Stakato's Nest without your help! Finally, we can quash the unrest! Will you join our assault on the Stakatos? "Let's do it." [31554-02.htm] Mercenary Kahman: Perfect! I trust your skills, so I know you'll have our backs. Go to the Stakato's Nest and kill them! It won't be an easy battle, so bring plenty of supplies with you. Don't forget to collect Stakato Fangs. Now get going! [31554-03.htm] Mercenary Kahman: What are you doing? There are no cowards in the Golden Ram Mercenaries! Suck it up, soldier, and show us what you're made of! Slaughter the Spiked Stakato, Spiked Stakato Worker, Spiked Stakato Guard, Male Spiked Stakato, Female Spiked Stakato, Spiked Stakato Sorcerer, Cannibalistic Stakato Leader, Spiked Stakato Soldier, Spiked Stakato Drone, Spiked Stakato Captain, Spiked Stakato Nurse and the Spiked Stakato Shaman. [31554-04.htm] Mercenary Kahman: You showed real bravery in the face of those filthy Stakatos. Victory is ours! Give me your Stakato Fangs and then choose your reward! "Here they are!" [31554-05.htm] Mercenary Kahman: Which reward would you like? 1 Enria (12 Stakato Fangs) 1 Asofe (6 Stakato Fangs) 1 Thons (6 Stakato Fangs) 10 Varnishes of Purity (81 Stakato Fangs) 5 Syntetic Cokes (33 Stakato Fangs) 10 Compoud Braids (30 Stakato Fangs) 10 Durable Metal Plates (150 Stakato Fangs) 10 Mithril Alloy (131 Stakato Fangs) 5 Oriharukon (123 Stakato Fangs) [31554-06.htm] Mercenary Kahman: Where are the Fangs you said you had? You won't get money for nothing in this business, soldier! Don't even think about insulting the honor of the Golden Ram Mercenaries! "I won't! I'll go and fight again." "I'm done with this." [31554-07.htm] Mercenary Kahman: Had enough? No? Then get back out here and fight! [31554-08.htm] Mercenary Kahman: Suit yourself. Goodbye. [31554-09.htm] Mercenary Kahman: I gave you your reward. What else do you want? "I'll bring more Fangs." "I'll looks somewhere else." "I'm done with this." [31554-10.htm] Mercenary Kahman: We haven't finished our investigation, so there's nothing for you right now. Come back later! (This quest may only be undertaken by a character who has completed In Search of the Nest quest.)
Исходник условий и наград (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.Q00640_TheZeroHour;

import org.l2jmobius.commons.util.StringUtil;
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 quests.Q00109_InSearchOfTheNest.Q00109_InSearchOfTheNest;

public class Q00640_TheZeroHour extends Quest
{
	// NPC
	private static final int KAHMAN = 31554;
	
	// Item
	private static final int FANG_OF_STAKATO = 8085;
	private static final int[][] REWARDS =
	{
		// @formatter:off
		{12, 4042, 1},
		{6, 4043, 1},
		{6, 4044, 1},
		{81, 1887, 10},
		{33, 1888, 5},
		{30, 1889, 10},
		{150, 5550, 10},
		{131, 1890, 10},
		{123, 1893, 5}
		// @formatter:on
	};
	
	public Q00640_TheZeroHour()
	{
		super(640, "The Zero Hour");
		registerQuestItems(FANG_OF_STAKATO);
		addStartNpc(KAHMAN);
		addTalkId(KAHMAN);
		
		// All "spiked" stakatos types, except babies and cannibalistic followers.
		addKillId(22105, 22106, 22107, 22108, 22109, 22110, 22111, 22113, 22114, 22115, 22116, 22117, 22118, 22119, 22121);
	}
	
	@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("31554-02.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("31554-05.htm"))
		{
			if (!hasQuestItems(player, FANG_OF_STAKATO))
			{
				htmltext = "31554-06.htm";
			}
		}
		else if (event.equals("31554-08.htm"))
		{
			st.exitQuest(true, true);
		}
		else if (StringUtil.isNumeric(event))
		{
			final int[] reward = REWARDS[Integer.parseInt(event)];
			if (getQuestItemsCount(player, FANG_OF_STAKATO) >= reward[0])
			{
				htmltext = "31554-09.htm";
				takeItems(player, FANG_OF_STAKATO, reward[0]);
				rewardItems(player, reward[1], reward[2]);
			}
			else
			{
				htmltext = "31554-06.htm";
			}
		}
		
		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:
			{
				if (player.getLevel() < 66)
				{
					htmltext = "31554-00.htm";
				}
				else
				{
					final QuestState st2 = player.getQuestState(Q00109_InSearchOfTheNest.class.getSimpleName());
					htmltext = ((st2 != null) && st2.isCompleted()) ? "31554-01.htm" : "31554-10.htm";
				}
				break;
			}
			case State.STARTED:
			{
				htmltext = (hasQuestItems(player, FANG_OF_STAKATO)) ? "31554-04.htm" : "31554-03.htm";
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player killer, boolean isSummon)
	{
		final QuestState qs = getRandomPartyMemberState(killer, 1, 3, npc);
		if (qs != null)
		{
			giveItemRandomly(qs.getPlayer(), npc, FANG_OF_STAKATO, 1, 0, 1, true);
		}
	}
}