ZURSULUS L2

Light and Darkness

ID
17
Название
Light and Darkness
start_npcs_json
[31517]
npc_ids_json
[31508,31509,31510,31511,31517]
constants_json
{"HIERARCH":31517,"SAINT_ALTAR_1":31508,"SAINT_ALTAR_2":31509,"SAINT_ALTAR_3":31510,"SAINT_ALTAR_4":31511,"BLOOD_OF_SAINT":7168}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00017_LightAndDarkness/Q00017_LightAndDarkness.java

NPC квеста

IDНазваниеСтарт квестаУровень
31508Altar of SaintsНет70
31509Altar of SaintsНет70
31510Altar of SaintsНет70
31511Altar of SaintsНет70
31517HierarchДа70

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

htmltext = (player.getLevel() < 61) ? "31517-03.htm" : "31517-01.htm";

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

giveItems(player, BLOOD_OF_SAINT, 4);
addExpAndSp(player, 105527, 0);

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

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

[31508-01.htm] Altar of Saints: The first Altar of Saints has a desolate atmosphere. You know that you need to sprinkle the Blood of Saint here, but you feel apprehensive. You begin to feel faint... Sprinkle the Blood of Saint. [31508-02.htm] Altar of Saints: The Blood of Saint you sprinkled on the Altar of Saints quickly disappeared. You're starting to feel better now. It's time to move on! [31508-03.htm] Altar of Saints: Behold, the Altar of Saints! As instructed, you put your hand your pocket to prepare to sprinkle the blood, and... The Blood of Saint is gone! Did you lose it on your way here? This is terrible! [31508-04.htm] Altar of Saints: An Altar of Saints that has lost its power. All traces of purity have disappeared. Hurry along, much remains to be done. [31509-01.htm] Altar of Saints: The second Altar of Saints. The atmosphere is similar to that of the previous altar. You know that you should sprinkle the Blood of Saint here as you were told, but you're hesitant... You begin to feel faint... Sprinkle the Blood of Saint. [31509-02.htm] Altar of Saints: The Altar of Saints reacts to the Blood of Saint. You're starting to feel better. The altar appears depleted. It's time to move on. [31509-03.htm] Altar of Saints: Behold, the Altar of Saints! As instructed, you put your hand in your pocket to prepare to sprinkle the blood, and... The Blood of Saint is gone! Did you lose it on your way here? This is terrible! [31509-04.htm] Altar of Saints: The altar is depleted of its power. Its former atmosphere of purity has dissipated. Only two more altars to go. [31510-01.htm] Altar of Saints: At last, the third Altar of Saints! No less forbidding than the first two! Sprinkle the Blood of Saint. [31510-02.htm] Altar of Saints: The Altar of Saints reacts. It seems the Blood of Saint has relieved the altar of its purity. One more altar to go. [31510-03.htm] Altar of Saints: Behold, the Altar of Saints! As instructed, you put your hand in your pocket to prepare to sprinkle the blood, and... The Blood of Saint is gone! Perhaps you lost it on your way here. What shall you do?! [31510-04.htm] Altar of Saints: The altar is depleted of its power. Its former purity is gone. One more altar to go. [31511-01.htm] Altar of Saints: The last Altar of Saints looks the same as the others. You're starting to feel more comfortable. That could be good or bad! Sprinkle the Blood of Saint. [31511-02.htm] Altar of Saints: The Altar of Saints is behaving strangely. This is getting tiresome. It seems that I'm changed a lot. Time to go back and see the elder. [31511-03.htm] Altar of Saints: Behold, the Altar of Saints! As instructed, you put your hand in your pocket to prepare to sprinkle the blood, and... The Blood of Saint is gone! Perhaps you lost it on your way here. What shall you do?! [31511-04.htm] Altar of Saints: The altar is depleted of its power. Its former purity has dissipated. The quest is complete. Return to the elder. [31517-01.htm] Hierarch: You have been with us for quite some time! You've earned our trust, and therefore I believe you are ready for an important mission! Are you up to the task? "What do you need done?" [31517-02.htm] Hierarch: Before I tell you, I need to ask you something. How strong is your faith in the work that we do? Are you certain that you can persevere no matter what happens while carrying out this mission? "I will persevere." [31517-03.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 61 and above.) [31517-04.htm] Hierarch: Very well, then. Listen carefully! Go to the Altar of Saints, sprinkle this Blood of Saint on it and then come back. You may think that this sounds simple... But I warn you... Unless your faith in us is very strong, you won't complete this mission! So go sprinkle the blood on the Altar of Saints! You can see it from the path by the entrance to the Valley of Saints. Don't get lost on your way there! May Triol watch over you... [31517-05.htm] Hierarch: You haven't finished your mission. Come back when you're done. [31517-06.htm] Hierarch: Where is the Blood of Saint I gave you? How could you betray our trust like that?! You are no longer our brother! Get out! We cast you out in the name of Triol! May your remaining days be full of terrible pain and suffering... [31517-07.htm] Hierarch: Well done! Our trust in you has proven well placed thus far. Someday, perhaps, you will truly be one of us. Congratulations!
Исходник условий и наград (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.Q00017_LightAndDarkness;

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 Q00017_LightAndDarkness extends Quest
{
	// NPCs
	private static final int HIERARCH = 31517;
	private static final int SAINT_ALTAR_1 = 31508;
	private static final int SAINT_ALTAR_2 = 31509;
	private static final int SAINT_ALTAR_3 = 31510;
	private static final int SAINT_ALTAR_4 = 31511;
	
	// Items
	private static final int BLOOD_OF_SAINT = 7168;
	
	public Q00017_LightAndDarkness()
	{
		super(17, "Light and Darkness");
		registerQuestItems(BLOOD_OF_SAINT);
		addStartNpc(HIERARCH);
		addTalkId(HIERARCH, SAINT_ALTAR_1, SAINT_ALTAR_2, SAINT_ALTAR_3, SAINT_ALTAR_4);
	}
	
	@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-04.htm":
			{
				st.startQuest();
				giveItems(player, BLOOD_OF_SAINT, 4);
				break;
			}
			case "31508-02.htm":
			{
				if (hasQuestItems(player, BLOOD_OF_SAINT))
				{
					st.setCond(2, true);
					takeItems(player, BLOOD_OF_SAINT, 1);
				}
				else
				{
					htmltext = "31508-03.htm";
				}
				break;
			}
			case "31509-02.htm":
			{
				if (hasQuestItems(player, BLOOD_OF_SAINT))
				{
					st.setCond(3, true);
					takeItems(player, BLOOD_OF_SAINT, 1);
				}
				else
				{
					htmltext = "31509-03.htm";
				}
				break;
			}
			case "31510-02.htm":
			{
				if (hasQuestItems(player, BLOOD_OF_SAINT))
				{
					st.setCond(4, true);
					takeItems(player, BLOOD_OF_SAINT, 1);
				}
				else
				{
					htmltext = "31510-03.htm";
				}
				break;
			}
			case "31511-02.htm":
			{
				if (hasQuestItems(player, BLOOD_OF_SAINT))
				{
					st.setCond(5, true);
					takeItems(player, BLOOD_OF_SAINT, 1);
				}
				else
				{
					htmltext = "31511-03.htm";
				}
				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() < 61) ? "31517-03.htm" : "31517-01.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case HIERARCH:
					{
						if (cond == 5)
						{
							htmltext = "31517-07.htm";
							addExpAndSp(player, 105527, 0);
							st.exitQuest(false, true);
						}
						else
						{
							if (hasQuestItems(player, BLOOD_OF_SAINT))
							{
								htmltext = "31517-05.htm";
							}
							else
							{
								htmltext = "31517-06.htm";
								st.exitQuest(true);
							}
						}
						break;
					}
					case SAINT_ALTAR_1:
					{
						if (cond == 1)
						{
							htmltext = "31508-01.htm";
						}
						else if (cond > 1)
						{
							htmltext = "31508-04.htm";
						}
						break;
					}
					case SAINT_ALTAR_2:
					{
						if (cond == 2)
						{
							htmltext = "31509-01.htm";
						}
						else if (cond > 2)
						{
							htmltext = "31509-04.htm";
						}
						break;
					}
					case SAINT_ALTAR_3:
					{
						if (cond == 3)
						{
							htmltext = "31510-01.htm";
						}
						else if (cond > 3)
						{
							htmltext = "31510-04.htm";
						}
						break;
					}
					case SAINT_ALTAR_4:
					{
						if (cond == 4)
						{
							htmltext = "31511-01.htm";
						}
						else if (cond > 4)
						{
							htmltext = "31511-04.htm";
						}
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
}