@Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { final QuestState st = getQuestState(player, false); if (st == null) { return null; } String htmltext = event; switch (event) { case "32650-04.htm": case "32650-05.htm": case "32650-06.html": break; case "32650-07.htm": st.startQuest(); break; case "despawn": npc.setBusy(false); npc.deleteMe(); htmltext = null; break; default: htmltext = null; break; } return htmltext; }
@Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { final QuestState st = getQuestState(player, false); if ((st != null) && (player.getLevel() >= MIN_LEVEL) && event.equals("32612-04.html")) { st.startQuest(); return event; } return null; }
@Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { final QuestState st = getQuestState(player, false); if (st == null) { return getNoQuestMsg(player); } switch (event) { case "30070-02.htm": st.startQuest(); st.giveItems(TEMPLE_MANIFESTO, 1); break; case "30070-05.html": st.giveAdena(84593, true); if ((player.getLevel() < 42)) { st.addExpAndSp(187062, 11307); } st.exitQuest(false, true); break; case "30070-03.html": st.setCond(2, true); break; case "30118-06.html": st.setCond(3, true); break; case "30118-09.html": st.setCond(6, true); st.giveItems(PUPINAS_RECOMMENDATION, 1); break; case "30474-02.html": st.setCond(4, true); break; case "30666-02.html": if (st.hasQuestItems(PUPINAS_RECOMMENDATION)) { st.set("talk", "1"); st.takeItems(PUPINAS_RECOMMENDATION, -1); } break; case "30666-03.html": if (st.hasQuestItems(TEMPLE_MANIFESTO)) { st.set("talk", "2"); st.takeItems(TEMPLE_MANIFESTO, -1); } break; case "30666-08.html": st.setCond(7, true); st.unset("talk"); break; } return event; }
@Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { final QuestState st = getQuestState(player, false); if (st == null) { return null; } String htmltext = null; switch (event) { case "31453-02.htm": case "31453-03.htm": case "31453-10.html": { htmltext = event; break; } case "31453-04.html": { st.startQuest(); htmltext = event; break; } case "31453-11.html": { if (st.isCond(2)) { st.giveAdena(150292, true); st.addExpAndSp(902439, 90067); st.exitQuest(false, true); htmltext = event; } break; } case "brooch": { htmltext = (st.hasQuestItems(ANTIQUE_BROOCH)) ? "32009-02.html" : "32009-03.html"; break; } case "32009-04.html": { if (st.isCond(1) && st.hasQuestItems(ANTIQUE_BROOCH)) { st.setCond(2, true); htmltext = event; } break; } } return htmltext; }
@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 "32975-03.htm": { qs.startQuest(); qs.setCond(2); // show arrow hack qs.setCond(1); player.sendPacket( new TutorialShowHtml( npc.getObjectId(), "..\\L2Text\\QT_027_Quest_01.htm", TutorialShowHtml.LARGE_WINDOW)); htmltext = event; break; } case "32975-02.htm": { htmltext = event; break; } case "32974-02.html": { giveAdena(player, 50, true); addExpAndSp(player, 40, 5); qs.exitQuest(false, true); Broadcast.toKnownPlayers( npc, new NpcSay( npc.getObjectId(), ChatType.NPC_GENERAL, npc.getTemplate().getDisplayId(), NpcStringId.HM_DON_T_JUST_GO_I_STILL_HAVE_TONS_TO_TEACH_YOU)); htmltext = event; break; } } return htmltext; }
@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 "33864-03.html": { qs.startQuest(); giveItems(player, SCROLL_OF_ESCAPE_FIELDS_OF_MASSACRE); htmltext = event; break; } case "33867-02.html": { if (qs.isCond(1)) { giveItems(player, STEEL_DOOR_GUILD); giveItems(player, ENCHANT_WEAPON_A); addExpAndSp(player, 807240, 193); showOnScreenMsg( player, NpcStringId .GROW_STRONGER_HERE_UNTIL_YOU_RECEIVE_THE_NEXT_LETTER_FROM_KEKROPUS_AT_LV_65, ExShowScreenMessage.TOP_CENTER, 4500); qs.exitQuest(false, true); htmltext = event; } break; } case "33864-02.htm": { htmltext = event; break; } } return htmltext; }
@Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { final QuestState st = getQuestState(player, false); if (st == null) { return getNoQuestMsg(player); } switch (event) { case "31338-1.html": st.giveItems(ANCIENT_BOOK, 1); st.startQuest(); break; case "32113-2.html": case "32113-2a.html": st.giveAdena(191678, true); st.addExpAndSp(251602, 25245); st.exitQuest(false, true); break; } return event; }
@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 "33952-02.htm": case "33953-02.html": { htmltext = event; break; } case "33952-03.html": { qs.startQuest(); htmltext = event; break; } case "33953-03.html": { if (qs.isCond(2)) { giveAdena(player, 62000, true); addExpAndSp(player, 62876, 0); giveItems(player, LEATHER_SHOES); showOnScreenMsg( player, NpcStringId.CHECK_YOUR_EQUIPMENT_IN_YOUR_INVENTORY, ExShowScreenMessage.TOP_CENTER, 4500); qs.exitQuest(false, true); htmltext = event; } break; } } return htmltext; }
@Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { final QuestState qs = getQuestState(player, false); if (qs == null) { return null; } String texthtml = null; switch (event) { case "33509-02.htm": { texthtml = event; break; } case "33509-03.htm": // start the quest { qs.startQuest(); texthtml = event; break; } case "31795-02.html": { texthtml = event; break; } case "31795-03.html": // end quest, take sketch, give rewards { giveAdena(player, ADENA_REWARD, true); addExpAndSp(player, EXP_REWARD, SP_REWARD); rewardItems(player, SCROLL_EW_D); qs.exitQuest(false, true); texthtml = event; break; } } return texthtml; }
@Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { if ("DESPAWN_GUARDIAN".equals(event)) { if (npc != null) { npc.deleteMe(); } return super.onAdvEvent(event, npc, player); } final QuestState qs = getQuestState(player, false); String htmltext = null; if (qs == null) { return htmltext; } switch (event) { case "30610-05.htm": { if (qs.isCreated()) { if (getQuestItemsCount( player, DRAGONFLUTE_OF_WIND, DRAGONFLUTE_OF_STAR, DRAGONFLUTE_OF_TWILIGHT) == 1) { final L2ItemInstance flute = getFlute(player); if (flute.getEnchantLevel() < MIN_HACHLING_LVL) { htmltext = "30610-06.html"; } else { qs.startQuest(); qs.setMemoState(100); qs.set("fluteObjectId", flute.getObjectId()); htmltext = event; } } else { htmltext = "30610-06.html"; } } break; } case "30747-04.html": { final L2Summon summon = player.getPet(); if (summon == null) { htmltext = "30747-02.html"; } else if (summon.getControlObjectId() != qs.getInt("fluteObjectId")) { htmltext = "30747-03.html"; } else { htmltext = event; } break; } case "30747-05.html": { final L2Summon summon = player.getPet(); if (summon == null) { htmltext = "30747-06.html"; } else if (summon.getControlObjectId() != qs.getInt("fluteObjectId")) { htmltext = "30747-06.html"; } else { giveItems(player, FAIRY_LEAF, 4); qs.setCond(2, true); qs.setMemoState(0); htmltext = event; } break; } case "30747-07.html": case "30747-08.html": case "30747-09.html": case "30747-10.html": { htmltext = event; break; } } return htmltext; }
@Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { final QuestState st = getQuestState(player, false); final QuestState q115 = player.getQuestState(Q00115_TheOtherSideOfTruth.class.getSimpleName()); if (st == null) { return null; } String htmltext = null; switch (event) { case "ACCEPT": { st.startQuest(); if ((q115 != null) && (q115.isCompleted())) { htmltext = "32020-04.htm"; } else { st.setCond(2); htmltext = "32020-05.htm"; } break; } case "ASK": { if (st.getCond() >= 1) { htmltext = ((q115 != null) && !q115.isCompleted()) ? "32020-14.html" : "32020-15.html"; } break; } case "LATER": { if (st.getCond() >= 1) { htmltext = ((q115 != null) && !q115.isCompleted()) ? "32020-19.html" : "32020-20.html"; } break; } case "REWARD": { if (st.getCond() >= 1) { final long silverCryCount = getQuestItemsCount(player, SILVER_ICE_CRYSTAL); final long blackCryCount = getQuestItemsCount(player, BLACK_ICE_CRYSTAL); if ((silverCryCount + blackCryCount) > 0) { giveAdena(player, (silverCryCount * 300) + (blackCryCount * 1200), true); takeItems(player, -1, SILVER_ICE_CRYSTAL, BLACK_ICE_CRYSTAL); htmltext = ((q115 != null) && !q115.isCompleted()) ? "32020-16.html" : "32020-17.html"; } else { htmltext = "32020-18.html"; } } break; } case "QUIT": { if (st.getCond() >= 1) { if ((q115 != null) && !q115.isCompleted()) { htmltext = "32020-21.html"; st.exitQuest(true, true); } else { htmltext = "32020-22.html"; } } break; } case "32020-06.html": case "32020-07.html": case "32020-08.html": case "32020-09.html": { if (st.getCond() >= 1) { htmltext = event; } break; } case "32020-23.html": { if (st.getCond() >= 1) { st.exitQuest(true, true); htmltext = event; } break; } case "32023-04.html": { if ((st.getCond() >= 1) && hasQuestItems(player, SILVER_ICE_CRYSTAL) && (st.getInt("ex") == 0)) { st.set("ex", ((getRandom(4) + 1) * 10)); htmltext = event; } break; } case "32023-05.html": { if ((st.getCond() >= 1) && hasQuestItems(player, SILVER_ICE_CRYSTAL) && (st.getInt("ex") > 0)) { takeItems(player, SILVER_ICE_CRYSTAL, 1); final int val = (st.getInt("ex") + 1); st.set("ex", val); playSound(player, QuestSound.ITEMSOUND_BROKEN_KEY); htmltext = event; } break; } case "32023-06.html": { if ((st.getCond() >= 1) && hasQuestItems(player, SILVER_ICE_CRYSTAL) && (st.getInt("ex") > 0)) { takeItems(player, SILVER_ICE_CRYSTAL, 1); final int val = (st.getInt("ex") + 2); st.set("ex", val); playSound(player, QuestSound.ITEMSOUND_BROKEN_KEY); htmltext = event; } break; } case "REPLY4": { if ((st.getCond() >= 1) && (st.getInt("ex") > 0)) { final int ex = st.getInt("ex"); final int val1 = ex / 10; final int val2 = ex - (val1 * 10); if (val1 == val2) { htmltext = "32023-07.html"; giveItems(player, BLACK_ICE_CRYSTAL, 1); playSound(player, QuestSound.ITEMSOUND_ENCHANT_SUCCESS); } else { htmltext = "32023-08.html"; playSound(player, QuestSound.ITEMSOUND_ENCHANT_FAILED); } st.set("ex", 0); } break; } case "REPLY5": { if ((st.getCond() >= 1) && (st.getInt("ex") > 0)) { final int ex = st.getInt("ex"); final int val1 = ex / 10; final int val2 = ((ex - (val1 * 10)) + 2); if (val1 == val2) { htmltext = "32023-07.html"; giveItems(player, BLACK_ICE_CRYSTAL, 1); playSound(player, QuestSound.ITEMSOUND_ENCHANT_SUCCESS); } else { htmltext = "32023-08.html"; playSound(player, QuestSound.ITEMSOUND_ENCHANT_FAILED); } st.set("ex", 0); } break; } } return htmltext; }
@Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { if (event.startsWith("DESPAWN")) { 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 "30760-08.html": { if (qs.isCreated()) { giveItems(player, GUSTAVS_1ST_LETTER, 1); qs.startQuest(); qs.setMemoState(1000); htmltext = event; } break; } case "30760-12.html": { giveItems(player, GUSTAVS_2ND_LETTER, 1); qs.setMemoState(4000); qs.setCond(4); htmltext = event; break; } case "30760-16.html": { giveItems(player, GUSTAVS_3RD_LETTER, 1); qs.setMemoState(7000); qs.setCond(7); htmltext = event; break; } case "30760-20.html": { if (hasQuestItems(player, SCEPTER_OF_JUDGMENT)) { giveItems(player, SEAL_OF_ASPIRATION, 1); addExpAndSp(player, 0, 250000); qs.exitQuest(false, true); htmltext = event; } break; } case "30760-22.html": { qs.setMemoState(10000); qs.setCond(12); htmltext = event; break; } case "30760-23.html": { if (hasQuestItems(player, SCEPTER_OF_JUDGMENT)) { giveItems(player, SEAL_OF_ASPIRATION, 1); addExpAndSp(player, 0, 250000); qs.exitQuest(false, true); htmltext = event; } break; } case "30512-03.html": { if (hasQuestItems(player, BROOCH_OF_THE_MAGPIE)) { takeItems(player, BROOCH_OF_THE_MAGPIE, -1); giveItems(player, BLACK_ANVIL_COIN, 1); } htmltext = event; break; } case "30645-03.html": { takeItems(player, GUSTAVS_1ST_LETTER, -1); qs.setMemoState(2000); qs.setCond(2, true); htmltext = event; break; } case "30761-02.html": { if (qs.isMemoState(2000) || qs.isMemoState(2011) || qs.isMemoState(2010) || qs.isMemoState(2001)) { giveItems(player, BLITZ_WYRM_EGG, 3); qs.setMemoState(qs.getMemoState() + 100); addAttackPlayerDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player); addAttackPlayerDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player); startQuestTimer("DESPAWN", 10000, npc, player); htmltext = event; } else if (qs.isMemoState(2100) || qs.isMemoState(2111) || qs.isMemoState(2110) || qs.isMemoState(2101)) { addAttackPlayerDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player); addAttackPlayerDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player); startQuestTimer("DESPAWN", 10000, npc, player); htmltext = "30761-03.html"; } break; } case "30762-02.html": { if (qs.isMemoState(2000) || qs.isMemoState(2101) || qs.isMemoState(2001) || qs.isMemoState(2100)) { giveItems(player, BLITZ_WYRM_EGG, 3); giveItems(player, MIST_DRAKES_EGG, 4); qs.setMemoState(qs.getMemoState() + 10); addAttackPlayerDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player); addAttackPlayerDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player); startQuestTimer("DESPAWN", 10000, npc, player); htmltext = event; } else if (qs.isMemoState(2100) || qs.isMemoState(2111) || qs.isMemoState(2011) || qs.isMemoState(2110)) { addAttackPlayerDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player); addAttackPlayerDesire(addSpawn(BLITZ_WYRM, npc, true, 0, false), player); startQuestTimer("DESPAWN", 10000, npc, player); htmltext = "30762-03.html"; } break; } case "30763-02.html": { if (qs.isMemoState(2000) || qs.isMemoState(2110) || qs.isMemoState(2010) || qs.isMemoState(2100)) { giveItems(player, BROOCH_OF_THE_MAGPIE, 1); giveItems(player, MIST_DRAKES_EGG, 6); qs.setMemoState(qs.getMemoState() + 1); npc.deleteMe(); htmltext = event; } break; } case "30764-03.html": { takeItems(player, GUSTAVS_2ND_LETTER, -1); qs.setMemoState(5000); qs.setCond(5, true); htmltext = event; break; } case "30764-06.html": { takeItems(player, GUSTAVS_2ND_LETTER, -1); takeItems(player, BLACK_ANVIL_COIN, -1); giveItems(player, RECIPE_SPITEFUL_SOUL_ENERGY, 1); qs.setMemoState(5000); qs.setCond(5, true); htmltext = event; break; } case "30765-04.html": { takeItems(player, IMPERIAL_KEY, -1); giveItems(player, SCEPTER_OF_JUDGMENT, 1); qs.setMemoState(8700); htmltext = event; break; } case "30766-04.html": { qs.setMemoState(8100); qs.setCond(9, true); npc.broadcastPacket(new NpcSay(npc, ChatType.NPC_GENERAL, NpcStringId.BLOOD_AND_HONOR)); startQuestTimer("SPAWN_WITCH", 5000, npc, player); htmltext = event; break; } case "30766-08.html": { if (hasQuestItems(player, SCEPTER_OF_JUDGMENT)) { giveItems(player, SEAL_OF_ASPIRATION, 1); addExpAndSp(player, 0, 250000); qs.exitQuest(false, true); htmltext = event; } break; } case "30868-04.html": { takeItems(player, GUSTAVS_3RD_LETTER, -1); qs.setMemoState(8000); qs.setCond(8, true); htmltext = event; break; } case "30868-10.html": { qs.setMemoState(9000); qs.setCond(11, true); htmltext = event; break; } case "30645-06.html": case "30760-05.html": case "30760-06.html": case "30760-07.html": case "30760-21.html": case "30764-05.html": case "30765-02.html": case "30765-05a.html": case "30766-03.html": case "30868-03.html": case "30868-06a.html": { htmltext = event; break; } case "SPAWN_WITCH": { final L2Npc athrea = addSpawn(WITCH_ATHREA, 160688, 21296, -3714, 0, false, 0); athrea.setScriptValue(50301); final L2Npc kalis = addSpawn(WITCH_KALIS, 160690, 21176, -3712, 0, false, 0); kalis.setScriptValue(50302); break; } } return htmltext; }
@Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { final QuestState qs = getQuestState(player, false); String htmltext = null; if (qs == null) { return htmltext; } switch (event) { case "30386-03.htm": { if (qs.isCreated()) { qs.startQuest(); htmltext = event; } break; } case "30386-06.html": { if (qs.isCond(2)) { if (hasItem(player, FEATHER)) { qs.setCond(3, true); takeItem(player, FEATHER); giveItems(player, TOTEM_TOOTH_1ST, 1); htmltext = event; } else { htmltext = "30386-07.html"; } } break; } case "30034-02.html": { if (qs.isCond(3)) { if (hasQuestItems(player, TOTEM_TOOTH_1ST)) { qs.setCond(4, true); takeItems(player, TOTEM_TOOTH_1ST, 1); giveItems(player, LETTER_1ST, 1); htmltext = event; } else { htmltext = "30034-03.html"; } } break; } case "30034-06.html": { if (qs.isCond(5)) { if (hasQuestItems(player, LETTER_2ND)) { qs.setCond(6, true); takeItems(player, LETTER_2ND, 1); htmltext = event; } else { htmltext = "30034-07.html"; } } break; } case "30034-10.html": { if (qs.isCond(7)) { if (hasItem(player, TOTEM_TOOTH_2ND)) { addExpAndSp(player, 435117, 23977); final int chance = getRandom(1000); if (chance < 250) { rewardItems(player, BONE_HELMET, 1); giveAdena(player, 5200, true); } else if (chance < 500) { rewardItems(player, ASPIS, 1); giveAdena(player, 1500, true); } else if (chance < 750) { rewardItems(player, BLUE_BUCKSKIN_BOOTS, 1); giveAdena(player, 3200, true); } else if (chance < 1000) { rewardItems(player, LEATHER_GAUNTLET, 1); giveAdena(player, 3200, true); } qs.exitQuest(false, true); htmltext = event; } else { htmltext = "30034-11.html"; } } break; } case "30344-02.html": { if (qs.isCond(4)) { if (hasQuestItems(player, LETTER_1ST)) { qs.setCond(5, true); takeItems(player, LETTER_1ST, 1); giveItems(player, LETTER_2ND, 1); htmltext = event; } else { htmltext = "30344-03.html"; } } break; } } return htmltext; }
@Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { final QuestState st = getQuestState(player, false); if (st == null) { return null; } String htmltext = event; switch (event) { case "30894-02.html": case "30297-04.html": case "30612-05.html": case "30612-06.html": case "30612-07.html": case "30612-08.html": case "32369-04.html": case "32369-05.html": case "32369-07.html": case "32369-08.html": case "32369-09.html": case "32369-10.html": break; case "30894-01.html": st.startQuest(); break; case "30894-03.html": st.setCond(2, true); st.giveItems(SEALED_PROPHECY_PATH_OF_THE_GOD, 1); break; case "30297-03.html": st.takeItems(SEALED_PROPHECY_PATH_OF_THE_GOD, -1); st.set("talk", "1"); break; case "30297-05.html": st.unset("talk"); st.setCond(3, true); st.giveItems(PROPHECY_PATH_OF_THE_GOD, 1); st.giveItems(EMPTY_SOUND_CRYSTAL, 1); break; case "30612-03.html": st.takeItems(PROPHECY_PATH_OF_THE_GOD, -1); st.set("talk", "1"); break; case "30612-09.html": st.unset("talk"); st.setCond(4, true); st.giveItems(ANGEL_MEDICINE, 1); break; case "32368-04.html": if (isAngelSpawned) { return "32368-03.html"; } addSpawn(ANGEL, npc.getX() + 100, npc.getY() + 100, npc.getZ(), 0, false, 120000); startQuestTimer("despawn", 120000, null, player); isAngelSpawned = true; break; case "32369-03.html": st.takeItems(ANGEL_MEDICINE, -1); st.set("talk", "1"); break; case "32369-06.html": st.set("talk", "2"); break; case "32369-11.html": st.unset("talk"); st.takeItems(EMPTY_SOUND_CRYSTAL, -1); st.giveItems(ANGELS_MESSAGE, 1); st.setCond(5, true); npc.deleteMe(); isAngelSpawned = false; break; case "despawn": if (isAngelSpawned) { isAngelSpawned = false; } default: htmltext = null; break; } return htmltext; }