Saga of the Dreadnoughts
- ID
- 74
- Название
- Saga of the Dreadnoughts
- start_npcs_json
- []
- npc_ids_json
- []
- constants_json
- {}
- Статус разбора
- metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
- Источник
- game/data/scripts/quests/Q00074_SagaOfTheDreadnought/Q00074_SagaOfTheDreadnought.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] Master Aiken: Warlords have always been at the forefront of major victories, from the war between Aden and Elmore to the recent conquest of the Tower of Insolence. We've had many nicknames, Terror of the Battlefield, Dragon's Descendants, and so on... Do you know which art of fighting the Warlords developed their techniques from? "No, I don't."
[0-010.htm] Master Aiken: You must be stronger to control the energy of the dragon. To fulfill the vision in your mind you must have more experience. (Only a character of level 76 or above is allowed to do a class transfer. Do not abandon quest before transfer is complete!)
[0-02.htm] Master Aiken: I heard she was somewhere up north. You should take on a task more suited to your abilities. (This quest may only be undertaken by a Warlord of level 76 or above.)
[0-03.htm] Master Aiken: Meet with Guard Ulrich in Goddard Castle Town. He used to live in Giran. He sent me a letter about Leona, her battle and the fire dragon Valakas. He knows all the details. Read this book he sent me before you go.
[0-04.htm] Master Aiken: Guard Ulrich in Goddard Castle Town knows all the details.
[0-05.htm] Master Aiken: Warlords studied the fighting techniques of dragons during the war of the gods. That's why we're rumored to be descended from dragons! Leona Blackbird, also known as the Bride of the Fire Dragon, was once captain of the guards in Giran. Before the era of chaos began she was defeated by Sighardt Ein. Now she's a wanderer. Her fighting technique was truly excellent. If you wish to improve yours, you should meet her. "Where can I find her?"
[0-06.htm] Master Aiken: Things were more orderly during the war with Elmore. We have entered an era of chaos. Have you met the Bride of the Fire Dragon and acquired the vision of the dragon? "Yes I have."
[0-07.htm] Master Aiken: I felt that power in you. It can instill fear in people, but it can also help us maintain peace in this land. I hereby bestow upon you the title of Dreadnought, dragon descendant!
[0-08.htm] Master Aiken: You're not strong enough to control the energy of the dragon. Come back when you have more training. (Only characters level 76 or above are allowed to do a class transfer. Do not abandon quest before transfer is complete!)
[0-09.htm] Master Aiken: You have proven your strength and learned the vision of the dragon. I hereby bestow upon you the title of Dreadnought, dragon descendant!
[1-01.htm] Chef Donath: Ah, the fish soup of dead souls? What do you need it for? Who asked for it? There are many different kinds, you know! I need to know for whom and for what purpose it will be used so that I can make it correctly. "Well, you see..."
[1-02.htm] Chef Donath: Have you brought the ice crystal and the fish? Ask Chef Jeremy for the ice crystal. A skilled fisherman could catch a fat, white fish for you.
[1-03.htm] Chef Donath: Good job! I'll get started then! This is going to take a while. Please wait. "I'll wait."
[1-04.htm] Chef Donath: Did Guard Ullrich's mother enjoy the soup I made?
[1-05.htm] Chef Donath: You mean Guard Ullrich of Goddard Castle Town? Perhaps he's trying to extend someone's lifespan. That soup can have many different effects... You'll need to bring a fat white fish and an ice crystal. You can get the ice crystal from Chef Jeremy, nearby. And as for the fat white fish... you're on your own!
[1-06.htm] Chef Donath: Your food is ready! This fish is famous for its strong life force and vitality. The ice crystal captured this life force and infused it into the soup! I'm sure Guard Ullrich's mother will enjoy it.
[10-01.htm] Tablet of Vision: As you approach the tablet, you hear a terrible racket, as if two giant powers had collided! You hear a woman scream. This is all familiar to you. There's that huge angel, and the lady with the power of a dragon! Warlords are many people's only hope and must have great strength. The blood of dragons boils in their veins. Dragons strike a blow...! .....There's the tablet! Is it real or an illusion? The sound of swordplay brings you back to reality. Patrol the area.
[10-02.htm] Tablet of Vision: The image of an angel stands before you. He was sent by a goddess to prevent Humans from reaching their true potential. A fearless woman stands against him!
[10-03.htm] Tablet of Vision: The tablet is still and dark. Leona looks as if she has something to say.
[10-04.htm] Tablet of Vision: There is a disturbance nearby. Don't get involved. Wait and see what happens.
[10-05.htm] Tablet of Vision: The Stone of Commune starts emitting light as you draw near the tablet. Commune with the Tablet of Vision.
[10-06.htm] Tablet of Vision: A sharp blast of knowledge sears painfully into your brain. You hear the sound of distant laughter. A man announces the birth of another Hero. The woman in blue disagrees... A child no longer, but still young. The power of all dragons is Shilen's, and she fights with her children by her side. But only the strongest power can bring peace! Visions of dragons flash through your mind. A human who imitates the dragon in combat would command tremendous physical power when outnumbered! You feel this power coursing through you! Go back to Master Aiken in Aden Castle Town.
[10-07.htm] Tablet of Vision: Further communion with this tablet would be futile. Speak with Master Aiken in Aden Castle Town and tell him what you've learned from Leona.
[11-01.htm] Mysterious Wizard: The Stone of Commune? I never thought about that! I used it to watch over the bride of a fire dragon, but it led people to me. I can't give you this one because I'm still using it, but I'll tell you where you can get one. "Where?"
[11-02.htm] Mysterious Wizard: This stone, you can get it if you defeat the Inferior of Halisha in the four Sepulchers or Shrine of the Loyal. Why don't you go there? After you get the stone, go to find the Tablet in the southwest of the Wall of Argos.
[11-03.htm] Mysterious Wizard: This stone contains the power of Gran Kain, the God of Destruction. I'm not sure about it's composition, but I do know that the Stone of Commune was made from a material that Gran Kain cherished dearly. At the present... One of the Rulers of Hell is said to use this very same material. That would be Halisha. Maybe you could get it by defeating his Minions or Archon? Luckily, I have heard that Halisha is now sending many of his minions to the Four Sepulchers. It might be a good idea to go make every effort to get there quickly to see what you can obtain. Hmm.. the Evil Creatures in the Shrine of the Loyal are also Minions of Halisha. If you defeat them, much more powerful Minions will appear. Perhaps they also have the material you seek. After you find it, go to the Tablet in the southwest of the Wall of Argos.
[2-01.htm] Guard Ulrich: You must mean Leona Blackbird, the last lord of the manor in Giran. Yes, I saw her, all right! I summarized her accounts of her battles in this book! Considering your willingness to chase her, you must be an accomplished Warlord! Could I ask you a favor? "Go ahead and ask."
[2-02.htm] Guard Ulrich: I know this is quite sudden, but I don't have a choice. If you go to the hot springs region in the north and get some fish soup made by Chef Donath, I'll tell you everything Miss Leona told me.
[2-03.htm] Guard Ulrich: Thank you! My mother will be so happy to get this! Now I'll tell you what Miss Leona told me. She recounted an old story told by Valakas about a stone tablet with legendary power. She explained that the skills of a Warlord can be learned by watching a dragon, but to understand how a dragon actually utilizes its power, one must commune with the Tablet of Vision. "What is the Tablet of Vision?"
[2-04.htm] Guard Ulrich: She said that the first Tablet of Vision can be found on the south side of the Tower of Insolence. Did you put the Stone of Commune I gave you in a safe place?
[2-05.htm] Guard Ulrich: My mother is seriously ill! I've heard that dead souls fish soup might cure her, but it must be prepared by an excellent chef! Please visit Chef Donath in the hot springs region to the north and get some of this soup. Bring it to me and I'll tell you a story.
[2-06.htm] Guard Ulrich: The Tablets of Vision contain the secret power of the gods. They were divided and scattered throughout the world. Each must be paired with its own Stone of Commune before the information within can be accessed. The first tablet can be found on the south side of the Tower of Insolence. The Stone of Commune for that tablet was left with me by Miss Leona. I'll give it to you. While I'm at it, I should tell you about a book called "The Army of the White Wings". It describes the guardians that Miss Leona encountered while she was on the pilgrimage of the stone tablets. You may run into them as well, and should learn all you can about them.
[3-01.htm] Grand Master Bernhard: Ha! Are you the successor mentioned by the bride of Antharas? Of course! She visited me a while back. She said that someone was following her footsteps, seeking the power of the dragon! Can you solve the riddle? "Let's find out!"
[3-02.htm] Grand Master Bernhard: Go to the Ketra Orcs advance base and meet with Messenger Wahkan! He will tell you how to befriend them. Since you're skilled, I'm sure they'll welcome you. Earn their trust, obtain the Divine Stone of Wisdom and return here!
[3-03.htm] Grand Master Bernhard: First go to the Varka Silenos stronghold and meet with Naran Ashanuk, Varka's Messenger! He'll tell you how to befriend them. Since you're skilled I'm sure they'll welcome you. Earn their trust, obtain the Divine Stone of Wisdom and return here!
[3-04.htm] Grand Master Bernhard: Have you earned their trust? Go to either the Varka Silenos or the Ketra Orcs to obtain a Divine Stone of Wisdom and bring it to me. Pick either one, it doesn't matter. Change your mind if you choose. Just get it.
[3-05.htm] Grand Master Bernhard: You're back! Did you bring the Divine Stone of Wisdom? Good job! You are as capable as the bride of Antharas told me. Now I'll give you the Stone of Commune. The stone tablet that forms a union with it is north of the Varka Silenos stronghold. I'd like to see it myself, but I'm not a descendant of a dragon like you. The bride left a note with me. "What's it say?"
[3-06.htm] Grand Master Bernhard: Didn't I tell you? Look for the Tablet of Vision!
[3-07.htm] Grand Master Bernhard: She asked me to keep the Stone of Commune until someone worthy came to me for it. She also says that it's not complete. To make it perfect you will need a Divine Stone of Wisdom! There are two pieces held by opposing forces, the Ketra Orcs and the Varka Silenos. Both threaten Goddard. Bring back either of the stones. It won't be easy! You must earn their absolute trust. Which side will you choose? Ketra Orcs Varka Silenos
[3-08.htm] Grand Master Bernhard: Here it says, "Since you're reading this, you must have defeated the white-winged fighters." Is that so? Anyways... "You can follow in my footsteps and learn the vision of the dragon. Some will try to stop us. You'll see..." I don't know what she means, but here's the Stone of Commune.
[4-01.htm] Leona Blackbird: Finally, I get to meet you! We'll talk later. First, would you help me take care of this guy?
[4-010.htm] Leona Blackbird: I was suspicious for a while. Why, at that time, did the fire dragon come to me? What woke that beast from its sleep...? Especially damning was the fact that the seal of Shilen was broken! The era of chaos... The period the dragon warned about, had arrived at last. In times of chaos and violence, the most important thing to me was the power to realize my intentions... All the evil creatures and spirits were saying the same thing. Although Valakas was silent on the matter, I knew the truth. He wanted to tell me that if we were to realize the peace I sought, I needed a power that could shape things to my will. That applies to you as well! A Warlord can fight against multiple enemies. The more powerful a Warlord is, the fewer losses he suffers. I'll probably end up in hell for the deaths I'm responsible for, but still I continue, creating more death and destruction. No one dares challenge me! Take this last Stone of Commune... It will give you a new understanding. Complete the last communion and then visit Master Aiken in Aden Castle Town. Farewell! "Wait!"
[4-011.htm] Leona Blackbird: I was suspicious for a while. Why, at that time, did the fire dragon come to me? What woke that beast from its sleep...? Especially damning was the fact that the seal of Shilen was broken! The era of chaos... The period the dragon warned about, had arrived at last. In times of chaos and violence, the most important thing to me was the power to realize my intentions... All the evil creatures and spirits were saying the same thing. Although Valakas was silent on the matter, I knew the truth. He wanted to tell me that if we were to realize the peace I sought, I needed a power that could shape things to my will. That applies to you as well! A Warlord can fight against multiple enemies. The more powerful a Warlord is, the fewer losses he suffers. I'll probably end up in hell for the deaths I'm responsible for, but still I continue, creating more death and destruction. No one dares challenge me! Take this last Stone of Commune... It will give you a new understanding. Complete the last communion and then visit Master Aiken in Aden Castle Town.
[4-02.htm] Leona Blackbird: Sorry, but as you can see, this isn't the time for me to sit down for a chat!
[4-03.htm] Leona Blackbird: Hmm? He..he ran away? Well, that's OK! I didn't really need to kill him anyway!
[4-04.htm] Leona Blackbird: I have a lot of things I'd like to tell you. But for now, it's important for you to help me in defeating this guy. In order to obtain more power, you will need to overcome hardship! A real challenge like this one!
[4-05.htm] Leona Blackbird: What do you want from me? You shouldn't get so close when Warlords fight! You could get hurt!
[4-06.htm] Leona Blackbird: Good job! Pleased to meet you. I'm Leona Blackbird. Some call me such things as the Bride of the Fire Dragon, but believe me, I never married Valakas! Ha! At one time I was captain of the guard in Giran. That's when the fire dragon told me about this pilgrimage, which I didn't follow at that time. I didn't expect Sighardt Ein to attack at a time like that. When I think back on it now, I understand. I've been expecting someone like you to come looking for me. "Why is that?"
[4-07.htm] Leona Blackbird: Good job! Pleased to meet you. I'm Leona Blackbird. Some call me such things as the Bride of the Fire Dragon, but believe me, I never married Valakas! Ha! At one time I was captain of the guard in Giran. That's when the fire dragon told me about this pilgrimage, which I didn't follow at that time. I didn't expect Sighardt Ein to attack at a time like that. When I think back on it now, I understand. So, I've been expecting someone like you to come looking for me. Why is that?
[4-08.htm] Leona Blackbird: We meet again! Have you gotten the last vision of the dragon? The Tablet of Vision beside you holds the knowledge you seek.
[4-09.htm] Leona Blackbird: Take the stone and commune with the last stone tablet to learn the vision of the dragon...
[5-01.htm] Tablet of Vision: The Stone of Commune starts emitting light as soon as you near the Tablet of Vision. Commune with the Tablet of Vision.
[5-02.htm] Countless thoughts beyond comprehension sear painfully into your brain. A female voice seems to float on by as if the wind were singing... I feel the next Stone of Commune is in the possession of many warriors. I must get that stone if I am to achieve enlightenment! The monument said to look toward the south of the Valley of Saints.
[5-03.htm] Tablet of Vision: Further communion with this tablet is futile. The Guardians of Forbidden Knowledge have the next Stone of Commune in the south of the Valley of Saints. Kill the guardians and take their stone!
[6-01.htm] Tablet of Vision: The tablet has incomprehensible hieroglyphs engraved upon it. Guardians of Forbidden Knowledge have the Stone of Commune .
[6-02.htm] Tablet of Vision: The Stone of Commune starts emitting light as soon as you near the Tablet of Vision. Commune with the Tablet of Vision.
[6-03.htm] Tablet of Vision: Countless thoughts beyond comprehension sear painfully into your brain. You hear the faint whisper of a woman's voice. In a vision you see the guardian who once feared the power of Dragons and Gods... yet eventually he claimed that power for himself! That guardian now waits for those who seek to confront the Dragons, near the third Tablet of Vision in the southwest of the Wall of Argos. You cannot fight them by normal means, so you must learn from Leona's experience!
[6-04.htm] Tablet of Vision: Further communion with this tablet would be futile. The next challenge awaits you at the Tablet of Vision near the southwest part of the Wall of Argos! You must prepare yourself for battle!
[7-01.htm] Tablet of Vision: As you near the Tablet of Vision, you sense a presence. It must be a guardian, whose only purpose is to deny Humans the ultimate knowledge! You fear that you must find a way to defeat this foe beyond what you already know. The past may hold the key. What would Leona do? "I'll use my spear on them!"
[7-02.htm] Tablet of Vision: The woman who would deny Humans the power of dragons has sent soldiers to enforce her will. White Wing Combat Corps forever!
[7-03.htm] Tablet of Vision: The tablet means nothing until we defeat the guardian! Destroy the guardian and take his Stone of Commune!
[7-04.htm] Tablet of Vision: You sense a disturbance near the Tablet of Vision. Now isn't the time to prove yourself.
[7-05.htm] Tablet of Vision: The Stone of Commune starts emitting light as soon as you near the Tablet of Vision. Commune with the Tablet of Vision.
[7-06.htm] Tablet of Vision: Countless thoughts beyond comprehension sear painfully into your brain. You hear the faint whisper of a woman's voice. A vision appears... It's Grand Master Bernhart of the Warrior Guild in Goddard Castle Town! The Stone of Commune lies weakening in his powerful grasp...
[7-07.htm] Tablet of Vision: Further communion with this Tablet of Vision would be futile. You must get the next Stone of Commune from Grand Master Bernhart in Goddard Castle Town.
[8-01.htm] Tablet of Vision: The Stone of Commune starts emitting light as you approach the Tablet of Vision. Commune with the Tablet of Vision.
[8-02.htm] Tablet of Vision: Countless thoughts beyond comprehension sear painfully into your brain. A vision appears of a mysterious dark knight... I also see a man in a long, black robe, smiling and holding the Stone of Commune! He's up to no good and has everyone in Rune Territory fooled! Speak with the mysterious wizard in the Forest of the Dead.
[8-03.htm] Tablet of Vision: Communion with this tablet is complete. Get the next Stone of Commune from the mysterious wizard in the Forest of the Dead.
[9-01.htm] Tablet of Vision: The tablet is still and dark. The Stone of Commune that can access this tablet can be found at the Wall of Argos or the Imperial Tomb.
[9-02.htm] Tablet of Vision: The Stone of Commune starts emitting light as you approach the Tablet of Vision. Commune with the Tablet of Vision.
[9-03.htm] Tablet of Vision: A sharp blast of knowlege courses through your cranium! A vision appears of a black knight! There's a woman trying to prevent a man from getting the power of the dragon. White wings and the overwhelming presence of power! This is similar to the fear of a soldier facing the Lord of War on the battlefield. But the descendants of dragons have nothing to fear, like Leona. The Tablet of Vision can be found in the southern part of the Forest of the Dead where Leona is!
[9-04.htm] Tablet of Vision: Further communion with this tablet would be futile. The next Stone of Commune is near the sixth Tablet of Vision in the Forest of the Dead.
Исходник условий и наград (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.Q00074_SagaOfTheDreadnought;
import quests.AbstractSagaQuest;
/**
* @author Emperorc
*/
public class Q00074_SagaOfTheDreadnought extends AbstractSagaQuest
{
public Q00074_SagaOfTheDreadnought()
{
super(74, "Saga of the Dreadnoughts");
_npc = new int[]
{
30850,
31624,
31298,
31276,
31595,
31646,
31648,
31650,
31654,
31655,
31657,
31522
};
_items = new int[]
{
7080,
7538,
7081,
7489,
7272,
7303,
7334,
7365,
7396,
7427,
7097,
6480
};
_mob = new int[]
{
27290,
27223,
27282
};
_classId = new int[]
{
89
};
_prevClass = new int[]
{
0x03
};
_x = new int[]
{
191046,
46087,
46066
};
_y = new int[]
{
-40640,
-36372,
-36396
};
_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));
}
}
}
}