def onAttack (self,npc,player,damage,isPet):
     objId=npc.getObjectId()
     if self.FirstAttacked:
        if Rnd.get(40) : return
        npc.broadcastPacket(CreatureSay(objId,0,npc.getName(),"Ei! Estava tendo um duelo aqui!"))
     else :
        self.FirstAttacked = True
        npc.broadcastPacket(CreatureSay(objId,0,npc.getName(),"Como ousa interromper nossa luta! Ei pessoal, ajude!"))
     return 
Exemplo n.º 2
0
 def onAttack(self, npc, player, damage, isPet):
     objId = npc.getObjectId()
     if self.FirstAttacked:
         if Rnd.get(100): return
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(), "Vamos ver isso!"))
     else:
         self.FirstAttacked = True
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(),
                         "Eu definitivamente vou pagar essa humilhação!"))
     return
Exemplo n.º 3
0
 def onAttack(self, npc, player, damage, isPet):
     objId = npc.getObjectId()
     if self.FirstAttacked:
         if Rnd.get(40): return
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(),
                         "Você não vai me derrubar facilmente."))
     else:
         self.FirstAttacked = True
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(), "Vamos ver isso!"))
     return
Exemplo n.º 4
0
 def onAttack(self, npc, player, damage, isPet):
     objId = npc.getObjectId()
     if self.FirstAttacked:
         if Rnd.get(4): return
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(),
                         "Sua parte traseira é praticamente desprotegida!"))
     else:
         self.FirstAttacked = True
         if Rnd.get(4): return
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(), "Tome cuidado!"))
     return
Exemplo n.º 5
0
 def onAttack(self, npc, player, damage, isPet):
     objId = npc.getObjectId()
     if self.FirstAttacked:
         if Rnd.get(40): return
         npc.broadcastPacket(
             CreatureSay(
                 objId, 0, npc.getName(),
                 "Não há razão para você me matar! Eu não tenho nada que você precise!"
             ))
     else:
         self.FirstAttacked = True
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(), "Vamos ver isso!"))
     return
Exemplo n.º 6
0
def AutoChat(npc, text):
    chars = npc.getKnownList().getKnownPlayers().values().toArray()
    if chars != None:
        for pc in chars:
            sm = CreatureSay(npc.getObjectId(), 0, npc.getName(), text)
            pc.sendPacket(sm)
    return
Exemplo n.º 7
0
 def onAttack (self,npc,player,damage,isPet):
     objId=npc.getObjectId()
     if self.FirstAttacked:
        if Rnd.get(50) : return
        npc.broadcastPacket(CreatureSay(objId,0,npc.getName(),"Destrua o inimigo, meus irmãos!"))
     else :
        self.FirstAttacked = True
     return 
Exemplo n.º 8
0
 def onAttack(self, npc, player, damage, isPet):
     objId = npc.getObjectId()
     if self.FirstAttacked:
         if Rnd.get(50): return
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(), "Caro poder supremo !!!"))
     else:
         self.FirstAttacked = True
     return
Exemplo n.º 9
0
 def onAttack(self, npc, player, damage, isPet):
     objId = npc.getObjectId()
     if self.FirstAttacked:
         if Rnd.get(40): return
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(),
                         "Seu tolo infantil, você acha que pode me pegar?"))
     else:
         self.FirstAttacked = True
     return
Exemplo n.º 10
0
 def onAdvEvent(self, event, npc, player):
     objId = npc.getObjectId()
     if event == "Good By" and npc and player:
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(), "Bom por !! RI MUITO."))
         npc.onDecay()
     elif event == "Good By1" and npc and player:
         npc.broadcastPacket(
             CreatureSay(
                 objId, 0, npc.getName(),
                 "Adeus a todos ... A grande abóbora disse adeus ..."))
         npc.onDecay()
     elif event == "Good By2" and npc and player:
         npc.broadcastPacket(
             CreatureSay(
                 objId, 0, npc.getName(),
                 "Você pode mais rápido? Daqui a 30 segundos vou correr ..."
             ))
     elif event == "Good By3" and npc and player:
         npc.broadcastPacket(
             CreatureSay(
                 objId, 0, npc.getName(),
                 "Eu vou quebrar o relacionamento com você em 20 segundos!")
         )
     elif event == "Good By4" and npc and player:
         npc.broadcastPacket(
             CreatureSay(
                 objId, 0, npc.getName(),
                 "Eu tenho apenas 10 segundos restantes! 9. 8. 7 ..!"))
     elif event == "Good By5" and npc and player:
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(),
                         "Ei! Felizmente fique! Idiota, esqueça de mim!"))
     return
Exemplo n.º 11
0
 def onAdvEvent(self, event, npc, player):
     st = player.getQuestState(qn)
     htmltext = event
     if event == "31328-02.htm":  # call 31328-03.htm
         st.giveItems(MapForestofDeadman, 1)
         st.giveItems(SilverKey, 1)
         st.set("cond", "1")
         st.playSound("ItemSound.quest_accept")
         st.setState(STARTED)
     elif event == "31328-03.htm":  # call 31328-05.htm and 31328-06.htm
         st.set("cond", "2")
         st.playSound("ItemSound.quest_middle")
     elif event == "31526-05.htm":  # called by 31526-03.htm for hairpin
         if st.getQuestItemsCount(LidiaHairPin) == 0:
             st.giveItems(LidiaHairPin, 1)  # give hairpin
             if st.getQuestItemsCount(
                     LidiaDiary) != 0:  # if has diary cond = 4
                 st.set("cond", "4")
                 st.playSound("ItemSound.quest_middle")
     elif event == "31526-11.htm":  # called by 31526-07 for diary
         if st.getQuestItemsCount(LidiaDiary) == 0:
             st.giveItems(LidiaDiary, 1)
             if st.getQuestItemsCount(
                     LidiaHairPin) != 0:  # if has hairpin cond = 4
                 st.set("cond", "4")
                 st.playSound("ItemSound.quest_middle")
     elif event == "31328-19.htm":  # end of questions loop go to ghost
         st.set("cond", "6")
         st.playSound("ItemSound.quest_middle")
     elif event == "31524-04.htm":  # sends you to the tombstone to dig
         st.set("cond", "7")
         st.playSound("ItemSound.quest_middle")
         st.takeItems(LidiaDiary, -1)
     elif event == "31523-02.htm":
         st.playSound("SkillSound5.horror_02")
         ghost = st.addSpawn(31524, 51432, -54570, -3136, 1800000)
         ghost.broadcastPacket(
             CreatureSay(ghost.getObjectId(), 0, ghost.getName(),
                         "Who awoke me?"))
     elif event == "31523-05.htm":
         st.startQuestTimer("ghost_timer", 10000)
     elif event == "ghost_timer":
         st.set("cond", "8")
         htmltext = "31523-06.htm"
         st.giveItems(SilverKey, 1)
     elif event == "31530-02.htm":  # box gives spear takes key
         st.set("cond", "10")
         st.playSound("ItemSound.quest_middle")
         st.takeItems(SilverKey, -1)
         st.giveItems(SilverSpear, 1)
     return htmltext
Exemplo n.º 12
0
 def onKill(self, npc, player, isPet):
     st = player.getQuestState(qn)
     if not st: return
     npcId = npc.getNpcId()
     if st.getState() == STARTED and st.getInt("cond") == 10:
         if npcId == Guardian:
             npc.broadcastPacket(
                 CreatureSay(
                     npc.getObjectId(), 0, npc.getName(),
                     "This enemy is far too powerful for me to fight. I must withdraw"
                 ))
             st.set("cond", "11")
             st.playSound("ItemSound.quest_middle")
     return
Exemplo n.º 13
0
 def onKill(self, npc, player, isPet):
     st = player.getQuestState(qn)
     if not st: return
     if st.getState() != STARTED: return
     if st.getInt("cond") == 7:
         st.playSound("ItemSound.quest_itemget")
         st.set("cond", "8")
         npc.broadcastPacket(
             CreatureSay(
                 npc.getObjectId(), 0, npc.getName(),
                 "You've ended my immortal life! You've protected by the feudal lord, aren't you?"
             ))
         st.giveItems(TotemDoll, 1)
         st.set("step", "2")
     return
Exemplo n.º 14
0
    def onKill(self, npc, player, isPet):
        npcId = npc.getNpcId()
        if npcId == self.cats_eye_bandit:
            objId = npc.getObjectId()
            if Rnd.get(80):
                npc.broadcastPacket(
                    CreatureSay(
                        objId, 0, npc.getName(),
                        "Eu devo fazer algo sobre esse incidente vergonhoso ..."
                    ))

            self.FirstAttacked = False
        elif self.FirstAttacked:
            self.addSpawn(npcId, npc.getX(), npc.getY(), npc.getZ())
        return
Exemplo n.º 15
0
 def onKill(self, npc, player, isPet):
     # all kill events triggered by the leader occur automatically.
     # However, kill events that were triggered by members occur via the leader and
     # only if the leader is online and within a certain distance!
     leader_st = 0
     if player.isClanLeader():
         leader_st = player.getQuestState(qn)
     else:
         clan = player.getClan()
         if clan:
             c_leader = clan.getLeader()
             if c_leader:
                 leader = c_leader.getPlayerInstance()
                 if leader:
                     if player.isInsideRadius(leader, 1600, 1, 0):
                         leader_st = leader.getQuestState(qn)
     if leader_st:
         if leader_st.getState() != PROGRESS: return
         npcId = npc.getNpcId()
         condition, maxcount, chance, itemList = DROPLIST[npcId]
         random = leader_st.getRandom(100)
         cond = leader_st.getInt("cond")
         if cond == condition and random < chance:
             if len(itemList) > 1:
                 stoneRandom = leader_st.getRandom(3)
                 if stoneRandom == 0:
                     if leader_st.getInt("Kurtz") < 4:
                         return
                     else:
                         maxcount *= 4
                 giveItem(itemList[stoneRandom], maxcount, leader_st)
             elif len(itemList):
                 giveItem(itemList[0], maxcount, leader_st)
             else:
                 if npcId == 27181:  # Imperial Gravekeeper
                     spawnedNpc = leader_st.addSpawn(30765, 120000)
                     npc.broadcastPacket(
                         CreatureSay(
                             spawnedNpc.getObjectId(), 0,
                             spawnedNpc.getName(),
                             "Curse of the gods on the one that defiles the property of the empire!"
                         ))
                     leader_st.set("ImpGraveKeeper", "3")
                     self.ImpGraveKepperStat = 1
                 else:
                     leader_st.addSpawn(27179)
     return
Exemplo n.º 16
0
 def onAttack(self, npc, player, damage, isPet):
     npcId = npc.getNpcId()
     objId = npc.getObjectId()
     if npcId not in WATERED_SQUASH: return
     if npcId in self.adultLargeSquash:
         if Rnd.get(30) < 2:
             mytext = [
                 "Mordidas tecer rendas ... para substituir ... corpo ...!",
                 "Ha ha, cresci! Totalmente em tudo!",
                 "Você não pode chtoli todo objetivo? Veja tudo para não fugir ...",
                 "Eu conto seus socos! Oh, lembra soco de novo!",
                 "Não perca seu tempo!",
                 "Ha, esse som é realmente bom de se ouvir?",
                 "Eu consumo seus ataques para crescer!",
                 "Hora de bater de novo! Bata mais uma vez!",
                 "Apenas música útil pode abrir uma grande abóbora ... Eu não posso ser aberto com uma arma!"
             ]
             npc.broadcastPacket(
                 CreatureSay(objId, 0, npc.getName(),
                             mytext[Rnd.get(len(mytext))]))
     return
Exemplo n.º 17
0
 def onAttack(self,npc,player,damage,isPet) :
     npcId = npc.getNpcId()
     objId = npc.getObjectId()
     if self.MobSpawns.has_key(npcId) :
         if npc.getStatus().getCurrentHp() <= npc.getMaxHp() * self.MobSpawns[npcId]['HP'] / 100 and Rnd.get(100) < self.MobSpawns[npcId]['chance'] :
             if self.MobTexts.has_key(npcId) :
                 text = self.MobTexts[npcId][Rnd.get(len(self.MobTexts[npcId]))]
                 npc.broadcastPacket(CreatureSay(objId,0,npc.getName(),text))
             posX = npc.getX()
             posY = npc.getY()
             posZ = npc.getZ()
             signX = -500
             signY = -500
             if npc.getX() > player.getX() :
                 signX = 500
             if npc.getY() > player.getY() :
                 signY = 500
             posX = posX + signX
             posY = posY + signY
             npc.setIsAfraid(1)
             npc.setRunning()
             npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,L2CharPosition(posX,posY,posZ,0))
             self.startQuestTimer("Retreat", 10000, npc, player)
     return
Exemplo n.º 18
0
 def onKill(self, npc, player, isPet):
     npcId = npc.getNpcId()
     objId = npc.getObjectId()
     if npcId not in WATERED_SQUASH: return
     if npcId in self.adultSmallSquash:
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(), "Abóbora abre !!"))
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(),
                         "eah! Abre! Muita coisa boa ..."))
     elif npcId in self.adultLargeSquash:
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(), "Abóbora abre !!"))
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(),
                         "Yeah! Abre! Muita coisa boa ..."))
     else:
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(), "Por que, mestre?"))
         npc.broadcastPacket(
             CreatureSay(objId, 0, npc.getName(), "Oh, coragem caiu !!"))
     return
Exemplo n.º 19
0
 def onAdvEvent(self, event, npc, player):
     st = player.getQuestState(qn)
     if not st: return
     htmltext = event
     if event == "32018-04.htm":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "7")
         st.takeItems(Letter2, 1)
     elif event == "32020-02.htm":
         st.setState(STARTED)
         st.playSound("ItemSound.quest_accept")
         st.set("cond", "1")
     elif event == "32020-05.htm":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "3")
         st.takeItems(Letter, 1)
     elif event in ["32020-06.htm", "32020-08a.htm"]:
         st.exitQuest(1)
         st.playSound("ItemSound.quest_finish")
     elif event in ["32020-08.htm", "32020-07a.htm"]:
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "4")
     elif event == "32020-12.htm":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "5")
     elif event == "32020-16.htm":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "10")
         st.takeItems(Report, 1)
     elif event == "32020-18.htm":
         if st.getQuestItemsCount(Tablet) == 0:
             st.playSound("ItemSound.quest_middle")
             st.set("cond", "11")
             htmltext = "32020-19.htm"
         else:
             st.exitQuest(false)
             st.playSound("ItemSound.quest_finish")
             st.giveItems(57, 115673)
             st.addExpAndSp(493595, 40442)
     elif event == "32020-19.htm":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "11")
     elif event == "32022-02.htm":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "9")
         man = st.addSpawn(Suspicious, 104562, -107598, -3688, 0, False,
                           4000)
         man.broadcastPacket(
             CreatureSay(man.getObjectId(), 0, man.getName(),
                         "We meet again."))
         self.startQuestTimer("2", 3700, man, player)
         st.giveItems(Report, 1)
     elif event == "Sculpture-04.htm":
         st.set("talk", "1")
         htmltext = "Sculpture-05.htm"
         st.set(str(npc.getNpcId()), "1")
     elif event == "Sculpture-04a":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "8")
         man = st.addSpawn(Suspicious, 117890, -126478, -2584, 0, False,
                           4000)
         man.broadcastPacket(
             CreatureSay(man.getObjectId(), 0, man.getName(),
                         "This looks like the right place..."))
         self.startQuestTimer("1", 3700, man, player)
         htmltext = "Sculpture-04.htm"
         if st.getInt(str(Sculpture1)) == 0 and st.getInt(
                 str(Sculpture2)) == 0:
             st.giveItems(Tablet, 1)
     elif event == "Sculpture-05.htm":
         st.set(str(npc.getNpcId()), "1")
     elif event == "1":
         npc.broadcastPacket(
             CreatureSay(npc.getObjectId(), 0, npc.getName(),
                         "I see someone. Is this fate?"))
     elif event == "2":
         npc.broadcastPacket(
             CreatureSay(
                 npc.getObjectId(), 0, npc.getName(),
                 "Don't bother trying to find out more about me. Follow your own destiny."
             ))
     return htmltext
Exemplo n.º 20
0
    def onEvent(self, event, st):
        htmltext = event
        # Events Gustaf
        if event == "30760-08.htm":
            st.giveItems(G_Let_Martien, 1)
            for var in STATS:
                st.set(var, "1")
            st.setState(PROGRESS)
        elif event == "30760-12.htm":
            st.giveItems(G_Let_Balthazar, 1)
            st.set("cond", "4")
        elif event == "30760-16.htm":
            st.giveItems(G_Let_Rodemai, 1)
            st.set("cond", "7")
        elif event == "30760-20.htm":
            exit503(1, st)
        elif event == "30760-22.htm":
            st.set("cond", "13")
        elif event == "30760-23.htm":
            exit503(1, st)
# Events Martien
        elif event == "30645-03.htm":
            st.takeItems(G_Let_Martien, -1)
            st.set("cond", "2")
            suscribe_members(st)
            try:
                members = st.getPlayer().getClan().getOnlineMembers("")[0]
                for i in members:
                    pst = QuestManager.getInstance().getQuest(
                        qn).newQuestState(
                            st.getPlayer().getClan().getClanMember(
                                int(i)).getPlayerInstance())
                    pst.setState(PROGRESS)
            except:
                return htmltext
# Events Kurtz
        elif event == "30763-03.htm":
            if st.getInt("Kurtz") == 1:
                htmltext = "30763-02.htm"
                st.giveItems(Mi_Drake_Eggs, 6)
                st.giveItems(Brooch, 1)
                st.set("Kurtz", "2")
# Events Lutz
        elif event == "30762-03.htm":
            lutz = st.getInt("Lutz")
            if lutz == 1:
                htmltext = "30762-02.htm"
                st.giveItems(Mi_Drake_Eggs, 4)
                st.giveItems(Bl_Wyrm_Eggs, 3)
                st.set("Lutz", "2")
            st.addSpawn(27178, 112268, 112761, -2770, 120000)
            st.addSpawn(27178, 112234, 112705, -2770, 120000)
# Events Fritz
        elif event == "30761-03.htm":
            fritz = st.getInt("Fritz")
            if fritz == 1:
                htmltext = "30761-02.htm"
                st.giveItems(Bl_Wyrm_Eggs, 3)
                st.set("Fritz", "2")
            st.addSpawn(27178, 103841, 116809, -3025, 120000)
            st.addSpawn(27178, 103848, 116910, -3020, 120000)
# Events Kusto
        elif event == "30512-03.htm":
            st.takeItems(Brooch, -1)
            st.giveItems(Bl_Anvil_Coin, 1)
            st.set("Kurtz", "3")
# Events Balthazar
        elif event == "30764-03.htm":
            st.takeItems(G_Let_Balthazar, -1)
            st.set("cond", "5")
            st.set("Kurtz", "3")
        elif event == "30764-05.htm":
            st.takeItems(G_Let_Balthazar, -1)
            st.set("cond", "5")
        elif event == "30764-06.htm":
            st.takeItems(Bl_Anvil_Coin, -1)
            st.set("Kurtz", "4")
            st.giveItems(Recipe_Power_Stone, 1)
# Events Rodemai
        elif event == "30868-04.htm":
            st.takeItems(G_Let_Rodemai, -1)
            st.set("cond", "8")
        elif event == "30868-06a.htm":
            st.set("cond", "10")
        elif event == "30868-10.htm":
            st.set("cond", "12")


# Events Cleo
        elif event == "30766-04.htm":
            st.set("cond", "9")
            spawnedNpc = st.addSpawn(30766, 160622, 21230, -3710, 90000)
            spawnedNpc.broadcastPacket(
                CreatureSay(spawnedNpc.getObjectId(), 0, spawnedNpc.getName(),
                            "Blood and Honour."))
            spawnedNpc = st.addSpawn(30759, 160665, 21209, -3710, 90000)
            spawnedNpc.broadcastPacket(
                CreatureSay(spawnedNpc.getObjectId(), 0, spawnedNpc.getName(),
                            "Ambition and Power"))
            spawnedNpc = st.addSpawn(30758, 160665, 21291, -3710, 90000)
            spawnedNpc.broadcastPacket(
                CreatureSay(spawnedNpc.getObjectId(), 0, spawnedNpc.getName(),
                            "War and Death"))
        elif event == "30766-08.htm":
            st.takeItems(Scepter_Judgement, -1)
            exit503(0, st)
        return htmltext
Exemplo n.º 21
0
 def onSkillUse(self, npc, player, skill):
     npcId = npc.getNpcId()
     skillId = skill.getId()
     if skillId != SKILL_NECTAR: return
     if npcId not in WATERED_SQUASH: return
     objectId = npc.getObjectId()
     if skillId == SKILL_NECTAR:
         # Primeira rega
         if npc.getNectar() == 0:
             if Rnd.get(2) == 1:
                 mytext = [
                     "Para poder crescer, eu tenho que beber apenas néctar ... e mais vezes",
                     "Se você derramará néctar para mim mais rápido - eu crescerei mais rápido!",
                     "Bem, acredite em mim, pule néctar! Eu posso me transformar em uma grande abóbora !!!",
                     "Traga o néctar para cultivar uma abóbora!",
                     "O fruto de uma linda jovem abóbora começa a brilhar quando a semente é enterrada! De agora em diante, será capaz de se tornar saudável e forte!",
                     "Oh, muito tempo sem ver?",
                     "Não esperava ver minha linda aparência?",
                     "Ótimo! Isso é alguma coisa! Néctar",
                     "Reabastecimento! Encha 5 garrafas para que eu possa me transformar em uma grande abóbora! Oh!"
                 ]
                 npc.broadcastPacket(
                     CreatureSay(objectId, 0, npc.getName(),
                                 mytext[Rnd.get(len(mytext))]))
                 npc.addNectar()
                 npc.addGood()
             else:
                 mytext = [
                     "Não se apresse! Demasiadas vezes, não tenho tempo!",
                     "Eu não sou automático, não me dê uma taxa de fogo",
                     "Mas onde você está com pressa! Demasiadas vezes, não tenho tempo!",
                     "Oops, muito rápido novamente",
                     "Vamos abrandar, não se apresse, lentamente, pegue a garrafa e, lentamente, despeje!",
                     "Você não tem senso de velocidade? Mais devagar, vamos lá"
                 ]
                 npc.broadcastPacket(
                     CreatureSay(objectId, 0, npc.getName(),
                                 mytext[Rnd.get(len(mytext))]))
                 npc.addNectar()
         # Segunda rega
         elif npc.getNectar() == 1:
             if Rnd.get(2) == 1:
                 mytext = [
                     "Eu quero ser uma grande abóbora!",
                     "Yum, yum, yum! Saiu! Cuidado - bom!",
                     "ocê acha que eu sou maduro e podre?",
                     "Néctar - apenas o melhor! Hah Hah Hah"
                 ]
                 npc.broadcastPacket(
                     CreatureSay(objectId, 0, npc.getName(),
                                 mytext[Rnd.get(len(mytext))]))
                 npc.addNectar()
                 npc.addGood()
             else:
                 mytext = [
                     "Oh! Mais uma vez por! O néctar pode ser consumido muito rapidamente?",
                     "Se eu morrer assim, você só pega uma abóbora jovem ...",
                     "Cresça um pouco mais rápido! Seria bom ser uma abóbora grande, uma abóbora jovem não é boa!",
                     "Que pequena abóbora você deve comer? Traga néctar, eu posso ser mais!"
                 ]
                 npc.broadcastPacket(
                     CreatureSay(objectId, 0, npc.getName(),
                                 mytext[Rnd.get(len(mytext))]))
                 npc.addNectar()
         # Terceira rega
         elif npc.getNectar() == 2:
             if Rnd.get(2) == 1:
                 mytext = [
                     "Abóbora, faminta! Pedidos para saciar a sua sede!",
                     "Bem, finalmente ... é muito gostoso! Existe mais?",
                     "Você está cuidando de mim só para comer? Ótimo, é seu aleatório ... não dar maná para suicídio"
                 ]
                 npc.broadcastPacket(
                     CreatureSay(objectId, 0, npc.getName(),
                                 mytext[Rnd.get(len(mytext))]))
                 npc.addNectar()
                 npc.addGood()
             else:
                 mytext = [
                     "Você adiciona água? Que gosto?",
                     "Mestre, salve-me ... Eu não tenho o sabor do néctar, devo morrer ..."
                 ]
                 npc.broadcastPacket(
                     CreatureSay(objectId, 0, npc.getName(),
                                 mytext[Rnd.get(len(mytext))]))
                 npc.addNectar()
         # Quarta rega
         elif npc.getNectar() == 3:
             if Rnd.get(2) == 1:
                 mytext = [
                     "Muito bem, fazendo muito bem! Você sabe o que o próximo passo é fazer?",
                     "Se você me pegar, eu te dou 10 milhões de adena !!! Você concorda?s"
                 ]
                 npc.broadcastPacket(
                     CreatureSay(objectId, 0, npc.getName(),
                                 mytext[Rnd.get(len(mytext))]))
                 npc.addNectar()
                 npc.addGood()
             else:
                 mytext = [
                     "Estou com fome Você quer que eu seque?",
                     "Eu exijo que o néctar cresça um pouco mais rápido."
                 ]
                 npc.broadcastPacket(
                     CreatureSay(objectId, 0, npc.getName(),
                                 mytext[Rnd.get(len(mytext))]))
                 npc.addNectar()
         # Quinta rega
         elif npc.getNectar() == 4:
             if Rnd.get(2) == 1:
                 npc.addGood()
             if npc.getGood() >= 3:
                 if npcId == 12774:
                     newGourd = self.addSpawn(12775, npc)
                     newGourd.setOwner(player.getName())
                     self.startQuestTimer(
                         "Good By", 120000, newGourd,
                         player)  # Após 2 minutos, o desaparecimento
                     self.startQuestTimer(
                         "Good By2", 90000, newGourd,
                         player)  # 30 segundos antes de desaparecer
                     self.startQuestTimer(
                         "Good By3", 100000, newGourd,
                         player)  # 20 segundos antes de desaparecer
                     self.startQuestTimer(
                         "Good By4", 110000, newGourd,
                         player)  # 10 segundos antes de desaparecer
                     mytext = [
                         "Abóbora jovem, sedenta! Como já cresceu?",
                         "Eu vou fugir em 2 minutos"
                     ]
                     npc.broadcastPacket(
                         CreatureSay(objectId, 0, npc.getName(),
                                     mytext[Rnd.get(len(mytext))]))
                     npc.onDecay()
                 else:
                     newGourd = self.addSpawn(12778, npc)
                     newGourd.setOwner(player.getName())
                     self.startQuestTimer(
                         "Good By1", 120000, newGourd,
                         player)  # Após 2 minutos, o desaparecimento
                     self.startQuestTimer(
                         "Good By2", 90000, newGourd,
                         player)  # 30 segundos antes de desaparecer
                     self.startQuestTimer(
                         "Good By3", 100000, newGourd,
                         player)  # 20 segundos antes de desaparecer
                     self.startQuestTimer(
                         "Good By4", 110000, newGourd,
                         player)  # 10 segundos antes de desaparecer
                     mytext = [
                         "A caridade é uma característica muito boa. Agora olhe, me sinto mais bem",
                         "Eu vou fugir em 2 minutos"
                     ]
                     npc.broadcastPacket(
                         CreatureSay(objectId, 0, npc.getName(),
                                     mytext[Rnd.get(len(mytext))]))
                     npc.onDecay()
             else:
                 if npcId == 12774:
                     newGourd = self.addSpawn(12776, npc)
                     newGourd.setOwner(player.getName())
                     mytext = [
                         "Eh! Foi - não foi! Existe! Agora! Você não pode cuidar corretamente? Estou tão podre!",
                         "Uau, pare? Por que obrigado",
                         "Jade de néctar ...",
                         "Você quer uma abóbora grande? Mas eu quero ficar um pouco de abóbora ..."
                     ]
                     npc.broadcastPacket(
                         CreatureSay(objectId, 0, npc.getName(),
                                     mytext[Rnd.get(len(mytext))]))
                     npc.onDecay()
                 if npcId == 12777:
                     newGourd = self.addSpawn(12779, npc)
                     newGourd.setOwner(player.getName())
                     mytext = [
                         "Eh! Foi - não foi! Existe! Agora! Você não pode cuidar corretamente? Estou tão podre!",
                         "Uau, pare? Por que obrigado",
                         "Jade de néctar ...",
                         "Você quer uma abóbora grande? Mas eu quero ficar um pouco de abóbora ..."
                     ]
                     npc.broadcastPacket(
                         CreatureSay(objectId, 0, npc.getName(),
                                     mytext[Rnd.get(len(mytext))]))
                     npc.onDecay()
     return
Exemplo n.º 22
0
    def onSkillUse (self,npc,player,skill):
            # coletar alguns valores em variáveis locais
        npcId = npc.getNpcId()
        skillId = skill.getId()
        # verifique se o npc e as habilidades usadas são válidas para este script. Saia se for inválido.
        if npcId not in self.feedableBeasts : return
        if skillId not in [SKILL_GOLDEN_SPICE,SKILL_CRYSTAL_SPICE] : return

            # primeiro reúne alguns valores em variáveis locais
        objectId = npc.getObjectId()
        growthLevel = 3  # se um mob estiver em feedableBeasts, mas não em growthCapableMobs, então ele estará no crescimento máximo (3)
        if self.growthCapableMobs.has_key(npcId) :
            growthLevel = self.growthCapableMobs[npcId][0]

            # impede a exploração que permite que 2 jogadores levantem simultaneamente a mesma fera de 0-crescimento
            # Se o mob estiver no nível 0 (quando ainda ouvir todos os alimentadores), trave-o no primeiro alimentador!      
        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

            # exibir a ação social da besta comendo a comida.
        npc.broadcastPacket(SocialAction(objectId,2))

            # se este animal não puder crescer, está tudo pronto.
        if npcId in self.growthCapableMobs.keys() :
            # não fazer nada se esta multidão não comer o alimento especificado (a comida é consumida, mas não tem efeito).
            if len(self.growthCapableMobs[npcId][1][food]) == 0 : return

            # rare random talk...
            if Rnd.get(20) == 0 :
                npc.broadcastPacket(CreatureSay(objectId,0,npc.getName(),self.Text[growthLevel][Rnd.get(len(self.Text[growthLevel]))]))

            if growthLevel > 0 :
            # verifique se este é o mesmo jogador daquele que o levantou do crescimento 0.
            # se não, então não permita a chance de criar o animal de estimação (a comida é consumida, mas não tem efeito).
                if self.feedInfo[objectId] != player.getObjectId() : return

            # Polimorfia a máfia, com uma certa chance, dado seu atual nível de crescimento
            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 = ["Recargas! Yeah! "," Eu sou um animal tão guloso, é constrangedor! Ha ha",
                          "Seu sentimento cooperativo está ficando cada vez melhor.",
                          "Vou te ajudar!",
                          "O tempo está muito bom. Quer ir para um piquenique?",
                          "Eu gosto mesmo de você! Isso é gostoso ...",
                          "Se você não precisa sair deste lugar, eu posso ajudá-lo.",
                          "Com o que posso ajudar?",
                          "Eu não estou aqui só por comida!",
                          "Yam, inhame, inhame, inhame, inhame!"]
                npc.broadcastPacket(CreatureSay(objectId,0,npc.getName(),mytext[Rnd.get(len(mytext))]))
        return
Exemplo n.º 23
0
    def spawnNext(self, npc, growthLevel,player,food) :
        npcId = npc.getNpcId()
        nextNpcId = 0

        # encontre o próximo mob para gerar, com base no atual npcId, growthlevel e food.
        if growthLevel == 2:
            rand = Rnd.get(2)
            # se domado, o mob que irá aparecer depende do tipo de classe (lutador / mago) do jogador!
            if rand == 1 :
                if player.getClassId().isMage() :
                    nextNpcId = self.growthCapableMobs[npcId][1][food][1][1]
                else :
                    nextNpcId = self.growthCapableMobs[npcId][1][food][1][0]
  
            # se não domada, há uma pequena chance de ter a doença da "vaca louca".
            # que é um animal mais forte que o normal que ataca seu alimentador
            else :
                if Rnd.get(5) == 0 :
                    nextNpcId = self.growthCapableMobs[npcId][1][food][0][1]
                else :
                    nextNpcId = self.growthCapableMobs[npcId][1][food][0][0]
        # all other levels of growth are straight-forward
        else :            
            nextNpcId = self.growthCapableMobs[npcId][1][food][Rnd.get(len(self.growthCapableMobs[npcId][1][food]))]
        
        # remove the feedinfo of the mob that got despawned, if any
        if self.feedInfo.has_key(npc.getObjectId()) :
            if self.feedInfo[npc.getObjectId()] == player.getObjectId() :
                self.feedInfo.pop(npc.getObjectId())
        
        # despawn the old mob
        if self.growthCapableMobs[npcId][0] == 0 :
            npc.onDecay()
        else :
            npc.deleteMe()
        
        # se esta é finalmente uma multidão treinada, então despawn quaisquer outros mobs treinados que o
        # player pode ter e inicializar a Besta Tamed.
        if nextNpcId in self.tamedBeasts :
            oldTrained = player.getTrainedBeast()
            if oldTrained :
                oldTrained.doDespawn()

            #o seguinte 5 linhas comentadas não são necessárias, mas eles fornecem uma implementação alternativa plausível ... apenas no caso ...
            #nextNpc = self.addSpawn (nextNpcId, npc)
            # nextNpc.setOwner (player)
            # nextNpc.setFoodType (foodSkill [comida])
            # nextNpc.setHome (npc)
                
            template = NpcTable.getInstance().getTemplate(nextNpcId)
            nextNpc = L2TamedBeastInstance(IdFactory.getInstance().getNextId(), template, player, foodSkill[food], npc.getX(), npc.getY(), npc.getZ())
            nextNpc.setRunning()

            objectId = nextNpc.getObjectId()
            
            st = player.getQuestState("20_BringUpWithLove")
            if st :
                if Rnd.get(100) <= 5 and st.getQuestItemsCount(7185) == 0 :
                    st.giveItems(7185,1) # se o jogador tiver 20 missões, dê o item da missão
                    st.set("cond","2")   # é mais fácil codificá-lo aqui do que tentar repetir essas coisas na missão

            # também, execute um bate-papo aleatório raro
            rand = Rnd.get(20)
            if rand > 4 : pass
            elif rand == 0 : npc.broadcastPacket(CreatureSay(objectId,0,nextNpc.getName(), player.getName()+", você vai me mostrar o seu refúgio?"))
            elif rand == 1 : npc.broadcastPacket(CreatureSay(objectId,0,nextNpc.getName(), player.getName()+", Sempre que olho para o tempero, penso em você."))
            elif rand == 2 : npc.broadcastPacket(CreatureSay(objectId,0,nextNpc.getName(), player.getName()+", você não precisa voltar para a aldeia. Eu vou te dar força"))
            elif rand == 3 : npc.broadcastPacket(CreatureSay(objectId,0,nextNpc.getName(), "Thanks, "+player.getName()+".  Espero poder te ajudar"))
            elif rand == 4 : npc.broadcastPacket(CreatureSay(objectId,0,nextNpc.getName(), player.getName()+", O que eu posso fazer para te ajudar?"))

            # se não for treinado, o mob recém-criado será automaticamente agro contra seu alimentador
            # (o que aconteceu com "nunca morder a mão que te alimenta" de qualquer maneira ?!)
        else :
            # desovar o novo mob
            nextNpc = self.addSpawn(nextNpcId,npc)

            if nextNpcId in self.madCowPolymorph :
                self.startQuestTimer("polymorph Mad Cow", 10000, nextNpc, player)            
            
            # registrar o jogador no feedinfo para a multidão que acabou de gerar
            self.feedInfo[nextNpc.getObjectId()] = player.getObjectId()
            nextNpc.setRunning()
            nextNpc.addDamageHate(player,0,99999)
            nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player)
Exemplo n.º 24
0
 def onAdvEvent(self, event, npc, player):
     st = player.getQuestState(qn)
     if not st: return
     htmltext = event
     if event == "31349-02.htm":
         st.playSound("ItemSound.quest_accept")
         st.set("cond", "1")
         st.setState(STARTED)
     elif event == "31349-03.htm":
         if st.getQuestItemsCount(SuspiciousTotem):
             htmltext = "31349-05.htm"
         else:
             st.playSound("ItemSound.quest_middle")
             st.set("cond", "2")
     elif event == "31349-10.htm":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "4")
     elif event == "31348-02.htm":
         st.takeItems(SuspiciousTotem, -1)
     elif event == "31348-07.htm":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "5")
         st.giveItems(GemstoneKey, 1)
     elif event == "31522-04.htm":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "6")
     elif event == "31535-03.htm":
         if st.getInt("step") == 0:
             st.set("step", "1")
             triol = st.addSpawn(Triol, 59712, -47568, -2712, 0, 0, 300000,
                                 1)
             time.sleep(1)
             triol.broadcastPacket(
                 CreatureSay(
                     triol.getObjectId(), 0, triol.getName(),
                     "That box was sealed by my master. Don't touch it!"))
             triol.setRunning()
             triol.addDamageHate(player, 0, 999)
             triol.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK,
                                        player)
             st.playSound("ItemSound.quest_middle")
             st.set("cond", "7")
         elif st.getInt("step") == 2:
             htmltext = "31535-04.htm"
     elif event == "31535-05.htm":
         st.giveItems(Contract, 1)
         st.takeItems(GemstoneKey, -1)
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "9")
     elif event == "31532-02.htm":
         st.takeItems(Contract, -1)
     elif event == "31532-06.htm":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "11")
     elif event == "31531-02.htm":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "12")
         st.addSpawn(Coffin, 60104, -35820, -664, 0, 0, 20000, 1)
     elif event == "31532-18.htm":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "15")
     elif event == "31522-12.htm":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "16")
     elif event == "31348-10.htm":
         st.takeItems(TotemDoll, -1)
     elif event == "31348-15.htm":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "17")
     elif event == "31348-16.htm":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "18")
     elif event == "31532-20.htm":
         st.giveItems(905, 2)
         st.giveItems(874, 1)
         st.takeItems(7063, -1)
         st.addExpAndSp(572277, 53750)
         st.unset("cond")
         st.exitQuest(False)
         st.playSound("ItemSound.quest_finish")
     elif event == "31522-15.htm":
         st.giveItems(936, 1)
         st.giveItems(874, 1)
         st.takeItems(7063, -1)
         st.addExpAndSp(572277, 53750)
         st.unset("cond")
         st.exitQuest(False)
         st.playSound("ItemSound.quest_finish")
     return htmltext
Exemplo n.º 25
0
def autochat(npc,text) :
    if npc: npc.broadcastPacket(CreatureSay(npc.getObjectId(),0,npc.getName(),text))
    return
Exemplo n.º 26
0
 def onEvent(self, event, st):
     htmltext = event
     if event == "31961-02.htm":
         st.set("cond", "22")
         st.takeItems(Letter, 1)
         st.giveItems(Starstone2, 1)
         st.playSound("ItemSound.quest_middle")
     if event == "32041-02.htm":
         st.setState(STARTED)
         st.playSound("ItemSound.quest_accept")
         st.set("cond", "1")
         st.set("talk", "0")
     elif event == "32041-06.htm":
         st.set("talk", "1")
     elif event == "32041-07.htm":
         st.set("cond", "2")
         st.playSound("ItemSound.quest_middle")
         st.set("talk", "0")
     elif event == "32041-10.htm":
         choice = st.getInt("choice")
         if choice == 1:
             htmltext = "32041-10.htm"
         elif choice == 2:
             htmltext = "32041-10a.htm"
         elif choice == 3:
             htmltext = "32041-10b.htm"
     elif event == "32041-11.htm":
         st.set("talk", "1")
     elif event == "32041-18.htm":
         st.set("talk", "2")
     elif event == "32041-20.htm":
         st.set("cond", "6")
         st.playSound("ItemSound.quest_middle")
         st.set("talk", "0")
     elif event == "32041-25.htm":
         st.set("cond", "17")
         st.playSound("ItemSound.quest_middle")
         st.giveItems(Detector, 1)
     elif event == "32041-28.htm":
         st.takeItems(Detector2, 1)
         st.set("talk", "1")
     elif event == "32041-31.htm":
         choice = st.getInt("choice")
         if choice > 1:
             htmltext = "32041-37.htm"
     elif event == "32041-32.htm":
         st.set("cond", "21")
         st.giveItems(Letter, 1)
         st.playSound("ItemSound.quest_middle")
     elif event == "32041-36.htm":
         st.set("cond", "20")
         st.playSound("ItemSound.quest_middle")
     elif event == "32046-02.htm":
         st.set("cond", "19")
         st.playSound("ItemSound.quest_middle")
     elif event == "32046-06.htm":
         st.exitQuest(False)
         st.addExpAndSp(410358, 32060)
         st.playSound("ItemSound.quest_finish")
     elif event == "32047-01.htm":
         if st.getInt("talk") + st.getInt("talk1") == 2:
             htmltext = "32047-04.htm"
         elif st.getInt("talk") + st.getInt("talk1") + st.getInt(
                 "talk2") == 6:
             htmltext = "32047-08.htm"
     elif event == "32047-02.htm":
         if st.getInt("talk") == 0:
             st.set("talk", "1")
     elif event == "32047-03.htm":
         if st.getInt("talk1") == 0:
             st.set("talk1", "1")
     elif event == "32047-05.htm":
         st.set("cond", "3")
         st.playSound("ItemSound.quest_middle")
         st.set("talk", "0")
         st.set("choice", "1")
         st.unset("talk1")
     elif event == "32047-06.htm":
         st.set("cond", "4")
         st.playSound("ItemSound.quest_middle")
         st.set("talk", "0")
         st.set("choice", "2")
         st.unset("talk1")
     elif event == "32047-07.htm":
         st.set("cond", "5")
         st.playSound("ItemSound.quest_middle")
         st.set("talk", "0")
         st.set("choice", "3")
         st.unset("talk1")
     elif event == "32047-13.htm":
         st.set("cond", "7")
         st.playSound("ItemSound.quest_middle")
     elif event == "32047-13a.htm":
         st.set("cond", "10")
         st.playSound("ItemSound.quest_middle")
     elif event == "32047-15.htm":
         if st.getInt("talk") == 0:
             st.set("talk", "1")
     elif event == "32047-15a.htm":
         if self.isSpawned == 0:
             golem = st.addSpawn(Guardian, 96977, -110625, -3280, 0, False,
                                 900000)
             golem.broadcastPacket(
                 CreatureSay(
                     golem.getObjectId(), 0, golem.getName(),
                     "You, " + st.getPlayer().getName() +
                     ", you attacked Wendy. Prepare to die!"))
             golem.setRunning()
             golem.addDamageHate(player, 0, 999)
             golem.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK,
                                        player)
             self.isSpawned = 1
         else:
             htmltext = "32047-19a.htm"
     elif event == "32047-17a.htm":
         st.set("cond", "12")
         st.playSound("ItemSound.quest_middle")
     elif event == "32047-20.htm":
         st.set("talk", "2")
     elif event == "32047-23.htm":
         st.set("cond", "13")
         st.playSound("ItemSound.quest_middle")
         st.set("talk", "0")
     elif event == "32047-25.htm":
         st.set("cond", "15")
         st.playSound("ItemSound.quest_middle")
         st.takeItems(Starstone, 1)
     elif event == "32047-30.htm":
         st.set("talk", "2")
     elif event == "32047-33.htm":
         if st.getInt("cond") == 7:
             st.set("cond", "8")
             st.set("talk", "0")
             st.playSound("ItemSound.quest_middle")
         elif st.getInt("cond") == 8:
             st.set("cond", "9")
             st.playSound("ItemSound.quest_middle")
             htmltext = "32047-34.htm"
     elif event == "32047-34.htm":
         st.set("cond", "9")
         st.playSound("ItemSound.quest_middle")
     elif event == "32047-38.htm":
         st.giveItems(Starstone2, 1)
         st.takeItems(57, 3000)
         st.set("cond", "26")
         st.playSound("ItemSound.quest_middle")
     elif event == "32050-02.htm":
         st.playSound("ItemSound.armor_wood_3")
         st.set("talk", "1")
     elif event == "32050-04.htm":
         st.set("cond", "14")
         st.giveItems(Starstone, 1)
         st.playSound("ItemSound.quest_middle")
         st.set("talk", "0")
     return htmltext