Esempio n. 1
0
 def onKill(self, npc, player, isPet):
     leaderst = leader(player)
     if not leaderst: return
     if not leaderst.getState() == State.STARTED:
         if DEBUG:
             print "onKill says leader needs to start quest"
             return "Need to start quest!"
         return
     part = leaderst.getInt("part")
     npcId = npc.getNpcId()
     if npcId in CHESTS and part == 4:
         wins = leaderst.getInt("chest_wins")
         if (self.chests - wins) == 12 or (wins < 4
                                           and not leaderst.getRandom(4)):
             wins += 1
             leaderst.set("chest_wins", str(wins))
             npc.broadcastPacket(
                 NpcSay(npc.getObjectId(), 0, npc.getNpcId(),
                        "###### BINGO! ######"))
         self.chests += 1
     elif npcId in MOBS.keys():
         st = player.getQuestState(qn)
         if not st: st = self.newQuestState(player)
         if st == leaderst: return
         if part >= 3 and part < 6:
             if not st.getRandom(10):
                 st.giveItems(MOBS[npcId], 1)
                 st.playSound("ItemSound.quest_itemget")
         elif DEBUG:
             print "onKill says leader is not correct state" + str(part)
             return "leader is not correct state"
     return
Esempio n. 2
0
 def onKill(self, npc, player, isPet):
     st = player.getQuestState(qn)
     if not st: return
     if st.getState() != State.STARTED: return
     if st.getInt("cond") == 7:
         st.playSound("ItemSound.quest_itemget")
         st.set("cond", "8")
         npc.broadcastPacket(
             NpcSay(
                 npc.getObjectId(), 0, npc.getNpcId(),
                 "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
Esempio n. 3
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(State.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(NpcSay(ghost.getObjectId(),0,ghost.getNpcId(),"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
Esempio n. 4
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() != State.STARTED : 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(NpcSay(spawnedNpc.getObjectId(),0,spawnedNpc.getNpcId(),"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
Esempio n. 5
0
 def onAttack(self, npc, player, damage, isPet, skill):
     st = player.getQuestState(qn)
     if not st:
         return
     npcId = npc.getNpcId()
     for pc, mobId, in self.killedTrees:
         if pc == player and mobId == npcId:
             return
     if isPet and st.getInt("id") < 16:
         pet = player.getPet()
         if st.getRandom(100) <= 2 and st.getQuestItemsCount(FT_LEAF) >= 0:
             st.takeItems(FT_LEAF, 1)
             st.playSound("ItemSound.quest_middle")
             npc.broadcastPacket(
                 NpcSay(npc.getNpcId(), 0, npcId,
                        "gives me spirit leaf...!"))
             self.killedTrees.append([player, npcId])
             if st.getQuestItemsCount(FT_LEAF) == 0:
                 st.set("id", "15")
                 st.set("cond", "3")
     return
Esempio n. 6
0
def AutoChat(npc, text):
    chars = npc.getKnownList().getKnownPlayers().values().toArray()
    if chars != None:
        for pc in chars:
            sm = NpcSay(npc.getObjectId(), 0, npc.getNpcId(), text)
            pc.sendPacket(sm)
Esempio n. 7
0
    def onKill(self, npc, player, isPet):
        st = player.getQuestState(qn)
        if not st: return
        if st.getState() != State.STARTED: return

        npcId = npc.getNpcId()
        if npcId == 20479:
            st.set("id", "0")
            if st.getInt("cond") and st.getQuestItemsCount(
                    FIRE_CHARM
            ) == 1 and st.getQuestItemsCount(KASHA_BEAR_PELT) < 1:
                if st.getQuestItemsCount(
                        KASHA_BEAR_PELT) + st.getQuestItemsCount(
                            KASHA_BSPIDER_HUSK) + st.getQuestItemsCount(
                                FIERY_EGG1) == 2:
                    st.giveItems(KASHA_BEAR_PELT, 1)
                    st.playSound("ItemSound.quest_middle")
                    st.set("cond", "2")
                else:
                    st.giveItems(KASHA_BEAR_PELT, 1)
                    st.playSound("ItemSound.quest_itemget")
        elif npcId == 27319:
            if st.getInt("cond") == 14:
                st.set("cond", "15")
                st.playSound("ItemSound.quest_middle")
                npc.broadcastPacket(
                    NpcSay(
                        npc.getObjectId(), 0, npc.getNpcId(),
                        "My dear friend of " + player.getName() +
                        ", who has gone on ahead of me!"))
            elif st.getInt("cond") == 16:
                st.set("cond", "17")
                st.playSound("ItemSound.quest_middle")
                npc.broadcastPacket(
                    NpcSay(
                        npc.getObjectId(), 0, npc.getNpcId(),
                        "Listen to Tejakar Gandi, young Oroka! The spirit of the slain leopard is calling you, "
                        + player.getName() + "!"))
            elif st.getInt("cond") == 18:
                st.set("cond", "19")
                st.playSound("ItemSound.quest_middle")
        elif npcId == 20478:
            st.set("id", "0")
            if st.getInt("cond") and st.getQuestItemsCount(
                    FIRE_CHARM
            ) == 1 and st.getQuestItemsCount(KASHA_BSPIDER_HUSK) < 1:
                if st.getQuestItemsCount(
                        KASHA_BEAR_PELT) + st.getQuestItemsCount(
                            KASHA_BSPIDER_HUSK) + st.getQuestItemsCount(
                                FIERY_EGG1) == 2:
                    st.giveItems(KASHA_BSPIDER_HUSK, 1)
                    st.playSound("ItemSound.quest_middle")
                    st.set("cond", "2")
                else:
                    st.giveItems(KASHA_BSPIDER_HUSK, 1)
                    st.playSound("ItemSound.quest_itemget")
        elif npcId == 20415:
            st.set("id", "0")
            if st.getInt("cond") and st.getQuestItemsCount(
                    FIRE_CHARM) == 1 and st.getQuestItemsCount(FIERY_EGG1) < 1:
                if st.getQuestItemsCount(
                        KASHA_BEAR_PELT) + st.getQuestItemsCount(
                            KASHA_BSPIDER_HUSK) + st.getQuestItemsCount(
                                FIERY_EGG1) == 2:
                    st.giveItems(FIERY_EGG1, 1)
                    st.playSound("ItemSound.quest_middle")
                    st.set("cond", "2")
                else:
                    st.giveItems(FIERY_EGG1, 1)
                    st.playSound("ItemSound.quest_itemget")
        elif npcId == 20335:
            st.set("id", "0")
            if st.getInt("cond") and st.getQuestItemsCount(
                    FLAME_CHARM
            ) == 1 and st.getQuestItemsCount(GRIZZLY_BLOOD) < 3:
                if st.getQuestItemsCount(GRIZZLY_BLOOD) == 2:
                    st.giveItems(GRIZZLY_BLOOD, 1)
                    st.playSound("ItemSound.quest_middle")
                    st.set("cond", "7")
                else:
                    st.giveItems(GRIZZLY_BLOOD, 1)
                    st.playSound("ItemSound.quest_itemget")
        elif npcId == 20038:
            st.set("id", "0")
            if st.getInt("cond") and st.getQuestItemsCount(
                    SPIRIT_NET) == 1 and st.getQuestItemsCount(
                        BOUND_DURKA_SPIRIT
                    ) == 0 and st.getQuestItemsCount(DURKA_PARASITE) < 8:
                n = st.getRandom(10)
                if st.getQuestItemsCount(DURKA_PARASITE) == 5 and n < 1:
                    st.takeItems(DURKA_PARASITE,
                                 st.getQuestItemsCount(DURKA_PARASITE))
                    st.addSpawn(27056)
                    st.playSound("ItemSound.quest_itemget")
                elif st.getQuestItemsCount(DURKA_PARASITE) == 6 and n < 2:
                    st.takeItems(DURKA_PARASITE,
                                 st.getQuestItemsCount(DURKA_PARASITE))
                    st.playSound("ItemSound.quest_itemget")
                    st.addSpawn(27056)
                elif st.getQuestItemsCount(DURKA_PARASITE) == 7 and n < 2:
                    st.takeItems(DURKA_PARASITE,
                                 st.getQuestItemsCount(DURKA_PARASITE))
                    st.playSound("ItemSound.quest_itemget")
                    st.addSpawn(27056)
                elif st.getQuestItemsCount(DURKA_PARASITE) >= 7:
                    st.addSpawn(27056)
                    st.playSound("ItemSound.quest_itemget")
                    st.takeItems(DURKA_PARASITE,
                                 st.getQuestItemsCount(DURKA_PARASITE))
                else:
                    st.giveItems(DURKA_PARASITE, 1)
                    st.playSound("ItemSound.quest_itemget")
        elif npcId == 20043:
            st.set("id", "0")
            if st.getInt("cond") and st.getQuestItemsCount(
                    SPIRIT_NET) == 1 and st.getQuestItemsCount(
                        BOUND_DURKA_SPIRIT
                    ) == 0 and st.getQuestItemsCount(DURKA_PARASITE) < 8:
                n = st.getRandom(10)
                if st.getQuestItemsCount(DURKA_PARASITE) == 5 and n < 1:
                    st.takeItems(DURKA_PARASITE,
                                 st.getQuestItemsCount(DURKA_PARASITE))
                    st.addSpawn(27056)
                    st.playSound("ItemSound.quest_itemget")
                elif st.getQuestItemsCount(DURKA_PARASITE) == 6 and n < 2:
                    st.takeItems(DURKA_PARASITE,
                                 st.getQuestItemsCount(DURKA_PARASITE))
                    st.playSound("ItemSound.quest_itemget")
                    st.addSpawn(27056)
                elif st.getQuestItemsCount(DURKA_PARASITE) == 7 and n < 2:
                    st.takeItems(DURKA_PARASITE,
                                 st.getQuestItemsCount(DURKA_PARASITE))
                    st.playSound("ItemSound.quest_itemget")
                    st.addSpawn(27056)
                elif st.getQuestItemsCount(DURKA_PARASITE) >= 7:
                    st.addSpawn(27056)
                    st.playSound("ItemSound.quest_itemget")
                    st.takeItems(DURKA_PARASITE,
                                 st.getQuestItemsCount(DURKA_PARASITE))
                else:
                    st.giveItems(DURKA_PARASITE, 1)
                    st.playSound("ItemSound.quest_itemget")
        elif npcId == 27056:
            st.set("id", "0")
            if st.getInt("cond") and st.getQuestItemsCount(
                    SPIRIT_NET) == 1 and st.getQuestItemsCount(
                        BOUND_DURKA_SPIRIT) == 0:
                st.giveItems(BOUND_DURKA_SPIRIT, 1)
                st.takeItems(SPIRIT_NET, 1)
                st.takeItems(DURKA_PARASITE,
                             st.getQuestItemsCount(DURKA_PARASITE))
                st.playSound("ItemSound.quest_middle")
                st.set("cond", "10")
        return
Esempio n. 8
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(State.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.rewardItems(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(
             NpcSay(man.getObjectId(), 0, man.getNpcId(), "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.htm":
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "8")
         man = st.addSpawn(Suspicious, 117890, -126478, -2584, 0, False,
                           4000)
         man.broadcastPacket(
             NpcSay(man.getObjectId(), 0, man.getNpcId(),
                    "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(
             NpcSay(npc.getObjectId(), 0, npc.getNpcId(),
                    "I see someone. Is this fate?"))
     elif event == "2":
         npc.broadcastPacket(
             NpcSay(
                 npc.getObjectId(), 0, npc.getNpcId(),
                 "Don't bother trying to find out more about me. Follow your own destiny."
             ))
     return htmltext
Esempio n. 9
0
 def onAdvEvent(self, event, npc, player):
     st = player.getQuestState(qn)
     if not st: return
     htmltext = event
     if event == "31522-02.htm":
         st.setState(State.STARTED)
         st.playSound("ItemSound.quest_accept")
         st.set("cond", "1")
     elif event == "31328-05.htm":
         st.set("cond", "0")
         st.set("onlyone", "1")
         st.unset("AGRIPEL")
         st.unset("DOMINIC")
         st.unset("BENEDICT")
         st.exitQuest(False)
         st.takeItems(7140, -1)
         if st.getQuestItemsCount(7141) == 0:
             st.giveItems(7141, 1)
             st.addExpAndSp(131228, 11978)
         st.playSound("ItemSound.quest_finish")
         htmltext = "31328-05.htm"
     elif event == "31523-03.htm":
         st.playSound("SkillSound5.horror_02")
         st.set("cond", "2")
         ghost = st.addSpawn(31524, 51432, -54570, -3136, 180000)
         ghost.broadcastPacket(
             NpcSay(ghost.getObjectId(), 0, ghost.getNpcId(),
                    "Who awoke me?"))
     elif event == "31524-06.htm":
         st.set("cond", "3")
         st.playSound("ItemSound.quest_middle")
         ghost = self.addSpawn(31525, npc)
         ghost.broadcastPacket(
             NpcSay(
                 ghost.getObjectId(), 0, ghost.getNpcId(),
                 "My master has instructed me to be your guide, " +
                 player.getName()))
         self.startQuestTimer("1", 1, ghost, player)
         self.startQuestTimer("despawn", 180000, ghost, player)
     elif event == "31526-03.htm":
         st.playSound("ItemSound.item_drop_equip_armor_cloth")
     elif event == "31526-08.htm":
         st.playSound("AmdSound.ed_chimes_05")
         st.set("cond", "5")
         st.playSound("ItemSound.quest_middle")
     elif event == "31526-14.htm":
         st.giveItems(7140, 1)
         st.set("cond", "6")
         st.playSound("ItemSound.quest_middle")
     elif event == "despawn":
         npc.deleteMe()
         return
     elif event.isdigit():
         loc = int(event)
         x, y, z, heading = ROUTES[loc]
         if event == "1":
             npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,
                                      Location(x, y, z, heading))
             self.startQuestTimer("2", 5000, npc, player)
         elif event == "2":
             npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,
                                      Location(x, y, z, heading))
             self.startQuestTimer("3", 12000, npc, player)
         elif event == "3":
             npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,
                                      Location(x, y, z, heading))
             self.startQuestTimer("4", 15000, npc, player)
         elif event == "4":
             npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,
                                      Location(x, y, z, heading))
             self.startQuestTimer("5", 5000, npc, player)
         elif event == "5":
             npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO,
                                      Location(x, y, z, heading))
         return
     return htmltext
Esempio n. 10
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(State.STARTED)
    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)[0]
        for i in members:
          pst = QuestManager.getInstance().getQuest(qn).newQuestState(st.getPlayer().getClan().getClanMember(int(i)).getPlayerInstance())
          pst.setState(State.STARTED)
      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(NpcSay(spawnedNpc.getObjectId(),0,spawnedNpc.getNpcId(),"Blood and Honour."))
      spawnedNpc=st.addSpawn(30759,160665,21209,-3710,90000)
      spawnedNpc.broadcastPacket(NpcSay(spawnedNpc.getObjectId(),0,spawnedNpc.getNpcId(),"Ambition and Power"))
      spawnedNpc=st.addSpawn(30758,160665,21291,-3710,90000)
      spawnedNpc.broadcastPacket(NpcSay(spawnedNpc.getObjectId(),0,spawnedNpc.getNpcId(),"War and Death"))
    elif event == "30766-08.htm":
      st.takeItems(Scepter_Judgement,-1)
      exit503(0,st)
    return htmltext
Esempio n. 11
0
def autochat(npc, text):
    if npc:
        npc.broadcastPacket(NpcSay(npc.getObjectId(), 0, npc.getNpcId(), text))
    return
Esempio n. 12
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(State.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(
                 NpcSay(
                     triol.getObjectId(), 0, triol.getNpcId(),
                     "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