def onAttack (self,npc,player,damage,isPet): npcId = npc.getNpcId() if npcId in HSMOBS: if (Rnd.get(2) == 1): if (Rnd.get(2) == 1): if player.getFirstEffect(int(4552)): holera = player.getFirstEffect(int(4552)).getLevel() if (Rnd.get(100) < 30): if holera < 10: newholera = int(holera + 1) npc.setTarget(player) npc.doCast(SkillTable.getInstance().getInfo(4552,newholera)) else: npc.setTarget(player) npc.doCast(SkillTable.getInstance().getInfo(4552,1)) else: if player.getFirstEffect(int(4554)): malaria = player.getFirstEffect(int(4554)).getLevel() if (Rnd.get(100) < 15): if malaria < 10: newmalaria = int(malaria + 1) npc.setTarget(player) npc.doCast(SkillTable.getInstance().getInfo(4554,newmalaria)) else: npc.setTarget(player) npc.doCast(SkillTable.getInstance().getInfo(4554,1)) return
def onAdvEvent(self, event, npc, player): htmltext = event st = player.getQuestState(qn) if not st: return Alevel = player.getAllianceWithVarkaKetra() if str(event) in BUFF.keys(): skillId, level, seeds = BUFF[event] if st.getQuestItemsCount(Seed) >= seeds: st.takeItems(Seed, seeds) npc.setTarget(player) npc.doCast(SkillTable.getInstance().getInfo(skillId, level)) npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp()) htmltext = "31379-4.htm" elif event == "Withdraw": if player.getWarehouse().getSize() == 0: htmltext = "31381-0.htm" else: player.sendPacket(ActionFailed()) player.setActiveWarehouse(player.getWarehouse()) player.sendPacket(WareHouseWithdrawalList(player, 1)) elif event == "Teleport": if Alevel == -4: htmltext = "31383-4.htm" elif Alevel == -5: htmltext = "31383-5.htm" return htmltext
def onAdvEvent(self, event, npc, player): if event == "prosnuca": self.IQ = self.addSpawn(ICE_QUEEEN, 102727, -125655, -2846, 0, False, 0) self.startQuestTimer("vkrovatku", 1800000, self.IQ, None) self.cancelQuestTimer("prosnuca", npc, None) elif event == "captain": npc = self.addSpawn(ICE_CAPTAIN, 105804, -127721, -2769, 0, False, 0) self.startQuestTimer("sleepcap", 1800000, npc, None) self.cancelQuestTimer("prosnuca", npc, None) elif event == "resist": npc = self.addSpawn(FR_GARDENER, 111375, -126645, -2991, 0, False, 0) self.startQuestTimer("sleepres", 1800000, npc, None) self.cancelQuestTimer("resist", npc, None) elif event == "mdef": npc = self.addSpawn(FR_SERVANT, 108885, -129124, -3218, 0, False, 0) self.startQuestTimer("sleepmdef", 1800000, npc, None) self.cancelQuestTimer("mdef", npc, None) elif event == "pdef": npc = self.addSpawn(FR_DOG, 109784, -125793, -3142, 0, False, 0) self.startQuestTimer("sleeppdef", 1800000, npc, None) self.cancelQuestTimer("pdef", npc, None) elif event == "vkrovatku": npc.deleteMe() self.cancelQuestTimer("vkrovatku", npc, None) elif event == "sleepcap": npc.deleteMe() self.cancelQuestTimer("sleepcap", npc, None) elif event == "sleepres": npc.deleteMe() self.cancelQuestTimer("sleepres", npc, None) elif event == "sleepmdef": npc.deleteMe() self.cancelQuestTimer("sleepmdef", npc, None) elif event == "sleeppdef": npc.deleteMe() self.cancelQuestTimer("sleeppdef", npc, None) elif event == "open": self.deleteGlobalQuestVar("closed") self.deleteGlobalQuestVar("first") self.cancelQuestTimer("open", npc, None) elif event == "buff": npc.setTarget(player) npc.doCast(SkillTable.getInstance().getInfo(4479, 1)) return elif event == "teleout": if player: player.teleToLocation(115525, -125724, -3439) return "<html><body><font color=LEVEL>Tempo esgotado...</font></body></html>" self.cancelQuestTimer("teleout", None, player) return
def onKill(self, npc, player, isPet): st = player.getQuestState(qn) npcId = npc.getNpcId() if npcId == FR_GARDENER: self.startQuestTimer("buff", 1, npc, player) if npcId == FR_SERVANT: player.setTarget(self.IQ) player.useMagic(SkillTable.getInstance().getInfo(4480, 1), True, True) if npcId == FR_DOG: player.setTarget(self.IQ) player.useMagic(SkillTable.getInstance().getInfo(4481, 1), True, True) if npcId == ICE_CAPTAIN: player.setTarget(self.IQ) player.useMagic(SkillTable.getInstance().getInfo(4482, 1), True, True) if npcId == ICE_QUEEEN: self.cancelQuestTimer("vkrovatku", npc, None) return
def onAdvEvent(self, event, npc, player): st = player.getQuestState(qn) if not st: return htmltext = event cond = st.getInt("cond") if htmltext == "31554-03a.htm": #Giving 100 Splinter Stakato Chitins. Getting Recruit mark if st.getQuestItemsCount(CHITIN) >= count and cond == 1: st.set("cond", "2") st.takeItems(CHITIN, -1) st.giveItems(RECRUIT, 1) htmltext = "31554-04.htm" elif event == "31554-07.htm": #Cancelling the quest st.exitQuest(1) st.playSound("ItemSound.quest_giveup") elif event in BUFF.keys() and cond == 3: #Asking for buff skillId, level, coins = BUFF[event] if st.getQuestItemsCount(GOLDEN_RAM_COIN) >= coins: st.takeItems(GOLDEN_RAM_COIN, coins) npc.setTarget(player) npc.doCast(SkillTable.getInstance().getInfo(skillId, level)) htmltext = "31556-1.htm" else: htmltext = "You don't have required items" return htmltext
def onTalk(self, npc, player): htmltext = "<html><body>You are either not carrying out your quest or don't meet the criteria.</body></html>" st = player.getQuestState(qn) if not st: return htmltext cond = st.getInt("cond") npcId = npc.getNpcId() if npcId == MUSHIKA: first = player.getQuestState("124_MeetingTheElroki") if st.getState() == COMPLETED: htmltext = "<html><body>This quest has already been completed.</body></html>" elif first and first.getState().getName( ) == 'Completed' and st.getState( ) == CREATED and player.getLevel() >= 76: htmltext = "32114-01.htm" elif cond == 0: htmltext = "32114-00.htm" elif cond == 1: htmltext = "32114-07.htm" elif cond == 2: htmltext = "32114-10.htm" elif cond >= 3 and cond < 8: htmltext = "32114-11.htm" elif cond == 8: st.addExpAndSp(859195, 86603) st.unset("cond") st.unset("pilar1") st.unset("pilar2") st.unset("pilar3") st.setState(COMPLETED) st.exitQuest(False) st.playSound("ItemSound.quest_finish") htmltext = "32114-12.htm" elif npcId == KARAKAWEI: if cond == 2: htmltext = "32117-01.htm" elif cond == 3: htmltext = "32117-09.htm" elif cond == 4: st.takeItems(ORNITHOMIMUS_CLAW, -1) st.takeItems(DEINONYCHUS_BONE, -1) st.playSound("ItemSound.quest_middle") htmltext = "32117-10.htm" elif cond == 5: htmltext = "32117-15.htm" elif cond == 6 or cond == 7: htmltext = "32117-16.htm" elif cond == 8: htmltext = "32117-17.htm" elif npcId == ULU_KAIMU: if cond == 5: npc.doCast(SkillTable.getInstance().getInfo(5089, 1)) htmltext = "32119-01.htm" elif cond == 6: htmltext = "32119-14.htm" elif npcId == BALU_KAIMU: if cond == 6: npc.doCast(SkillTable.getInstance().getInfo(5089, 1)) htmltext = "32120-01.htm" elif cond == 7: htmltext = "32120-16.htm" elif npcId == CHUTA_KAIMU: if cond == 7: npc.doCast(SkillTable.getInstance().getInfo(5089, 1)) htmltext = "32121-01.htm" elif cond == 8: htmltext = "32121-17.htm" return htmltext
def onAttack (self,npc,player,damage,isPet): player.setTarget(player) player.doCast(SkillTable.getInstance().getInfo(5088,1)) return