ZURSULUS L2

1000 years, the End of Lamentation

ID
344
Название
1000 years, the End of Lamentation
start_npcs_json
[30754]
npc_ids_json
[30623,30704,30754,30756,30857]
constants_json
{"GILMORE":30754,"RODEMAI":30756,"ORVEN":30857,"KAIEN":30623,"GARVARENTZ":30704,"ARTICLE_DEAD_HERO":4269,"OLD_KEY":4270,"OLD_HILT":4271,"OLD_TOTEM":4272,"CRUCIFIX":4273}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00344_1000YearsTheEndOfLamentation/Q00344_1000YearsTheEndOfLamentation.java

NPC квеста

IDНазваниеСтарт квестаУровень
30623KaienНет70
30704GarvarentzНет70
30754GilmoreДа70
30756Sir Kristof RodemaiНет70
30857OrvenНет70

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

htmltext = (player.getLevel() < 48) ? "30754-01.htm" : "30754-02.htm";

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

giveAdena(player, amount * 60, true);
giveItems(player, OLD_KEY, 1);
giveItems(player, OLD_HILT, 1);
giveItems(player, OLD_TOTEM, 1);
giveItems(player, CRUCIFIX, 1);
giveItems(player, 1875, 19);
giveItems(player, 952, 5);
giveItems(player, 2437, 1);
giveItems(player, 1882, 70);
giveItems(player, 1881, 50);
giveItems(player, 191, 1);
giveItems(player, 1874, 25);
giveItems(player, 1887, 10);
giveItems(player, 951, 1);
giveItems(player, 133, 1);
giveItems(player, 1879, 55);
giveItems(player, 951, 1);
giveItems(player, 885, 1);
giveItems(player, ARTICLE_DEAD_HERO, 1);

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

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

[30623-01.htm] Duelist Kaien: This is the first I've heard of that! I'm so sorry, obviously you've gone to a great deal of trouble for nothing... Wait a moment~ Could I take a closer look at that? This design is remarkably similar to the one engraved on a scabbard that I received from my father... I am beginning to believe you now. I come from a long line of dualists! It has been a tradition in my family for over a thousand years! Charming, no? Thank you, I will accept this... I wish I had more to offer you in return! Please accept these worthless trinkets as a token of my appreciation! [30623-02.htm] Duelist Kaien: Your hilt has been taken to a Dwarven craftsman who will fashion a suitable blade for it... Aren't you excited?! [30704-01.htm] High Prefect Garvarentz: This necklace and statue prove that what you say is true. Last night I dreamed of an orc. His large body was covered with scars and he was drenched in what must have been his enemy's blood. He gave me this necklace... Thank you, young traveler. Now I shall give the necklace to you. Use it carefully. [30704-02.htm] High Prefect Garvarentz: I have entrusted the amulet necklace to my daughter, who I have sent north to the Orc Fortress. She will wear the necklace in battle. I pray the mighty spirit of her ancestor will watch over her. [30754-01.htm] Antharas Watchman Gilmore: I've not left Dragon Valley since I led my men here so many years ago to battle Antharas... I have accepted the inevitability of my eternal responsibility to watch over the beast. But my heart goes out to the loyal soldiers who lost their lives due to my stubborn ignorance. I have no other wish than to see their remains returned to their hometowns, but I fear that you are not up to the task... (This quest may only be undertaken by a character of level 48 and above.) [30754-02.htm] Antharas Watchman Gilmore: I've not left Dragon Valley since I led my men here so many years ago to battle Antharas... I have accepted the inevitability of my eternal responsibility to watch over the beast. But my heart goes out to the loyal soldiers who lost their lives due to my stubborn ignorance. I have no other wish than to see their remains returned to their hometowns so they can rest in peace. "I will help you." [30754-03.htm] Antharas Watchman Gilmore: Alas, their souls have been lost to the beast. Now they wander the valley, preying on innocent passersby. They have come to be known as cave servants. "Tell me more, Gilmore." [30754-04.htm] Antharas Watchman Gilmore: Surely you have heard of the untold numbers that have died trying to slay Antharas. The fortunate among them were called back to the bosom of Shilen. The unfortunate ones are now the cave servants. I couldn't begin to tell you how many these are now in the valley. You must simply kill as many as you can. These are several types of cave servants, among them cave servant archers, cave servant warriors, and cave servant captains. You must kill them all. If they leave any relics behind, please bring them to me. You shall be well-rewarded. [30754-05.htm] Antharas Watchman Gilmore: Believe it or not we gave our lives willingly to save Giran! But we never counted on being here for eternity, let alone looking like this! It's been a thousand years and still I long for my mortal life... Give him the relics. [30754-06.htm] Antharas Watchman Gilmore: Thank you! Please take this as a token of my appreciation. Thanks to you the noble soldiers can finally rest in peace... I am afraid that there are many more, however, who still wander this valley. Would you be willing to continue doing this for a while? "I will continue the work." "I quit." [30754-06a.htm] Antharas Watchman Gilmore: What's that? Oh, for some reason, I was sure that you had brought back relics. You should be out killing cave servants. You must do whatever you can to release my men from their endless torment. [30754-07.htm] Antharas Watchman Gilmore: Oh, thank you! I knew I could depend on you. This could go on for a while. There seems to be no end of cave servants in this cursed valley. [30754-08.htm] Antharas Watchman Gilmore: Oh, well, you have done much good. I knew you wouldn't stay here forever, as I and my soldiers must do. Thank you for helping me and my men. Goodbye... [30754-09.htm] Antharas Watchman Gilmore: Is there something keeping you here? Why aren't you out killing cave servants? Bring me back any relics they leave behind. [30754-10.htm] Antharas Watchman Gilmore: Could it be? If my eyes aren't deceiving me this used to belong to a friend of mine... "Tell me more, Gilmore." [30754-11.htm] Antharas Watchman Gilmore: This crucifix belonged to one of the brave young soldiers who accompanied me here 1,000 years ago to battle the beast Antharas. At that time it shone like the sun. Now it looks so old and weathered... He worshipped in a temple that stood where Aden Castle stands now. Please go to Aden Castle Town and take this crucifix to the temple of Einhasad. Show it to a High Priest at the temple, he will know what to do with it. Even if I could leave the valley to travel there, an undead such as myself could never enter the temple. If you will do this for me I will pay you well. [30754-12.htm] Antharas Watchman Gilmore: My personal aide wore this key around his neck. He stood by my side during the battle with Antharas 1,000 years ago. He was the first-born son in his family... This key was very important to him. I believe one of his descendants is living in Giran Castle Town. He has the family name of Rodemai. I am bound to this valley so cannot go myself. Would you please take the key to Rodemai in Giran Castle Town? I will pay you for your trouble. [30754-13.htm] Antharas Watchman Gilmore: This sword belonged to one of my aides who fought alongside me against Antharas 1,000 years ago. In the intervening years the blade must have rusted away and only this hilt is left. He was a swordsman without parallel... It is said that one of his descendants is living in Oren Castle Town. It is likely that he is following the family tradition of being a Duelist. I am unable to leave this valley or I would take this relic to him. Would you please do this for me? I will pay you for your trouble. [30754-14.htm] Antharas Watchman Gilmore: This necklace belonged to a soldier that served under my command in the battle against Antharas. He was the finest Orc I've ever known, a true intellectual. Seriously! I'm fairly certain he was of aristocratic birth. Come to think of it, I've seen that necklace elsewhere. It was worn by an Orc who was a High Prefect from Hunters Village. I would take the necklace to him if I was able to leave this valley, but alas, I cannot. Would you please take it to him? I will compensate you well for your trouble. [30754-15.htm] Antharas Watchman Gilmore: Please go ahead and deliver the relic I gave you. You can come back and resume dispatching the cave servants afterwards. [30754-16.htm] Antharas Watchman Gilmore: Were they surprised to see a relic from a 1,000-year-old ancestor? Good work, my friend! Please accept this reward along with the compensation for having to travel so far. The brave soldiers who have finally obtained peace must be very grateful to you... But there are still many here in the valley who live in eternal torment. Will you continue to give them rest? "I will continue the work." "I quit." [30756-01.htm] Sir Kristof Rodemai: Really! So the ancestors of the Rodemai family participated in the expedition to fight Antharas during the Elmoreden Empire? Yes, that does sound familiar. My family has always been a self-sacrificing lot... This key proves it. So, how about that? I appreciate your bringing me something so precious! Here, take this as a token of my appreciation for your hard work. [30756-02.htm] Sir Kristof Rodemai: The recovery of this key has restored the honor of the Rodemai family. It actually traces our ancestry back to the time of the ancient empire! I hope that you will continue working for us... [30857-01.htm] High Priest Orven: This looks like a badge from our temple...? Don't tell me... Could it be a relic from the battle against Antharas 1,000 years ago? How could it be? I have always feared that our efforts to slay Antharas have been in vain. This old badge tells me that our responsibilities cannot be avoided, no matter the cost. Thank you, young traveler. Please take this small token of appreciation from our temple. [30857-02.htm] High Priest Orven: The badge is safe with other sacred relics deep within the temple. Many fail to grasp the significance of this old piece of metal, but I hear it calling me to my duty...
Исходник условий и наград (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.Q00344_1000YearsTheEndOfLamentation;

import java.util.HashMap;
import java.util.Map;

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;

public class Q00344_1000YearsTheEndOfLamentation extends Quest
{
	// NPCs
	private static final int GILMORE = 30754;
	private static final int RODEMAI = 30756;
	private static final int ORVEN = 30857;
	private static final int KAIEN = 30623;
	private static final int GARVARENTZ = 30704;
	
	// Items
	private static final int ARTICLE_DEAD_HERO = 4269;
	private static final int OLD_KEY = 4270;
	private static final int OLD_HILT = 4271;
	private static final int OLD_TOTEM = 4272;
	private static final int CRUCIFIX = 4273;
	
	// Drop chances
	private static final Map<Integer, Integer> CHANCES = new HashMap<>();
	static
	{
		CHANCES.put(20236, 380000);
		CHANCES.put(20237, 490000);
		CHANCES.put(20238, 460000);
		CHANCES.put(20239, 490000);
		CHANCES.put(20240, 530000);
		CHANCES.put(20272, 380000);
		CHANCES.put(20273, 490000);
		CHANCES.put(20274, 460000);
		CHANCES.put(20275, 490000);
		CHANCES.put(20276, 530000);
	}
	
	public Q00344_1000YearsTheEndOfLamentation()
	{
		super(344, "1000 years, the End of Lamentation");
		registerQuestItems(ARTICLE_DEAD_HERO, OLD_KEY, OLD_HILT, OLD_TOTEM, CRUCIFIX);
		addStartNpc(GILMORE);
		addTalkId(GILMORE, RODEMAI, ORVEN, GARVARENTZ, KAIEN);
		addKillId(20236, 20237, 20238, 20239, 20240, 20272, 20273, 20274, 20275, 20276);
	}
	
	@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 "30754-04.htm":
			{
				st.startQuest();
				break;
			}
			case "30754-07.htm":
			{
				if (st.get("success") != null)
				{
					st.setCond(1, true);
					st.unset("success");
				}
				break;
			}
			case "30754-08.htm":
			{
				st.exitQuest(true, true);
				break;
			}
			case "30754-06.htm":
			{
				if (!hasQuestItems(player, ARTICLE_DEAD_HERO))
				{
					htmltext = "30754-06a.htm";
				}
				else
				{
					final int amount = getQuestItemsCount(player, ARTICLE_DEAD_HERO);
					
					takeItems(player, ARTICLE_DEAD_HERO, -1);
					giveAdena(player, amount * 60, true);
					
					// Special item, % based on actual number of qItems.
					if (getRandom(1000) < Math.min(10, Math.max(1, amount / 10)))
					{
						htmltext = "30754-10.htm";
					}
				}
				break;
			}
			case "30754-11.htm":
			{
				final int random = getRandom(4);
				if (random < 1)
				{
					htmltext = "30754-12.htm";
					giveItems(player, OLD_KEY, 1);
				}
				else if (random < 2)
				{
					htmltext = "30754-13.htm";
					giveItems(player, OLD_HILT, 1);
				}
				else if (random < 3)
				{
					htmltext = "30754-14.htm";
					giveItems(player, OLD_TOTEM, 1);
				}
				else
				{
					giveItems(player, CRUCIFIX, 1);
				}
				
				st.setCond(2, 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:
			{
				htmltext = (player.getLevel() < 48) ? "30754-01.htm" : "30754-02.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case GILMORE:
					{
						if (cond == 1)
						{
							htmltext = (hasQuestItems(player, ARTICLE_DEAD_HERO)) ? "30754-05.htm" : "30754-09.htm";
						}
						else if (cond == 2)
						{
							htmltext = (st.get("success") != null) ? "30754-16.htm" : "30754-15.htm";
						}
						break;
					}
					default:
					{
						if (cond == 2)
						{
							if (st.get("success") != null)
							{
								htmltext = npc.getId() + "-02.htm";
							}
							else
							{
								rewards(st, npc.getId());
								htmltext = npc.getId() + "-01.htm";
							}
						}
						break;
					}
				}
				break;
			}
		}
		
		return htmltext;
	}
	
	private void rewards(QuestState st, int npcId)
	{
		final Player player = st.getPlayer();
		switch (npcId)
		{
			case ORVEN:
			{
				if (hasQuestItems(player, CRUCIFIX))
				{
					st.set("success", "1");
					takeItems(player, CRUCIFIX, -1);
					
					final int chance = getRandom(100);
					if (chance < 80)
					{
						giveItems(player, 1875, 19);
					}
					else if (chance < 95)
					{
						giveItems(player, 952, 5);
					}
					else
					{
						giveItems(player, 2437, 1);
					}
				}
				break;
			}
			case GARVARENTZ:
			{
				if (hasQuestItems(player, OLD_TOTEM))
				{
					st.set("success", "1");
					takeItems(player, OLD_TOTEM, -1);
					
					final int chance = getRandom(100);
					if (chance < 55)
					{
						giveItems(player, 1882, 70);
					}
					else if (chance < 99)
					{
						giveItems(player, 1881, 50);
					}
					else
					{
						giveItems(player, 191, 1);
					}
				}
				break;
			}
			case KAIEN:
			{
				if (hasQuestItems(player, OLD_HILT))
				{
					st.set("success", "1");
					takeItems(player, OLD_HILT, -1);
					
					final int chance = getRandom(100);
					if (chance < 60)
					{
						giveItems(player, 1874, 25);
					}
					else if (chance < 85)
					{
						giveItems(player, 1887, 10);
					}
					else if (chance < 99)
					{
						giveItems(player, 951, 1);
					}
					else
					{
						giveItems(player, 133, 1);
					}
				}
				break;
			}
			case RODEMAI:
			{
				if (hasQuestItems(player, OLD_KEY))
				{
					st.set("success", "1");
					takeItems(player, OLD_KEY, -1);
					
					final int chance = getRandom(100);
					if (chance < 80)
					{
						giveItems(player, 1879, 55);
					}
					else if (chance < 95)
					{
						giveItems(player, 951, 1);
					}
					else
					{
						giveItems(player, 885, 1);
					}
				}
				break;
			}
		}
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		final QuestState st = getQuestState(player, false);
		if ((st == null) || !st.isCond(1))
		{
			return;
		}
		
		if (getRandom(1000000) < CHANCES.get(npc.getId()))
		{
			giveItems(player, ARTICLE_DEAD_HERO, 1);
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
		}
	}
}