ZURSULUS L2

Fate's Whisper

ID
234
Название
Fate's Whisper
start_npcs_json
[31002]
npc_ids_json
[]
constants_json
{"REIRIA_SOUL_ORB":4666,"KERMON_INFERNIUM_SCEPTER":4667,"GOLKONDA_INFERNIUM_SCEPTER":4668,"HALLATE_INFERNIUM_SCEPTER":4669,"INFERNIUM_VARNISH":4672,"REORIN_HAMMER":4670,"REORIN_MOLD":4671,"PIPETTE_KNIFE":4665,"RED_PIPETTE_KNIFE":4673,"CRYSTAL_B":1460,"STAR_OF_DESTINY":5011}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00234_FatesWhisper/Q00234_FatesWhisper.java

NPC квеста

Записей нет.

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

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

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

giveItems(player, INFERNIUM_VARNISH, 1);
giveItems(player, PIPETTE_KNIFE, 1);
giveItems(player, aGradeItemId, 1);
giveItems(player, STAR_OF_DESTINY, 1);
giveItems(player, REORIN_HAMMER, 1);
giveItems(player, REORIN_MOLD, 1);
giveItems(player, REIRIA_SOUL_ORB, 1);
giveItems(player, itemId, 1);
giveItems(attacker, RED_PIPETTE_KNIFE, 1);

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

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

[30178-01.htm] Trader Zenkin: Maestro Reorin's Mold? Yes, I bought it from him a year ago. I got a great deal on it. Actually, since it was a tool used by such a famous artisan, I was ready to pay considerably more for it. When I saw how cheaply he had it priced, I snatched it right up. As soon as I gave him the adena Maestro Reorin ran to a liquor store. I hated to see him like that. He was so well-respected at one time... "I would like to buy the mold from you." [30178-01a.htm] Trader Zenkin: Sorry, my friend, I've already sold it! Just think about it! It was used by one of the top 10 artisans in the kingdom. Who wouldn't want to own it? Let me check my book. Please give me a minute. Ah, here it is. Magister Kaspar bought the mold a few months ago. He lives at Hardin's Academy. Anything else I can help you with? [30178-02.htm] Trader Zenkin: In case you are still looking for the Reorin's Mold, I told you before, I it to Magister Kaspar of Hardin's Academy. You can try asking him for it. Farewell then. [30182-01.htm] Warehouse Freightman Cliff: Ah, so you were sent by Maestro Reorin? What wonderful news! How is the Maestro? I am so glad to hear he is active again. I feel bad because I've been too busy to go and see him. What happened was so sad... To tell you the truth, I couldn't bear to look him in the eye. "I am looking for Infernium Varnish." [30182-01a.htm] Warehouse Freightman Cliff: Why do you seek Infernium Varnish? Don't tell me that Maestro Reorin is fooling around with demons again! He should know better than that, after what happened with demon Hallate... He was tricked into making scepters for them! Oh, that's not it this time, eh? "All the scepters have been recovered from the demons." [30182-01b.htm] Warehouse Freightman Cliff: Very impressive! All the scepters! How wonderful! I must report this to the superiors of the guild! Perhaps they will reconsider his banishment for "dealings with demons". What does he intend to do with the scepters? "He will melt them down in order to create something else." [30182-01c.htm] Warehouse Freightman Cliff: Splendid! What is he going to make? I can't wait to see it! Here you go, take this Infernium Varnish to the maestro immediately! I knew this stuff would come in handy someday... Now I am off to see the guild elders and tell them of the recovery of the scepters. Perhaps he will obtain a pardon! Don't tell him about this now, we wouldn't want to get his hopes up! Okay? [30182-02.htm] Warehouse Freightman Cliff: Have you given the Infernium Varnish back to Reorin yet? I hope all goes well for him now. [30833-01.htm] Magister Kaspar: Ah, you must have come for Maestro Reorin's Mold. How is Reorin? I should check you out. Uh oh, did I say that out loud? Sorry... I was just talking to myself. If you knew what I went through to get this mold, you would understand why I can't just give it to you for nothing... If you ask me to set a price on it, I will set it so high that you could not possibly afford it. But there is another way you can get it. Perhaps you could do a favor for me... "What do you want me to do?" [30833-01a.htm] Magister Kaspar: Oh! You're the one who explored the Tower of Insolence on behalf of Reorin! Hardin's Academy is not your ordinary place of learning. It constantly monitors world affairs. Recently there have been interesting developments around the Tower of Insolence. Even now, forces are gathering to fight over ancient relics that are supposedly hidden in the tower. Of course, our interests are different from theirs... "What are your interests?" [30833-01b.htm] Magister Kaspar: We hope to collect Baium's blood from the Tower of Insolence. Surely you have heard of how Baium was descended from King Shunaiman, who received the blessing of Einhasad in person! We must obtain the accursed royal blood from his veins. Take this pipet knife and cut Baium. Once the knife absorbs his blood and turns red, bring it to me. Although others have succeeded in infiltrating the tower recently, your task will not be easy. Go now and talk to Magister Hanellin of Aden Castle Town. [30833-02.htm] Magister Kaspar: Have you forgotten about our deal? Let me refresh your memory: You will need to talk to Magister Hanellin of Aden Castle Town. He will tell you how to enter Baium's room. Once inside, wake up Baium and stab with the pipette knife till his blood turns it red. Come back to me with the red pipette knife and I shall give you the Reorin's Mold. Ah, one more thing. The entrance to the room where Baium stays is locked. [30833-03.htm] Magister Kaspar: You exceeded my expectations! Excellent job! Obviously, there is more to you than meets the eye. I now see that the attention you've been getting is well-deserved. Well, as promised, here is Maestro Reorin's Mold. As it is said, a person's belongings have a way of finding their way home. Be careful on your way back to Reorin. Please tell him that Hardin will soon be ordering a new staff... [30833-04.htm] Magister Kaspar: What are you still doing here?! I already gave you Reorin's Mold! Just take it to him and get out of my way already! Can't you see I'm busy? [30847-01.htm] Head Blacksmith Ferris: Do you know Reorin? Then I suppose you've heard the news of his pardon! He's been reinstated as a regular guildsman! In the nick of time if you ask me. The guild could not afford to lose a maestro such as him. What's that? You are here for the Hammer of Maestro Reorin? Yes! It was seized when the maestro was expelled from the guild. Now take it back to him. Please congratulate him for me and tell him that I am looking forward to seeing the results of his new project. [30847-02.htm] Head Blacksmith Ferris: Have you taken Reorin's Hammer back to him? If so, what else do you need with me? I do not have anything else of his here. Go and ask Reorin what he needs. [31002-01.htm] Maestro Reorin: Hiccup~! Hey you whippersnapper! Stop bothering me... Go on, bother someone else! (This quest may only be undertaken by a character of level 75 and above.) "Why are you a drunk?" [31002-02.htm] Maestro Reorin: Are you the one that woman was talking about? What woman...? I don't know. I had never seen her before. She was quite beautiful, with blonde hair and blue eyes. She said that soon I would have an important visitor and that I should make a top-quality weapon for that person! Sadly, I've been thrown out of the guild. I explained to her that I no longer make weapons. But she wouldn't accept any of my excuses. She said that I would know after meeting you that I must once again pick up the hammer. But what am I to do? I drank away the money she gave me...Even if I wanted to make a weapon for you, I don't have the money to pay for the materials I need! "Why were you thrown out of the guild?" [31002-02a.htm] Maestro Reorin: I thought I had told you that already! I foolishly broke the guild's taboo and had dealings with a demon. My desire to create a masterpiece has been my ruin! However, I cannot turn back the hands of time. My honor has been destroyed and all of my apprentices have abandoned me. My pride is long-gone. Now I am reduced to working for the favor of those filthy demons. I have earned my new nickname, "blacksmith of demons". Now all I live for is the drink. Liquor is my only friend. "I will restore your honor!" [31002-02b.htm] Maestro Reorin: Don't bother! The only way I could possibly have my honor restored would be to stop my dealings with demons. However I... I... cannot refuse their requests. They have the soul of my wife, and are holding her hostage! If I don't do exactly as they say, they will throw her soul into eternal torment! I cannot let this happen to my dear Reiria, my honor is sacrificed for her! "I will rescue the soul of your wife!" [31002-02c.htm] Maestro Reorin: You? No. I can't let you do that. No one can stand up to those demons. Cabrio, the messenger of Shilen is the one who holds the soul of my wife in his grasp... However, if what that beautiful woman said is true... if you really are "the one who will shape the face of this continent for years to come"...perhaps you could do it... "I will save the soul of your wife!" [31002-03.htm] Maestro Reorin: Well, I suppose that I will have to trust you. But mark my words, if the soul of my wife suffers any torment, I will hold you personally responsible! Now listen carefully. Messenger Cabrio is a cruel collector of souls. This demon keeps the souls in this world, never allowing them to cross into eternal rest. Some time ago, the soul of my wife was added to his collection! He can be found in the Cemetery in Aden... Please free my wife's soul from this wicked demon... "Tell me more about the woman who came to see you?" [31002-04.htm] Maestro Reorin: That is all very hazy to me. I was sitting on my front porch, drunk as usual, and she appeared. She was accompanied by a black knight. Although I shall never forget that day, I cannot tell you much about their appearance. Now it seems like it was a dream... I do remember that she had an other-wordly beauty, with blonde hair and blue eyes. The knight was quite old, with gray hair and a dark countenance. Other than that... I cannot say... "What did she say?" [31002-04a.htm] Maestro Reorin: Ah yes, I shall never forget her words. In a soft and melodious voice she said, "Soon you will be visited by a very important person. One who will re-shape the face of the continent. Please make a top quality weapon for him." Then she smiled and turned away. The black knight then gave me a pouch filled with gold coins and told me to use it to buy the weapon... But then a few weeks passed with a visitor, and I began to believe that she was just a demented aristocrat. I soon drank up all the money... [31002-04b.htm] Maestro Reorin: I am counting on you to save my wife's soul from Messenger Cabrio. He can be found in the Cemetery in Aden... Please hurry and save her! [31002-05.htm] Maestro Reorin: The soul of Reiria is at rest... Yes, I feel she is finally at peace! My friend, I am in your debt. Now I shall have my revenge on her tormentor. My honor can now be restored, but I will need your help! "I will help you" [31002-05a.htm] Maestro Reorin: Those wicked demons forced me to make an infernium scepter. Infernium is a very rare element, seldom seen since the time of the Titans. They told me that I should be honored to be working with such a precious material. I must admit that this thought appealed to me, and I quickly set about creating the scepters for them. Now it is clear what I must do. I must recover the three scepters and melt them away so that they cannot be used by the demons. This will restore my honor! To do this, I will have to confront Death Lord Hallate and his minions! I will not be successful without your help. Please, help me do this! "Tell me about Death Lord Hallate" [31002-05b.htm] Maestro Reorin: Ah, yes, Death Lord Hallate... He leads the army of darkness. He is also known as the insolent invader and the archenemy of the angels. He plans to invade the Tower of Insolence and steal the ancient treasure that is on its highest floor. Longhorn General Golkonda and Kernon are assisting him. All three of these demons are carrying infernium scepters! Legend says that angels protected the tower with a powerful force field, shielding it from all with evil intent. However, using the scepter I made for him, Hallate has breached the shield. To think of the hours I spent toiling over that scepter, putting my heart and soul into it, and now it's come to this... [31002-05c.htm] Maestro Reorin: Did you forget what I had asked you to do? Death Lord Hallate leads the army of darkness. He is also known as the insolent invader and the archenemy of the angels. He plans to invade the Tower of Insolence and steal the ancient treasure that is on its highest floor. Longhorn General Golkonda and Kernon are assisting him. All three of these demons are carrying infernium scepters! Please go and retrieve these scepters and bring them to me so that I may destroy them! [31002-06.htm] Maestro Reorin: Is it true? Have you really slain Death Lord Hallate and his underlings...? Indeed, the mysterious woman was telling the truth. Yes, the infernium scepters... My greatest masterpiece and the key to my downfall... Now, I will gladly destroy them and create an even more powerful weapon for you! Do you smell that? It's the infernium. Smells like Sulfur, doesn't it? That's why the demons are so fond of it. An amazing material, really. Tougher and lighter than mithril, it is one of the finest materials you will find. It can be used to make Grade A weapon that you will find most useful. Refining this material can be tricky, however. I will need some Infernium Varnish. It is quite rare. "Where can I find Infernium Varnish?" [31002-06a.htm] Maestro Reorin: My former apprentice Cliff should have some. I must admit, I cannot bear to look him in the face. Through my darkest days, Cliff stuck by me. He only left after I became drunk and physically threw him out... Please go see Cliff and obtain the Infernium Varnish. He is now a warehouse keeper in Oren Castle Town. I am counting on you, my friend! [31002-06b.htm] Maestro Reorin: Did you find the Infernium Varnish, yet? You will need to talk to Warehouse Freightman Cliff in Oren and get some for me. [31002-07.htm] Maestro Reorin: Ah, the Infernium Varnish! I wish that you hadn't told him so much... I just wanted you to get the Varnish, not gossip about my personal business! Anyway, thanks for the Varnish. Things are going well. Yesterday, I received a letter from the president of the Black Anvil Guild! He says that he will pardon my sins and accept me as a guildsman. Yes, thanks to you, I've become a maestro again... Now I can set about making a weapon of the utmost quality for you! Unfortunately, I don't have the hammer I need to make it. If only I had my old hammer... "Where is your hammer?" [31002-07a.htm] Maestro Reorin: My rivals stole it from me when I was expelled from the guild! Instead of defending me, they helped themselves to my materials and tools! Thankfully, I was able to hide away my work journal. I have heard that the Head Blacksmith Ferris in Aden Castle Town has my hammer. At one time he was one of my apprentices. When I had my problems with the guild, he turned on me like a bad dog. I cannot bear to see him. Please go and get my hammer from him. [31002-07b.htm] Maestro Reorin: Now that I have cleansed by sins, I am ready to craft a weapon for you as reward...but I do need my special hammer back. Have you talked to Head Blacksmith Ferris in Aden Castle Town yet? I'm sure he'll give it to you if you tell him that you helped cleanse my sins. [31002-08.htm] Maestro Reorin: Ah, my hammer! Good job! It feels good to hold it in my hand again. How long has it been! The infernium is almost ready to be formed... Now the work can begin! Ah, yes, all I need now is the mold... Ahem... "Where is the mold?" [31002-08a.htm] Maestro Reorin: Well, you see, I was out of money and I really needed a drink, and well, you know...I sold it to Trader Zenkin of Oren Castle Town... Could I ask you but one more favor? Will you please go and see Trader Zenkin and buy the mold back for me? Oh, thank you! You are such a helpful person! [31002-08b.htm] Maestro Reorin: Have you talked to Trader Zenkin in Oren Castle Town about my mold yet? I hope he still has it with him, though it has been a while. Please go and ask him about it. [31002-09.htm] Maestro Reorin: My goodness, you had to go all the way to the Tower of Insolence to get this for me? Good job! Thanks to you, I can finally begin work on the weapon! Now I only need the last ingredient... "What do you need now?!" [31002-09a.htm] Maestro Reorin: Don't get upset, it's just one more little thing. Before the metal cools I must add some B grade crystals. If I apply this formula to the mass of the metal and allow for its its tensile strength... I have determined that I will need exactly 984 B grade crystals. Please bring them to me immediately! [31002-09b.htm] Maestro Reorin: If I apply this formula to the mass of the metal and allow for its tensile strength... I have determined that I will need exactly 984 B grade crystals. Please bring them to me immediately! [31002-10.htm] Maestro Reorin: Think it over, then, and let me know. [31002-11.htm] Maestro Reorin: Are you ready then? Have you brought a weapon like I described? I'd better inspect the weapons you are carrying and I'll tell you which ones among them will do the job. May I? Show him all the weapons you are carrying [31002-12.htm] Maestro Reorin: Be patient my young friend! I shall create a marvelous weapon for you, one that will make the earth tremble! Clang! Clang! Behold the power of the hammer of Maphr! Clang! Clang! Boom! Boom! Forged in the flames of Pa'agrio! Clang! Clang! Bang bang! Immersed in the water of Eva! Clang! Clang! Splash! Bang! Bang! Cooled with the wind of Sayha! I hear her laughing in my ear! Bang! Bang! Clang! Clang! The flames of passion heat the metal to the core! Such is the love in my heart! Clang! Clang! ...Voila! It is finished! Not to toot my own horn, but I'm one of only a handful of Dwarves capable of creating A grade weapons on this continent! I, Maestro Reorin, present you with this %weaponname%! Also, take this mark engraved with the Phoenix of Revolution or the Messenger of Dawn. The mysterious woman who foretold your coming asked me to give it to you... I suppose our time together is over. Thank you for your help. If you see that mysterious woman again, give her my regards! [31002-13.htm] Maestro Reorin: A %weaponname%? Are you sure? "Yes, a %weaponname%." "Let me think it over." [31002-14.htm] Maestro Reorin: Very well! I'll make the necessary preparations for a %weaponname%! This won't be easy, but it is what must be done! [31002-15.htm] Maestro Reorin: I hate to ask this, but I must have a %weaponname%. [31002-16.htm] Maestro Reorin: Are you trying to cheat me?! What happened to the weapon you were about to give me for the neutralization of Infernum's evil aura? [31002-AGradeList.htm] Maestro Reorin: What a perfect %weaponname%! This will suit our purpose admirably. So, what kind of A-Grade weapon do you want? I can make quite a variety; I am practically a walking blueprint library! Ask, and I'll make it right away. Tallum Blade Carnage Bow Halberd Elemental Sword Dasparion's Staff Bloody Orchid Blood Tornado Meteor Shower Keshanberk Dualsword Infernal Master Spiritual Eye Destroyer Hammer [31002-BGradeList.htm] Maestro Reorin: Did you bring all 984 Grade B Crystals? You came just in time. We've reached the perfect temperature for inserting the Crystals... Uh huh, it's not over yet! I still need one more ingredient. Pure Infernium is too soft to be made into weapons. It must be mixed with high quality Mithril in order to make an alloy. But it's just so hard to find good Mithril ore these days... The most reliable method is to melt a Grade B weapon down and use it instead. Understand? Now then, what kind of Grade B weapon can you bring? I'll have to adjust the temperature and the component ratio for the molten liquid, so you cannot change type of weapon later. Choose carefully! Also, you have to understand that any Enchantment or special capability the weapon possesses will disappear once it is thrown into the furnace! Don't forget that refined weapons are useless. Standard weapons are also useless! Sword of Damascus Samurai Dual-sword Bow of Peril Lance Art of Battle Axe Staff of Evil Spirits Demon Dagger Bellion Cestus Deadman's Glory Guardian Sword Wizard's Tear Star Buster Kaim Vanul's Bones [31027-01.htm] Messenger's Coffin: Inside the coffin, Reiria's Soul Orb was discovered. [31027-02.htm] Messenger's Coffin: The coffin is empty. [31028-01.htm] Chest of Kernon: Kernon's Infernium Scepter is in the chest. [31028-02.htm] Chest of Kernon: The chest is empty. [31029-01.htm] Chest of Golkonda: The Infernium Scepter of Golkonda is in the chest. [31029-02.htm] Chest of Golkonda: The chest is empty. [31030-01.htm] Chest of Hallate: Hallate's Infernium Scepter is in the chest. [31030-02.htm] Chest of Hallate: The chest is empty.
Исходник условий и наград (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.Q00234_FatesWhisper;

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

import org.l2jmobius.gameserver.data.xml.ItemData;
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;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;

public class Q00234_FatesWhisper extends Quest
{
	// Items
	private static final int REIRIA_SOUL_ORB = 4666;
	private static final int KERMON_INFERNIUM_SCEPTER = 4667;
	private static final int GOLKONDA_INFERNIUM_SCEPTER = 4668;
	private static final int HALLATE_INFERNIUM_SCEPTER = 4669;
	private static final int INFERNIUM_VARNISH = 4672;
	private static final int REORIN_HAMMER = 4670;
	private static final int REORIN_MOLD = 4671;
	private static final int PIPETTE_KNIFE = 4665;
	private static final int RED_PIPETTE_KNIFE = 4673;
	private static final int CRYSTAL_B = 1460;
	
	// Reward
	private static final int STAR_OF_DESTINY = 5011;
	
	// Chest Spawn
	private static final Map<Integer, Integer> CHEST_SPAWN = new HashMap<>();
	static
	{
		CHEST_SPAWN.put(25035, 31027);
		CHEST_SPAWN.put(25054, 31028);
		CHEST_SPAWN.put(25126, 31029);
		CHEST_SPAWN.put(25220, 31030);
	}
	
	// Weapons
	private static final Map<Integer, String> WEAPONS = new HashMap<>();
	static
	{
		WEAPONS.put(79, "Sword of Damascus");
		WEAPONS.put(97, "Lance");
		WEAPONS.put(171, "Deadman's Glory");
		WEAPONS.put(175, "Art of Battle Axe");
		WEAPONS.put(210, "Staff of Evil Spirits");
		WEAPONS.put(234, "Demon Dagger");
		WEAPONS.put(268, "Bellion Cestus");
		WEAPONS.put(287, "Bow of Peril");
		WEAPONS.put(2626, "Samurai Dual-sword");
		WEAPONS.put(7883, "Guardian Sword");
		WEAPONS.put(7889, "Wizard's Tear");
		WEAPONS.put(7893, "Kaim Vanul's Bones");
		WEAPONS.put(7901, "Star Buster");
	}
	
	public Q00234_FatesWhisper()
	{
		super(234, "Fate's Whisper");
		registerQuestItems(PIPETTE_KNIFE, RED_PIPETTE_KNIFE);
		addStartNpc(31002);
		addTalkId(31002, 30182, 30847, 30178, 30833, 31028, 31029, 31030, 31027);
		
		// The 4 bosses which spawn chests
		addKillId(25035, 25054, 25126, 25220);
		
		// Baium
		addAttackId(29020);
	}
	
	@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("31002-03.htm"))
		{
			st.startQuest();
		}
		else if (event.equals("30182-01c.htm"))
		{
			playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			giveItems(player, INFERNIUM_VARNISH, 1);
		}
		else if (event.equals("30178-01a.htm"))
		{
			st.setCond(6, true);
		}
		else if (event.equals("30833-01b.htm"))
		{
			st.setCond(7, true);
			giveItems(player, PIPETTE_KNIFE, 1);
		}
		else if (event.startsWith("selectBGrade_"))
		{
			if (st.getInt("bypass") == 1)
			{
				return null;
			}
			
			final String bGradeId = event.replace("selectBGrade_", "");
			st.set("weaponId", bGradeId);
			htmltext = getHtm(player, "31002-13.htm").replace("%weaponname%", WEAPONS.get(st.getInt("weaponId")));
		}
		else if (event.startsWith("confirmWeapon"))
		{
			st.set("bypass", "1");
			htmltext = getHtm(player, "31002-14.htm").replace("%weaponname%", WEAPONS.get(st.getInt("weaponId")));
		}
		else if (event.startsWith("selectAGrade_"))
		{
			if (st.getInt("bypass") == 1)
			{
				final int itemId = st.getInt("weaponId");
				if (hasQuestItems(player, itemId))
				{
					final int aGradeItemId = Integer.parseInt(event.replace("selectAGrade_", ""));
					htmltext = getHtm(player, "31002-12.htm").replace("%weaponname%", ItemData.getInstance().getTemplate(aGradeItemId).getName());
					takeItems(player, itemId, 1);
					giveItems(player, aGradeItemId, 1);
					giveItems(player, STAR_OF_DESTINY, 1);
					player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
					st.exitQuest(false, true);
				}
				else
				{
					htmltext = getHtm(player, "31002-15.htm").replace("%weaponname%", WEAPONS.get(itemId));
				}
			}
			else
			{
				htmltext = "31002-16.htm";
			}
		}
		
		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() < 75) ? "31002-01.htm" : "31002-02.htm";
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case 31002:
					{
						if (cond == 1)
						{
							if (!hasQuestItems(player, REIRIA_SOUL_ORB))
							{
								htmltext = "31002-04b.htm";
							}
							else
							{
								htmltext = "31002-05.htm";
								st.setCond(2, true);
								takeItems(player, REIRIA_SOUL_ORB, 1);
							}
						}
						else if (cond == 2)
						{
							if (!hasQuestItems(player, KERMON_INFERNIUM_SCEPTER) || !hasQuestItems(player, GOLKONDA_INFERNIUM_SCEPTER) || !hasQuestItems(player, HALLATE_INFERNIUM_SCEPTER))
							{
								htmltext = "31002-05c.htm";
							}
							else
							{
								htmltext = "31002-06.htm";
								st.setCond(3, true);
								takeItems(player, GOLKONDA_INFERNIUM_SCEPTER, 1);
								takeItems(player, HALLATE_INFERNIUM_SCEPTER, 1);
								takeItems(player, KERMON_INFERNIUM_SCEPTER, 1);
							}
						}
						else if (cond == 3)
						{
							if (!hasQuestItems(player, INFERNIUM_VARNISH))
							{
								htmltext = "31002-06b.htm";
							}
							else
							{
								htmltext = "31002-07.htm";
								st.setCond(4, true);
								takeItems(player, INFERNIUM_VARNISH, 1);
							}
						}
						else if (cond == 4)
						{
							if (!hasQuestItems(player, REORIN_HAMMER))
							{
								htmltext = "31002-07b.htm";
							}
							else
							{
								htmltext = "31002-08.htm";
								st.setCond(5, true);
								takeItems(player, REORIN_HAMMER, 1);
							}
						}
						else if ((cond > 4) && (cond < 8))
						{
							htmltext = "31002-08b.htm";
						}
						else if (cond == 8)
						{
							htmltext = "31002-09.htm";
							st.setCond(9, true);
							takeItems(player, REORIN_MOLD, 1);
						}
						else if (cond == 9)
						{
							if (getQuestItemsCount(player, CRYSTAL_B) < 984)
							{
								htmltext = "31002-09b.htm";
							}
							else
							{
								htmltext = "31002-BGradeList.htm";
								st.setCond(10, true);
								takeItems(player, CRYSTAL_B, 984);
							}
						}
						else if (cond == 10)
						{
							// If a weapon is selected
							if (st.getInt("bypass") == 1)
							{
								// If you got it in the inventory
								final int itemId = st.getInt("weaponId");
								htmltext = getHtm(player, (hasQuestItems(player, itemId)) ? "31002-AGradeList.htm" : "31002-15.htm").replace("%weaponname%", WEAPONS.get(itemId));
							}
							// B weapon is still not selected
							else
							{
								htmltext = "31002-BGradeList.htm";
							}
						}
						break;
					}
					case 30182:
					{
						if (cond == 3)
						{
							htmltext = !hasQuestItems(player, INFERNIUM_VARNISH) ? "30182-01.htm" : "30182-02.htm";
						}
						break;
					}
					case 30847:
					{
						if ((cond == 4) && !hasQuestItems(player, REORIN_HAMMER))
						{
							htmltext = "30847-01.htm";
							playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
							giveItems(player, REORIN_HAMMER, 1);
						}
						else if ((cond >= 4) && hasQuestItems(player, REORIN_HAMMER))
						{
							htmltext = "30847-02.htm";
						}
						break;
					}
					case 30178:
					{
						if (cond == 5)
						{
							htmltext = "30178-01.htm";
						}
						else if (cond > 5)
						{
							htmltext = "30178-02.htm";
						}
						break;
					}
					case 30833:
					{
						if (cond == 6)
						{
							htmltext = "30833-01.htm";
						}
						else if (cond == 7)
						{
							if (hasQuestItems(player, PIPETTE_KNIFE) && !hasQuestItems(player, RED_PIPETTE_KNIFE))
							{
								htmltext = "30833-02.htm";
							}
							else
							{
								htmltext = "30833-03.htm";
								st.setCond(8, true);
								takeItems(player, RED_PIPETTE_KNIFE, 1);
								giveItems(player, REORIN_MOLD, 1);
							}
						}
						else if (cond > 7)
						{
							htmltext = "30833-04.htm";
						}
						break;
					}
					case 31027:
					{
						if ((cond == 1) && !hasQuestItems(player, REIRIA_SOUL_ORB))
						{
							htmltext = "31027-01.htm";
							playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
							giveItems(player, REIRIA_SOUL_ORB, 1);
						}
						else
						{
							htmltext = "31027-02.htm";
						}
						break;
					}
					case 31028:
					case 31029:
					case 31030:
					{
						final int itemId = npc.getId() - 26361;
						if ((cond == 2) && !hasQuestItems(player, itemId))
						{
							htmltext = npc.getId() + "-01.htm";
							playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
							giveItems(player, itemId, 1);
						}
						else
						{
							htmltext = npc.getId() + "-02.htm";
						}
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onAttack(Npc npc, Player attacker, int damage, boolean isPet)
	{
		final QuestState st = attacker.getQuestState(getName());
		if ((st == null) || !st.isCond(7))
		{
			return;
		}
		
		if ((attacker.getActiveWeaponItem() != null) && (attacker.getActiveWeaponItem().getId() == PIPETTE_KNIFE) && !hasQuestItems(attacker, RED_PIPETTE_KNIFE))
		{
			playSound(attacker, QuestSound.ITEMSOUND_QUEST_ITEMGET);
			takeItems(attacker, PIPETTE_KNIFE, 1);
			giveItems(attacker, RED_PIPETTE_KNIFE, 1);
		}
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isPet)
	{
		addSpawn(CHEST_SPAWN.get(npc.getId()), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 120000);
	}
}