ZURSULUS L2

Sword of Solidarity

ID
101
Название
Sword of Solidarity
start_npcs_json
[30008]
npc_ids_json
[30008,30283]
constants_json
{"ROIEN":30008,"ALTRAN":30283,"BROKEN_SWORD_HANDLE":739,"BROKEN_BLADE_BOTTOM":740,"BROKEN_BLADE_TOP":741,"ROIENS_LETTER":796,"DIR_TO_RUINS":937,"ALTRANS_NOTE":742,"SWORD_OF_SOLIDARITY":738,"SPIRITSHOT_FOR_BEGINNERS":5790,"SOULSHOT_FOR_BEGINNERS":5789,"LESSER_HEALING_POT":1060,"ECHO_BATTLE":4412,"ECHO_LOVE":4413,"ECHO_SOLITUDE":4414,"ECHO_FEAST":4415,"ECHO_CELEBRATION":4416}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00101_SwordOfSolidarity/Q00101_SwordOfSolidarity.java

NPC квеста

IDНазваниеСтарт квестаУровень
30008RoienДа70
30283AltranНет70

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

else if (player.getLevel() < 9)

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

giveItems(player, ROIENS_LETTER, 1);
giveItems(player, DIR_TO_RUINS, 1);
giveItems(player, SWORD_OF_SOLIDARITY, 1);
giveItems(player, LESSER_HEALING_POT, 100);
giveItems(player, SPIRITSHOT_FOR_BEGINNERS, 3000);
giveItems(player, SOULSHOT_FOR_BEGINNERS, 7000);
giveItems(player, ECHO_BATTLE, 10);
giveItems(player, ECHO_LOVE, 10);
giveItems(player, ECHO_SOLITUDE, 10);
giveItems(player, ECHO_FEAST, 10);
giveItems(player, ECHO_CELEBRATION, 10);
giveItems(player, BROKEN_SWORD_HANDLE, 1);
giveItems(player, ALTRANS_NOTE, 1);
giveItems(killer, BROKEN_BLADE_TOP, 1);
giveItems(killer, BROKEN_BLADE_BOTTOM, 1);

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

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

[30008-01.htm] Grand Master Roein: Perhaps you have heard of the Sword of Solidarity? They say it is a find blade treasured by the Elves that resided on this island long ago. Theses days, whenever I have the time I visit the libraries within Einhovant's School of Magic, to look through books and read stories related to the sword. Seeing that it is recorded not only in Human history books but also in those of Elves, it seems certain that this sword really existed... If this Sword of Solidarity really existed, wouldn't it be hidden somewhere on the island? Such a precious and magnificent blade as that would not be easily destroyed or abandoned... I plan to search the island for the sword some day. If you are interested, won't you come along? (This quest may only be undertaken by a character of level 9 and above.) [30008-01a.htm] Grand Master Roien: You have traveled quite far from your homeland, young stranger of a foreign race. I'm sorry, but I have no work for you. (This quest may only be undertaken by a Human character.) [30008-02.htm] Grand Master Roien: In the past, this island was where Elves taught us Humans their magic. In the year marking the hundredth anniversary of the Humans coming to this remote island to learn the magic of the Elves, Human magicians commissioned a Dwarven craftsman to create a beautiful sword that was presented to the Elves. It was a sign of thanks for their teaching the Humans magic, and a symbol of the pledge to strengthen the unity between the two Human and Elf races. The Elves named this present the Sword of Solidarity. Ask about the Sword of Solidarity [30008-02a.htm] Grand Master Roien: A thousand years ago, war arose between the Humans and the Elves, and the Elves were eventually defeated. The Elves of Talking Island said that the present they had received was not a Sword of solidarity but a sword of betrayal, and broke the blade in half before leaving the island. Thereafter, the Elves never returned to this island, and the building where they had taught magic was abandoned and became the present Elven Ruins. I read about the sword in a history book, and came to believe that it is hidden somewhere on this island. A few weeks ago, one of my pupils discovered an old sword handle during his exploration of the ruins. Upon close examination of the engravings on the handle, it exactly matched a text recorded in the Elven historical book that speak of the Sword of Solidarity. I am certain that the handle is a part of the Sword of Solidarity. It is my opinion that if the rest of the blade can be found, we can recreate the Sword of Solidarity that has only existed in history books until now. Ask about the remaining portions [30008-02b.htm] Grand Master Roien: A few days ago, I mentioned the sword handle to Blacksmith Altran over a couple of drinks, and he showed avid interest in it. He says that if only he had the blade portion, he could resurrect the sword to its original state, and suggested that since it is probably somewhere in the ruins, we should send someone to go and find it. Regretfully, I am occupied with the construction that is going on for the outer walls of the training hall, which was destroyed during a storm, and cannot perform the task myself. But I think you would be able to help Altran... What do you think? Will you give it a try? Say you will perform the task [30008-03.htm] Grand Master Roien: First, go and show this letter to Blacksmith Altran. In the letter, I have organized information that I've discovered regarding the Sword of Solidarity during my research of Ancient Scrolls at Einhovant's School of Magic. Altran says that his ancestors created the blade and asked me to research information about the sword. You can meet Altran by going to the village forge. Thank you. [30008-03a.htm] Grand Master Roien: I hear you are helping Altran. He says that you will bring back the broken blade from the Elven Ruins. Good luck! [30008-04.htm] Grand Master Roien: Please deliver my letter to Blacksmith Altran. You can find him at the village forge. [30008-05.htm] Grand Master Roien: You've found all the pieces of the broken blade?! What wonderful news! Now Altran can restore the Sword of Solidarity. But in order to do so, he's going to need the sword handle. Now, take this to Altran. Please tell him that it is given to him in thanks for all the help he has given us with the reconstruction of the training hall. [30008-05a.htm] Grand Master Roien: What, you haven't left yet? Go and deliver the sword handle to Blacksmith Altran immediately. [30008-06.htm] Grand Master Roien: So you've found all the pieces of the broken blade! Take them to Altran immediately! [30283-01.htm] Blacksmith Altran: Ah! Roein's Letter! Thank you! So they say that the craftsman in the legend that created the 'Sword of Solidarity' was a Dwarf, like me? A sword created by my ancestors a thousand years ago ... I'm curious to see what it looks like. If only we could find the missing broken blades, I would be able to return the Sword of Solidarity to its original state... I hope you can recover the blade fragments. Is that too difficult of a task to ask? Say that you will search for the broken blade portions [30283-02.htm] Blacksmith Altran: According to Roien's research, the blade was broken into two parts, and they are probably somewhere in the Elven Ruins. They may even be in the dirty hands of the Orcs that live in the ruins... But those Orcs don't know how to deal with Steel, and probably don't have the skills to reassemble the pieces. They're probably using it to skin rabbits or something. Go to the Elven Ruins and search for the two pieces of the broken blade. I'm sure you don't know the way, so I will write down the directions on this note. Be careful! They say that the ruins are not only full of Orcs, but other savage beasts as well. [30283-03.htm] Blacksmith Altran: If you can't find the Elven Ruins even with the directions I've given, ask the Village Guard Kenyos. When you find the two pieces of the blade, bring them to me. [30283-04.htm] Blacksmith Altran: So you've managed to find it! Hmm... I will have to attach the two halves of the blade together, but the task is going to take some time. Meanwhile, go and see Roien. I will write a note asking for the sword handle, and you will please deliver the note to Roien. [30283-04a.htm] Blacksmith Altran: I have to connect the two broken halves together, but it will be more difficult task than I thought. I'm calculating in my mind how high the temperature of the furnace must be, how many times I should hammer the blade, and other factors. By the way, have you brought back the sword handle from Roien? What do you mean, not yet? Look, if you don't have the sword handle, I can't restore this sword to its original state! [30283-05.htm] Blacksmith Altran: So this is the sword handle. While you were visiting the training hall, I managed to attach the broken blade fragments together. All I have to do now is attach the handle ... Would you wait a moment? Wait until Altran finishes his task [30283-06.htm] Blacksmith Altran: Ta da, it's finished! This is the legendary Sword of Solidarity. Isn't it beautiful? The blade has been crafted of Mithril and hasn't lost its sharpness yet! As my ancestors created this Sword of Solidarity for the Humans of this island a thousand years ago, I will now present you with this sword. Please do not refuse, and accept it as a gift. For your information, Dwarves are happiest when the weapons they create have been placed in the hands of a skilled user. The way I see it, you are qualified to receive this sword. I hope that you will perform a mighty deed appropriate for a sword with such a great history. And if anyone should ask, tell them that Blacksmith Altran reconstructed this sword! May the grace of Maphr be with you!
Исходник условий и наград (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.Q00101_SwordOfSolidarity;

import org.l2jmobius.gameserver.entity.actor.Npc;
import org.l2jmobius.gameserver.entity.actor.Player;
import org.l2jmobius.gameserver.entity.actor.enums.creature.Race;
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.mechanics.variables.PlayerVariables;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;

public class Q00101_SwordOfSolidarity extends Quest
{
	// NPCs
	private static final int ROIEN = 30008;
	private static final int ALTRAN = 30283;
	
	// Items
	private static final int BROKEN_SWORD_HANDLE = 739;
	private static final int BROKEN_BLADE_BOTTOM = 740;
	private static final int BROKEN_BLADE_TOP = 741;
	private static final int ROIENS_LETTER = 796;
	private static final int DIR_TO_RUINS = 937;
	private static final int ALTRANS_NOTE = 742;
	private static final int SWORD_OF_SOLIDARITY = 738;
	private static final int SPIRITSHOT_FOR_BEGINNERS = 5790;
	private static final int SOULSHOT_FOR_BEGINNERS = 5789;
	private static final int LESSER_HEALING_POT = 1060;
	private static final int ECHO_BATTLE = 4412;
	private static final int ECHO_LOVE = 4413;
	private static final int ECHO_SOLITUDE = 4414;
	private static final int ECHO_FEAST = 4415;
	private static final int ECHO_CELEBRATION = 4416;
	
	public Q00101_SwordOfSolidarity()
	{
		super(101, "Sword of Solidarity");
		registerQuestItems(BROKEN_SWORD_HANDLE, BROKEN_BLADE_BOTTOM, BROKEN_BLADE_TOP);
		addStartNpc(ROIEN);
		addTalkId(ROIEN, ALTRAN);
		addKillId(20361, 20362);
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		final String htmltext = event;
		final QuestState st = getQuestState(player, false);
		if (st == null)
		{
			return htmltext;
		}
		
		switch (event)
		{
			case "30008-03.htm":
			{
				st.startQuest();
				giveItems(player, ROIENS_LETTER, 1);
				break;
			}
			case "30283-02.htm":
			{
				st.setCond(2, true);
				takeItems(player, ROIENS_LETTER, 1);
				giveItems(player, DIR_TO_RUINS, 1);
				break;
			}
			case "30283-06.htm":
			{
				takeItems(player, BROKEN_SWORD_HANDLE, 1);
				giveItems(player, SWORD_OF_SOLIDARITY, 1);
				giveItems(player, LESSER_HEALING_POT, 100);
				
				// Give newbie reward if player is eligible
				if (player.isNewbie())
				{
					int newPlayerRewardsReceived = player.getVariables().getInt(PlayerVariables.NEWBIE_SHOTS_RECEIVED, 0);
					if (newPlayerRewardsReceived < 2)
					{
						st.showQuestionMark(26);
						if (player.isMageClass())
						{
							st.playTutorialVoice("tutorial_voice_027");
							giveItems(player, SPIRITSHOT_FOR_BEGINNERS, 3000);
							player.getVariables().set(PlayerVariables.NEWBIE_SHOTS_RECEIVED, ++newPlayerRewardsReceived);
						}
						else
						{
							st.playTutorialVoice("tutorial_voice_026");
							giveItems(player, SOULSHOT_FOR_BEGINNERS, 7000);
							player.getVariables().set(PlayerVariables.NEWBIE_SHOTS_RECEIVED, ++newPlayerRewardsReceived);
						}
					}
				}
				
				giveItems(player, ECHO_BATTLE, 10);
				giveItems(player, ECHO_LOVE, 10);
				giveItems(player, ECHO_SOLITUDE, 10);
				giveItems(player, ECHO_FEAST, 10);
				giveItems(player, ECHO_CELEBRATION, 10);
				player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
				st.exitQuest(false, true);
				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:
			{
				if (player.getRace() != Race.HUMAN)
				{
					htmltext = "30008-01a.htm";
				}
				else if (player.getLevel() < 9)
				{
					htmltext = "30008-01.htm";
				}
				else
				{
					htmltext = "30008-02.htm";
				}
				break;
			}
			case State.STARTED:
			{
				final int cond = (st.getCond());
				switch (npc.getId())
				{
					case ROIEN:
					{
						if (cond == 1)
						{
							htmltext = "30008-04.htm";
						}
						else if (cond == 2)
						{
							htmltext = "30008-03a.htm";
						}
						else if (cond == 3)
						{
							htmltext = "30008-06.htm";
						}
						else if (cond == 4)
						{
							htmltext = "30008-05.htm";
							st.setCond(5, true);
							takeItems(player, ALTRANS_NOTE, 1);
							giveItems(player, BROKEN_SWORD_HANDLE, 1);
						}
						else if (cond == 5)
						{
							htmltext = "30008-05a.htm";
						}
						break;
					}
					case ALTRAN:
					{
						if (cond == 1)
						{
							htmltext = "30283-01.htm";
						}
						else if (cond == 2)
						{
							htmltext = "30283-03.htm";
						}
						else if (cond == 3)
						{
							htmltext = "30283-04.htm";
							st.setCond(4, true);
							takeItems(player, DIR_TO_RUINS, 1);
							takeItems(player, BROKEN_BLADE_TOP, 1);
							takeItems(player, BROKEN_BLADE_BOTTOM, 1);
							giveItems(player, ALTRANS_NOTE, 1);
						}
						else if (cond == 4)
						{
							htmltext = "30283-04a.htm";
						}
						else if (cond == 5)
						{
							htmltext = "30283-05.htm";
						}
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player killer, boolean isSummon)
	{
		final QuestState qs = getQuestState(killer, false);
		if ((qs != null) && qs.isCond(2) && (getRandom(5) == 0))
		{
			if (!hasQuestItems(killer, BROKEN_BLADE_TOP))
			{
				giveItems(killer, BROKEN_BLADE_TOP, 1);
				if (hasQuestItems(killer, BROKEN_BLADE_BOTTOM))
				{
					qs.setCond(3, true);
				}
				else
				{
					playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
			}
			else if (!hasQuestItems(killer, BROKEN_BLADE_BOTTOM))
			{
				giveItems(killer, BROKEN_BLADE_BOTTOM, 1);
				if (hasQuestItems(killer, BROKEN_BLADE_TOP))
				{
					qs.setCond(3, true);
				}
				else
				{
					playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
				}
			}
		}
	}
}