@Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { String htmltext = event; final QuestState st = player.getQuestState(qn); if (st == null) { return htmltext; } switch (event) { case "31570-03.htm": st.set("cond", "1"); st.setState(State.STARTED); st.playSound("ItemSound.quest_accept"); break; case "31570-05.htm": if ((st.getInt("cond") == 1) && (st.hasQuestItems(BLUE_TREASURE_BOX))) { htmltext = "31570-06.htm"; st.set("cond", "2"); st.giveItems(STRANGE_BLUESPRINT, 1); st.takeItems(BLUE_TREASURE_BOX, -1); st.playSound("ItemSound.quest_middle"); } break; case "31434-02.htm": if ((st.getInt("cond") == 2) && (st.hasQuestItems(STRANGE_BLUESPRINT))) { htmltext = "31434-01.htm"; st.giveItems(BLACK_PEARL_RING, 1); st.takeItems(STRANGE_BLUESPRINT, -1); st.playSound("ItemSound.quest_finish"); st.exitQuest(false); } break; } return htmltext; }
@Override public final String onTalk(L2Npc npc, L2PcInstance player) { final QuestState st = player.getQuestState(qn); if (st == null) { return getNoQuestMsg(player); } final int cond = st.getInt("cond"); switch (npc.getNpcId()) { case ADLER1: switch (st.getState()) { case State.CREATED: if (player.getLevel() < MIN_LEVEL) { return "32497-05.htm"; } if (player.getLevel() > MAX_LEVEL) { return "32497-06.htm"; } return "32497-01.htm"; case State.STARTED: if (cond > 1) { return "32497-00.htm"; } return "32497-03.htm"; case State.COMPLETED: return "32497-07.htm"; default: return "32497-01.htm"; } case SINAI: if (cond > 1) { return "32500-00.htm"; } return "32500-01.htm"; case INSPECTOR: switch (st.getInt("cond")) { case 1: return "32507-01.htm"; case 2: return "32507-02.htm"; case 3: return "32507-03.htm"; case 4: case 5: return "32507-05.htm"; case 6: return "32507-06.htm"; default: return "32507-09.htm"; } case ADLER2: if (st.getState() == State.COMPLETED) { return "32510-00.htm"; } else if (cond == 9) { return "32510-01.htm"; } } return getNoQuestMsg(player); }
@Override public final String onTalk(L2Npc npc, L2PcInstance player) { final QuestState st = player.getQuestState(qn); final QuestState contractOfMammon = player.getQuestState("194_SevenSignContractOfMammon"); if (st == null) return "<html><body>目前沒有執行任務,或條件不符。</body></html>"; final int cond = st.getInt("cond"); switch (npc.getNpcId()) { case CLAUDIA: switch (st.getState()) { case State.CREATED: if (cond == 0 && player.getLevel() >= 79 && contractOfMammon.getState() == State.COMPLETED) return "31001-01.htm"; else st.exitQuest(true); return "31001-00.htm"; case State.STARTED: if (cond == 1) return "31001-06.htm"; case State.COMPLETED: return "<html><body>這是已經完成的任務。</body></html>"; } case JOHN: switch (st.getInt("cond")) { case 1: return "32576-01.htm"; case 2: return "32576-03.htm"; } case RAYMOND: switch (st.getInt("cond")) { case 1: case 2: return "30289-01.htm"; case 3: if (st.getQuestItemsCount(SHUNAIMAN_CONTRACT) == 1) return "30289-09.htm"; else return "30289-06.htm"; case 4: return "30289-12.htm"; } case IASON_HEINE: if (cond == 4) return "30969-01.htm"; } return "<html><body>目前沒有執行任務,或條件不符。</body></html>"; }
@Override public String onTalk(L2Npc npc, L2PcInstance talker) { final QuestState qs = getQuestState(talker, true); String htmltext = getNoQuestMsg(talker); switch (qs.getState()) { case State.CREATED: { if (npc.getId() == EYE_OF_ARGOS) { htmltext = ((talker.getLevel() < MIN_LVL) ? "31683-02.html" : "31683-01.htm"); } break; } case State.STARTED: { if (npc.getId() == EYE_OF_ARGOS) { switch (qs.getCond()) { case 1: case 2: case 3: case 4: case 5: { htmltext = "31683-04.html"; break; } case 6: { htmltext = "31683-05.html"; break; } case 7: { htmltext = "31683-07.html"; break; } case 8: { htmltext = "31683-08.html"; break; } } } else if (qs.getInt("TABLET_" + npc.getId()) == 0) { htmltext = npc.getId() + "-01.html"; } else { htmltext = npc.getId() + "-03.html"; } break; } case State.COMPLETED: { htmltext = getAlreadyCompletedMsg(talker); break; } } return htmltext; }
@Override public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { QuestState st = player.getQuestState(qn); if (st == null) return "<html><body>目前沒有執行任務,或條件不符。</body></html>"; final int cond = st.getInt("cond"); if (event.equalsIgnoreCase("31001-05.htm")) { if (cond == 0) { st.set("cond", "1"); st.setState(State.STARTED); st.playSound("ItemSound.quest_accept"); } } else if (event.equalsIgnoreCase("32576-02.htm")) { if (cond == 1) { st.giveItems(IDENTITY_CARD, 1); st.set("cond", "2"); st.playSound("ItemSound.quest_middle"); } } else if (event.equalsIgnoreCase("30289-04.htm")) { if (cond == 2) { st.set("cond", "3"); player.stopAllEffects(); SkillTable.getInstance().getInfo(GUARD_DAWN, 1).getEffects(player, player); } } else if (event.equalsIgnoreCase("30289-07.htm")) { if (cond == 3) { SkillTable.getInstance().getInfo(GUARD_DAWN, 1).getEffects(player, player); } } else if (event.equalsIgnoreCase("30289-08.htm")) { if (cond == 3) { player.stopAllEffects(); } } else if (event.equalsIgnoreCase("30289-11.htm")) { if (cond == 3) { st.set("cond", "4"); st.playSound("ItemSound.quest_middle"); player.stopAllEffects(); } } else if (event.equalsIgnoreCase("30969-03.htm")) { if (cond == 4) { st.addExpAndSp(52518015, 5817677); // st.addExpAndSp(25000000, 2500000); // High Five st.unset("cond"); st.exitQuest(false); st.playSound("ItemSound.quest_finish"); } } return event; }
@Override public String onTalk(L2Npc npc, L2PcInstance player) { String htmltext = getNoQuestMsg(player); final QuestState st = player.getQuestState(qn); if (st == null) { return htmltext; } final int npcId = npc.getNpcId(); switch (st.getState()) { case State.COMPLETED: htmltext = getAlreadyCompletedMsg(player); break; case State.CREATED: final QuestState qs = player.getQuestState("50_LanoscosSpecialBait"); if (npcId == LANOSCO) { htmltext = "31570-02.htm"; if (qs != null) { htmltext = ((player.getLevel() >= 27) && qs.isCompleted()) ? "31570-01.htm" : htmltext; } } break; case State.STARTED: final int cond = st.getInt("cond"); switch (npcId) { case LANOSCO: if (cond == 1) { if (st.hasQuestItems(BLUE_TREASURE_BOX)) { htmltext = "31570-04.htm"; } else { htmltext = "31570-05.htm"; } } else { htmltext = "31570-07.htm"; } break; case SHALING: if (cond == 2) { htmltext = "31434-00.htm"; } break; } } return htmltext; }
@Override public final String onTalk(L2Npc npc, L2PcInstance player) { final QuestState st = player.getQuestState(qn); if (st == null) { return "<html><body>目前沒有執行任務,或條件不符。</body></html>"; } final byte id = st.getState(); if (id == State.CREATED) { if (player.getLevel() > 72) { if (st.hasQuestItems(FADED_MARK)) { return "32010-02.htm"; } if (st.hasQuestItems(VISITOR_MARK)) { st.exitQuest(true); return "32010-01a.htm"; } if (st.hasQuestItems(MARK)) { st.exitQuest(true); return "32010-0.htm"; } } st.exitQuest(true); return "32010-01.htm"; } else if (id == State.STARTED) { if ((st.getInt("cond") == 2) && (st.getQuestItemsCount(NECRO_HEART) == 10)) { st.takeItems(NECRO_HEART, 10); st.takeItems(FADED_MARK, 1); st.giveItems(MARK, 1); st.giveItems(8273, 10); st.playSound("ItemSound.quest_finish"); st.exitQuest(true); return "32010-05.htm"; } return "32010-04.htm"; } return "<html><body>目前沒有執行任務,或條件不符。</body></html>"; }
@Override public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { String htmltext = ""; QuestState st = getQuestState(player, false); if (st == null) { return null; } final int npcId = npc.getId(); if (event.equalsIgnoreCase("Return")) { if (Util.contains(TEMPLE_PRIEST, npcId) && (st.getState() == State.STARTED)) { player.teleToLocation(RETURN_LOCS[st.getInt("id")]); player.setIsIn7sDungeon(false); st.exitQuest(true); } else if (Util.contains(RIFT_POSTERS, npcId) && (st.getState() == State.STARTED)) { player.teleToLocation(RETURN_LOCS[st.getInt("id")]); htmltext = "rift_back.htm"; st.exitQuest(true); } } else if (event.equalsIgnoreCase("Festival")) { int id = st.getInt("id"); if (Util.contains(TOWN_DAWN, id)) { player.teleToLocation(new Location(-80157, 111344, -4901)); player.setIsIn7sDungeon(true); } else if (Util.contains(TOWN_DUSK, id)) { player.teleToLocation(new Location(-81261, 86531, -5157)); player.setIsIn7sDungeon(true); } else { htmltext = "oracle1.htm"; } } else if (event.equalsIgnoreCase("Dimensional")) { htmltext = "oracle.htm"; player.teleToLocation(new Location(-114755, -179466, -6752)); } else if (event.equalsIgnoreCase("5.htm")) { int id = st.getInt("id"); if (id > -1) { htmltext = "5a.htm"; } int i = 0; for (int id1 : TELEPORTERS) { if (id1 == npcId) { break; } i++; } st.set("id", Integer.toString(i)); st.setState(State.STARTED); player.teleToLocation(new Location(-114755, -179466, -6752)); } else if (event.equalsIgnoreCase("6.htm")) { htmltext = "6.htm"; st.exitQuest(true); } else if (event.equalsIgnoreCase("zigurratDimensional")) { int playerLevel = player.getLevel(); if ((playerLevel >= 20) && (playerLevel < 30)) { takeItems(player, Inventory.ADENA_ID, 2000); } else if ((playerLevel >= 30) && (playerLevel < 40)) { takeItems(player, Inventory.ADENA_ID, 4500); } else if ((playerLevel >= 40) && (playerLevel < 50)) { takeItems(player, Inventory.ADENA_ID, 8000); } else if ((playerLevel >= 50) && (playerLevel < 60)) { takeItems(player, Inventory.ADENA_ID, 12500); } else if ((playerLevel >= 60) && (playerLevel < 70)) { takeItems(player, Inventory.ADENA_ID, 18000); } else if (playerLevel >= 70) { takeItems(player, Inventory.ADENA_ID, 24500); } int i = 0; for (int ziggurat : TELEPORTERS) { if (ziggurat == npcId) { break; } i++; } st.set("id", Integer.toString(i)); st.setState(State.STARTED); playSound(player, QuestSound.ITEMSOUND_QUEST_ACCEPT); htmltext = "ziggurat_rift.htm"; player.teleToLocation(new Location(-114755, -179466, -6752)); } return htmltext; }
@Override public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) { final QuestState qs = getQuestState(killer, false); if ((qs == null) || !Util.checkIfInRange(1500, killer, npc, true)) { return super.onKill(npc, killer, isSummon); } switch (npc.getId()) { case SKELETON_MARAUDER: case SKELETON_RAIDER: { if (qs.isMemoState(2)) { final int flag = qs.getInt("flag"); if (getRandom(100) < (flag * 10)) { addSpawn(SPIRIT_OF_SIR_HEROD, npc); qs.set("flag", 0); } else { qs.set("flag", flag + 1); } } break; } case SPIRIT_OF_SIR_HEROD: { if (qs.isMemoState(2)) { final L2Weapon weapon = killer.getActiveWeaponItem(); if ((weapon != null) && (weapon.getId() == OLD_KNIGHTS_SWORD)) { giveItems(killer, KNIGHTS_TEAR, 1); qs.setMemoState(3); qs.setCond(3, true); } } break; } case STRAIN: case GHOUL: { if (qs.isMemoState(5) && !hasQuestItems(killer, TALIANUSS_REPORT)) { if (giveItemRandomly( killer, npc, REPORT_PIECE.getId(), 1, REPORT_PIECE.getCount(), 1, true)) { takeItem(killer, REPORT_PIECE); giveItems(killer, TALIANUSS_REPORT, 1); qs.setCond(6); } } break; } case HANGMAN_TREE: { if (qs.isMemoState(6)) { final int flag = qs.getInt("flag"); if (getRandom(100) < ((flag - 3) * 33)) { addSpawn(SPIRIT_OF_SIR_TALIANUS, npc); qs.set("flag", 0); qs.setCond(8, true); } else { qs.set("flag", flag + 1); } } break; } case LETO_LIZARDMAN: case LETO_LIZARDMAN_ARCHER: case LETO_LIZARDMAN_SOLDIER: case LETO_LIZARDMAN_WARRIOR: case LETO_LIZARDMAN_SHAMAN: case LETO_LIZARDMAN_OVERLORD: { if (qs.isMemoState(9) && giveItemRandomly( killer, npc, MILITAS_ARTICLE.getId(), 1, MILITAS_ARTICLE.getCount(), 1, true)) { qs.setCond(12); } break; } case BREKA_ORC_OVERLORD: { if (qs.isMemoState(11)) { if (!hasQuestItems(killer, ATHEBALDTS_SKULL)) { giveItems(killer, ATHEBALDTS_SKULL, 1); playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); } else if (!hasQuestItems(killer, ATHEBALDTS_RIBS)) { giveItems(killer, ATHEBALDTS_RIBS, 1); playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET); } else if (!hasQuestItems(killer, ATHEBALDTS_SHIN)) { giveItems(killer, ATHEBALDTS_SHIN, 1); qs.setCond(15, true); } } break; } } return super.onKill(npc, killer, isSummon); }
@Override public final String onKill(L2Npc npc, L2PcInstance player, boolean isPet) { QuestState st = player.getQuestState(qn); if ((st == null) || (st.getState() != State.STARTED)) { return null; } final int cond = st.getInt("cond"); switch (npc.getNpcId()) { case HILLAS: if (cond == 2) { st.set("cond", "3"); st.playSound("ItemSound.quest_itemget"); st.takeItems(BOOK1, -1); st.giveItems(BOOK2, 1); st.giveItems(WATER_ESSENCE, 1); } addSpawn(PAPION, -53903, 181484, -4555, 30456, false, 0, false, npc.getInstanceId()); break; case PAPION: if (cond == 4) { st.takeItems(BOOK3, -1); st.giveItems(BOOK4, 1); st.set("cond", "5"); st.playSound("ItemSound.quest_itemget"); } addSpawn(KINSUS, -61415, 181418, -4818, 63852, false, 0, false, npc.getInstanceId()); break; case KINSUS: if (cond == 5) { st.set("cond", "6"); st.playSound("ItemSound.quest_itemget"); st.takeItems(BOOK4, -1); st.giveItems(BOOK5, 1); st.giveItems(FIRE_ESSENCE, 1); } addSpawn(GARGOS, -61354, 183624, -4821, 63613, false, 0, false, npc.getInstanceId()); break; case GARGOS: if (cond == 7) { st.set("cond", "8"); st.playSound("ItemSound.quest_itemget"); st.takeItems(BOOK6, -1); st.giveItems(BOOK7, 1); } addSpawn(ADIANTUM, -53297, 185027, -4617, 1512, false, 0, false, npc.getInstanceId()); break; case ADIANTUM: if (cond == 8) { st.set("cond", "9"); st.playSound("ItemSound.quest_middle"); st.takeItems(BOOK7, -1); addSpawn(ADLER2, -53297, 185027, -4617, 33486, false, 0, false, npc.getInstanceId()); } break; case BOTTLE: case BRAZIER: case BLOOM: dropItem(npc, player); break; default: // hardcoded herb drops dropHerb(npc, player, HP_HERBS_DROPLIST); dropHerb(npc, player, MP_HERBS_DROPLIST); break; } return super.onKill(npc, player, isPet); }
@Override public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player) { final QuestState st = player.getQuestState(qn); if (st == null) { return getNoQuestMsg(player); } final int cond = st.getInt("cond"); if (event.equalsIgnoreCase("enter")) { enterInstance(player); return null; } else if (event.equalsIgnoreCase("32497-03.htm")) { if (cond == 0) { st.set("cond", "1"); st.setState(State.STARTED); st.playSound("ItemSound.quest_accept"); } } else if (event.equalsIgnoreCase("32500-06.htm")) { if (cond == 1) { st.set("cond", "2"); st.playSound("ItemSound.quest_itemget"); st.giveItems(SWORD, 1); st.giveItems(BOOK1, 1); } } else if (event.equalsIgnoreCase("32507-04.htm")) { if (cond == 3) { st.set("cond", "4"); st.playSound("ItemSound.quest_middle"); st.takeItems(SWORD, -1); st.takeItems(WATER_ESSENCE, -1); st.takeItems(BOOK2, -1); st.giveItems(BOOK3, 1); st.giveItems(ENH_SWORD1, 1); } } else if (event.equalsIgnoreCase("32507-08.htm")) { if (cond == 6) { st.set("cond", "7"); st.playSound("ItemSound.quest_itemget"); st.takeItems(ENH_SWORD1, -1); st.takeItems(BOOK5, -1); st.takeItems(FIRE_ESSENCE, -1); st.giveItems(ENH_SWORD2, 1); st.giveItems(BOOK6, 1); } } else if (event.equalsIgnoreCase("32510-02.htm")) { st.unset("cond"); st.playSound("ItemSound.quest_finish"); st.exitQuest(false); Instance inst = InstanceManager.getInstance().getInstance(npc.getInstanceId()); inst.setDuration(EXIT_TIME * 60000); inst.setEmptyDestroyTime(0); if (inst.containsPlayer(player.getObjectId())) { player.setVitalityPoints(20000, true); st.addExpAndSp(810000, 50000); for (int id : REWARDS) { st.giveItems(id, 1); } } } return event; }
@Override public String onTalk(L2Npc npc, L2PcInstance player) { String htmltext = getNoQuestMsg(player); final QuestState st = player.getQuestState(getName()); if (st == null) { return htmltext; } switch (npc.getId()) { case NATOOLS: switch (st.getState()) { case State.STARTED: switch (st.getCond()) { case 1: htmltext = "30894-01.html"; break; default: htmltext = "30894-04.html"; break; } break; case State.COMPLETED: htmltext = getAlreadyCompletedMsg(player); break; } break; case RAYMOND: if (st.isStarted()) { switch (st.getCond()) { case 1: htmltext = "30289-01.html"; break; case 2: if (st.isSet("talk")) { htmltext = "30289-03.html"; } else { st.takeItems(CRYPTOGRAM_OF_THE_ANGEL_SEARCH, -1); st.set("talk", "1"); htmltext = "30289-02.html"; } break; case 3: case 4: case 5: htmltext = "30289-06.html"; break; case 6: st.giveAdena(92676, true); if (player.getLevel() <= MAX_REWARD_LEVEL) { st.addExpAndSp(223036, 13091); } st.exitQuest(false, true); htmltext = "30289-07.html"; break; } } break; case CASIAN: if (st.isStarted()) { switch (st.getCond()) { case 1: case 2: htmltext = "30612-01.html"; break; case 3: if (st.getInt("talk") == 1) { htmltext = "30612-03.html"; } else if (st.getInt("talk") == 2) { htmltext = "30612-06.html"; } else { htmltext = "30612-02.html"; st.set("talk", "1"); } break; case 4: case 5: case 6: htmltext = "30612-09.html"; break; } } break; case ROCK: if (st.isStarted()) { switch (st.getCond()) { case 5: htmltext = "32368-02.html"; break; case 6: htmltext = "32368-05.html"; break; default: htmltext = "32368-01.html"; break; } } break; } return htmltext; }
@Override public String onTalk(L2Npc npc, L2PcInstance player) { String htmltext = ""; QuestState st = player.getQuestState(getName()); if (st == null) return null; switch (npc.getNpcId()) { case 13001: if (antharasAI() != null) { int status = GrandBossManager.getInstance().getBossStatus(29019); int statusW = GrandBossManager.getInstance().getBossStatus(29066); int statusN = GrandBossManager.getInstance().getBossStatus(29067); int statusS = GrandBossManager.getInstance().getBossStatus(29068); if (status == 2 || statusW == 2 || statusN == 2 || statusS == 2) htmltext = "13001-02.htm"; else if (status == 3 || statusW == 3 || statusN == 3 || statusS == 3) htmltext = "13001-01.htm"; else if (status == 0 || status == 1) // If entrance to see Antharas is unlocked (he is Dormant or Waiting) { if (st.hasQuestItems(3865)) { // st.takeItems(3865, 1); // No longer consumed in h5 L2BossZone zone = GrandBossManager.getInstance().getZone(179700, 113800, -7709); if (zone != null) zone.allowPlayerEntry(player, 30); player.teleToLocation(179700 + Rnd.get(700), 113800 + Rnd.get(2100), -7709); if (status == 0) { L2GrandBossInstance antharas = GrandBossManager.getInstance().getBoss(29019); antharasAI().notifyEvent("waiting", antharas, player); } } else htmltext = "13001-03.htm"; } } break; case 31859: player.teleToLocation(79800 + Rnd.get(600), 151200 + Rnd.get(1100), -3534); break; case 31385: if (valakasAI() != null) { int status = GrandBossManager.getInstance().getBossStatus(29028); if (status == 0 || status == 1) { if (playerCount >= 200) htmltext = "31385-03.htm"; else if (st.getInt("allowEnter") == 1) { st.unset("allowEnter"); L2BossZone zone = GrandBossManager.getInstance().getZone(212852, -114842, -1632); if (zone != null) zone.allowPlayerEntry(player, 30); player.teleToLocation(204328 + Rnd.get(600), -111874 + Rnd.get(600), 70); playerCount++; if (status == 0) { L2GrandBossInstance valakas = GrandBossManager.getInstance().getBoss(29028); valakasAI().startQuestTimer("1001", Config.Valakas_Wait_Time, valakas, null); GrandBossManager.getInstance().setBossStatus(29028, 1); } } else htmltext = "31385-04.htm"; } else if (status == 2) htmltext = "31385-02.htm"; else htmltext = "31385-01.htm"; } else htmltext = "31385-01.htm"; break; case 31384: DoorTable.getInstance().getDoor(24210004).openMe(); break; case 31686: DoorTable.getInstance().getDoor(24210006).openMe(); break; case 31687: DoorTable.getInstance().getDoor(24210005).openMe(); break; case 31540: if (playerCount < 50) htmltext = "31540-01.htm"; else if (playerCount < 100) htmltext = "31540-02.htm"; else if (playerCount < 150) htmltext = "31540-03.htm"; else if (playerCount < 200) htmltext = "31540-04.htm"; else htmltext = "31540-05.htm"; break; case 31759: player.teleToLocation(150037 + Rnd.get(500), -57720 + Rnd.get(500), -2976); break; } return htmltext; }