ZURSULUS L2

Saga of the Fortune Seeker

ID
99
Название
Saga of the Fortune Seeker
start_npcs_json
[]
npc_ids_json
[]
constants_json
{}
Статус разбора
metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
Источник
game/data/scripts/quests/Q00099_SagaOfTheFortuneSeeker/Q00099_SagaOfTheFortuneSeeker.java

NPC квеста

Записей нет.

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

if (player.getLevel() < 76)
if (player.getLevel() < 76)
if (player.getLevel() >= 76)

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

giveItems(player, _items[10], 1);
addExpAndSp(player, 2299404, 0);
giveAdena(player, 5000000, true);
giveItems(player, 6622, 1);
giveItems(player, _items[1], 1);
giveItems(player, _items[4], 1);
giveItems(player, _items[7], 1);
giveItems(player, _items[9], 1);
giveItems(player, _items[9], 1);
giveItems(player, _items[8], 1);
giveItems(player, _items[5], 1);
giveItems(player, _items[6], 1);
giveItems(player, _items[8], 1);
addExpAndSp(player, 2299404, 0);
giveAdena(player, 5000000, true);
giveItems(player, 6622, 1); // XXX rewardItems?
giveItems(player, _items[3], getRandom(1, 4));

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

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

[0-01.htm] Chief Inspector Mond: Do you know who I am? I'm an inspector from the Bronze Key Guild, but that's just a superficial job title! What I'm about to tell you is known by only a few people in the whole Dwarven kingdom! Listen carefully! I won't repeat it. The Bronze Key Guild was originally formed to resist the von Hellmann family that tried to take over the Elmore Kingdom and the Benandanti cartel that followed them. It was an elite group, consisting of only Dwarves with the very best skills. Our guild has watched you for a long time. We saw you pass the cruel test of Master Toma and get your Scavenger license, and when you made 7 journeyman's rings and passed the Trial of the Guildsman. Some time ago, we concluded that a Dwarf with your willpower and acumen deserves to be a member of our guild. Now I have an offer for you. Will you join us in defeating the Benandanti cartel? "I'll do it." [0-010.htm] Chief Inspector Mond: You've drunk from the Grail of Splendor and learned the ultimate absolute geometry, but you still haven't attained the sacred knowledge! Just like food, knowledge must be digested to become truth. Come back after you've trained some more. (Only a character of level 76 or above may transfer to the Fortune Seeker class. Don't abandon the quest until class transfer is complete.) [0-02.htm] Chief Inspector Mond: Do you know who I am? I'm an inspector from the Bronze Key Guild, but that's just a superficial job title! What I'm about to tell you is known by only a few people in the whole Dwarven kingdom! Listen carefully! I won't repeat it. The Bronze Key Guild was originally formed to resist the von Hellmann family that tried to take over the Elmore Kingdom and the Benandanti cartel that followed them. It was an elite group, consisting of only Dwarves with the very best skills. Our guild has watched you for a long time. We saw you pass the cruel test of Master Toma and get your Scavenger license, and when you made 7 journeyman's rings and passed the Trial of the Guildsman. Some time ago, we concluded that a Dwarf with your willpower and acumen deserves to be a member of our guild. But unfortunately, your experience is still lacking... I'll call for you sooner or later. Please keep up the hard work. (This quest may only be undertaken only by Bounty Hunters of level 76 or above.) [0-03.htm] Chief Inspector Mond: First you must speak with Pamela Aprodia, the agent dispatched to Goddard. Although she's not a Dwarf, she's an excellent agent who's been working with us for a long time. She's probably investigating the six tablets in Goddard Castle Town right now. You'd better go there and meet her. One more thing. Before you leave, read this report. It's an Investigative Report on the spirit protecting one of the tablets. If you follow the Benandantis, you will probably come across this spirit. You should read it now. You'd better get going! May Maphr be with you! [0-04.htm] Chief Inspector Mond: Go to Goddard Castle Town and speak with Pamela Aprodia. She'll tell you more about the tablets. Hurry! The secrets of the tablets must never be handed over to the Benandantis! [0-05.htm] Chief Inspector Mond: Well then, let's spit on the ground and shake hands! The trust between us has been established while Maphr has watched over us. Now I'll tell you what to do. The Benandanti cartel is searching for a legendary relic known as the Grail of Splendor. They would have found it by now if it were a real object, but it's not! It is actually the knowledge that reaches into the domain of the gods! It may be a part of the absolute geometry that elders of our guild have searched for since ancient times! There is nothing to be learned in books or scrolls about the grail. The gods wrote their secrets on six ancient stone tablets, and put them in secluded places, guarded by fearsome monsters! If you absorb the knowledge held in the six tablets, you'll attain the level of Fortune Seeker, one who controls disasters and even the flow of destiny! We must not let this valuable legacy slip into the hands of Benandantis! You must get the grail before they do! "What do I have to do?" [0-06.htm] Chief Inspector Mond: Ha, ha, ha! Welcome back! You've cut members of the Benedictine Cartel out and beautifully finished your job! "Now what happens?" [0-07.htm] Chief Inspector Mond: You've drunk from the Grail of Splendor and learned the ultimate absolute geometry! You've acheived the sacred knowledge! My only role is to confer an appropriate title on the person who has that knowledge. I hereby confer upon you the title of Fortune Seeker! Congratulations! I can't believe that a young Dwarf like you has become the Fortune Seeker of our time! Am I witnessing the beginning of the new destiny? I expect great things from you in the future! Please work hard to become a positive role model for all the Dwarves! May Maphr's abundance be with you! [0-08.htm] Chief Inspector Mond: You've drunk from the Grail of Splendor and learned the ultimate absolute geometry, but you still haven't attained the sacred knowledge! Just like food, knowledge must be digested to become truth. Come back after you've trained some more. (Only a character of level 76 or above may transfer to the Fortune Seeker class. Don't abandon the quest until class transfer is complete.) [0-09.htm] Chief Inspector Mond: You've drunk from the Grail of Splendor and learned the ultimate absolute geometry! You've acheived the sacred knowledge! My only role is to confer an appropriate title on the person who has that knowledge. I hereby confer upon you the title of Fortune Seeker! Congratulations! I can't believe that a young Dwarf like you has become the Fortune Seeker of our time! Am I witnessing the beginning of a new destiny? I expect great things from you in the future! Please work hard to become a positive role model for all the Dwarves! May Maphr's abundance be with you! [1-01.htm] Information Broker Bavarin: Dammit, Sharon! I came here for a rest, but I keep having to deal with customers! Could you please handle them from now on? So, what do you want? You're here for the grail of splendor, aren't you? How do I know that? Well, I have my ways... You're too late! I already sold that information to the Benandanti Cartel. Made a pretty penny, too, I must say! Of course, I'm perfectly willing to give you the same information for the right price. Ha! "How much do you want for it?" [1-02.htm] Information Broker Bavarin: It won't come cheap, my friend! This wine tastes terrible warm! Bring me some ice crystals for my wine right away! Chef Jeremy can tell you where to find them. He's around here somewhere... [1-03.htm] Information Broker Bavarin: Excellent! You brought the ice crystal! Now I can finally enjoy my wine! You've made quite a name for yourself around here, my friend! You destroyed Bumbalump, didn't you? I heard that yeti was as big as a house! How did you kill that critter? You're awesome! "Please give me proof that I brought you an ice crystal." [1-04.htm] Information Broker Bavarin: Hey, why are you still here? Pamela must be wondering where you are! Don't keep a lady waiting! Take her the document that I gave you immediately! [1-05.htm] Information Broker Bavarin: You think I'm just a silly old Dwarf, don't you? Well, I don't care what you think! What's the bottom line? Where's my profit? That philosophy has served us Dwarves well for thousands of years! Do you think I care what I look like to you? Rubbish! Well, speaking of my profit... I want a nice cool glass of wine after my bath. I simply must have some of the legendary ice crystals that can only be found in this area! Chef Jeremy can tell you where to find them. I'll bet if you help him find some soy sauce, he'll tell you where to find the ice crystals. He's around here somewhere... [1-06.htm] Information Broker Bavarin: You're a real stick in the mud, aren't you? OK, I'll give you the information... Now where did I put it? Ah, yes, here it is! Take these documents, and please give Pamela my regards! Goodbye! [10-01.htm] Tablet of Vision: You can feel the presence of the Stone of Commune near the tablet. You feel you can find out its exact location if you lay your hands on the tablet. Lay hands on the tablet. [10-02.htm] Tablet of Vision: As you are about to lay your hands on the tablet, you feel something behind you. A creature, unknown to you, appears... [10-03.htm] Tablet of Vision: You need the Stone of Commune to decipher the hieroglyphs on the tablet. Speak with Pamela Aprodia about the Stone of Commune. [10-04.htm] Tablet of Vision: Someone is already communing with the Tablet of Vision. Please try again later. [10-05.htm] Tablet of Vision: The tablet is inscribed with indecipherable hieroglyphs. The letters emit a dim light and the tablet seems to manifest strong magical powers. Use the Stone of Commune. [10-06.htm] Tablet of Vision: As you hold the Stone of Commune and concentrate on it, the tablet starts to be surrounded by bright light. You hear several hundred people simultaneously reading scriptures, and new knowledge starts to enter your mind. On one hand, you feel like you understand everything. On the other hand, you feel that you don't understand anything. You hear someone's low-pitched laughter. And you hear a man's voice. "You now have one more successor that you like." A blonde woman replies. "No, he's like a baby who just started walking. But he will no longer need his mother's protection..." All images disappear, and you start to recognize the surrounding environment. You are starting to understand the knowledge you have gained from the tablet little by little. The pilgrimage of the tablet seems to have ended. Return to Rune Castle Town and see Chief Inspector Mond. [10-07.htm] Tablet of Vision: Nothing happens any more even when you lay your hands on the tablet. Now that you have finished your pilgrimage of the tablet, return to Rune Castle Town and see Chief Inspector Mond. [11-01.htm] Pamela Aprodia: I've been waiting for you! My soldiers recently attacked a convoy of Benandantis and captured vital information! With this Stone of Commune... This is the Stone of Commune you felt. But haven't you felt that its power is weaker than before? This Stone of Commune is useless since it lost its power. Hey, it is too early to give up! I've recently learned that there are two more Stones of Commune that are exactly the same as this! One can be found at the Imperial Tomb and the other at the Wall of Argos. At the cemetery, look in the Four Sepulchers. If you decide to go to the Wall of Argos, look in the Shrine of the Loyal in the northeastern part of the valley. And... "And...?" [11-02.htm] Pamela Aprodia: To get the fifth Stone of Commune, you must destroy the Archon of Halisha. Find the devil in the Imperial Tomb or at the Wall of Argos. If you go to the Imperial Tomb, you can confront him by entering the Four Sepulchers. If you go to the Shrine of the Loyal, you must attack his minions as you see them. Then Archon of Halisha will appear. Keep in mind that you must destroy him to get the Stone of Commune. OK, leave now! MMMMMAH!!! This is the kiss of luck!. [11-03.htm] Pamela Aprodia: There is no way to avoid meeting the Archon of Halisha. Yes, because he has the fifth Stone of Commune. If you go to the Imperial Tomb, you can confront him by entering the Four Sepulchers. If you go to the Shrine of the Loyal, you must attack his minions as you see them. Then the Archon of Halisha will appear. OK, leave now! MMMMMAH!!! This is the kiss of luck! [2-01.htm] Pamela Aprodia: Did M send you to me? I mean Mr. Bond... The Benandantis are one step ahead of us. They already know the location of the stone tablet. We must find out what they've learned! "How?" [2-02.htm] Pamela Aprodia: Why are you still here? Go to the hot springs area and speak with Bavarin! The Benandanti cartel is already on the move. You must quickly find out the location of the stone tablet. Hurry, there isn't much time! [2-03.htm] Pamela Aprodia: Is this the document from Bavarin? It shows not only the location of the stone tablet, but how to read the questions written on the tablet. This is better than I expected. Excellent work, I underestimated you. Let's read it... Nobody can read the passage written on the six stone Tablets of Vision because the gods don't want us to learn the highest level of magic. They're afraid we would become arrogant and self-righteous, like Emperor Baium, Demon Beleth, or the giants did when they made war against them. They broke the tablet, where the most profound principles of magic were written - it was used to teach the magic to the giants - into six pieces and changed the letters on the tablet into the god's characters. They can only be understood by the gods or those who are as powerful. This way, nobody could learn the knowledge. But there is a method! I'll explain. Wow, this is really interesting, isn't it? "Read on!" [2-04.htm] Pamela Aprodia: We can find the Tablet of Vision with the Stone of Commune. Can you sense the location of the tablet? Then go immediately! [2-05.htm] Pamela Aprodia: You should go to the hot springs area and speak with Bavarin. He already knows me. He might tell our enemies that the Bronze Key Guild is on the move if I went. A stranger like you should approach him. You must hurry! The messengers of the Benandanti cartel are running swiftly! [2-06.htm] Pamela Aprodia: Be patient. Ahem! If you use the power of the Stone of Commune, you can understand the characters of the gods written on the Tablet of Vision. Also, if you hold the stone with your hands, you will know intuitively where the tablet is hidden. It isn't yet known who on earth made this. But this much is evident. Someone is secretly helping us learn the knowledge forbidden by the gods! Then this stone that we took from the Benandanti member we killed may be the Stone of Commune! Take it! If what is written in the document is true, we can find the Tablet of Vision with it. Can you sense the location of the tablet? Then go immediately! I'll gather more information. [3-01.htm] Pamela Aprodia: Oh, it was you! Wow, you defeated the Archangel Iconoclasis alone! Very impressive! I could really go for someone like you! However... The Benandantis are still ahead of us, and it seems that they already communed with the fourth Tablet of Vision! Fortunately, I followed them and learned several pieces of information. "And then what?" [3-02.htm] Pamela Aprodia: Very well! Go to Messenger Wahkan of the Ketra Orcs. They will be hiring mercenaries. This is a good opportunity to gain their trust! The sacred stone of wisdom we are looking for is possessed by soul guide Asefa, the chief shaman of the Ketra Orcs. If things aren't going well, you can switch sides and approach the Varka Silenos tribe. [3-03.htm] Pamela Aprodia: Then go to Messenger Naran Ashanuk of the Ketra Orcs. They will be hiring mercenaries. This is a good opportunity to gain their trust! The sacred stone of wisdom we are looking for is possessed by soul guide Udan Mardui, the chief shaman of the Varka Silenos. If things aren't going well, you can switch sides and approach the Ketra Orcs. [3-04.htm] Pamela Aprodia: To use the fourth Stone of Commune, we have to get the sacred stone of wisdom worshipped by the Ketra Orcs and the Varka Silenos. You have to gain their trust first, but it won't be easy as they are wild and warlike tribes. [3-05.htm] Pamela Aprodia: A fragment of the fourth Stone of Commune is actually worshiped by an uncivilized tribe who call it their Holy Stone of Wisdom! Now put these two stones together... "Put the Holy Stone of Wisdom and Pamela's fragment together." [3-06.htm] Pamela Aprodia: You haven't left yet? Take the Stone of Commune I gave you to the fourth tablet. You'll know its location intuitively. If it's difficult to find with your feelings, use the Map. [3-07.htm] Pamela Aprodia: You can feel the Stone of Commune? It must be this small piece of stone that I stole from the Benandantis. It's the fragment of the fourth Stone of Commune. However, for it to work properly, we have to find the missing piece and put them together. The rest of the Stone of Commune is called the sacred stone of wisdom and is worshiped as an idol by the uncivilized tribes in this area. The Ketra Orcs and the Varka Silenos each have one. To get the stone from them, you must first win their trust. Since they are wild and warlike, I don't know which tribe you should approach. "I'll approach the Ketra Orcs." "I'll approach the Varka Silenos." [3-08.htm] Pamela Aprodia: The two pieces fit together perfectly! Take this Stone of Commune and find the fourth Tablet of Vision. Hurry! We must win the race against the Benandantis! And who knows? Maybe you'll become the Fortune Seeker... [4-01.htm] Pamela Aprodia: It's Minelbia, the witch of the van Hacken family! Don't let her get away! Help! Hurry! [4-010.htm] Pamela Aprodia: Ah, yes.... I took this from the witch's pocket... It's the sixth Stone of Commune! Hurry and take it to the last Tablet of Vision before more Benandantis come! I'm going to keep an eye on them. See you later! "Wait!" [4-011.htm] Pamela Aprodia: Ah, yes.... I took this from the witch's pocket... It's the sixth Stone of Commune! Hurry and take it to the last Tablet of Vision before more Benandantis come! [4-02.htm] Pamela Aprodia: It's Minelbia, the witch of the van Hacken family! She's trying to get away! [4-03.htm] Pamela Aprodia: It's Minelbia, the witch of the van Hacken family! She's escaped! [4-04.htm] Pamela Aprodia: It's Minelbia, the witch of the van Hacken family! Don't let her get away! Help! Hurry! [4-05.htm] Pamela Aprodia: It's Minelbia, the witch of the van Hacken family! She's trying to get away! [4-06.htm] Pamela Aprodia: Wow! You killed her! I thought we were done for! Thank you for your help! "No big deal!" [4-07.htm] Pamela Aprodia: I hate vampires! "Why?" [4-08.htm] Pamela Aprodia: It's Minelbia, the witch of the van Hacken family! She's trying to get away! Hurry, let the Stone of Commune react with the tablet! Quickly, before more Benandantis come! [4-09.htm] Pamela Aprodia: Let the Stone of Commune react with the tablet! Quickly, before more Benandantis come! [5-01.htm] Tablet of Vision: Hieroglyphics are engraved on the tablet. They emit a dim light, with a mysterious and powerful magic. Use the stone. [5-02.htm] Tablet of Vision: The Tablet of Vision becomes overwhelmed by bright lights. While you are holding the stone to work on it, you start to acquire a new sense of knowledge as you hear the voices of thousands reading scriptures in the background. You now realize the truth of the world and yet understand nothing. One of the voices is a familiar female whisper. But it quickly disappears. Slowly, you begin to visualize where the next Stone of Commune is... in the valley of dust... you see a second Tablet of Vision... and a female warrior in platinum armor. She is holding the stone... She unfolds her wings and flies away... and she's not alone... In an instant, the images disappear and then the stone goes completely dark. [5-03.htm] Tablet of Vision: You visualize the stone once again when touching the Tablet. In the yellow-brown valley, you see a female warrior with platinum wings. She is holding the stone in her hand. You are compelled to go forth and find the stone right now! [6-01.htm] Tablet of Vision: You must have the Stone of Commune to access this Tablet of Vision. It is being held by one of the female warriors with wings. [6-02.htm] Tablet of Vision: Hieroglyphics are engraved on the tablet. They emit a dim light, with a mysterious and powerful magic. Use the stone. [6-03.htm] Tablet of Vision: The Tablet of Vision becomes overwhelmed by bright lights. While you are holding the stone to work on it, you start to acquire a new sense of knowledge as you hear the voices of thousands reading scriptures in the background. You now realize the truth of the world and yet understand nothing. One of the voices is a familiar female whisper. But it quickly disappears. Slowly, you sense the stone... You see the third Tablet of Vision... and an angel with two pairs of wings... She is holding the stone in her hand... In an instant, the images disappear and then the stone goes completely dark. [6-04.htm] Tablet of Vision: Your visions temporarily return, you again see the third Tablet of Vision... and an angel with two pairs of wings... She is holding the stone in her hand. You are compelled to go forth and find the stone right now! [7-01.htm] Tablet of Vision: You definitely sense the Stone of Commune. You seem to understand the location of the next Stone of Commune. Touch the Tablet. [7-02.htm] Tablet of Vision: An invisible force pushes you away whenever you go to touch the tablet. [7-03.htm] Tablet of Vision: You must have the Stone of Commune to access this Tablet of Vision. It is being held by an archangel. Defeat Archangel Iconoclasis and take the Stone of Commune. [7-04.htm] Tablet of Vision: Someone else is currently communing with the Tablet of Vision. Come back later. [7-05.htm] Tablet of Vision: Hieroglyphics are engraved on the tablet. They emit a dim light, with a mysterious and powerful magic. Use the stone. [7-06.htm] Tablet of Vision: The Tablet of Vision becomes overwhelmed by bright lights. While you are holding the stone to work on it, you start to acquire a new sense of knowledge as you hear the voices of thousands reading scriptures in the background. You now realize the truth of the world and yet understand nothing. One of the voices is a familiar female whisper. But it quickly disappears. Slowly, you sense the stone... You see the Village of the Goddard Castle... Dark Elven... and Pamela Aprodia... You sense that she is holding the stone in her hand. In an instant, the images disappear and then the stone goes completely dark. [7-07.htm] Tablet of Vision: Putting your hands on the tablet, the location of the Stone of Commune again becomes clear. Pamela Aprodia in the Goddard Castle Town has the stone! Go to the town and get it from her. [8-01.htm] Tablet of Vision: Ancient, indecipherable hieroglyphs are engraved upon the tablet. They emit a mysterious, dim light. There is something magical and powerful in the tablet. Commune with the Tablet of Vision. [8-02.htm] Tablet of Vision: The Tablet of Vision becomes overwhelmed by bright lights. While you are holding the stone to work on it, you start to acquire a new sense of knowledge as you hear the voices of thousands reading scriptures in the background. You now realize the truth of the world and yet understand nothing. There is a vision of a beautiful blonde woman and a knight with a black armor. The vision disappears. Slowly, you begin to visualize where the next Stone of Commune is...The Goddard Castle Town...There is Pamela Aprodia with the Stone of Commune...The beam from the stone is much weaker than before. In an instant, the images disappear and then the stone goes completely dark. [8-03.htm] Tablet of Vision: Putting your hands on the tablet, the location of the Stone of Commune again becomes clear. Pamela Aprodia in the Goddard Castle Town has the fifth Stone of Commune. Go and get it from her! [9-01.htm] Tablet of Vision: To decode the figures in the tablet, the Stone of Commune is needed. The fifth Stone of Commune is in the possession of the Archon of Halisha! You can find him at the Sepulchers or the Shrine of the Feudal Lords at the northeastern part of the Wall of Argos, and defeat low-grade evils. [9-02.htm] Tablet of Vision: Ancient, indecipherable hieroglyphs are engraved upon the tablet. They emit a mysterious, dim light. There is something magical and powerful in the tablet. Commune with the Tablet of Vision. [9-03.htm] Tablet of Vision: The Tablet of Vision becomes overwhelmed by bright lights. While you are holding the stone to work on it, you start to acquire a new sense of knowledge as you hear the voices of thousands reading scriptures in the background. You now realize the truth of the world and yet understand nothing. There is a vision of a beautiful blonde woman and a knight with black armor. The vision disappears. Slowly, you begin to visualize where the next Stone of Commune is...A vision appears...The sixth Tablet of Vision hidden in the wilds. Standing in front of the tablet is the unfamiliar shadow of a human...His face is invisible in the darkness, but the Stone of Commune held in his hands emits a dim light. In an instant, the images disappear and then the stone goes completely dark. [9-04.htm] Tablet of Vision: Putting your hands on the tablet, the location of the Stone of Commune again becomes clear. The sixth Stone of Commune is hidden in the wilderness and there are ominious signs of a person's presence ...He is holding the Stone of Commune in his hands...Go and get the stone from him!
Исходник условий и наград (Java)
/*
 * This file is part of the L2J Mobius project.
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package quests.Q00099_SagaOfTheFortuneSeeker;

import quests.AbstractSagaQuest;

/**
 * Saga of the Fortune Seeker (99)
 * @author Emperorc
 */
public class Q00099_SagaOfTheFortuneSeeker extends AbstractSagaQuest
{
	public Q00099_SagaOfTheFortuneSeeker()
	{
		super(99, "Saga of the Fortune Seeker");
		_npc = new int[]
		{
			31594,
			31623,
			31600,
			31600,
			31601,
			31646,
			31649,
			31650,
			31654,
			31655,
			31657,
			31600
		};
		_items = new int[]
		{
			7080,
			7608,
			7081,
			7514,
			7297,
			7328,
			7359,
			7390,
			7421,
			7452,
			7109,
			0
		};
		_mob = new int[]
		{
			27259,
			27248,
			27309
		};
		_classId = new int[]
		{
			117
		};
		_prevClass = new int[]
		{
			0x37
		};
		_x = new int[]
		{
			191046,
			46066,
			46087
		};
		_y = new int[]
		{
			-40640,
			-36396,
			-36372
		};
		_z = new int[]
		{
			-3042,
			-1685,
			-1685
		};
		_text = new String[]
		{
			"PLAYERNAME! Pursued to here! However, I jumped out of the Banshouren boundaries! You look at the giant as the sign of power!",
			"... Oh ... good! So it was ... let's begin!",
			"I do not have the patience ..! I have been a giant force ...! Cough chatter ah ah ah!",
			"Paying homage to those who disrupt the orderly will be PLAYERNAME's death!",
			"Now, my soul freed from the shackles of the millennium, Halixia, to the back side I come ...",
			"Why do you interfere others' battles?",
			"This is a waste of time.. Say goodbye...!",
			"...That is the enemy",
			"...Goodness! PLAYERNAME you are still looking?",
			"PLAYERNAME ... Not just to whom the victory. Only personnel involved in the fighting are eligible to share in the victory.",
			"Your sword is not an ornament. Don't you think, PLAYERNAME?",
			"Goodness! I no longer sense a battle there now.",
			"let...",
			"Only engaged in the battle to bar their choice. Perhaps you should regret.",
			"The human nation was foolish to try and fight a giant's strength.",
			"Must...Retreat... Too...Strong.",
			"PLAYERNAME. Defeat...by...retaining...and...Mo...Hacker",
			"....! Fight...Defeat...It...Fight...Defeat...It..."
		};
		registerNPCs();
	}
}


// Shared quest dependency: AbstractSagaQuest.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;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.l2jmobius.gameserver.config.PlayerConfig;
import org.l2jmobius.gameserver.entity.World;
import org.l2jmobius.gameserver.entity.WorldObject;
import org.l2jmobius.gameserver.entity.actor.Creature;
import org.l2jmobius.gameserver.entity.actor.Npc;
import org.l2jmobius.gameserver.entity.actor.Player;
import org.l2jmobius.gameserver.entity.groups.Party;
import org.l2jmobius.gameserver.mechanics.script.Quest;
import org.l2jmobius.gameserver.mechanics.script.QuestState;
import org.l2jmobius.gameserver.mechanics.skill.Skill;
import org.l2jmobius.gameserver.network.enums.ChatType;
import org.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
import org.l2jmobius.gameserver.network.serverpackets.NpcSay;

public abstract class AbstractSagaQuest extends Quest
{
	protected int[] _npc = {};
	protected int[] _items = {};
	protected int[] _mob = {};
	protected int[] _classId = {};
	protected int[] _prevClass = {};
	protected int[] _x = {};
	protected int[] _y = {};
	protected int[] _z = {};
	protected String[] _text = {};
	private static final Map<Npc, Integer> SPAWN_LIST = new HashMap<>();
	// @formatter:off
	private static final int[][] QUEST_CLASSES =
	{
		{ 0x7f }, { 0x80, 0x81 }, { 0x82 }, { 0x05 }, { 0x14 }, { 0x15 },
		{ 0x02 }, { 0x03 }, { 0x2e }, { 0x30 }, { 0x33 }, { 0x34 }, { 0x08 },
		{ 0x17 }, { 0x24 }, { 0x09 }, { 0x18 }, { 0x25 }, { 0x10 }, { 0x11 },
		{ 0x1e }, { 0x0c }, { 0x1b }, { 0x28 }, { 0x0e }, { 0x1c }, { 0x29 },
		{ 0x0d }, { 0x06 }, { 0x22 }, { 0x21 }, { 0x2b }, { 0x37 }, { 0x39 }
	};
	// @formatter:on
	private static final int[] ARCHON_HALISHA_NORM =
	{
		18212,
		18214,
		18215,
		18216,
		18218
	};
	
	public AbstractSagaQuest(int questId, String description)
	{
		super(questId, description);
	}
	
	public void registerNPCs()
	{
		addStartNpc(_npc[0]);
		addAttackId(_mob[2]);
		addAttackId(_mob[1]);
		addSkillSeeId(_mob[1]);
		addFirstTalkId(_npc[4]);
		addTalkId(_npc);
		addKillId(_mob);
		final int[] questItemIds = _items.clone();
		questItemIds[0] = 0;
		questItemIds[2] = 0; // remove Ice Crystal and Divine Stone of Wisdom
		registerQuestItems(questItemIds);
		for (int archonMinion = 21646; archonMinion < 21652; archonMinion++)
		{
			addKillId(archonMinion);
		}
		
		addKillId(ARCHON_HALISHA_NORM);
		for (int guardianAngel = 27214; guardianAngel < 27217; guardianAngel++)
		{
			addKillId(guardianAngel);
		}
	}
	
	@Override
	public String onEvent(String event, Npc npc, Player player)
	{
		final QuestState st = getQuestState(player, false);
		if (st == null)
		{
			return null;
		}
		
		String htmltext = null;
		switch (event)
		{
			case "0-011.htm":
			case "0-012.htm":
			case "0-013.htm":
			case "0-014.htm":
			case "0-015.htm":
			{
				htmltext = event;
				break;
			}
			case "accept":
			{
				st.startQuest();
				giveItems(player, _items[10], 1);
				htmltext = "0-03.htm";
				break;
			}
			case "0-1":
			{
				if (player.getLevel() < 76)
				{
					htmltext = "0-02.htm";
					if (st.isCreated())
					{
						st.exitQuest(true);
					}
				}
				else
				{
					htmltext = "0-05.htm";
				}
				break;
			}
			case "0-2":
			{
				if (player.getLevel() < 76)
				{
					takeItems(player, _items[10], -1);
					st.setCond(20, true);
					htmltext = "0-08.htm";
				}
				else
				{
					takeItems(player, _items[10], -1);
					addExpAndSp(player, 2299404, 0);
					giveAdena(player, 5000000, true);
					giveItems(player, 6622, 1);
					final int playerClass = getPlayerClass(player);
					final int prevClass = getPrevClass(player);
					player.setPlayerClass(playerClass);
					if (!player.isSubClassActive() && (player.getBaseClass() == prevClass))
					{
						player.setBaseClass(playerClass);
					}
					
					player.broadcastUserInfo();
					cast(npc, player, 4339, 1);
					st.exitQuest(false);
					htmltext = "0-07.htm";
				}
				break;
			}
			case "1-3":
			{
				st.setCond(3);
				htmltext = "1-05.htm";
				break;
			}
			case "1-4":
			{
				st.setCond(4);
				takeItems(player, _items[0], 1);
				if (_items[11] != 0)
				{
					takeItems(player, _items[11], 1);
				}
				
				giveItems(player, _items[1], 1);
				htmltext = "1-06.htm";
				break;
			}
			case "2-1":
			{
				st.setCond(2);
				htmltext = "2-05.htm";
				break;
			}
			case "2-2":
			{
				st.setCond(5);
				takeItems(player, _items[1], 1);
				giveItems(player, _items[4], 1);
				htmltext = "2-06.htm";
				break;
			}
			case "3-5":
			{
				htmltext = "3-07.htm";
				break;
			}
			case "3-6":
			{
				st.setCond(11);
				htmltext = "3-02.htm";
				break;
			}
			case "3-7":
			{
				st.setCond(12);
				htmltext = "3-03.htm";
				break;
			}
			case "3-8":
			{
				st.setCond(13);
				takeItems(player, _items[2], 1);
				giveItems(player, _items[7], 1);
				htmltext = "3-08.htm";
				break;
			}
			case "4-1":
			{
				htmltext = "4-010.htm";
				break;
			}
			case "4-2":
			{
				giveItems(player, _items[9], 1);
				st.setCond(18, true);
				htmltext = "4-011.htm";
				break;
			}
			case "4-3":
			{
				giveItems(player, _items[9], 1);
				st.setCond(18, true);
				autoChat(npc, _text[13].replace("PLAYERNAME", player.getName()));
				st.set("Quest0", "0");
				cancelQuestTimer("Mob_2 has despawned", npc, player);
				deleteSpawn(npc);
				return null;
			}
			case "5-1":
			{
				st.setCond(6, true);
				takeItems(player, _items[4], 1);
				cast(npc, player, 4546, 1);
				htmltext = "5-02.htm";
				break;
			}
			case "6-1":
			{
				st.setCond(8, true);
				st.set("spawned", "0");
				takeItems(player, _items[5], 1);
				cast(npc, player, 4546, 1);
				htmltext = "6-03.htm";
				break;
			}
			case "7-1":
			{
				if (st.getInt("spawned") == 1)
				{
					htmltext = "7-03.htm";
				}
				else if (st.getInt("spawned") == 0)
				{
					final Npc mob1 = addSpawn(_mob[0], _x[0], _y[0], _z[0], -1);
					st.set("spawned", "1");
					startQuestTimer("Mob_1 Timer 1", 500, mob1, player);
					startQuestTimer("Mob_1 has despawned", 300000, mob1, player);
					addSpawn(st, mob1);
					htmltext = "7-02.htm";
				}
				else
				{
					htmltext = "7-04.htm";
				}
				break;
			}
			case "7-2":
			{
				st.setCond(10, true);
				takeItems(player, _items[6], 1);
				cast(npc, player, 4546, 1);
				htmltext = "7-06.htm";
				break;
			}
			case "8-1":
			{
				st.setCond(14, true);
				takeItems(player, _items[7], 1);
				cast(npc, player, 4546, 1);
				htmltext = "8-02.htm";
				break;
			}
			case "9-1":
			{
				st.setCond(17, true);
				st.set("Quest0", "0");
				st.set("Tab", "0");
				takeItems(player, _items[8], 1);
				cast(npc, player, 4546, 1);
				htmltext = "9-03.htm";
				break;
			}
			case "10-1":
			{
				if (st.getInt("Quest0") == 0)
				{
					final Npc mob3 = addSpawn(_mob[2], _x[1], _y[1], _z[1], -1);
					final Npc mob2 = addSpawn(_npc[4], _x[2], _y[2], _z[2], -1);
					addSpawn(st, mob3);
					addSpawn(st, mob2);
					st.set("Mob_2", String.valueOf(mob2.getObjectId()));
					st.set("Quest0", "1");
					st.set("Quest1", "45");
					startQuestTimer("Mob_3 Timer 1", 500, mob3, player, true);
					startQuestTimer("Mob_3 has despawned", 59000, mob3, player);
					startQuestTimer("Mob_2 Timer 1", 500, mob2, player);
					startQuestTimer("Mob_2 has despawned", 60000, mob2, player);
					htmltext = "10-02.htm";
				}
				else if (st.getInt("Quest1") == 45)
				{
					htmltext = "10-03.htm";
				}
				else
				{
					htmltext = "10-04.htm";
				}
				break;
			}
			case "10-2":
			{
				st.setCond(19, true);
				takeItems(player, _items[9], 1);
				cast(npc, player, 4546, 1);
				htmltext = "10-06.htm";
				break;
			}
			case "11-9":
			{
				st.setCond(15);
				htmltext = "11-03.htm";
				break;
			}
			case "Mob_1 Timer 1":
			{
				autoChat(npc, _text[0].replace("PLAYERNAME", player.getName()));
				return null;
			}
			case "Mob_1 has despawned":
			{
				autoChat(npc, _text[1].replace("PLAYERNAME", player.getName()));
				st.set("spawned", "0");
				deleteSpawn(npc);
				return null;
			}
			case "Archon Hellisha has despawned":
			{
				autoChat(npc, _text[6].replace("PLAYERNAME", player.getName()));
				st.set("spawned", "0");
				deleteSpawn(npc);
				return null;
			}
			case "Mob_3 Timer 1":
			{
				final Npc mob2 = findSpawn(player, World.findObject(st.getInt("Mob_2")).asNpc());
				if ((World.getFirstVisibleObject(npc, Npc.class, it -> it == mob2) != null))
				{
					npc.asAttackable().addDamageHate(mob2, 0, 99999);
					npc.getAI().setIntentionAttack(mob2);
					mob2.getAI().setIntentionAttack(npc);
					autoChat(npc, _text[14].replace("PLAYERNAME", player.getName()));
					cancelQuestTimer("Mob_3 Timer 1", npc, player);
				}
				
				return null;
			}
			case "Mob_3 has despawned":
			{
				autoChat(npc, _text[15].replace("PLAYERNAME", player.getName()));
				st.set("Quest0", "2");
				deleteSpawn(npc);
				return null;
			}
			case "Mob_2 Timer 1":
			{
				autoChat(npc, _text[7].replace("PLAYERNAME", player.getName()));
				startQuestTimer("Mob_2 Timer 2", 1500, npc, player);
				if (st.getInt("Quest1") == 45)
				{
					st.set("Quest1", "0");
				}
				
				return null;
			}
			case "Mob_2 Timer 2":
			{
				autoChat(npc, _text[8].replace("PLAYERNAME", player.getName()));
				startQuestTimer("Mob_2 Timer 3", 10000, npc, player);
				return null;
			}
			case "Mob_2 Timer 3":
			{
				if (st.getInt("Quest0") == 0)
				{
					startQuestTimer("Mob_2 Timer 3", 13000, npc, player);
					if (getRandomBoolean())
					{
						autoChat(npc, _text[9].replace("PLAYERNAME", player.getName()));
					}
					else
					{
						autoChat(npc, _text[10].replace("PLAYERNAME", player.getName()));
					}
				}
				
				return null;
			}
			case "Mob_2 has despawned":
			{
				st.set("Quest1", String.valueOf(st.getInt("Quest1") + 1));
				if ((st.getInt("Quest0") == 1) || (st.getInt("Quest0") == 2) || (st.getInt("Quest1") > 3))
				{
					st.set("Quest0", "0");
					
					// TODO: This "if" will never be true.
					if (st.getInt("Quest0") == 1)
					{
						autoChat(npc, _text[11].replace("PLAYERNAME", player.getName()));
					}
					else
					{
						autoChat(npc, _text[12].replace("PLAYERNAME", player.getName()));
					}
					
					deleteSpawn(npc);
				}
				else
				{
					startQuestTimer("Mob_2 has despawned", 1000, npc, player);
				}
				
				return null;
			}
		}
		
		return htmltext;
	}
	
	@Override
	public void onAttack(Npc npc, Player player, int damage, boolean isSummon)
	{
		final QuestState st2 = findRightState(npc);
		if (st2 != null)
		{
			final int cond = st2.getCond();
			final QuestState st = getQuestState(player, false);
			final int npcId = npc.getId();
			if ((npcId == _mob[2]) && (st == st2) && (cond == 17))
			{
				int quest0 = st.getInt("Quest0") + 1;
				if (quest0 == 1)
				{
					autoChat(npc, _text[16].replace("PLAYERNAME", player.getName()));
				}
				
				if (quest0 > 15)
				{
					quest0 = 1;
					autoChat(npc, _text[17].replace("PLAYERNAME", player.getName()));
					cancelQuestTimer("Mob_3 has despawned", npc, st2.getPlayer());
					st.set("Tab", "1");
					deleteSpawn(npc);
				}
				
				st.set("Quest0", Integer.toString(quest0));
			}
			else if ((npcId == _mob[1]) && (cond == 15) && ((st != st2) || player.isInParty()))
			{
				autoChat(npc, _text[5].replace("PLAYERNAME", player.getName()));
				cancelQuestTimer("Archon Hellisha has despawned", npc, st2.getPlayer());
				st2.set("spawned", "0");
				deleteSpawn(npc);
			}
		}
	}
	
	@Override
	public String onFirstTalk(Npc npc, Player player)
	{
		String htmltext = "";
		final QuestState st = getQuestState(player, false);
		final int npcId = npc.getId();
		if ((st != null) && (npcId == _npc[4]))
		{
			final int cond = st.getCond();
			if (cond == 17)
			{
				final QuestState st2 = findRightState(npc);
				if (st2 != null)
				{
					player.setLastQuestNpcObject(npc.getObjectId());
					final int tab = st.getInt("Tab");
					final int quest0 = st.getInt("Quest0");
					if (st == st2)
					{
						if (tab == 1)
						{
							if (quest0 == 0)
							{
								htmltext = "4-04.htm";
							}
							else if (quest0 == 1)
							{
								htmltext = "4-06.htm";
							}
						}
						else if (quest0 == 0)
						{
							htmltext = "4-01.htm";
						}
						else if (quest0 == 1)
						{
							htmltext = "4-03.htm";
						}
					}
					else if (tab == 1)
					{
						if (quest0 == 0)
						{
							htmltext = "4-05.htm";
						}
						else if (quest0 == 1)
						{
							htmltext = "4-07.htm";
						}
					}
					else if (quest0 == 0)
					{
						htmltext = "4-02.htm";
					}
				}
			}
			else if (cond == 18)
			{
				htmltext = "4-08.htm";
			}
		}
		
		if (htmltext.isEmpty())
		{
			npc.showChatWindow(player);
		}
		
		return htmltext;
	}
	
	@Override
	public void onKill(Npc npc, Player player, boolean isSummon)
	{
		final int npcId = npc.getId();
		QuestState st = getQuestState(player, false);
		for (int archonMinion = 21646; archonMinion < 21652; archonMinion++)
		{
			if (npcId == archonMinion)
			{
				final Party party = player.getParty();
				if (party != null)
				{
					final List<QuestState> partyQuestMembers = new ArrayList<>();
					for (Player player1 : party.getMembers())
					{
						final QuestState st1 = findQuest(player1);
						if ((st1 != null) && st1.isCond(15) && player1.isInsideRadius2D(player, PlayerConfig.ALT_PARTY_RANGE))
						{
							partyQuestMembers.add(st1);
						}
					}
					
					if (!partyQuestMembers.isEmpty())
					{
						final QuestState st2 = partyQuestMembers.get(getRandom(partyQuestMembers.size()));
						giveHalishaMark(st2);
					}
				}
				else
				{
					final QuestState st1 = findQuest(player);
					if ((st1 != null) && st1.isCond(15))
					{
						giveHalishaMark(st1);
					}
				}
				return;
			}
		}
		
		for (int element : ARCHON_HALISHA_NORM)
		{
			if (npcId == element)
			{
				final QuestState st1 = findQuest(player);
				if ((st1 != null) && st1.isCond(15))
				{
					// This is just a guess....not really sure what it actually says, if anything
					autoChat(npc, _text[4].replace("PLAYERNAME", st1.getPlayer().getName()));
					giveItems(player, _items[8], 1);
					takeItems(player, _items[3], -1);
					st1.setCond(16, true);
				}
				return;
			}
		}
		
		for (int guardianAngel = 27214; guardianAngel < 27217; guardianAngel++)
		{
			if (npcId == guardianAngel)
			{
				final QuestState st1 = findQuest(player);
				if ((st1 != null) && st1.isCond(6))
				{
					final int kills = st1.getInt("kills");
					if (kills < 9)
					{
						st1.set("kills", Integer.toString(kills + 1));
					}
					else
					{
						giveItems(player, _items[5], 1);
						st.setCond(7, true);
					}
				}
				return;
			}
		}
		
		if ((st != null) && (npcId != _mob[2]))
		{
			final QuestState st2 = findRightState(npc);
			if (st2 != null)
			{
				final int cond = st.getCond();
				if ((npcId == _mob[0]) && (cond == 8))
				{
					if (!player.isInParty() && (st == st2))
					{
						autoChat(npc, _text[12].replace("PLAYERNAME", player.getName()));
						giveItems(player, _items[6], 1);
						st.setCond(9, true);
					}
					
					cancelQuestTimer("Mob_1 has despawned", npc, st2.getPlayer());
					st2.set("spawned", "0");
					deleteSpawn(npc);
				}
				else if ((npcId == _mob[1]) && (cond == 15))
				{
					if (!player.isInParty())
					{
						if (st == st2)
						{
							autoChat(npc, _text[4].replace("PLAYERNAME", player.getName()));
							giveItems(player, _items[8], 1);
							takeItems(player, _items[3], -1);
							st.setCond(16, true);
						}
						else
						{
							autoChat(npc, _text[5].replace("PLAYERNAME", player.getName()));
						}
					}
					
					cancelQuestTimer("Archon Hellisha has despawned", npc, st2.getPlayer());
					st2.set("spawned", "0");
					deleteSpawn(npc);
				}
			}
		}
		else if (npcId == _mob[0])
		{
			st = findRightState(npc);
			if (st != null)
			{
				cancelQuestTimer("Mob_1 has despawned", npc, st.getPlayer());
				st.set("spawned", "0");
				deleteSpawn(npc);
			}
		}
		else if (npcId == _mob[1])
		{
			st = findRightState(npc);
			if (st != null)
			{
				cancelQuestTimer("Archon Hellisha has despawned", npc, st.getPlayer());
				st.set("spawned", "0");
				deleteSpawn(npc);
			}
		}
		else if (npcId == _mob[2])
		{
			st = findRightState(npc);
			if (st != null)
			{
				st.setCond(18, true);
				autoChat(npc, _text[13].replace("PLAYERNAME", player.getName()));
				st.set("Quest0", "0");
				cancelQuestTimer("Mob_2 has despawned", npc, player);
				deleteSpawn(npc);
			}
		}
	}
	
	@Override
	public void onSkillSee(Npc npc, Player player, Skill skill, List<WorldObject> targets, boolean isSummon)
	{
		if (SPAWN_LIST.containsKey(npc) && (SPAWN_LIST.get(npc) != player.getObjectId()))
		{
			final Player questPlayer = World.findObject(SPAWN_LIST.get(npc)).asPlayer();
			if (questPlayer == null)
			{
				return;
			}
			
			for (WorldObject obj : targets)
			{
				if ((obj == questPlayer) || (obj == npc))
				{
					final QuestState st2 = findRightState(npc);
					if (st2 == null)
					{
						return;
					}
					
					autoChat(npc, _text[5].replace("PLAYERNAME", player.getName()));
					cancelQuestTimer("Archon Hellisha has despawned", npc, st2.getPlayer());
					st2.set("spawned", "0");
					deleteSpawn(npc);
				}
			}
		}
	}
	
	@Override
	public String onTalk(Npc npc, Player player)
	{
		final QuestState st = getQuestState(player, true);
		String htmltext = getNoQuestMsg(player);
		final int npcId = npc.getId();
		if ((npcId == _npc[0]) && st.isCompleted())
		{
			htmltext = getAlreadyCompletedMsg(player);
		}
		else if (player.getPlayerClass().getId() == getPrevClass(player))
		{
			switch (st.getCond())
			{
				case 0:
				{
					if (npcId == _npc[0])
					{
						htmltext = "0-01.htm";
					}
					break;
				}
				case 1:
				{
					if (npcId == _npc[0])
					{
						htmltext = "0-04.htm";
					}
					else if (npcId == _npc[2])
					{
						htmltext = "2-01.htm";
					}
					break;
				}
				case 2:
				{
					if (npcId == _npc[2])
					{
						htmltext = "2-02.htm";
					}
					else if (npcId == _npc[1])
					{
						htmltext = "1-01.htm";
					}
					break;
				}
				case 3:
				{
					if ((npcId == _npc[1]) && hasQuestItems(player, _items[0]))
					{
						if ((_items[11] == 0) || hasQuestItems(player, _items[11]))
						{
							htmltext = "1-03.htm";
						}
						else
						{
							htmltext = "1-02.htm";
						}
					}
					break;
				}
				case 4:
				{
					if (npcId == _npc[1])
					{
						htmltext = "1-04.htm";
					}
					else if (npcId == _npc[2])
					{
						htmltext = "2-03.htm";
					}
					break;
				}
				case 5:
				{
					if (npcId == _npc[2])
					{
						htmltext = "2-04.htm";
					}
					else if (npcId == _npc[5])
					{
						htmltext = "5-01.htm";
					}
					break;
				}
				case 6:
				{
					if (npcId == _npc[5])
					{
						htmltext = "5-03.htm";
					}
					else if (npcId == _npc[6])
					{
						htmltext = "6-01.htm";
					}
					break;
				}
				case 7:
				{
					if (npcId == _npc[6])
					{
						htmltext = "6-02.htm";
					}
					break;
				}
				case 8:
				{
					if (npcId == _npc[6])
					{
						htmltext = "6-04.htm";
					}
					else if (npcId == _npc[7])
					{
						htmltext = "7-01.htm";
					}
					break;
				}
				case 9:
				{
					if (npcId == _npc[7])
					{
						htmltext = "7-05.htm";
					}
					break;
				}
				case 10:
				{
					if (npcId == _npc[7])
					{
						htmltext = "7-07.htm";
					}
					else if (npcId == _npc[3])
					{
						htmltext = "3-01.htm";
					}
					break;
				}
				case 11:
				case 12:
				{
					if (npcId == _npc[3])
					{
						if (hasQuestItems(player, _items[2]))
						{
							htmltext = "3-05.htm";
						}
						else
						{
							htmltext = "3-04.htm";
						}
					}
					break;
				}
				case 13:
				{
					if (npcId == _npc[3])
					{
						htmltext = "3-06.htm";
					}
					else if (npcId == _npc[8])
					{
						htmltext = "8-01.htm";
					}
					break;
				}
				case 14:
				{
					if (npcId == _npc[8])
					{
						htmltext = "8-03.htm";
					}
					else if (npcId == _npc[11])
					{
						htmltext = "11-01.htm";
					}
					break;
				}
				case 15:
				{
					if (npcId == _npc[11])
					{
						htmltext = "11-02.htm";
					}
					else if (npcId == _npc[9])
					{
						htmltext = "9-01.htm";
					}
					break;
				}
				case 16:
				{
					if (npcId == _npc[9])
					{
						htmltext = "9-02.htm";
					}
					break;
				}
				case 17:
				{
					if (npcId == _npc[9])
					{
						htmltext = "9-04.htm";
					}
					else if (npcId == _npc[10])
					{
						htmltext = "10-01.htm";
					}
					break;
				}
				case 18:
				{
					if (npcId == _npc[10])
					{
						htmltext = "10-05.htm";
					}
					break;
				}
				case 19:
				{
					if (npcId == _npc[10])
					{
						htmltext = "10-07.htm";
					}
					else if (npcId == _npc[0])
					{
						htmltext = "0-06.htm";
					}
					break;
				}
				case 20:
				{
					if (npcId == _npc[0])
					{
						if (player.getLevel() >= 76)
						{
							htmltext = "0-09.htm";
							
							st.exitQuest(false);
							addExpAndSp(player, 2299404, 0);
							giveAdena(player, 5000000, true);
							giveItems(player, 6622, 1); // XXX rewardItems?
							final int playerClass = getPlayerClass(player);
							final int prevClass = getPrevClass(player);
							player.setPlayerClass(playerClass);
							if (!player.isSubClassActive() && (player.getBaseClass() == prevClass))
							{
								player.setBaseClass(playerClass);
							}
							
							player.broadcastUserInfo();
							cast(npc, player, 4339, 1);
						}
						else
						{
							htmltext = "0-010.htm";
						}
					}
					break;
				}
			}
		}
		
		return htmltext;
	}
	
	private QuestState findQuest(Player player)
	{
		final QuestState st = getQuestState(player, false);
		if (st != null)
		{
			if (getId() == 68)
			{
				for (int q = 0; q < 2; q++)
				{
					if (player.getPlayerClass().getId() == QUEST_CLASSES[1][q])
					{
						return st;
					}
				}
			}
			else if (player.getPlayerClass().getId() == QUEST_CLASSES[getId() - 67][0])
			{
				return st;
			}
		}
		
		return null;
	}
	
	private void autoChat(Npc npc, String text)
	{
		npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.GENERAL, npc.getId(), text));
	}
	
	private void cast(Npc npc, Creature target, int skillId, int level)
	{
		target.broadcastSkillPacket(new MagicSkillUse(target, target, skillId, level, 6000, 1), target);
		target.broadcastSkillPacket(new MagicSkillUse(npc, npc, skillId, level, 6000, 1), npc);
	}
	
	private void addSpawn(QuestState st, Npc mob)
	{
		SPAWN_LIST.put(mob, st.getPlayer().getObjectId());
	}
	
	private static Npc findSpawn(Player player, Npc npc)
	{
		if (SPAWN_LIST.containsKey(npc) && (SPAWN_LIST.get(npc) == player.getObjectId()))
		{
			return npc;
		}
		
		return null;
	}
	
	private void deleteSpawn(Npc npc)
	{
		if (SPAWN_LIST.remove(npc) != null)
		{
			npc.deleteMe();
		}
	}
	
	private QuestState findRightState(Npc npc)
	{
		Player player = null;
		QuestState st = null;
		final Integer spawned = SPAWN_LIST.get(npc);
		if (spawned != null)
		{
			player = World.getPlayer(spawned);
			if (player != null)
			{
				st = player.getQuestState(getName());
			}
		}
		
		return st;
	}
	
	private int getPlayerClass(Player player)
	{
		if (player.getPlayerClass().getId() == 0x81)
		{
			return _classId[1];
		}
		
		return _classId[0];
	}
	
	private int getPrevClass(Player player)
	{
		if (player.getPlayerClass().getId() == 0x81)
		{
			if (_prevClass.length == 1)
			{
				return -1;
			}
			
			return _prevClass[1];
		}
		
		return _prevClass[0];
	}
	
	private void giveHalishaMark(QuestState st)
	{
		if (st.getInt("spawned") == 0)
		{
			final Player player = st.getPlayer();
			if (getQuestItemsCount(player, _items[3]) >= 700)
			{
				takeItems(player, _items[3], 20);
				final int xx = st.getPlayer().getX();
				final int yy = st.getPlayer().getY();
				final int zz = st.getPlayer().getZ();
				final Npc archon = addSpawn(_mob[1], xx, yy, zz, -1);
				addSpawn(st, archon);
				st.set("spawned", "1");
				startQuestTimer("Archon Hellisha has despawned", 600000, archon, player);
				autoChat(archon, _text[13].replace("PLAYERNAME", st.getPlayer().getName()));
				archon.asAttackable().addDamageHate(st.getPlayer(), 0, 99999);
				archon.getAI().setIntentionAttack(st.getPlayer());
			}
			else
			{
				giveItems(player, _items[3], getRandom(1, 4));
			}
		}
	}
}