ZURSULUS L2

Test of the Reformer

ID
227
Название
Test of the Reformer
start_npcs_json
[30118]
npc_ids_json
[20022,20100,20102,20104,20404,27099,27128,27129,27130,27131,27132,30118,30666,30667,30668,30669,30670,30732]
constants_json
{"PUPINA":30118,"SLA":30666,"RAMUS":30667,"KATARI":30668,"KAKAN":30669,"NYAKURI":30670,"OL_MAHUM_PILGRIM":30732,"MISERY_SKELETON":20022,"SKELETON_ARCHER":20100,"SKELETON_MARKSMAN":20102,"SKELETON_LORD":20104,"SILENT_HORROR":20404,"NAMELESS_REVENANT":27099,"ARURAUNE":27128,"OL_MAHUM_INSPECTOR":27129,"OL_MAHUM_BETRAYER":27130,"CRIMSON_WEREWOLF":27131,"KRUDEL_LIZARDMAN":27132,"BOOK_OF_REFORM":2822,"LETTER_OF_INTRODUCTION":2823,"SLA_LETTER":2824,"GREETINGS":2825,"OL_MAHUM_MONEY":2826,"KATARI_LETTER":2827,"NYAKURI_LETTER":2828,"UNDEAD_LIST":2829,"RAMUS_LETTER":2830,"RIPPED_DIARY":2831,"HUGE_NAIL":2832,"LETTER_OF_BETRAYER":2833,"BONE_FRAGMENT_4":2834,"BONE_FRAGMENT_5":2835,"BONE_FRAGMENT_6":2836,"BONE_FRAGMENT_7":2837,"BONE_FRAGMENT_8":2838,"BONE_FRAGMENT_9":2839,"KAKAN_LETTER":3037,"MARK_OF_REFORMER":2821,"DIMENSIONAL_DIAMOND":7562,"DISRUPT_UNDEAD":1031}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00227_TestOfTheReformer/Q00227_TestOfTheReformer.java

NPC квеста

IDНазваниеСтарт квестаУровень
20022Misery SkeletonНет14
20100Skeleton ArcherНет13
20102Skeleton MarksmanНет14
20104Skeleton LordНет15
20404Silent HorrorНет16
27099Nameless RevenantНет38
27128ArurauneНет40
27129Ol Mahum InspectorНет38
27130Ol Mahum BetrayerНет36
27131Crimson WerewolfНет36
27132Krudel LizardmanНет36
30118PupinaДа70
30666SlaНет70
30667RamusНет70
30668KatariНет70
30669KakanНет70
30670NyakuriНет70
30732Ol Mahum PilgrimНет36

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

htmltext = (player.getLevel() < 39) ? "30118-01.htm" : "30118-03.htm";

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

giveItems(player, BOOK_OF_REFORM, 1);
giveItems(player, DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getPlayerClass().getId()));
giveItems(player, LETTER_OF_INTRODUCTION, 1);
giveItems(player, SLA_LETTER, 1);
giveItems(player, GREETINGS, 3);
giveItems(player, MARK_OF_REFORMER, 1);
addExpAndSp(player, 164032, 17500);
giveItems(player, KATARI_LETTER, 1);
giveItems(player, OL_MAHUM_MONEY, 1);
giveItems(player, KAKAN_LETTER, 1);
giveItems(player, NYAKURI_LETTER, 1);
giveItems(player, UNDEAD_LIST, 1);
giveItems(player, RAMUS_LETTER, 1);
giveItems(player, RIPPED_DIARY, 1);
giveItems(player, HUGE_NAIL, 1);
giveItems(player, LETTER_OF_BETRAYER, 1);
giveItems(player, BONE_FRAGMENT_4, 1);
giveItems(player, BONE_FRAGMENT_5, 1);
giveItems(player, BONE_FRAGMENT_6, 1);
giveItems(player, BONE_FRAGMENT_7, 1);
giveItems(player, BONE_FRAGMENT_8, 1);

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

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

[30118-01.htm] Priestess Pupina: Why have you come here? I see that you follow the path of service to the Lord as do I... Are you all right? Could it be that you are concerned about a higher level of faith, by any chance? You seem too young to have such worries... You must continue to seek the truth elsewhere. When you find your way obstructed, come back to see me. (This quest may only be undertaken by a character of level 39 and above.) [30118-02.htm] Priestess Pupina: I am a Priestess of the God of light. My calling is to give counsel to brothers and sisters who are struggling with their faith. Do you wish to convert to the path of Einhasad? If so, go and visit with those other priests over there. (This quest may only be undertaken by Clerics or Shillien Oracles.) [30118-03.htm] Priestess Pupina: Our faith teaches nonviolence, peace and sacrifice. I must confess that I question this when I see the current state of affairs. The world is overrun by evildoers and yet here we sit doing nothing but praying, training, giving remedies and alms... Sometimes I wish that I could make it a better world, where good people live in peace... Oh my... I've said too much. Please pay no mind to my mutterings... It is far too easy to be mistaken for a heretic around here... "At one time I had the same concerns." [30118-04.htm] Priestess Pupina: It is an honor to meet a fellow traveler... I suppose that such is the curse of the enlightened... You must keep these opinions close to your vest; they are quite taboo and can get you into trouble with the High Priests. Take this book, you should read it when you have the time. There is also a task that will help answer some of your questions. In the Execution Grounds of Dion there are Nameless Revenants wandering about. They must be laid to rest. Remember to strike the last blow with the magic of Disrupt Undead. [30118-04a.htm] Priestess Pupina: Have you changed your mind? If you are in search of the true faith, you must confront it rather than avoid it. Use your Disrupt Undead skill to destroy the Nameless Revenants that haunt the Execution Grounds. You will find that the temple has turned its back on them. [30118-04b.htm] Priest Pupina: I have finally met someone who sees the world as I do! Oh, but speak softly and take great care not to be overheard. The order, after all, bans even talking about matters of this kind. Here, take this book. Read it in secret and perhaps it will help enlighten you. But first, travel to the Dion Execution Ground. There, perhaps, your questions will be answered if you can defeat the Nameless Ghosts that wander that cursed place. You cannot permanently defeat them with physical means, so be sure to finish them off with Disrupt Undead magic. Finally, take this Dimension Diamond. You can trade it to the village gatekeeper for something special that may help you on your journey. [30118-05.htm] Priestess Pupina: A nail was driven into the head of the untamable Mandragora Aruraune to brainwash it. This is, basically, no different from what the Priests do every day, brainwashing ignorant people with their platitudes about light...Or perhaps we are the ones brainwashed... Now... I want you to meet someone. She is a former Priestess of this shrine who was defrocked after being accused of paganism. When she got into trouble I denied knowing anything about her beliefs. I could not afford to risk my position. If you have the courage of your convictions, you should go and talk to her. "I shall remain true to my beliefs." [30118-06.htm] Priestess Pupina: Excellent! It is good to see someone with integrity around here. You will find her teaching her beliefs to whoever will listen. In the Wastelands she is known as the 'wild plain shouter', her name is Preacher Sla. Take this letter to her in the Wastelands. [30118-07.htm] Priestess Pupina: If only I had the courage that you have right now... No, nothing, never mind! Now you better go and meet Preacher Sla. She is in the Wasteland. Give her my best regards... [30666-01.htm] Preacher Sla: Ah, an introduction letter from Pupina... Oh that is just so Pupina... as proper as always. The way she frets over details is going to be the death of her... By the way, do you believe that the gods' will is responsible for our behavior? "Of course I do." "I do not believe that." [30666-02.htm] Preacher Sla: Then what is our involvement as devotees? Can you answer this? I think you should go back and be a good little Priest who obeys what the other little Priests say. Perhaps at least you have learned something here that will keep you from turning rotten like they are... If you change your mind, come back and talk to me again. [30666-03.htm] Preacher Sla: Do you believe that we should venerate the sons of Gran Kain as we do the sons of Einhasad? "Yes" "No" [30666-04.htm] Preacher Sla: That is easier said than done, isn't it? Do you hear the heresy coming from your mouth? If the High Priests from the shrine heard your words you would already be smelling your burning flesh... I believe that Einhasad's will has brought you here. There is something that I need your help with. Currently my disciples are performing missionary work for the warriors of Gracia. They are being harassed by the Ol Mahums. Please go and help them. The person you must speak with is named Katari. You can find her near the waterfalls of the Neutral Zone. [30666-05.htm] Preacher Sla: Please go and help my disciple Katari. She is a Dark Elf who follows the justice of Shilen, but in matters of faith she is no different from you and I. She is waiting for you near the waterfalls of the Neutral Zone. [30666-06.htm] Preacher Sla: I am so very glad that I sent you. I was concerned about Katari having to deal with the Ol Mahums all alone... By the way, is that Ol Mahum money? It's useless. Just throw it away... . As you know, I have one more thing that requires your help... Recently, after giving a lecture on the tenet of light, I was approached by a group of Ol Mahums. They had been touched by my sermon and wanted to become my disciples. I agreed, but I seriously underestimated the firestorm that would erupt from the hierarchy of the church. For their safety we split them into 3 groups, and sent one group to Talking Island, one to the Orc Town of the northern region, and the other to the Dwarven Village. I haven't heard anything from them in days and I am very concerned... Especially with the recent Ol Mahum campsite incident and all... Could you go and check on them for me? Take these 3 letters to my Ol Mahum disciples.. First you must go and meet Kakan. She has settled down southeast of Orc Town... [30666-07.htm] Preacher Sla: Well done! Thanks to your efforts our lives of quiet contemplation have been restored...We are so very grateful! I can tell from my disciples' letters that they took quite a liking to you as well... Please take this Mark of the Reformer as a symbol of our affection and esteem. [30667-01.htm] Ramus: Glory to Einhasad! You have traveled so far... for this? Thank you so much. How is my master? Things here are going very smoothly..., too smoothly, in fact. Sometimes I worry. The people here are much more open-minded than elsewhere. We are planning a big assembly in the Elven relics of Talking Island. First, in preparation, we must hold a memorial service to calm the magical creatures.Could you help us prepare for the service? A piece of bone must be gathered from every undead in the relics. Look at this diagram... Could you help us, please? [30667-02.htm] Ramus: To the north of Talking Island there are ancient Elven ruins. This is the only place suitable for such a big assembly. You will find the bone pieces and remains of the undead there. Be careful not to lose your Map... [30667-03.htm] Ramus: Thank you so much. Now we can hold the ceremony today. Could you please take this letter to my master? [30668-01.htm] Katari: The master sent you? Your timing could not have been better, my friend. Look here... This was the secret meeting place of the converted Ol Mahums until they were discovered by mercenary scouts this evening. We need an unknown stranger such as yourself to chase them off! [30668-02.htm] Katari: Thank you! Now we can finally get some peace and quiet... I understand that there was a traitor among the Ol Mahums...who is it? I am concerned about the other Ol Mahums. I must see to their safety. Please capture that betrayer! Please! [30668-03.htm] Katari: A traitor among us! How could I have been so blind? How do I know that our other meeting places weren't compromised? While I don't yet know the identity of the betrayer, I can guess what he is thinking... Please take this letter to my master. He will have a task for you. Goodbye... [30668-04.htm] Katari: Take this letter to the master and await his orders. Goodbye for now... [30669-01.htm] Kakan: After being sent here by my master, we had barely managed to escape the prying eyes of the Orcs and to build a home for ourselves before we were viciously attacked by werewolves trying to drive us out. Bear in mind, I don't blame the church of Einhasad in any way for this... But... after a few skirmishes, we reached an agreement to send representatives and settle this through combat. However... Ask what the problem is. [30669-02.htm] Kakan: Our representative is not himself lately. Hey, you look like a magic user... Would you help us? Perhaps you could just rough him up a bit, you know, scare him a little... You must decide quickly though, he draws nigh... "I will help." "You're on your own." [30669-03.htm] Kakan: Don't you get it? Either use your magic to help us secretly or deal with him directly and knock him out with one blow. We must show him our strength! Otherwise, the entire pack will be upon us! It would be a bloodbath! [30669-04.htm] Kakan: Do you think we are lying? We who have lost so many friends to deceit and broken promises? You must agree that this is the best way to cut our losses... Please take this letter to my master as soon as possible. You want to meet with all of Sla's disciples? Try going to the nearby village of the Dwarves. One of my fellow disciples, Nyakuri, has a place outside the village, to the west. [30669-05.htm] Kakan: Please reconsider. Even if we are defeated, we shall all die together. Our representative has been weakened by those very werewolves. There was no evidence, but... They are savage, but clever. [30670-01.htm] Nyakuri: Oh... Did you say that Mother Sla sent you? She must be worried. I'm fine, just working too much... Oh, well, here we are! You look like you could take care of yourself in a fight.. Hmmm... I put money on a fight and now one of the fighters claims to have a stomachache... Would you be interested in standing in for him? Your opponent would be that Lizardman over there... I've got to tell you, it won't be an easy fight... What do you say? "I will fight and win!" "I have a stomachache and need to go to the restroom. Goodbye." [30670-02.htm] Nyakuri: Everyone seems to come down with a stomachache when they see that Lizardman. Either something is going around or I am surrounded by cowards! [30670-03.htm] Nyakuri: Excellent! Please win! I can't afford to lose this bet! [30670-04.htm] Nyakuri: Wow! You actually beat the Lizardman! He is said to be one of the strongest lizards in his tribe! I guess they will leave us alone for a while now. Here is the letter for Sla's mother. Say hello to her for me-- You should go to Talking Island next! A man called Ramus was among the pupils of Mother Sla, and I once saw him writing a letter mentioning the waterfall on Talking Island... [30732-01.htm] Ol Mahum Pilgrim: Thank you for your help. I will always remember your kindness. Please take this small token of my appreciation.
Исходник условий и наград (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.Q00227_TestOfTheReformer;

import org.l2jmobius.gameserver.entity.Location;
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.mechanics.skill.Skill;
import org.l2jmobius.gameserver.mechanics.stats.Stat;
import org.l2jmobius.gameserver.mechanics.stats.functions.FuncSet;
import org.l2jmobius.gameserver.network.enums.ChatType;
import org.l2jmobius.gameserver.network.serverpackets.SocialAction;
import org.l2jmobius.gameserver.util.ArrayUtil;

public class Q00227_TestOfTheReformer extends Quest
{
	// NPCs
	private static final int PUPINA = 30118;
	private static final int SLA = 30666;
	private static final int RAMUS = 30667;
	private static final int KATARI = 30668;
	private static final int KAKAN = 30669;
	private static final int NYAKURI = 30670;
	private static final int OL_MAHUM_PILGRIM = 30732;
	
	// Monsters
	private static final int MISERY_SKELETON = 20022;
	private static final int SKELETON_ARCHER = 20100;
	private static final int SKELETON_MARKSMAN = 20102;
	private static final int SKELETON_LORD = 20104;
	private static final int SILENT_HORROR = 20404;
	private static final int NAMELESS_REVENANT = 27099;
	private static final int ARURAUNE = 27128;
	private static final int OL_MAHUM_INSPECTOR = 27129;
	private static final int OL_MAHUM_BETRAYER = 27130;
	private static final int CRIMSON_WEREWOLF = 27131;
	private static final int KRUDEL_LIZARDMAN = 27132;
	
	// Items
	private static final int BOOK_OF_REFORM = 2822;
	private static final int LETTER_OF_INTRODUCTION = 2823;
	private static final int SLA_LETTER = 2824;
	private static final int GREETINGS = 2825;
	private static final int OL_MAHUM_MONEY = 2826;
	private static final int KATARI_LETTER = 2827;
	private static final int NYAKURI_LETTER = 2828;
	private static final int UNDEAD_LIST = 2829;
	private static final int RAMUS_LETTER = 2830;
	private static final int RIPPED_DIARY = 2831;
	private static final int HUGE_NAIL = 2832;
	private static final int LETTER_OF_BETRAYER = 2833;
	private static final int BONE_FRAGMENT_4 = 2834;
	private static final int BONE_FRAGMENT_5 = 2835;
	private static final int BONE_FRAGMENT_6 = 2836;
	private static final int BONE_FRAGMENT_7 = 2837;
	private static final int BONE_FRAGMENT_8 = 2838;
	private static final int BONE_FRAGMENT_9 = 2839;
	private static final int KAKAN_LETTER = 3037;
	
	// Rewards
	private static final int MARK_OF_REFORMER = 2821;
	private static final int DIMENSIONAL_DIAMOND = 7562;
	
	// Checks & Instances
	private static long _timer;
	
	// Misc
	private static Npc _olMahumInspector;
	private static Npc _olMahumPilgrim;
	private static Npc _olMahumBetrayer;
	private static boolean _crimsonWerewolf = false;
	private static boolean _krudelLizardman = false;
	
	// Allowed skills when attacking Crimson Werewolf
	private static final int[] ALLOWED_SKILLS =
	{
		1031, // Disrupt Undead
		1069, // Sleep
		1147, // Vampiric Touch
		1164, // Curse: Weakness
		1168, // Curse: Poison
		1177, // Wind Strike
		1184, // Ice Bolt
		1201, // Dryad Root
		1206, // Wind Shackle
		4192, // BOSS HP Drain
	};
	private static final int DISRUPT_UNDEAD = 1031;
	
	public Q00227_TestOfTheReformer()
	{
		super(227, "Test of the Reformer");
		registerQuestItems(BOOK_OF_REFORM, LETTER_OF_INTRODUCTION, SLA_LETTER, GREETINGS, OL_MAHUM_MONEY, KATARI_LETTER, NYAKURI_LETTER, UNDEAD_LIST, RAMUS_LETTER, RIPPED_DIARY, HUGE_NAIL, LETTER_OF_BETRAYER, BONE_FRAGMENT_4, BONE_FRAGMENT_5, BONE_FRAGMENT_6, BONE_FRAGMENT_7, BONE_FRAGMENT_8, BONE_FRAGMENT_9, KAKAN_LETTER);
		addStartNpc(PUPINA);
		addTalkId(PUPINA, SLA, RAMUS, KATARI, KAKAN, NYAKURI, OL_MAHUM_PILGRIM);
		addAttackId(NAMELESS_REVENANT, CRIMSON_WEREWOLF);
		addKillId(MISERY_SKELETON, SKELETON_ARCHER, SKELETON_MARKSMAN, SKELETON_LORD, SILENT_HORROR, NAMELESS_REVENANT, ARURAUNE, OL_MAHUM_INSPECTOR, OL_MAHUM_BETRAYER, CRIMSON_WEREWOLF, KRUDEL_LIZARDMAN);
	}
	
	@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 "30118-04.htm":
			{
				st.startQuest();
				giveItems(player, BOOK_OF_REFORM, 1);
				if (!player.getVariables().getBoolean("secondClassChange39", false))
				{
					htmltext = "30118-04b.htm";
					giveItems(player, DIMENSIONAL_DIAMOND, DF_REWARD_39.get(player.getPlayerClass().getId()));
					player.getVariables().set("secondClassChange39", true);
				}
				break;
			}
			case "30118-06.htm":
			{
				st.setCond(4, true);
				takeItems(player, BOOK_OF_REFORM, 1);
				takeItems(player, HUGE_NAIL, 1);
				giveItems(player, LETTER_OF_INTRODUCTION, 1);
				break;
			}
			case "30666-04.htm":
			{
				st.setCond(5, true);
				takeItems(player, LETTER_OF_INTRODUCTION, 1);
				giveItems(player, SLA_LETTER, 1);
				break;
			}
			case "30669-03.htm":
			{
				if (!st.isCond(12))
				{
					st.setCond(12, true);
				}
				
				if (!_crimsonWerewolf)
				{
					// It may only be hunted with low level spells, so it never resists magic whatever magic success formula is configured.
					final Npc werewolf = addSpawn(CRIMSON_WEREWOLF, -9382, -89852, -2333, 0, false, 299000);
					werewolf.addStatFunc(new FuncSet(Stat.MAGIC_SUCCESS_RES, 0x100, werewolf, 0, null));
					_crimsonWerewolf = true;
					
					// Resets Crimson Werewolf
					startQuestTimer("werewolf_cleanup", 300000, null, player, false);
				}
				break;
			}
			case "30670-03.htm":
			{
				st.setCond(15, true);
				if (!_krudelLizardman)
				{
					addSpawn(KRUDEL_LIZARDMAN, 126019, -179983, -1781, 0, false, 299000);
					_krudelLizardman = true;
					
					// Resets Krudel Lizardman
					startQuestTimer("lizardman_cleanup", 300000, null, player, false);
				}
				break;
			}
			case "werewolf_despawn":
			{
				npc.abortAttack();
				npc.broadcastSay(ChatType.GENERAL, "Cowardly guy!");
				npc.decayMe();
				_crimsonWerewolf = false;
				cancelQuestTimer("werewolf_cleanup", null, player);
				return null;
			}
			case "ol_mahums_despawn":
			{
				_timer++;
				if (st.isCond(8) || (_timer >= 60))
				{
					if (_olMahumPilgrim != null)
					{
						_olMahumPilgrim.deleteMe();
						_olMahumPilgrim = null;
					}
					
					if (_olMahumInspector != null)
					{
						_olMahumInspector.deleteMe();
						_olMahumInspector = null;
					}
					
					cancelQuestTimer("ol_mahums_despawn", null, player);
					_timer = 0;
				}
				
				return null;
			}
			case "betrayer_despawn":
			{
				if (_olMahumBetrayer != null)
				{
					_olMahumBetrayer.deleteMe();
					_olMahumBetrayer = null;
				}
				
				return null;
			}
			case "werewolf_cleanup":
			{
				_crimsonWerewolf = false;
				return null;
			}
			case "lizardman_cleanup":
			{
				_krudelLizardman = false;
				return null;
			}
		}
		
		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.getPlayerClass() == PlayerClass.CLERIC) || (player.getPlayerClass() == PlayerClass.SHILLIEN_ORACLE))
				{
					htmltext = (player.getLevel() < 39) ? "30118-01.htm" : "30118-03.htm";
				}
				else
				{
					htmltext = "30118-02.htm";
				}
				break;
			}
			case State.STARTED:
			{
				final int cond = st.getCond();
				switch (npc.getId())
				{
					case PUPINA:
					{
						if (cond < 3)
						{
							htmltext = "30118-04a.htm";
						}
						else if (cond == 3)
						{
							htmltext = "30118-05.htm";
						}
						else if (cond > 3)
						{
							htmltext = "30118-07.htm";
						}
						break;
					}
					case SLA:
					{
						if (cond == 4)
						{
							htmltext = "30666-01.htm";
						}
						else if ((cond > 4) && (cond < 10))
						{
							htmltext = "30666-05.htm";
						}
						else if (cond == 10)
						{
							htmltext = "30666-06.htm";
							st.setCond(11, true);
							takeItems(player, OL_MAHUM_MONEY, 1);
							giveItems(player, GREETINGS, 3);
						}
						else if ((cond > 10) && (cond < 20))
						{
							htmltext = "30666-06.htm";
						}
						else if (cond == 20)
						{
							htmltext = "30666-07.htm";
							takeItems(player, KATARI_LETTER, 1);
							takeItems(player, KAKAN_LETTER, 1);
							takeItems(player, NYAKURI_LETTER, 1);
							takeItems(player, RAMUS_LETTER, 1);
							giveItems(player, MARK_OF_REFORMER, 1);
							addExpAndSp(player, 164032, 17500);
							player.broadcastPacket(new SocialAction(player.getObjectId(), 3));
							st.exitQuest(false, true);
						}
						break;
					}
					case KATARI:
					{
						if ((cond == 5) || (cond == 6))
						{
							htmltext = "30668-01.htm";
							
							if (cond == 5)
							{
								st.setCond(6, true);
								takeItems(player, SLA_LETTER, 1);
							}
							
							if ((_olMahumPilgrim == null) && (_olMahumInspector == null))
							{
								_olMahumPilgrim = addSpawn(OL_MAHUM_PILGRIM, -4015, 40141, -3664, 0, false, 0);
								_olMahumInspector = addSpawn(OL_MAHUM_INSPECTOR, -4034, 40201, -3665, 0, false, 0);
								
								// Resets Ol Mahums' instances
								startQuestTimer("ol_mahums_despawn", 5000, null, player, true);
								
								_olMahumInspector.asAttackable().addDamageHate(_olMahumPilgrim, 0, 99999);
								_olMahumInspector.getAI().setIntentionAttack(_olMahumPilgrim);
								
								// TODO : make Npc be able to attack Attackable.
								// _olMahumPilgrim.asAttackable().addDamageHate(_olMahumInspector, 0, 99999);
								// _olMahumPilgrim.getAI().setIntentionAttack(_olMahumInspector);
							}
						}
						else if (cond == 7)
						{
							htmltext = "30668-01.htm";
							
							if (_olMahumPilgrim == null)
							{
								_olMahumPilgrim = addSpawn(OL_MAHUM_PILGRIM, -4015, 40141, -3664, 0, false, 0);
								
								// Resets Ol Mahums' instances
								startQuestTimer("ol_mahums_despawn", 5000, null, player, true);
							}
						}
						else if (cond == 8)
						{
							htmltext = "30668-02.htm";
							
							if (_olMahumBetrayer == null)
							{
								_olMahumBetrayer = addSpawn(OL_MAHUM_BETRAYER, -4106, 40174, -3660, 0, false, 0);
								_olMahumBetrayer.setRunning();
								_olMahumBetrayer.getAI().setIntentionMoveTo(new Location(-7732, 36787, -3709));
								
								// Resets Ol Mahum Betrayer's instance
								startQuestTimer("betrayer_despawn", 40000, null, player, false);
							}
						}
						else if (cond == 9)
						{
							htmltext = "30668-03.htm";
							st.setCond(10, true);
							takeItems(player, LETTER_OF_BETRAYER, 1);
							giveItems(player, KATARI_LETTER, 1);
						}
						else if (cond > 9)
						{
							htmltext = "30668-04.htm";
						}
						break;
					}
					case OL_MAHUM_PILGRIM:
					{
						if (cond == 7)
						{
							htmltext = "30732-01.htm";
							st.setCond(8, true);
							giveItems(player, OL_MAHUM_MONEY, 1);
						}
						break;
					}
					case KAKAN:
					{
						if ((cond == 11) || (cond == 12))
						{
							htmltext = "30669-01.htm";
						}
						else if (cond == 13)
						{
							htmltext = "30669-04.htm";
							st.setCond(14, true);
							takeItems(player, GREETINGS, 1);
							giveItems(player, KAKAN_LETTER, 1);
						}
						else if (cond > 13)
						{
							htmltext = "30669-04.htm";
						}
						break;
					}
					case NYAKURI:
					{
						if ((cond == 14) || (cond == 15))
						{
							htmltext = "30670-01.htm";
						}
						else if (cond == 16)
						{
							htmltext = "30670-04.htm";
							st.setCond(17, true);
							takeItems(player, GREETINGS, 1);
							giveItems(player, NYAKURI_LETTER, 1);
						}
						else if (cond > 16)
						{
							htmltext = "30670-04.htm";
						}
						break;
					}
					case RAMUS:
					{
						if (cond == 17)
						{
							htmltext = "30667-01.htm";
							st.setCond(18, true);
							takeItems(player, GREETINGS, 1);
							giveItems(player, UNDEAD_LIST, 1);
						}
						else if (cond == 18)
						{
							htmltext = "30667-02.htm";
						}
						else if (cond == 19)
						{
							htmltext = "30667-03.htm";
							st.setCond(20, true);
							takeItems(player, BONE_FRAGMENT_4, 1);
							takeItems(player, BONE_FRAGMENT_5, 1);
							takeItems(player, BONE_FRAGMENT_6, 1);
							takeItems(player, BONE_FRAGMENT_7, 1);
							takeItems(player, BONE_FRAGMENT_8, 1);
							takeItems(player, UNDEAD_LIST, 1);
							giveItems(player, RAMUS_LETTER, 1);
						}
						else if (cond > 19)
						{
							htmltext = "30667-03.htm";
						}
						break;
					}
				}
				break;
			}
			case State.COMPLETED:
			{
				htmltext = getAlreadyCompletedMsg(player);
				break;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onAttack(Npc npc, Player attacker, int damage, boolean isPet, Skill skill)
	{
		// Crimson Werewolf leaves as soon as a player hits it with anything but the allowed skills.
		if ((npc.getId() == CRIMSON_WEREWOLF) && !isPet && !npc.isScriptValue(1) && ((skill == null) || !ArrayUtil.contains(ALLOWED_SKILLS, skill.getId())))
		{
			npc.setScriptValue(1);
			startQuestTimer("werewolf_despawn", 1000, npc, attacker, false);
			return;
		}
		
		final QuestState st = getQuestState(attacker, false);
		if (st == null)
		{
			return;
		}
		
		final int cond = st.getCond();
		switch (npc.getId())
		{
			case NAMELESS_REVENANT:
			{
				// Only a kill right after Disrupt Undead counts, any other hit clears it.
				if ((cond == 1) || (cond == 2))
				{
					npc.setScriptValue(((skill != null) && (skill.getId() == DISRUPT_UNDEAD)) ? 1 : 2);
				}
				break;
			}
		}
	}
	
	@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();
		switch (npc.getId())
		{
			case NAMELESS_REVENANT:
			{
				if (((cond == 1) || (cond == 2)) && npc.isScriptValue(1) && (getQuestItemsCount(player, RIPPED_DIARY) < 7))
				{
					giveItems(player, RIPPED_DIARY, 1);
					if (getQuestItemsCount(player, RIPPED_DIARY) >= 7)
					{
						st.setCond(2, true);
						takeItems(player, RIPPED_DIARY, -1);
						addSpawn(ARURAUNE, npc, false, 300000);
					}
					else
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
				}
				break;
			}
			case ARURAUNE:
			{
				if (cond == 2)
				{
					st.setCond(3, true);
					giveItems(player, HUGE_NAIL, 1);
					npc.broadcastSay(ChatType.GENERAL, "The concealed truth will always be revealed...!");
				}
				break;
			}
			case OL_MAHUM_INSPECTOR:
			{
				if (cond == 6)
				{
					st.setCond(7, true);
				}
				break;
			}
			case OL_MAHUM_BETRAYER:
			{
				if (cond == 8)
				{
					st.setCond(9, true);
					giveItems(player, LETTER_OF_BETRAYER, 1);
					cancelQuestTimer("betrayer_despawn", null, player);
					_olMahumBetrayer = null;
				}
				break;
			}
			case CRIMSON_WEREWOLF:
			{
				if (cond == 12)
				{
					st.setCond(13, true);
					cancelQuestTimer("werewolf_cleanup", null, player);
					_crimsonWerewolf = false;
				}
				break;
			}
			case KRUDEL_LIZARDMAN:
			{
				if (cond == 15)
				{
					st.setCond(16, true);
					cancelQuestTimer("lizardman_cleanup", null, player);
					_krudelLizardman = false;
				}
				break;
			}
			case SILENT_HORROR:
			{
				if ((cond == 18) && !hasQuestItems(player, BONE_FRAGMENT_4))
				{
					giveItems(player, BONE_FRAGMENT_4, 1);
					if (hasQuestItems(player, BONE_FRAGMENT_5, BONE_FRAGMENT_6, BONE_FRAGMENT_7, BONE_FRAGMENT_8))
					{
						st.setCond(19, true);
					}
					else
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
				}
				break;
			}
			case SKELETON_LORD:
			{
				if ((cond == 18) && !hasQuestItems(player, BONE_FRAGMENT_5))
				{
					giveItems(player, BONE_FRAGMENT_5, 1);
					if (hasQuestItems(player, BONE_FRAGMENT_4, BONE_FRAGMENT_6, BONE_FRAGMENT_7, BONE_FRAGMENT_8))
					{
						st.setCond(19, true);
					}
					else
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
				}
				break;
			}
			case SKELETON_MARKSMAN:
			{
				if ((cond == 18) && !hasQuestItems(player, BONE_FRAGMENT_6))
				{
					giveItems(player, BONE_FRAGMENT_6, 1);
					if (hasQuestItems(player, BONE_FRAGMENT_4, BONE_FRAGMENT_5, BONE_FRAGMENT_7, BONE_FRAGMENT_8))
					{
						st.setCond(19, true);
					}
					else
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
				}
				break;
			}
			case MISERY_SKELETON:
			{
				if ((cond == 18) && !hasQuestItems(player, BONE_FRAGMENT_7))
				{
					giveItems(player, BONE_FRAGMENT_7, 1);
					if (hasQuestItems(player, BONE_FRAGMENT_4, BONE_FRAGMENT_5, BONE_FRAGMENT_6, BONE_FRAGMENT_8))
					{
						st.setCond(19, true);
					}
					else
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
				}
				break;
			}
			case SKELETON_ARCHER:
			{
				if ((cond == 18) && !hasQuestItems(player, BONE_FRAGMENT_8))
				{
					giveItems(player, BONE_FRAGMENT_8, 1);
					if (hasQuestItems(player, BONE_FRAGMENT_4, BONE_FRAGMENT_5, BONE_FRAGMENT_6, BONE_FRAGMENT_7))
					{
						st.setCond(19, true);
					}
					else
					{
						playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
					}
				}
				break;
			}
		}
	}
}