12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211 |
- /*
- * Copyright (C) 2004-2015 L2J DataPack
- *
- * This file is part of L2J DataPack.
- *
- * L2J DataPack 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.
- *
- * L2J DataPack 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.Q00236_SeedsOfChaos;
- import quests.Q00025_HidingBehindTheTruth.Q00025_HidingBehindTheTruth;
- import com.l2jserver.gameserver.enums.QuestSound;
- import com.l2jserver.gameserver.enums.Race;
- import com.l2jserver.gameserver.model.actor.L2Npc;
- import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- import com.l2jserver.gameserver.model.quest.Quest;
- import com.l2jserver.gameserver.model.quest.QuestState;
- import com.l2jserver.gameserver.network.NpcStringId;
- import com.l2jserver.gameserver.network.clientpackets.Say2;
- import com.l2jserver.gameserver.network.serverpackets.NpcSay;
- import com.l2jserver.gameserver.util.Util;
- /**
- * Seeds Of Chaos (236)
- * @author ivantotov
- */
- public final class Q00236_SeedsOfChaos extends Quest
- {
- // NPCs
- private static final int KURSTIN = 31387;
- private static final int MYSTERIOU_WIZARD = 31522;
- private static final int HIERARCH_KEKROPUS = 32138;
- private static final int VICE_HIERARCH_MAO = 32190;
- private static final int KATENAR = 32235;
- private static final int HARKILGAMED = 32236;
- private static final int RODENPICULA = 32237;
- private static final int ROCK = 32238;
- private static final int MOTHER_NORNIL = 32239;
- private static final int KATENAR_A = 32332;
- private static final int KATENAR_B = 32333;
- private static final int HARKILGAMED_A = 32334;
- // Items
- private static final int STAR_OF_DESTINY = 5011;
- private static final int SHINING_MEDALLION = 9743;
- private static final int BLOOD_JEWEL = 9744;
- private static final int BLACK_ECHO_CRYSTAL = 9745;
- // Reward
- private static final int SCROLL_ENCHANT_WEAPON_A_GRADE = 729;
- // Monster
- private static final int NEEDLE_STAKATO_DRONE = 21516;
- private static final int SHOUT_OF_SPLENDOR = 21532;
- private static final int ALLIANCE_OF_SPLENDOR = 21533;
- private static final int ALLIANCE_OF_SPLENDOR_1 = 21534;
- private static final int SIGNET_OF_SPLENDOR = 21535;
- private static final int CROWN_OF_SPLENDOR = 21536;
- private static final int FANG_OF_SPLENDOR = 21537;
- private static final int FANG_OF_SPLENDOR_1 = 21538;
- private static final int WAILINGOF_SPLENDOR = 21539;
- private static final int WAILINGOF_SPLENDOR_1 = 21540;
- private static final int VAMPIRE_WIZARD = 21588;
- private static final int VAMPIRE_WIZARD_A = 21589;
- // Misc
- private static final int MIN_LEVEL = 75;
-
- public Q00236_SeedsOfChaos()
- {
- super(236, Q00236_SeedsOfChaos.class.getSimpleName(), "Seeds Of Chaos");
- addStartNpc(HIERARCH_KEKROPUS);
- addTalkId(HIERARCH_KEKROPUS, KURSTIN, MYSTERIOU_WIZARD, VICE_HIERARCH_MAO, KATENAR, HARKILGAMED, RODENPICULA, ROCK, MOTHER_NORNIL, KATENAR_A, KATENAR_B, HARKILGAMED_A);
- addKillId(NEEDLE_STAKATO_DRONE, SHOUT_OF_SPLENDOR, ALLIANCE_OF_SPLENDOR, ALLIANCE_OF_SPLENDOR_1, SIGNET_OF_SPLENDOR, CROWN_OF_SPLENDOR, FANG_OF_SPLENDOR, FANG_OF_SPLENDOR_1, WAILINGOF_SPLENDOR, WAILINGOF_SPLENDOR_1, VAMPIRE_WIZARD, VAMPIRE_WIZARD_A);
- addSpawnId(KATENAR, HARKILGAMED, KATENAR_A, KATENAR_B, HARKILGAMED_A);
- registerQuestItems(SHINING_MEDALLION, BLOOD_JEWEL, BLACK_ECHO_CRYSTAL);
- }
-
- @Override
- public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
- {
- if ("KATENAR_120".equals(event))
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
- if (npc0 != null)
- {
- if (npc0.getVariables().getBoolean("SPAWNED"))
- {
- npc0.getVariables().set("SPAWNED", false);
- if (c0 != null)
- {
- npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.HMM_WHERE_DID_MY_FRIEND_GO));
- }
- }
- }
- npc.deleteMe();
- return super.onAdvEvent(event, npc, player);
- }
- else if ("HARKILGAMED_120".equals(event))
- {
- final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
- if (npc0 != null)
- {
- if (npc0.getVariables().getBoolean("SPAWNED"))
- {
- npc0.getVariables().set("SPAWNED", false);
- npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.GRAAAH_WERE_BEING_ATTACKED));
- }
- }
- npc.deleteMe();
- return super.onAdvEvent(event, npc, player);
- }
- else if ("KATENAR_A_120".equals(event))
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
- if (npc0 != null)
- {
- if (npc0.getVariables().getBoolean("SPAWNED"))
- {
- npc0.getVariables().set("SPAWNED", false);
- if (c0 != null)
- {
- npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.HMM_WHERE_DID_MY_FRIEND_GO));
- }
- }
- }
- npc.deleteMe();
- return super.onAdvEvent(event, npc, player);
- }
- else if ("KATENAR_B_120".equals(event))
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
- if (npc0 != null)
- {
- if (npc0.getVariables().getBoolean("SPAWNED"))
- {
- npc0.getVariables().set("SPAWNED", false);
- if (c0 != null)
- {
- npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.HMM_WHERE_DID_MY_FRIEND_GO));
- }
- }
- }
- npc.deleteMe();
- return super.onAdvEvent(event, npc, player);
- }
- else if ("HARKILGAMED_A_120".equals(event))
- {
- final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
- if (npc0 != null)
- {
- if (npc0.getVariables().getBoolean("SPAWNED"))
- {
- npc0.getVariables().set("SPAWNED", false);
- npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.GRAAAH_WERE_BEING_ATTACKED));
- }
- }
- npc.deleteMe();
- return super.onAdvEvent(event, npc, player);
- }
-
- final QuestState qs = getQuestState(player, false);
- if (qs == null)
- {
- return null;
- }
-
- String htmltext = null;
- switch (event)
- {
- case "32138-04.htm":
- {
- if (qs.isCreated())
- {
- qs.setMemoState(1);
- qs.startQuest();
- htmltext = event;
- }
- break;
- }
- case "32138-03.htm":
- {
- if ((player.getLevel() >= MIN_LEVEL) && (player.getRace() == Race.KAMAEL) && hasQuestItems(player, STAR_OF_DESTINY))
- {
- htmltext = event;
- }
- break;
- }
- case "32138-12.html":
- {
- if (qs.isMemoState(30))
- {
- qs.setMemoState(40);
- qs.setCond(15, true);
- htmltext = event;
- }
- break;
- }
- case "31387-03.html":
- {
- if (qs.isMemoState(11))
- {
- takeItems(player, BLOOD_JEWEL, -1);
- qs.setMemoState(12);
- htmltext = event;
- }
- break;
- }
- case "31387-05a.html":
- {
- if (qs.isMemoState(12))
- {
- final QuestState q25 = player.getQuestState(Q00025_HidingBehindTheTruth.class.getSimpleName());
- if ((q25 != null) && q25.isCompleted())
- {
- htmltext = event;
- }
- else
- {
- htmltext = "31387-05b.html";
- }
- }
- break;
- }
- case "31387-10.html":
- {
- if (qs.isMemoState(12))
- {
- qs.setMemoState(20);
- qs.setMemoStateEx(1, 1);
- qs.setCond(11, true);
- htmltext = event;
- }
- else if (qs.isMemoState(20) && (qs.getMemoStateEx(1) == 1))
- {
- htmltext = event;
- }
- break;
- }
- case "31522-04a.html":
- {
- if (qs.isMemoState(1))
- {
- htmltext = event;
- }
- break;
- }
- case "31522-05a.html":
- {
- if (qs.isMemoState(1))
- {
- qs.setMemoState(2);
- qs.setCond(2, true);
- htmltext = event;
- }
- break;
- }
- case "31522-05b.html":
- {
- if (qs.isMemoState(1))
- {
- qs.setMemoState(3);
- qs.setMemoStateEx(1, 0);
- qs.setCond(6, true);
- htmltext = event;
- }
- break;
- }
- case "31522-09a.html":
- {
- if (qs.isMemoState(2) && hasQuestItems(player, BLACK_ECHO_CRYSTAL))
- {
- takeItems(player, BLACK_ECHO_CRYSTAL, -1);
- qs.setMemoState(6);
- qs.setCond(4, true);
- htmltext = event;
- }
- break;
- }
- case "31522-12a.html":
- {
- if (qs.isMemoState(6))
- {
- if (!npc.getVariables().getBoolean("SPAWNED", false))
- {
- npc.getVariables().set("SPAWNED", true);
- npc.getVariables().set("PLAYER_ID", player.getObjectId());
- final L2Npc katenar = addSpawn(KATENAR, player.getX() + 10, player.getY() + 10, player.getZ(), +10, false, 0);
- katenar.getVariables().set("npc0", npc);
- katenar.getVariables().set("player0", player);
- htmltext = event;
- }
- else if (npc.getVariables().getInt("PLAYER_ID") == player.getObjectId())
- {
- htmltext = "31522-13a.html";
- }
- else
- {
- htmltext = "31522-14a.html";
- }
- }
- break;
- }
- case "31522-09b.html":
- {
- if (qs.isMemoState(3) && (qs.getMemoStateEx(1) == 2))
- {
- if (!npc.getVariables().getBoolean("SPAWNED", false))
- {
- npc.getVariables().set("SPAWNED", true);
- npc.getVariables().set("PLAYER_ID", player.getObjectId());
- final L2Npc katenar = addSpawn(KATENAR_A, player.getX() + 10, player.getY() + 10, player.getZ(), +10, false, 0);
- katenar.getVariables().set("npc0", npc);
- katenar.getVariables().set("player0", player);
- htmltext = event;
- }
- else if (npc.getVariables().getInt("PLAYER_ID") == player.getObjectId())
- {
- htmltext = "31522-10b.html";
- }
- else
- {
- htmltext = "31522-11b.html";
- }
- }
- break;
- }
- case "31522-14b.html":
- {
- if (qs.isMemoState(7) && hasQuestItems(player, BLOOD_JEWEL))
- {
- if (!npc.getVariables().getBoolean("SPAWNED", false))
- {
- npc.getVariables().set("SPAWNED", true);
- npc.getVariables().set("PLAYER_ID", player.getObjectId());
- final L2Npc katenar = addSpawn(KATENAR_B, player.getX() + 10, player.getY() + 10, player.getZ(), +10, false, 0);
- katenar.getVariables().set("npc0", npc);
- katenar.getVariables().set("player0", player);
- htmltext = event;
- }
- else if (npc.getVariables().getInt("PLAYER_ID") == player.getObjectId())
- {
- htmltext = "31522-15b.html";
- }
- else
- {
- htmltext = "31522-15bz.html";
- }
- }
- break;
- }
- case "32235-09a.html":
- {
- if (qs.isMemoState(6))
- {
- qs.setMemoState(20);
- qs.setMemoStateEx(1, 0);
- qs.setCond(5, true);
- htmltext = event;
- }
- break;
- }
- case "32236-07.html":
- {
- if (qs.isMemoState(20))
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- if (c0 != null)
- {
- qs.setMemoState(21);
- qs.setMemoStateEx(1, 0);
- qs.setCond(12, true);
- }
- htmltext = event;
- }
- break;
- }
- case "32237-10.html":
- {
- if (qs.isMemoState(40))
- {
- htmltext = event;
- }
- break;
- }
- case "32237-11.html":
- {
- if (qs.isMemoState(40))
- {
- qs.setMemoState(42);
- qs.setCond(17, true);
- htmltext = event;
- }
- break;
- }
- case "32237-13.html":
- {
- if (qs.isMemoState(43))
- {
- qs.setMemoState(44);
- qs.setCond(19, true);
- htmltext = event;
- }
- break;
- }
- case "32237-17.html":
- {
- if (qs.isMemoState(45))
- {
- giveItems(player, SCROLL_ENCHANT_WEAPON_A_GRADE, 1);
- takeItems(player, STAR_OF_DESTINY, 1);
- qs.exitQuest(false, true);
- htmltext = event;
- }
- break;
- }
- case "32238-02.html":
- {
- if (qs.isMemoState(20))
- {
- if (!npc.getVariables().getBoolean("SPAWNED", false))
- {
- npc.getVariables().set("SPAWNED", true);
- npc.getVariables().set("PLAYER_ID", player.getObjectId());
- final L2Npc kamael = addSpawn(HARKILGAMED, 71722, -78853, -4464, 0, false, 0);
- kamael.getVariables().set("npc0", npc);
- kamael.getVariables().set("player0", player);
- htmltext = event;
- }
- else if (npc.getVariables().getInt("PLAYER_ID") == player.getObjectId())
- {
- htmltext = "32238-03.html";
- }
- else
- {
- htmltext = "32238-04z.html";
- }
- }
- break;
- }
- case "32238-06.html":
- {
- if (qs.isMemoState(22))
- {
- if (!npc.getVariables().getBoolean("SPAWNED", false))
- {
- npc.getVariables().set("SPAWNED", true);
- npc.getVariables().set("PLAYER_ID", player.getObjectId());
- final L2Npc kamael = addSpawn(HARKILGAMED_A, 71722, -78853, -4464, 0, false, 0);
- kamael.getVariables().set("npc0", npc);
- kamael.getVariables().set("player0", player);
- htmltext = event;
- }
- else if (npc.getVariables().getInt("PLAYER_ID") == player.getObjectId())
- {
- htmltext = "32238-07.html";
- }
- else
- {
- htmltext = "32238-08.html";
- }
- }
- break;
- }
- case "32239-04.html":
- {
- if (qs.isMemoState(42))
- {
- qs.setMemoState(43);
- qs.setCond(18, true);
- htmltext = event;
- }
- break;
- }
- case "32239-08.html":
- {
- if (qs.isMemoState(44))
- {
- qs.setMemoState(45);
- qs.setCond(20, true);
- htmltext = event;
- }
- break;
- }
- case "32332-05b.html":
- {
- if (qs.isMemoState(3) && (qs.getMemoStateEx(1) == 2))
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- if (c0 != null)
- {
- qs.setMemoState(7);
- qs.setMemoStateEx(1, 0);
- qs.setCond(8, true);
- }
- htmltext = event;
- }
- break;
- }
- case "32334-17.html":
- {
- if (qs.isMemoState(22))
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- if (c0 != null)
- {
- takeItems(player, SHINING_MEDALLION, -1);
- qs.setMemoState(30);
- qs.setCond(14, true);
- }
- htmltext = event;
- }
- break;
- }
- case "KEITNAR_DESPAWN":
- {
- if (qs.isMemoState(20) && (qs.getMemoStateEx(1) == 0))
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
- if (player == c0)
- {
- if (npc0 != null)
- {
- npc0.getVariables().set("SPAWNED", false);
- }
- npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.BEST_OF_LUCK_WITH_YOUR_FUTURE_ENDEAVOURS));
- npc.deleteMe();
- }
- }
- break;
- }
- case "HARKILGAMED_DESPAWN":
- {
- if (qs.isMemoState(21))
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
- if (player == c0)
- {
- if (npc0 != null)
- {
- npc0.getVariables().set("SPAWNED", false);
- }
- npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.IN_THAT_CASE_I_WISH_YOU_GOOD_LUCK));
- npc.deleteMe();
- }
- }
- break;
- }
- case "KEITNAR_A_DESPAWN":
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
- if (player == c0)
- {
- if (npc0 != null)
- {
- npc0.getVariables().set("SPAWNED", false);
- }
- npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.BEST_OF_LUCK_WITH_YOUR_FUTURE_ENDEAVOURS));
- npc.deleteMe();
- }
- break;
- }
- case "KEITNAR_B_DESPAWN":
- {
- if (qs.isMemoState(11) && hasQuestItems(player, BLOOD_JEWEL))
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
- if (player == c0)
- {
- if (npc0 != null)
- {
- npc0.getVariables().set("SPAWNED", false);
- }
- npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.BEST_OF_LUCK_WITH_YOUR_FUTURE_ENDEAVOURS));
- npc.deleteMe();
- }
- }
- break;
- }
- case "HARKILGAMED_A_DESPAWN":
- {
- if (qs.isMemoState(30))
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
- if (player == c0)
- {
- if (npc0 != null)
- {
- npc0.getVariables().set("SPAWNED", false);
- }
- npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.SAFE_TRAVELS));
- npc.deleteMe();
- }
- }
- break;
- }
- case "31387-02.html":
- case "31387-04.html":
- case "31387-06.html":
- case "31387-07.html":
- case "31387-08.html":
- case "31522-02.html":
- case "31522-03.html":
- case "31522-04b.html":
- case "31522-08a.html":
- case "31522-11a.html":
- case "32138-02.html":
- case "32138-07.html":
- case "32138-08.html":
- case "32138-09.html":
- case "32138-10.html":
- case "32138-11.html":
- case "32235-02a.html":
- case "32235-03a.html":
- case "32235-04a.html":
- case "32235-05a.html":
- case "32235-06a.html":
- case "32235-08a.html":
- case "32236-03.html":
- case "32236-04.html":
- case "32236-05.html":
- case "32236-06.html":
- case "32237-02.html":
- case "32237-03.html":
- case "32237-04.html":
- case "32237-05.html":
- case "32237-06.html":
- case "32237-07.html":
- case "32237-08.html":
- case "32237-16.html":
- case "32237-18.html":
- case "32239-03.html":
- case "32239-07.html":
- case "32332-02b.html":
- case "32332-03b.html":
- case "32332-04b.html":
- case "32334-10.html":
- case "32334-11.html":
- case "32334-12.html":
- case "32334-13.html":
- case "32334-14.html":
- case "32334-15.html":
- case "32334-16.html":
- {
- htmltext = event;
- break;
- }
- }
- return htmltext;
- }
-
- @Override
- public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
- {
- final QuestState qs = getQuestState(killer, false);
- if ((qs != null) && qs.isStarted() && Util.checkIfInRange(1500, npc, killer, true))
- {
- switch (npc.getId())
- {
- case NEEDLE_STAKATO_DRONE:
- {
- if (qs.isMemoState(2) && !hasQuestItems(killer, BLACK_ECHO_CRYSTAL))
- {
- if (getRandom(100) < 20)
- {
- giveItems(killer, BLACK_ECHO_CRYSTAL, 1);
- qs.setCond(3, true);
- }
- }
- break;
- }
- case SHOUT_OF_SPLENDOR:
- case ALLIANCE_OF_SPLENDOR:
- case ALLIANCE_OF_SPLENDOR_1:
- case SIGNET_OF_SPLENDOR:
- case CROWN_OF_SPLENDOR:
- case FANG_OF_SPLENDOR:
- case FANG_OF_SPLENDOR_1:
- case WAILINGOF_SPLENDOR:
- case WAILINGOF_SPLENDOR_1:
- {
- if (qs.isMemoState(21) && (getQuestItemsCount(killer, SHINING_MEDALLION) < 62))
- {
- if (getRandom(100) < 70)
- {
- giveItems(killer, SHINING_MEDALLION, 1);
- if (getQuestItemsCount(killer, SHINING_MEDALLION) == 62)
- {
- qs.setMemoState(22);
- qs.setCond(13, true);
- }
- else
- {
- playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
- }
- }
- }
- break;
- }
- case VAMPIRE_WIZARD:
- case VAMPIRE_WIZARD_A:
- {
- if (qs.isMemoState(7) && !hasQuestItems(killer, BLOOD_JEWEL))
- {
- if (getRandom(100) < 8)
- {
- giveItems(killer, BLOOD_JEWEL, 1);
- qs.setCond(9, true);
- }
- }
- break;
- }
- }
- }
- return super.onKill(npc, killer, isSummon);
- }
-
- @Override
- public String onTalk(L2Npc npc, L2PcInstance player)
- {
- final QuestState qs = getQuestState(player, true);
- String htmltext = getNoQuestMsg(player);
- if (qs.isCreated())
- {
- if (npc.getId() == HIERARCH_KEKROPUS)
- {
- if (player.getLevel() >= MIN_LEVEL)
- {
- if (player.getRace() == Race.KAMAEL)
- {
- if (hasQuestItems(player, STAR_OF_DESTINY))
- {
- htmltext = "32138-01.htm";
- }
- else
- {
- htmltext = "32138-01x.html";
- }
- }
- else
- {
- htmltext = "32138-01y.html";
- }
- }
- else
- {
- htmltext = "32138-01z.html";
- }
- }
- }
- else if (qs.isStarted())
- {
- switch (npc.getId())
- {
- case HIERARCH_KEKROPUS:
- {
- switch (qs.getMemoState())
- {
- case 1:
- {
- htmltext = "32138-05.html";
- break;
- }
- case 30:
- {
- htmltext = "32138-06.html";
- break;
- }
- case 40:
- {
- htmltext = "32138-13.html";
- break;
- }
- }
- break;
- }
- case KURSTIN:
- {
- switch (qs.getMemoState())
- {
- case 11:
- {
- htmltext = "31387-01.html";
- break;
- }
- case 12:
- {
- htmltext = "31387-04.html";
- break;
- }
- case 20:
- {
- if (qs.getMemoStateEx(1) == 1)
- {
- htmltext = "31387-11.html";
- }
- break;
- }
- }
- break;
- }
- case MYSTERIOU_WIZARD:
- {
- switch (qs.getMemoState())
- {
- case 1:
- {
- htmltext = "31522-01.html";
- break;
- }
- case 2:
- {
- if (!hasQuestItems(player, BLACK_ECHO_CRYSTAL))
- {
- htmltext = "31522-06a.html";
- }
- else
- {
- htmltext = "31522-07a.html";
- }
- break;
- }
- case 6:
- {
- htmltext = "31522-10a.html";
- break;
- }
- case 20:
- {
- if (qs.getMemoStateEx(1) == 0)
- {
- htmltext = "31522-15a.html";
- }
- break;
- }
- case 3:
- {
- if (qs.getMemoStateEx(1) == 0)
- {
- qs.setMemoStateEx(1, 1);
- htmltext = "31522-06b.html";
- }
- else if (qs.getMemoStateEx(1) == 1)
- {
- qs.setMemoStateEx(1, 2);
- qs.setCond(7, true);
- htmltext = "31522-07b.html";
- }
- else if (qs.getMemoStateEx(1) == 2)
- {
- htmltext = "31522-08b.html";
- }
- break;
- }
- case 7:
- {
- if (!hasQuestItems(player, BLOOD_JEWEL))
- {
- htmltext = "31522-12b.html";
- }
- else
- {
- htmltext = "31522-13b.html";
- }
- break;
- }
- case 11:
- {
- htmltext = "31522-16b.html";
- break;
- }
- }
- break;
- }
- case VICE_HIERARCH_MAO:
- {
- if ((qs.getMemoState() >= 40) && (qs.getMemoState() <= 45))
- {
- htmltext = "32190-01.html";
- }
- break;
- }
- case KATENAR:
- {
- switch (qs.getMemoState())
- {
- case 6:
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
- npc0.getVariables().set("SPAWNED", false);
- if (player == c0)
- {
- htmltext = "32235-01a.html";
- }
- else
- {
- htmltext = "32235-01z.html";
- }
- break;
- }
- case 20:
- {
- if (qs.getMemoStateEx(1) == 0)
- {
- htmltext = "32235-09z.html";
- }
- break;
- }
- }
- break;
- }
- case HARKILGAMED:
- {
- switch (qs.getMemoState())
- {
- case 20:
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
- npc0.getVariables().set("SPAWNED", false);
- if (player == c0)
- {
- htmltext = "32236-01.html";
- }
- else
- {
- htmltext = "32236-02.html";
- }
- break;
- }
- case 21:
- {
- htmltext = "32236-07z.html";
- break;
- }
- case 22:
- {
- htmltext = "32236-08z.html";
- break;
- }
- }
- break;
- }
- case RODENPICULA:
- {
- switch (qs.getMemoState())
- {
- case 40:
- {
- htmltext = "32237-01.html";
- break;
- }
- case 42:
- {
- htmltext = "32237-11a.html";
- break;
- }
- case 43:
- {
- htmltext = "32237-12.html";
- break;
- }
- case 44:
- {
- htmltext = "32237-14.html";
- break;
- }
- case 45:
- {
- htmltext = "32237-15.html";
- break;
- }
- }
- break;
- }
- case ROCK:
- {
- switch (qs.getMemoState())
- {
- case 20:
- {
- htmltext = "32238-01.html";
- break;
- }
- case 21:
- {
- htmltext = "32238-04.html";
- break;
- }
- case 22:
- {
- htmltext = "32238-05.html";
- break;
- }
- case 30:
- {
- htmltext = "32238-09.html";
- break;
- }
- }
- break;
- }
- case MOTHER_NORNIL:
- {
- switch (qs.getMemoState())
- {
- case 40:
- {
- htmltext = "32239-01.html";
- break;
- }
- case 42:
- {
- htmltext = "32239-02.html";
- break;
- }
- case 43:
- {
- htmltext = "32239-05.html";
- break;
- }
- case 44:
- {
- htmltext = "32239-06.html";
- break;
- }
- case 45:
- {
- htmltext = "32239-09.html";
- break;
- }
- }
- break;
- }
- case KATENAR_A:
- {
- switch (qs.getMemoState())
- {
- case 3:
- {
- if (qs.getMemoStateEx(1) == 2)
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
- npc0.getVariables().set("SPAWNED", false);
- if (player == c0)
- {
- htmltext = "32332-01b.html";
- }
- else
- {
- htmltext = "32332-01z.html";
- }
- }
- break;
- }
- case 7:
- {
- if (!hasQuestItems(player, BLOOD_JEWEL))
- {
- htmltext = "32332-05z.html";
- }
- break;
- }
- }
- break;
- }
- case KATENAR_B:
- {
- switch (qs.getMemoState())
- {
- case 7:
- {
- if (hasQuestItems(player, BLOOD_JEWEL))
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
- npc0.getVariables().set("SPAWNED", false);
- if (player == c0)
- {
- qs.setMemoState(11);
- qs.setCond(10, true);
- htmltext = "32333-06bz.html";
- }
- else
- {
- qs.setMemoState(11);
- qs.setCond(10, true);
- htmltext = "32333-06b.html";
- }
- }
- break;
- }
- case 11:
- {
- htmltext = "32333-06b.html";
- break;
- }
- }
- break;
- }
- case HARKILGAMED_A:
- {
- switch (qs.getMemoState())
- {
- case 22:
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- final L2Npc npc0 = npc.getVariables().getObject("npc0", L2Npc.class);
- npc0.getVariables().set("SPAWNED", false);
- if (player == c0)
- {
- htmltext = "32334-08.html";
- }
- else
- {
- htmltext = "32334-09.html";
- }
- break;
- }
- case 30:
- {
- htmltext = "32334-18.html";
- break;
- }
- }
- break;
- }
- }
- }
- else if (qs.isCompleted())
- {
- if (npc.getId() == HIERARCH_KEKROPUS)
- {
- htmltext = getAlreadyCompletedMsg(player);
- }
- }
- return htmltext;
- }
-
- @Override
- public String onSpawn(L2Npc npc)
- {
- switch (npc.getId())
- {
- case KATENAR:
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- startQuestTimer("KATENAR_120", 120000, npc, null);
- if (c0 != null)
- {
- npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.S1_FINALLY_WE_MEET).addStringParameter(c0.getAppearance().getVisibleName()));
- }
- break;
- }
- case HARKILGAMED:
- {
- startQuestTimer("HARKILGAMED_120", 120000, npc, null);
- npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.HMM_IS_SOMEONE_APPROACHING));
- break;
- }
- case KATENAR_A:
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- startQuestTimer("KATENAR_A_120", 120000, npc, null);
- if (c0 != null)
- {
- npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.S1_DID_YOU_WAIT_FOR_LONG).addStringParameter(c0.getAppearance().getVisibleName()));
- }
- break;
- }
- case KATENAR_B:
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- startQuestTimer("KATENAR_B_120", 120000, npc, null);
- if (c0 != null)
- {
- npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.DID_YOU_BRING_WHAT_I_ASKED_S1).addStringParameter(c0.getAppearance().getVisibleName()));
- }
- break;
- }
- case HARKILGAMED_A:
- {
- final L2PcInstance c0 = npc.getVariables().getObject("player0", L2PcInstance.class);
- startQuestTimer("HARKILGAMED_A_120", 120000, npc, null);
- if (c0 != null)
- {
- npc.broadcastPacket(new NpcSay(npc, Say2.NPC_ALL, NpcStringId.S1_HAS_EVERYTHING_BEEN_FOUND).addStringParameter(c0.getAppearance().getVisibleName()));
- }
- break;
- }
- }
- return super.onSpawn(npc);
- }
- }
|