public Q10390_KekropusLetter() { super(10390, Q10390_KekropusLetter.class.getSimpleName(), "Kekropus' Letter"); addStartNpc(DRIKUS, RAYMOND, RAINS, ELLENIA, ESRANDELL, TOBIAS, MENDIO, GERSHWIN); addTalkId( DRIKUS, BATHIS, GOSTA, ELI, RAYMOND, RAINS, ELLENIA, ESRANDELL, TOBIAS, MENDIO, GERSHWIN); registerQuestItems( SCROLL_OF_ESCAPE_ALIGATOR_ISLAND.getId(), SCROLL_OF_ESCAPE_HEINE.getId(), KEKROPUS_LETTER.getId()); addCondLevel(MIN_LEVEL, MAX_LEVEL, "30505-noLevel.html"); BypassHandler.getInstance().registerHandler(this); }
public Q00212_TrialOfDuty() { super(212, Q00212_TrialOfDuty.class.getSimpleName(), "Trial of Duty"); addStartNpc(HANNAVALT); addTalkId( HANNAVALT, DUSTIN, SIR_COLLIN_WINDAWOOD, SIR_ARON_TANFORD, SIR_KIEL_NIGHTHAWK, ISAEL_SILVERSHADOW, SPIRIT_OF_SIR_TALIANUS); addKillId( HANGMAN_TREE, SKELETON_MARAUDER, SKELETON_RAIDER, STRAIN, GHOUL, BREKA_ORC_OVERLORD, LETO_LIZARDMAN, LETO_LIZARDMAN_ARCHER, LETO_LIZARDMAN_SOLDIER, LETO_LIZARDMAN_WARRIOR, LETO_LIZARDMAN_SHAMAN, LETO_LIZARDMAN_OVERLORD, SPIRIT_OF_SIR_HEROD); registerQuestItems( LETTER_OF_DUSTIN, KNIGHTS_TEAR, MIRROR_OF_ORPIC, TEAR_OF_CONFESSION, REPORT_PIECE.getId(), TALIANUSS_REPORT, TEAR_OF_LOYALTY, MILITAS_ARTICLE.getId(), SAINTS_ASHES_URN, ATHEBALDTS_SKULL, ATHEBALDTS_RIBS, ATHEBALDTS_SHIN, LETTER_OF_WINDAWOOD, OLD_KNIGHTS_SWORD); }
@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 "30505-03.html": case "30297-03.html": { qs.startQuest(); htmltext = event; break; } case "30332-02.html": { if (qs.getQuestItemsCount(KEKROPUS_LETTER.getId()) < 1) { giveItems(player, KEKROPUS_LETTER); } htmltext = event; break; } case "30332-03.html": { if (qs.isCond(1)) { qs.setCond(2); htmltext = event; } break; } case "30332-05.html": { if (qs.isCond(2)) { qs.setCond(3); giveItems(player, SCROLL_OF_ESCAPE_HEINE); htmltext = event; } break; } case "30916-03.html": { if (qs.isCond(3)) { qs.setCond(4); giveItems(player, SCROLL_OF_ESCAPE_ALIGATOR_ISLAND); htmltext = event; } break; } case "33858-02.html": { if (qs.isCond(4)) { giveItems(player, ENCHANT_WEAPON_C); giveItems(player, STEEL_DOOR_GUILD); addExpAndSp(player, EXP_REWARD, SP_REWARD); showOnScreenMsg( player, NpcStringId .GROW_STRONGER_HERE_UNTIL_YOU_RECEIVE_THE_NEXT_LETTER_FROM_KEKROPUS_AT_LV_46, ExShowScreenMessage.TOP_CENTER, 4500); qs.exitQuest(false, true); htmltext = event; } break; } case "30505-02.htm": case "30297-02.htm": case "30916-02.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) || !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); }