ZURSULUS L2

Inhabitants of the Forest of the Dead

ID
24
Название
Inhabitants of the Forest of the Dead
start_npcs_json
[31389]
npc_ids_json
[31389,31522,31531,31532]
constants_json
{"DORIAN":31389,"WIZARD":31522,"TOMBSTONE":31531,"MAID_OF_LIDIA":31532,"LETTER":7065,"HAIRPIN":7148,"TOTEM":7151,"FLOWER":7152,"SILVER_CROSS":7153,"BROKEN_SILVER_CROSS":7154,"SUSPICIOUS_TOTEM":7156}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00024_InhabitantsOfTheForestOfTheDead/Q00024_InhabitantsOfTheForestOfTheDead.java

NPC квеста

IDНазваниеСтарт квестаУровень
31389DorianДа70
31522Mysterious WizardНет70
31531TombstoneНет70
31532Maid of LidiaНет70

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

if ((st2 != null) && st2.isCompleted() && (player.getLevel() >= 65))

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

giveItems(player, FLOWER, 1);
giveItems(player, SILVER_CROSS, 1);
giveItems(player, SUSPICIOUS_TOTEM, 1);
giveItems(player, LETTER, 1);
giveItems(player, HAIRPIN, 1);
giveItems(player, BROKEN_SILVER_CROSS, 1);
giveItems(player, TOTEM, 1);

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

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

[31389-01.htm] Dorian: Are you the one who recovered the Silver Spear? Your reputation precedes you! Actually, I have a problem you may be able to help me with! Would you be willing to help me? "I'll do it!" [31389-02.htm] Dorian: Oh...? Was it really you who recovered the Silver Spear? I must have misjudged you! I thought you were more experienced... (Only a character of level 65 or above who has fulfilled the Lidia's Heart quest can undertake this quest.) [31389-03.htm] Dorian: Every day I place a flower in front of a tombstone on my way to the castle in the south part of the village, but I've been having severe pains in my legs all day! Would you place this flower in front of the tombstone for me? [31389-04.htm] Dorian: Please place a flower in front of the tombstone in the southern part of the village. I'll tell you the rest of the story when you come back. [31389-05.htm] Dorian: Did you place the flower at the tombstone? Did you notice who was buried in that grave? Nidrah Lidia Rose [31389-06.htm] Dorian: Did you really put the flower there? This task requires someone with keen observation and insight, not someone who could not even look upon the grave! I hoped that it was you who would recover the Silver Spear... [31389-07.htm] Dorian: Did you really put the flower there? This task requires someone with keen observation and insight, not someone who could not even look upon the grave! I hoped that it was you who would recover the Silver Spear... [31389-08.htm] Dorian: Yes! Rose rests there... She was the maid Mr. Alfred, my former master, assigned to his daughter. They were about the same age. "Who is Alfred's daughter?" [31389-09.htm] Dorian: Yes! Rose rests there... She was the maid Mr. Alfred, my former master, assigned to his daughter. They were about the same age. "Who is Alfred's daughter?" [31389-10.htm] Dorian: Why, she's Lady Lidia, current lord of this manor! She thought highly of Rose, and didn't want her coming back as an undead! Lady Lidia graciously allowed Rose to rest in peace. That's better than most others get around here! "How did Rose earn such a privilege?" [31389-11.htm] Dorian: I don't know, exactly. All I know is, my fiance was with Lady Lidia, and died protecting her! Anyway, thank you for taking the flower to Rose's grave. "It's the least I could do." [31389-12.htm] Dorian: Oh, don't be so modest! You remembered Rose's name! And you asked such respectful questions! You're obviously a wonderful person! Do you suppose you could do something else for me? Recently my nights have been dreamless, and I've woken up with wounds that I don't remember getting! Something strange is going on in this village! Will you investigate? "Yes, I will." [31389-13.htm] Dorian: Excellent! Take this crucifix, just in case! This forest is very dangerous, you never know what might jump out at you! Please observe the village and try to determine what is going on there at night! [31389-14.htm] Dorian: Observe the village closely. Help me figure out what's going on here! [31389-15.htm] Dorian: I can't remember last night at all, and I'm exhausted! Have you discovered anything? "There's a vampire!" "The villagers are changing into monsters!" [31389-16.htm] Dorian: A vampire, eh?! Hmm... I see. Is the lord of the manor coming down here making the rounds? Hmm...Why am I so tired then? "I'll tell you why! Because you're the vampire!" [31389-16a.htm] Dorian: Don't you dare compare me to those idiots in the village! A monster, eh? And it only comes out at night? "That's right!" [31389-17.htm] Dorian: Nooo! It can't be! Me? A vampire? It's true that the lord of the manor I serve is an undead... But that doesn't mean I'm a vampire! "Check out this crucifix!" [31389-18.htm] Dorian: I gave you that! ...I see. Now I remember... Young master Einhart and... and... you! You were standing there... holding the holy symbol! Now I know... why the lord gave me such an order! "What order?" [31389-19.htm] Dorian: This has all been a test! The lord himself ordered it! I think you might have something that belongs to him! Go to a bookshelf in the southwest part of the forest, you'll meet the maid of the lord. She only appears at night. [31389-20.htm] Dorian: So, you haven't met the maid of our lord yet? Remember, she only appears at night. Naturally, things get pretty scary around here after dark... You should really be careful! But I'm sure you can handle it! Go to the bookshelf in the southwest part of the forest, the maid of the lord will be there. Meet her there at night! [31389-21.htm] Dorian: Oh, come in! Say, you must've dropped this the last time you were here! It looks very valuable! You should keep it in a safe place. [31389-22.htm] Dorian: Did you see the maid of the lord? I have no memories after dark, so I have no idea what she's like! I've heard that she's quite beautiful! I was even told that she resembles my fiance! At least she's... alive! What a privilege, even if it's only during the day! Oh, well, I shouldn't be talking about this... [31522-01.htm] Mysterious Wizard: Long time no see. Things sure are quiet these days! "What do you know about an odd doll?" [31522-02.htm] Mysterious Wizard: What are you talking about? "Look at this!" [31522-03.htm] Mysterious Wizard: Oh, that. It's an amulet to help my puppets collect bone pieces in the forest without getting hurt. "That's not what I heard." [31522-04.htm] Mysterious Wizard: It may look a little odd, but it's just an amulet. "That's not what I heard." [31522-05.htm] Mysterious Wizard: What did you hear? "That it's related to Wizard Nidrah." [31522-06.htm] Mysterious Wizard: Where did you hear the name Nidrah? "From the person who told me to see you about the doll." [31522-07.htm] Mysterious Wizard: So, you're under the protection of Lady Lidia. We've signed a mutual contract not to harm each other. This doll was made by Nidrah, and tells the Lord of the Forest of the Dead not to attack its bearer. "How did you get it?" [31522-08.htm] Mysterious Wizard: This much I can tell you. I'm a Dark Mage, that's how I got it! You just can't tell the future, can you? Come back when you have more confidence in me. [31522-09.htm] Mysterious Wizard: You trust me now? Tell me about Nidrah! "Allright, I'll tell you." [31522-10.htm] Mysterious Wizard: So tell me! "You're gathering materials for the dark arts." "You signed a contract." [31522-11.htm] Mysterious Wizard: Where is your proof? "Lady Lidia controls all the dead of this earth, a power nearly equal to a god's! One must be granted authority by her to have power over the dead in any capacity." [31522-12.htm] Mysterious Wizard: So? "Nobody is allowed here without permission. That you're here means you have power at least equal to the Lord of the Forest of the Dead." [31522-13.htm] Mysterious Wizard: So I made a mistake. What's wrong with that? "It's impossible to have a real nonaggression contract in this situation!" [31522-14.htm] Mysterious Wizard: History is filled with such contracts. Do you know why? "Nonaggression contracts are signed between two equal powers. It stays in effect only as long as it benefits them. If one party becomes weaker, the contract is nullified." [31522-15.htm] Mysterious Wizard: Go on. "The Lord of the Dead has absolute power here, why would she sign a contract with you? You must have power equal to hers, or else she reaps some benefit from not fighting you." [31522-16.htm] Mysterious Wizard: You think I have something to do with Nidrah? "Yes." [31522-17.htm] Mysterious Wizard: Let's say for arguments sake that I'm Nidrah. What difference would that make? "Here's the missing page from the diary." [31522-18.htm] Mysterious Wizard: Let's say for arguments sake that I'm Nidrah. What difference would that make? "Here's the missing page from the diary." [31522-19.htm] Mysterious Wizard: You found the diary! You're tracking Nidrah. Going further may be difficult, you're following a dangerous man. If you insist, you'll need the key. "Key?" [31522-20.htm] Mysterious Wizard: The Priest of the Rune Township has the key. I'll give you the doll, it represents the person who carried the real authority in the Hellmann Forest and Rune Territory, even over Lidia. "Who is it?" [31522-21.htm] Mysterious Wizard: I can't tell you, but you may find out soon. Come on, show the doll to the priest at the temple of the Rune Township. Ask him about the one who hides behind the truth. [31522-22.htm] Mysterious Wizard: Visit the temple of the Rune Township if you want to learn more about them. Ask about the one who hides the truth... [31531-01.htm] Tombstone: Here lies Rose, a faithful, loving servant. May she rest in peace. Place flowers on the grave. [31531-02.htm] Tombstone: You've placed flowers on the grave. [31531-03.htm] Tombstone: The tombstone bears an epitaph: Here lies Rose, a faithful and loving servant. May she rest in peace. Moon Face Flowers bloom brilliantly around the tomb. [31532-01.htm] Maid of Lidia: My lady thanks you for recovering the Silver Spear. It's a family treasure. "I was doing my duty." [31532-02.htm] Maid of Lidia: She knows how you helped her ancestors rest in peace. My lady knows all that happens in her forest! "Everything?" [31532-03.htm] Maid of Lidia: My lady knows everything about your journeys here. She hopes you'll uncover all the details of what has transpired. "Please continue." [31532-04.htm] Maid of Lidia: Come back after reading this letter from my lady. [31532-05.htm] Maid of Lidia: I don't know what it says, I wouldn't dream of reading the letter meant for my lord! I was told you had something for me? "Here's the hairpin." [31532-06.htm] Maid of Lidia: This is Nidrah's work, a hairpin of Moon Face Flower. How beautiful! I must go now. "Wait!" [31532-07.htm] Maid of Lidia: Oh no! Could you have dropped it in the village? Take the letter with you and ask around for it. Meet me again tomorrow night. [31532-07a.htm] Maid of Lidia: Do you have something for me? "Here's the hairpin." [31532-08.htm] Maid of Lidia: What is it? "What do you know about Nidrah?" [31532-09.htm] Maid of Lidia: What is it? "Tell me everything you know about Nidrah!" [31532-10.htm] Maid of Lidia: Did I say Nidrah? What do you know of the name? "It's a tree." "It's a corpse." "It's a Mystic." [31532-11.htm] Maid of Lidia: Did I say Nidrah? What do you know of the name? "It's a tree." "It's a corpse." "It's a Mystic." [31532-12.htm] Maid of Lidia: Perhaps there is a tree with that name. Why would you think I had anything to do with this? [31532-13.htm] Maid of Lidia: This manor is covered in corpses. This is the Forest of the Dead. Why do you keep asking about it? [31532-14.htm] Maid of Lidia: What kind of Mystic was he? "A Mystic of Dark Arts!" [31532-15.htm] Maid of Lidia: Oh! Only Lord Alfred and Lady Lidia know. Even Einhalder thinks he's an ordinary Mystic! How do you know of this? "I read the diary." "How do you know?" [31532-16.htm] Maid of Lidia: Did you read of the contract between Nidrah and my lady in the diary? "Now you must tell me what you know!" [31532-17.htm] Maid of Lidia: How do you know about Nidrah? Are you the last survivor? If so, you'll never get out of this forest alive...or dead! "I read the diary." [31532-18.htm] Maid of Lidia: I was there when the contract was signed, but the memory of the undead is not very clear. If you find out what's on the missing page, when the contract was signed, I'll tell you more. "I've already come this far." [31532-19.htm] Maid of Lidia: This I can tell you. The black magi roam freely during the day, but are fewer at night. Some carry odd looking dolls. Take one to their master, I'm sure he can tell you more! [31532-20.htm] Maid of Lidia: This I can tell you. The black magi roam freely during the day, but are fewer at night. Some carry odd looking dolls. Take one to their master, I'm sure he can tell you more!
Исходник условий и наград (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.Q00024_InhabitantsOfTheForestOfTheDead;

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

import quests.Q00023_LidiasHeart.Q00023_LidiasHeart;

public class Q00024_InhabitantsOfTheForestOfTheDead extends Quest
{
	// NPCs
	private static final int DORIAN = 31389;
	private static final int WIZARD = 31522;
	private static final int TOMBSTONE = 31531;
	private static final int MAID_OF_LIDIA = 31532;
	private static final int[] MOBS =
	{
		21557, // BONE_SNATCHER
		21558, // BONE_SNATCHER_A
		21560, // BONE_SHAPER
		21563, // BONE_COLLECTOR
		21564, // SKULL_COLLECTOR
		21565, // BONE_ANIMATOR
		21566, // SKULL_ANIMATOR
		21567, // BONE_SLAYER
	};
	
	// Items
	private static final int LETTER = 7065;
	private static final int HAIRPIN = 7148;
	private static final int TOTEM = 7151;
	private static final int FLOWER = 7152;
	private static final int SILVER_CROSS = 7153;
	private static final int BROKEN_SILVER_CROSS = 7154;
	private static final int SUSPICIOUS_TOTEM = 7156;
	
	public Q00024_InhabitantsOfTheForestOfTheDead()
	{
		super(24, "Inhabitants of the Forest of the Dead");
		
		addStartNpc(DORIAN);
		addTalkId(DORIAN, TOMBSTONE, MAID_OF_LIDIA, WIZARD);
		registerQuestItems(FLOWER, SILVER_CROSS, BROKEN_SILVER_CROSS, LETTER, HAIRPIN, TOTEM);
		addKillId(MOBS);
		addAggroRangeEnterId(25332);
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		QuestState st = player.getQuestState(getName());
		if (st == null)
		{
			return event;
		}
		
		String htmltext = event;
		switch (event)
		{
			case "31389-03.htm":
			{
				st.startQuest();
				st.set("state", "1");
				giveItems(player, FLOWER, 1);
				break;
			}
			case "31389-08.htm":
			{
				st.set("state", "3");
				break;
			}
			case "31389-13.htm":
			{
				st.setCond(3, true);
				st.set("state", "4");
				giveItems(player, SILVER_CROSS, 1);
				break;
			}
			case "31389-18.htm":
			{
				playSound(player, QuestSound.INTERFACESOUND_CHARSTAT_OPEN);
				break;
			}
			case "31389-19.htm":
			{
				st.setCond(5, true);
				st.set("state", "5");
				takeItems(player, BROKEN_SILVER_CROSS, -1);
				break;
			}
			case "31522-03.htm":
			{
				st.set("state", "12");
				takeItems(player, TOTEM, -1);
				break;
			}
			case "31522-08.htm":
			{
				st.setCond(11, true);
				st.set("state", "13");
				break;
			}
			case "31522-17.htm":
			{
				st.set("state", "14");
				break;
			}
			case "31522-21.htm":
			{
				giveItems(player, SUSPICIOUS_TOTEM, 1);
				st.exitQuest(false, true);
				break;
			}
			case "31532-04.htm":
			{
				st.setCond(6, true);
				st.set("state", "6");
				giveItems(player, LETTER, 1);
				break;
			}
			case "31532-06.htm":
			{
				if (hasQuestItems(player, HAIRPIN))
				{
					st.set("state", "8");
					takeItems(player, LETTER, -1);
					takeItems(player, HAIRPIN, -1);
				}
				else
				{
					st.setCond(7);
					st.set("state", "7");
					htmltext = "31532-07.htm";
				}
				break;
			}
			case "31532-10.htm":
			{
				st.set("state", "9");
				break;
			}
			case "31532-14.htm":
			{
				st.set("state", "10");
				break;
			}
			case "31532-19.htm":
			{
				st.setCond(9, true);
				st.set("state", "11");
				break;
			}
			case "31531-02.htm":
			{
				st.setCond(2, true);
				st.set("state", "2");
				takeItems(player, FLOWER, -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:
			{
				final QuestState st2 = player.getQuestState(Q00023_LidiasHeart.class.getSimpleName());
				if ((st2 != null) && st2.isCompleted() && (player.getLevel() >= 65))
				{
					htmltext = "31389-01.htm";
				}
				else
				{
					htmltext = "31389-02.htm";
				}
				break;
			}
			case State.STARTED:
			{
				int state = st.getInt("state");
				switch (npc.getId())
				{
					case 31389:
					{
						if (state == 1)
						{
							htmltext = "31389-04.htm";
							return htmltext;
						}
						else if (state == 2)
						{
							htmltext = "31389-05.htm";
							return htmltext;
						}
						else if (state == 3)
						{
							htmltext = "31389-09.htm";
							return htmltext;
						}
						else if (state == 4)
						{
							if (hasQuestItems(player, SILVER_CROSS))
							{
								htmltext = "31389-14.htm";
							}
							else if (hasQuestItems(player, BROKEN_SILVER_CROSS))
							{
								htmltext = "31389-15.htm";
								return htmltext;
							}
							
							return htmltext;
						}
						else if (state == 5)
						{
							htmltext = "31389-20.htm";
							return htmltext;
						}
						else
						{
							if ((state == 7) && !hasQuestItems(player, HAIRPIN))
							{
								htmltext = "31389-21.htm";
								st.setCond(8, true);
								giveItems(player, HAIRPIN, 1);
							}
							else if (((state == 7) && hasQuestItems(player, HAIRPIN)) || (state == 6))
							{
								htmltext = "31389-22.htm";
								return htmltext;
							}
							
							return htmltext;
						}
					}
					case 31522:
					{
						if ((state == 11) && hasQuestItems(player, TOTEM))
						{
							htmltext = "31522-01.htm";
							return htmltext;
						}
						else if (state == 12)
						{
							htmltext = "31522-04.htm";
							return htmltext;
						}
						else
						{
							if (state == 13)
							{
								htmltext = "31522-09.htm";
							}
							else if (state == 14)
							{
								htmltext = "31522-18.htm";
								return htmltext;
							}
							
							return htmltext;
						}
					}
					case 31531:
					{
						if ((state == 1) && hasQuestItems(player, FLOWER))
						{
							htmltext = "31531-01.htm";
							playSound(player, QuestSound.AMDSOUND_WIND_LOOT);
						}
						else if (state == 2)
						{
							htmltext = "31531-03.htm";
							return htmltext;
						}
						
						return htmltext;
					}
					case 31532:
					{
						if (state == 5)
						{
							htmltext = "31532-01.htm";
							return htmltext;
						}
						else if ((state == 6) && hasQuestItems(player, LETTER))
						{
							htmltext = "31532-05.htm";
							return htmltext;
						}
						else if (state == 7)
						{
							htmltext = "31532-07a.htm";
							return htmltext;
						}
						else if (state == 8)
						{
							htmltext = "31532-08.htm";
							return htmltext;
						}
						else if (state == 9)
						{
							htmltext = "31532-11.htm";
							return htmltext;
						}
						else
						{
							if (state == 10)
							{
								htmltext = "31532-15.htm";
							}
							else if (state == 11)
							{
								htmltext = "31532-20.htm";
								return htmltext;
							}
							
							return htmltext;
						}
					}
					default:
					{
						return htmltext;
					}
				}
			}
			case State.COMPLETED:
			{
				if (npc.getId() == 31522)
				{
					htmltext = "31522-22.htm";
				}
				else
				{
					htmltext = getAlreadyCompletedMsg(player);
				}
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onAggroRangeEnter(Npc npc, Player player, boolean isPet)
	{
		if (isPet)
		{
			npc.getAttackByList().remove(player.getSummon());
		}
		else
		{
			npc.getAttackByList().remove(player);
			final QuestState st = player.getQuestState(getName());
			if ((st != null) && (getQuestItemsCount(player, SILVER_CROSS) > 0))
			{
				takeItems(player, SILVER_CROSS, -1);
				giveItems(player, BROKEN_SILVER_CROSS, 1);
				st.setCond(4);
				npc.broadcastSay(ChatType.GENERAL, "That sign!");
			}
		}
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isSummon)
	{
		final QuestState st = getQuestState(player, false);
		if ((st != null) && st.isCond(9) && (getRandom(100) < 10))
		{
			giveItems(player, TOTEM, 1);
			st.setCond(10, true);
		}
	}
}