ZURSULUS L2

Path to a Warrior

ID
401
Название
Path to a Warrior
start_npcs_json
[30010]
npc_ids_json
[30010,30253]
constants_json
{"AURON_LETTER":1138,"WARRIOR_GUILD_MARK":1139,"RUSTED_BRONZE_SWORD_1":1140,"RUSTED_BRONZE_SWORD_2":1141,"RUSTED_BRONZE_SWORD_3":1142,"SIMPLON_LETTER":1143,"POISON_SPIDER_LEG":1144,"MEDALLION_OF_WARRIOR":1145,"AURON":30010,"SIMPLON":30253}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00401_PathOfTheWarrior/Q00401_PathOfTheWarrior.java

NPC квеста

IDНазваниеСтарт квестаУровень
30010AuronДа70
30253SimplonНет70

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

else if (player.getLevel() < 19)

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

giveItems(player, AURON_LETTER, 1);
giveItems(player, WARRIOR_GUILD_MARK, 1);
giveItems(player, RUSTED_BRONZE_SWORD_3, 1);
giveItems(player, MEDALLION_OF_WARRIOR, 1);
addExpAndSp(player, 3200, 1500);
giveItems(player, RUSTED_BRONZE_SWORD_2, 1);
giveItems(player, SIMPLON_LETTER, 1);
giveItems(player, RUSTED_BRONZE_SWORD_1, 1);
giveItems(player, POISON_SPIDER_LEG, 1);

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

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

[30010-01.htm] Master Auron: Now I'm a master who teaches young Fighters, but I was once a soldier for the Warrior League, walking the borderline between of life and death on the battlefield. To be accepted into the Warrior League, there's no need for a noble birth or the lord's Recommendation. We accept any Fighter who has courage and spirit. Say you want to become a Warrior [30010-02.htm] Master Auron: You are still too inexperienced. The damage to your armor and the callus on your palm show me that plainly. Come back after you are more seasoned. At that time, I will be willing to test you to determine if you are indeed qualified to be a true Warrior. (This quest may only be undertaken by a character of level 19 and above.) [30010-02b.htm] Master Auron: You seem to have already decided on the path you will take. So why have you come to me? [30010-03.htm] Master Auron: Why has one who has already attained the title of Warrior come to seek me? Is not your place on the battlefield? Leave at once! May the goddess of victory smile down on you! [30010-04.htm] Master Auron: You already have the medallion of the Warrior. Then you already have the qualifications to enter the warriors guild. Take the medallion and go to Grand Master Ramos of our guild, and he will change your profession to a Warrior. He's the one standing right over there. [30010-05.htm] Master Auron: Good! Then I will test you to see if you have the talents to become a true Warrior. It is a very simple test -- any Fighter with courage and spirit can pass it. Ask about the test [30010-06.htm] Master Auron: To take this test, you must first find the weapon that the Warriors call the sword of trial. Simplon of the town of Gludio knows all about the sword. These days, he works at a weapons and armor shop, but in the past he was a famous soldier, so treat him with respect. If you show him this letter, he will receive you very cordially. [30010-07.htm] Master Auron: You haven't met Simplon yet? He works at a weapons shop in the town of Gludio. If you show him my letter, he will tell you everything you need to know about the sword of trial. [30010-08.htm] Master Auron: I see you met Simplon. It gather that he asked you to do something difficult, because he certainly doesn't give the Sword of Trial to just anyone. But don't be too upset. Though he seems tempermental on the outside, he's really a warm person once you get to know him. [30010-09.htm] Master Auron: Good, so you have found the sword of trial. Here's what you must do now ... If you go out to Windmill Hill, in the southern plains, you will find poison spiders -- their bodies are bigger than wagons, and they're violent and dangerous to deal with. Use only the rusty bronze sword to hunt the poison spiders. You may not use any other weapons. When you kill a poison spider, cut off its legs and keep them. Ah yes, and you may also bring the legs of the arachnid tracker, a spider which is a little more ferocious even than the poison spider. Collect twenty spider legs and bring them here. That is the test to become a Warrior. If you pass this test, I will give you the medallion of the Warrior. Say it's impossible with a rusty sword Say you understand [30010-10.htm] Master Auron: How do you hunt a poison spider with a rusty sword? Look here, fellow, do you know what the creed of our warriors guild is? It's stay alive even in the worst conditions. There is no law that says you will always be at an advantage in a fight against your opponent. However, in any situation, you can win if you keep your wits about you. Think of this ... do you think a knight armed with luxurious Steel armor and a Steel sword has achieved a real victory after killing a farmer who is armed with a wooden spear? True victory is rolling in the mud and taking a beating, then picking up a stone and striking for your opponent's head. It is that gruesome. Do you understand what I'm saying? Say you understand [30010-11.htm] Master Auron: Good! Once you've passed through the southern gate of the village, to the left you'll see the windmills of Windmill Hill. There you'll find giant poison spiders and arachnid trackers. You'll also find many spiders on the Fellmere Harvesting Grounds west of the Fellmere Lake over the northern mountains. Bring twenty of their legs to me. You must use only the sword of trial to kill them! Do you understand? Get going! [30010-12.htm] Master Auron: Why have you come back? Didn't I tell you to bring back twenty Poison Spider Legs from giant poison spiders or arachnid trackers? You're not thinking of giving up, are you? Where are your guts? [30010-13.htm] Master Auron: Have you returned? Well, I knew you would be able to do the job magnificently. I hereby give you the medallion of the Warrior. It is proof that you have earned the qualifications to change profession to a Warrior. Take it and go to Grand Master Ramos of our guild. He will change your profession to a Warrior. He is the one right over there. I don't know how your future will turn out, but I hope you do not forget the warrior's creed that I've taught you. Until we meet again, may the goddess of victory smile on you! [30253-01.htm] Trader Simplon: What? Are you trying to become a Warrior? Ha ha! To me, you seem like a novice! Well, now that I think of it, when I was young the elder soldiers would often look down on me because I had a childlike face. So I will give you an opportunity. Well, if you want to be a Warrior, you must first find the sword of trial. I already know where it is, but first let me test your disposition. Ask about the test [30253-02.htm] Trader Simplon: Recently, the lord announced that he would restore all the villages that became ruins during the war and solicited to the warriors guild for soldiers to do away with the undead. If you want to prove that you have the qualities of a Warrior, go to the Ruins of Agony and fight with the tracker skeletons! The skeletons in the ruins are the spirits of poor soldiers that lost their lives cruelly during the war and become undead. Bring back ten rusted swords that they used. While you perform this task, take this mark with you, since you have become a member of our warriors guild for a short time. What? Difficult? What are you saying! Twenty years ago when I was about your age, the witch Cleo led undead troops into the Castle of Gludio. My comrades and I fought against hundreds of skeletons in just one night! And here you are whining about killing just ten tracker skeletons?! No more unnecessary words, now be off with you! [30253-03.htm] Trader Simplon: What? Why have you returned empty handed? Do you not wish to become a Warrior, or are you stupid? If you have forgotten already, let me tell you again! Go to the Ruins of Agony and fight the tracker skeletons, collect ten of their rusted swords, and bring them to me. [30253-03b.htm] Trader Simplon: Didn't I tell you to bring ten rusted swords? You can count, can't you? Put out both of your hands and look at your fingers. That is how many rusted swords you should come back with. Only then can I give you the sword of trial. [30253-04.htm] Trader Simplon: Ho, you have brought back ten rusted swords used by the tracker skeletons of the ruins. I can tell from the Gracian characters engraved on the blade -- the undead of the ruins are all spirits of the soldiers that died during war with Gracia. Anyway, many thanks for your trouble. Here, take one of these rusted sword. Why? Because that is none other than the sword of trial! What is that dumbfounded look on your face? Don't be unreasonable. Look here, young fellow, did you think we warriors had a magical sword with splendid ornaments? If I say that is the sword of trial, then understand that it is so, and be off! Here, I will write you a letter to take to Master Auron! [30253-05.htm] Trader Simplon: So, how do you like the sword of trial that I gave you? By the way, why are you still staying in this village? Go along to Master Auron and show him the letter that I wrote. Then he will tell you about the test you must take with the sword of trial to become a Warrior.
Исходник условий и наград (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.Q00401_PathOfTheWarrior;

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.entity.itemcontainer.Inventory;
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 Q00401_PathOfTheWarrior extends Quest
{
	// Items
	private static final int AURON_LETTER = 1138;
	private static final int WARRIOR_GUILD_MARK = 1139;
	private static final int RUSTED_BRONZE_SWORD_1 = 1140;
	private static final int RUSTED_BRONZE_SWORD_2 = 1141;
	private static final int RUSTED_BRONZE_SWORD_3 = 1142;
	private static final int SIMPLON_LETTER = 1143;
	private static final int POISON_SPIDER_LEG = 1144;
	private static final int MEDALLION_OF_WARRIOR = 1145;
	
	// NPCs
	private static final int AURON = 30010;
	private static final int SIMPLON = 30253;
	
	public Q00401_PathOfTheWarrior()
	{
		super(401, "Path to a Warrior");
		registerQuestItems(AURON_LETTER, WARRIOR_GUILD_MARK, RUSTED_BRONZE_SWORD_1, RUSTED_BRONZE_SWORD_2, RUSTED_BRONZE_SWORD_3, SIMPLON_LETTER, POISON_SPIDER_LEG);
		addStartNpc(AURON);
		addTalkId(AURON, SIMPLON);
		addKillId(20035, 20038, 20042, 20043);
	}
	
	@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("30010-05.htm"))
		{
			if (player.getPlayerClass() != PlayerClass.FIGHTER)
			{
				htmltext = (player.getPlayerClass() == PlayerClass.WARRIOR) ? "30010-03.htm" : "30010-02b.htm";
			}
			else if (player.getLevel() < 19)
			{
				htmltext = "30010-02.htm";
			}
			else if (hasQuestItems(player, MEDALLION_OF_WARRIOR))
			{
				htmltext = "30010-04.htm";
			}
		}
		else if (event.equals("30010-06.htm"))
		{
			st.startQuest();
			giveItems(player, AURON_LETTER, 1);
		}
		else if (event.equals("30253-02.htm"))
		{
			st.setCond(2, true);
			takeItems(player, AURON_LETTER, 1);
			giveItems(player, WARRIOR_GUILD_MARK, 1);
		}
		else if (event.equals("30010-11.htm"))
		{
			st.setCond(5, true);
			takeItems(player, RUSTED_BRONZE_SWORD_2, 1);
			takeItems(player, SIMPLON_LETTER, 1);
			giveItems(player, RUSTED_BRONZE_SWORD_3, 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 = "30010-01.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case AURON:
					{
						if (cond == 1)
						{
							htmltext = "30010-07.htm";
						}
						else if ((cond == 2) || (cond == 3))
						{
							htmltext = "30010-08.htm";
						}
						else if (cond == 4)
						{
							htmltext = "30010-09.htm";
						}
						else if (cond == 5)
						{
							htmltext = "30010-12.htm";
						}
						else if (cond == 6)
						{
							htmltext = "30010-13.htm";
							takeItems(player, POISON_SPIDER_LEG, -1);
							takeItems(player, RUSTED_BRONZE_SWORD_3, 1);
							giveItems(player, MEDALLION_OF_WARRIOR, 1);
							addExpAndSp(player, 3200, 1500);
							player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
							st.exitQuest(true, true);
						}
						break;
					}
					case SIMPLON:
					{
						if (cond == 1)
						{
							htmltext = "30253-01.htm";
						}
						else if (cond == 2)
						{
							if (!hasQuestItems(player, RUSTED_BRONZE_SWORD_1))
							{
								htmltext = "30253-03.htm";
							}
							else if (getQuestItemsCount(player, RUSTED_BRONZE_SWORD_1) <= 9)
							{
								htmltext = "30253-03b.htm";
							}
						}
						else if (cond == 3)
						{
							htmltext = "30253-04.htm";
							st.setCond(4, true);
							takeItems(player, RUSTED_BRONZE_SWORD_1, 10);
							takeItems(player, WARRIOR_GUILD_MARK, 1);
							giveItems(player, RUSTED_BRONZE_SWORD_2, 1);
							giveItems(player, SIMPLON_LETTER, 1);
						}
						else if (cond == 4)
						{
							htmltext = "30253-05.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 20035:
			case 20042:
			{
				if (st.isCond(2) && (getRandom(10) < 4))
				{
					if (getQuestItemsCount(player, RUSTED_BRONZE_SWORD_1) < 10)
					{
						giveItems(player, RUSTED_BRONZE_SWORD_1, 1);
						
						if (getQuestItemsCount(player, RUSTED_BRONZE_SWORD_1) >= 10)
						{
							st.setCond(3, true);
						}
						else
						{
							playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
						}
					}
				}
				break;
			}
			case 20038:
			case 20043:
			{
				if (st.isCond(5) && (player.getInventory().getPaperdollItemId(Inventory.PAPERDOLL_RHAND) == RUSTED_BRONZE_SWORD_3))
				{
					if (getQuestItemsCount(player, POISON_SPIDER_LEG) < 20)
					{
						giveItems(player, POISON_SPIDER_LEG, 1);
						
						if (getQuestItemsCount(player, POISON_SPIDER_LEG) >= 20)
						{
							st.setCond(6, true);
						}
						else
						{
							playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
						}
					}
				}
				break;
			}
		}
	}
}