123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062 |
- /*
- * 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.Q00066_CertifiedArbalester;
- import com.l2jserver.gameserver.enums.QuestSound;
- import com.l2jserver.gameserver.model.actor.L2Npc;
- import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- import com.l2jserver.gameserver.model.base.ClassId;
- import com.l2jserver.gameserver.model.quest.Quest;
- import com.l2jserver.gameserver.model.quest.QuestState;
- import com.l2jserver.gameserver.network.serverpackets.SocialAction;
- import com.l2jserver.gameserver.util.Util;
- /**
- * Certified Arbalester (66)
- * @author ivantotov
- */
- public final class Q00066_CertifiedArbalester extends Quest
- {
- // NPCs
- private static final int WAREHOUSE_KEEPER_HOLVAS = 30058;
- private static final int MAGISTER_GAIUS = 30171;
- private static final int BLACKSMITH_POITAN = 30458;
- private static final int MAGISTER_CLAYTON = 30464;
- private static final int MAGISTER_GAUEN = 30717;
- private static final int MAGISTER_KAIENA = 30720;
- private static final int MASTER_RINDY = 32201;
- private static final int GRAND_MASTER_MELDINA = 32214;
- private static final int MASTER_SELSIA = 32220;
- // Items
- private static final int ENMITY_CRYSTAL = 9773;
- private static final int ENMITY_CRYSTAL_CORE = 9774;
- private static final int MANUSCRIPT_PAGE = 9775;
- private static final int ENCODED_PAGE_ON_THE_ANCIENT_RACE = 9776;
- private static final int KAMAEL_INQUISITOR_TRAINEE_MARK = 9777;
- private static final int FRAGMENT_OF_ATTACK_ORDERS = 9778;
- private static final int GRANDIS_ATTACK_ORDERS = 9779;
- private static final int MANASHENS_TALISMAN = 9780;
- private static final int RESEARCH_ON_THE_GIANTS_AND_THE_ANCIENT_RACE = 9781;
- // Reward
- private static final int DIMENSIONAL_DIAMOND = 7562;
- private static final int KAMAEL_INQUISITOR_MARK = 9782;
- // Monster
- private static final int GRANITIC_GOLEM = 20083;
- private static final int HANGMAN_TREE = 20144;
- private static final int AMBER_BASILISK = 20199;
- private static final int STRAIN = 20200;
- private static final int GHOUL = 20201;
- private static final int DEAD_SEEKER = 20202;
- private static final int GRANDIS = 20554;
- private static final int MANASHEN_GARGOYLE = 20563;
- private static final int TIMAK_ORC = 20583;
- private static final int TIMAK_ORC_ARCHER = 20584;
- private static final int DELU_LIZARDMAN_SHAMAN = 20781;
- private static final int WATCHMAN_OF_THE_PLAINS = 21102;
- private static final int ROUGHLY_HEWN_ROCK_GOLEM = 21103;
- private static final int DELU_LIZARDMAN_SUPPLIER = 21104;
- private static final int DELU_LIZARDMAN_AGENT = 21105;
- private static final int CURSED_SEER = 21106;
- private static final int DELU_LIZARDMAN_COMMANDER = 21107;
- // Quest Monster
- private static final int CRIMSON_LADY = 27336;
- // Misc
- private static final int MIN_LEVEL = 39;
-
- public Q00066_CertifiedArbalester()
- {
- super(66, Q00066_CertifiedArbalester.class.getSimpleName(), "Certified Arbalester");
- addStartNpc(MASTER_RINDY);
- addTalkId(MASTER_RINDY, WAREHOUSE_KEEPER_HOLVAS, MAGISTER_GAIUS, BLACKSMITH_POITAN, MAGISTER_CLAYTON, MAGISTER_GAUEN, MAGISTER_KAIENA, GRAND_MASTER_MELDINA, MASTER_SELSIA);
- addKillId(GRANITIC_GOLEM, HANGMAN_TREE, AMBER_BASILISK, STRAIN, GHOUL, DEAD_SEEKER, GRANDIS, MANASHEN_GARGOYLE, TIMAK_ORC, TIMAK_ORC_ARCHER, DELU_LIZARDMAN_SHAMAN, WATCHMAN_OF_THE_PLAINS, ROUGHLY_HEWN_ROCK_GOLEM, DELU_LIZARDMAN_SUPPLIER, DELU_LIZARDMAN_AGENT, CURSED_SEER, DELU_LIZARDMAN_COMMANDER, CRIMSON_LADY);
- registerQuestItems(ENMITY_CRYSTAL, ENMITY_CRYSTAL_CORE, MANUSCRIPT_PAGE, ENCODED_PAGE_ON_THE_ANCIENT_RACE, KAMAEL_INQUISITOR_TRAINEE_MARK, FRAGMENT_OF_ATTACK_ORDERS, GRANDIS_ATTACK_ORDERS, MANASHENS_TALISMAN, RESEARCH_ON_THE_GIANTS_AND_THE_ANCIENT_RACE);
- }
-
- @Override
- public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
- {
- final QuestState qs = getQuestState(player, false);
- if (qs == null)
- {
- return null;
- }
-
- String htmltext = null;
- switch (event)
- {
- case "ACCEPT":
- {
- if ((player.getLevel() >= MIN_LEVEL) && (player.getClassId() == ClassId.warder) && !hasQuestItems(player, KAMAEL_INQUISITOR_MARK))
- {
- qs.startQuest();
- qs.setMemoState(1);
- if (player.getVariables().getInt("2ND_CLASS_DIAMOND_REWARD", 0) == 0)
- {
- giveItems(player, DIMENSIONAL_DIAMOND, 64);
- player.getVariables().set("2ND_CLASS_DIAMOND_REWARD", 1);
- htmltext = "32201-07a.htm";
- }
- else
- {
- htmltext = "32201-07.htm";
- }
- }
- break;
- }
- case "32201-08.html":
- {
- if (qs.isMemoState(1))
- {
- qs.setMemoState(2);
- qs.setCond(2, true);
- htmltext = event;
- }
- break;
- }
- case "30058-03.html":
- case "30058-04.html":
- {
- if (qs.isMemoState(7))
- {
- htmltext = event;
- }
- break;
- }
- case "30058-05.html":
- {
- if (qs.isMemoState(7))
- {
- qs.setMemoState(8);
- qs.setCond(7, true);
- htmltext = event;
- }
- break;
- }
- case "30058-08.html":
- {
- if (qs.isMemoState(9))
- {
- giveItems(player, ENCODED_PAGE_ON_THE_ANCIENT_RACE, 1);
- qs.setMemoState(10);
- qs.setCond(9, true);
- htmltext = event;
- }
- break;
- }
- case "30171-03.html":
- {
- if (qs.isMemoState(23))
- {
- htmltext = event;
- }
- break;
- }
- case "30171-05.html":
- {
- if (qs.isMemoState(23))
- {
- takeItems(player, GRANDIS_ATTACK_ORDERS, -1);
- qs.setMemoState(24);
- htmltext = event;
- }
- break;
- }
- case "30171-06.html":
- case "30171-07.html":
- {
- if (qs.isMemoState(24))
- {
- htmltext = event;
- }
- break;
- }
- case "30171-08.html":
- {
- if (qs.isMemoState(24))
- {
- qs.setMemoState(25);
- }
- qs.setCond(14, true);
- htmltext = event;
- break;
- }
- case "30458-03.html":
- {
- if (qs.isMemoState(5))
- {
- takeItems(player, ENMITY_CRYSTAL_CORE, 1);
- qs.setMemoState(6);
- htmltext = event;
- }
- break;
- }
- case "30458-05.html":
- case "30458-06.html":
- case "30458-07.html":
- case "30458-08.html":
- {
- if (qs.isMemoState(6))
- {
- htmltext = event;
- }
- break;
- }
- case "30458-09.html":
- {
- if (qs.isMemoState(6))
- {
- qs.setMemoState(7);
- qs.setCond(6, true);
- htmltext = event;
- }
- break;
- }
- case "30464-03.html":
- case "30464-04.html":
- case "30464-05.html":
- {
- if (qs.isMemoState(2))
- {
- htmltext = event;
- }
- break;
- }
- case "30464-06.html":
- {
- if (qs.isMemoState(2))
- {
- qs.setMemoState(3);
- qs.setCond(3, true);
- htmltext = event;
- }
- break;
- }
- case "30464-09.html":
- {
- if (qs.isMemoState(4))
- {
- giveItems(player, ENMITY_CRYSTAL_CORE, 1);
- qs.setMemoState(5);
- qs.setCond(5, true);
- htmltext = event;
- }
- break;
- }
- case "30464-11.html":
- {
- htmltext = event;
- break;
- }
- case "30717-03.html":
- case "30717-05.html":
- case "30717-06.html":
- case "30717-07.html":
- case "30717-08.html":
- {
- if (qs.isMemoState(28))
- {
- htmltext = event;
- }
- break;
- }
- case "30717-09.html":
- {
- if (qs.isMemoState(28))
- {
- qs.setMemoState(29);
- qs.setCond(17, true);
- htmltext = event;
- }
- break;
- }
- case "30720-03.html":
- {
- if (qs.isMemoState(29))
- {
- htmltext = event;
- }
- break;
- }
- case "30720-04.html":
- {
- if (qs.isMemoState(29))
- {
- qs.setMemoState(30);
- qs.setCond(18, true);
- htmltext = event;
- }
- break;
- }
- case "32214-03.html":
- {
- if (qs.isMemoState(10))
- {
- htmltext = event;
- }
- break;
- }
- case "32214-04.html":
- {
- if (qs.isMemoState(10))
- {
- takeItems(player, ENCODED_PAGE_ON_THE_ANCIENT_RACE, 1);
- giveItems(player, KAMAEL_INQUISITOR_TRAINEE_MARK, 1);
- qs.setMemoState(11);
- qs.setCond(10, true);
- htmltext = event;
- }
- break;
- }
- case "32220-03.html":
- {
- if (qs.isMemoState(11))
- {
- takeItems(player, KAMAEL_INQUISITOR_TRAINEE_MARK, -1);
- qs.setMemoState(12);
- htmltext = event;
- }
- break;
- }
- case "32220-05.html":
- {
- if (qs.isMemoState(12))
- {
- qs.setMemoState(13);
- htmltext = event;
- }
- break;
- }
- case "32220-06.html":
- {
- if (qs.isMemoState(13))
- {
- qs.setMemoStateEx(1, 0);
- htmltext = event;
- }
- break;
- }
- case "32220-09.html":
- case "32220-10.html":
- {
- if (qs.isMemoState(13))
- {
- htmltext = event;
- }
- break;
- }
- case "32220-11.html":
- case "32220-12.html":
- case "32220-13.html":
- {
- if (qs.isMemoState(13))
- {
- qs.setMemoState(13);
- qs.setMemoStateEx(1, 1);
- htmltext = event;
- }
- break;
- }
- case "32220-13a.html":
- {
- if (qs.isMemoState(13))
- {
- qs.setMemoState(20);
- qs.setMemoStateEx(1, 0);
- htmltext = event;
- }
- break;
- }
- case "32220-13b.html":
- {
- if (qs.isMemoState(20))
- {
- qs.setMemoState(21);
- qs.setCond(11, true);
- htmltext = event;
- }
- break;
- }
- case "32220-19.html":
- case "32220-21.html":
- case "32220-22.html":
- case "32220-23.html":
- case "32220-24.html":
- case "32220-25.html":
- {
- if (qs.isMemoState(31))
- {
- htmltext = event;
- }
- break;
- }
- case "32220-26.html":
- {
- if (qs.isMemoState(31))
- {
- qs.setMemoStateEx(1, 0);
- qs.setMemoState(32);
- qs.setCond(19, true);
- 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 GRANITIC_GOLEM:
- case HANGMAN_TREE:
- {
- if (qs.isMemoState(8) && (getQuestItemsCount(killer, MANUSCRIPT_PAGE) < 30))
- {
- if (getQuestItemsCount(killer, MANUSCRIPT_PAGE) >= 29)
- {
- qs.setCond(8, true);
- }
- else
- {
- playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
- }
- giveItems(killer, MANUSCRIPT_PAGE, 1);
- if ((getRandom(1000) < 100) && (getQuestItemsCount(killer, MANUSCRIPT_PAGE) < 29))
- {
- giveItems(killer, MANUSCRIPT_PAGE, 1);
- }
- }
- break;
- }
- case AMBER_BASILISK:
- {
- if (qs.isMemoState(8) && (getQuestItemsCount(killer, MANUSCRIPT_PAGE) < 30))
- {
- if (getRandom(1000) < 980)
- {
- if (getQuestItemsCount(killer, MANUSCRIPT_PAGE) >= 29)
- {
- qs.setCond(8, true);
- }
- else
- {
- playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
- }
- giveItems(killer, MANUSCRIPT_PAGE, 1);
- }
- }
- break;
- }
- case STRAIN:
- {
- if (qs.isMemoState(8) && (getQuestItemsCount(killer, MANUSCRIPT_PAGE) < 30))
- {
- if (getRandom(1000) < 860)
- {
- if (getQuestItemsCount(killer, MANUSCRIPT_PAGE) >= 29)
- {
- qs.setCond(8, true);
- }
- else
- {
- playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
- }
- giveItems(killer, MANUSCRIPT_PAGE, 1);
- }
- }
- break;
- }
- case GHOUL:
- case DEAD_SEEKER:
- {
- if (qs.isMemoState(8) && (getQuestItemsCount(killer, MANUSCRIPT_PAGE) < 30))
- {
- if (getQuestItemsCount(killer, MANUSCRIPT_PAGE) >= 29)
- {
- qs.setCond(8, true);
- }
- else
- {
- playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
- }
- giveItems(killer, MANUSCRIPT_PAGE, 1);
- if ((getRandom(1000) < 20) && (getQuestItemsCount(killer, MANUSCRIPT_PAGE) < 29))
- {
- giveItems(killer, MANUSCRIPT_PAGE, 1);
- }
- }
- break;
- }
- case GRANDIS:
- {
- if (qs.isMemoState(21) || (qs.isMemoState(22) && (getQuestItemsCount(killer, FRAGMENT_OF_ATTACK_ORDERS) < 10)))
- {
- if (getRandom(1000) < 780)
- {
- if (qs.isMemoState(21) && !hasQuestItems(killer, FRAGMENT_OF_ATTACK_ORDERS))
- {
- qs.setMemoState(22);
- qs.setCond(12, true);
- giveItems(killer, FRAGMENT_OF_ATTACK_ORDERS, 1);
- }
- else if (qs.isMemoState(22) && (getQuestItemsCount(killer, FRAGMENT_OF_ATTACK_ORDERS) >= 9))
- {
- qs.setMemoState(23);
- qs.setCond(13, true);
- takeItems(killer, FRAGMENT_OF_ATTACK_ORDERS, -1);
- giveItems(killer, GRANDIS_ATTACK_ORDERS, 1);
- }
- else
- {
- playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
- giveItems(killer, FRAGMENT_OF_ATTACK_ORDERS, 1);
- }
- }
- break;
- }
- }
- case MANASHEN_GARGOYLE:
- {
- if (qs.isMemoState(25) || (qs.isMemoState(26) && (getQuestItemsCount(killer, MANASHENS_TALISMAN) < 10)))
- {
- if (getRandom(1000) < 840)
- {
- if (qs.isMemoState(25) && !hasQuestItems(killer, MANASHENS_TALISMAN))
- {
- qs.setMemoState(26);
- qs.setCond(15, true);
- }
- else if (qs.isMemoState(26) && (getQuestItemsCount(killer, MANASHENS_TALISMAN) >= 9))
- {
- qs.setMemoState(27);
- qs.setCond(16, true);
- }
- else
- {
- playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
- }
- giveItems(killer, MANASHENS_TALISMAN, 1);
- }
- break;
- }
- }
- case TIMAK_ORC:
- case TIMAK_ORC_ARCHER:
- {
- if (qs.isMemoState(32))
- {
- final int i4 = qs.getMemoStateEx(1);
- if (i4 < 5)
- {
- qs.setMemoStateEx(1, i4 + 1);
- }
- else if (i4 >= 4)
- {
- qs.setMemoStateEx(1, 0);
- addSpawn(CRIMSON_LADY, npc, true, 0, false);
- }
- }
- break;
- }
- case DELU_LIZARDMAN_SHAMAN:
- case DELU_LIZARDMAN_SUPPLIER:
- {
- if (qs.isMemoState(3) && (getQuestItemsCount(killer, ENMITY_CRYSTAL) < 30))
- {
- if (getQuestItemsCount(killer, ENMITY_CRYSTAL) >= 29)
- {
- qs.setCond(4, true);
- }
- else
- {
- playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
- }
- giveItems(killer, ENMITY_CRYSTAL, 1);
- if ((getRandom(1000) < 80) && (getQuestItemsCount(killer, ENMITY_CRYSTAL) < 29))
- {
- giveItems(killer, ENMITY_CRYSTAL, 1);
- }
- }
- break;
- }
- case WATCHMAN_OF_THE_PLAINS:
- {
- if (qs.isMemoState(3) && (getQuestItemsCount(killer, ENMITY_CRYSTAL) < 30))
- {
- if (getRandom(1000) < 840)
- {
- if (getQuestItemsCount(killer, ENMITY_CRYSTAL) >= 29)
- {
- qs.setCond(4, true);
- }
- else
- {
- playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
- }
- giveItems(killer, ENMITY_CRYSTAL, 1);
- }
- }
- break;
- }
- case ROUGHLY_HEWN_ROCK_GOLEM:
- {
- if (qs.isMemoState(3) && (getQuestItemsCount(killer, ENMITY_CRYSTAL) < 30))
- {
- if (getRandom(1000) < 860)
- {
- if (getQuestItemsCount(killer, ENMITY_CRYSTAL) >= 29)
- {
- qs.setCond(4, true);
- }
- else
- {
- playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
- }
- giveItems(killer, ENMITY_CRYSTAL, 1);
- }
- }
- break;
- }
- case DELU_LIZARDMAN_AGENT:
- {
- if (qs.isMemoState(3) && (getQuestItemsCount(killer, ENMITY_CRYSTAL) < 30))
- {
- if (getQuestItemsCount(killer, ENMITY_CRYSTAL) >= 29)
- {
- qs.setCond(4, true);
- }
- else
- {
- playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
- }
- giveItems(killer, ENMITY_CRYSTAL, 1);
- if ((getRandom(1000) < 240) && (getQuestItemsCount(killer, ENMITY_CRYSTAL) < 29))
- {
- giveItems(killer, ENMITY_CRYSTAL, 1);
- }
- }
- break;
- }
- case CURSED_SEER:
- {
- if (qs.isMemoState(3) && (getQuestItemsCount(killer, ENMITY_CRYSTAL) < 30))
- {
- if (getQuestItemsCount(killer, ENMITY_CRYSTAL) >= 29)
- {
- qs.setCond(4, true);
- }
- else
- {
- playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
- }
- giveItems(killer, ENMITY_CRYSTAL, 1);
- if ((getRandom(1000) < 40) && (getQuestItemsCount(killer, ENMITY_CRYSTAL) < 29))
- {
- giveItems(killer, ENMITY_CRYSTAL, 1);
- }
- }
- break;
- }
- case DELU_LIZARDMAN_COMMANDER:
- {
- if (qs.isMemoState(3) && (getQuestItemsCount(killer, ENMITY_CRYSTAL) < 30))
- {
- if (getQuestItemsCount(killer, ENMITY_CRYSTAL) >= 28)
- {
- qs.setCond(4, true);
- }
-
- if (getQuestItemsCount(killer, ENMITY_CRYSTAL) < 29)
- {
- giveItems(killer, ENMITY_CRYSTAL, 2);
- if ((getRandom(1000) < 220) && (getQuestItemsCount(killer, ENMITY_CRYSTAL) < 28))
- {
- giveItems(killer, ENMITY_CRYSTAL, 1);
- if (getQuestItemsCount(killer, ENMITY_CRYSTAL) >= 27)
- {
- qs.setCond(4, true);
- }
- else
- {
- playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
- }
- }
- }
- else
- {
- giveItems(killer, ENMITY_CRYSTAL, 1);
- }
- }
- break;
- }
- case CRIMSON_LADY:
- {
- if (qs.isMemoState(32))
- {
- giveItems(killer, RESEARCH_ON_THE_GIANTS_AND_THE_ANCIENT_RACE, 1);
- qs.setMemoState(32);
- qs.setCond(20, true);
- }
- break;
- }
- }
- }
- return super.onKill(npc, killer, isSummon);
- }
-
- @Override
- public String onTalk(L2Npc npc, L2PcInstance player)
- {
- final QuestState qs = getQuestState(player, true);
- final int memoState = qs.getMemoState();
- String htmltext = getNoQuestMsg(player);
- if (qs.isCreated())
- {
- if (npc.getId() == MASTER_RINDY)
- {
- if ((player.getClassId() == ClassId.warder) && !hasQuestItems(player, KAMAEL_INQUISITOR_MARK))
- {
- if (player.getLevel() >= MIN_LEVEL)
- {
- htmltext = "32201-01.htm";
- }
- else
- {
- htmltext = "32201-02.html";
- }
- }
- else
- {
- htmltext = "32201-03.html";
- }
- }
- }
- else if (qs.isStarted())
- {
- switch (npc.getId())
- {
- case MASTER_RINDY:
- {
- if (memoState == 1)
- {
- qs.setMemoState(2);
- qs.setCond(2, true);
- htmltext = "32201-09.html";
- }
- else if (memoState == 2)
- {
- htmltext = "32201-10.html";
- }
- else if ((memoState > 2) && (memoState < 11))
- {
- htmltext = "32201-11.html";
- }
- else if (memoState >= 11)
- {
- htmltext = "32201-12.html";
- }
- break;
- }
- case WAREHOUSE_KEEPER_HOLVAS:
- {
- if (memoState < 7)
- {
- htmltext = "30058-01.html";
- }
- else if (memoState == 7)
- {
- htmltext = "30058-02.html";
- }
- else if (memoState == 8)
- {
- if (getQuestItemsCount(player, MANUSCRIPT_PAGE) < 30)
- {
- htmltext = "30058-06.html";
- }
- else
- {
- takeItems(player, MANUSCRIPT_PAGE, -1);
- qs.setMemoState(9);
- htmltext = "30058-07.html";
- }
- }
- else if (memoState == 9)
- {
- giveItems(player, ENCODED_PAGE_ON_THE_ANCIENT_RACE, 1);
- qs.setMemoState(10);
- qs.setCond(9, true);
- htmltext = "30058-09.html";
- }
- else if (memoState > 9)
- {
- htmltext = "30058-10.html";
- }
- break;
- }
- case MAGISTER_GAIUS:
- {
- if (memoState < 23)
- {
- htmltext = "30171-01.html";
- }
- else if (memoState == 23)
- {
- htmltext = "30171-02.html";
- }
- else if (memoState == 24)
- {
- htmltext = "30171-06.html";
- }
- else if (memoState == 25)
- {
- htmltext = "30171-09.html";
- }
- else if (memoState == 26)
- {
- htmltext = "30171-10.html";
- }
- else if (memoState == 27)
- {
- htmltext = "30171-11.html";
- }
- else if (memoState == 28)
- {
- htmltext = "30171-12.html";
- }
- else if (memoState == 29)
- {
- htmltext = "30171-13.html";
- }
- break;
- }
- case BLACKSMITH_POITAN:
- {
- if (memoState < 5)
- {
- htmltext = "30458-01.html";
- }
- else if (memoState == 5)
- {
- htmltext = "30458-02.html";
- }
- else if (memoState == 6)
- {
- htmltext = "30458-04.html";
- }
- else if (memoState == 7)
- {
- htmltext = "30458-10.html";
- }
- break;
- }
- case MAGISTER_CLAYTON:
- {
- if (memoState < 2)
- {
- htmltext = "30464-01.html";
- }
- else if (memoState == 2)
- {
- qs.setMemoState(2);
- htmltext = "30464-02.html";
- }
- else if (memoState == 3)
- {
- if (getQuestItemsCount(player, ENMITY_CRYSTAL) < 30)
- {
- htmltext = "30464-07.html";
- }
- else
- {
- takeItems(player, ENMITY_CRYSTAL, -1);
- qs.setMemoState(4);
- htmltext = "30464-08.html";
- }
- }
- else if (memoState == 4)
- {
- giveItems(player, ENMITY_CRYSTAL_CORE, 1);
- qs.setMemoState(5);
- qs.setCond(5, true);
- htmltext = "30464-10.html";
- }
- else if (memoState == 5)
- {
- htmltext = "30464-12.html";
- }
- else if (memoState > 5)
- {
- htmltext = "30464-13.html";
- }
- break;
- }
- case MAGISTER_GAUEN:
- {
- if (memoState < 27)
- {
- htmltext = "30717-01.html";
- }
- else if (memoState == 27)
- {
- takeItems(player, MANASHENS_TALISMAN, -1);
- qs.setMemoState(28);
- htmltext = "30717-02.html";
- }
- else if (memoState == 28)
- {
- htmltext = "30717-04.html";
- }
- else if (memoState >= 29)
- {
- htmltext = "30717-10.html";
- }
- break;
- }
- case MAGISTER_KAIENA:
- {
- if (memoState < 29)
- {
- htmltext = "30720-01.html";
- }
- else if (memoState == 29)
- {
- htmltext = "30720-02.html";
- }
- if (memoState >= 30)
- {
- htmltext = "30720-05.html";
- }
- break;
- }
- case GRAND_MASTER_MELDINA:
- {
- if (memoState < 10)
- {
- htmltext = "32214-01.html";
- }
- else if (memoState == 10)
- {
- htmltext = "32214-02.html";
- }
- if (memoState == 11)
- {
- htmltext = "32214-05.html";
- }
- if (memoState > 11)
- {
- htmltext = "32214-06.html";
- }
- break;
- }
- case MASTER_SELSIA:
- {
- if (memoState < 11)
- {
- htmltext = "32220-01.html";
- }
- else if (memoState == 11)
- {
- htmltext = "32220-02.html";
- }
- else if (memoState == 12)
- {
- htmltext = "32220-04.html";
- }
- else if (memoState == 13)
- {
- if (qs.getMemoStateEx(1) == 0)
- {
- qs.setMemoStateEx(1, 0);
- htmltext = "32220-07.html";
- }
- else if (qs.getMemoStateEx(1) == 1)
- {
- qs.setMemoStateEx(1, 0);
- htmltext = "32220-08.html";
- }
- }
- else if (memoState == 20)
- {
- qs.setMemoState(21);
- qs.setCond(11, true);
- htmltext = "32220-14.html";
- }
- else if (memoState == 21)
- {
- htmltext = "32220-15.html";
- }
- else if (memoState == 22)
- {
- htmltext = "32220-16.html";
- }
- else if ((memoState >= 23) && (memoState < 30))
- {
- htmltext = "32220-17.html";
- }
- else if (memoState == 30)
- {
- qs.setMemoState(31);
- htmltext = "32220-18.html";
- }
- else if (memoState == 31)
- {
- htmltext = "32220-20.html";
- }
- else if (memoState == 32)
- {
- if (!hasQuestItems(player, RESEARCH_ON_THE_GIANTS_AND_THE_ANCIENT_RACE))
- {
- htmltext = "32220-27.html";
- }
- else
- {
- giveAdena(player, 77666, true);
- giveItems(player, KAMAEL_INQUISITOR_MARK, 1);
- addExpAndSp(player, 429546, 29476);
- qs.exitQuest(false, true);
- player.sendPacket(new SocialAction(player.getObjectId(), 3));
- htmltext = "32220-28.html";
- }
- }
- break;
- }
- }
- }
- if (qs.isCompleted())
- {
- if (npc.getId() == MASTER_RINDY)
- {
- if (player.getClassId() == ClassId.arbalester)
- {
- htmltext = "32201-05.html";
- }
- else
- {
- htmltext = "32201-06.html";
- }
- }
- }
- return htmltext;
- }
- }
|