def onAdvEvent(self, event, npc, player): htmltext = event st = player.getQuestState(qn) if not st: return player = st.getPlayer() if event == "32138-04.htm": st.set("cond", "1") st.setState(State.STARTED) st.playSound("ItemSound.quest_accept") elif event == "32133-06.htm": st.set("cond", "6") st.playSound("ItemSound.quest_accept") elif event == "32138-09.htm": st.set("cond", "7") st.playSound("ItemSound.quest_accept") elif event == "32138-12.htm": st.takeItems(MUERTOS_CLAW, -1) st.rewardItems(ADENA, 8799) st.rewardItems(LESSER_HEALING_POTIONS, 100) for item in ECHO: st.rewardItems(item, 10) newbie = player.getNewbie() if newbie | NEWBIE_REWARD != newbie: player.setNewbie(newbie | NEWBIE_REWARD) st.rewardItems(SOULSHOT_FOR_BEGINNERS, 7000) st.playTutorialVoice("tutorial_voice_026") st.giveItems(WARRIORS_SWORD, 1) st.addExpAndSp(20739, 1777) player.sendPacket(SocialAction(player.getObjectId(), 3)) player.sendPacket(SocialAction(player.getObjectId(), 15)) st.playSound("ItemSound.quest_finish") st.exitQuest(False) return htmltext
def onEvent (self,event,st) : htmltext = event player = st.getPlayer() if event == "32138-04.htm" : st.set("cond","1") st.setState(State.STARTED) st.playSound("ItemSound.quest_accept") elif event == "32133-06.htm" : st.set("cond","6") st.playSound("ItemSound.quest_accept") elif event == "32138-09.htm" : st.set("cond","7") st.playSound("ItemSound.quest_accept") elif event == "32138-12.htm" : st.takeItems(MUERTOS_CLAW,-1) st.rewardItems(57,8799) st.rewardItems(LESSER_HEALING_POTIONS,100) for item in ECHO : st.rewardItems(item,10) if player.getLevel() < 25 and player.isNewbie() : st.giveItems(SOULSHOT_FOR_BEGINNERS,7000) st.playTutorialVoice("tutorial_voice_026") st.giveItems(WARRIORS_SWORD,1) st.addExpAndSp(20739,1777) player.sendPacket(SocialAction(player.getObjectId(),3)) player.sendPacket(SocialAction(player.getObjectId(),15)) st.playSound("ItemSound.quest_finish") st.exitQuest(False) return htmltext
def onTalk(self, npc, player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st: return htmltext npcId = npc.getNpcId() id = st.getState() cond = st.getInt("cond") if id == State.COMPLETED: htmltext = "32197-07.htm" elif npcId == Gwain: if player.getLevel() < 18: htmltext = "32197-00a.htm" st.exitQuest(1) elif player.getClassId().getId() != 123: htmltext = "32197-00b.htm" st.exitQuest(1) elif id == State.CREATED: htmltext = "32197-01.htm" elif cond < 4: htmltext = "32197-03.htm" elif cond == 4: htmltext = "32197-04.htm" st.takeItems(Shubain_Rec, -1) st.set("cond", "5") elif cond == 5: if not st.getQuestItemsCount(Heart): htmltext = "32197-05.htm" else: st.takeItems(Heart, -1) st.giveItems(Gwain_Rec, 1) isFinished = st.getGlobalQuestVar("1ClassQuestFinished") if isFinished == "": st.rewardItems(57, 81900) st.addExpAndSp(228064, 13773) st.exitQuest(False) st.saveGlobalQuestVar("1ClassQuestFinished", "1") st.playSound("ItemSound.quest_finish") player.sendPacket(SocialAction(player.getObjectId(), 3)) htmltext = "32197-06.htm" elif npcId == Shubain: if cond == 1: htmltext = "32194-01.htm" elif cond == 2: if st.getQuestItemsCount(Head) < 5: htmltext = "32194-03.htm" else: htmltext = "32194-04.htm" st.takeItems(Head, -1) st.set("cond", "3") elif cond == 3: if st.getQuestItemsCount(Leg) < 10: htmltext = "32194-05.htm" else: htmltext = "32194-06.htm" st.takeItems(Leg, -1) st.giveItems(Shubain_Rec, 1) st.set("cond", "4") elif cond > 3: htmltext = "32194-07.htm" return htmltext
def onTalk (self,npc,player): npcId = npc.getNpcId() htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st : return htmltext id = st.getState() if npcId == 30568 and st.getInt("cond")==0 and st.getInt("onlyone")==0 : if player.getRace().ordinal() != 3 : htmltext = "30568-00.htm" st.exitQuest(1) elif player.getLevel() >= 10 : htmltext = "30568-02.htm" return htmltext else: htmltext = "30568-01.htm" st.exitQuest(1) elif npcId == 30568 and st.getInt("cond")==0 and st.getInt("onlyone")==1 : htmltext = "<html><body>This quest has already been completed.</body></html>" elif npcId == 30568 and st.getInt("cond")==1 and (st.getQuestItemsCount(HATOSS_ORDER1_ID) or st.getQuestItemsCount(HATOSS_ORDER2_ID) or st.getQuestItemsCount(HATOSS_ORDER3_ID)) and ((st.getQuestItemsCount(LETTER_TO_ELF_ID)+st.getQuestItemsCount(LETTER_TO_HUMAN_ID)+st.getQuestItemsCount(LETTER_TO_DARKELF_ID))==0) : htmltext = "30568-04.htm" elif npcId == 30568 and st.getInt("cond")==1 and (st.getQuestItemsCount(HATOSS_ORDER1_ID) or st.getQuestItemsCount(HATOSS_ORDER2_ID) or st.getQuestItemsCount(HATOSS_ORDER3_ID)) and ((st.getQuestItemsCount(LETTER_TO_ELF_ID)+st.getQuestItemsCount(LETTER_TO_HUMAN_ID)+st.getQuestItemsCount(LETTER_TO_DARKELF_ID))==1) : htmltext = "30568-05.htm" elif npcId == 30568 and st.getInt("cond")==1 and (st.getQuestItemsCount(HATOSS_ORDER1_ID) or st.getQuestItemsCount(HATOSS_ORDER2_ID) or st.getQuestItemsCount(HATOSS_ORDER3_ID)) and ((st.getQuestItemsCount(LETTER_TO_ELF_ID)+st.getQuestItemsCount(LETTER_TO_HUMAN_ID)+st.getQuestItemsCount(LETTER_TO_DARKELF_ID))==2) : htmltext = "30568-08.htm" elif npcId == 30568 and st.getInt("cond")==1 and (st.getQuestItemsCount(HATOSS_ORDER1_ID) or st.getQuestItemsCount(HATOSS_ORDER2_ID) or st.getQuestItemsCount(HATOSS_ORDER3_ID)) and ((st.getQuestItemsCount(LETTER_TO_ELF_ID)+st.getQuestItemsCount(LETTER_TO_HUMAN_ID)+st.getQuestItemsCount(LETTER_TO_DARKELF_ID))==3) and st.getInt("onlyone")==0 : if st.getInt("id") != 107 : st.set("id","107") htmltext = "30568-10.htm" st.takeItems(LETTER_TO_DARKELF_ID,1) st.takeItems(LETTER_TO_HUMAN_ID,1) st.takeItems(LETTER_TO_ELF_ID,1) st.takeItems(HATOSS_ORDER3_ID,1) st.rewardItems(LESSER_HEALING_ID,100) st.giveItems(BUTCHER_ID,1) st.giveItems(CRYSTAL_BATTLE,10) st.giveItems(CRYSTAL_LOVE,10) st.giveItems(CRYSTAL_SOLITUDE,10) st.giveItems(CRYSTAL_FEAST,10) st.giveItems(CRYSTAL_CELEBRATION,10) # check the player state against this quest newbie rewarding mark. newbie = player.getNewbie() if newbie | NEWBIE_REWARD != newbie : player.setNewbie(newbie|NEWBIE_REWARD) if player.getClassId().isMage() : st.giveItems(SPIRITSHOT_NO_GRADE_FOR_BEGINNERS,3000) st.playTutorialVoice("tutorial_voice_027") else : st.giveItems(SOULSHOT_NO_GRADE_FOR_BEGINNERS,7000) st.playTutorialVoice("tutorial_voice_026") st.set("cond","0") st.addExpAndSp(34565,2962) player.sendPacket(SocialAction(player.getObjectId(),3)) st.exitQuest(False) st.playSound("ItemSound.quest_finish") st.set("onlyone","1") elif npcId == 30580 and st.getInt("cond")==1 and id == State.STARTED and (st.getQuestItemsCount(HATOSS_ORDER1_ID) or st.getQuestItemsCount(HATOSS_ORDER2_ID) or st.getQuestItemsCount(HATOSS_ORDER3_ID)) : htmltext = "30580-01.htm" return htmltext
def onTalk (self,npc,player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st : return htmltext npcId = npc.getNpcId() id = st.getState() if npcId != 30327 and id != State.STARTED : return htmltext if id == State.CREATED : st.set("cond","0") cond=0 else : cond=st.getInt("cond") if npcId == 30327 : if cond == 0 : htmltext = "30327-01.htm" elif cond == 1 : if st.getQuestItemsCount(TOPAZ_PIECE)==0 : htmltext = "30327-07.htm" else: htmltext = "30327-08.htm" elif cond == 2 : if st.getQuestItemsCount(SORIUS_LETTER1) == 0 : st.giveItems(SORIUS_LETTER1,1) st.set("cond","3") htmltext = "30327-09.htm" elif cond in [3, 4, 5] : htmltext = "30327-11.htm" elif cond == 6 : st.takeItems(KLUTO_BOX,-1) st.rewardItems(57,81900) st.addExpAndSp(160267,11576) player.sendPacket(SocialAction(player.getObjectId(),3)) st.set("cond","0") st.exitQuest(False) st.playSound("ItemSound.quest_finish") if st.getQuestItemsCount(ELVEN_KNIGHT_BROOCH) == 0 : st.giveItems(ELVEN_KNIGHT_BROOCH,1) htmltext = "30327-10.htm" elif npcId == 30317 : if cond == 3 : htmltext = "30317-01.htm" elif cond == 4 : if st.getQuestItemsCount(EMERALD_PIECE)==0 : htmltext = "30317-03.htm" else: htmltext = "30317-04.htm" elif cond == 5 : st.takeItems(EMERALD_PIECE,-1) st.takeItems(TOPAZ_PIECE,-1) if st.getQuestItemsCount(KLUTO_BOX) == 0 : st.giveItems(KLUTO_BOX,1) st.takeItems(KLUTO_MEMO,-1) st.set("cond","6") htmltext = "30317-05.htm" elif cond == 6 : htmltext = "30317-06.htm" return htmltext
def onEvent(self, event, st): htmltext = event if event == "1": htmltext = "30510-05.htm" for var in STATS: st.set(var, "1") st.setState(State.STARTED) st.set("progress", "PART1") st.playSound("ItemSound.quest_accept") elif event == "30630_1": htmltext = "30630-02.htm" elif event == "30630_2": htmltext = "30630-03.htm" elif event == "30630_3": htmltext = "30630-04.htm" st.giveItems(ORIMS_CONTRACT, 1) st.set("Orim", "2") elif event == "30682_1": htmltext = "30682-02.htm" st.giveItems(PEKIRONS_TOTEM, 1) st.set("Perkiron", "2") elif event == "30515_1": htmltext = "30515-02.htm" st.giveItems(MANAKIAS_TOTEM, 1) st.set("Manakia", "2") st.set("Manakia_Queen", "2") elif event == "30507_1": htmltext = "30507-02.htm" st.giveItems(RACOYS_TOTEM, 1) st.set("Racoy", "2") elif event == "30030_1": htmltext = "30030-02.htm" elif event == "30030_2": htmltext = "30030-03.htm" elif event == "30030_3": htmltext = "30030-04.htm" st.giveItems(VIVIANTES_LETTER, 1) st.set("Racoy", "3") elif event == "30649_1": htmltext = "30649-02.htm" elif event == "30649_2": st.takeItems(WARSPIRIT_TOTEM, -1) st.takeItems(BRAKIS_REMAINS2, -1) st.takeItems(HERMODTS_REMAINS2, -1) st.takeItems(KIRUNAS_REMAINS2, -1) st.addExpAndSp(447444, 30704) st.takeItems(TONARS_REMAINS2, -1) st.giveItems(MARK_OF_WARSPIRIT, 1) st.getPlayer().sendPacket( SocialAction(st.getPlayer().getObjectId(), 3)) st.giveItems(7562, 92) htmltext = "30649-03.htm" for var in STATS: st.unset(var) st.exitQuest(False) st.playSound("ItemSound.quest_finish") return htmltext
def onEvent (self,event,st) : htmltext = event player = st.getPlayer() if event == "30587_1" : if player.getClassId().getId() != 0x2c : if player.getClassId().getId() == 0x2f : htmltext = "30587-02a.htm" st.exitQuest(1) else: htmltext = "30587-02.htm" st.exitQuest(1) else: if player.getLevel()<18 : htmltext = "30587-03.htm" else: if st.getQuestItemsCount(KHAVATARI_TOTEM) != 0 : htmltext = "30587-04.htm" else: htmltext = "30587-05.htm" elif event == "1" : st.set("id","0") st.set("cond","1") st.setState(State.STARTED) st.playSound("ItemSound.quest_accept") htmltext = "30587-06.htm" st.giveItems(POMEGRANATE,1) elif event == "30587-09a.htm" : st.takeItems(ROSHEEKS_LETTER,1) st.giveItems(GANTAKIS_LETTER,1) st.set("cond","9") st.playSound("ItemSound.quest_middle") elif event == "30587-09b.htm" : st.takeItems(ROSHEEKS_LETTER,1) st.giveItems(GANTAKIS_LETTER,1) st.set("cond","14") st.playSound("ItemSound.quest_middle") elif event == "32056-03.htm" : st.set("cond","15") st.playSound("ItemSound.quest_middle") elif event == "32056-08.htm" : st.set("cond","19") st.playSound("ItemSound.quest_middle") st.takeItems(8546,-1) elif event == "31979-03.htm" : st.takeItems(SCROLL_FIERY_SPIRIT,1) st.giveItems(KHAVATARI_TOTEM,1) isFinished = st.getGlobalQuestVar("1ClassQuestFinished") if isFinished == "" : st.rewardItems(57,81900) st.addExpAndSp(295862,19344) player.sendPacket(SocialAction(player.getObjectId(),3)) st.set("cond","0") st.set("onlyone","1") st.exitQuest(False) st.saveGlobalQuestVar("1ClassQuestFinished","1") st.playSound("ItemSound.quest_finish") return htmltext
def exit503(completed, st): if completed: st.giveItems(Proof_Aspiration, 1) st.addExpAndSp(0, 250000) ObjectId = st.getPlayer().getObjectId() st.getPlayer().broadcastPacket(SocialAction(ObjectId, 3)) for var in STATS: st.unset(var) st.exitQuest(False) else: st.exitQuest(1) st.takeItems(Scepter_Judgement, -1) try: members = st.getPlayer().getClan().getOnlineMembers(0)[0] for i in members: st.getPlayer().getClan().getClanMember( i).getPlayerInstance().getQuestState(qn).exitQuest(1) offlineMemberExit(st) except: return "You dont have any members in your Clan, so you can't finish the Pursuit of Aspiration" return "Congratulations, you have finished the Pursuit of Clan Ambition"
def onAdvEvent(self, event, npc, player): if event == "1": machine_instance = self.FindTemplate(Strange_Machine) if machine_instance: npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, machine_instance) machine_instance.broadcastPacket( SpecialCamera(machine_instance.getObjectId(), 1, -200, 15, 10000, 20000)) else: print "Dr Chaos AI: problem finding Strange Machine (npcid = " + Strange_Machine + "). Error: not spawned!" self.startQuestTimer("2", 2000, npc, player) self.startQuestTimer("3", 10000, npc, player) elif event == "2": npc.broadcastPacket(SocialAction(npc.getObjectId(), 3)) elif event == "3": npc.broadcastPacket( SpecialCamera(npc.getObjectId(), 1, -150, 10, 3000, 20000)) self.startQuestTimer("4", 2500, npc, player) elif event == "4": npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(96055, -110759, -3312, 0)) self.startQuestTimer("5", 2000, npc, player) elif event == "5": player.teleToLocation(94832, -112624, -3304) npc.teleToLocation(-113091, -243942, -15536) if self.isGolemSpawned == 0: golem = self.addSpawn(25512, 94640, -112496, -3336, 0, False, 0) self.isGolemSpawned == 1 self.startQuestTimer("6", 1000, golem, player) player.sendPacket(PlaySound(1, "Rm03_A", 0, 0, 0, 0, 0)) elif event == "6": npc.broadcastPacket( SpecialCamera(npc.getObjectId(), 30, -200, 20, 6000, 8000)) return
def onTalk(self, npc, player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st: return htmltext npcId = npc.getNpcId() id = st.getState() if npcId != 30585 and id != State.STARTED: return htmltext if npcId == 30585 and st.getInt("cond") == 0: htmltext = "30585-01.htm" elif npcId == 30585 and st.getInt("cond") == 12: htmltext = "30585-11a.htm" elif npcId == 31979 and st.getInt("cond") == 12: htmltext = "31979-01.htm" st.playSound("ItemSound.quest_middle") st.set("cond", "13") elif npcId == 31979 and st.getInt("cond") == 21: htmltext = "31979-03.htm" st.giveItems(MASK_OF_MEDIUM, 1) st.rewardItems(57, 81900) st.addExpAndSp(295862, 18194) player.sendPacket(SocialAction(player.getObjectId(), 3)) player.sendPacket(SocialAction(player.getObjectId(), 15)) st.set("cond", "0") st.exitQuest(False) st.playSound("ItemSound.quest_finish") elif npcId == 31979 and st.getInt("cond") == 13: htmltext = "31979-02.htm" elif npcId == 32057 and st.getInt("cond") == 13: htmltext = "32057-01.htm" elif npcId == 32057 and st.getInt("cond") == 14: htmltext = "32057-03.htm" elif npcId == 32057 and st.getInt("cond") == 20: htmltext = "32057-04.htm" elif npcId == 32057 and st.getInt("cond") == 21: htmltext = "32057-05.htm" elif npcId == 32090 and st.getInt("cond") == 15: htmltext = "32090-01.htm" st.playSound("ItemSound.quest_middle") st.set("cond", "16") elif npcId == 32090 and st.getInt("cond") == 16: htmltext = "32090-01.htm" elif npcId == 32090 and st.getInt("cond") == 17: htmltext = "32090-02.htm" elif npcId == 32090 and st.getInt("cond") == 18: htmltext = "32090-05.htm" elif npcId == 32090 and st.getInt("cond") == 19: htmltext = "32090-06.htm" st.playSound("ItemSound.quest_middle") st.set("cond", "20") elif npcId == 32090 and st.getInt("cond") == 20: htmltext = "32090-06.htm" elif npcId == 30585 and st.getInt("cond") and st.getQuestItemsCount( FIRE_CHARM) == 1 and ( (st.getQuestItemsCount(KASHA_BEAR_PELT) + st.getQuestItemsCount(KASHA_BSPIDER_HUSK) + st.getQuestItemsCount(FIERY_EGG1)) < 3): htmltext = "30585-07.htm" elif npcId == 30585 and st.getInt("cond") and st.getQuestItemsCount( FIRE_CHARM) == 1 and ( (st.getQuestItemsCount(KASHA_BEAR_PELT) + st.getQuestItemsCount(KASHA_BSPIDER_HUSK) + st.getQuestItemsCount(FIERY_EGG1)) >= 3): htmltext = "30585-08.htm" st.takeItems(FIRE_CHARM, 1) st.takeItems(KASHA_BEAR_PELT, 1) st.takeItems(KASHA_BSPIDER_HUSK, 1) st.takeItems(FIERY_EGG1, 1) st.giveItems(HESTUI_MASK, 1) st.giveItems(FIERY_EGG2, 1) st.set("cond", "3") st.playSound("ItemSound.quest_middle") elif npcId == 30585 and st.getInt("cond") and st.getQuestItemsCount( HESTUI_MASK) == 1 and st.getQuestItemsCount(FIERY_EGG2) == 1: htmltext = "30585-09.htm" elif npcId == 30585 and st.getInt("cond") and st.getQuestItemsCount( TOTEM_SPIRIT_CLAW) == 1: htmltext = "30585-10.htm" elif npcId == 30585 and st.getInt("cond") and st.getQuestItemsCount( TATARUS_LETTER) == 1: htmltext = "30585-12.htm" elif npcId == 30585 and st.getInt("cond") and ( st.getQuestItemsCount(GRIZZLY_BLOOD) or st.getQuestItemsCount(FLAME_CHARM) or st.getQuestItemsCount(BLOOD_CAULDRON) or st.getQuestItemsCount(SPIRIT_NET) or st.getQuestItemsCount(BOUND_DURKA_SPIRIT) or st.getQuestItemsCount(TOTEM_SPIRIT_BLOOD)): htmltext = "30585-13.htm" elif npcId == 30592 and st.getInt("cond") and st.getQuestItemsCount( HESTUI_MASK) and st.getQuestItemsCount(FIERY_EGG2): htmltext = "30592-01.htm" elif npcId == 30592 and st.getInt("cond") and st.getQuestItemsCount( TOTEM_SPIRIT_CLAW): htmltext = "30592-04.htm" elif npcId == 30592 and st.getInt("cond") and ( st.getQuestItemsCount(GRIZZLY_BLOOD) or st.getQuestItemsCount(FLAME_CHARM) or st.getQuestItemsCount(BLOOD_CAULDRON) or st.getQuestItemsCount(SPIRIT_NET) or st.getQuestItemsCount(BOUND_DURKA_SPIRIT) or st.getQuestItemsCount(TOTEM_SPIRIT_BLOOD) or st.getQuestItemsCount(TATARUS_LETTER)): htmltext = "30592-05.htm" elif npcId == 30502 and st.getInt("cond") and st.getQuestItemsCount( TATARUS_LETTER): htmltext = "30502-01.htm" st.giveItems(FLAME_CHARM, 1) st.takeItems(TATARUS_LETTER, 1) st.set("cond", "6") st.playSound("ItemSound.quest_middle") elif npcId == 30502 and st.getInt("cond") and st.getQuestItemsCount( FLAME_CHARM) == 1 and st.getQuestItemsCount(GRIZZLY_BLOOD) < 3: htmltext = "30502-02.htm" elif npcId == 30502 and st.getInt("cond") and st.getQuestItemsCount( FLAME_CHARM ) == 1 and st.getQuestItemsCount(GRIZZLY_BLOOD) >= 3: htmltext = "30502-03.htm" st.takeItems(FLAME_CHARM, 1) st.takeItems(GRIZZLY_BLOOD, st.getQuestItemsCount(GRIZZLY_BLOOD)) st.giveItems(BLOOD_CAULDRON, 1) st.set("cond", "8") st.playSound("ItemSound.quest_middle") elif npcId == 30502 and st.getInt("cond") and st.getQuestItemsCount( BLOOD_CAULDRON) == 1: htmltext = "30502-04.htm" elif npcId == 30502 and st.getInt("cond") and ( st.getQuestItemsCount(BOUND_DURKA_SPIRIT) == 1 or st.getQuestItemsCount(SPIRIT_NET) == 1): htmltext = "30502-05.htm" elif npcId == 30502 and st.getInt("cond") and st.getQuestItemsCount( TOTEM_SPIRIT_BLOOD) == 1: htmltext = "30502-06.htm" elif npcId == 30593 and st.getInt("cond") and st.getQuestItemsCount( BLOOD_CAULDRON): htmltext = "30593-01.htm" elif npcId == 30593 and st.getInt("cond") and st.getQuestItemsCount( SPIRIT_NET) and st.getQuestItemsCount(BOUND_DURKA_SPIRIT) == 0: htmltext = "30593-04.htm" elif npcId == 30593 and st.getInt("cond") and st.getQuestItemsCount( SPIRIT_NET) == 0 and st.getQuestItemsCount(BOUND_DURKA_SPIRIT): htmltext = "30593-05.htm" st.takeItems(BOUND_DURKA_SPIRIT, 1) st.giveItems(TOTEM_SPIRIT_BLOOD, 1) st.set("cond", "11") st.playSound("ItemSound.quest_middle") elif npcId == 30593 and st.getInt( "cond") == 1 and st.getQuestItemsCount(TOTEM_SPIRIT_BLOOD): htmltext = "30593-06.htm" return htmltext
def onSkillSee(self, npc, player, skill, targets, isPet): # this behavior is only run when the target of skill is the passed npc (chest) # i.e. when the player is attempting to open the chest using a skill if not npc in targets: return # gather some values on local variables npcId = npc.getNpcId() skillId = skill.getId() # check if the npc and skills used are valid for this script. Exit if invalid. if npcId not in self.feedableBeasts: return if skillId not in [SKILL_GOLDEN_SPICE, SKILL_CRYSTAL_SPICE]: return # more value gathering on local variables # first gather some values on local variables objectId = npc.getObjectId() growthLevel = 3 # if a mob is in feedableBeasts but not in growthCapableMobs, then it's at max growth (3) if self.growthCapableMobs.has_key(npcId): growthLevel = self.growthCapableMobs[npcId][0] # prevent exploit which allows 2 players to simultaneously raise the same 0-growth beast # If the mob is at 0th level (when it still listens to all feeders) lock it to the first feeder! if (growthLevel == 0) and self.feedInfo.has_key(objectId): return else: self.feedInfo[objectId] = player.getObjectId() food = 0 if skillId == SKILL_GOLDEN_SPICE: food = GOLDEN_SPICE elif skillId == SKILL_CRYSTAL_SPICE: food = CRYSTAL_SPICE # display the social action of the beast eating the food. npc.broadcastPacket(SocialAction(objectId, 2)) # if this pet can't grow, it's all done. if npcId in self.growthCapableMobs.keys(): # do nothing if this mob doesn't eat the specified food (food gets consumed but has no effect). if len(self.growthCapableMobs[npcId][1][food]) == 0: return # rare random talk... if Rnd.get(20) == 0: npc.broadcastPacket( NpcSay( objectId, 0, npc.getNpcId(), self.Text[growthLevel][Rnd.get( len(self.Text[growthLevel]))])) if growthLevel > 0: # check if this is the same player as the one who raised it from growth 0. # if no, then do not allow a chance to raise the pet (food gets consumed but has no effect). if self.feedInfo[objectId] != player.getObjectId(): return # Polymorph the mob, with a certain chance, given its current growth level if Rnd.get(100) < self.growthCapableMobs[npcId][2]: self.spawnNext(npc, growthLevel, player, food) elif npcId in self.tamedBeasts: if skillId == npc.getFoodType(): npc.onReceiveFood() mytext = [ "Refills! Yeah!", "I am such a gluttonous beast, it is embarrassing! Ha ha", "Your cooperative feeling has been getting better and better.", "I will help you!", "The weather is really good. Wanna go for a picnic?", "I really like you! This is tasty...", "If you do not have to leave this place, then I can help you.", "What can I help you with?", "I am not here only for food!", "Yam, yam, yam, yam, yam!" ] npc.broadcastPacket( NpcSay(objectId, 0, npc.getNpcId(), mytext[Rnd.get(len(mytext))])) return
def onTalk(self, npc, player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st: return htmltext npcId = npc.getNpcId() id = st.getState() if npcId != 30022 and id != State.STARTED: return htmltext npcId = npc.getNpcId() htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" id = st.getState() if npcId == 30022 and st.getInt("cond") == 0: if st.getQuestItemsCount(MARK_OF_FAITH) == 0: htmltext = "30022-01.htm" return htmltext else: htmltext = "30022-04.htm" elif npcId == 30022 and st.getInt("cond") and st.getQuestItemsCount( LETTER_OF_ORDER2) == 1 and st.getQuestItemsCount( LEMONIELLS_COVENANT) == 0: htmltext = "30022-07.htm" elif npcId == 30022 and st.getInt("cond") and st.getQuestItemsCount( LETTER_OF_ORDER2) == 1 and st.getQuestItemsCount( LEMONIELLS_COVENANT) == 1: htmltext = "30022-09.htm" isFinished = st.getGlobalQuestVar("1ClassQuestFinished") if isFinished == "": st.addExpAndSp(295862, 17664) st.rewardItems(57, 81900) st.takeItems(LETTER_OF_ORDER2, 1) st.takeItems(LEMONIELLS_COVENANT, 1) st.giveItems(MARK_OF_FAITH, 1) # st.rewardItems(57,81900) This quest should give adena rewards 2 times each time?? not sure, uncomment if that's the case st.set("cond", "0") st.exitQuest(False) st.saveGlobalQuestVar("1ClassQuestFinished", "1") st.playSound("ItemSound.quest_finish") player.sendPacket(SocialAction(player.getObjectId(), 3)) elif npcId == 30022 and st.getInt("cond") and st.getQuestItemsCount( LETTER_OF_ORDER1) == 1: if st.getQuestItemsCount( BOOK_OF_VIVI) == 1 and st.getQuestItemsCount( BOOK_OF_SIMLON) > 0 and st.getQuestItemsCount( BOOK_OF_PRAGA) == 1: htmltext = "30022-08.htm" st.takeItems(BOOK_OF_PRAGA, 1) st.takeItems(BOOK_OF_VIVI, 1) st.takeItems(BOOK_OF_SIMLON, 3) st.takeItems(LETTER_OF_ORDER1, 1) st.giveItems(LETTER_OF_ORDER2, 1) st.set("cond", "3") else: htmltext = "30022-06.htm" elif npcId == 30253 and st.getInt("cond") and st.getQuestItemsCount( LETTER_OF_ORDER1) == 1: if st.getQuestItemsCount(BOOK_OF_SIMLON) == 0: htmltext = "30253-01.htm" st.giveItems(BOOK_OF_SIMLON, 3) elif st.getQuestItemsCount(BOOK_OF_SIMLON) > 0: htmltext = "30253-02.htm" elif npcId == 30030 and st.getInt("cond") and st.getQuestItemsCount( LETTER_OF_ORDER1) == 1: if st.getQuestItemsCount(BOOK_OF_VIVI) == 0: htmltext = "30030-01.htm" st.giveItems(BOOK_OF_VIVI, 1) elif st.getQuestItemsCount(BOOK_OF_VIVI) == 1: htmltext = "30030-02.htm" elif npcId == 30333 and st.getInt("cond") and st.getQuestItemsCount( LETTER_OF_ORDER1) == 1: if st.getQuestItemsCount( BOOK_OF_PRAGA) == 0 and st.getQuestItemsCount( NECKLACE_OF_MOTHER) == 0: htmltext = "30333-01.htm" st.giveItems(NECKLACE_OF_MOTHER, 1) elif st.getQuestItemsCount( BOOK_OF_PRAGA) == 0 and st.getQuestItemsCount( NECKLACE_OF_MOTHER) == 1 and st.getQuestItemsCount( PENDANT_OF_MOTHER) == 0: htmltext = "30333-02.htm" elif st.getQuestItemsCount( BOOK_OF_PRAGA) == 0 and st.getQuestItemsCount( NECKLACE_OF_MOTHER) == 1 and st.getQuestItemsCount( PENDANT_OF_MOTHER) == 1: htmltext = "30333-03.htm" st.takeItems(NECKLACE_OF_MOTHER, 1) st.takeItems(PENDANT_OF_MOTHER, 1) st.giveItems(BOOK_OF_PRAGA, 1) st.set("cond", "2") elif st.getQuestItemsCount(BOOK_OF_PRAGA) > 0: htmltext = "30333-04.htm" elif npcId == 30408 and st.getInt("cond"): if st.getQuestItemsCount(LETTER_OF_ORDER2) == 0: htmltext = "30408-02.htm" elif st.getQuestItemsCount( LETTER_OF_ORDER2) == 1 and st.getQuestItemsCount( BOOK_OF_LEMONIELL) == 0 and st.getQuestItemsCount( LEMONIELLS_COVENANT ) == 0 and st.getQuestItemsCount( CERTIFICATE_OF_GALLINT) == 0: htmltext = "30408-01.htm" st.giveItems(BOOK_OF_LEMONIELL, 1) st.set("cond", "4") elif st.getQuestItemsCount( LETTER_OF_ORDER2) == 1 and st.getQuestItemsCount( BOOK_OF_LEMONIELL) == 1 and st.getQuestItemsCount( LEMONIELLS_COVENANT ) == 0 and st.getQuestItemsCount( CERTIFICATE_OF_GALLINT) == 0: htmltext = "30408-03.htm" elif st.getQuestItemsCount( LETTER_OF_ORDER2) == 1 and st.getQuestItemsCount( BOOK_OF_LEMONIELL) == 0 and st.getQuestItemsCount( LEMONIELLS_COVENANT ) == 0 and st.getQuestItemsCount( CERTIFICATE_OF_GALLINT) == 1: htmltext = "30408-04.htm" st.takeItems(CERTIFICATE_OF_GALLINT, 1) st.giveItems(LEMONIELLS_COVENANT, 1) st.set("cond", "6") elif st.getQuestItemsCount( LETTER_OF_ORDER2) == 1 and st.getQuestItemsCount( BOOK_OF_LEMONIELL) == 0 and st.getQuestItemsCount( LEMONIELLS_COVENANT ) == 1 and st.getQuestItemsCount( CERTIFICATE_OF_GALLINT) == 0: htmltext = "30408-05.htm" elif npcId == 30017 and st.getInt("cond") and st.getQuestItemsCount( LETTER_OF_ORDER2) == 1 and st.getQuestItemsCount( LEMONIELLS_COVENANT) == 0: if st.getQuestItemsCount( BOOK_OF_LEMONIELL) == 1 and st.getQuestItemsCount( CERTIFICATE_OF_GALLINT) == 0: htmltext = "30017-01.htm" st.takeItems(BOOK_OF_LEMONIELL, 1) st.giveItems(CERTIFICATE_OF_GALLINT, 1) st.set("cond", "5") elif st.getQuestItemsCount( BOOK_OF_LEMONIELL) == 0 and st.getQuestItemsCount( CERTIFICATE_OF_GALLINT) == 1: htmltext = "30017-02.htm" return htmltext
def onTalk (self,npc,player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st : return htmltext npcId = npc.getNpcId() id = st.getState() cond = st.getInt("cond") if id == State.COMPLETED : htmltext = "<html><body>This quest has already been completed.</body></html>" elif npcId == Vitus : if player.getClassId().getId() not in [125,126] or player.getLevel() < 39: htmltext = "<html><body>Only Troopers or Warders are allowed to take this quest! Go away before I get angry!<br>You must be level 39 or higher to undertake this quest.</body></html>" st.exitQuest(1) elif id == State.CREATED : htmltext = "32213-01.htm" elif cond >= 1 and cond <= 3 : htmltext = "32213-04.htm" elif cond >= 4 and cond <17 : htmltext = "32213-05.htm" elif cond == 17 and st.getQuestItemsCount(Recommend) == 1 : htmltext = "32213-06.htm" player.sendPacket(SocialAction(player.getObjectId(),3)) st.takeItems(Recommend,-1) st.giveItems(certificate,1) st.exitQuest(False) st.playSound("ItemSound.quest_finish") st.addExpAndSp(189831,21526) elif npcId == Kekropus : if cond == 1 : htmltext = "32138-00.htm" elif cond == 2 : htmltext = "32138-04.htm" elif cond == 14 : htmltext = "32138-05.htm" elif cond == 15 : htmltext = "32138-07.htm" elif cond == 16 : htmltext = "32138-08.htm" elif cond == 17 : htmltext = "32138-12.htm" elif npcId == Casca : if cond == 2 : htmltext = "32139-01.htm" elif cond == 3 : htmltext = "32139-03.htm" elif cond == 4 : htmltext = "32139-05.htm" elif cond == 13 : htmltext = "32139-06.htm" elif cond == 14 : htmltext = "32139-09.htm" elif npcId == Holst : if cond == 4 : htmltext = "32199-01.htm" elif cond == 5 : htmltext = "32199-03.htm" st.set("cond","6") st.playSound("ItemSound.quest_middle") elif cond == 6 : htmltext = "32199-04.htm" elif npcId == Harlan : if cond == 6 : htmltext = "30074-01.htm" elif cond == 7 : htmltext = "30074-02.htm" elif npcId == Jacob : if cond == 6 : htmltext = "30073-01.htm" st.set("cond","7") st.playSound("ItemSound.quest_middle") elif cond == 7 : htmltext = "30073-02.htm" elif npcId == Lucas : if cond == 7 : htmltext = "30071-01.htm" elif cond == 8 : htmltext = "30071-03.htm" elif npcId == Xaber : if cond == 8 : htmltext = "30075-01.htm" elif cond == 9 : htmltext = "30075-02.htm" elif npcId == Liam : if cond == 8 : htmltext = "30076-01.htm" st.set("cond","9") st.playSound("ItemSound.quest_middle") elif cond == 9 : htmltext = "30076-02.htm" elif npcId == Zerome : if cond == 9 : htmltext = "30124-01.htm" elif cond == 10 : htmltext = "30124-02.htm" elif npcId == Vesa : if cond == 9 : htmltext = "30123-01.htm" st.set("cond","10") st.playSound("ItemSound.quest_middle") elif cond == 10 : htmltext = "30123-02.htm" elif npcId == Meldina : if cond == 10 : htmltext = "32214-01.htm" elif cond == 11 : htmltext = "32214-03.htm" elif npcId == Felton : if cond == 11 : htmltext = "30879-01.htm" elif cond == 12 : htmltext = "30879-04.htm" elif npcId == CargoBox : if cond == 12 : htmltext = "32243-01.htm" if st.getInt("angel") == 0 and self.isAngelSpawned == 0 : angel = st.addSpawn(27332,36198,191949,-3728,180000) angel.broadcastPacket(NpcSay(angel.getObjectId(),0,angel.getNpcId(),player.getName()+"! Step back from the confounded box! I will take it myself!")) angel.setRunning() angel.addDamageHate(player,0,999) angel.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player) self.isAngelSpawned = 1 self.startQuestTimer("angel_cleanup",180000,angel,player) elif self.isKatenarSpawned == 0 and st.getInt("angel") == 1: katenar = st.addSpawn(32242,36110,191921,-3712,60000) katenar.broadcastPacket(NpcSay(katenar.getObjectId(),0,katenar.getNpcId(),"I am late!")) self.isKatenarSpawned == 1 self.startQuestTimer("katenar_cleanup",60000,katenar,player) htmltext = "32243-02.htm" elif cond == 13 : htmltext = "32243-03.htm" return htmltext
def onAdvEvent(self, event, npc, pc): if event == "timer_check": gameTime = GameTimeController.getInstance().getGameTime() h = (gameTime / 60) % 24 m = gameTime % 60 if h == 20 and m >= 27 and m <= 33: self.startQuestTimer("Start", 100, None, None) self.cancelQuestTimer("timer_check", None, None) elif event == "Start": mc = self.addSpawn(self.MC, -56698, -56430, -2008, 32768, False, 0) self.AutoChat(mc, TEXT[0], 1) self.startQuestTimer("1", 30000, mc, None) elif event in TALKS.keys() and npc: text, nextEvent, time = TALKS[event] self.AutoChat(npc, text, 1) self.startQuestTimer(nextEvent, time, npc, None) elif event in WALKS.keys() and npc and self.isSpawned == 1: x, y, z, nextEvent, time = WALKS[event] npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(x, y, z, 0)) self.startQuestTimer(nextEvent, time, npc, None) elif event == "6" and npc: self.AutoChat(npc, TEXT[6], 1) npc.getAI().setIntention( CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(-56511, -56647, -2008, 36863)) npc.broadcastPacket(PlaySound(1, "NS22_F", 0, 0, 0, 0, 0)) elf = self.addSpawn(self.singers[0], -56344, -56328, -2008, 32768, False, 0) elf.getAI().setIntention( CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(-56657, -56338, -2008, 33102)) elf1 = self.addSpawn(self.singers[1], -56552, -56245, -2008, 36863, False, 0) elf2 = self.addSpawn(self.singers[1], -56546, -56426, -2008, 28672, False, 0) elf3 = self.addSpawn(self.singers[1], -56570, -56473, -2008, 28672, False, 0) elf4 = self.addSpawn(self.singers[1], -56594, -56516, -2008, 28672, False, 0) elf5 = self.addSpawn(self.singers[1], -56580, -56203, -2008, 36863, False, 0) elf6 = self.addSpawn(self.singers[1], -56606, -56157, -2008, 36863, False, 0) for i in [elf, elf1, elf2, elf3, elf4, elf5, elf6]: self.startQuestTimer("social1", 6000, i, None, True) for j in [npc, elf, elf1, elf2, elf3, elf4, elf5, elf6]: self.startQuestTimer("7", 215000, j, None) elif event == "7" and npc: if npc.getNpcId() == self.MC: self.AutoChat(npc, TEXT[7], 1) npc.getAI().setIntention( CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(-56698, -56430, -2008, 32768)) self.startQuestTimer("8", 12000, npc, None) else: self.cancelQuestTimer("social1", npc, None) npc.getAI().setIntention( CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(-56594, -56064, -2008, 32768)) self.startQuestTimer("clean_npc", 9000, npc, None) elif event == "10" and npc: npc.getAI().setIntention( CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(-56483, -56665, -2034, 32768)) npc1 = self.addSpawn(self.circus[0], -56495, -56375, -2008, 32768, False, 0) npc2 = self.addSpawn(self.circus[0], -56491, -56289, -2008, 32768, False, 0) npc3 = self.addSpawn(self.circus[1], -56502, -56246, -2008, 32768, False, 0) npc4 = self.addSpawn(self.circus[1], -56496, -56429, -2008, 32768, False, 0) npc5 = self.addSpawn(self.circus[2], -56505, -56334, -2008, 32768, False, 0) npc6 = self.addSpawn(self.circus[3], -56545, -56427, -2008, 32768, False, 0) npc7 = self.addSpawn(self.circus[3], -56552, -56248, -2008, 32768, False, 0) npc8 = self.addSpawn(self.circus[4], -56493, -56473, -2008, 32768, False, 0) npc9 = self.addSpawn(self.circus[4], -56504, -56201, -2008, 32768, False, 0) npc.broadcastPacket(PlaySound(1, "TP05_F", 0, 0, 0, 0, 0)) self.startQuestTimer("npc1_1", 3000, npc1, None) self.startQuestTimer("npc2_1", 3000, npc2, None) self.startQuestTimer("npc3_1", 3000, npc3, None) self.startQuestTimer("npc4_1", 3000, npc4, None) self.startQuestTimer("npc5_1", 3500, npc5, None) self.startQuestTimer("npc6_1", 4000, npc6, None) self.startQuestTimer("npc7_1", 4000, npc7, None) self.startQuestTimer("npc8_1", 3000, npc8, None) self.startQuestTimer("npc9_1", 3000, npc9, None) self.isSpawned = 1 for j in [ npc, npc1, npc2, npc3, npc4, npc5, npc6, npc7, npc8, npc9 ]: self.startQuestTimer("11", 100000, j, None) elif event == "11" and npc: if npc.getNpcId() == self.MC: self.AutoChat(npc, TEXT[10], 1) npc.getAI().setIntention( CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(-56698, -56430, -2008, 32768)) self.startQuestTimer("12", 5000, npc, None) else: npc.getAI().setIntention( CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(-56343, -56330, -2008, 32768)) self.startQuestTimer("clean_npc", 1000, npc, None) elif event == "14" and npc: npc1 = self.addSpawn(self.individuals[0], -56700, -56385, -2008, 32768, False, 0) self.startQuestTimer("social1", 2000, npc1, None) self.startQuestTimer("clean_npc", 49000, npc1, None) self.startQuestTimer("15", 7000, npc, None) elif event == "17" and npc: self.AutoChat(npc, TEXT[15], 1) npc1 = self.addSpawn(self.individuals[1], -56700, -56340, -2008, 32768, False, 0) self.startQuestTimer("social1", 2000, npc1, None) self.startQuestTimer("clean_npc", 32000, npc1, None) self.startQuestTimer("18", 9000, npc, None) elif event == "20" and npc: npc1 = self.addSpawn(self.individuals[2], -56703, -56296, -2008, 32768, False, 0) self.startQuestTimer("social1", 2000, npc1, None) self.startQuestTimer("clean_npc", 13000, npc1, None) self.startQuestTimer("21", 8000, npc, None) elif event == "23" and npc: npc.getAI().setIntention( CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(-56702, -56340, -2008, 32768)) self.startQuestTimer("24", 2800, npc, None) npc1 = self.addSpawn(self.showstuff[0], -56672, -56406, -2000, 32768, False, 0) npc2 = self.addSpawn(self.showstuff[1], -56648, -56368, -2000, 32768, False, 0) npc3 = self.addSpawn(self.showstuff[2], -56608, -56338, -2000, 32768, False, 0) npc4 = self.addSpawn(self.showstuff[3], -56652, -56307, -2000, 32768, False, 0) npc5 = self.addSpawn(self.showstuff[4], -56672, -56272, -2000, 32768, False, 0) for j in [npc1, npc2, npc3, npc4, npc5]: self.startQuestTimer("social1", 5500, j, None) self.startQuestTimer("social1_1", 12500, j, None) self.startQuestTimer("28", 19700, j, None) elif event == "28" and npc: self.AutoChat(npc, "We love you.", 0) self.startQuestTimer("social1", 1, npc, None) self.startQuestTimer("clean_npc", 1200, npc, None) elif event == "29" and npc: npc.getAI().setIntention( CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(-56730, -56340, -2008, 32768)) self.startQuestTimer("clean_npc", 4100, npc, None) self.startQuestTimer("timer_check", 60000, None, None, True) elif event in ["social1", "social1_1"] and npc: npc.broadcastPacket(SocialAction(npc.getObjectId(), 1)) elif event == "clean_npc" and npc: if npc.getNpcId() in [ self.circus[0], self.circus[1], self.circus[2], self.circus[3], self.circus[4] ]: self.isSpawned = 0 npc.deleteMe() return
def onEvent(self, event, st): htmltext = event if event == "1": htmltext = "30103-06.htm" st.set("cond", "1") st.setState(State.STARTED) st.playSound("ItemSound.quest_accept") st.giveItems(VALKONS_RECOMMEND_ID, 1) st.takeItems(ADENA_ID, 2000) elif event == "30103_1": htmltext = "30103-04.htm" elif event == "30103_2": if st.getQuestItemsCount(ADENA_ID) >= 2000: htmltext = "30103-05.htm" else: htmltext = "30103-05a.htm" elif event == "30103_3": htmltext = "30103-09a.htm" st.set("cond", "0") st.set("onlyone", "1") st.exitQuest(False) st.playSound("ItemSound.quest_finish") st.addExpAndSp(514739, 33384) st.giveItems(57, 93803) st.giveItems(7562, 85) st.takeItems(JOURNEYMAN_RING_ID, -1) st.takeItems(ALLTRANS_INSTRUCTIONS_ID, 1) st.takeItems(RP_JOURNEYMAN_RING_ID, 1) st.giveItems(MARK_OF_GUILDSMAN_ID, 1) st.getPlayer().sendPacket( SocialAction(st.getPlayer().getObjectId(), 3)) elif event == "30103_4": st.addExpAndSp(514739, 33384) st.giveItems(57, 93803) st.giveItems(7562, 85) htmltext = "30103-09b.htm" st.set("cond", "0") st.set("onlyone", "1") st.exitQuest(False) st.playSound("ItemSound.quest_finish") st.takeItems(JOURNEYMAN_RING_ID, -1) st.takeItems(ALLTRANS_INSTRUCTIONS_ID, 1) st.takeItems(RP_JOURNEYMAN_RING_ID, 1) st.giveItems(MARK_OF_GUILDSMAN_ID, 1) st.getPlayer().sendPacket( SocialAction(st.getPlayer().getObjectId(), 3)) elif event == "30283_1": htmltext = "30283-03.htm" st.giveItems(ALLTRANS_INSTRUCTIONS_ID, 1) st.takeItems(VALKONS_RECOMMEND_ID, 1) st.giveItems(RP_JOURNEYMAN_RING_ID, 1) st.takeItems(MANDRAGORA_BERRY_ID, 1) st.giveItems(ALLTRANS_RECOMMEND1_ID, 1) st.giveItems(ALLTRANS_RECOMMEND2_ID, 1) st.playSound("ItemSound.quest_middle") st.set("cond", "5") elif event == "30210_1": htmltext = "30210-02.htm" elif event == "30210_2": htmltext = "30210-03.htm" elif event == "30210_3": htmltext = "30210-04.htm" st.giveItems(NORMANS_INSTRUCTIONS_ID, 1) st.takeItems(ALLTRANS_RECOMMEND1_ID, 1) st.giveItems(NORMANS_RECEIPT_ID, 1) elif event == "30210_4": htmltext = "30210-08.htm" elif event == "30210_5": htmltext = "30210-09.htm" elif event == "30210_6": htmltext = "30210-10.htm" st.takeItems(DUNINGS_KEY_ID, st.getQuestItemsCount(DUNINGS_KEY_ID)) st.giveItems(NORMANS_LIST_ID, 1) st.takeItems(NORMANS_INSTRUCTIONS_ID, 1) elif event == "30688_1": htmltext = "30688-02.htm" st.giveItems(DUNINGS_INSTRUCTIONS_ID, 1) st.takeItems(NORMANS_RECEIPT_ID, 1) elif event == "30298_1": htmltext = "30298-03.htm" elif event == "30298_2": if st.getPlayer().getClassId().getId() == 0x36: htmltext = "30298-04.htm" st.giveItems(PINTERS_INSTRUCTIONS_ID, 1) st.takeItems(ALLTRANS_RECOMMEND2_ID, 1) else: htmltext = "30298-05.htm" st.giveItems(RP_AMBER_BEAD_ID, 1) st.takeItems(ALLTRANS_RECOMMEND2_ID, 1) st.giveItems(PINTERS_INSTRUCTIONS_ID, 1) return htmltext
def onTalk(self, npc, player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st: return htmltext npcId = npc.getNpcId() id = st.getState() if npcId != 30104 and id != State.STARTED: return htmltext if npcId == 30104 and st.getInt("cond") == 0 and st.getInt( "onlyone") == 0: if player.getRace().ordinal() != 4: htmltext = "30104-01.htm" st.exitQuest(1) else: if player.getLevel() < 37: htmltext = "30104-02.htm" st.exitQuest(1) else: htmltext = "30104-03.htm" elif npcId == 30104 and st.getInt("cond") == 0 and st.getInt( "onlyone") == 1: htmltext = "<html><body>This quest has already been completed.</body></html>" elif npcId == 30104 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) == 1: if st.getQuestItemsCount( OLD_ACCOUNT_BOOK_ID) and st.getQuestItemsCount( BLESSED_SEED_ID) and st.getQuestItemsCount( RECIPE_OF_EMILLY_ID) and st.getQuestItemsCount( LILITH_ELVEN_WAFER_ID): htmltext = "30104-06.htm" else: htmltext = "30104-05.htm" elif npcId == 30104 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( PARMANS_INSTRUCTIONS_ID) == 1: if player.getLevel() < 38: htmltext = "30104-09.htm" else: htmltext = "30104-10.htm" st.giveItems(RING_OF_TESTIMONY2_ID, 1) st.takeItems(PARMANS_INSTRUCTIONS_ID, 1) st.giveItems(PARMANS_LETTER_ID, 1) elif npcId == 30104 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY2_ID) and st.getQuestItemsCount( PARMANS_LETTER_ID) and st.getQuestItemsCount( MAPHR_TABLET_FRAGMENT_ID) == 0: htmltext = "30104-11.htm" elif npcId == 30104 and st.getInt("cond") >= 1 and ( st.getQuestItemsCount(CLAY_DOUGH_ID) or st.getQuestItemsCount(PATTERN_OF_KEYHOLE_ID) or st.getQuestItemsCount(NIKOLAS_LIST_ID) ) and st.getQuestItemsCount(RING_OF_TESTIMONY2_ID) == 1: htmltext = "30104-12.htm" elif npcId == 30104 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY2_ID) and st.getQuestItemsCount( MAPHR_TABLET_FRAGMENT_ID): st.addExpAndSp(599979, 40040) st.rewardItems(57, 108841) st.giveItems(7562, 50) st.takeItems(RING_OF_TESTIMONY2_ID, 1) st.giveItems(MARK_OF_PROSPERITY_ID, 1) st.takeItems(MAPHR_TABLET_FRAGMENT_ID, 1) htmltext = "30104-13.htm" st.set("cond", "0") st.set("onlyone", "1") st.exitQuest(False) st.playSound("ItemSound.quest_finish") player.sendPacket(SocialAction(player.getObjectId(), 3)) elif npcId == 30531 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( OLD_ACCOUNT_BOOK_ID) == 0 and st.getQuestItemsCount( COLLECTION_LICENSE_ID) == 0 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) == 1: htmltext = "30531-01.htm" elif npcId == 30531 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID): if st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION1_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION2_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION3_ID ) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION4_ID ) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION5_ID): htmltext = "30531-05.htm" st.giveItems(OLD_ACCOUNT_BOOK_ID, 1) st.takeItems(COLLECTION_LICENSE_ID, 1) st.takeItems(RECEIPT_OF_CONTRIBUTION1_ID, 1) st.takeItems(RECEIPT_OF_CONTRIBUTION2_ID, 1) st.takeItems(RECEIPT_OF_CONTRIBUTION3_ID, 1) st.takeItems(RECEIPT_OF_CONTRIBUTION4_ID, 1) st.takeItems(RECEIPT_OF_CONTRIBUTION5_ID, 1) if st.getQuestItemsCount( OLD_ACCOUNT_BOOK_ID) and st.getQuestItemsCount( BLESSED_SEED_ID) and st.getQuestItemsCount( RECIPE_OF_EMILLY_ID) and st.getQuestItemsCount( LILITH_ELVEN_WAFER_ID): st.set("cond", "2") st.playSound("ItemSound.quest_middle") else: htmltext = "30531-04.htm" elif npcId == 30531 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( OLD_ACCOUNT_BOOK_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) == 0: htmltext = "30531-06.htm" elif npcId == 30531 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY2_ID) == 1: htmltext = "30531-07.htm" elif npcId == 30532 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( LOCKIRINS_NOTICE1_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION1_ID ) == 0 and st.getQuestItemsCount( CONTRIBUTION_OF_CHALI_ID) == 0: htmltext = "30532-01.htm" st.takeItems(LOCKIRINS_NOTICE1_ID, 1) elif npcId == 30532 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION1_ID ) == 0 and st.getQuestItemsCount( CONTRIBUTION_OF_CHALI_ID ) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE1_ID) == 0: htmltext = "30532-02.htm" elif npcId == 30532 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( CONTRIBUTION_OF_CHALI_ID ) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION1_ID ) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE1_ID) == 0: htmltext = "30532-03.htm" st.giveItems(RECEIPT_OF_CONTRIBUTION1_ID, 1) st.takeItems(CONTRIBUTION_OF_CHALI_ID, 1) elif npcId == 30532 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( CONTRIBUTION_OF_CHALI_ID) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE1_ID) == 0 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID ) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION1_ID): htmltext = "30532-04.htm" elif npcId == 30533 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( LOCKIRINS_NOTICE2_ID ) and st.getQuestItemsCount( LOCKIRINS_NOTICE2_ID ) == 1 and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION2_ID ) == 0 and ( st.getQuestItemsCount(CONTRIBUTION_OF_MION_ID) + st.getQuestItemsCount(CONTRIBUTION_OF_MARIFE_ID) < 2): htmltext = "30533-01.htm" st.takeItems(LOCKIRINS_NOTICE2_ID, 1) elif npcId == 30533 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( LOCKIRINS_NOTICE2_ID ) == 0 and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION2_ID ) == 0 and ( st.getQuestItemsCount(CONTRIBUTION_OF_MION_ID) + st.getQuestItemsCount(CONTRIBUTION_OF_MARIFE_ID) < 2): htmltext = "30533-02.htm" elif npcId == 30533 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION2_ID ) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE2_ID ) == 0 and ( st.getQuestItemsCount(CONTRIBUTION_OF_MION_ID) + st.getQuestItemsCount(CONTRIBUTION_OF_MARIFE_ID) >= 2): htmltext = "30533-03.htm" st.takeItems(CONTRIBUTION_OF_MARIFE_ID, 1) st.giveItems(RECEIPT_OF_CONTRIBUTION2_ID, 1) st.takeItems(CONTRIBUTION_OF_MION_ID, 1) elif npcId == 30533 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( LOCKIRINS_NOTICE2_ID) == 0 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID ) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION2_ID ) and (st.getQuestItemsCount(CONTRIBUTION_OF_MION_ID) + st.getQuestItemsCount(CONTRIBUTION_OF_MARIFE_ID) < 2): htmltext = "30533-04.htm" elif npcId == 30534 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( LOCKIRINS_NOTICE3_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION3_ID ) == 0 and st.getQuestItemsCount( PROCURATION_OF_TOROCCO_ID) == 0: htmltext = "30534-01.htm" st.takeItems(LOCKIRINS_NOTICE3_ID, 1) elif npcId == 30534 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION3_ID ) == 0 and st.getQuestItemsCount( PROCURATION_OF_TOROCCO_ID) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE3_ID) == 0 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID): htmltext = "30534-02.htm" elif npcId == 30534 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( PROCURATION_OF_TOROCCO_ID ) and st.getQuestItemsCount( LOCKIRINS_NOTICE3_ID ) == 0 and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION3_ID) == 0: htmltext = "30534-03.htm" elif npcId == 30534 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION3_ID ) and st.getQuestItemsCount( PROCURATION_OF_TOROCCO_ID ) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE3_ID) == 0: htmltext = "30534-04.htm" elif npcId == 30535 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( LOCKIRINS_NOTICE4_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION4_ID ) == 0 and st.getQuestItemsCount( RECEIPT_OF_BOLTER_ID) == 0: htmltext = "30535-01.htm" st.takeItems(LOCKIRINS_NOTICE4_ID, 1) elif npcId == 30535 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION4_ID ) == 0 and st.getQuestItemsCount( RECEIPT_OF_BOLTER_ID) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE4_ID) == 0 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID): htmltext = "30535-02.htm" elif npcId == 30535 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( RECEIPT_OF_BOLTER_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION4_ID ) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE4_ID) == 0: htmltext = "30535-03.htm" st.giveItems(RECEIPT_OF_CONTRIBUTION4_ID, 1) st.takeItems(RECEIPT_OF_BOLTER_ID, 1) elif npcId == 30535 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION4_ID ) and st.getQuestItemsCount( RECEIPT_OF_BOLTER_ID ) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE4_ID) == 0: htmltext = "30535-04.htm" elif npcId == 30536 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( LOCKIRINS_NOTICE5_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION5_ID ) == 0 and st.getQuestItemsCount( CONTRIBUTION_OF_TOMA_ID) == 0: htmltext = "30536-01.htm" st.takeItems(LOCKIRINS_NOTICE5_ID, 1) elif npcId == 30536 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION5_ID ) == 0 and st.getQuestItemsCount( CONTRIBUTION_OF_TOMA_ID) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE5_ID) == 0 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID): htmltext = "30536-02.htm" elif npcId == 30536 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( CONTRIBUTION_OF_TOMA_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION5_ID ) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE5_ID) == 0: htmltext = "30536-03.htm" st.giveItems(RECEIPT_OF_CONTRIBUTION5_ID, 1) st.takeItems(CONTRIBUTION_OF_TOMA_ID, 1) elif npcId == 30536 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION5_ID ) and st.getQuestItemsCount( CONTRIBUTION_OF_TOMA_ID ) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE5_ID) == 0: htmltext = "30536-04.htm" elif npcId == 30517 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION1_ID ) == 0 and st.getQuestItemsCount( CONTRIBUTION_OF_CHALI_ID) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE1_ID) == 0 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID): htmltext = "30517-01.htm" st.giveItems(CONTRIBUTION_OF_CHALI_ID, 1) elif npcId == 30517 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( CONTRIBUTION_OF_CHALI_ID ) and st.getQuestItemsCount( LOCKIRINS_NOTICE1_ID ) == 0 and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION1_ID) == 0: htmltext = "30517-02.htm" elif npcId == 30519 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION2_ID ) == 0 and st.getQuestItemsCount( CONTRIBUTION_OF_MION_ID) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE2_ID) == 0 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID): htmltext = "30519-01.htm" st.giveItems(CONTRIBUTION_OF_MION_ID, 1) elif npcId == 30519 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( CONTRIBUTION_OF_MION_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION2_ID ) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE2_ID) == 0: htmltext = "30519-02.htm" elif npcId == 30553 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION2_ID ) == 0 and st.getQuestItemsCount( CONTRIBUTION_OF_MARIFE_ID) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE2_ID) == 0 and st.getQuestItemsCount( MARIFES_REQUEST_ID) == 0 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID ) and st.getQuestItemsCount(COLLECTION_LICENSE_ID): htmltext = "30553-01.htm" st.giveItems(MARIFES_REQUEST_ID, 1) elif npcId == 30553 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( MARIFES_REQUEST_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION2_ID ) == 0 and st.getQuestItemsCount( CONTRIBUTION_OF_MARIFE_ID ) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE2_ID) == 0: if st.getQuestItemsCount(ANIMAL_SKIN_ID) < 100: htmltext = "30553-02.htm" else: htmltext = "30553-03.htm" st.takeItems(ANIMAL_SKIN_ID, 100) st.giveItems(CONTRIBUTION_OF_MARIFE_ID, 1) st.takeItems(MARIFES_REQUEST_ID, 1) elif npcId == 30553 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( CONTRIBUTION_OF_MARIFE_ID ) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION2_ID ) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE2_ID ) == 0 and st.getQuestItemsCount( MARIFES_REQUEST_ID) == 0: htmltext = "30553-04.htm" elif npcId == 30555 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION3_ID ) == 0 and st.getQuestItemsCount( PROCURATION_OF_TOROCCO_ID) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE3_ID) == 0 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID): htmltext = "30555-01.htm" elif npcId == 30555 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( PROCURATION_OF_TOROCCO_ID ) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION3_ID ) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE3_ID) == 0: htmltext = "30555-03.htm" elif npcId == 30554 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION4_ID ) == 0 and st.getQuestItemsCount( RECEIPT_OF_BOLTER_ID) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE4_ID) == 0 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID): htmltext = "30554-01.htm" st.giveItems(RECEIPT_OF_BOLTER_ID, 1) elif npcId == 30554 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( RECEIPT_OF_BOLTER_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION4_ID ) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE4_ID) == 0: htmltext = "30554-02.htm" elif npcId == 30556 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION5_ID ) == 0 and st.getQuestItemsCount( CONTRIBUTION_OF_TOMA_ID) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE5_ID) == 0 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID): htmltext = "30556-01.htm" st.giveItems(CONTRIBUTION_OF_TOMA_ID, 1) elif npcId == 30556 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( COLLECTION_LICENSE_ID) and st.getQuestItemsCount( CONTRIBUTION_OF_TOMA_ID) and st.getQuestItemsCount( RECEIPT_OF_CONTRIBUTION5_ID ) == 0 and st.getQuestItemsCount( LOCKIRINS_NOTICE5_ID) == 0: htmltext = "30556-02.htm" elif npcId == 30597 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) == 1 and st.getQuestItemsCount( BLESSED_SEED_ID) == 0: htmltext = "30597-01.htm" elif npcId == 30597 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) == 1 and st.getQuestItemsCount( BLESSED_SEED_ID) == 1: htmltext = "30597-03.htm" elif npcId == 30597 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY2_ID) == 1: htmltext = "30597-04.htm" elif npcId == 30005 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) == 1 and st.getQuestItemsCount( LILITH_ELVEN_WAFER_ID) == 0 and st.getQuestItemsCount( CRYSTAL_BROOCH_ID) == 0: htmltext = "30005-01.htm" elif npcId == 30005 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( LILITH_ELVEN_WAFER_ID) == 0 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( CRYSTAL_BROOCH_ID): htmltext = "30005-05.htm" elif npcId == 30005 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( LILITH_ELVEN_WAFER_ID): htmltext = "30005-06.htm" elif npcId == 30005 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY2_ID) == 1: htmltext = "30005-07.htm" elif npcId == 30368 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( CRYSTAL_BROOCH_ID) and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( LILITH_ELVEN_WAFER_ID) == 0: htmltext = "30368-01.htm" elif npcId == 30368 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( LILITH_ELVEN_WAFER_ID) and st.getQuestItemsCount( CRYSTAL_BROOCH_ID) == 0: htmltext = "30368-04.htm" elif npcId == 30368 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY2_ID) == 1: htmltext = "30368-05.htm" elif npcId == 30466 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) == 1 and st.getQuestItemsCount( RECIPE_OF_EMILLY_ID) == 0 and st.getQuestItemsCount( BRIGHTS_LIST_ID) == 0 and st.getQuestItemsCount( MANDRAGORA_BOUQUET_ID) == 0: htmltext = "30466-01.htm" elif npcId == 30466 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RECIPE_OF_EMILLY_ID) == 0 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( BRIGHTS_LIST_ID): if st.getQuestItemsCount( MANDRAGORA_PETAL_ID) < 20 or st.getQuestItemsCount( CRIMSON_MOSS_ID) < 10: htmltext = "30466-04.htm" else: htmltext = "30466-05.htm" st.takeItems(MANDRAGORA_PETAL_ID, st.getQuestItemsCount(MANDRAGORA_PETAL_ID)) st.takeItems(CRIMSON_MOSS_ID, st.getQuestItemsCount(CRIMSON_MOSS_ID)) st.giveItems(MANDRAGORA_BOUQUET_ID, 1) st.takeItems(BRIGHTS_LIST_ID, 1) elif npcId == 30466 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( MANDRAGORA_BOUQUET_ID) and st.getQuestItemsCount( RECIPE_OF_EMILLY_ID ) == 0 and st.getQuestItemsCount(BRIGHTS_LIST_ID) == 0: htmltext = "30466-06.htm" elif npcId == 30466 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( RECIPE_OF_EMILLY_ID): htmltext = "30466-07.htm" elif npcId == 30466 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY2_ID) == 1: htmltext = "30466-08.htm" elif npcId == 30620 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( MANDRAGORA_BOUQUET_ID) and st.getQuestItemsCount( RECIPE_OF_EMILLY_ID ) == 0 and st.getQuestItemsCount(BRIGHTS_LIST_ID) == 0: htmltext = "30620-01.htm" elif npcId == 30620 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount( RECIPE_OF_EMILLY_ID): htmltext = "30620-04.htm" elif npcId == 30620 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY2_ID) == 1: htmltext = "30620-05.htm" elif npcId == 30621 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY2_ID) == 1 and st.getQuestItemsCount( CLAY_DOUGH_ID) == 0 and st.getQuestItemsCount( PATTERN_OF_KEYHOLE_ID ) == 0 and st.getQuestItemsCount( NIKOLAS_LIST_ID) == 0 and st.getQuestItemsCount( MAPHR_TABLET_FRAGMENT_ID) == 0: htmltext = "30621-01.htm" elif npcId == 30621 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY2_ID) and st.getQuestItemsCount( CLAY_DOUGH_ID) and st.getQuestItemsCount( PATTERN_OF_KEYHOLE_ID ) == 0 and st.getQuestItemsCount( NIKOLAS_LIST_ID) == 0 and st.getQuestItemsCount( MAPHR_TABLET_FRAGMENT_ID) == 0: htmltext = "30621-05.htm" elif npcId == 30621 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY2_ID) and st.getQuestItemsCount( PATTERN_OF_KEYHOLE_ID) and st.getQuestItemsCount( CLAY_DOUGH_ID) == 0 and st.getQuestItemsCount( NIKOLAS_LIST_ID ) == 0 and st.getQuestItemsCount( MAPHR_TABLET_FRAGMENT_ID) == 0: htmltext = "30621-06.htm" st.giveItems(NIKOLAS_LIST_ID, 1) st.takeItems(PATTERN_OF_KEYHOLE_ID, 1) st.giveItems(RP_TITAN_KEY_ID, 1) st.takeItems(PARMANS_LETTER_ID, 1) st.set("cond", "7") st.playSound("ItemSound.quest_middle") elif npcId == 30621 and st.getInt( "cond" ) >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY2_ID ) and st.getQuestItemsCount(NIKOLAS_LIST_ID) and st.getQuestItemsCount( CLAY_DOUGH_ID) == 0 and st.getQuestItemsCount( PATTERN_OF_KEYHOLE_ID) == 0 and st.getQuestItemsCount( MAPHR_TABLET_FRAGMENT_ID ) == 0 and st.getQuestItemsCount(KEY_OF_TITAN_ID) == 0: htmltext = "30621-07.htm" elif npcId == 30621 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY2_ID) and st.getQuestItemsCount( NIKOLAS_LIST_ID) and st.getQuestItemsCount( KEY_OF_TITAN_ID) and st.getQuestItemsCount( CLAY_DOUGH_ID) == 0 and st.getQuestItemsCount( PATTERN_OF_KEYHOLE_ID ) == 0 and st.getQuestItemsCount( MAPHR_TABLET_FRAGMENT_ID) == 0: htmltext = "30621-08.htm" elif npcId == 30621 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY2_ID) and st.getQuestItemsCount( MAPHR_TABLET_FRAGMENT_ID) and st.getQuestItemsCount( CLAY_DOUGH_ID) == 0 and st.getQuestItemsCount( PATTERN_OF_KEYHOLE_ID ) == 0 and st.getQuestItemsCount( NIKOLAS_LIST_ID) == 0: htmltext = "30621-09.htm" elif npcId == 30622 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY2_ID) and st.getQuestItemsCount( CLAY_DOUGH_ID) and st.getQuestItemsCount( PATTERN_OF_KEYHOLE_ID) == 0: htmltext = "30622-01.htm" elif npcId == 30622 and st.getInt( "cond") >= 1 and st.getQuestItemsCount( RING_OF_TESTIMONY2_ID) and st.getQuestItemsCount( KEY_OF_TITAN_ID) and st.getQuestItemsCount( MAPHR_TABLET_FRAGMENT_ID) == 0: htmltext = "30622-03.htm" return htmltext
def onTalk(self, npc, player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st: return htmltext npcId = npc.getNpcId() id = st.getState() if npcId != 30648 and id != State.STARTED: return htmltext cond = st.getInt("cond") if npcId == 30648 and cond == 0 and id == State.CREATED: if (player.getClassId().getId() in [0x0f, 0x1d, 0x2a, 0x32]): if player.getLevel() >= 35: htmltext = "30648-03.htm" else: htmltext = "30648-01.htm" st.exitQuest(1) else: htmltext = "30648-02.htm" st.exitQuest(1) elif npcId == 30648 and cond == 0 and id == State.COMPLETED: htmltext = "<html><body>This quest has already been completed.</body></html>" elif npcId == 30648 and cond == 1 and st.getQuestItemsCount( VOUCHER_OF_TRIAL): htmltext = "30648-09.htm" elif npcId == 30648 and cond == 17 and st.getQuestItemsCount( BOOK_OF_SAGE): st.addExpAndSp(629125, 40803) st.rewardItems(7562, 49) st.rewardItems(ADENA, 114649) player.sendPacket(SocialAction(player.getObjectId(), 3)) htmltext = "30648-10.htm" st.giveItems(MARK_OF_PILGRIM, 1) st.takeItems(BOOK_OF_SAGE, 1) st.exitQuest(False) st.playSound("ItemSound.quest_finish") st.unset("cond") elif npcId == 30571 and cond == 1 and st.getQuestItemsCount( VOUCHER_OF_TRIAL): htmltext = "30571-01.htm" st.takeItems(VOUCHER_OF_TRIAL, 1) st.set("cond", "2") st.playSound("ItemSound.quest_middle") elif npcId == 30571 and cond == 2: htmltext = "30571-02.htm" elif npcId == 30571 and cond in [ 5, 6 ] and st.getQuestItemsCount(SPIRIT_OF_FLAME): htmltext = "30571-03.htm" st.set("cond", "6") st.playSound("ItemSound.quest_middle") elif npcId == 30649 and cond == 2: htmltext = "30649-01.htm" st.set("cond", "3") st.playSound("ItemSound.quest_middle") elif npcId == 30649 and cond == 3: htmltext = "30649-02.htm" elif npcId == 30649 and cond == 4 and st.getQuestItemsCount( ESSENSE_OF_FLAME): htmltext = "30649-03.htm" elif npcId == 30550 and cond == 6 and st.getQuestItemsCount( SPIRIT_OF_FLAME): htmltext = "30550-01.htm" st.giveItems(TAG_OF_RUMOR, 1) st.set("cond", "7") st.playSound("ItemSound.quest_middle") elif npcId == 30550 and cond == 7: htmltext = "30550-02.htm" elif npcId == 30650 and cond == 7 and st.getQuestItemsCount( TAG_OF_RUMOR): htmltext = st.showHtmlFile("30650-01.htm").replace( "RequiredAdena", str(100000)) elif npcId == 30650 and cond >= 9 and st.getQuestItemsCount( GREY_BADGE) and st.getQuestItemsCount(BOOK_OF_GERALD): htmltext = "30650-04.htm" st.rewardItems(ADENA, 100000) st.takeItems(BOOK_OF_GERALD, 1) elif npcId == 30651 and cond == 7 and st.getQuestItemsCount( TAG_OF_RUMOR): htmltext = "30651-01.htm" st.giveItems(GREY_BADGE, 1) st.takeItems(TAG_OF_RUMOR, 1) st.set("cond", "9") st.playSound("ItemSound.quest_middle") elif npcId == 30651 and cond == 8 and st.getQuestItemsCount( TAG_OF_RUMOR): htmltext = "30651-02.htm" st.giveItems(GREY_BADGE, 1) st.takeItems(TAG_OF_RUMOR, 1) st.set("cond", "9") st.playSound("ItemSound.quest_middle") elif npcId == 30651 and cond == 9: htmltext = "30651-03.htm" elif npcId == 30117 and cond == 8: htmltext = "30117-01.htm" st.set("cond", "9") st.playSound("ItemSound.quest_middle") elif npcId == 30117 and cond == 9: htmltext = "30117-02.htm" elif npcId == 30036 and cond == 9: htmltext = "30036-01.htm" st.giveItems(PICTURE_OF_NAHIR, 1) st.set("cond", "10") st.playSound("ItemSound.quest_middle") elif npcId == 30036 and cond == 10: htmltext = "30036-02.htm" elif npcId == 30036 and cond == 11: htmltext = "30036-03.htm" st.giveItems(STATUE_OF_EINHASAD, 1) st.takeItems(PICTURE_OF_NAHIR, 1) st.takeItems(HAIR_OF_NAHIR, 1) st.set("cond", "12") st.playSound("ItemSound.quest_middle") elif npcId == 30036 and cond == 12 and st.getQuestItemsCount( STATUE_OF_EINHASAD): htmltext = "30036-04.htm" elif npcId == 30362 and cond == 12: htmltext = "30362-01.htm" st.set("cond", "13") st.playSound("ItemSound.quest_middle") elif npcId == 30362 and cond == 13: htmltext = "30362-02.htm" elif npcId == 30362 and cond == 15 and st.getQuestItemsCount( BOOK_OF_DARKNESS): htmltext = "30362-03.htm" elif npcId == 30362 and cond == 16: htmltext = "30362-06.htm" elif npcId == 30362 and cond == 15 and st.getQuestItemsCount( BOOK_OF_DARKNESS) == 0: htmltext = "30362-07.htm" elif npcId == 30652 and cond == 14 and st.getQuestItemsCount( DEBRIS_OF_WILLOW): htmltext = "30652-01.htm" elif npcId == 30652 and cond == 15 and st.getQuestItemsCount( BOOK_OF_DARKNESS): htmltext = "30652-03.htm" elif npcId == 30612 and cond == 16: htmltext = "30612-01.htm" st.giveItems(BOOK_OF_SAGE, 1) if st.getQuestItemsCount(BOOK_OF_DARKNESS): st.takeItems(BOOK_OF_DARKNESS, 1) st.set("cond", "17") st.playSound("ItemSound.quest_middle") st.takeItems(GREY_BADGE, 1) st.takeItems(SPIRIT_OF_FLAME, 1) st.takeItems(STATUE_OF_EINHASAD, 1) elif npcId == 30612 and cond == 17: htmltext = "30612-02.htm" return htmltext
def onTalk(self, npc, player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st: return htmltext npcId = npc.getNpcId() id = st.getState() clan = player.getClan() part = st.getInt("part") debug = "" if npcId == SIR_KRISTOF_RODEMAI: if id == State.CREATED: if player.isClanLeader() and clan: level = clan.getLevel() if level <= 2: htmltext = "01" elif level >= 4: htmltext = "02" elif level == 3: if st.getQuestItemsCount( PROOF_OF_ALLIANCE ): #you already have the item, no need to complete the quest! htmltext = "03" else: htmltext = "04" else: htmltext = "05" elif id == State.STARTED: htmltext = "10" if st.getQuestItemsCount(VOUCHER_OF_FAITH) and part == 6: st.playSound("ItemSound.quest_finish") st.takeItems(VOUCHER_OF_FAITH, 1) st.giveItems(PROOF_OF_ALLIANCE, 1) st.addExpAndSp(0, 120000) ObjectId = player.getObjectId() player.broadcastPacket(SocialAction(ObjectId, 3)) st.exitQuest(False) htmltext = "09" elif npcId == WITCH_KALIS: if id == State.CREATED: #not a valid leader (has not started the quest yet) or a clan member leaderst = leader(player) if leaderst: if player.isClanLeader() or leaderst == st: return "You must see Rodemai to start the quest! I cannot help you!" elif leaderst.getState() == State.STARTED: htmltext = "12" elif DEBUG: debug = "Leader needs to start the quest!" elif DEBUG: debug = "Kalis cannot find leader" elif id == State.STARTED: symbol = st.getQuestItemsCount(SYMBOL_OF_LOYALTY) if part == 1: #and not symbol : htmltext = "01" elif part == 2 and symbol < 3: htmltext = "05" elif symbol >= 3 and not isEffected(player, 4082): htmltext = "06" elif part == 5 and st.getQuestItemsCount(HERB_OF_HARIT) and st.getQuestItemsCount(HERB_OF_VANOR) and \ st.getQuestItemsCount(HERB_OF_OEL_MAHUM) and st.getQuestItemsCount(BLOOD_OF_EVA) and isEffected(player,4082): htmltext = "08" st.giveItems(VOUCHER_OF_FAITH, 1) st.giveItems(POTION_OF_RECOVERY, 1) for item in range(3832, 3836) + [ANTIDOTE_RECIPE]: st.takeItems(item, -1) st.set("part", "6") st.set("cond", "4") timer = st.getQuestTimer("poison_timer") if timer != None: timer.cancel() elif part == 3 or part == 4 or part == 5: if not isEffected(player, 4082): htmltext = "09" st.set("part", "1") st.takeItems(ANTIDOTE_RECIPE, -1) else: htmltext = "10" elif part == 6: htmltext = "11" elif DEBUG: debug = "Uhhh....Kalis is confused by player: " + str( player) elif DEBUG: debug = "Leader has already finished the quest!" elif npcId == STATUE_OF_OFFERING: leaderst = leader(player) if leaderst: id = leaderst.getState() if id == State.STARTED: if leaderst.getInt("part") == 2: if player.isClanLeader() or leaderst == st: htmltext = "02" else: if player.getLevel() >= 40: dlist = leaderst.get("dead_list").split() if player.getName( ) not in dlist and len(dlist) < 3: htmltext = "01" else: htmltext = "03" else: htmltext = "04" elif DEBUG: debug = "wrong state for sacrifice" else: htmltext = "08" if DEBUG: debug = "Leader must start the quest or has already finished the quest!" elif DEBUG: debug = "Statue can't find leader" elif npcId == WITCH_ATHREA: leaderst = leader(player) if leaderst: id = leaderst.getState() if id == State.STARTED: part = leaderst.getInt("part") if part == 3 and leaderst.getQuestItemsCount( ANTIDOTE_RECIPE ) and not leaderst.getQuestItemsCount(BLOOD_OF_EVA): htmltext = "01" elif part == 5: htmltext = "10" elif part == 4: htmltext = "06" if leaderst.getInt("chest_wins") >= 4: htmltext = "09" st.giveItems(BLOOD_OF_EVA, 1) leaderst.set("part", "5") elif DEBUG: debug = "You should go seek help elsewhere! I cannot help you in your current state!" elif DEBUG: debug = "You must have the quest started!" elif DEBUG: debug = "Athrea can't find your leader!" if DEBUG and debug: print debug return debug if htmltext.isdigit(): htmltext = str(npcId) + "-" + htmltext + ".htm" return htmltext
def onEvent(self, event, st): htmltext = event player = st.getPlayer() if event == "1": st.set("id", "0") st.set("cond", "1") st.setState(State.STARTED) st.playSound("ItemSound.quest_accept") htmltext = "30585-06.htm" st.giveItems(FIRE_CHARM, 1) elif event == "32057_1": htmltext = "32057-02.htm" st.playSound("ItemSound.quest_middle") st.set("cond", "14") elif event == "32057_2": htmltext = "32057-05.htm" st.playSound("ItemSound.quest_middle") st.set("cond", "21") elif event == "32090_1": htmltext = "32090-04.htm" st.playSound("ItemSound.quest_middle") st.set("cond", "18") elif event == "30585_1": if player.getClassId().getId() != 0x31: if player.getClassId().getId() == 0x32: htmltext = "30585-02a.htm" else: htmltext = "30585-02.htm" else: if player.getLevel() < 18: htmltext = "30585-03.htm" else: if st.getQuestItemsCount(MASK_OF_MEDIUM) != 0: htmltext = "30585-04.htm" else: htmltext = "30585-05.htm" return htmltext elif event == "30585_1a": htmltext = "30585-10a.htm" elif event == "30585_2": htmltext = "30585-11.htm" st.takeItems(TOTEM_SPIRIT_CLAW, 1) st.giveItems(TATARUS_LETTER, 1) st.set("cond", "5") st.playSound("ItemSound.quest_middle") elif event == "30585_3": htmltext = "30585-11a.htm" st.takeItems(TOTEM_SPIRIT_CLAW, 1) st.playSound("ItemSound.quest_middle") st.set("cond", "12") elif event == "30592_1": htmltext = "30592-02.htm" elif event == "30592_2": htmltext = "30592-03.htm" st.takeItems(HESTUI_MASK, 1) st.takeItems(FIERY_EGG2, 1) st.giveItems(TOTEM_SPIRIT_CLAW, 1) st.set("cond", "4") st.playSound("ItemSound.quest_middle") elif event == "30502_2": htmltext = "30502-07.htm" st.takeItems(TOTEM_SPIRIT_BLOOD, st.getQuestItemsCount(TOTEM_SPIRIT_BLOOD)) st.giveItems(MASK_OF_MEDIUM, 1) st.rewardItems(57, 81900) st.addExpAndSp(295862, 18194) player.sendPacket(SocialAction(player.getObjectId(), 3)) player.sendPacket(SocialAction(player.getObjectId(), 15)) st.set("cond", "0") st.exitQuest(False) st.playSound("ItemSound.quest_finish") elif event == "30593_1": htmltext = "30593-02.htm" elif event == "30593_2": htmltext = "30593-03.htm" st.takeItems(BLOOD_CAULDRON, 1) st.giveItems(SPIRIT_NET, 1) st.set("cond", "9") st.playSound("ItemSound.quest_middle") return htmltext
def onTalk (self,npc,player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st : return htmltext npcId = npc.getNpcId() id = st.getState() if npcId != 30416 and id != State.STARTED : return htmltext if id == State.CREATED : st.set("cond","0") st.set("onlyone","0") if npcId == 30416 and st.getInt("cond")==0 : if st.getQuestItemsCount(IRON_HEART) == 0 : htmltext = "30416-01.htm" else: htmltext = "30416-04.htm" elif npcId == 30416 and st.getInt("cond")>=1 : if st.getQuestItemsCount(ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(LEIKANS_NOTE) == 0 and st.getQuestItemsCount(SHILENS_TEARS) == 0 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 1 and st.getQuestItemsCount(IRON_HEART) == 0 : htmltext = "30416-06.htm" st.takeItems(ARKENIA_RECOMMEND,1) st.giveItems(IRON_HEART,1) isFinished = st.getGlobalQuestVar("1ClassQuestFinished") if isFinished == "" : st.rewardItems(57,81900) st.addExpAndSp(295862,21264) player.sendPacket(SocialAction(player.getObjectId(),3)) st.set("cond","0") st.exitQuest(False) st.saveGlobalQuestVar("1ClassQuestFinished","1") st.playSound("ItemSound.quest_finish") elif st.getQuestItemsCount(ARKENIAS_LETTER) == 1 and st.getQuestItemsCount(LEIKANS_NOTE) == 0 and st.getQuestItemsCount(SHILENS_TEARS) == 0 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 0 and st.getQuestItemsCount(IRON_HEART) == 0 and st.getQuestItemsCount(SHILENS_CALL) == 0 : htmltext = "30416-07.htm" elif st.getQuestItemsCount(ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(LEIKANS_NOTE) == 1 and st.getQuestItemsCount(SHILENS_TEARS) == 0 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 0 and st.getQuestItemsCount(IRON_HEART) == 0 and st.getQuestItemsCount(SHILENS_CALL) == 0 : htmltext = "30416-08.htm" elif st.getQuestItemsCount(ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(LEIKANS_NOTE) == 0 and st.getQuestItemsCount(SHILENS_TEARS) == 0 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 0 and st.getQuestItemsCount(IRON_HEART) == 0 and st.getQuestItemsCount(SHILENS_CALL) == 0 : htmltext = "30416-09.htm" elif st.getQuestItemsCount(ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(LEIKANS_NOTE) == 0 and st.getQuestItemsCount(SHILENS_TEARS) == 1 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 0 and st.getQuestItemsCount(IRON_HEART) == 0 and st.getQuestItemsCount(SHILENS_CALL) == 0 : htmltext = "30416-10.htm" elif st.getQuestItemsCount(ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(LEIKANS_NOTE) == 0 and st.getQuestItemsCount(SHILENS_TEARS) == 0 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 0 and st.getQuestItemsCount(IRON_HEART) == 0 and st.getQuestItemsCount(SHILENS_CALL) == 1 : htmltext = "30416-11.htm" elif npcId == 30419 and st.getInt("cond")>=1 : if st.getQuestItemsCount(ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(LEIKANS_NOTE) == 0 and st.getQuestItemsCount(SHILENS_TEARS) == 0 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 0 and st.getQuestItemsCount(IRON_HEART) == 0 and st.getQuestItemsCount(SHILENS_CALL) == 1 : htmltext = "30419-01.htm" elif st.getQuestItemsCount(ARKENIAS_LETTER) == 1 and st.getQuestItemsCount(LEIKANS_NOTE) == 0 and st.getQuestItemsCount(SHILENS_TEARS) == 0 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 0 and st.getQuestItemsCount(IRON_HEART) == 0 and st.getQuestItemsCount(SHILENS_CALL) == 0 : htmltext = "30419-07.htm" elif st.getQuestItemsCount(ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(LEIKANS_NOTE) == 0 and st.getQuestItemsCount(SHILENS_TEARS) == 1 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 0 and st.getQuestItemsCount(IRON_HEART) == 0 and st.getQuestItemsCount(SHILENS_CALL) == 0 : htmltext = "30419-08.htm" st.giveItems(ARKENIA_RECOMMEND,1) st.takeItems(SHILENS_TEARS,1) st.set("cond","7") st.playSound("ItemSound.quest_middle") elif st.getQuestItemsCount(ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(LEIKANS_NOTE) == 0 and st.getQuestItemsCount(SHILENS_TEARS) == 0 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 1 and st.getQuestItemsCount(IRON_HEART) == 0 and st.getQuestItemsCount(SHILENS_CALL) == 0 : htmltext = "30419-09.htm" elif st.getQuestItemsCount(ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(LEIKANS_NOTE) == 1 and st.getQuestItemsCount(SHILENS_TEARS) == 0 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 0 and st.getQuestItemsCount(IRON_HEART) == 0 and st.getQuestItemsCount(SHILENS_CALL) == 0 : htmltext = "30419-10.htm" elif st.getQuestItemsCount(ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(LEIKANS_NOTE) == 0 and st.getQuestItemsCount(SHILENS_TEARS) == 0 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 0 and st.getQuestItemsCount(IRON_HEART) == 0 and st.getQuestItemsCount(SHILENS_CALL) == 0 : htmltext = "30419-11.htm" elif npcId == 30382 and st.getInt("cond")>=1 : if st.getQuestItemsCount(ARKENIAS_LETTER) == 1 and st.getQuestItemsCount(LEIKANS_NOTE) == 0 and st.getQuestItemsCount(SHILENS_TEARS) == 0 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 0 and st.getQuestItemsCount(IRON_HEART) == 0 and st.getQuestItemsCount(SHILENS_CALL) == 0 and st.getQuestItemsCount(ONYX_BEASTS_MOLAR) == 0 : htmltext = "30382-01.htm" elif st.getQuestItemsCount(ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(LEIKANS_NOTE) == 1 and st.getQuestItemsCount(SHILENS_TEARS) == 0 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 0 and st.getQuestItemsCount(IRON_HEART) == 0 and st.getQuestItemsCount(SHILENS_CALL) == 0 and st.getQuestItemsCount(ONYX_BEASTS_MOLAR) == 0 : htmltext = "30382-05.htm" elif st.getQuestItemsCount(ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(LEIKANS_NOTE) == 1 and st.getQuestItemsCount(SHILENS_TEARS) == 0 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 0 and st.getQuestItemsCount(IRON_HEART) == 0 and st.getQuestItemsCount(SHILENS_CALL) == 0 and st.getQuestItemsCount(ONYX_BEASTS_MOLAR)<10 : htmltext = "30382-06.htm" elif st.getQuestItemsCount(ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(LEIKANS_NOTE) == 1 and st.getQuestItemsCount(SHILENS_TEARS) == 0 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 0 and st.getQuestItemsCount(IRON_HEART) == 0 and st.getQuestItemsCount(SHILENS_CALL) == 0 and st.getQuestItemsCount(ONYX_BEASTS_MOLAR) >= 10 : st.set("cond","5") st.playSound("ItemSound.quest_middle") htmltext = "30382-07.htm" st.takeItems(ONYX_BEASTS_MOLAR,10) st.takeItems(LEIKANS_NOTE,1) elif st.getQuestItemsCount(SHILENS_TEARS) == 1 : htmltext = "30382-08.htm" elif st.getInt("cond") >= 1 and st.getQuestItemsCount(ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(LEIKANS_NOTE) == 0 and st.getQuestItemsCount(SHILENS_TEARS) == 0 and st.getQuestItemsCount(ARKENIA_RECOMMEND) == 0 and st.getQuestItemsCount(IRON_HEART) == 0 and st.getQuestItemsCount(SHILENS_CALL) == 0 and st.getQuestItemsCount(ONYX_BEASTS_MOLAR) == 0 : htmltext = "30382-09.htm" return htmltext
def onTalk(self, npc, player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st: return htmltext npcId = npc.getNpcId() id = st.getState() if npcId != 30514 and id != State.STARTED: return htmltext if id == State.CREATED: # Check if is starting the quest st.set("cond", "0") st.set("id", "0") if npcId == 30514: if player.getRace().ordinal() == 3 and player.getClassId( ).getId() in [45, 47, 50]: if player.getLevel() >= 37: htmltext = "30514-03.htm" else: htmltext = "30514-01.htm" st.exitQuest(1) else: htmltext = "30514-02.htm" st.exitQuest(1) elif id == State.COMPLETED: # Check if the quest is already made if npcId == 30514: htmltext = "<html><body>This quest has already been completed.</body></html>" else: # The quest it self try: cond = st.getInt("cond") except: cond = None # Default text after condition 4 for the bellow NPCs if npcId == 30501 and cond >= 5: htmltext = "30501-11.htm" elif npcId == 30515 and cond >= 5: htmltext = "30515-08.htm" elif npcId == 30615 and cond >= 5: htmltext = "30615-08.htm" elif npcId == 30616 and cond >= 5: htmltext = "30616-08.htm" elif npcId == 30617 and cond >= 5: htmltext = "30617-07.htm" elif npcId == 30618 and cond >= 5: htmltext = "30618-05.htm" elif npcId == 30619 and cond >= 5: htmltext = "30619-07.htm" elif npcId == 30565 and cond in [8, 9, 10]: # Paagrio Lord Kakai htmltext = "30565-01.htm" # Condition Oriented code for optimal performance elif cond == 1: # Trial of Vokian if npcId == 30514 and st.getQuestItemsCount( VOKIYANS_ORDER1 ) and (st.getQuestItemsCount(MANASHEN_SHARD) < 10 or st.getQuestItemsCount(TYRANT_TALON) < 10 or st.getQuestItemsCount(GUARDIAN_BASILISK_FANG) < 10): htmltext = "30514-06.htm" # Begin of the cross compatible code elif CROSS_COMPATIBLE: if st.getQuestItemsCount( VOKIYANS_ORDER1) and st.getQuestItemsCount( MANASHEN_SHARD ) == 10 and st.getQuestItemsCount( TYRANT_TALON) == 10 and st.getQuestItemsCount( GUARDIAN_BASILISK_FANG) == 10: st.set("cond", "2") elif st.getQuestItemsCount( NECKLACE_OF_AUTHORITY) and st.getQuestItemsCount( VOKIYANS_ORDER2): st.set("cond", "3") elif st.getQuestItemsCount( NECKLACE_OF_AUTHORITY) and st.getQuestItemsCount( CHIANTAS_ORDER1): st.set("cond", "4") elif st.getQuestItemsCount(NECKLACE_OF_AUTHORITY) and ( st.getQuestItemsCount(CHIANTAS_ORDER2) or (st.getQuestItemsCount(CHIANTAS_ORDER1) and st.getQuestItemsCount(SCEPTER_OF_BREKA) and st.getQuestItemsCount(SCEPTER_OF_VUKU) and st.getQuestItemsCount(SCEPTER_OF_TUREK) and st.getQuestItemsCount(SCEPTER_OF_TUNATH) and st.getQuestItemsCount(SCEPTER_OF_ENKU))): st.set("cond", "5") elif st.getQuestItemsCount( NECKLACE_OF_AUTHORITY) and st.getQuestItemsCount( CHIANTAS_ORDER3): if st.getQuestItemsCount( TAMLIN_ORC_SKULL ) == 20 and st.getQuestItemsCount( TIMAK_ORC_HEAD) == 20: st.set("cond", "7") else: st.set("cond", "6") elif st.getQuestItemsCount(SCEPTER_BOX): st.set("cond", "8") elif st.getQuestItemsCount(TANAPIS_ORDER1): if st.getQuestItemsCount(SCEPTER_OF_TANTOS): st.set("cond", "10") else: st.set("cond", "9") elif st.getQuestItemsCount(RITUAL_BOX): st.set("cond", "11") # end of the cross compatible code elif cond == 2: # Return to Vokian if npcId == 30514: if st.getQuestItemsCount( VOKIYANS_ORDER1) and st.getQuestItemsCount( MANASHEN_SHARD ) == 10 and st.getQuestItemsCount( TYRANT_TALON) == 10 and st.getQuestItemsCount( GUARDIAN_BASILISK_FANG) == 10: htmltext = "30514-08.htm" st.giveItems(VOKIYANS_ORDER2, 1) st.giveItems(NECKLACE_OF_AUTHORITY, 1) st.set("cond", "3") st.takeItems(VOKIYANS_ORDER1, 1) st.takeItems(MANASHEN_SHARD, 10) st.takeItems(TYRANT_TALON, 10) st.takeItems(GUARDIAN_BASILISK_FANG, 10) elif cond == 3: # Chianta, Chief of the Gandi Tribe if npcId == 30514: htmltext = "30514-09.htm" elif npcId == 30642 and st.getQuestItemsCount( NECKLACE_OF_AUTHORITY) and st.getQuestItemsCount( VOKIYANS_ORDER2): htmltext = "30642-01.htm" elif cond == 4: # Five Unique and Honorable Deaths if npcId == 30514 and st.getQuestItemsCount(VOKIYANS_ORDER2): htmltext = "30514-10.htm" elif npcId == 30642: htmltext = "30642-04.htm" elif npcId == 30515 and st.getQuestItemsCount( NECKLACE_OF_AUTHORITY) and st.getQuestItemsCount( CHIANTAS_ORDER1): htmltext = "30515-01.htm" elif npcId == 30501 and st.getQuestItemsCount( NECKLACE_OF_AUTHORITY) and st.getQuestItemsCount( CHIANTAS_ORDER1): htmltext = "30501-01.htm" elif npcId == 30615: # Chief of Breka Orcs if st.getQuestItemsCount(MANAKIAS_LETTER1): htmltext = "30615-02.htm" elif st.getQuestItemsCount(GLOVE_OF_VOLTAR): htmltext = "30615-05.htm" st.playSound("Itemsound.quest_before_battle") st.addSpawn(27080, 80117, 120039, -2259) st.addSpawn(27081, 80058, 120038, -2259) elif st.getQuestItemsCount( PASHIKAS_HEAD) and st.getQuestItemsCount( VULTUS_HEAD): htmltext = "30615-06.htm" st.giveItems(SCEPTER_OF_BREKA, 1) st.takeItems(PASHIKAS_HEAD, 1) st.takeItems(VULTUS_HEAD, 1) if st.getQuestItemsCount( SCEPTER_OF_BREKA) and st.getQuestItemsCount( SCEPTER_OF_ENKU) and st.getQuestItemsCount( SCEPTER_OF_VUKU ) and st.getQuestItemsCount( SCEPTER_OF_TUREK ) and st.getQuestItemsCount( SCEPTER_OF_TUNATH): st.set("cond", "5") st.playSound("Itemsound.quest_middle") else: st.playSound("Itemsound.quest_itemget") elif st.getQuestItemsCount(SCEPTER_OF_BREKA): htmltext = "30615-07.htm" else: htmltext = "30615-01.htm" elif npcId == 30616: # Chief of Enku Orcs if st.getQuestItemsCount(MANAKIAS_LETTER2): htmltext = "30616-02.htm" elif st.getQuestItemsCount(GLOVE_OF_KEPRA): htmltext = "30616-05.htm" st.playSound("Itemsound.quest_before_battle") st.addSpawn(27082, 17710, 189813, -3581) st.addSpawn(27082, 17674, 189798, -3581) st.addSpawn(27082, 17770, 189852, -3581) st.addSpawn(27082, 17803, 189873, -3581) elif st.getQuestItemsCount(ENKU_OVERLORD_HEAD) == 4: htmltext = "30616-06.htm" st.giveItems(SCEPTER_OF_ENKU, 1) st.takeItems(ENKU_OVERLORD_HEAD, 4) if st.getQuestItemsCount( SCEPTER_OF_BREKA) and st.getQuestItemsCount( SCEPTER_OF_ENKU) and st.getQuestItemsCount( SCEPTER_OF_VUKU ) and st.getQuestItemsCount( SCEPTER_OF_TUREK ) and st.getQuestItemsCount( SCEPTER_OF_TUNATH): st.set("cond", "5") st.playSound("Itemsound.quest_middle") else: st.playSound("Itemsound.quest_itemget") elif st.getQuestItemsCount(SCEPTER_OF_ENKU): htmltext = "30616-07.htm" else: htmltext = "30616-01.htm" elif npcId == 30617: # Chief of Turek Orcs if st.getQuestItemsCount(KASMANS_LETTER2): htmltext = "30617-02.htm" elif st.getQuestItemsCount(GLOVE_OF_BURAI): htmltext = "30617-05.htm" st.playSound("Itemsound.quest_before_battle") st.addSpawn(27083, -94292, 110781, -3701) st.addSpawn(27083, -94293, 110861, -3701) elif st.getQuestItemsCount(MAKUM_BUGBEAR_HEAD) == 2: htmltext = "30617-06.htm" st.giveItems(SCEPTER_OF_TUREK, 1) st.takeItems(MAKUM_BUGBEAR_HEAD, 2) if st.getQuestItemsCount( SCEPTER_OF_BREKA) and st.getQuestItemsCount( SCEPTER_OF_ENKU) and st.getQuestItemsCount( SCEPTER_OF_VUKU ) and st.getQuestItemsCount( SCEPTER_OF_TUREK ) and st.getQuestItemsCount( SCEPTER_OF_TUNATH): st.set("cond", "5") st.playSound("Itemsound.quest_middle") else: st.playSound("Itemsound.quest_itemget") elif st.getQuestItemsCount(SCEPTER_OF_TUREK): htmltext = "30617-07.htm" else: htmltext = "30617-01.htm" elif npcId == 30618: # Chief of Tunath Orcs if st.getQuestItemsCount(KASMANS_LETTER3): htmltext = "30618-02.htm" elif st.getQuestItemsCount(SCEPTER_OF_TUNATH): htmltext = "30618-04.htm" else: htmltext = "30618-01.htm" elif npcId == 30619: # Chief of Vuku Orcs if st.getQuestItemsCount(KASMANS_LETTER1): htmltext = "30619-02.htm" elif st.getQuestItemsCount(DRIKOS_CONTRACT): if st.getQuestItemsCount(STAKATO_DRONE_HUSK1) == 30: htmltext = "30619-05.htm" st.giveItems(SCEPTER_OF_VUKU, 1) st.takeItems(STAKATO_DRONE_HUSK1, 30) st.takeItems(DRIKOS_CONTRACT, 1) if st.getQuestItemsCount( SCEPTER_OF_BREKA ) and st.getQuestItemsCount( SCEPTER_OF_ENKU) and st.getQuestItemsCount( SCEPTER_OF_VUKU ) and st.getQuestItemsCount( SCEPTER_OF_TUREK ) and st.getQuestItemsCount( SCEPTER_OF_TUNATH): st.set("cond", "5") st.playSound("Itemsound.quest_middle") else: st.playSound("Itemsound.quest_itemget") else: htmltext = "30619-04.htm" elif st.getQuestItemsCount(SCEPTER_OF_VUKU): htmltext = "30619-06.htm" else: htmltext = "30619-01.htm" elif cond == 5: # Return to Chianta if npcId == 30642 and st.getQuestItemsCount( NECKLACE_OF_AUTHORITY): if st.getQuestItemsCount( CHIANTAS_ORDER1) and st.getQuestItemsCount( SCEPTER_OF_BREKA) and st.getQuestItemsCount( SCEPTER_OF_VUKU) and st.getQuestItemsCount( SCEPTER_OF_TUREK ) and st.getQuestItemsCount( SCEPTER_OF_TUNATH ) and st.getQuestItemsCount( SCEPTER_OF_ENKU): htmltext = "30642-05.htm" elif st.getQuestItemsCount(CHIANTAS_ORDER2): if player.getLevel() >= 38: htmltext = "30642-09.htm" st.giveItems(CHIANTAS_ORDER3, 1) st.set("cond", "6") st.takeItems(CHIANTAS_ORDER2, 1) else: htmltext = "30642-08.htm" elif cond == 6: # Punish The Betrayers if npcId == 30642 and st.getQuestItemsCount( NECKLACE_OF_AUTHORITY) and st.getQuestItemsCount( CHIANTAS_ORDER3): htmltext = "30642-10.htm" elif cond == 7: # The Punishment Ends if npcId == 30642 and st.getQuestItemsCount( TAMLIN_ORC_SKULL) == 20 and st.getQuestItemsCount( TIMAK_ORC_HEAD) == 20: st.giveItems(SCEPTER_BOX, 1) st.set("cond", "8") st.takeItems(NECKLACE_OF_AUTHORITY, 1) st.takeItems(CHIANTAS_ORDER3, 1) st.takeItems(TAMLIN_ORC_SKULL, 20) st.takeItems(TIMAK_ORC_HEAD, 20) htmltext = "30642-11.htm" elif cond == 8: # Priest of the Immortal Plateau if npcId == 30642 and st.getQuestItemsCount(SCEPTER_BOX): htmltext = "30642-12.htm" elif npcId == 30571 and st.getQuestItemsCount(SCEPTER_BOX): htmltext = "30571-01.htm" elif cond == 9: # The Scepter of Tantos if npcId == 30571 and st.getQuestItemsCount(TANAPIS_ORDER1): htmltext = "30571-04.htm" elif npcId == 30642 and st.getQuestItemsCount(TANAPIS_ORDER1): htmltext = "30642-13.htm" elif cond == 10: # Recovered Scepter of Tantos if npcId == 30571 and st.getQuestItemsCount( TANAPIS_ORDER1) and st.getQuestItemsCount( SCEPTER_OF_TANTOS): htmltext = "30571-05.htm" st.giveItems(RITUAL_BOX, 1) st.set("cond", "11") st.takeItems(SCEPTER_OF_TANTOS, 1) st.takeItems(TANAPIS_ORDER1, 1) elif cond == 11: # To the Lord of Flame if npcId == 30571 and st.getQuestItemsCount(RITUAL_BOX): htmltext = "30571-06.htm" elif npcId == 30565 and st.getQuestItemsCount(RITUAL_BOX): player.sendPacket(SocialAction(player.getObjectId(), 3)) st.addExpAndSp(724113, 48324) st.rewardItems(57, 131360) st.rewardItems(7562, 109) htmltext = "30565-02.htm" st.giveItems(MARK_OF_GLORY, 1) st.takeItems(RITUAL_BOX, 1) st.set("cond", "0") st.exitQuest(False) st.playSound("ItemSound.quest_finish") else: htmltext = "30565-01.htm" return htmltext
def onTalk(self, npc, player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st: return htmltext npcId = npc.getNpcId() id = st.getState() if npcId != 30329 and id != State.STARTED: return htmltext npcId = npc.getNpcId() htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" id = st.getState() if npcId == 30329 and st.getInt("cond") == 0: htmltext = "30329-01.htm" elif npcId == 30329 and st.getInt("cond"): if st.getQuestItemsCount( PALLUS_TALISMAN) == 1 and st.getQuestItemsCount( LYCANTHROPE_SKULL) == 0: htmltext = "30329-07.htm" elif st.getQuestItemsCount( PALLUS_TALISMAN) == 1 and st.getQuestItemsCount( LYCANTHROPE_SKULL) > 0 and st.getQuestItemsCount( LYCANTHROPE_SKULL) < 13: htmltext = "30329-08.htm" elif st.getQuestItemsCount( PALLUS_TALISMAN ) == 1 and st.getQuestItemsCount(LYCANTHROPE_SKULL) >= 13: htmltext = "30329-09.htm" elif st.getQuestItemsCount(COFFIN_ETERNAL_REST) == 1: htmltext = "30329-11.htm" st.takeItems(COFFIN_ETERNAL_REST, 1) st.giveItems(GAZE_OF_ABYSS, 1) st.rewardItems(57, 81900) st.addExpAndSp(295862, 19804) player.sendPacket(SocialAction(player.getObjectId(), 3)) st.set("cond", "0") st.exitQuest(False) st.playSound("ItemSound.quest_finish") elif st.getQuestItemsCount( MORTE_TALISMAN) or st.getQuestItemsCount(VIRGILS_LETTER): htmltext = "30329-12.htm" elif npcId == 30422 and st.getInt("cond"): if st.getQuestItemsCount(VIRGILS_LETTER): htmltext = "30422-01.htm" elif st.getQuestItemsCount( MORTE_TALISMAN) and st.getQuestItemsCount( TRIMDEN_SILK) == 0 and st.getQuestItemsCount( PREDATOR_CARAPACE) == 0: htmltext = "30422-03.htm" elif st.getQuestItemsCount( MORTE_TALISMAN) and st.getQuestItemsCount( TRIMDEN_SILK) > 0 and st.getQuestItemsCount( PREDATOR_CARAPACE) == 0: htmltext = "30422-04.htm" elif st.getQuestItemsCount( MORTE_TALISMAN) and st.getQuestItemsCount( TRIMDEN_SILK ) == 0 and st.getQuestItemsCount(PREDATOR_CARAPACE) > 0: htmltext = "30422-04.htm" elif st.getQuestItemsCount( MORTE_TALISMAN) and st.getQuestItemsCount( TRIMDEN_SILK) >= 5 and st.getQuestItemsCount( PREDATOR_CARAPACE) > 0: htmltext = "30422-05.htm" return htmltext
def onTalk(self, npc, player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st: return htmltext npcId = npc.getNpcId() id = st.getState() cond = st.getInt("cond") if npcId != 30587 and id != State.STARTED: return htmltext if npcId == 30587 and st.getInt("cond") == 0 and st.getInt( "onlyone") == 0: htmltext = "30587-01.htm" elif npcId == 30587 and st.getInt("cond") == 0 and st.getInt( "onlyone") == 1: htmltext = "30587-04.htm" elif npcId == 30587 and st.getInt("cond") and st.getQuestItemsCount( SCROLL_FIERY_SPIRIT) == 0 and st.getQuestItemsCount( POMEGRANATE) == 1 and st.getQuestItemsCount( GANTAKIS_LETTER) == 0 and st.getQuestItemsCount( ROSHEEKS_LETTER) == 0 and ( (st.getQuestItemsCount(LEATHER_POUCH1) + st.getQuestItemsCount(LEATHER_POUCH2) + st.getQuestItemsCount(LEATHER_POUCH3) + st.getQuestItemsCount(LEATHER_POUCH1FULL) + st.getQuestItemsCount(LEATHER_POUCH2FULL) + st.getQuestItemsCount(LEATHER_POUCH3FULL)) == 0): htmltext = "30587-07.htm" elif npcId == 30587 and st.getInt("cond") and st.getQuestItemsCount( SCROLL_FIERY_SPIRIT) == 0 and st.getQuestItemsCount( POMEGRANATE) == 0 and st.getQuestItemsCount( GANTAKIS_LETTER) == 0 and st.getQuestItemsCount( ROSHEEKS_LETTER) == 0 and ( (st.getQuestItemsCount(LEATHER_POUCH1) + st.getQuestItemsCount(LEATHER_POUCH2) + st.getQuestItemsCount(LEATHER_POUCH3) + st.getQuestItemsCount(LEATHER_POUCH1FULL) + st.getQuestItemsCount(LEATHER_POUCH2FULL) + st.getQuestItemsCount(LEATHER_POUCH3FULL)) == 1): htmltext = "30587-08.htm" elif npcId == 30587 and st.getInt("cond") and st.getQuestItemsCount( SCROLL_FIERY_SPIRIT) == 1 and st.getQuestItemsCount( POMEGRANATE) == 0 and st.getQuestItemsCount( GANTAKIS_LETTER) == 0 and st.getQuestItemsCount( ROSHEEKS_LETTER) == 1 and ( (st.getQuestItemsCount(LEATHER_POUCH1) + st.getQuestItemsCount(LEATHER_POUCH2) + st.getQuestItemsCount(LEATHER_POUCH3) + st.getQuestItemsCount(LEATHER_POUCH1FULL) + st.getQuestItemsCount(LEATHER_POUCH2FULL) + st.getQuestItemsCount(LEATHER_POUCH3FULL)) == 0): htmltext = "30587-09.htm" elif npcId == 30587 and st.getInt("cond") >= 14: htmltext = "30587-09b.htm" elif npcId == 30587 and st.getInt("cond") and st.getQuestItemsCount( SCROLL_FIERY_SPIRIT) == 1 and st.getQuestItemsCount( POMEGRANATE) == 0 and st.getQuestItemsCount( GANTAKIS_LETTER) == 1 and st.getQuestItemsCount( ROSHEEKS_LETTER) == 0 and ( (st.getQuestItemsCount(LEATHER_POUCH1) + st.getQuestItemsCount(LEATHER_POUCH2) + st.getQuestItemsCount(LEATHER_POUCH3) + st.getQuestItemsCount(LEATHER_POUCH1FULL) + st.getQuestItemsCount(LEATHER_POUCH2FULL) + st.getQuestItemsCount(LEATHER_POUCH3FULL)) == 0): htmltext = "30587-10.htm" elif npcId == 30587 and st.getInt("cond") and st.getQuestItemsCount( SCROLL_FIERY_SPIRIT) == 1 and st.getQuestItemsCount( POMEGRANATE) == 0 and st.getQuestItemsCount( GANTAKIS_LETTER) == 0 and st.getQuestItemsCount( ROSHEEKS_LETTER) == 0 and ( (st.getQuestItemsCount(LEATHER_POUCH1) + st.getQuestItemsCount(LEATHER_POUCH2) + st.getQuestItemsCount(LEATHER_POUCH3) + st.getQuestItemsCount(LEATHER_POUCH1FULL) + st.getQuestItemsCount(LEATHER_POUCH2FULL) + st.getQuestItemsCount(LEATHER_POUCH3FULL)) == 0): htmltext = "30587-11.htm" elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount( POMEGRANATE): htmltext = "30590-01.htm" st.takeItems(POMEGRANATE, 1) st.giveItems(LEATHER_POUCH1, 1) st.set("cond", "2") st.playSound("ItemSound.quest_middle") elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount( LEATHER_POUCH1) and st.getQuestItemsCount( LEATHER_POUCH1FULL) == 0: htmltext = "30590-02.htm" elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount( LEATHER_POUCH1) == 0 and st.getQuestItemsCount( LEATHER_POUCH1FULL): htmltext = "30590-03.htm" st.takeItems(LEATHER_POUCH1FULL, 1) st.giveItems(LEATHER_POUCH2, 1) st.set("cond", "4") st.playSound("ItemSound.quest_middle") elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount( LEATHER_POUCH2) == 1 and st.getQuestItemsCount( LEATHER_POUCH2FULL) == 0: htmltext = "30590-04.htm" elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount( LEATHER_POUCH2) == 0 and st.getQuestItemsCount( LEATHER_POUCH2FULL) == 1: htmltext = "30590-05.htm" st.takeItems(LEATHER_POUCH2FULL, 1) st.giveItems(LEATHER_POUCH3, 1) st.set("cond", "6") st.playSound("ItemSound.quest_middle") elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount( LEATHER_POUCH3) == 1 and st.getQuestItemsCount( LEATHER_POUCH3FULL) == 0: htmltext = "30590-06.htm" elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount( LEATHER_POUCH3) == 0 and st.getQuestItemsCount( LEATHER_POUCH3FULL) == 1: htmltext = "30590-07.htm" st.takeItems(LEATHER_POUCH3FULL, 1) st.giveItems(SCROLL_FIERY_SPIRIT, 1) st.giveItems(ROSHEEKS_LETTER, 1) st.set("cond", "8") st.playSound("ItemSound.quest_middle") elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount( ROSHEEKS_LETTER) == 1 and st.getQuestItemsCount( SCROLL_FIERY_SPIRIT) == 1: htmltext = "30590-08.htm" elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount( ROSHEEKS_LETTER) == 0 and st.getQuestItemsCount( SCROLL_FIERY_SPIRIT) == 1: htmltext = "30590-09.htm" elif npcId == 30501 and st.getInt("cond") and st.getQuestItemsCount( GANTAKIS_LETTER): htmltext = "30501-01.htm" st.takeItems(GANTAKIS_LETTER, 1) st.giveItems(FIG, 1) st.set("cond", "10") st.playSound("ItemSound.quest_middle") elif npcId == 30501 and st.getInt("cond") and st.getQuestItemsCount( FIG) and (st.getQuestItemsCount(LEATHER_PURSE4) == 0 or st.getQuestItemsCount(LEATHER_POUCH4FULL) == 0): htmltext = "30501-02.htm" elif npcId == 30501 and st.getInt("cond") and st.getQuestItemsCount( FIG) == 0 and (st.getQuestItemsCount(LEATHER_PURSE4) == 1 or st.getQuestItemsCount(LEATHER_POUCH4FULL) == 1): htmltext = "30501-03.htm" elif npcId == 30501 and st.getInt("cond") and st.getQuestItemsCount( SCROLL_IRON_WILL): htmltext = "30501-04.htm" st.takeItems(SCROLL_IRON_WILL, 1) st.takeItems(SCROLL_FIERY_SPIRIT, 1) st.takeItems(TORUKUS_LETTER, 1) st.giveItems(KHAVATARI_TOTEM, 1) st.rewardItems(57, 81900) st.addExpAndSp(295862, 19344) player.sendPacket(SocialAction(player.getObjectId(), 3)) st.set("cond", "0") st.set("onlyone", "1") st.exitQuest(False) st.playSound("ItemSound.quest_finish") elif npcId == 30591 and st.getInt("cond") and st.getQuestItemsCount( FIG): htmltext = "30591-01.htm" st.takeItems(FIG, 1) st.giveItems(LEATHER_PURSE4, 1) st.set("cond", "11") st.playSound("ItemSound.quest_middle") elif npcId == 30591 and st.getInt("cond") and st.getQuestItemsCount( LEATHER_PURSE4) and st.getQuestItemsCount( LEATHER_POUCH4FULL) == 0: htmltext = "30591-02.htm" elif npcId == 30591 and st.getInt("cond") and st.getQuestItemsCount( LEATHER_PURSE4) == 0 and st.getQuestItemsCount( LEATHER_POUCH4FULL) == 1: htmltext = "30591-03.htm" st.takeItems(LEATHER_POUCH4FULL, 1) st.giveItems(SCROLL_IRON_WILL, 1) st.giveItems(TORUKUS_LETTER, 1) st.set("cond", "13") st.playSound("ItemSound.quest_middle") elif npcId == 30591 and st.getInt("cond") and st.getQuestItemsCount( SCROLL_IRON_WILL) == 1 and st.getQuestItemsCount( TORUKUS_LETTER) == 1: htmltext = "30591-04.htm" elif npcId == 32056: if cond == 14: htmltext = "32056-01.htm" elif cond == 15: htmltext = "32056-04.htm" elif cond == 16: htmltext = "32056-05.htm" st.set("cond", "17") st.playSound("ItemSound.quest_middle") st.takeItems(8545, -1) elif cond == 17: htmltext = "32056-06.htm" elif cond == 18: htmltext = "32056-07.htm" elif cond == 19: htmltext = "32056-09.htm" elif npcId == 31979: if cond == 19: htmltext = "31979-01.htm" return htmltext
def onTalk (self,npc,player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st : return htmltext npcId = npc.getNpcId() id = st.getState() if npcId != KARUKIA and id != State.STARTED : return htmltext playerClassID = player.getClassId().getId() playerLvl = player.getLevel() cond = st.getInt("cond") if npcId == KARUKIA and cond == 0 : if playerLvl >= 18 and playerClassID == 0x2c and st.getQuestItemsCount(MARK_OF_RAIDER) == 0 and st.getQuestItemsCount(GOBLIN_DWELLING_MAP) == 0 : htmltext = "30570-01.htm" elif playerClassID != 0x2c : if playerClassID == 0x2d : htmltext = "30570-02a.htm" else: htmltext = "30570-03.htm" elif playerLvl < 18 and playerClassID == 0x2c : htmltext = "30570-02.htm" elif playerLvl >= 18 and playerClassID == 0x2c and st.getQuestItemsCount(MARK_OF_RAIDER) == 1 : htmltext = "30570-04.htm" else: htmltext = "30570-02.htm" elif npcId == KARUKIA and cond and st.getQuestItemsCount(GOBLIN_DWELLING_MAP) == 1 and st.getQuestItemsCount(KURUKA_RATMAN_TOOTH) < 10 : htmltext = "30570-06.htm" elif npcId == KARUKIA and cond and st.getQuestItemsCount(GOBLIN_DWELLING_MAP) == 1 and st.getQuestItemsCount(KURUKA_RATMAN_TOOTH) >= 10 and st.getQuestItemsCount(BETRAYER_UMBAR_REPORT) == 0 : htmltext = "30570-07.htm" elif npcId == KARUKIA and cond >5 : htmltext = "30570-07b.htm" elif npcId == KARUKIA and cond and st.getQuestItemsCount(BETRAYER_UMBAR_REPORT) and st.getQuestItemsCount(HEAD_OF_BETRAYER) < 2 : htmltext = "30570-08.htm" elif npcId == KARUKIA and cond and st.getQuestItemsCount(BETRAYER_UMBAR_REPORT) and st.getQuestItemsCount(HEAD_OF_BETRAYER) == 2 : htmltext = "30570-09.htm" elif npcId == KASMAN and cond and st.getQuestItemsCount(BETRAYER_UMBAR_REPORT) and st.getQuestItemsCount(HEAD_OF_BETRAYER) == 0 : htmltext = "30501-01.htm" elif npcId == KASMAN and cond and st.getQuestItemsCount(HEAD_OF_BETRAYER) > 0 and st.getQuestItemsCount(HEAD_OF_BETRAYER) < 2 : htmltext = "30501-02.htm" elif npcId == KASMAN and cond and st.getQuestItemsCount(HEAD_OF_BETRAYER) == 2 : htmltext = "30501-03.htm" st.rewardItems(57,81900) st.takeItems(HEAD_OF_BETRAYER,-1) st.takeItems(BETRAYER_UMBAR_REPORT,-1) st.giveItems(MARK_OF_RAIDER,1) st.addExpAndSp(295862,17354) player.sendPacket(SocialAction(player.getObjectId(),3)) st.unset("cond") st.exitQuest(False) st.playSound("ItemSound.quest_finish") elif npcId == TAZEER: if cond == 5: htmltext = "31978-01.htm" elif cond == 6: htmltext = "31978-04.htm" elif cond == 7: htmltext = "31978-05.htm" st.takeItems(TIMORA_ORC_HEAD,-1) st.giveItems(MARK_OF_RAIDER,1) st.rewardItems(57,81900) st.addExpAndSp(160267,10656) player.sendPacket(SocialAction(player.getObjectId(),3)) st.unset("cond") st.exitQuest(False) st.playSound("ItemSound.quest_finish") return htmltext
def onTalk(self, npc, player): npcId = npc.getNpcId() htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st: return htmltext id = st.getState() if npcId == 30218 and st.getInt("cond") == 0 and st.getInt( "onlyone") == 0: if player.getLevel() >= 10 and player.getRace().ordinal() == 1: htmltext = "30218-02.htm" return htmltext elif player.getRace().ordinal() != 1: htmltext = "30218-00.htm" st.exitQuest(1) else: htmltext = "30218-10.htm" st.exitQuest(1) elif npcId == 30218 and st.getInt("cond") == 0 and st.getInt( "onlyone") == 1: htmltext = "<html><body>This quest has already been completed.</body></html>" elif npcId == 30218 and st.getInt("cond"): if st.getQuestItemsCount(KABOO_CHIEF_TORC1): htmltext = "30218-06.htm" if st.getQuestItemsCount(KENDNELLS_ORDER1): st.takeItems(KENDNELLS_ORDER1, 1) if st.getQuestItemsCount(KENDNELLS_ORDER2): st.takeItems(KENDNELLS_ORDER2, 1) if st.getQuestItemsCount(KENDNELLS_ORDER3): st.takeItems(KENDNELLS_ORDER3, 1) if st.getQuestItemsCount(KENDNELLS_ORDER4): st.takeItems(KENDNELLS_ORDER4, 1) st.takeItems(KABOO_CHIEF_TORC1, 1) n = st.getRandom(100) if n < 25: st.giveItems(KENDNELLS_ORDER5, 1) elif n < 50: st.giveItems(KENDNELLS_ORDER6, 1) elif n < 75: st.giveItems(KENDNELLS_ORDER7, 1) else: st.giveItems(KENDNELLS_ORDER8, 1) st.set("cond", "3") elif st.getQuestItemsCount( KENDNELLS_ORDER1) or st.getQuestItemsCount( KENDNELLS_ORDER2) or st.getQuestItemsCount( KENDNELLS_ORDER3) or st.getQuestItemsCount( KENDNELLS_ORDER4): htmltext = "30218-05.htm" elif st.getQuestItemsCount(KABOO_CHIEF_TORC2): if st.getInt("id") != 105: st.set("id", "105") htmltext = "30218-08.htm" if st.getQuestItemsCount(KENDNELLS_ORDER5): st.takeItems(KENDNELLS_ORDER5, 1) if st.getQuestItemsCount(KENDNELLS_ORDER6): st.takeItems(KENDNELLS_ORDER6, 1) if st.getQuestItemsCount(KENDNELLS_ORDER7): st.takeItems(KENDNELLS_ORDER7, 1) if st.getQuestItemsCount(KENDNELLS_ORDER8): st.takeItems(KENDNELLS_ORDER8, 1) st.takeItems(KABOO_CHIEF_TORC2, 1) newbie = player.getNewbie() mage = player.getClassId().isMage() st.rewardItems(57, 17599) if mage: st.giveItems(RED_SUNSET_STAFF, 1) st.giveItems(SPIRITSHOT_NO_GRADE, 500) else: st.giveItems(RED_SUNSET_SWORD, 1) st.giveItems(SOULSHOT_NO_GRADE, 1000) if newbie | NEWBIE_REWARD != newbie: player.setNewbie(newbie | NEWBIE_REWARD) if mage: st.playTutorialVoice("tutorial_voice_027") st.giveItems(SPIRITSHOT_NO_GRADE_FOR_BEGINNERS, 3000) else: st.playTutorialVoice("tutorial_voice_026") st.giveItems(SOULSHOT_NO_GRADE_FOR_BEGINNERS, 7000) st.playSound("ItemSound.quest_tutorial") st.rewardItems(1060, 100) # Lesser Healing Potions for item in range(4412, 4417): st.giveItems(item, 10) # Echo crystals st.addExpAndSp(41478, 3555) player.sendPacket(SocialAction(player.getObjectId(), 3)) st.exitQuest(False) st.playSound("ItemSound.quest_finish") st.set("onlyone", "1") st.set("cond", "0") elif st.getQuestItemsCount( KENDNELLS_ORDER5) or st.getQuestItemsCount( KENDNELLS_ORDER6) or st.getQuestItemsCount( KENDNELLS_ORDER7) or st.getQuestItemsCount( KENDNELLS_ORDER8): htmltext = "30218-07.htm" return htmltext
def onTalk(self, npc, player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st: return htmltext npcId = npc.getNpcId() id = st.getState() if npcId != 30328 and id != State.STARTED: return htmltext if npcId == 30328 and st.getInt("cond") == 0: htmltext = "30328-01.htm" return htmltext elif npcId == 30328 and st.getInt( "cond") and st.getQuestItemsCount(REORIA_LETTER2) > 0: htmltext = "30328-06.htm" elif npcId == 30328 and st.getInt("cond") and st.getQuestItemsCount( REORIA_LETTER2) == 0 and st.getQuestItemsCount( HONORARY_GUARD) == 0: htmltext = "30328-08.htm" elif npcId == 30337 and st.getInt("cond") and st.getQuestItemsCount( REORIA_LETTER2) > 0 and st.getQuestItemsCount( PRIGUNS_TEAR_LETTER1) + st.getQuestItemsCount( PRIGUNS_TEAR_LETTER2) + st.getQuestItemsCount( PRIGUNS_TEAR_LETTER3) + st.getQuestItemsCount( PRIGUNS_TEAR_LETTER4) == 0: htmltext = "30337-01.htm" elif npcId == 30337 and st.getQuestItemsCount( MORETTIS_LETTER) < 1 and st.getQuestItemsCount( PRIGUNS_LETTER) == 0 and st.getQuestItemsCount( HONORARY_GUARD) == 0: if st.getQuestItemsCount( PRIGUNS_TEAR_LETTER1) + st.getQuestItemsCount( PRIGUNS_TEAR_LETTER2) + st.getQuestItemsCount( PRIGUNS_TEAR_LETTER3) + st.getQuestItemsCount( PRIGUNS_TEAR_LETTER4) < 1: htmltext = "30337-04.htm" elif st.getQuestItemsCount( PRIGUNS_TEAR_LETTER1) + st.getQuestItemsCount( PRIGUNS_TEAR_LETTER2) + st.getQuestItemsCount( PRIGUNS_TEAR_LETTER3) + st.getQuestItemsCount( PRIGUNS_TEAR_LETTER4 ) > 0 and st.getQuestItemsCount( PRIGUNS_TEAR_LETTER1) + st.getQuestItemsCount( PRIGUNS_TEAR_LETTER2 ) + st.getQuestItemsCount( PRIGUNS_TEAR_LETTER3 ) + st.getQuestItemsCount( PRIGUNS_TEAR_LETTER4) < 4: htmltext = "30337-05.htm" else: htmltext = "30337-06.htm" st.takeItems(PRIGUNS_TEAR_LETTER1, 1) st.takeItems(PRIGUNS_TEAR_LETTER2, 1) st.takeItems(PRIGUNS_TEAR_LETTER3, 1) st.takeItems(PRIGUNS_TEAR_LETTER4, 1) st.giveItems(MORETTIS_HERB, 1) st.giveItems(MORETTIS_LETTER, 1) st.set("cond", "4") st.playSound("ItemSound.quest_middle") elif npcId == 30334 and st.getInt("cond"): htmltext = "30334-01.htm" elif npcId == 30426 and st.getInt("cond") and st.getQuestItemsCount( MORETTIS_LETTER) and st.getQuestItemsCount(MORETTIS_HERB): if st.getQuestItemsCount(RUSTED_KEY) < 1: htmltext = "30426-01.htm" st.set("cond", "5") st.playSound("ItemSound.quest_middle") else: htmltext = "30426-02.htm" st.takeItems(RUSTED_KEY, 1) st.takeItems(MORETTIS_HERB, 1) st.takeItems(MORETTIS_LETTER, 1) st.giveItems(PRIGUNS_LETTER, 1) st.set("cond", "7") st.playSound("ItemSound.quest_middle") elif npcId == 30426 and st.getInt("cond") and st.getQuestItemsCount( PRIGUNS_LETTER): htmltext = "30426-04.htm" elif npcId == 30337 and st.getInt( "cond") and st.getQuestItemsCount(PRIGUNS_LETTER) > 0: if st.getQuestItemsCount(MORETTIS_HERB): htmltext = "30337-09.htm" else: htmltext = "30337-07.htm" st.takeItems(PRIGUNS_LETTER, 1) st.giveItems(HONORARY_GUARD, 1) st.set("cond", "8") st.playSound("ItemSound.quest_middle") elif npcId == 30337 and st.getInt( "cond") and st.getQuestItemsCount(HONORARY_GUARD) > 0: htmltext = "30337-08.htm" elif npcId == 30328 and st.getInt( "cond") and st.getQuestItemsCount(HONORARY_GUARD) > 0: htmltext = "30328-07.htm" st.takeItems(HONORARY_GUARD, 1) st.giveItems(REORIA_RECOMMENDATION, 1) st.rewardItems(57, 81900) st.addExpAndSp(160267, 9966) player.sendPacket(SocialAction(player.getObjectId(), 3)) st.set("cond", "0") st.exitQuest(False) st.playSound("ItemSound.quest_finish") return htmltext
def onTalk (self,npc,player): htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>" st = player.getQuestState(qn) if not st : return htmltext npcId = npc.getNpcId() id = st.getState() if npcId != 30191 and id != State.STARTED : return htmltext if id == State.CREATED : # Check if is starting the quest st.set("cond","0") st.set("id","0") if npcId == 30191 : if player.getRace().ordinal() == 0 : if player.getLevel() >= 37 : htmltext = "30191-03.htm" else: htmltext = "30191-01.htm" st.exitQuest(1) else: htmltext = "30191-02.htm" st.exitQuest(1) elif id == State.COMPLETED : # Check if the quest is already made if npcId == 30191 : htmltext = "<html><body>This quest has already been completed.</body></html>" else : # The quest it self try : cond = st.getInt("cond") except : cond = None if cond == 1 : # Condition 1 take the letter to Hierarch Asterios (Elven Master) if npcId == 30191 : htmltext = "30191-08.htm" elif npcId == 30154 and st.getQuestItemsCount(LETTER_TO_ELF_ID) : htmltext = "30154-01.htm" elif cond == 2 : # Condition 2 kill the Luel of Zephy and Aktea of the Woods if npcId == 30154 and st.getQuestItemsCount(ORDER_OF_OZZY_ID) : htmltext = "30154-04.htm" elif cond == 3 : # Condition 3 bring back the Breath of winds and Seed of Verdure to Asterios if npcId == 30154 and st.getQuestItemsCount(BREATH_OF_WINDS_ID) and st.getQuestItemsCount(SEED_OF_VERDURE_ID) : htmltext = "30154-05.htm" st.takeItems(BREATH_OF_WINDS_ID,1) st.takeItems(SEED_OF_VERDURE_ID,1) st.takeItems(ORDER_OF_OZZY_ID,1) st.giveItems(SCROLL_OF_ELF_TRUST_ID,1) st.set("cond","4") elif cond == 4 : # Condition 4 take the letter to Tetrarch Thifiell (Dark Elven Master) if npcId == 30154 : htmltext = "30154-06.htm" elif npcId == 30358 and st.getQuestItemsCount(LETTER_TO_DARKELF_ID) : htmltext = "30358-01.htm" elif cond == 5 : # Condition 5 meet the Magister Clayton if npcId == 30358 : htmltext = "30358-05.htm" elif npcId == 30464 and st.getQuestItemsCount(LETTER_OF_THIFIELL_ID) : htmltext = "30464-01.htm" st.takeItems(LETTER_OF_THIFIELL_ID,1) st.giveItems(ORDER_OF_CLAYTON_ID,1) st.set("cond","6") elif cond == 6 : # Condition 6 get 10 of each, Stakato ichor, honey dew and basilisk plasma if npcId == 30464 and st.getQuestItemsCount(ORDER_OF_CLAYTON_ID) : htmltext = "30464-02.htm" elif cond == 7 : # Condition 7 bring back the Stakato ichor, honey dew and basilisk plasma to Magister Clayton if npcId == 30464 and st.getQuestItemsCount(ORDER_OF_CLAYTON_ID) and st.getQuestItemsCount(STAKATO_ICHOR_ID) and st.getQuestItemsCount(HONEY_DEW_ID) and st.getQuestItemsCount(BASILISK_PLASMA_ID) : htmltext = "30464-03.htm" st.set("cond","8") elif cond == 8 : # Condition 8 take the Stakato ichor, honey dew and basilisk plasma to Thifiell if npcId == 30358 and st.getQuestItemsCount(ORDER_OF_CLAYTON_ID) and st.getQuestItemsCount(STAKATO_ICHOR_ID) and st.getQuestItemsCount(HONEY_DEW_ID) and st.getQuestItemsCount(BASILISK_PLASMA_ID) : htmltext = "30358-03.htm" st.takeItems(ORDER_OF_CLAYTON_ID,1) st.takeItems(BASILISK_PLASMA_ID,1) st.takeItems(STAKATO_ICHOR_ID,1) st.takeItems(HONEY_DEW_ID,1) st.giveItems(SCROLL_OF_DARKELF_TRUST_ID,1) st.set("cond","9") elif cond == 9 : # Condition 9 take the Elven and Dark Elven scroll to Hollint if npcId == 30191 and st.getQuestItemsCount(SCROLL_OF_ELF_TRUST_ID) and st.getQuestItemsCount(SCROLL_OF_DARKELF_TRUST_ID) : htmltext = "30191-05.htm" st.takeItems(SCROLL_OF_DARKELF_TRUST_ID,1) st.takeItems(SCROLL_OF_ELF_TRUST_ID,1) st.giveItems(LETTER_TO_SERESIN_ID,1) st.set("cond","10") elif npcId == 30358 : htmltext = "30358-04.htm" elif cond in [ 10, 11 ] : # Condition 10 meet the Seresin or Condition 11 A lack of Experience if npcId == 30191 : htmltext = "30191-09.htm" elif npcId == 30657 and st.getQuestItemsCount(LETTER_TO_SERESIN_ID) : htmltext = "30657-01.htm" elif cond == 12 : # Condition 12 meet the Lord Kakai (Orc Master) if npcId == 30657 : htmltext = "30657-04.htm" elif npcId == 30565 and st.getQuestItemsCount(LETTER_TO_ORC_ID) : htmltext = "30565-01.htm" elif cond == 13 : # Condition 13 meet the Seer Manakia if npcId == 30565 : htmltext = "30565-03.htm" elif npcId == 30515 and st.getQuestItemsCount(LETTER_TO_MANAKIA_ID) : htmltext = "30515-01.htm" elif cond == 14 : # Condition 14 get 10 Parasite of lota if npcId == 30515 : htmltext = "30515-03.htm" elif cond == 15 : # Condition 15 bring back the Parasite of lota to Seer Manakia if npcId == 30515 and st.getQuestItemsCount(PARASITE_OF_LOTA_ID)==10 : htmltext = "30515-04.htm" st.takeItems(PARASITE_OF_LOTA_ID,10) st.giveItems(LETTER_OF_MANAKIA_ID,1) st.set("cond","16") elif cond == 16 : # Condition 16 bring the letter of Manakia to the Lord Kakai if npcId == 30565 and st.getQuestItemsCount(LETTER_OF_MANAKIA_ID) : htmltext = "30565-04.htm" st.takeItems(LETTER_OF_MANAKIA_ID,1) st.giveItems(SCROLL_OF_ORC_TRUST_ID,1) st.set("cond","17") elif npcId == 30515 : htmltext = "30515-05.htm" elif cond == 17 : # Condition 17 meet the Lockirin (Dwarven Master) if npcId == 30565 : htmltext = "30565-05.htm" elif npcId == 30531 and st.getQuestItemsCount(LETTER_TO_DWARF_ID) : htmltext = "30531-01.htm" elif cond == 18 : # Condition 18 take the letter to Nichola if npcId == 30531 : htmltext = "30531-03.htm" elif npcId == 30621 and st.getQuestItemsCount(LETTER_TO_NICHOLA_ID) : htmltext = "30621-01.htm" elif cond == 19 : # Condition 19 get 1 Heart of Porta if npcId == 30621 : htmltext = "30621-03.htm" elif cond == 20 : # Condition 20 bring the 1 Heart of Porta to Nichola if npcId == 30621 and st.getQuestItemsCount(ORDER_OF_NICHOLA_ID) and st.getQuestItemsCount(HEART_OF_PORTA_ID) : htmltext = "30621-04.htm" st.takeItems(HEART_OF_PORTA_ID,1) st.takeItems(ORDER_OF_NICHOLA_ID,1) st.set("cond","21") elif cond == 21 : # Condition 21 take the letter to Lockirin if npcId == 30621 : htmltext = "30621-05.htm" elif npcId == 30531 : htmltext = "30531-04.htm" st.giveItems(SCROLL_OF_DWARF_TRUST_ID,1) st.set("cond","22") elif cond == 22 : # Condition 22 take the Orc and Dwarven scroll to High Priest Hollint if npcId == 30191 and st.getQuestItemsCount(SCROLL_OF_DWARF_TRUST_ID) and st.getQuestItemsCount(SCROLL_OF_ORC_TRUST_ID) : htmltext = "30191-06.htm" st.takeItems(SCROLL_OF_DWARF_TRUST_ID,1) st.takeItems(SCROLL_OF_ORC_TRUST_ID,1) st.giveItems(RECOMMENDATION_OF_HOLLIN_ID,1) st.set("cond","23") elif npcId == 30657 : htmltext = "30657-05.htm" elif npcId == 30531 : htmltext = "30531-05.htm" elif cond == 23 : # Condition 23 take the Recommendation of Hollin to the High Priest Biotin if npcId == 30191 : htmltext = "30191-07.htm" elif npcId == 30031 and st.getQuestItemsCount(RECOMMENDATION_OF_HOLLIN_ID) : st.addExpAndSp(695149,46391) st.rewardItems(ADENA,126106) ObjectId=player.getObjectId() player.broadcastPacket(SocialAction(ObjectId,3)) htmltext = "30031-01.htm" st.takeItems(RECOMMENDATION_OF_HOLLIN_ID,1) st.giveItems(MARK_OF_TRUST_ID,1) st.unset("cond") st.unset("id") st.exitQuest(False) st.playSound("ItemSound.quest_finish") return htmltext
def onAdvEvent(self, event, npc, player): if event == "BenomTeleSpawn": self.addSpawn(BenomTeleport, 11013, -49629, -547, 13400, False, 0) elif event == "BenomRaidRoomSpawn": if self.BenomIsSpawned == 0 and checkState() == 0: self.addSpawn(Benom, 12047, -49211, -3009, 0, False, 0) self.BenomIsSpawned = 1 elif event == "BenomRaidSiegeSpawn": if checkState() == 0: if self.BenomIsSpawned == 0: self.addSpawn(Benom, 11025, -49152, -537, 0, False, 0) self.BenomIsSpawned = 1 elif self.BenomIsSpawned == 1: self.Benom.teleToLocation(11025, -49152, -537) self.startQuestTimer("BenomSpawnEffect", 100, npc, None) self.startQuestTimer("BenomBossDespawn", 5400000, npc, None) self.cancelQuestTimer("BenomSpawn", npc, None) unspawnNpc(BenomTeleport) elif event == "BenomSpawnEffect": npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE) npc.broadcastPacket( SpecialCamera(npc.getObjectId(), 200, 0, 150, 0, 5000)) npc.broadcastPacket(SocialAction(npc.getObjectId(), 3)) self.startQuestTimer("BenomWalk", 5000, npc, None) self.BenomWalkRouteStep = 0 elif event == "Attacking": NumPlayers = [] for player in npc.getKnownList().getKnownPlayers().values(): NumPlayers.append(player) if len(NumPlayers) > 0: target = NumPlayers[Rnd.get(len(NumPlayers))] npc.addDamageHate(target, 0, 999) npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target) self.startQuestTimer("Attacking", 2000, npc, player) elif len(NumPlayers) == 0: self.startQuestTimer("BenomWalkFinish", 2000, npc, None) elif event == "BenomWalkFinish": if npc.getCastle().getSiege().getIsInProgress(): self.cancelQuestTimer("Attacking", npc, player) X = benomWalkRoutes[self.BenomWalkRouteStep][0] Y = benomWalkRoutes[self.BenomWalkRouteStep][1] Z = benomWalkRoutes[self.BenomWalkRouteStep][2] npc.teleToLocation(X, Y, Z) npc.setWalking() self.BenomWalkRouteStep = 0 self.startQuestTimer("BenomWalk", 2200, npc, None) elif event == "BenomWalk": if self.BenomWalkRouteStep == 33: self.BenomWalkRouteStep = 0 self.startQuestTimer("BenomWalk", 100, npc, None) else: self.startQuestTimer("Talk", 100, npc, None) if self.BenomWalkRouteStep == 14: self.startQuestTimer("DoorOpen", 15000, None, None) self.startQuestTimer("DoorClose", 23000, None, None) if self.BenomWalkRouteStep == 32: self.startQuestTimer("DoorOpen", 500, None, None) self.startQuestTimer("DoorClose", 4000, None, None) Time = WalkTimes[self.BenomWalkRouteStep] npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE) X = benomWalkRoutes[self.BenomWalkRouteStep][0] Y = benomWalkRoutes[self.BenomWalkRouteStep][1] Z = benomWalkRoutes[self.BenomWalkRouteStep][2] npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(X, Y, Z, 0)) self.BenomWalkRouteStep = int(self.BenomWalkRouteStep) + 1 self.startQuestTimer("BenomWalk", Time, npc, None) elif event == "DoorOpen": DoorTable.getInstance().getDoor(20160005).openMe() elif event == "DoorClose": DoorTable.getInstance().getDoor(20160005).closeMe() elif event == "Talk": if Rnd.get(100) < 40: npc.broadcastPacket( NpcSay(npc.getObjectId(), 0, npc.getNpcId(), BenomSpeak[Rnd.get(4)])) elif event == "BenomBossDespawn": updateState(0) self.BenomIsSpawned = 0 unspawnNpc(Benom) return