ZURSULUS L2

The Coming Darkness

ID
16
Название
The Coming Darkness
start_npcs_json
[31517]
npc_ids_json
[31512,31513,31514,31515,31516,31517]
constants_json
{"HIERARCH":31517,"EVIL_ALTAR_1":31512,"EVIL_ALTAR_2":31513,"EVIL_ALTAR_3":31514,"EVIL_ALTAR_4":31515,"EVIL_ALTAR_5":31516,"CRYSTAL_OF_SEAL":7167}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00016_TheComingDarkness/Q00016_TheComingDarkness.java

NPC квеста

IDНазваниеСтарт квестаУровень
31512Evil AltarНет70
31513Evil AltarНет70
31514Evil AltarНет70
31515Evil AltarНет70
31516Evil AltarНет70
31517HierarchДа70

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

htmltext = (player.getLevel() < 62) ? "31517-0a.htm" : "31517-0.htm";

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

giveItems(player, CRYSTAL_OF_SEAL, 5);
addExpAndSp(player, 221958, 0);

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

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

[31512-0.htm] Evil Altar: Upon close examination, you discover a place under the altar where the crystal will easily fit. Place the crystal in the space under the altar. [31512-1.htm] Evil Altar: The altar makes an ominous sound as the seal loosens and the crystal disappears. Try the next altar. [31512-2.htm] Evil Altar: The altar looks the same as the seal loosens, but feels different. Fear washes over you. [31513-0.htm] Evil Altar: As with the previous altar, there is a space underneath where the crystal will easily fit. Place the crystal in the space under the altar. [31513-1.htm] Evil Altar: The seal is loosening! The power is getting stronger. Find the next altar. [31513-2.htm] Evil Altar: The altar looks the same as the seal continues to loosen, but it feels different. [31514-0.htm] Evil Altar: Upon close examination, you discover a place under the altar where the crystal will easily fit. Place the crystal in the space under the altar. [31514-1.htm] Evil Altar: The power is growing stronger as the seal loosens. Find the next altar. [31514-2.htm] Evil Altar: The seal is loosening. Your faith is being tested. [31515-0.htm] Evil Altar: Upon close examination, you discover a place under the altar where the crystal will easily fit. Place the crystal in the space under the altar. [31515-1.htm] Evil Altar: The power is growing stronger as the seal loosens. Find the next altar. [31515-2.htm] Evil Altar: The seal is almost removed and the power is growing stronger. If you continue, you won't be able to stop it. [31516-0.htm] Evil Altar: Upon close examination, you discover a place under the altar where the crystal will easily fit. Place the crystal in the space under the altar. [31516-1.htm] Evil Altar: The seal is almost loose, and it emanates great power. Visit the Tetrarch in the neighborhood. [31516-2.htm] Evil Altar: The seal is removed. Visit the Hierarch in the neighborhood. [31517-0.htm] Hierarch: Brother, you've been with us for a long time! You've earned our trust, and therefore I believe you're ready for an important mission! "I'm ready!" [31517-0a.htm] Hierarch: We've spent much time together, dear brother, but I regret to tell you that you're not yet ready! Try again when your faith and conviction are more firmly established. (This quest may only be undertaken by a character of level 62 and above.) [31517-1.htm] Hierarch: You're very well prepared! I wish all of us could be as well prepared as you! You've chosen a path that holds many trials, one that your brothers have traveled before you! Do you have the faith you'll need to complete your journey? "I have enough faith." [31517-2.htm] Hierarch: Very well. Based on the trust we have for you, brother, I'll give you a mission. Use these five crystals of binding to break open the seals that have been placed throughout this region. Watch the altar carefully; you'll discover how to use these crystals. I'll wait here until you break all the seals and return. First, you must go to the altar near the entrance of the Valley of Saints. Your mission begins there. Good luck! [31517-3.htm] Hierarch: You haven't finished your job yet! Come back when you've broken the seal. I'll be waiting. [31517-3a.htm] Hierarch: Where are the crystals of binding? How could you betray us, your brothers? Very well, you are no longer our brother! We cast you out in the name of Triol! May the rest of your days be filled with pain and agony... [31517-4.htm] Hierarch: Yoy've done well! Welcome to the brotherhood! You're now a member of the Benandanti Cartel! I'll see that you're well-rewarded! [altar_nocrystal.htm] Evil Altar: There is space at the altar, but the crystal is missing. You must return to the Hierarch.
Исходник условий и наград (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.Q00016_TheComingDarkness;

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;

public class Q00016_TheComingDarkness extends Quest
{
	// NPCs
	private static final int HIERARCH = 31517;
	private static final int EVIL_ALTAR_1 = 31512;
	private static final int EVIL_ALTAR_2 = 31513;
	private static final int EVIL_ALTAR_3 = 31514;
	private static final int EVIL_ALTAR_4 = 31515;
	private static final int EVIL_ALTAR_5 = 31516;
	
	// Item
	private static final int CRYSTAL_OF_SEAL = 7167;
	
	public Q00016_TheComingDarkness()
	{
		super(16, "The Coming Darkness");
		registerQuestItems(CRYSTAL_OF_SEAL);
		addStartNpc(HIERARCH);
		addTalkId(HIERARCH, EVIL_ALTAR_1, EVIL_ALTAR_2, EVIL_ALTAR_3, EVIL_ALTAR_4, EVIL_ALTAR_5);
	}
	
	@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 "31517-2.htm":
			{
				st.startQuest();
				giveItems(player, CRYSTAL_OF_SEAL, 5);
				break;
			}
			case "31512-1.htm":
			{
				st.setCond(2, true);
				takeItems(player, CRYSTAL_OF_SEAL, 1);
				break;
			}
			case "31513-1.htm":
			{
				st.setCond(3, true);
				takeItems(player, CRYSTAL_OF_SEAL, 1);
				break;
			}
			case "31514-1.htm":
			{
				st.setCond(4, true);
				takeItems(player, CRYSTAL_OF_SEAL, 1);
				break;
			}
			case "31515-1.htm":
			{
				st.setCond(5, true);
				takeItems(player, CRYSTAL_OF_SEAL, 1);
				break;
			}
			case "31516-1.htm":
			{
				st.setCond(6, true);
				takeItems(player, CRYSTAL_OF_SEAL, 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() < 62) ? "31517-0a.htm" : "31517-0.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				final int npcId = npc.getId();
				
				switch (npcId)
				{
					case HIERARCH:
					{
						if (cond == 6)
						{
							htmltext = "31517-4.htm";
							addExpAndSp(player, 221958, 0);
							st.exitQuest(false, true);
						}
						else
						{
							if (hasQuestItems(player, CRYSTAL_OF_SEAL))
							{
								htmltext = "31517-3.htm";
							}
							else
							{
								htmltext = "31517-3a.htm";
								st.exitQuest(true);
							}
						}
						break;
					}
					case EVIL_ALTAR_1:
					case EVIL_ALTAR_2:
					case EVIL_ALTAR_3:
					case EVIL_ALTAR_4:
					case EVIL_ALTAR_5:
					{
						final int condAltar = npcId - 31511;
						if (cond == condAltar)
						{
							if (hasQuestItems(player, CRYSTAL_OF_SEAL))
							{
								htmltext = npcId + "-0.htm";
							}
							else
							{
								htmltext = "altar_nocrystal.htm";
							}
						}
						else if (cond > condAltar)
						{
							htmltext = npcId + "-2.htm";
						}
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
}