Saga of the Adventurer
- ID
- 79
- Название
- Saga of the Adventurer
- start_npcs_json
- []
- npc_ids_json
- []
- constants_json
- {}
- Статус разбора
- metadata_only; dynamic Java conditions/rewards retained in source; unresolved starts: []
- Источник
- game/data/scripts/quests/Q00079_SagaOfTheAdventurer/Q00079_SagaOfTheAdventurer.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] Black Cat: Are you from the union? Then please, listen carefully to what I'm about to say. "I'm listening."
[0-010.htm] Black Cat: Within your body hides an amazing power, but you are not skilled enough to control it yet. What a pity! Improve your skills and come back. (Only a character of level 76 or above is allowed to transfer to another class. Be careful. You cannot change occupation if you stop Quest!)
[0-02.htm] Black Cat: Bernard sent the wrong person again! I'm afraid he's completely lost his mind since he started collecting coins! (Only a character of level 76 or above and of the Treasure Hunter class may pursue this quest.)
[0-03.htm] Black Cat: All right! Finally, he sent the right person! Klaus is the only one who's ever even come close to achieving it. Alas, he too failed in the end... Now he spends his days loafing about Goddard Castle Town, getting drunk and fishing. He could tell you some things about forbidden power! Here's a description of the beast that maimed me... Now, go find Klaus, and don't come back until you've gotten the power!
[0-04.htm] Black Cat: You can probably find him hanging around the Fishermen's Guild in Goddard Castle Town.
[0-05.htm] Black Cat: At one time, I was considered the most likely to succeed in the Hunters Union! Unfortunately, I made the mistake of challenging the power that was forbidden by the gods! This power allows whoever controls it to transcend Human limitations! But look where it got me! My body was totally ruined, and when I could no longer challenge the power, I was expelled from the union by my jealous rivals! I sank into a mass of self-pity and regret! But then, I had an idea! Maybe I can't do it personally, but I can certainly train and send someone on my behalf! Using my brain rather than physical force, and overcoming many political obstacles, I took control of the union! While in that position, I never found the competent person I needed. When I resigned, I was promised by the president of the union that I would be supplied with a competent person! He seemed credible then, he wasn't so obsessed with his coins at that point... Are you up to the challenge? Are you willing to risk injuries such as mine, or worse? Are you brave enough to seek the power? "I'm ready to take the challenge."
[0-06.htm] Black Cat: Sometimes I doubt whether anyone will ever bring the power to me. You showed great promise... Could you have really gotten it this time? "I've got the power!"
[0-07.htm] Black Cat: At last, my lifetime of work has borne fruit! Great job! You've made me very proud. I'll have Bernard announce it to the guild. We have a very special honor to bestow upon you who have overcome such unimaginable hardships. Henceforth you shall be known as an Adventurer!
[0-08.htm] Black Cat: Within your body hides an amazing power, but you are not skilled enough to control it yet. What a pity! Improve your skills and come back. (Only a character of level 76 or above is allowed to transfer to another class. Be careful. You cannot change occupation if you stop Quest!)
[0-09.htm] Black Cat: At last, my lifetime of work has borne fruit! Great job! You've made me very proud. I'll have Bernard announce it to the guild. We have a very special honor to bestow upon you who have overcome such unimaginable hardships. Henceforth you shall be known as an Adventurer!
[1-01.htm] Valentine: Did Klaus order some ice liquor? Hmm... How strange! He knows very well how rare that stuff is! If I'm to make some, I'll need some ingredients. Would you be willing to bring them to me? "I'll do it!"
[1-02.htm] Valentine: Bring me an ice crystal and I'll make ice liquor.
[1-03.htm] Valentine: What impeccable timing you have! I'm about ready to start brewing. Hand over the ice crystal and I'll make the liquor right away. "Here you go!"
[1-04.htm] Black Cat: Klaus must be very thirsty by now! Hurry up!
[1-05.htm] Valentine: Very well, if you feel that strongly about it, I'll tell you! Ice liquor can only be made from ice crystals. You should meet with Chef Jeremy. Perhaps if you help him, he might let you know where to find ice crystals.
[1-06.htm] Valentine: Here it is! You gave me more than enough ice crystals, so I made a few extra bottles of ice liquor for myself! I should be the one who's grateful! Ha!
[10-01.htm] Tablet of Vision: You feel something strange. Examine the area.
[10-02.htm] Tablet of Vision: You feel a huge surge of energy.
[10-03.htm] Tablet of Vision: The tablet is still and dark. Speak with the Hero.
[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 Stone of Commune starts emitting light as soon as you near the Tablet of Vision. Commune with the Tablet of Vision.
[10-06.htm] Tablet of Vision: A familiar feeling rushes through your body. And then when it seems unbearable, a new vision appears... All the pleasure, pain, anger and love ever felt by all the previous challengers of this power courses at once through your veins! The emotions rush over you like a waterfall, and the screams you hear are your own as you slip into unconsciousness... ... ... And then you awake... You mouth moves, but no words are formed... Could this be the end?
[10-07.htm] Tablet of Vision: This tablet is useless. Go back to Black Cat.
[11-01.htm] Hermit: I can't remember the last time anyone came this far just to see me! Are you ready for the second test? "I'm ready."
[11-02.htm] Hermit: Kill the Archon of Halisha! He can be found in the Sepulchers, or by attacking his minions on the north side of the Wall of Argos. Kill him and take possession of the fifth Stone of Commune.
[11-03.htm] Hermit: Ah, yes, the second test... the Archon of Halisha has the fifth Stone of Commune. After you get it from him, take it to the northwestern end of the Wall of Argos. Commune with the Tablet of Vision there. Slaying the Archon of Halisha isn't going to be easy! He can usually be found inside the Sepulchers, but if you attack his minions on the north side of the Wall of Argos, that usually draws him out! Good luck! Your success means that my long wait is finally over!
[2-01.htm] Klaus: Ha Ha Ha! Has that old hag not given up yet? Do you want to end up like me? Just give up. Have a drink like I'm doing. If you drink this, all the cares of this world will go away. Ha Ha Ha! Ask him to give you the information regarding the forbidden power.
[2-02.htm] Klaus: I am the best hunter among all the members of the Hunter's Guild! Ha Ha Ha! Uggh. I, ah... feel a little bit tipsy, now... Now, I've become a fisher... no, the best drunkard in Goddard! Bwa Ha Ha! Isn't it fun? Are you having fun, yet? I know how you can have even more fun. Well now, go to Valentine and bring me back some of his ice liquor!
[2-03.htm] Klaus: Hey! All right, you brought the liquor! Come on, let me have it. Give him the ice liquor.
[2-04.htm] Kalus: Didn't I tell you already? The first Tablet of Vision is located on the south side of the Tower of Insolence. Hiccup!
[2-05.htm] Kalus: All right! All right! I know the path to reach the first passage. However, it's hard for me to bring up the memory of that time while I'm sober. Go to Brewer Valentine in this village, obtain the ice liquor and bring it back to me. If I have a glass of that liquor, I just might be able to recall an old memory like that one.
[2-06.htm] Kalus: Gulp! Gulp! Gulp! You must be more capable than I thought, huh? Ha Ha Ha! Now then, should I try to remember the old times? Hmm... Let me see... The forbidden power was obtained by a strange hermit. It was taken away and divided by the gods. It is sealed up in several Tablets of Vision. In order to release the power that is bound in each tablet, you must have an object called a Stone of Commune. Each Tablet of Vision has its own individual Stone of Commune that it can communicate with! Ah! Here it is. The first Stone of Commune. Take this and use it to communicate with the first Tablet of Vision which is located on the south side of the Tower of Insolence. I told you everything I know. So now, leave me in peace and go on your way.
[3-01.htm] Hermit: I've been expecting you. You follow in the footsteps of giants! I've been waiting for many, many years... Since the gods told me to expect a hero such as you! I have the stone of vision you seek. First, however, you must prove that you are who you appear to be... Will you take a test? Yes, I will take the test.
[3-02.htm] Hermit: Well, go to the Ketra Orcs and get the Divine Stone of Wisdom. Like I said, Ketra Orcs are not the ones who trust strangers easily. To obtain Ketra Orcs' trust, you should go to Ketra's Messenger Wahkan in the Ketra Orc Outpost, and carry out difficult tasks that he asks you to do. You must earn the trust of the Ketra Orcs! This won't be an easy task, and will take much time and patience. Remember to never help their mortal enemies, the Varka Silenos! You'd never regain their trust!
[3-03.htm] Hermit: Well, go to the Varka Silenos and get the Divine Stone of Wisdom. Like I said, Varka Silenos are not the ones who trust strangers easily. To obtain Varka Silenos' trust, you should go to Varka's Messenger Naran Ashanuk in the Varka Silenos Outpost, and carry out difficult tasks that he asks you to do. You must earn the trust of the Ketra Orcs! This won't be an easy task, and will take much time and patience. Remember to never help their mortal enemies, the Ketra Orcs! You'd never regain their trust!
[3-04.htm] Hermit: Obtaining it won't be an easy task. This is your chance to prove that you are truly the one to succeed the legend! After earning the trust of the tribe you chose and being regarded as a true friend by them, you can obtain the Divine Stone of Wisdom. For Ketra Orcs, you must go to Ketra's Messenger Wahkan in the Ketra Orc Outpost whereas you must go see Varka's Messenger Naran Ashanuk in the Varka Silenos Outpost for Varka Silenos.
[3-05.htm] Hermit: Have you brought the Divine Stone of Wisdom? "Here it is."
[3-06.htm] Hermit: The Tablet of Vision can be found in the northern part of the Varka Silenos stronghold. Please don't disappoint us.
[3-07.htm] Hermit: This test has two paths. The Ketra Orcs and the Varka Silenos have long been at war, and both tribes are infamous for their hatred of each other and their cruelty in battle. Select one of the two tribes and obtain from them the Divine Stone of Wisdom. They give that only to those who they consider to be their true friend. Which tribe would you like to choose? "I'll fight for the Ketra Orcs!" "I'll fight for the Varka Silenos!"
[3-08.htm] Hermit: You've passed the first test. You've already come further than most who've attempted it! You're really starting to look like the hero I've been waiting for! Further dangers await you, however... You must always keep your cool. Take this Stone of Commune to the Tablet of Vision in the northern part of the Varka Silenos stronghold. You'll get further instruction from the tablet.
[4-01.htm] Erica Ken Weber: For my sake and for the sake of my followers, I cannot surrender now! Are you with me?
[4-010.htm] Erica Ken Weber: This Stone of Commune is a key that unlocks the forbidden power that resides within the Tablet of Vision. I don't have any use for it anymore. Take it with you. Thank you for your help. If we meet again, I won't forget what you've done for me! "Wait!"
[4-011.htm] Erica Ken Weber: Here it is. I hope to see you again someday. Goodbye!
[4-02.htm] Erica Ken Weber: I'm not fighting only for myself! I won't give you this chance! Will you withdraw?
[4-03.htm] Erica Ken Weber: Damn! Missed him again! Oh, it's you! Keep that up and you'll never defeat Azrael nor obtain the Stone of Commune. If you get another chance, try harder, OK?
[4-04.htm] Erica Ken Weber: Do you think this is a game? Don't say you're trying your best! I know you're not! Now, fight!
[4-05.htm] Erica Ken Weber: I'm not doing this for your amusement. This is a fight I can't withdraw from. There's no room for you here. Wait your turn.
[4-06.htm] Erica Ken Weber: Thanks for your help. I'm Erica. Although I couldn't kill him, I was able to get what I needed. Azrael dropped this earlier, during the fight. It's a Stone of Commune! You've been looking for it, right? "Yes, I have!"
[4-07.htm] Erica Ken Weber: Thanks for your help. I'm Erica. Although I couldn't kill him, I was able to get what I needed. Azrael dropped this earlier, during the fight. It's a Stone of Commune! Do you want it? "Yes, thank you!"
[4-08.htm] Erica Ken Weber: You won't escape again, Azrael! Oh, there you are! Take the Stone of Commune I gave you earlier to the Tablet of Vision. You can use the stone to communicate with the tablet.
[4-09.htm] Erica Ken Weber: Take the Stone of Commune to the Tablet of Vision. Communicate with the tablet and you'll obtain forbidden power!
[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] Tablet of Vision: You feel a strange, disconnected force enter your body. The tablet seems to be communicating with you. You see a vision of a tablet much like this one, protected by several ominous guardians. One of them is holding the next Stone of Commune! It appears that they're located in the northeast part of the Valley of Saints! You feel the Tablet of Vision weakening.
[5-03.htm] Tablet of Vision: The tablet goes completely dark. You must retrieve the Stone of Commune from the Guardians of Forbidden Knowledge!
[6-01.htm] Tablet of Viision: There are no changes. I may need the Stone of Commune that the Guardians of Forbidden Knowledge have.
[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: You feel a strange, disconnected force enter your body. The tablet seems to be communicating with you. You see a vision of a tablet much like this one. It appears to be located north of the Border Outpost. You feel the Tablet of Vision weakening.
[6-04.htm] Tablet of Vision: The tablet is still and dark. Find the next tablet.
[7-01.htm] Tablet of Vision: Evil lurks nearby. Examine the area.
[7-02.htm] Tablet of Vision: It's Ezekiel! I read about him in the book I got from Black Cat!
[7-03.htm] Tablet of Vision: Ezekiel must be dealt with first.
[7-04.htm] Tablet of Vision: Someone else is currently communing with the stone. Come back later.
[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: You feel a strange, disconnected force enter your body. The tablet seems to be communicating with you. You see a vision of a Human, standing before a house engulfed in a dark aura. It seems to located on the road from the Ketra Orc Outpost to Goddard Castle Town. You feel the Tablet of Vision weakening.
[7-07.htm] Tablet of Vision: The tablet goes completely dark. Let's go find the male Human that the Vision Stone showed.
[8-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.
[8-02.htm] Tablet of Vision: You feel a strange, disconnected force enter your body. The tablet seems to be communicating with you. You see a Human engulfed in a familiar dark aura... He seems to located on the road from the Ketra Orc Outpost to Goddard Castle Town. You feel the Tablet of Vision weakening.
[8-03.htm] Tablet of Vision: The tablet is still and dark. Find the house you saw in the vision.
[9-01.htm] Tablet of Vision: The tablet is still and dark. As the hermit said, kill the Archon of Halisha and take the stone from him!
[9-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.
[9-03.htm] Tablet of Vision: You feel a strange, disconnected force enter your body. The tablet seems to be communicating with you. You see a vision of a Human standing before a tablet much like this one. He appears to be north of Giants Cave. You feel the Tablet of Vision weakening.
[9-04.htm] Tablet of Vision: The tablet is still and dark. Find the next Stone of Commune now.
Исходник условий и наград (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.Q00079_SagaOfTheAdventurer;
import quests.AbstractSagaQuest;
/**
* @author Emperorc
*/
public class Q00079_SagaOfTheAdventurer extends AbstractSagaQuest
{
public Q00079_SagaOfTheAdventurer()
{
super(79, "Saga of the Adventurer");
_npc = new int[]
{
31603,
31584,
31579,
31615,
31619,
31646,
31647,
31651,
31654,
31655,
31658,
31616
};
_items = new int[]
{
7080,
7516,
7081,
7494,
7277,
7308,
7339,
7370,
7401,
7432,
7102,
0
};
_mob = new int[]
{
27299,
27228,
27302
};
_classId = new int[]
{
93
};
_prevClass = new int[]
{
0x08
};
_x = new int[]
{
119518,
181205,
181215
};
_y = new int[]
{
-28658,
36676,
36676
};
_z = new int[]
{
-3811,
-4816,
-4812
};
_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));
}
}
}
}