ZURSULUS L2

Hidden Truth

ID
21
Название
Hidden Truth
start_npcs_json
[31522]
npc_ids_json
[31328,31348,31349,31350,31522,31523,31524,31525,31526]
constants_json
{"MYSTERIOUS_WIZARD":31522,"TOMBSTONE":31523,"VON_HELLMAN_DUKE":31524,"VON_HELLMAN_PAGE":31525,"BROKEN_BOOKSHELF":31526,"AGRIPEL":31348,"DOMINIC":31350,"BENEDICT":31349,"INNOCENTIN":31328,"CROSS_OF_EINHASAD":7140,"CROSS_OF_EINHASAD_NEXT_QUEST":7141}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00021_HiddenTruth/Q00021_HiddenTruth.java

NPC квеста

IDНазваниеСтарт квестаУровень
31328InnocentinНет70
31348AgripelНет70
31349BenedictНет70
31350DominicНет70
31522Mysterious WizardДа70
31523TombstoneНет70
31524Ghost of von HellmannНет70
31525Ghost of von Hellmann's PageНет70
31526Broken BookshelfНет70

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

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

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

giveItems(player, CROSS_OF_EINHASAD, 1);
giveItems(player, CROSS_OF_EINHASAD_NEXT_QUEST, 1);

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

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

[31328-01.htm] Innocentin: You came all this way just to find me? Yes, I was once a high priest, until some unfortunate political developments landed me here in this blasted library! But lately, I've seen signs that my luck might be changing... "Check out this crucifix!" [31328-02.htm] Innocentin: Zounds! Where did you find this? "Truthfully, ..." [31328-03.htm] Innocentin: He was always a dutiful Warrior, even after his death... may the gods watch over his soul! ... Why would he have you deliver this to me in person? Lately I've been having the same dream every night... "What is in your dream?" [31328-04.htm] Innocentin: In my dream, I'm looking down upon the Forest of the Dead... Suddenly, huge explosions rock the forest, and an army of undead rush towards me... This is bound to be a message from the gods! That's why I sent the one who held this crucifix there! "But he's dead!" [31328-05.htm] Innocentin: I've learned much of the ways of the wild since my days at the temple. In times like these, dead souls must be appeased! Take this crucifix to Grand Magister Tifaren of the Dark Elves and ask him to perform necromancy. He should be able to tell us what actually happened in the Forest of the Dead... [31328-06.htm] Innocentin: Take the crucifix to Grand Magister Tifaren of the Dark Elves and perform the necromancy to summon the soul of the priest. Ask him what happened in the Forest of the Dead... [31348-01.htm] High Priest Agripel: Maybe he was the guy who long ago was expelled for keeping a devil worshipper with him! He's probably a beggar now. I don't waste my time on such filth. [31349-01.htm] Benedict: Maybe the devil worshippers are hiding in a library somewhere, they still need to acquire knowledge. They couldn't be here in the temple! [31350-01.htm] Dominic: Is Innocentin one of those devil worshippers executed in the old witch trials? I never heard of him, ask someone else. [31522-01.htm] Mysterious Wizard: There's a ghost hanging around that tombstone that's been bothering me lately. Could you help me get rid of it? "I'll handle it." "Why is it bothering you?" [31522-02.htm] Mysterious Wizard: You think you're up to it? Look for the ghost in the tombstone. [31522-03.htm] Mysterious Wizard: Come back when the Forest of the Dead won't eat you alive! (This quest may only be undertaken by a character of level 63 and above.) [31522-04.htm] Mysterious Wizard: It may sound funny coming from a Dark Mage, but I don't like dealing with the dead. It's only trouble. Back [31522-05.htm] Mysterious Wizard: What's this? Weren't you supposed to check the tombstone for that noisy ghost? [31523-01.htm] Tombstone: After pushing away the moss, words appear engraved upon the stone. Could these words be used to conjure a ghost? Say the words loudly. [31523-02.htm] Tombstone: A jeweled scepter for the King and two Silver Spears for the von Hellmann family who protect him. Wait. [31523-03.htm] Tombstone: Soon a ghostly being appears... [31523-04.htm] Tombstone: Don't look now, but there's a ghost behind you! [31524-01.htm] Ghost of von Hellmann: Who is calling me? Why am I stuck here? Why can't I sleep? "Who are you? What's wrong?" [31524-02.htm] Ghost of von Hellmann: I'm Duke Adolf von Hellmann, father of Alfred von Hellmann, who King Astor struck down with his spear. Why can't I rest in peace?! Who dares interrupt my sleep? "Tell me more." [31524-03.htm] Ghost of von Hellmann: Woe is me! This was once our home, but now we have no authority! Does this land still belong to the Elmore Kingdom? "Elmore still rules here." [31524-04.htm] Ghost of von Hellmann: Elmore? Why can't I feel the King's grace? What's happened here? "I don't know." [31524-05.htm] Ghost of von Hellmann: Find out what happened here and who has owned this land while I was sleeping! What's become of my family? "I'll find out." [31524-06.htm] Ghost of von Hellmann: Thank you. Find out what has transpired! Follow my servant and bring me the news! [31524-07.htm] Ghost of von Hellmann: I've repeatedly sent my servants to help you! Find the bookshelf that contains the history of the forest. It's somewhere in the south. [31524-07a.htm] Ghost of von Hellmann: You haven't found out enough to tell me why I can't rest in peace! Be gone! [31525-01.htm] Ghost of von Hellmann's Page: I'm a guide of the Forest of the Dead. By the Lord's order, I'll lead you. [31525-02.htm] Ghost of von Hellmann's Page: Find a book that discusses an old grudge. [31526-00.htm] Broken Bookshelf: The book that the ghost spoke of was easily found. The padlock was firmly locked. Examine the padlock. Take the book from the sheif. [31526-01.htm] Broken Bookshelf: The book that the ghost spoke of was easily found. The padlock was firmly locked. Examine the padlock. Take the book from the shelf. [31526-02.htm] Broken Bookshelf: The padlock is engraved with the mark of the Hellmann family. In spite of it's many years outside, once the outer layer of dust and soil is brushed away, it shines silvery in the light! This lock won't be easy to break. Return [31526-03.htm] Broken Bookshelf: The book's cover is lambskin that's been discolored by dark, red-colored stains. Try opening the book. [31526-04.htm] Broken Bookshelf: The dark red stains have damaged the pages of the book as well. Not much text is legible. All the years outside couldn't have helped, either! Do you want to read it? Try to read the book. [31526-05.htm] "Chapter 5, The Lord of the Forest of the Dead ... The lord of the Forest of the Dead... has existed from the beginning of... ... the ruling is, ... the form of taxation... ... rather than that, life and death itself... under the ruling authority..." Turn the page. [31526-06.htm] "Basically, to her, taxation means... no different from... Due to... who's the master of the Moon Face Flower and the Forest of the Dead... went under her... are vampires ... this is.... when examining the characteristics of..... sucking... by that one's power... that is... necessary to the subordinate of the lord of the forest..." Turn the page. [31526-07.htm] ".... vampire.............. of the Forest of Dead............... ............... cursed............... working at..............." The rest of the text is obscured by the red stains. Put the book back onto the shelf. [31526-08.htm] Broken Bookshelf: When you're about to replace the book, you notice something lying on the ground. Maybe it fell out of the book... Examine the object closely. [31526-09.htm] Broken Bookshelf: While examining the bookshelf, you notice something lying on the ground. Maybe it fell out of the book. Examine the object closely. [31526-10.htm] Broken Bookshelf: When you're about to replace the book, you notice something lying on the ground. Maybe it fell out of the book. Examine the object closely. [31526-11.htm] Broken Bookshelf: While examining the area around the bookshelf, you see something lying on the ground. Perhaps it fell when you were taking out the book. Examine the object closely. [31526-12.htm] Broken Bookshelf: It's a metallic cross. It seems to be an Einhasad's Crucifix! Pick up the cross. Ignore the cross. [31526-13.htm] Broken Bookshelf: An old bookshelf is standing in front of you. It's extremely worn, and the lower section is used as a locker. A few books are arranged on the shelves, and the locker is secured with a padlock which bears the mark of the Hellmann Family. Take out a book and read it. Examine the area around the bookshelf. [31526-14.htm] Broken Bookshelf: You feel the cold metallic surface of the Einhasad's Crucifix. Since it's been inside the bookshelf for a long time, it's a little rusty. At the moment you touch the crucifix, you hear a whisper in your ear! Take it to Einhasad Temple in Rune Castle Town... to Priest Innocentin there... [31526-15.htm] Broken Bookshelf: You feel the cold metallic surface of the Einhasad's Crucifix. Since it's been inside the bookshelf for a long time, it's a little rusty. At the moment you touch the crucifix, you hear a whisper in your ear! Take it to Einhasad Temple in Rune Castle Town... to Priest Innocentin there...
Исходник условий и наград (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.Q00021_HiddenTruth;

import org.l2jmobius.gameserver.entity.Location;
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.network.enums.ChatType;

public class Q00021_HiddenTruth extends Quest
{
	// NPCs
	private static final int MYSTERIOUS_WIZARD = 31522;
	private static final int TOMBSTONE = 31523;
	private static final int VON_HELLMAN_DUKE = 31524;
	private static final int VON_HELLMAN_PAGE = 31525;
	private static final int BROKEN_BOOKSHELF = 31526;
	private static final int AGRIPEL = 31348;
	private static final int DOMINIC = 31350;
	private static final int BENEDICT = 31349;
	private static final int INNOCENTIN = 31328;
	
	// Items
	private static final int CROSS_OF_EINHASAD = 7140;
	private static final int CROSS_OF_EINHASAD_NEXT_QUEST = 7141;
	
	private static final Location[] PAGE_LOCS =
	{
		new Location(51992, -54424, -3160),
		new Location(52328, -53400, -3160),
		new Location(51928, -51656, -3096)
	};
	
	private Npc _duke;
	private Npc _page;
	
	public Q00021_HiddenTruth()
	{
		super(21, "Hidden Truth");
		registerQuestItems(CROSS_OF_EINHASAD);
		addStartNpc(MYSTERIOUS_WIZARD);
		addTalkId(MYSTERIOUS_WIZARD, TOMBSTONE, VON_HELLMAN_DUKE, VON_HELLMAN_PAGE, BROKEN_BOOKSHELF, AGRIPEL, DOMINIC, BENEDICT, INNOCENTIN);
	}
	
	@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 "31522-02.htm":
			{
				st.startQuest();
				break;
			}
			case "31523-03.htm":
			{
				st.setCond(2, true);
				spawnTheDuke(player);
				break;
			}
			case "31524-06.htm":
			{
				st.setCond(3, true);
				spawnThePage(player);
				break;
			}
			case "31526-08.htm":
			{
				st.setCond(5, true);
				break;
			}
			case "31526-14.htm":
			{
				st.setCond(6, true);
				giveItems(player, CROSS_OF_EINHASAD, 1);
				break;
			}
			case "1":
			{
				_page.getAI().setIntentionMoveTo(PAGE_LOCS[0]);
				_page.broadcastSay(ChatType.GENERAL, "Follow me...");
				startQuestTimer("2", 5000, _page, player, false);
				return null;
			}
			case "2":
			{
				_page.getAI().setIntentionMoveTo(PAGE_LOCS[1]);
				startQuestTimer("3", 12000, _page, player, false);
				return null;
			}
			case "3":
			{
				_page.getAI().setIntentionMoveTo(PAGE_LOCS[2]);
				startQuestTimer("4", 18000, _page, player, false);
				return null;
			}
			case "4":
			{
				st.set("end_walk", "1");
				_page.broadcastSay(ChatType.GENERAL, "Please check this bookcase, " + player.getName() + ".");
				startQuestTimer("5", 47000, _page, player, false);
				return null;
			}
			case "5":
			{
				_page.broadcastSay(ChatType.GENERAL, "I'm confused! Maybe it's time to go back.");
				return null;
			}
			case "31328-05.htm":
			{
				if (hasQuestItems(player, CROSS_OF_EINHASAD))
				{
					takeItems(player, CROSS_OF_EINHASAD, 1);
					giveItems(player, CROSS_OF_EINHASAD_NEXT_QUEST, 1);
					st.exitQuest(false, true);
				}
				break;
			}
			case "dukeDespawn":
			{
				_duke.deleteMe();
				_duke = null;
				return null;
			}
			case "pageDespawn":
			{
				_page.deleteMe();
				_page = null;
				return null;
			}
		}
		
		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() < 63) ? "31522-03.htm" : "31522-01.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case MYSTERIOUS_WIZARD:
					{
						htmltext = "31522-05.htm";
						break;
					}
					case TOMBSTONE:
					{
						if (cond == 1)
						{
							htmltext = "31523-01.htm";
						}
						else if ((cond == 2) || (cond == 3))
						{
							htmltext = "31523-04.htm";
							spawnTheDuke(player);
						}
						else if (cond > 3)
						{
							htmltext = "31523-04.htm";
						}
						break;
					}
					case VON_HELLMAN_DUKE:
					{
						if (cond == 2)
						{
							htmltext = "31524-01.htm";
						}
						else if (cond == 3)
						{
							htmltext = "31524-07.htm";
							spawnThePage(player);
						}
						else if (cond > 3)
						{
							htmltext = "31524-07a.htm";
						}
						break;
					}
					case VON_HELLMAN_PAGE:
					{
						if (cond == 3)
						{
							if (st.getInt("end_walk") == 1)
							{
								htmltext = "31525-02.htm";
								st.setCond(4, true);
							}
							else
							{
								htmltext = "31525-01.htm";
							}
						}
						else if (cond == 4)
						{
							htmltext = "31525-02.htm";
						}
						break;
					}
					case BROKEN_BOOKSHELF:
					{
						if (((cond == 3) && (st.getInt("end_walk") == 1)) || (cond == 4))
						{
							htmltext = "31526-01.htm";
							st.setCond(5, true);
							
							if (_page != null)
							{
								cancelQuestTimer("5", _page, player);
								cancelQuestTimer("pageDespawn", _page, player);
								_page.deleteMe();
								_page = null;
							}
							
							if (_duke != null)
							{
								cancelQuestTimer("dukeDespawn", _duke, player);
								_duke.deleteMe();
								_duke = null;
							}
						}
						else if (cond == 5)
						{
							htmltext = "31526-10.htm";
						}
						else if (cond > 5)
						{
							htmltext = "31526-15.htm";
						}
						break;
					}
					case AGRIPEL:
					case BENEDICT:
					case DOMINIC:
					{
						if (((cond == 6) || (cond == 7)) && hasQuestItems(player, CROSS_OF_EINHASAD))
						{
							final int npcId = npc.getId();
							
							// For cond 6, make checks until cond 7 is activated.
							if (cond == 6)
							{
								int npcId1 = 0;
								int npcId2 = 0;
								if (npcId == AGRIPEL)
								{
									npcId1 = BENEDICT;
									npcId2 = DOMINIC;
								}
								else if (npcId == BENEDICT)
								{
									npcId1 = AGRIPEL;
									npcId2 = DOMINIC;
								}
								else if (npcId == DOMINIC)
								{
									npcId1 = AGRIPEL;
									npcId2 = BENEDICT;
								}
								
								if ((st.getInt(String.valueOf(npcId1)) == 1) && (st.getInt(String.valueOf(npcId2)) == 1))
								{
									st.setCond(7, true);
								}
								else
								{
									st.set(String.valueOf(npcId), "1");
								}
							}
							
							htmltext = npcId + "-01.htm";
						}
						break;
					}
					case INNOCENTIN:
					{
						if ((cond == 7) && hasQuestItems(player, CROSS_OF_EINHASAD))
						{
							htmltext = "31328-01.htm";
						}
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				if (npc.getId() == INNOCENTIN)
				{
					htmltext = "31328-06.htm";
				}
				else
				{
					htmltext = getAlreadyCompletedMsg(player);
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	private void spawnTheDuke(Player player)
	{
		if (_duke == null)
		{
			_duke = addSpawn(VON_HELLMAN_DUKE, 51432, -54570, -3136, 0, false, 0);
			_duke.broadcastSay(ChatType.GENERAL, "Who awoke me?");
			startQuestTimer("dukeDespawn", 300000, _duke, player, false);
		}
	}
	
	private void spawnThePage(Player player)
	{
		if (_page == null)
		{
			_page = addSpawn(VON_HELLMAN_PAGE, 51608, -54520, -3168, 0, false, 0);
			_page.broadcastSay(ChatType.GENERAL, "My master has instructed me to be your guide, " + player.getName() + ".");
			startQuestTimer("1", 4000, _page, player, false);
			startQuestTimer("pageDespawn", 90000, _page, player, false);
		}
	}
}