ZURSULUS L2

Path to a Dark Wizard

ID
412
Название
Path to a Dark Wizard
start_npcs_json
[30421]
npc_ids_json
[30415,30418,30419,30421]
constants_json
{"VARIKA":30421,"CHARKEREN":30415,"ANNIKA":30418,"ARKENIA":30419,"SEED_OF_ANGER":1253,"SEED_OF_DESPAIR":1254,"SEED_OF_HORROR":1255,"SEED_OF_LUNACY":1256,"FAMILY_REMAINS":1257,"VARIKA_LIQUOR":1258,"KNEE_BONE":1259,"HEART_OF_LUNACY":1260,"JEWEL_OF_DARKNESS":1261,"LUCKY_KEY":1277,"CANDLE":1278,"HUB_SCENT":1279}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00412_PathOfTheDarkWizard/Q00412_PathOfTheDarkWizard.java

NPC квеста

IDНазваниеСтарт квестаУровень
30415CharkerenНет70
30418AnnikaНет70
30419ArkeniaНет70
30421VarikaДа70

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

else if (player.getLevel() < 19)

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

giveItems(player, SEED_OF_DESPAIR, 1);
giveItems(player, LUCKY_KEY, 1);
giveItems(player, CANDLE, 1);
giveItems(player, JEWEL_OF_DARKNESS, 1);
addExpAndSp(player, 3200, 1650);
giveItems(player, SEED_OF_ANGER, 1);
giveItems(player, SEED_OF_HORROR, 1);
giveItems(player, HUB_SCENT, 1);
giveItems(player, SEED_OF_LUNACY, 1);
giveItems(player, FAMILY_REMAINS, 1);
giveItems(player, KNEE_BONE, 1);
giveItems(player, HEART_OF_LUNACY, 1);

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

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

[30415-01.htm] Charkeren: Who are you? I curse everything in this world! Just leave me alone! Ah ... What good is it to be the only one alive? If the gods asked me what to do with the world, I'd ask them to destroy it right away! What good is it to live in a world like this ... Listen to his tale [30415-02.htm] Charkeren: My family ... We built a house near the waterfall and lived happily, tending our fields. Then suddenly, one day, an Elven militia corps showed up and threatened us, but we didn't pay much attention because we though it was just the normal harassment. But the day I went up to repair the roof for the rainy season, they swarmed into the house and killed my entire family ... I was a powerless coward, and I held my breath on the roof and just watched. As my family was killed one by one in front of my eyes, I pressed myself close to the roof so that I would not be seen, and did nothing to save them until they were all dead ... What sins did I commit for my family to be murdered! I will take revenge on those Elves by doing exactly what they did! I will make them understand how it feels to be able to do nothing while your loved ones die in front of your eyes! Ahh ... My family ... Could you do me a favor? It's nothing difficult... Accept request [30415-03.htm] Charkeren: Those wretched murderers threw the corpses of my family in the marsh, but I can't bear to go there to search. If I could devour those murderers like a wild beast, it still wouldn't satisfy my hunger for revenge! Please find the bodies of my parents and younger sister. I beg you. The Marsh Zombies have probably torn up the corpses. Kill the Marsh Zombies and bring back the three remains, please. This key was given to me by my parents as a gift. It is supposed to bring good luck. Carry this with you. [30415-04.htm] Charkeren: I didn't think it would be easy to find all the remains of my family ... I know the marsh is quite large ... They say that the Marsh Zombies love dead bodies, so I'm sure they have scattered the corpses of my family. I do not care how long it takes. Please find their remains. Please, I beg you. [30415-05.htm] Charkeren: Ahh ... You have found the remains of my family ... How can I ever thank you ... I will never forget your kind heart. I promise I will pay you back once I finish my revenge. Argh ... My head suddenly ... Ugh ... I feel nauseous. What is this? Is this a seed? I will give this to you. Now ... My heart feels so much lighter. I will not forget your kindness. Thank you so much. [30415-06.htm] Charkeren: Thank you so much. I do not have anything now so I cannot give you anything in return. I will honor you for your kindness for the rest of my life. [30418-01.htm] Annika: The finest Wizards of the Dark Elven race used to study black magic here a long time ago. But this place has since been abandoned and is now in ruins. Can't you feel the spirit of evil inside? The accumulated dark magic is so strong, even a Fighter like myself can feel its power. I am training to become a sentry. The training course involves exploring the School of Dark Arts here. However, whenever I go into dark and closed spaces, I cannot breathe. Just the thought of going into that place steals my breath. I beg you... Please help me complete my training. Accept the request [30418-02.htm] Annika: Please go into the School of Dark Arts and find me two Knee Bones of the undead. You can find them by killing skeleton hunters, skeleton hunter archers, or misery skeletons. I will give you this candle. If you are trapped in a dark corridor in the ruins, you may need it. [30418-03.htm] Annika: How come you've returned empty-handed? Have you forgotten your promise already? Didn't you say you were going to find me two Knee Bones of the undead? You can get the Knee Bones by killing skeleton hunters, skeleton hunter archers, or misery skeletons. [30418-04.htm] Annika: Thank you very much. Thanks to you, I can safely complete my training. Soon, I will earn the qualifications to become a sentry. When I do, my friends won't laugh at me anymore. I give you this in thanks for helping me. I'm not sure exactly what it is, but it is definitely very precious. It looks like a seed or something... It looks quite marvelous, I've never seen anything like it before. I found it in the nearby woods a few days ago. [30419-01.htm] Arkenia: The Dark Forest is peaceful and orderly, but Gludio is not like that. The wounds of war still run red in that place. A Sorcerer in the past went mad, and did things that should not have been done. He made live Humans the subjects of his experiments. After the experiments, they were no longer Humans. The scientist turned them into skeletons, you see. Kill the skeleton scouts in the Ruins of Agony in Gludio and find the Heart of Lunacy, left by that Sorcerer whose lunacy created the evil. Here is a perfume made from crushed herbs, it will defend your mind from the curse of that madness. [30419-02.htm] Arkenia: Kill the skeleton scouts that appear in the Ruins of Agony and free the dead Humans' souls. Then, bring me the Heart of Lunacy you'll get from the skeleton's body. [30419-03.htm] Arkenia: You have found the Heart of Lunacy. This must be handled very carefully. If you are careless, it will burst. This heart is an important ingredient in the making of medicine. This much will make a lot of medicine. If you dry one of these hearts, it will become a Seed of Lunacy. Since you found all the hearts, I will give you a Seed of Lunacy as a reward. If you carry this with you, you will not be tormented by evil creatures. [30421-01.htm] Varika: Do you want the ultimate power in your hands? If so, then you must not hesitate. Decision is always important. If you become a Dark Wizard, you will have the power to command the spirits as you wish. Well, do you want the power of the Dark Wizard that commands spirits? Want to obtain power [30421-02.htm] Varika: You do not have enough experience to become a Dark Wizard. Your level must be at least 19 to earn the qualifications for the power of the Dark Wizard. [30421-02a.htm] Varika: It seems that ... You already have the power of a Dark Wizard ... I cannot help you. Please research power of a higher level. [30421-03.htm] Varika: You are already walking another path. You are not eligible to take the test to become a Dark Wizard. [30421-04.htm] Varika: I see you already have the Jewel of Darkness. That means you are qualified to become a Dark Wizard. Take the jewel and go to a Grand Master of the Dark Elven guild in Gludio. The closest is the village of Gludin. Follow the road and continue on south. Go to the Dark Elven guild there and meet Grand Master Xenos. He will change your profession to Dark Wizard. [30421-05.htm] Varika: Dark Wizards can control the power of nature and perform powerful magic. But you should be aware of the origin of power that enables magic. Long ago, our mother Shilen was insulted by Einhasad and betrayed by the Elves when they began to serve Eva. Since then, the origin of our power is darkness, like our mother Shilen. Dark power consists of four factors -- anger, despair, horror and lunacy. You can qualify to become a Dark Wizard only if you collect the four seeds that symbolize these things. Here, take this. This is the Seed of Despair. Take this and find the remaining seeds. Now, which one should I explain first? Seed of Anger Seed of Horror Seed of Lunacy [30421-06.htm] Varika: Are you trying to trick me? Others may be easily fooled, but it will not be easy to fool me. I see you already have the Seed of Anger. Go find the remaining seeds. [30421-07.htm] Varika: Go to the waterfall that is north of the Neutral Zone and northeast of here. There, you will feel a tremendous force of anger. I have foreseen that the one emitting the anger is a young Dark Elven youth by the name of Charkeren. Bring the Seed of Anger planted in his heart. [30421-08.htm] Varika: The young man called Charkeren was greatly afflicted. He will have great knots in his heart. Undo the knots and they will form a Seed of Anger. Please help that poor man as soon as possible. [30421-09.htm] Varika: None are as weak as an opponent that has fear in his heart. I see you have the Seed of Horror. Did you collect all the other seeds? [30421-10.htm] Varika: I sense that someone is trembling in fear. It seems to be near the School of Dark Arts. Search thoroughly near the entrance of the School of Dark Arts. She seems like a very attractive young woman. Listen to her tale and erase her horror. [30421-12.htm] Varika: You are quite an amusing person. If you already have the Seed of Lunacy, why have you come to find it again? Go gather the seeds that you do not have yet. [30421-13.htm] Varika: For methods of finding a Seed of Lunacy, go and ask my sister Arkenia. She will tell you in detail what you wish to know. When you have found a Seed of Lunacy, come and seek me again. [30421-16.htm] Varika: So you have finally collected the Seeds of Anger, Despair, Horror and Lunacy. Now do you know the source of our power? There is no need to be afraid. All you have to do is control these by your will. Emotion is important when dealing with nature's elementals. Don't forget that emotion is the source of power. Since you have gathered all the seeds needed to become a Dark Wizard, I will give you a token. Take this token to the Grand Master of the Dark Elven Guild and you can become a Dark Wizard. The nearest village where Dark Elves reside is the village of Gludin. Go and seek Grand Master Xenos there. He will change your profession to a Dark Wizard. Well then my friend, may the divine protection of Shilen be with you. [30421-17.htm] Varika: Dark Wizards can control the power of nature and perform powerful magic. But you should be aware of the origin of power that enables it. Long ago, our mother Shilen was insulted by Einhasad and betrayed by the Elves. Since then, the origin of our power is darkness, like our mother Shilen. Dark power consists of four factors -- anger, despair, horror and lunacy. You can qualify to become a Dark Wizard only if you collect the four seeds that symbolize these four things. Seed of Anger Seed of Horror Seed of Lunacy [30421-18.htm] Varika: The young man called Charkeren was greatly afflicted. The emotions within his heart must be great. Go and give these ashes of his family to him. Then the anger in Chakeren's heart will come together and form the 'Seed of Anger'. [30421-19.htm] Varika: The Knee Bones of the undead can be made into many different kinds of medicine and are often used for teaching in school. Annika seems to be unexpectedly clever, despite her appearance. A girl of her age shouldn't want to spend the entire day in a depressing dungeon. Give the girl these Knee Bones.
Исходник условий и наград (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.Q00412_PathOfTheDarkWizard;

import org.l2jmobius.gameserver.entity.actor.Npc;
import org.l2jmobius.gameserver.entity.actor.Player;
import org.l2jmobius.gameserver.entity.actor.enums.player.PlayerClass;
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.serverpackets.SocialAction;

public class Q00412_PathOfTheDarkWizard extends Quest
{
	// NPCs
	private static final int VARIKA = 30421;
	private static final int CHARKEREN = 30415;
	private static final int ANNIKA = 30418;
	private static final int ARKENIA = 30419;
	
	// Items
	private static final int SEED_OF_ANGER = 1253;
	private static final int SEED_OF_DESPAIR = 1254;
	private static final int SEED_OF_HORROR = 1255;
	private static final int SEED_OF_LUNACY = 1256;
	private static final int FAMILY_REMAINS = 1257;
	private static final int VARIKA_LIQUOR = 1258;
	private static final int KNEE_BONE = 1259;
	private static final int HEART_OF_LUNACY = 1260;
	private static final int JEWEL_OF_DARKNESS = 1261;
	private static final int LUCKY_KEY = 1277;
	private static final int CANDLE = 1278;
	private static final int HUB_SCENT = 1279;
	
	public Q00412_PathOfTheDarkWizard()
	{
		super(412, "Path to a Dark Wizard");
		registerQuestItems(SEED_OF_ANGER, SEED_OF_DESPAIR, SEED_OF_HORROR, SEED_OF_LUNACY, FAMILY_REMAINS, VARIKA_LIQUOR, KNEE_BONE, HEART_OF_LUNACY, LUCKY_KEY, CANDLE, HUB_SCENT);
		addStartNpc(VARIKA);
		addTalkId(VARIKA, CHARKEREN, ANNIKA, ARKENIA);
		addKillId(20015, 20022, 20045, 20517, 20518);
	}
	
	@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 "30421-05.htm":
			{
				if (player.getPlayerClass() != PlayerClass.DARK_MAGE)
				{
					htmltext = (player.getPlayerClass() == PlayerClass.DARK_WIZARD) ? "30421-02a.htm" : "30421-03.htm";
				}
				else if (player.getLevel() < 19)
				{
					htmltext = "30421-02.htm";
				}
				else if (hasQuestItems(player, JEWEL_OF_DARKNESS))
				{
					htmltext = "30421-04.htm";
				}
				else
				{
					st.startQuest();
					giveItems(player, SEED_OF_DESPAIR, 1);
				}
				break;
			}
			case "30421-07.htm":
			{
				if (hasQuestItems(player, SEED_OF_ANGER))
				{
					htmltext = "30421-06.htm";
				}
				else if (hasQuestItems(player, LUCKY_KEY))
				{
					htmltext = "30421-08.htm";
				}
				else if (getQuestItemsCount(player, FAMILY_REMAINS) == 3)
				{
					htmltext = "30421-18.htm";
				}
				break;
			}
			case "30421-10.htm":
			{
				if (hasQuestItems(player, SEED_OF_HORROR))
				{
					htmltext = "30421-09.htm";
				}
				else if (getQuestItemsCount(player, KNEE_BONE) == 2)
				{
					htmltext = "30421-19.htm";
				}
				break;
			}
			case "30421-13.htm":
			{
				if (hasQuestItems(player, SEED_OF_LUNACY))
				{
					htmltext = "30421-12.htm";
				}
				break;
			}
			case "30415-03.htm":
			{
				playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
				giveItems(player, LUCKY_KEY, 1);
				break;
			}
			case "30418-02.htm":
			{
				playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
				giveItems(player, CANDLE, 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 = "30421-01.htm";
				break;
			}
			case State.STARTED:
			{
				switch (npc.getId())
				{
					case VARIKA:
					{
						if (hasQuestItems(player, SEED_OF_ANGER, SEED_OF_HORROR, SEED_OF_LUNACY))
						{
							htmltext = "30421-16.htm";
							takeItems(player, SEED_OF_ANGER, 1);
							takeItems(player, SEED_OF_DESPAIR, 1);
							takeItems(player, SEED_OF_HORROR, 1);
							takeItems(player, SEED_OF_LUNACY, 1);
							giveItems(player, JEWEL_OF_DARKNESS, 1);
							addExpAndSp(player, 3200, 1650);
							player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
							st.exitQuest(true, true);
						}
						else
						{
							htmltext = "30421-17.htm";
						}
						break;
					}
					case CHARKEREN:
					{
						if (hasQuestItems(player, SEED_OF_ANGER))
						{
							htmltext = "30415-06.htm";
						}
						else if (!hasQuestItems(player, LUCKY_KEY))
						{
							htmltext = "30415-01.htm";
						}
						else if (getQuestItemsCount(player, FAMILY_REMAINS) == 3)
						{
							htmltext = "30415-05.htm";
							playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
							takeItems(player, FAMILY_REMAINS, -1);
							takeItems(player, LUCKY_KEY, 1);
							giveItems(player, SEED_OF_ANGER, 1);
						}
						else
						{
							htmltext = "30415-04.htm";
						}
						break;
					}
					case ANNIKA:
					{
						if (hasQuestItems(player, SEED_OF_HORROR))
						{
							htmltext = "30418-04.htm";
						}
						else if (!hasQuestItems(player, CANDLE))
						{
							htmltext = "30418-01.htm";
						}
						else if (getQuestItemsCount(player, KNEE_BONE) == 2)
						{
							htmltext = "30418-04.htm";
							playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
							takeItems(player, CANDLE, 1);
							takeItems(player, KNEE_BONE, -1);
							giveItems(player, SEED_OF_HORROR, 1);
						}
						else
						{
							htmltext = "30418-03.htm";
						}
						break;
					}
					case ARKENIA:
					{
						if (hasQuestItems(player, SEED_OF_LUNACY))
						{
							htmltext = "30419-03.htm";
						}
						else if (!hasQuestItems(player, HUB_SCENT))
						{
							htmltext = "30419-01.htm";
							playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
							giveItems(player, HUB_SCENT, 1);
						}
						else if (getQuestItemsCount(player, HEART_OF_LUNACY) == 3)
						{
							htmltext = "30419-03.htm";
							playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
							takeItems(player, HEART_OF_LUNACY, -1);
							takeItems(player, HUB_SCENT, 1);
							giveItems(player, SEED_OF_LUNACY, 1);
						}
						else
						{
							htmltext = "30419-02.htm";
						}
						break;
					}
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState st = getQuestState(player, false);
		if ((st == null) || !st.isStarted())
		{
			return;
		}
		
		switch (npc.getId())
		{
			case 20015:
			{
				if (hasQuestItems(player, LUCKY_KEY) && (getQuestItemsCount(player, FAMILY_REMAINS) < 3) && (getRandom(10) < 5))
				{
					giveItems(player, FAMILY_REMAINS, 1);
					if (getQuestItemsCount(player, FAMILY_REMAINS) < 3)
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
					else
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
					}
				}
				break;
			}
			case 20022:
			case 20517:
			case 20518:
			{
				if (hasQuestItems(player, CANDLE) && (getQuestItemsCount(player, KNEE_BONE) < 2) && (getRandom(10) < 5))
				{
					giveItems(player, KNEE_BONE, 1);
					if (getQuestItemsCount(player, KNEE_BONE) < 2)
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
					else
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
					}
				}
				break;
			}
			case 20045:
			{
				if (hasQuestItems(player, HUB_SCENT) && (getQuestItemsCount(player, HEART_OF_LUNACY) < 3) && (getRandom(10) < 5))
				{
					giveItems(player, HEART_OF_LUNACY, 1);
					if (getQuestItemsCount(player, HEART_OF_LUNACY) < 3)
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
					else
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_MIDDLE);
					}
				}
				break;
			}
		}
	}
}