ZURSULUS L2

Into the Flame

ID
618
Название
Into the Flame
start_npcs_json
[31540]
npc_ids_json
[31271,31540]
constants_json
{"KLEIN":31540,"HILDA":31271,"VACUALITE_ORE":7265,"VACUALITE":7266,"FLOATING_STONE":7267}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00618_IntoTheFlame/Q00618_IntoTheFlame.java

NPC квеста

IDНазваниеСтарт квестаУровень
31271HildaНет70
31540KleinДа70

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

htmltext = (player.getLevel() < 60) ? "31540-01.htm" : "31540-02.htm";

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

giveItems(player, FLOATING_STONE, 1);
giveItems(player, VACUALITE, 1);
giveItems(partyMember, VACUALITE_ORE, 1);

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

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

[31271-01.htm] Blacksmith Hilda: Klein sent you here for a Vacualite, didn't he? ... I'm sorry, but I don't seem to have one at the moment. I could make one, however. You can get the ore. Bring me some Vacualite ore and I'll make a Vacualite for you. "Where can I find Vacualite ore?" [31271-02.htm] Blacksmith Hilda: Open the bellies of the Kookaburra, Bandersnatch and Grendel in the Garden of Wild Beasts. Occasionally their entrails contain Vacualite ore. It's probably due to their bizarre diet! Bring 50 pieces of Vacualite ore to me and I'll make a Vacualite for you. [31271-03.htm] Blacksmith Hilda: You haven't brought enough! As I said, open the bellies of the Kookaburra, Bandersnatch and Grendel in the Garden of Wild Beasts. Sometimes their entrails contain Vacualite ore. This is probably due to their strange diet... Bring me 50 pieces of Vacualite ore and I'll make you a Vacualite. [31271-04.htm] Blacksmith Hilda: You've brought them all? Let me see! Excellent! I can get started on your Vacualite right away! Now, let me have that Vacualite ore... "Here you go." [31271-05.htm] Blacksmith Hilda: Where should I begin? First I must melt it in the furnace to separate the impurities and extract pure Vacualite. Then, once cooled... It's done! Here it is! Take this Vacualite to Klein. [31271-06.htm] Blacksmith Hilda: Take the Vacualite to Klein. [31540-01.htm] Watcher of Valakas Klein: Do you know what's behind this Hall of Flames? Not everyone can make it through. I don't think you're ready. (This quest may only be undertaken by a character of level 60 and above.) [31540-02.htm] Watcher of Valakas Klein: Do you know what's behind this Hall of Flames? Not everyone can make it through. You can't get there by foot, but I can tell you how. Quest [31540-03.htm] Watcher of Valakas Klein: Meet Blacksmith Hilda in Goddard Castle Town and bring me Vacualite. If a magic power is infused in it, it can activate the magic. It's a very unique mineral, and can only be used once. With it I can create a disposable Floating Stone to get through the Hall of Flames. [31540-04.htm] Watcher of Valakas Klein: You brought some Vacualite! Now I can make a Floating Stone. Let me see it. "Here it is." [31540-05.htm] Watcher of Valakas Klein: You can defy gravity with this Floating Stone and travel with the wind. You'll need it for the Hall of Flames.
Исходник условий и наград (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.Q00618_IntoTheFlame;

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 Q00618_IntoTheFlame extends Quest
{
	// NPCs
	private static final int KLEIN = 31540;
	private static final int HILDA = 31271;
	
	// Items
	private static final int VACUALITE_ORE = 7265;
	private static final int VACUALITE = 7266;
	
	// Reward
	private static final int FLOATING_STONE = 7267;
	
	public Q00618_IntoTheFlame()
	{
		super(618, "Into the Flame");
		registerQuestItems(VACUALITE_ORE, VACUALITE);
		addStartNpc(KLEIN);
		addTalkId(KLEIN, HILDA);
		
		// Kookaburras, Bandersnatches, Grendels
		addKillId(21274, 21275, 21276, 21277, 21282, 21283, 21284, 21285, 21290, 21291, 21292, 21293);
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		String htmltext = event;
		final QuestState st = getQuestState(player, false);
		if (st == null)
		{
			return htmltext;
		}
		
		switch (event)
		{
			case "31540-03.htm":
			{
				st.startQuest();
				break;
			}
			case "31540-05.htm":
			{
				takeItems(player, VACUALITE, 1);
				giveItems(player, FLOATING_STONE, 1);
				st.exitQuest(true, true);
				break;
			}
			case "31271-02.htm":
			{
				st.setCond(2, true);
				break;
			}
			case "31271-05.htm":
			{
				st.setCond(4, true);
				takeItems(player, VACUALITE_ORE, -1);
				giveItems(player, VACUALITE, 1);
				break;
			}
		}
		
		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 = (player.getLevel() < 60) ? "31540-01.htm" : "31540-02.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case KLEIN:
					{
						htmltext = (cond == 4) ? "31540-04.htm" : "31540-03.htm";
						break;
					}
					case HILDA:
					{
						if (cond == 1)
						{
							htmltext = "31271-01.htm";
						}
						else if (cond == 2)
						{
							htmltext = "31271-03.htm";
						}
						else if (cond == 3)
						{
							htmltext = "31271-04.htm";
						}
						else if (cond == 4)
						{
							htmltext = "31271-06.htm";
						}
						break;
					}
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState qs = getRandomPartyMemberState(player, 2, 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, VACUALITE_ORE, 1);
			if (getQuestItemsCount(partyMember, VACUALITE_ORE) < 50)
			{
				playSound(partyMember, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			}
			else
			{
				st.setCond(3, true);
			}
		}
	}
}