ZURSULUS L2

Magical Power of Fire - Part 1

ID
615
Название
Magical Power of Fire - Part 1
start_npcs_json
[31378]
npc_ids_json
[31378,31379,31559,31684]
constants_json
{"NARAN":31378,"UDAN":31379,"ASEFA_BOX":31559,"ASEFA_EYE":31684,"KEY":1661,"STOLEN_RED_TOTEM":7242,"WISDOM_STONE":7081,"RED_TOTEM":7243,"MIN_LEVEL":74}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00615_MagicalPowerOfFirePart1/Q00615_MagicalPowerOfFirePart1.java

NPC квеста

IDНазваниеСтарт квестаУровень
31378Naran AshanukДа70
31379Udan MarduiНет70
31559Box of AsefaНет70
31684Eye of Udan MarduiНет70

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

private static final int MIN_LEVEL = 74;
htmltext = (player.getLevel() >= MIN_LEVEL) ? (hasAtLeastOneQuestItem(player, VARKA_MARKS)) ? "31378-01.htm" : "31378-00a.html" : "31378-00b.html";

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

giveItems(player, STOLEN_RED_TOTEM, 1);
giveItems(player, RED_TOTEM, 1);
giveItems(player, WISDOM_STONE, 1);

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

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

[31378-00a.html] Varka's Messenger Naran Ashanuk: Friend of Varka, Guide of Dead Souls Udan Mardui is keeping an eye on your progress. He may one day bless you with a new mission. But only if you train harder! (This quest is for characters level 74 and above, and who have the 'Proof of Alliance with Varka Silenos' - Level 1 or above.) [31378-00b.html] Varka's Messenger Naran Ashanuk: Friend of Varka, Guide of Dead Souls Udan Mardui is watching you. Should he call upon you, you must be ready. When that day comes... you WILL be. (This quest is for characters level 74 and above, and who have the 'Proof of Alliance with Varka Silenos' - Level 1 or above.) [31378-01.htm] Varka's Messenger Naran Ashanuk: You have been an inspiration to the Varka, my friend! Udan Mardui has recently expressed interest in assigning a mission to you. Are you up to it? "I accept the mission." [31378-02.html] Varka's Messenger Naran Ashanuk: Very well! Udan Mardui can tell you all about it. You can find him in the center of the village. Get going! [31378-03.html] Varka's Messenger Naran Ashanuk: Have you met the guide of dead souls yet? Of course, I'm speaking of Udan Mardui, located in the center of the village. He has all the details regarding your new mission! [31379-01.html] Soul Guide Udan Mardui: Do you feel the power of Asefa engulfing the battleground, comrade? You must go to the Ketra Orc Outpost and steal the Red Totem, the source of his power. You mustn't confront it's guardians directly! If they discover you, you'll never get the totem. Once you do this, I'll give you the Divine Stone of Wisdom, a sacred relic of our tribe! The Red Totem is locked inside a box, so don't forget to take the Thief Key with you. I pray that you are victorious! [31379-02.html] Soul Guide Udan Mardui: Bring me the Red Totem, the source of Soul Guide Asefa's power, and don't let the guards see you! The totem is locked inside a box, so don't forget to take the Thief Key with you. Once you do this, I'll give you a sacred relic of our tribe! [31379-03.html] Soul Guide Udan Mardui: You were spotted? How careless! I'll blind the guard for you. Go back and bring the totem from Asefa's box! [31379-04.html] Soul Guide Udan Mardui: Oh, were you successful? Is this the Red Totem? I feel the strong energy of fire! I didn't think that Ketra Orcs could use this mysterious power! In honor of your wisdom and courage, I hereby bestow upon you this holy relic of our tribe, the Divine Stone of Wisdom. Now, I, Udan Mardui, will discover the secret contained within the totem. Come back to see me later. I'll have more work for you. [31559-01.html] Asefa's Box: There is a box with Ketra Orcs' sorcerous patterns engraved. It seems that the box contains something powerful like the power of fire. Try to open it [31559-02.html] Asefa's Box: This box can only be opened with a Thief Key. [31559-03.html] Asefa's Box: The box opened! In the box, there is a Red Totem from which I can feel some strong power. [31559-04.html] Asefa's Box: The box opened! But it's empty. The surveillant must have found out and hid the Red Totem somewhere else. Go back to Soul Guide Udan Mardui, and come back again after breaking the curse.
Исходник условий и наград (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.Q00615_MagicalPowerOfFirePart1;

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.mechanics.skill.holders.SkillHolder;
import org.l2jmobius.gameserver.network.enums.ChatType;
import org.l2jmobius.gameserver.network.serverpackets.NpcSay;

/**
 * Magical Power of Fire - Part 1 (615)
 * @author Joxit
 */
public class Q00615_MagicalPowerOfFirePart1 extends Quest
{
	// NPCs
	private static final int NARAN = 31378;
	private static final int UDAN = 31379;
	private static final int ASEFA_BOX = 31559;
	private static final int ASEFA_EYE = 31684;
	
	// Monsters
	private static final int[] KETRA_MOBS =
	{
		21324, // Ketra Orc Footman
		21325, // Ketra's War Hound
		21327, // Ketra Orc Raider
		21328, // Ketra Orc Scout
		21329, // Ketra Orc Shaman
		21331, // Ketra Orc Warrior
		21332, // Ketra Orc Lieutenant
		21334, // Ketra Orc Medium
		21335, // Ketra Orc Elite Soldier
		21336, // Ketra Orc White Captain
		21338, // Ketra Orc Seer
		21339, // Ketra Orc General
		21340, // Ketra Orc Battalion Commander
		21342, // Ketra Orc Grand Seer
		21343, // Ketra Commander
		21344, // Ketra Elite Guard
		21345, // Ketra's Head Shaman
		21346, // Ketra's Head Guard
		21347, // Ketra Prophet
		21348, // Prophet's Guard
		21349, // Prophet's Aide
	};
	
	// Items
	private static final int KEY = 1661;
	private static final int STOLEN_RED_TOTEM = 7242;
	private static final int WISDOM_STONE = 7081;
	private static final int RED_TOTEM = 7243;
	private static final int[] VARKA_MARKS =
	{
		7221, // Mark of Varka's Alliance - Level 1
		7222, // Mark of Varka's Alliance - Level 2
		7223, // Mark of Varka's Alliance - Level 3
		7224, // Mark of Varka's Alliance - Level 4
		7225, // Mark of Varka's Alliance - Level 5
	};
	
	// Skills
	private static final SkillHolder GOW = new SkillHolder(4547, 1); // Gaze of Watcher
	private static final SkillHolder DISPEL_GOW = new SkillHolder(4548, 1); // Quest - Dispel Watcher Gaze
	// Misc
	private static final int MIN_LEVEL = 74;
	
	public Q00615_MagicalPowerOfFirePart1()
	{
		super(615, "Magical Power of Fire - Part 1");
		addStartNpc(NARAN);
		addTalkId(UDAN, NARAN, ASEFA_BOX);
		addAttackId(KETRA_MOBS);
		registerQuestItems(STOLEN_RED_TOTEM);
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		final QuestState qs = getQuestState(player, false);
		if (qs == null)
		{
			return null;
		}
		
		String htmltext = null;
		switch (event)
		{
			case "31378-02.html":
			{
				qs.startQuest();
				htmltext = event;
				break;
			}
			case "open_box":
			{
				if (!hasQuestItems(player, KEY))
				{
					htmltext = "31559-02.html";
				}
				else if (qs.isCond(2))
				{
					if (qs.isSet("spawned"))
					{
						takeItems(player, KEY, 1);
						htmltext = "31559-04.html";
					}
					else
					{
						giveItems(player, STOLEN_RED_TOTEM, 1);
						takeItems(player, KEY, 1);
						qs.setCond(3, true);
						htmltext = "31559-03.html";
					}
				}
				break;
			}
			case "eye_despawn":
			{
				npc.broadcastPacket(new NpcSay(npc, ChatType.NPC_GENERAL, "Asefa has already seen your face!"));
				npc.deleteMe();
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onAttack(Npc npc, Player attacker, int damage, boolean isSummon)
	{
		final QuestState qs = getQuestState(attacker, false);
		if ((qs != null) && qs.isCond(2) && !qs.isSet("spawned"))
		{
			qs.set("spawned", "1");
			npc.setTarget(attacker);
			npc.doCast(GOW.getSkill());
			final Npc eye = addSpawn(ASEFA_EYE, npc);
			eye.broadcastPacket(new NpcSay(eye, ChatType.NPC_GENERAL, "You can't avoid the eyes of Asefa!"));
			startQuestTimer("eye_despawn", 10000, eye, attacker);
		}
	}
	
	@Override
	public String onTalk(Npc npc, Player player)
	{
		final QuestState qs = getQuestState(player, true);
		String htmltext = getNoQuestMsg(player);
		switch (npc.getId())
		{
			case NARAN:
			{
				switch (qs.getState())
				{
					case State.CREATED:
					{
						htmltext = (player.getLevel() >= MIN_LEVEL) ? (hasAtLeastOneQuestItem(player, VARKA_MARKS)) ? "31378-01.htm" : "31378-00a.html" : "31378-00b.html";
						break;
					}
					case State.STARTED:
					{
						if (qs.isCond(1))
						{
							htmltext = "31378-03.html";
						}
						break;
					}
				}
				break;
			}
			case UDAN:
			{
				if (qs.isStarted())
				{
					switch (qs.getCond())
					{
						case 1:
						{
							htmltext = "31379-01.html";
							qs.setCond(2, true);
							break;
						}
						case 2:
						{
							if (qs.isSet("spawned"))
							{
								qs.unset("spawned");
								npc.setTarget(player);
								npc.doCast(DISPEL_GOW.getSkill());
								htmltext = "31379-03.html";
							}
							else
							{
								htmltext = "31379-02.html";
							}
							break;
						}
						case 3:
						{
							giveItems(player, RED_TOTEM, 1);
							giveItems(player, WISDOM_STONE, 1);
							qs.exitQuest(true, true);
							htmltext = "31379-04.html";
							break;
						}
					}
				}
				break;
			}
			case ASEFA_BOX:
			{
				if (qs.isCond(2))
				{
					htmltext = "31559-01.html";
				}
				break;
			}
		}
		
		return htmltext;
	}
}