ZURSULUS L2

Path to an Elven Scout

ID
407
Название
Path to an Elven Scout
start_npcs_json
[30328]
npc_ids_json
[30328,30334,30337,30426]
constants_json
{"REISA":30328,"BABENCO":30334,"MORETTI":30337,"PRIAS":30426,"REISA_LETTER":1207,"PRIAS_TORN_LETTER_1":1208,"PRIAS_TORN_LETTER_2":1209,"PRIAS_TORN_LETTER_3":1210,"PRIAS_TORN_LETTER_4":1211,"MORETTI_HERB":1212,"MORETTI_LETTER":1214,"PRIAS_LETTER":1215,"HONORARY_GUARD":1216,"REISA_RECOMMENDATION":1217,"RUSTED_KEY":1293}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00407_PathOfTheElvenScout/Q00407_PathOfTheElvenScout.java

NPC квеста

IDНазваниеСтарт квестаУровень
30328ReisaДа70
30334BabencoНет80
30337MorettiНет80
30426PriasНет70

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

else if (player.getLevel() < 19)

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

giveItems(player, REISA_LETTER, 1);
giveItems(player, REISA_RECOMMENDATION, 1);
addExpAndSp(player, 3200, 1000);
giveItems(player, MORETTI_HERB, 1);
giveItems(player, MORETTI_LETTER, 1);
giveItems(player, HONORARY_GUARD, 1);
giveItems(player, PRIAS_LETTER, 1);
giveItems(player, PRIAS_TORN_LETTER_1, 1);
giveItems(player, PRIAS_TORN_LETTER_2, 1);
giveItems(player, PRIAS_TORN_LETTER_3, 1);
giveItems(player, PRIAS_TORN_LETTER_4, 1);
giveItems(player, RUSTED_KEY, 1);

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

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

[30328-01.htm] Master Reisa: So you want to be an Elven Scout? Hmm ... it is not my place to recommend you as an Elven Scout without reason, so I would like to see your skills first. By chance, there is a task you may be perfect for. Prove your skills as an Elven Fighter through this task. What do you say, will you accept the assignment? Say you will accept the task [30328-02.htm] Master Reisa: I'm sorry, but you are not qualified to take the test to become an to Elven Scout. Try to find the path that is right for you. [30328-02a.htm] Master Reisa: You have already changed profession to Elven Scout, so there is no need for you to reaffirm your skills. You are not needed in villages like these, but in the vast plains. Travel wide and far and increase the dignity of our Elven race. [30328-03.htm] Master Reisa: Becoming an Elven Scout ... I appreciate your enthusiasm, but you do not have enough skill. Enthusiasm alone is not enough to become an Elven Scout. [30328-04.htm] Master Reisa: Now, go to Grand Master Rains to change your profession to Elven Scout. If you take my Recommendation, you will be permitted to change profession to Elven Scout. And friend, I hope you raise the dignity of our race ever higher with your steadfast manner. [30328-05.htm] Master Reisa: If that is the case, I will explain the task to you now. Not long ago, Guard Moretti of our village came to me. He said that a colleague who on patrols with him was lost and they still don't know his whereabouts. So he wanted the help of the Elves who are skilled in the arts of investigation. He is a very devoted youth, and I have always thought very highly of him, so I accepted his request. So, I am about to give you that task. Finding a missing person requires great investigative skills, alertness, and lucidity. Moreover, you never know what dangers lie ahead, so you must also have great combat skills. Solving this task is a good opportunity for you to prove your abilities. Please, go to Guard Moretti and listen to the facts of the case and help him. Moretti is at the east of the village, standing at the entrance where you can see the bridge. If you go with no references, he may not know you, so I will write you a letter. Please take this and go seek Moretti. [30328-06.htm] Master Reisa: Haven't you met Guard Moretti yet? You can learn the details from him. Moretti stands guard at the east entrance of the village where you can see the bridge. [30328-07.htm] Master Reisa: I see you have received an Honorary Guard certificate. I have already heard of your achievements. Guard Moretti highly praised you. Now I can gladly recommend you as an Elven Scout. Who but a skilled Elf like you could become an Elven Scout? In the future, I hope you train still further, to become a magnificent Plainswalker or Silver Ranger. Now take my Recommendation and go to Grand Master Rains. He will change your profession to Elven Scout. May the power of Eva be with you. [30328-08.htm] Master Reisa: I see you have not solved the matter yet. Go now and help Guard Moretti. [30334-01.htm] Guard Babenco: I have heard from Moretti. You must be the one who took charge of investigating this case. You must be going to the Ol Mahum's campgrounds. If you follow this road west, you will arrive at a fork in the road. Follow the road that heads southwest and you will reach the campgrounds. It used to be a place where the Gracian army made its camp, but it was abandoned for some time before the remaining army of Ol Mahums settled down there. Prias and I were classmates, so please find out where he is. I hope nothing has happened to him ... Pray, be careful. [30337-01.htm] Guard Moretti: Ah, you were sent by Reisa. Greetings. In this letter, Reisa says that you will complete this task without fail. Very well, then let me explain to you exactly what is required. I hope we can find the whereabouts of Prias as soon as possible ... Listen to details [30337-02.htm] Guard Moretti: All right, It's time to tell you what is going on. A fortnight ago, I set off on a regular patrol of the ruins with a few of my colleagues. However, while we were looking around the reconstruction site, a group of Ol Mahum patrollers suddenly attacked us! In our experience, they usually don't appear at the ruins, but for some reason they suddenly showed up and attacked us. During the surprise attack, we were unable to keep our formation and fought back as best we could to make our escape. It was total chaos as we continued to try and fight our way free of the trap ... I still get shivers when I think of it! When we had won free and regrouped, we discovered our problem. One of our party, Prias, was nowhere to be seen. We didn't know what to do, since he had vanished while we were preoccupied. So we returned to the village as quickly as we could, gathered more of our colleagues and returned to the ruins. But no matter how much we searched, we could not find a clue to his whereabouts. Since then, we are continuing our investigations, but we still have not found a clue to his whereabouts. So in the end, I requested the help of Reisa. Poor Prias ... I am really worried. Say you will begin the search [30337-03.htm] Guard Moretti: Thank you for your decision to help us in our task. My colleagues traced the footsteps of the Ol Mahum patrols, and it seems that they are staying in the abandoned camp. I think that would be the best place to start searching. If you are not familiar with the geography around here, ask Guard Babenco at the western entrance of the village. He will tell you how to find the abandoned camp. It is a place where a large group of Ol Mahums have established a settlement, so you must be careful. [30337-04.htm] Guard Moretti: You haven't found the Ol Mahum patrols yet? I think it would be best to go to the Abandoned Camp first. If you don't know how to go there, ask Guard Babenco. He is at the west entrance of the village. Thank you in advance. [30337-05.htm] Guard Moretti: Oh, what is this? Prias's Letter! Ah... seeing that it is torn, I'm sure he tore it up while he was writing us a message because he was discovered. Unfortunately, the letter is so badly torn that I cannot tell exactly what he wanted to say... 'Ol Mahum... Urgent... Attack... Elves...' I wonder what the Elves have to do with this... anyway, I cannot read any more. Do you have any other torn letter pieces? Since this is the only clue that we have, I think it would be best to collect the remaining torn letter pieces. [30337-06.htm] Guard Moretti: Why, this is a letter Prias left behind! And it is torn into pieces... I am sure he ripped it up while he was trying to leave us a message. Anyway, let's quickly assemble the pieces and read the letter. Hmm... If I put this one on top... Ah! At last, I can read it. "I write in haste. Emergency! They have kidnapped me and are planning to attack Gludin. The Ol Mahum scouts are taking me to the Neutral Zone in the Elven Forest. It's an emergency..." The letter ends here. Now I know... The reason the Ol Mahum showed up in the ruins... The reason they kidnapped Prias... At least now we know where he is so there is a slight hope, but can we save him? I must ask you another favor. We must prepare for the upcoming attack, so please go and save Prias... Every moment is critical! If you meet Prias, give him this. This is a letter that explains the circumstances and a Medicinal Herb that will cure his wounds. To go to the Neutral Zone, cross this bridge in front of you and follow the road north. It is where Dark Elven and Elven soldiers stand face to face against each other. [30337-07.htm] Guard Moretti: Ah, you have finally returned. Is Prias safe? What about his letter? Hmm... Ah, I do not know whether my friend is truly courageous or merely rash. I can't believe he is staying behind to patrol. Anyway, he is very obliged to you. He may seem a little impolite on the outside, but he has a very kind heart. It's just that he is awkward when it comes to expressing his gratitude. Now our guards must prepare and set off for the battle. We must teach the Ol Mahum stragglers a lesson. At any rate, your distinguished services have greatly helped this case. I have spoken to the captain of the guards and he has already prepared an Honorary Guard. If you take this to Master Reisa, you will be able to get what you want. Well, I have many things to prepare, so goodbye. [30337-08.htm] Guard Moretti: Ah, you haven't gone to Reisa yet? Go on now and see Reisa. I hear you want to be an Elven Scout. I'm sure everything will turn out well. I am busy, so please excuse me. [30337-09.htm] Guard Moretti: Please find my friend Prias somewhere in the Neutral Zone, and give him the herb and letter that I gave you. The Neutral Zone is to the north of our village, across the bridge and along the road. It is the region where Dark Elven and Elven soldiers stand face to face with one another. [30426-01.htm] Prias: Has Moretti sent you? I cannot move because my feet are in shackles. Please free me! Do you see those Ol Mahum sentries over there? One of them has the key to the shackles on my feet! It seems they haven't noticed you yet. Lure them now and get rid of them. There is no time to hesitate. Hurry! [30426-02.htm] Prias: You are very lucky. You came just when the others had left and only the sentries remained ... Anyway, I am free, thanks to you. Thank you very much. Ah, Moretti sent me a letter? And an herb as well ... he is a wonderful friend. I begin to feel faint just by thinking about my captivity, and the torments I've had to endure. The scoundrels here just now were scouts of the group that was going to attack our village. They were planning to do their work in the Elven Forest where Humans cannot enter easily. Since you arrived at the right time, we can alert the people of the danger. Take this to Moretti and tell him that it will be hard for me to return immediately ... Tell him I will take a closer look at the situation here and join the guards later. I am entirely in your debt. Thank you very much. To think that I would receive help from the Elves in my lifetime! On your way back, please take this letter to Moretti. I beg you! [30426-04.htm] Prias: Elven friend, do not worry about me but please take my letter to Moretti. I will have to scout some 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.Q00407_PathOfTheElvenScout;

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 Q00407_PathOfTheElvenScout extends Quest
{
	// NPCs
	private static final int REISA = 30328;
	private static final int BABENCO = 30334;
	private static final int MORETTI = 30337;
	private static final int PRIAS = 30426;
	
	// Items
	private static final int REISA_LETTER = 1207;
	private static final int PRIAS_TORN_LETTER_1 = 1208;
	private static final int PRIAS_TORN_LETTER_2 = 1209;
	private static final int PRIAS_TORN_LETTER_3 = 1210;
	private static final int PRIAS_TORN_LETTER_4 = 1211;
	private static final int MORETTI_HERB = 1212;
	private static final int MORETTI_LETTER = 1214;
	private static final int PRIAS_LETTER = 1215;
	private static final int HONORARY_GUARD = 1216;
	private static final int REISA_RECOMMENDATION = 1217;
	private static final int RUSTED_KEY = 1293;
	
	public Q00407_PathOfTheElvenScout()
	{
		super(407, "Path to an Elven Scout");
		registerQuestItems(REISA_LETTER, PRIAS_TORN_LETTER_1, PRIAS_TORN_LETTER_2, PRIAS_TORN_LETTER_3, PRIAS_TORN_LETTER_4, MORETTI_HERB, MORETTI_LETTER, PRIAS_LETTER, HONORARY_GUARD, RUSTED_KEY);
		addStartNpc(REISA);
		addTalkId(REISA, MORETTI, BABENCO, PRIAS);
		addKillId(20053, 27031);
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		String htmltext = event;
		final QuestState st = getQuestState(player, false);
		if (st == null)
		{
			return htmltext;
		}
		
		if (event.equals("30328-05.htm"))
		{
			if (player.getPlayerClass() != PlayerClass.ELVEN_FIGHTER)
			{
				htmltext = (player.getPlayerClass() == PlayerClass.ELVEN_SCOUT) ? "30328-02a.htm" : "30328-02.htm";
			}
			else if (player.getLevel() < 19)
			{
				htmltext = "30328-03.htm";
			}
			else if (hasQuestItems(player, REISA_RECOMMENDATION))
			{
				htmltext = "30328-04.htm";
			}
			else
			{
				st.startQuest();
				giveItems(player, REISA_LETTER, 1);
			}
		}
		else if (event.equals("30337-03.htm"))
		{
			st.setCond(2, true);
			takeItems(player, REISA_LETTER, -1);
		}
		
		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 = "30328-01.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case REISA:
					{
						if (cond == 1)
						{
							htmltext = "30328-06.htm";
						}
						else if ((cond > 1) && (cond < 8))
						{
							htmltext = "30328-08.htm";
						}
						else if (cond == 8)
						{
							htmltext = "30328-07.htm";
							takeItems(player, HONORARY_GUARD, -1);
							giveItems(player, REISA_RECOMMENDATION, 1);
							addExpAndSp(player, 3200, 1000);
							player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
							st.exitQuest(true, true);
						}
						break;
					}
					case MORETTI:
					{
						if (cond == 1)
						{
							htmltext = "30337-01.htm";
						}
						else if (cond == 2)
						{
							htmltext = (!hasQuestItems(player, PRIAS_TORN_LETTER_1)) ? "30337-04.htm" : "30337-05.htm";
						}
						else if (cond == 3)
						{
							htmltext = "30337-06.htm";
							st.setCond(4, true);
							takeItems(player, PRIAS_TORN_LETTER_1, -1);
							takeItems(player, PRIAS_TORN_LETTER_2, -1);
							takeItems(player, PRIAS_TORN_LETTER_3, -1);
							takeItems(player, PRIAS_TORN_LETTER_4, -1);
							giveItems(player, MORETTI_HERB, 1);
							giveItems(player, MORETTI_LETTER, 1);
						}
						else if ((cond > 3) && (cond < 7))
						{
							htmltext = "30337-09.htm";
						}
						else if ((cond == 7) && hasQuestItems(player, PRIAS_LETTER))
						{
							htmltext = "30337-07.htm";
							st.setCond(8, true);
							takeItems(player, PRIAS_LETTER, -1);
							giveItems(player, HONORARY_GUARD, 1);
						}
						else if (cond == 8)
						{
							htmltext = "30337-08.htm";
						}
						break;
					}
					case BABENCO:
					{
						if (cond == 2)
						{
							htmltext = "30334-01.htm";
						}
						break;
					}
					case PRIAS:
					{
						if (cond == 4)
						{
							htmltext = "30426-01.htm";
							st.setCond(5, true);
						}
						else if (cond == 5)
						{
							htmltext = "30426-01.htm";
						}
						else if (cond == 6)
						{
							htmltext = "30426-02.htm";
							st.setCond(7, true);
							takeItems(player, RUSTED_KEY, -1);
							takeItems(player, MORETTI_HERB, -1);
							takeItems(player, MORETTI_LETTER, -1);
							giveItems(player, PRIAS_LETTER, 1);
						}
						else if (cond == 7)
						{
							htmltext = "30426-04.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;
		}
		
		final int cond = st.getCond();
		if (npc.getId() == 20053)
		{
			if (cond == 2)
			{
				if (!hasQuestItems(player, PRIAS_TORN_LETTER_1))
				{
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					giveItems(player, PRIAS_TORN_LETTER_1, 1);
				}
				else if (!hasQuestItems(player, PRIAS_TORN_LETTER_2))
				{
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					giveItems(player, PRIAS_TORN_LETTER_2, 1);
				}
				else if (!hasQuestItems(player, PRIAS_TORN_LETTER_3))
				{
					playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					giveItems(player, PRIAS_TORN_LETTER_3, 1);
				}
				else if (!hasQuestItems(player, PRIAS_TORN_LETTER_4))
				{
					st.setCond(3, true);
					giveItems(player, PRIAS_TORN_LETTER_4, 1);
				}
			}
		}
		else if (((cond == 4) || (cond == 5)) && (getRandom(10) < 6))
		{
			giveItems(player, RUSTED_KEY, 1);
			st.setCond(6, true);
		}
	}
}