public void tele() { Player player = getSelf(); NpcInstance npc = getNpc(); if (player != null && npc != null) if (player.getLevel() < 75) show("teleporter/" + npc.getNpcId() + "-4.htm", player); else if (player.getAdena() >= 150000) { player.reduceAdena(150000, true); player.teleToLocation(-149406, 255247, -80); } else show("teleporter/" + npc.getNpcId() + "-2.htm", player); }
@Override protected void onEvtAttacked(Creature attacker, int damage) { if (attacker == null || attacker.getPlayer() == null) return; for (NpcInstance minion : World.getAroundNpc(getActor(), 3000, 2000)) if (minion.getNpcId() == 22358 || minion.getNpcId() == 22357) minion.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, attacker, 5000); if (!_attacked) { Functions.npcSay(getActor(), "Fool, you and your friends will die! Attack!"); _attacked = true; } }
@Override public String onKill(NpcInstance npc, QuestState st) { int npcId = npc.getNpcId(); if ((npcId == 20517 || npcId == 20518 || npcId == 20455) && st.getCond() == 3) { if (st.getQuestItemsCount(CECKTINONS_VOUCHER2_ID) == 1 && st.getQuestItemsCount(BONE_FRAGMENT1_ID) < 10) { if (Rnd.chance(33)) { st.giveItems(BONE_FRAGMENT1_ID, 1); if (st.getQuestItemsCount(BONE_FRAGMENT1_ID) == 10) { st.playSound(SOUND_MIDDLE); st.setCond(4); } else { st.playSound(SOUND_ITEMGET); } } } } else if ((npcId == 20015 || npcId == 20020) && st.getCond() == 6) { if (st.getQuestItemsCount(PRESERVE_OIL_ID) == 1) { if (Rnd.chance(33)) { st.giveItems(ZOMBIE_HEAD_ID, 1); st.playSound(SOUND_MIDDLE); st.takeItems(PRESERVE_OIL_ID, 1); st.setCond(7); } } } return null; }
@Override public String onKill(NpcInstance npc, QuestState st) { if (st.getState() == STARTED) { st.rollAndGive(CLAWS, 1, CHANCE[npc.getNpcId() - 21508][1]); } return null; }
@Override public void runImpl() throws Exception { for (NpcInstance npc : GameObjectsStorage.getAllNpcs()) { if (npc != null && npc.getNpcId() == 18913 && getDistance(npc) <= 1200) { ((FurnfaceInstance) npc).setActive2114001(i_ai9); } } PC_TURN = ThreadPoolManager.getInstance().schedule(new PC_TURN(), interval_time * 1000); }
@Override public void runImpl() throws Exception { NpcInstance npc1 = GameObjectsStorage.getAsNpc(_storedId); Functions.npcShout(npc1, NpcString.FURNFACE4); for (NpcInstance npc : GameObjectsStorage.getAllNpcs()) { if (npc != null && npc.getNpcId() == 18913 && getDistance(npc) <= 1200) { ((FurnfaceInstance) npc).setSCE_GAME_PLAYER_START(); } } i_ai0 = 1; }
@Override public String onKill(NpcInstance npc, QuestState qs) { if (qs.getState() != STARTED) return null; Integer chance = Medal_Chances.get(npc.getNpcId()); if (chance != null && Rnd.chance(chance * Config.RATE_QUESTS_REWARD)) { qs.giveItems(Warehouse_Keepers_Medal, 1); qs.playSound( qs.getQuestItemsCount(Warehouse_Keepers_Medal) == 10 ? SOUND_MIDDLE : SOUND_ITEMGET); } return null; }
@Override public String onTalk(NpcInstance npc, QuestState st) { String htmltext = "noquest"; int cond = st.getCond(); int npcId = npc.getNpcId(); if (npcId == Sophia) switch (cond) { case 1: htmltext = "sophia_q464_01.htm"; break; case 2: htmltext = "sophia_q464_05a.htm"; break; case 3: htmltext = "sophia_q464_05b.htm"; break; case 4: htmltext = "sophia_q464_05c.htm"; break; case 5: htmltext = "sophia_q464_05d.htm"; break; case 6: htmltext = "sophia_q464_05e.htm"; break; case 7: htmltext = "sophia_q464_05f.htm"; break; case 8: htmltext = "sophia_q464_05g.htm"; break; case 9: htmltext = "sophia_q464_05h.htm"; break; } else if (npcId == Seresin) { if (cond == 2) htmltext = "seresin_q464_01.htm"; } else if (npcId == Holly) { if (cond == 3) htmltext = "holly_q464_01.htm"; } else if (npcId == Flauen) { if (cond == 4) htmltext = "flauen_q464_01.htm"; } else if (npcId == Dominic) { if (cond == 5) htmltext = "dominic_q464_01.htm"; } else if (npcId == Chichirin) { if (cond == 6) htmltext = "chichirin_q464_01.htm"; } else if (npcId == Tobias) { if (cond == 7) htmltext = "tobias_q464_01.htm"; } else if (npcId == Blacksmith) { if (cond == 8) htmltext = "blacksmith_q464_01.htm"; } else if (npcId == Agnes) if (cond == 9) htmltext = "agnes_q464_01.htm"; return htmltext; }
@Override public String onKill(NpcInstance npc, QuestState st) { int npcId = npc.getNpcId(); int cond = st.getCond(); for (int i = 0; i < DROPLIST_COND.length; i++) { if (cond == DROPLIST_COND[i][0] && npcId == DROPLIST_COND[i][2]) { if (DROPLIST_COND[i][3] == 0 || st.getQuestItemsCount(DROPLIST_COND[i][3]) > 0) { if (DROPLIST_COND[i][5] == 0) { st.rollAndGive(DROPLIST_COND[i][4], DROPLIST_COND[i][7], DROPLIST_COND[i][6]); } else if (st.rollAndGive( DROPLIST_COND[i][4], DROPLIST_COND[i][7], DROPLIST_COND[i][7], DROPLIST_COND[i][5], DROPLIST_COND[i][6])) { if (DROPLIST_COND[i][1] != cond && DROPLIST_COND[i][1] != 0) { st.setCond(Integer.valueOf(DROPLIST_COND[i][1])); st.setState(STARTED); } } } } } if (cond == 3 && st.getQuestItemsCount(LeatherPouchFull1st) == 0) { st.takeItems(KashaBearClaw, -1); st.takeItems(LeatherPouch1st, -1); st.giveItems(LeatherPouchFull1st, 1); } else if (cond == 5 && st.getQuestItemsCount(LeatherPouchFull2st) == 0) { st.takeItems(KashaBladeSpiderTalon, -1); st.takeItems(LeatherPouch2st, -1); st.giveItems(LeatherPouchFull2st, 1); } else if (cond == 7 && st.getQuestItemsCount(LeatherPouchFull3st) == 0) { st.takeItems(ScarletSalamanderScale, -1); st.takeItems(LeatherPouch3st, -1); st.giveItems(LeatherPouchFull3st, 1); } else if (cond == 11 && st.getQuestItemsCount(RatmanFang) >= 3 && st.getQuestItemsCount(LangkLizardmanTooth) >= 3 && st.getQuestItemsCount(FelimLizardmanTooth) >= 3 && st.getQuestItemsCount(VukuOrcTusk) >= 3) { st.takeItems(VukuOrcTusk, -1); st.takeItems(RatmanFang, -1); st.takeItems(LangkLizardmanTooth, -1); st.takeItems(FelimLizardmanTooth, -1); st.takeItems(LeatherPouch4st, -1); st.giveItems(LeatherPouchFull4st, 1); st.setCond(12); st.setState(STARTED); } return null; }
/* * благодаря ai.Quest421FairyTree вызовется только при атаке от L2PetInstance */ @Override public String onAttack(NpcInstance npc, QuestState st) { if (st.getState() != STARTED || st.getCond() != 2 || !HatchlingSummoned(st, true) || st.getQuestItemsCount(Fairy_Leaf) == 0) return null; String npcID = String.valueOf(npc.getNpcId()); Integer attaked_times = st.getInt(npcID); if (CheckTree(st, npc.getNpcId())) return null; if (attaked_times > Min_Fairy_Tree_Attaks) { st.set(npcID, "1000000"); Functions.npcSay(npc, "Give me the leaf!"); st.takeItems(Fairy_Leaf, 1); if (CheckTree(st, Fairy_Tree_of_Wind) && CheckTree(st, Fairy_Tree_of_Star) && CheckTree(st, Fairy_Tree_of_Twilight) && CheckTree(st, Fairy_Tree_of_Abyss)) { st.setCond(3); st.playSound(SOUND_MIDDLE); } else st.playSound(SOUND_ITEMGET); } else st.set(npcID, String.valueOf(attaked_times + 1)); return null; }
@Override public String onTalk(NpcInstance npc, QuestState st) { String htmltext = "noquest"; int npcId = npc.getNpcId(); int cond = st.getCond(); if (npcId == 31517) { if (cond == 0) if (st.getPlayer().getLevel() >= 61) htmltext = "dark_presbyter_q0017_01.htm"; else { htmltext = "dark_presbyter_q0017_03.htm"; st.exitCurrentQuest(true); } else if (cond > 0 && cond < 5 && st.getQuestItemsCount(7168) > 0) htmltext = "dark_presbyter_q0017_05.htm"; else if (cond > 0 && cond < 5 && st.getQuestItemsCount(7168) == 0) { htmltext = "dark_presbyter_q0017_06.htm"; st.setCond(0); st.exitCurrentQuest(false); } else if (cond == 5 && st.getQuestItemsCount(7168) == 0) { htmltext = "dark_presbyter_q0017_07.htm"; st.addExpAndSp(697040, 54887); st.playSound(SOUND_FINISH); st.exitCurrentQuest(false); } } else if (npcId == 31508) { if (cond == 1) if (st.getQuestItemsCount(7168) != 0) htmltext = "blessed_altar1_q0017_01.htm"; else htmltext = "blessed_altar1_q0017_03.htm"; else if (cond == 2) htmltext = "blessed_altar1_q0017_05.htm"; } else if (npcId == 31509) { if (cond == 2) if (st.getQuestItemsCount(7168) != 0) htmltext = "blessed_altar2_q0017_01.htm"; else htmltext = "blessed_altar2_q0017_03.htm"; else if (cond == 3) htmltext = "blessed_altar2_q0017_05.htm"; } else if (npcId == 31510) { if (cond == 3) if (st.getQuestItemsCount(7168) != 0) htmltext = "blessed_altar3_q0017_01.htm"; else htmltext = "blessed_altar3_q0017_03.htm"; else if (cond == 4) htmltext = "blessed_altar3_q0017_05.htm"; } else if (npcId == 31511) if (cond == 4) if (st.getQuestItemsCount(7168) != 0) htmltext = "blessed_altar4_q0017_01.htm"; else htmltext = "blessed_altar4_q0017_03.htm"; else if (cond == 5) htmltext = "blessed_altar4_q0017_05.htm"; return htmltext; }
@Override public String onTalk(NpcInstance npc, QuestState st) { int npcId = npc.getNpcId(); String htmltext = "noquest"; int id = st.getState(); if (id == CREATED) { if (st.getPlayer().getRace() != Race.human || st.getQuestItemsCount(MARK_OF_TRAVELER_ID) == 0) { htmltext = "galladuchi_q0045_0102.htm"; st.exitCurrentQuest(true); } else if (st.getPlayer().getLevel() < 3) { htmltext = "galladuchi_q0045_0103.htm"; st.exitCurrentQuest(true); } else { htmltext = "galladuchi_q0045_0101.htm"; } } else if (npcId == 30097 && st.getCond() == 1) { htmltext = "galladuchi_q0045_0105.htm"; } else if (npcId == 30097 && st.getCond() == 2) { htmltext = "galladuchi_q0045_0201.htm"; } else if (npcId == 30097 && st.getCond() == 3) { htmltext = "galladuchi_q0045_0303.htm"; } else if (npcId == 30097 && st.getCond() == 4) { htmltext = "galladuchi_q0045_0401.htm"; } else if (npcId == 30097 && st.getCond() == 5) { htmltext = "galladuchi_q0045_0503.htm"; } else if (npcId == 30097 && st.getCond() == 6) { htmltext = "galladuchi_q0045_0601.htm"; } else if (npcId == 30094 && st.getCond() == 1) { htmltext = "gentler_q0045_0101.htm"; } else if (npcId == 30094 && st.getCond() == 2) { htmltext = "gentler_q0045_0203.htm"; } else if (npcId == 30090 && st.getCond() == 3) { htmltext = "sandra_q0045_0301.htm"; } else if (npcId == 30090 && st.getCond() == 4) { htmltext = "sandra_q0045_0403.htm"; } else if (npcId == 30116 && st.getCond() == 5) { htmltext = "dustin_q0045_0501.htm"; } else if (npcId == 30116 && st.getCond() == 6) { htmltext = "dustin_q0045_0603.htm"; } return htmltext; }
@Override public String onKill(NpcInstance npc, QuestState st) { int npcId = npc.getNpcId(); int cond = st.getCond(); if (npcId == LIZARDMAN_WARRIOR | npcId == LIZARDMAN_SCOUT | npcId == LIZARDMAN) { if (cond == 2 && st.getQuestItemsCount(LIZARD_CAPTAIN_ORDER_ID) < 1) { st.giveItems(LIZARD_CAPTAIN_ORDER_ID, 1); st.playSound(SOUND_MIDDLE); st.setCond(3); } } else if (npcId == TAMIL) { if (cond == 4 && st.getQuestItemsCount(TAMATOS_NECKLACE_ID) < 1) { st.giveItems(TAMATOS_NECKLACE_ID, 1); st.playSound(SOUND_MIDDLE); st.setCond(5); } } return null; }
@Override public String onKill(NpcInstance npc, QuestState st) { int npcId = npc.getNpcId(); MonsterInstance mob = (MonsterInstance) npc; boolean cond = st.getCond() > 0; if (npcId == HunterBear) { if (cond && st.getQuestItemsCount(BEAR_PIC) == 1 && st.getQuestItemsCount(HONEY_JAR) < 5 && Rnd.chance(20)) { st.addSpawn(HoneyBear); } } else if (npcId == HoneyBear) { if (cond && st.getQuestItemsCount(BEAR_PIC) == 1 && st.getQuestItemsCount(HONEY_JAR) < 5) { if (mob.isSpoiled()) { st.giveItems(HONEY_JAR, 1); if (st.getQuestItemsCount(HONEY_JAR) == 5) { st.playSound(SOUND_MIDDLE); st.setCond(6); } else { st.playSound(SOUND_ITEMGET); } } } } else if (npcId == HunterTarantula || npcId == PlunderTarantula) { if (cond && st.getQuestItemsCount(TARANTULA_PIC) == 1 && st.getQuestItemsCount(BEAD) < 20) { if (mob.isSpoiled()) { if (Rnd.chance(50)) { st.giveItems(BEAD, 1); if (st.getQuestItemsCount(BEAD) == 20) { st.playSound(SOUND_MIDDLE); st.setCond(8); } else { st.playSound(SOUND_ITEMGET); } } } } } return null; }
@Override public String onTalk(NpcInstance npc, QuestState st) { int npcId = npc.getNpcId(); String htmltext = "noquest"; int cond = st.getCond(); if (npcId == MOIRA) { if (cond == 0) { if (st.getPlayer().getLevel() >= 20) { htmltext = "seer_moirase_q0122_0101.htm"; } else { htmltext = "seer_moirase_q0122_0103.htm"; st.exitCurrentQuest(true); } } else { htmltext = "seer_moirase_q0122_0104.htm"; } } else if (npcId == KARUDA && cond == 1) { htmltext = "karuda_q0122_0101.htm"; } return htmltext; }
@Override public String onTalk(NpcInstance npc, QuestState st) { String htmltext = "noquest"; int npcId = npc.getNpcId(); int cond = st.getCond(); if (npcId == CADMON) { if (cond == 0) { if (st.getPlayer().getLevel() >= 74) htmltext = "guard_cadmon_q0012_0101.htm"; else { htmltext = "guard_cadmon_q0012_0103.htm"; st.exitCurrentQuest(true); } } else if (cond == 1) htmltext = "guard_cadmon_q0012_0105.htm"; } else if (npcId == HELMUT) { if (cond == 1) htmltext = "trader_helmut_q0012_0101.htm"; else if (cond == 2) htmltext = "trader_helmut_q0012_0202.htm"; } else if (npcId == NARAN_ASHANUK) if (cond == 2 && st.getQuestItemsCount(MUNITIONS_BOX) > 0) htmltext = "herald_naran_q0012_0201.htm"; return htmltext; }
@Override public String onTalk(NpcInstance npc, QuestState st) { int _state = st.getState(); int npcId = npc.getNpcId(); if (_state == CREATED) { if (npcId != Cliff) return "noquest"; if (st.getPlayer().getLevel() < 40) { st.exitCurrentQuest(true); return "30182-04.htm"; } st.setCond(0); return "30182-01.htm"; } if (_state != STARTED) return "noquest"; long medals = st.getQuestItemsCount(Warehouse_Keepers_Medal); if (medals >= 100) return String.valueOf(npcId) + "-06.htm"; if (medals >= 10) return String.valueOf(npcId) + "-06a.htm"; return String.valueOf(npcId) + "-06b.htm"; }
@Override public String onTalk(NpcInstance npc, QuestState st) { String htmltext = "noquest"; int npcId = npc.getNpcId(); int cond = st.getCond(); if (npcId == MANUEL) { if (cond < 1) { htmltext = "father_manuell_q0409_01.htm"; } else if (st.getQuestItemsCount(CRYSTAL_MEDALLION_ID) > 0) { if (st.getQuestItemsCount(MONEY_OF_SWINDLER_ID) < 1 && st.getQuestItemsCount(DAIRY_OF_ALLANA_ID) < 1 && st.getQuestItemsCount(LIZARD_CAPTAIN_ORDER_ID) < 1 && st.getQuestItemsCount(HALF_OF_DAIRY_ID) < 1) { htmltext = "father_manuell_q0409_09.htm"; } else if (st.getQuestItemsCount(MONEY_OF_SWINDLER_ID) > 0 && st.getQuestItemsCount(DAIRY_OF_ALLANA_ID) > 0 && st.getQuestItemsCount(LIZARD_CAPTAIN_ORDER_ID) > 0 && st.getQuestItemsCount(HALF_OF_DAIRY_ID) < 1) { htmltext = "father_manuell_q0409_08.htm"; st.takeItems(MONEY_OF_SWINDLER_ID, 1); st.takeItems(DAIRY_OF_ALLANA_ID, -1); st.takeItems(LIZARD_CAPTAIN_ORDER_ID, -1); st.takeItems(CRYSTAL_MEDALLION_ID, -1); if (st.getPlayer().getClassId().getLevel() == 1) { st.giveItems(LEAF_OF_ORACLE_ID, 1); if (!st.getPlayer().getVarB("prof1")) { st.getPlayer().setVar("prof1", "1", -1); st.addExpAndSp(228064, 16455); // FIXME [G1ta0] дать адены, только если первый чар на акке st.giveItems(ADENA_ID, 163800); } } st.playSound(SOUND_FINISH); st.exitCurrentQuest(true); } else { htmltext = "father_manuell_q0409_07.htm"; } } } else if (npcId == ALLANA) { if (st.getQuestItemsCount(CRYSTAL_MEDALLION_ID) > 0) { if (st.getQuestItemsCount(MONEY_OF_SWINDLER_ID) < 1 && st.getQuestItemsCount(DAIRY_OF_ALLANA_ID) < 1 && st.getQuestItemsCount(LIZARD_CAPTAIN_ORDER_ID) < 1 && st.getQuestItemsCount(HALF_OF_DAIRY_ID) < 1) { if (cond > 2) { htmltext = "allana_q0409_05.htm"; } else { htmltext = "allana_q0409_01.htm"; } } else if (st.getQuestItemsCount(MONEY_OF_SWINDLER_ID) < 1 && st.getQuestItemsCount(DAIRY_OF_ALLANA_ID) < 1 && st.getQuestItemsCount(LIZARD_CAPTAIN_ORDER_ID) > 0 && st.getQuestItemsCount(HALF_OF_DAIRY_ID) < 1) { htmltext = "allana_q0409_02.htm"; st.giveItems(HALF_OF_DAIRY_ID, 1); st.setCond(4); } else if (st.getQuestItemsCount(MONEY_OF_SWINDLER_ID) < 1 && st.getQuestItemsCount(DAIRY_OF_ALLANA_ID) < 1 && st.getQuestItemsCount(LIZARD_CAPTAIN_ORDER_ID) > 0 && st.getQuestItemsCount(HALF_OF_DAIRY_ID) > 0) { if (st.getQuestItemsCount(TAMATOS_NECKLACE_ID) < 1) { htmltext = "allana_q0409_06.htm"; } else { htmltext = "allana_q0409_03.htm"; } } else if (st.getQuestItemsCount(MONEY_OF_SWINDLER_ID) > 0 && st.getQuestItemsCount(DAIRY_OF_ALLANA_ID) < 1 && st.getQuestItemsCount(LIZARD_CAPTAIN_ORDER_ID) > 0 && st.getQuestItemsCount(HALF_OF_DAIRY_ID) > 0) { htmltext = "allana_q0409_04.htm"; st.takeItems(HALF_OF_DAIRY_ID, -1); st.giveItems(DAIRY_OF_ALLANA_ID, 1); st.setCond(7); } else if (st.getQuestItemsCount(MONEY_OF_SWINDLER_ID) > 0 && st.getQuestItemsCount(LIZARD_CAPTAIN_ORDER_ID) > 0 && st.getQuestItemsCount(HALF_OF_DAIRY_ID) < 1 && st.getQuestItemsCount(DAIRY_OF_ALLANA_ID) > 0) { htmltext = "allana_q0409_05.htm"; } } } else if (npcId == PERRIN) { if (st.getQuestItemsCount(CRYSTAL_MEDALLION_ID) > 0 && st.getQuestItemsCount(LIZARD_CAPTAIN_ORDER_ID) > 0) { if (st.getQuestItemsCount(TAMATOS_NECKLACE_ID) > 0) { htmltext = "perrin_q0409_04.htm"; st.takeItems(TAMATOS_NECKLACE_ID, -1); st.giveItems(MONEY_OF_SWINDLER_ID, 1); st.setCond(6); } else if (st.getQuestItemsCount(MONEY_OF_SWINDLER_ID) > 0) { htmltext = "perrin_q0409_05.htm"; } else if (cond > 4) { htmltext = "perrin_q0409_06.htm"; } else { htmltext = "perrin_q0409_01.htm"; } } } return htmltext; }
@Override public String onTalk(NpcInstance npc, QuestState st) { int npcId = npc.getNpcId(); String htmltext = "noquest"; int cond = st.getCond(); if (npcId == Pupina) { if (st.getQuestItemsCount(MarkOfReformer) != 0) { htmltext = "completed"; st.exitCurrentQuest(true); } else if (cond == 0) { if (st.getPlayer().getClassId().getId() == 0x0f || st.getPlayer().getClassId().getId() == 0x2a) { if (st.getPlayer().getLevel() >= 39) { htmltext = "30118-03.htm"; } else { htmltext = "30118-01.htm"; st.exitCurrentQuest(true); } } else { htmltext = "30118-02.htm"; st.exitCurrentQuest(true); } } else if (cond == 3) { htmltext = "30118-05.htm"; } else if (cond >= 4) { htmltext = "30118-07.htm"; } } else if (npcId == Sla) { if (cond == 4) { htmltext = "30666-01.htm"; } else if (cond == 5) { htmltext = "30666-05.htm"; } else if (cond == 10) { st.takeItems(OlMahumMoney, -1); st.giveItems(Greetings, 3); htmltext = "30666-06.htm"; st.setCond(11); st.setState(STARTED); } else if (cond == 20) { st.takeItems(KatarisLetter, -1); st.takeItems(KakansLetter, -1); st.takeItems(NyakurisLetter, -1); st.takeItems(RamussLetter, -1); st.giveItems(MarkOfReformer, 1); if (!st.getPlayer().getVarB("prof2.3")) { st.addExpAndSp(1252844, 85972); st.giveItems(ADENA_ID, 226528); st.getPlayer().setVar("prof2.3", "1", -1); } htmltext = "30666-07.htm"; st.playSound(SOUND_FINISH); st.exitCurrentQuest(true); } } else if (npcId == Katari) { if (cond == 5 || cond == 6) { NpcInstance NPC = GameObjectsStorage.getByNpcId(OlMahumPilgrimNPC); NpcInstance Mob = GameObjectsStorage.getByNpcId(OlMahumInspector); if (NPC == null && Mob == null) { st.takeItems(SlasLetter, -1); htmltext = "30668-01.htm"; st.setCond(6); st.setState(STARTED); st.addSpawn(OlMahumPilgrimNPC); st.addSpawn(OlMahumInspector); st.startQuestTimer("Wait2", 300000); } else { if (!st.isRunningQuestTimer("Wait2")) { st.startQuestTimer("Wait2", 300000); } htmltext = "<html><head><body>Please wait 5 minutes</body></html>"; } } else if (cond == 8) { if (GameObjectsStorage.getByNpcId(OlMahumBetrayer) == null) { htmltext = "30668-02.htm"; st.addSpawn(OlMahumBetrayer); st.startQuestTimer("Wait3", 300000); } else { if (!st.isRunningQuestTimer("Wait3")) { st.startQuestTimer("Wait3", 300000); } htmltext = "<html><head><body>Please wait 5 minutes</body></html>"; } } else if (cond == 9) { st.takeItems(LetterOfBetrayer, -1); st.giveItems(KatarisLetter, 1); htmltext = "30668-03.htm"; st.setCond(10); st.setState(STARTED); } } else if (npcId == OlMahumPilgrimNPC) { if (cond == 7) { st.giveItems(OlMahumMoney, 1); htmltext = "30732-01.htm"; st.setCond(8); st.setState(STARTED); NpcInstance isQuest = GameObjectsStorage.getByNpcId(OlMahumInspector); if (isQuest != null) { isQuest.deleteMe(); } isQuest = GameObjectsStorage.getByNpcId(OlMahumPilgrimNPC); if (isQuest != null) { isQuest.deleteMe(); } st.cancelQuestTimer("Wait2"); } } else if (npcId == Kakan) { if (cond == 11 || cond == 12) { htmltext = "30669-01.htm"; } else if (cond == 13) { st.takeItems(Greetings, 1); st.giveItems(KakansLetter, 1); htmltext = "30669-04.htm"; st.setCond(14); st.setState(STARTED); } } else if (npcId == Nyakuri) { if (cond == 14 || cond == 15) { htmltext = "30670-01.htm"; } else if (cond == 16) { st.takeItems(Greetings, 1); st.giveItems(NyakurisLetter, 1); htmltext = "30670-04.htm"; st.setCond(17); st.setState(STARTED); } } else if (npcId == Ramus) { if (cond == 17) { st.takeItems(Greetings, -1); st.giveItems(UndeadList, 1); htmltext = "30667-01.htm"; st.setCond(18); st.setState(STARTED); } else if (cond == 19) { st.takeItems(BoneFragment1, -1); st.takeItems(BoneFragment2, -1); st.takeItems(BoneFragment3, -1); st.takeItems(BoneFragment4, -1); st.takeItems(BoneFragment5, -1); st.takeItems(UndeadList, -1); st.giveItems(RamussLetter, 1); htmltext = "30667-03.htm"; st.setCond(20); st.setState(STARTED); } } return htmltext; }
@Override public String onKill(NpcInstance npc, QuestState st) { int npcId = npc.getNpcId(); int cond = st.getCond(); for (int i = 0; i < DROPLIST_COND.length; i++) { if (cond == DROPLIST_COND[i][0] && npcId == DROPLIST_COND[i][2]) { if (DROPLIST_COND[i][3] == 0 || st.getQuestItemsCount(DROPLIST_COND[i][3]) > 0) { if (DROPLIST_COND[i][5] == 0) { st.rollAndGive(DROPLIST_COND[i][4], DROPLIST_COND[i][7], DROPLIST_COND[i][6]); } else if (st.rollAndGive( DROPLIST_COND[i][4], DROPLIST_COND[i][7], DROPLIST_COND[i][7], DROPLIST_COND[i][5], DROPLIST_COND[i][6])) { if (DROPLIST_COND[i][1] != cond && DROPLIST_COND[i][1] != 0) { st.setCond(Integer.valueOf(DROPLIST_COND[i][1])); st.setState(STARTED); } } } } } if (cond == 18 && st.getQuestItemsCount(BoneFragment1) != 0 && st.getQuestItemsCount(BoneFragment2) != 0 && st.getQuestItemsCount(BoneFragment3) != 0 && st.getQuestItemsCount(BoneFragment4) != 0 && st.getQuestItemsCount(BoneFragment5) != 0) { st.setCond(19); st.setState(STARTED); } else if (npcId == NamelessRevenant && (cond == 1 || cond == 2)) { if (st.getQuestItemsCount(RippedDiary) < 6) { st.giveItems(RippedDiary, 1); } else if (GameObjectsStorage.getByNpcId(Aruraune) == null) { st.takeItems(RippedDiary, -1); st.setCond(2); st.setState(STARTED); st.addSpawn(Aruraune); st.startQuestTimer("Wait1", 300000); } else if (!st.isRunningQuestTimer("Wait1")) { st.startQuestTimer("Wait1", 300000); } } else if (npcId == Aruraune) { NpcInstance isQuest = GameObjectsStorage.getByNpcId(Aruraune); if (isQuest != null) { isQuest.deleteMe(); } if (cond == 2) { if (st.getQuestItemsCount(HugeNail) == 0) { st.giveItems(HugeNail, 1); } st.setCond(3); st.setState(STARTED); st.cancelQuestTimer("Wait1"); } } else if (npcId == OlMahumInspector) { NpcInstance isQuest = GameObjectsStorage.getByNpcId(OlMahumInspector); if (isQuest != null) { isQuest.deleteMe(); } st.cancelQuestTimer("Wait2"); if (cond == 6) { st.setCond(7); st.setState(STARTED); } } else if (npcId == OlMahumBetrayer) { NpcInstance isQuest = GameObjectsStorage.getByNpcId(OlMahumBetrayer); if (isQuest != null) { isQuest.deleteMe(); } st.cancelQuestTimer("Wait3"); if (cond == 8) { if (st.getQuestItemsCount(LetterOfBetrayer) == 0) { st.giveItems(LetterOfBetrayer, 1); } st.setCond(9); st.setState(STARTED); } } else if (npcId == CrimsonWerewolf) { NpcInstance isQuest = GameObjectsStorage.getByNpcId(CrimsonWerewolf); if (isQuest != null) { isQuest.deleteMe(); } st.cancelQuestTimer("Wait4"); if (cond == 12) { st.setCond(13); st.setState(STARTED); } } else if (npcId == KrudelLizardman) { NpcInstance isQuest = GameObjectsStorage.getByNpcId(KrudelLizardman); if (isQuest != null) { isQuest.deleteMe(); } st.cancelQuestTimer("Wait5"); if (cond == 15) { st.setCond(16); st.setState(STARTED); } } return null; }
@Override public String onTalk(NpcInstance npc, QuestState st) { int _state = st.getState(); int npcId = npc.getNpcId(); int cond = st.getCond(); ItemInstance dragonflute = GetDragonflute(st); int dragonflute_id = st.getInt("dragonflute"); if (_state == CREATED) { if (npcId != Cronos) return "noquest"; if (st.getPlayer().getLevel() < 45) { st.exitCurrentQuest(true); return "30610_01.htm"; } if (dragonflute == null) { st.exitCurrentQuest(true); return "30610_02.htm"; } if (dragonflute.getEnchantLevel() < 55) { st.exitCurrentQuest(true); return "30610_03.htm"; } st.setCond(0); st.set("dragonflute", String.valueOf(dragonflute.getObjectId())); return "30610_04.htm"; } if (_state != STARTED) return "noquest"; if (npcId == Cronos) { if (dragonflute == null) return "30610_02.htm"; return dragonflute.getObjectId() == dragonflute_id ? "30610_07.htm" : "30610_06.htm"; } if (npcId == Mimyu) { if (st.getQuestItemsCount(Dragon_Bugle_of_Wind) + st.getQuestItemsCount(Dragon_Bugle_of_Star) + st.getQuestItemsCount(Dragon_Bugle_of_Twilight) > 0) return "30747_00b.htm"; if (dragonflute == null) return "noquest"; if (cond == 1) return "30747_01.htm"; if (cond == 2) { if (!HatchlingSummoned(st, false)) return "30747_09.htm"; if (st.getQuestItemsCount(Fairy_Leaf) == 0) { st.playSound(SOUND_FINISH); st.exitCurrentQuest(true); return "30747_11.htm"; } return "30747_10.htm"; } if (cond == 3) { if (dragonflute.getObjectId() != dragonflute_id) return "30747_00a.htm"; if (st.getQuestItemsCount(Fairy_Leaf) > 0) { st.playSound(SOUND_FINISH); st.exitCurrentQuest(true); return "30747_11.htm"; } if (!(CheckTree(st, Fairy_Tree_of_Wind) && CheckTree(st, Fairy_Tree_of_Star) && CheckTree(st, Fairy_Tree_of_Twilight) && CheckTree(st, Fairy_Tree_of_Abyss))) { st.playSound(SOUND_FINISH); st.exitCurrentQuest(true); return "30747_11.htm"; } if (st.getInt("welldone") == 0) { if (!HatchlingSummoned(st, false)) return "30747_09.htm"; st.set("welldone", "1"); return "30747_12.htm"; } if (HatchlingSummoned(st, false) || st.getPlayer().getSummonList().getPet() != null) return "30747_13a.htm"; dragonflute.setItemId(Dragon_Bugle_of_Wind + dragonflute.getItemId() - Dragonflute_of_Wind); dragonflute.setJdbcState(JdbcEntityState.UPDATED); dragonflute.update(); st.getPlayer().sendPacket(new InventoryUpdate().addModifiedItem(dragonflute)); st.playSound(SOUND_FINISH); st.exitCurrentQuest(true); return "30747_13.htm"; } } return "noquest"; }
public void setSCE_POT_ON(int i) { if (i == i_ai1 && i_ai0 == 1) { if (i_quest9 == 1) {} i_ai0 = 2; } else if (i == i_ai2 && i_ai0 == 2) { if (i_quest9 == 1) {} i_ai0 = 3; } else if (i == i_ai3 && i_ai0 == 3) { if (i_quest9 == 1) {} i_ai0 = 4; } else if (i == i_ai4 && i_ai0 == 4) { if (i_quest9 == 1) {} i_ai0 = 5; } else if (i == i_ai5 && i_ai0 == 5) { if (i_quest9 == 1) {} i_ai0 = 6; } else if (i == i_ai6 && i_ai0 == 6) { if (i_quest9 == 1) {} i_ai0 = 7; } else if (i == i_ai7 && i_ai0 == 7) { if (i_quest9 == 1) {} i_ai0 = 8; } else if (i == i_ai8 && i_ai0 == 8) { if (i_quest9 == 1) {} i_ai0 = 9; } else if (i == i_ai9 && i_ai0 == 9) { if (i_quest9 == 1) {} for (NpcInstance npc : GameObjectsStorage.getAllNpcs()) { if (npc != null && npc.getNpcId() == 18913 && getDistance(npc) <= 1200) { ((FurnfaceInstance) npc).setSCE_GAME_END(); } } SimpleSpawner sp = new SimpleSpawner(NpcHolder.getInstance().getTemplate(18934)); switch (getAISpawnParam()) { case 1: sp.setLoc(new Location(110772, -82063, -1584)); break; case 2: sp.setLoc(new Location(114915, -70998, -544)); break; } sp.doSpawn(true); Functions.npcShout(this, NpcString.FURNFACE6); switch (getAISpawnParam()) { case 1: if (HURRY_UP_1 != null) { HURRY_UP_1.cancel(false); HURRY_UP_1 = null; } if (HURRY_UP2_1 != null) { HURRY_UP2_1.cancel(false); HURRY_UP2_1 = null; } break; case 2: if (HURRY_UP_2 != null) { HURRY_UP_2.cancel(false); HURRY_UP_2 = null; } if (HURRY_UP2_2 != null) { HURRY_UP2_2.cancel(false); HURRY_UP2_2 = null; } break; } c_ai0 = null; i_quest0 = 0; i_quest1 = 0; } else { for (NpcInstance npc : GameObjectsStorage.getAllNpcs()) { if (npc != null && npc.getNpcId() == 18913 && getDistance(npc) <= 1200) { ((FurnfaceInstance) npc).setSCE_GAME_FAILURE(); } } if (i_quest9 == 1) { } else if (i_quest0 < 2) { i_quest0 = i_quest0 + 1; Functions.npcShout(this, NpcString.FURNFACE7); i_quest1 = 0; } else { switch (getAISpawnParam()) { case 1: if (HURRY_UP_1 != null) { HURRY_UP_1.cancel(false); HURRY_UP_1 = null; } if (HURRY_UP2_1 != null) { HURRY_UP2_1.cancel(false); HURRY_UP2_1 = null; } break; case 2: if (HURRY_UP_2 != null) { HURRY_UP_2.cancel(false); HURRY_UP_2 = null; } if (HURRY_UP2_2 != null) { HURRY_UP2_2.cancel(false); HURRY_UP2_2 = null; } break; } Functions.npcShout(this, NpcString.FURNFACE8); c_ai0 = null; i_quest0 = 0; i_quest1 = 0; } } }
@Override public String onTalk(NpcInstance npc, QuestState st) { String htmltext = "noquest"; int npcId = npc.getNpcId(); int id = st.getState(); int cond = st.getCond(); Castle castle = ResidenceHolder.getInstance().getResidence(ShuttgartCastle); if (castle.getOwner() == null) { return "Castle has no lord"; } Player castleOwner = castle.getOwner().getLeader().getPlayer(); if (npcId == August) { if (cond == 0) { if (castleOwner == st.getPlayer()) { if (castle.getDominion().getLordObjectId() != st.getPlayer().getObjectId()) { htmltext = "august_q714_01.htm"; } else { htmltext = "august_q714_00.htm"; st.exitCurrentQuest(true); } } else { htmltext = "august_q714_00a.htm"; st.exitCurrentQuest(true); } } else if (cond == 1) { htmltext = "august_q714_04.htm"; } else if (cond == 2) { htmltext = "august_q714_06.htm"; } else if (cond == 7) { htmltext = "august_q714_07.htm"; } } else if (npcId == Newyear) { if (cond == 2) { htmltext = "newyear_q714_01.htm"; } else if (cond == 3) { QuestState q1 = st.getPlayer().getQuestState(_114_ResurrectionOfAnOldManager.class); QuestState q2 = st.getPlayer().getQuestState(_120_PavelsResearch.class); QuestState q3 = st.getPlayer().getQuestState(_121_PavelTheGiants.class); if (q3 != null && q3.isCompleted()) { if (q1 != null && q1.isCompleted()) { if (q2 != null && q2.isCompleted()) { st.setCond(4); htmltext = "newyear_q714_04.htm"; } else { htmltext = "newyear_q714_04a.htm"; } } else { htmltext = "newyear_q714_04b.htm"; } } else { htmltext = "newyear_q714_04c.htm"; } } } else if (npcId == Yasheni) { if (cond == 4) { htmltext = "yasheni_q714_01.htm"; } else if (cond == 5) { htmltext = "yasheni_q714_03.htm"; } else if (cond == 6) { st.takeAllItems(GolemShard); st.setCond(7); htmltext = "yasheni_q714_04.htm"; } } return htmltext; }
@Override public String onEvent(String event, QuestState st, NpcInstance npc) { String htmltext = event; if (event.equalsIgnoreCase("bookowner")) { switch (Rnd.get(2, 8)) { case 2: st.setCond(2); htmltext = "sophia_q464_04a.htm"; break; case 3: st.setCond(3); htmltext = "sophia_q464_04b.htm"; break; case 4: st.setCond(4); htmltext = "sophia_q464_04c.htm"; break; case 5: st.setCond(5); htmltext = "sophia_q464_04d.htm"; break; case 6: st.setCond(6); htmltext = "sophia_q464_04e.htm"; break; case 7: st.setCond(7); htmltext = "sophia_q464_04f.htm"; break; case 8: st.setCond(8); htmltext = "sophia_q464_04g.htm"; break; case 9: st.setCond(9); htmltext = "sophia_q464_04h.htm"; break; } st.takeAllItems(BookofSilence1); st.giveItems(BookofSilence2, 1); } else if (event.equalsIgnoreCase("request_reward")) { switch (npc.getNpcId()) { case Seresin: htmltext = "seresin_q464_02.htm"; break; case Holly: htmltext = "holly_q464_02.htm"; break; case Flauen: htmltext = "flauen_q464_02.htm"; break; case Dominic: htmltext = "dominic_q464_02.htm"; break; case Chichirin: htmltext = "chichirin_q464_02.htm"; break; case Tobias: htmltext = "tobias_q464_02.htm"; break; case Blacksmith: htmltext = "blacksmith_q464_02.htm"; break; case Agnes: htmltext = "agnes_q464_02.htm"; break; } st.giveItems(ADENA_ID, Rnd.get(45000, 90000)); st.addExpAndSp(Rnd.get(15450, 1200000), Rnd.get(15000, 200000)); st.takeAllItems(BookofSilence2); st.playSound(SOUND_FINISH); st.exitCurrentQuest(true); } return htmltext; }
@Override public String onTalk(NpcInstance npc, QuestState st) { String htmltext = "noquest"; int npcId = npc.getNpcId(); int id = st.getState(); int cond = st.getCond(); if (id == CREATED) { st.setState(STARTED); } if (npcId == Pippi) { if (cond == 0) { htmltext = "collector_pipi_q0417_01.htm"; } else if (st.getQuestItemsCount(PIPIS_LETTER) > 0) { htmltext = "collector_pipi_q0417_06.htm"; } else if (st.getQuestItemsCount(PIPIS_LETTER) == 0 && id == STARTED) { htmltext = "collector_pipi_q0417_01.htm"; } else if (st.getQuestItemsCount(PIPIS_LETTER) == 0) { htmltext = "collector_pipi_q0417_07.htm"; } } else if (cond == 0) { return "noquest"; } else if (npcId == Mion) { if (st.getQuestItemsCount(PIPIS_LETTER) > 0) { htmltext = "trader_mion_q0417_01.htm"; } else if (st.getQuestItemsCount(CHARIS_AXE, BRONKS_INGOT, ZIMENFS_POTION) > 0 && st.getInt("id") / 10 == 0) { htmltext = "trader_mion_q0417_05.htm"; } else if (st.getQuestItemsCount(CHARIS_AXE, BRONKS_INGOT, ZIMENFS_POTION) > 0 && st.getInt("id") / 10 > 0) { htmltext = "trader_mion_q0417_08.htm"; } else if (st.getQuestItemsCount(CHALIS_PAY, BRONKS_PAY, ZIMENFS_PAY) > 0 && st.getInt("id") < 50) { htmltext = "trader_mion_q0417_12.htm"; } else if (st.getQuestItemsCount(CHALIS_PAY, BRONKS_PAY, ZIMENFS_PAY) > 0 && st.getInt("id") >= 50) { htmltext = "trader_mion_q0417_15.htm"; st.giveItems(MIONS_LETTER, 1); st.takeItems(CHALIS_PAY, -1); st.takeItems(ZIMENFS_PAY, -1); st.takeItems(BRONKS_PAY, -1); st.setCond(4); } else if (st.getQuestItemsCount(MIONS_LETTER) > 0) { htmltext = "trader_mion_q0417_13.htm"; } else if (st.getQuestItemsCount(BEAR_PIC) > 0 || st.getQuestItemsCount(TARANTULA_PIC) > 0 || st.getQuestItemsCount(BEAD_PARCEL) > 0 || st.getQuestItemsCount(ROUTS_TP_SCROLL) > 0 || st.getQuestItemsCount(SUCCUBUS_UNDIES) > 0) { htmltext = "trader_mion_q0417_14.htm"; } } else if (npcId == Shari) { if (st.getQuestItemsCount(CHARIS_AXE) > 0) { if (st.getInt("id") < 20) { htmltext = "trader_chali_q0417_01.htm"; } else { htmltext = "trader_chali_q0417_02.htm"; } st.takeItems(CHARIS_AXE, 1); st.giveItems(CHALIS_PAY, 1); if (st.getInt("id") >= 50) { st.setCond(3); } st.set("id", st.getInt("id") + 10); } else if (st.getQuestItemsCount(CHALIS_PAY) == 1) { htmltext = "trader_chali_q0417_03.htm"; } } else if (npcId == Bronk) { if (st.getQuestItemsCount(BRONKS_INGOT) == 1) { if (st.getInt("id") < 20) { htmltext = "head_blacksmith_bronk_q0417_01.htm"; } else { htmltext = "head_blacksmith_bronk_q0417_02.htm"; } st.takeItems(BRONKS_INGOT, 1); st.giveItems(BRONKS_PAY, 1); if (st.getInt("id") >= 50) { st.setCond(3); } st.set("id", st.getInt("id") + 10); } else if (st.getQuestItemsCount(BRONKS_PAY) == 1) { htmltext = "head_blacksmith_bronk_q0417_03.htm"; } } else if (npcId == Zimenf) { if (st.getQuestItemsCount(ZIMENFS_POTION) == 1) { if (st.getInt("id") < 20) { htmltext = "zimenf_priest_of_earth_q0417_01.htm"; } else { htmltext = "zimenf_priest_of_earth_q0417_02.htm"; } st.takeItems(ZIMENFS_POTION, 1); st.giveItems(ZIMENFS_PAY, 1); if (st.getInt("id") >= 50) { st.setCond(3); } st.set("id", st.getInt("id") + 10); } else if (st.getQuestItemsCount(ZIMENFS_PAY) == 1) { htmltext = "zimenf_priest_of_earth_q0417_03.htm"; } } else if (npcId == Toma) { if (st.getQuestItemsCount(MIONS_LETTER) == 1) { htmltext = "master_toma_q0417_01.htm"; st.takeItems(MIONS_LETTER, 1); st.giveItems(BEAR_PIC, 1); st.setCond(5); st.set("id", String.valueOf(0)); } else if (st.getQuestItemsCount(BEAR_PIC) == 1 && st.getQuestItemsCount(HONEY_JAR) < 5) { htmltext = "master_toma_q0417_02.htm"; } else if (st.getQuestItemsCount(BEAR_PIC) == 1 && st.getQuestItemsCount(HONEY_JAR) >= 5) { htmltext = "master_toma_q0417_03.htm"; st.takeItems(HONEY_JAR, st.getQuestItemsCount(HONEY_JAR)); st.takeItems(BEAR_PIC, 1); st.giveItems(TARANTULA_PIC, 1); st.setCond(7); } else if (st.getQuestItemsCount(TARANTULA_PIC) == 1 && st.getQuestItemsCount(BEAD) < 20) { htmltext = "master_toma_q0417_04.htm"; } else if (st.getQuestItemsCount(TARANTULA_PIC) == 1 && st.getQuestItemsCount(BEAD) >= 20) { htmltext = "master_toma_q0417_05.htm"; st.takeItems(BEAD, st.getQuestItemsCount(BEAD)); st.takeItems(TARANTULA_PIC, 1); st.giveItems(BEAD_PARCEL, 1); st.setCond(9); } else if (st.getQuestItemsCount(BEAD_PARCEL) > 0) { htmltext = "master_toma_q0417_06.htm"; } else if (st.getQuestItemsCount(ROUTS_TP_SCROLL) > 0 || st.getQuestItemsCount(SUCCUBUS_UNDIES) > 0) { htmltext = "master_toma_q0417_07.htm"; } } else if (npcId == Raut) { if (st.getQuestItemsCount(BEAD_PARCEL) == 1) { htmltext = "raut_q0417_01.htm"; } else if (st.getQuestItemsCount(ROUTS_TP_SCROLL) == 1) { htmltext = "raut_q0417_04.htm"; } else if (st.getQuestItemsCount(SUCCUBUS_UNDIES) == 1) { htmltext = "raut_q0417_05.htm"; st.takeItems(SUCCUBUS_UNDIES, 1); if (st.getPlayer().getClassId().getLevel() == 1) { st.giveItems(RING_OF_RAVEN, 1); if (!st.getPlayer().getVarB("prof1")) { st.getPlayer().setVar("prof1", "1", -1); st.addExpAndSp(228064, 16455); // FIXME [G1ta0] дать адены, только если первый чар на акке st.giveItems(ADENA_ID, 163800); } } st.playSound(SOUND_FINISH); st.exitCurrentQuest(false); } } else if (npcId == Torai && st.getQuestItemsCount(ROUTS_TP_SCROLL) == 1) { htmltext = "torai_q0417_01.htm"; } return htmltext; }
@Override public String onTalk(NpcInstance npc, QuestState st) { int npcId = npc.getNpcId(); String htmltext = "noquest"; int id = st.getState(); if (id == CREATED) { st.setCond(0); } if (npcId == 30307 && st.getCond() == 0) { if (st.getPlayer().getRace() != Race.darkelf) { htmltext = "blacksmith_karoyd_q0103_00.htm"; } else if (st.getPlayer().getLevel() >= 10) { htmltext = "blacksmith_karoyd_q0103_03.htm"; return htmltext; } else { htmltext = "blacksmith_karoyd_q0103_02.htm"; st.exitCurrentQuest(true); } } else if (npcId == 30307 && st.getCond() == 0) { htmltext = "completed"; } else if (id == STARTED) { if (npcId == 30307 && st.getCond() >= 1 && (st.getQuestItemsCount(KAROYDS_LETTER_ID) >= 1 || st.getQuestItemsCount(CECKTINONS_VOUCHER1_ID) >= 1 || st.getQuestItemsCount(CECKTINONS_VOUCHER2_ID) >= 1)) { htmltext = "blacksmith_karoyd_q0103_06.htm"; } else if (npcId == 30132 && st.getCond() == 1 && st.getQuestItemsCount(KAROYDS_LETTER_ID) == 1) { htmltext = "cecon_q0103_01.htm"; st.setCond(2); st.takeItems(KAROYDS_LETTER_ID, 1); st.giveItems(CECKTINONS_VOUCHER1_ID, 1); } else if (npcId == 30132 && st.getCond() >= 2 && (st.getQuestItemsCount(CECKTINONS_VOUCHER1_ID) >= 1 || st.getQuestItemsCount(CECKTINONS_VOUCHER2_ID) >= 1)) { htmltext = "cecon_q0103_02.htm"; } else if (npcId == 30144 && st.getCond() == 2 && st.getQuestItemsCount(CECKTINONS_VOUCHER1_ID) >= 1) { htmltext = "harne_q0103_01.htm"; st.setCond(3); st.takeItems(CECKTINONS_VOUCHER1_ID, 1); st.giveItems(CECKTINONS_VOUCHER2_ID, 1); } else if (npcId == 30144 && st.getCond() == 3 && st.getQuestItemsCount(CECKTINONS_VOUCHER2_ID) >= 1 && st.getQuestItemsCount(BONE_FRAGMENT1_ID) < 10) { htmltext = "harne_q0103_02.htm"; } else if (npcId == 30144 && st.getCond() == 4 && st.getQuestItemsCount(CECKTINONS_VOUCHER2_ID) == 1 && st.getQuestItemsCount(BONE_FRAGMENT1_ID) >= 10) { htmltext = "harne_q0103_03.htm"; st.setCond(5); st.takeItems(CECKTINONS_VOUCHER2_ID, 1); st.takeItems(BONE_FRAGMENT1_ID, 10); st.giveItems(SOUL_CATCHER_ID, 1); } else if (npcId == 30144 && st.getCond() == 5 && st.getQuestItemsCount(SOUL_CATCHER_ID) == 1) { htmltext = "harne_q0103_04.htm"; } else if (npcId == 30132 && st.getCond() == 5 && st.getQuestItemsCount(SOUL_CATCHER_ID) == 1) { htmltext = "cecon_q0103_03.htm"; st.setCond(6); st.takeItems(SOUL_CATCHER_ID, 1); st.giveItems(PRESERVE_OIL_ID, 1); } else if (npcId == 30132 && st.getCond() == 6 && st.getQuestItemsCount(PRESERVE_OIL_ID) == 1 && st.getQuestItemsCount(ZOMBIE_HEAD_ID) == 0 && st.getQuestItemsCount(STEELBENDERS_HEAD_ID) == 0) { htmltext = "cecon_q0103_04.htm"; } else if (npcId == 30132 && st.getCond() == 7 && st.getQuestItemsCount(ZOMBIE_HEAD_ID) == 1) { htmltext = "cecon_q0103_05.htm"; st.setCond(8); st.takeItems(ZOMBIE_HEAD_ID, 1); st.giveItems(STEELBENDERS_HEAD_ID, 1); } else if (npcId == 30132 && st.getCond() == 8 && st.getQuestItemsCount(STEELBENDERS_HEAD_ID) == 1) { htmltext = "cecon_q0103_06.htm"; } else if (npcId == 30307 && st.getCond() == 8 && st.getQuestItemsCount(STEELBENDERS_HEAD_ID) == 1) { htmltext = "blacksmith_karoyd_q0103_07.htm"; st.takeItems(STEELBENDERS_HEAD_ID, 1); st.giveItems(BLOODSABER_ID, 1); st.giveItems(ADENA_ID, 19799, false); st.addExpAndSp(46663, 3999); if (st.getPlayer().getClassId().getLevel() == 1 && !st.getPlayer().getVarB("p1q3")) { st.getPlayer().setVar("p1q3", "1", -1); // flag for helper st.getPlayer() .sendPacket( new ExShowScreenMessage( "Now go find the Newbie Guide.", 5000, ScreenMessageAlign.TOP_CENTER, true)); st.giveItems(1060, 100); // healing potion for (int item = 4412; item <= 4417; item++) { st.giveItems(item, 10); // echo cry } if (st.getPlayer().getClassId().isMage()) { st.playTutorialVoice("tutorial_voice_027"); st.giveItems(5790, 3000); // newbie sps } else { st.playTutorialVoice("tutorial_voice_026"); st.giveItems(5789, 6000); // newbie ss } } st.exitCurrentQuest(false); st.playSound(SOUND_FINISH); } } return htmltext; }
@Override public String onTalk(NpcInstance npc, QuestState st) { int npcId = npc.getNpcId(); String htmltext = "noquest"; int cond = st.getCond(); if (npcId == Urutu) { if (st.getQuestItemsCount(KhavatariTotem) != 0) { htmltext = "gantaki_zu_urutu_q0415_04.htm"; st.exitCurrentQuest(true); } else if (cond == 0) { if (st.getPlayer().getClassId().getId() != 0x2c) { if (st.getPlayer().getClassId().getId() == 0x2f) { htmltext = "gantaki_zu_urutu_q0415_02a.htm"; } else { htmltext = "gantaki_zu_urutu_q0415_02.htm"; } st.exitCurrentQuest(true); } else if (st.getPlayer().getLevel() < 18) { htmltext = "gantaki_zu_urutu_q0415_03.htm"; st.exitCurrentQuest(true); } else { htmltext = "gantaki_zu_urutu_q0415_01.htm"; } } else if (cond == 1) { htmltext = "gantaki_zu_urutu_q0415_07.htm"; } else if (cond >= 2 && cond <= 7) { htmltext = "gantaki_zu_urutu_q0415_08.htm"; } else if (cond == 8) { st.takeItems(RosheeksLetter, 1); st.giveItems(GantakisLetterOfRecommendation, 1); htmltext = "gantaki_zu_urutu_q0415_09.htm"; st.setCond(9); st.setState(STARTED); } else if (cond == 9) { htmltext = "gantaki_zu_urutu_q0415_10.htm"; } else if (cond >= 10) { htmltext = "gantaki_zu_urutu_q0415_11.htm"; } } else if (npcId == Rosheek) { if (cond == 1) { st.takeItems(Pomegranate, -1); st.giveItems(LeatherPouch1st, 1); htmltext = "khavatari_rosheek_q0415_01.htm"; st.setCond(2); st.setState(STARTED); } else if (cond == 2) { htmltext = "khavatari_rosheek_q0415_02.htm"; } else if (cond == 3) { htmltext = "khavatari_rosheek_q0415_03.htm"; st.takeItems(LeatherPouchFull1st, -1); st.giveItems(LeatherPouch2st, 1); st.setCond(4); st.setState(STARTED); } else if (cond == 4) { htmltext = "khavatari_rosheek_q0415_04.htm"; } else if (cond == 5) { st.takeItems(LeatherPouchFull2st, -1); st.giveItems(LeatherPouch3st, 1); htmltext = "khavatari_rosheek_q0415_05.htm"; st.setCond(6); st.setState(STARTED); } else if (cond == 6) { htmltext = "khavatari_rosheek_q0415_06.htm"; } else if (cond == 7) { st.takeItems(LeatherPouchFull3st, -1); st.giveItems(FierySpiritScroll, 1); st.giveItems(RosheeksLetter, 1); htmltext = "khavatari_rosheek_q0415_07.htm"; st.setCond(8); st.setState(STARTED); } else if (cond == 8) { htmltext = "khavatari_rosheek_q0415_08.htm"; } else if (cond == 9) { htmltext = "khavatari_rosheek_q0415_09.htm"; } } else if (npcId == Kasman) { if (cond == 9) { st.takeItems(GantakisLetterOfRecommendation, -1); st.giveItems(Fig, 1); htmltext = "prefect_kasman_q0415_01.htm"; st.setCond(10); st.setState(STARTED); } else if (cond == 10) { htmltext = "prefect_kasman_q0415_02.htm"; } else if (cond == 11 || cond == 12) { htmltext = "prefect_kasman_q0415_03.htm"; } else if (cond == 13) { st.takeItems(FierySpiritScroll, -1); st.takeItems(IronWillScroll, -1); st.takeItems(TorukusLetter, -1); htmltext = "prefect_kasman_q0415_04.htm"; if (st.getPlayer().getClassId().getLevel() == 1) { st.giveItems(KhavatariTotem, 1); if (!st.getPlayer().getVarB("prof1")) { st.getPlayer().setVar("prof1", "1", -1); st.addExpAndSp(228064, 16455); // FIXME [G1ta0] дать адены, только если первый чар на акке st.giveItems(ADENA_ID, 163800); } } st.playSound(SOUND_FINISH); st.exitCurrentQuest(true); } } else if (npcId == Toruku) { if (cond == 10) { st.takeItems(Fig, -1); st.giveItems(LeatherPouch4st, 1); htmltext = "khavatari_toruku_q0415_01.htm"; st.setCond(11); st.setState(STARTED); } else if (cond == 11) { htmltext = "khavatari_toruku_q0415_02.htm"; } else if (cond == 12) { st.takeItems(LeatherPouchFull4st, -1); st.giveItems(IronWillScroll, 1); st.giveItems(TorukusLetter, 1); htmltext = "khavatari_toruku_q0415_03.htm"; st.setCond(13); st.setState(STARTED); } else if (cond == 13) { htmltext = "khavatari_toruku_q0415_04.htm"; } } return htmltext; }