Exemplo n.º 1
0
 def onAdvEvent(self, event, npc, player):
     htmltext = event
     st = player.getQuestState(qn)
     if not st: return
     if event in ["30839-02.htm", "31307-02.htm"]:
         st.set("cond", "1")
         st.setState(State.STARTED)
         st.playSound("ItemSound.quest_accept")
     elif event == "30839-05.htm":
         st.set("cond", "2")
         st.playSound("ItemSound.quest_middle")
     elif event == "31307-05.htm":
         st.set("cond", "7")
         st.playSound("ItemSound.quest_middle")
     elif event == "32325-03.htm":
         st.set("cond", "3")
         st.giveItems(YinSword, 1, Elementals.FIRE, 10)
         st.playSound("ItemSound.quest_middle")
     elif event == "32326-03.htm":
         st.set("cond", "8")
         st.giveItems(YangSword, 1, Elementals.EARTH, 10)
         st.playSound("ItemSound.quest_middle")
     elif event == "32325-06.htm":
         if st.getQuestItemsCount(YinSword):
             st.takeItems(YinSword, 1)
             htmltext = "32325-07.htm"
         st.giveItems(YinSword, 1, Elementals.FIRE, 10)
     elif event == "32326-06.htm":
         if st.getQuestItemsCount(YangSword):
             st.takeItems(YangSword, 1)
             htmltext = "32326-07.htm"
         st.giveItems(YangSword, 1, Elementals.EARTH, 10)
     elif event == "32325-09.htm":
         st.set("cond", "5")
         SkillTable.getInstance().getInfo(2635,
                                          1).getEffects(player, player)
         st.giveItems(YinSword, 1, Elementals.FIRE, 10)
         st.playSound("ItemSound.quest_middle")
     elif event == "32326-09.htm":
         st.set("cond", "10")
         SkillTable.getInstance().getInfo(2636,
                                          1).getEffects(player, player)
         st.giveItems(YangSword, 1, Elementals.EARTH, 10)
         st.playSound("ItemSound.quest_middle")
     elif event.isdigit():
         st.giveItems(10520 + int(event), 2)
         st.addExpAndSp(202160, 20375)
         st.unset("cond")
         st.exitQuest(False)
         st.playSound("ItemSound.quest_finish")
         htmltext = str(npc.getNpcId()) + "-1" + event + ".htm"
     return htmltext
Exemplo n.º 2
0
 def onAdvEvent (self,event,npc, player) :
     htmltext = event
     st = player.getQuestState(qn)
     if not st : return
     if event in ["30839-02.htm","31307-02.htm"] :
         st.set("cond","1")
         st.setState(State.STARTED)
         st.playSound("ItemSound.quest_accept")
     elif event == "30839-05.htm" :
         st.set("cond","2")
         st.playSound("ItemSound.quest_middle")
     elif event == "31307-05.htm" :
         st.set("cond","7")
         st.playSound("ItemSound.quest_middle")
     elif event == "32325-03.htm" :
         st.set("cond","3")
         st.giveItems(YinSword,1,Elementals.FIRE,10)
         st.playSound("ItemSound.quest_middle")
     elif event == "32326-03.htm" :
         st.set("cond","8")
         st.giveItems(YangSword,1,Elementals.EARTH,10)
         st.playSound("ItemSound.quest_middle")
     elif event == "32325-06.htm" :
         if st.getQuestItemsCount(YinSword):
            st.takeItems(YinSword,1)
            htmltext = "32325-07.htm"
         st.giveItems(YinSword,1,Elementals.FIRE,10)
     elif event == "32326-06.htm" :
         if st.getQuestItemsCount(YangSword):
            st.takeItems(YangSword,1)
            htmltext = "32326-07.htm"
         st.giveItems(YangSword,1,Elementals.EARTH,10)
     elif event == "32325-09.htm" :
         st.set("cond","5")
         SkillTable.getInstance().getInfo(2635,1).getEffects(player,player)
         st.giveItems(YinSword,1,Elementals.FIRE,10)
         st.playSound("ItemSound.quest_middle")
     elif event == "32326-09.htm" :
         st.set("cond","10")
         SkillTable.getInstance().getInfo(2636,1).getEffects(player,player)
         st.giveItems(YangSword,1,Elementals.EARTH,10)
         st.playSound("ItemSound.quest_middle")
     elif event.isdigit() :
         st.giveItems(10520+int(event),2)
         st.addExpAndSp(202160,20375)
         st.unset("cond")
         st.exitQuest(False)
         st.playSound("ItemSound.quest_finish")
         htmltext = str(npc.getNpcId())+"-1"+event+".htm"
     return htmltext
Exemplo n.º 3
0
 def onAttack (self,npc,player,damage,isPet):
   st = player.getQuestState(qn)
   if not st : return 
   if st.getState() != State.STARTED : return 
   
   chance=st.getRandom(100)
   if chance < 3 :
      count = 0
      for item in range(5875,5879):
         if st.getQuestItemsCount(item) :
            count += 1
            st.takeItems(item,-1)
      if count:
         st.giveItems(5880,1)
   elif chance < 7 :
      for item in range(5875,5879):
         if st.getQuestItemsCount(item) :
            npc.doCast(SkillTable.getInstance().getInfo(4072,4))
            st.takeItems(item,-1)
            st.giveItems(item+1,1)
            if item < 5878 :
               st.playSound("ItemSound.quest_itemget")
            elif item == 5878 :
               st.playSound("ItemSound.quest_middle")
               st.set("cond","2")
            break
   return
Exemplo n.º 4
0
 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,horns=BUFF[event]
        if st.getQuestItemsCount(Horn) >= horns :
            st.takeItems(Horn,horns)
            npc.setTarget(player)
            npc.doCast(SkillTable.getInstance().getInfo(skillId,level))
            npc.setCurrentHpMp(npc.getMaxHp(), npc.getMaxMp())
            htmltext = "31372-4.htm"
    elif event == "Withdraw" :
        if player.getWarehouse().getSize() == 0 :
            htmltext = "31374-0.htm"
        else :
            player.sendPacket(ActionFailed())
            player.setActiveWarehouse(player.getWarehouse())
            player.sendPacket(WareHouseWithdrawalList(player, 1))
    elif event == "Teleport" :
        if Alevel == 4 :
            htmltext = "31376-4.htm"
        elif Alevel == 5 :
            htmltext = "31376-5.htm"
    return htmltext
Exemplo n.º 5
0
    def onAttack(self, npc, player, damage, isPet):
        st = player.getQuestState(qn)
        if not st: return
        if st.getState() != State.STARTED: return

        chance = st.getRandom(100)
        if chance < 3:
            count = 0
            for item in range(5875, 5879):
                if st.getQuestItemsCount(item):
                    count += 1
                    st.takeItems(item, -1)
            if count:
                st.giveItems(5880, 1)
        elif chance < 7:
            for item in range(5875, 5879):
                if st.getQuestItemsCount(item):
                    npc.doCast(SkillTable.getInstance().getInfo(4072, 4))
                    st.takeItems(item, -1)
                    st.giveItems(item + 1, 1)
                    if item < 5878:
                        st.playSound("ItemSound.quest_itemget")
                    elif item == 5878:
                        st.playSound("ItemSound.quest_middle")
                        st.set("cond", "2")
                    break
        return
Exemplo n.º 6
0
 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.STATIC_PACKET)
            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
Exemplo n.º 7
0
    def onEvent(self, event, st):
        htmltext = event
        #####  Leaders area  ######
        if event == "30756-03.htm":
            st.setState(PART2)
            st.set("cond", "1")
            st.playSound("ItemSound.quest_accept")
        elif event == "30759-03.htm":
            st.setState(PART3)
            st.set("cond", "2")
            st.set("dead_list", " ")
        elif event == "30759-07.htm":
            for i in range(3):
                st.takeItems(SYMBOL_OF_LOYALTY, 1)
            st.giveItems(ANTIDOTE_RECIPE, 1)
            st.addNotifyOfDeath(st.getPlayer())
            st.setState(PART4)
            st.set("cond", "3")
            st.set("ingredients", "0 0 0")
            st.set("chest_count", "0")
            st.set("chest_game", "0")
            st.set("chest_try", "0")
            st.startQuestTimer("poison_timer", 3600000)
            st.getPlayer().useMagic(SkillTable.getInstance().getInfo(4082, 1),
                                    False, False)
        elif event == "poison_timer":
            members_finnish(st)
            st.exitQuest(1)
            htmltext = "30759-09.htm"
        elif event == "chest_timer":
            htmltext = ""
            chest_game(st, "stop")
            if DEBUG: htmltext = "DEBUG MESSAGE: chest timer event sent."


#####  Members area  ######
        elif event == "30757-04.htm":
            deadlist = leader(st).get("dead_list").split()
            deadlist.append(st.getPlayer().getName())
            leader(st).set("dead_list", " ".join(deadlist))
            st.addNotifyOfDeath(
                st.getPlayer().getClan().getLeader().getPlayerInstance())
            st.getPlayer().reduceCurrentHp(st.getPlayer().getCurrentHp(),
                                           st.getPlayer())
            st.giveItems(SYMBOL_OF_LOYALTY, 1)
            st.playSound("ItemSound.quest_accept")
        elif event == "30757-05.htm":
            st.exitQuest(1)
        elif event == "30758-03.htm":
            chest_game(st, "start")
        elif event == "30758-07.htm":
            if st.getQuestItemsCount(RETRY_ITEMS) < RETRY_PRICE:
                htmltext = "30758-06.htm"
            else:
                st.takeItems(RETRY_ITEMS, RETRY_PRICE)
        return htmltext
Exemplo n.º 8
0
 def onEvent (self,event,st):
    if event in BUFF.keys() :
        skillId,level,horns=BUFF[event]
        if st.getQuestItemsCount(Horn) >= horns :
            a = st.getPlayer().getCurrentMp()
            st.takeItems(Horn,horns)
            st.getPlayer().setTarget(st.getPlayer())
            st.getPlayer().doCast(SkillTable.getInstance().getInfo(skillId,level))
            st.getPlayer().setCurrentMp(a)
            htmltext = "a4.htm"
    return
Exemplo n.º 9
0
 def onEvent(self, event, st):
     if event in BUFF.keys():
         skillId, level, horns = BUFF[event]
         if st.getQuestItemsCount(Horn) >= horns:
             a = st.getPlayer().getCurrentMp()
             st.takeItems(Horn, horns)
             st.getPlayer().setTarget(st.getPlayer())
             st.getPlayer().doCast(SkillTable.getInstance().getInfo(
                 skillId, level))
             st.getPlayer().setCurrentMp(a)
             htmltext = "a4.htm"
     return
Exemplo n.º 10
0
 def onEvent (self,event,st) :
    htmltext = event
    if htmltext == "01" :
       if st.getPlayer().getLevel() < 40 :
          st.getPlayer().setTarget(st.getPlayer())
          st.getPlayer().useMagic(SkillTable.getInstance().getInfo(5182,1),False,False)
          st.exitQuest(1)
          return
       else:
          st.exitQuest(1)
          return "00.htm"
    return
Exemplo n.º 11
0
 def onEvent (self,event,st):
   htmltext = event
#####  Leaders area  ######
   if event == "30756-03.htm" :
     st.setState(PART2)
     st.set("cond","1")
     st.playSound("ItemSound.quest_accept")
   elif event == "30759-03.htm" :
     st.setState(PART3)
     st.set("cond","2")
     st.set("dead_list"," ")
   elif event == "30759-07.htm" :
     for i in range(3) :
        st.takeItems(SYMBOL_OF_LOYALTY,1)
     st.giveItems(ANTIDOTE_RECIPE,1)
     st.addNotifyOfDeath(st.getPlayer())
     st.setState(PART4)
     st.set("cond","3")
     st.set("ingredients","0 0 0")
     st.set("chest_count","0")
     st.set("chest_game","0")
     st.set("chest_try","0")
     st.startQuestTimer("poison_timer",3600000)
     st.getPlayer().useMagic(SkillTable.getInstance().getInfo(4082,1),False,False)
   elif event == "poison_timer" :
     members_finnish(st)
     st.exitQuest(1)
     htmltext = "30759-09.htm"
   elif event == "chest_timer" :
     htmltext = ""
     chest_game(st,"stop")
     if DEBUG: htmltext = "DEBUG MESSAGE: chest timer event sent."
#####  Members area  ######
   elif event == "30757-04.htm" :
     deadlist = leader(st).get("dead_list").split()
     deadlist.append(st.getPlayer().getName())
     leader(st).set("dead_list"," ".join(deadlist))
     st.addNotifyOfDeath(st.getPlayer().getClan().getLeader().getPlayerInstance())
     st.getPlayer().reduceCurrentHp(st.getPlayer().getCurrentHp(),st.getPlayer())
     st.giveItems(SYMBOL_OF_LOYALTY,1)
     st.playSound("ItemSound.quest_accept")
   elif event == "30757-05.htm" :
     st.exitQuest(1)
   elif event == "30758-03.htm" :
     chest_game(st,"start")
   elif event == "30758-07.htm" :
     if st.getQuestItemsCount(RETRY_ITEMS) < RETRY_PRICE :
        htmltext = "30758-06.htm"
     else :
        st.takeItems(RETRY_ITEMS,RETRY_PRICE) 
   return htmltext
Exemplo n.º 12
0
 def onKill (self,npc,player,isPet):
     npcId = npc.getNpcId()
     if npcId in range(27185,27189) :
        for x in xrange(20):
            newNpc = self.addSpawn(27189,npc)
            killer = player
            if isPet :
                killer = player.getPet()
            newNpc.setRunning()
            newNpc.addDamageHate(killer,0,999)
            newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, killer)
            self.startQuestTimer("despawn",300000, newNpc, None)
            if Rnd.get(2) :
               skill = SkillTable.getInstance().getInfo(4243,1)
               if skill != None :
                  skill.getEffects(newNpc, killer)
     return 
Exemplo n.º 13
0
 def onKill(self, npc, player, isPet):
     npcId = npc.getNpcId()
     if npcId in range(27185, 27189):
         for x in xrange(20):
             newNpc = self.addSpawn(27189, npc)
             killer = player
             if isPet:
                 killer = player.getPet()
             newNpc.setRunning()
             newNpc.addDamageHate(killer, 0, 999)
             newNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK,
                                         killer)
             self.startQuestTimer("despawn", 300000, newNpc, None)
             if Rnd.get(2):
                 skill = SkillTable.getInstance().getInfo(4243, 1)
                 if skill != None:
                     skill.getEffects(newNpc, killer)
     return
Exemplo n.º 14
0
 def onAdvEvent (self,event,npc, player) :
     htmltext = event
     st = player.getQuestState(qn)
     if not st : return
     if event == "32557-06.htm" :
         st.set("cond","1")
         st.setState(State.STARTED)
         st.playSound("ItemSound.quest_accept")
     elif event == "32557-09.htm" :
         st.set("transform","1")
         SkillTable.getInstance().getInfo(5982,1).getEffects(player,player)
     elif event == "32557-10.htm" :
         st.set("transform","2")
         SkillTable.getInstance().getInfo(5983,1).getEffects(player,player)
     elif event == "32557-13.htm" :
         if st.getInt("transform") == 1 :
             SkillTable.getInstance().getInfo(5982,1).getEffects(player,player)
         elif st.getInt("transform") == 2 :
             SkillTable.getInstance().getInfo(5983,1).getEffects(player,player)
     return htmltext
Exemplo n.º 15
0
 def onAcquireSkillList (self, npc, player) :
   asl = AcquireSkillList(AcquireSkillList.SkillType.unk4)
   st = player.getQuestState(qn)
   oldSkills = player.getAllSkills()
   count = 0
   for i in SKILLITEMS:
     for j in SUBSKILLS[i]:
       minLevel = 0
       maxLevel = SkillTable.getInstance().getMaxLevel(j)
       for oldsk in oldSkills:
         if oldsk.getId() == j:
           minLevel = oldsk.getLevel()
       if minLevel < maxLevel:
         count+=1
         asl.addSkill(j, minLevel+1, maxLevel, 0, 0)
   player.sendPacket(asl)
   if count == 0:
     player.sendPacket(SystemMessage(SystemMessageId.NO_MORE_SKILLS_TO_LEARN))
   return ""
Exemplo n.º 16
0
 def onEvent (self,event,st) :
    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)
          st.getPlayer().setTarget(st.getPlayer())
          st.getPlayer().doCast(SkillTable.getInstance().getInfo(skillId,level))
          htmltext = "31556-1.htm"
        else :
          htmltext = "You don't have required items"
    return htmltext
Exemplo n.º 17
0
 def onAdvEvent(self, event, npc, player):
     htmltext = event
     st = player.getQuestState(qn)
     if not st: return
     if event == "32557-06.htm":
         st.set("cond", "1")
         st.setState(State.STARTED)
         st.playSound("ItemSound.quest_accept")
     elif event == "32557-09.htm":
         st.set("transform", "1")
         SkillTable.getInstance().getInfo(5982,
                                          1).getEffects(player, player)
     elif event == "32557-10.htm":
         st.set("transform", "2")
         SkillTable.getInstance().getInfo(5983,
                                          1).getEffects(player, player)
     elif event == "32557-13.htm":
         if st.getInt("transform") == 1:
             SkillTable.getInstance().getInfo(5982,
                                              1).getEffects(player, player)
         elif st.getInt("transform") == 2:
             SkillTable.getInstance().getInfo(5983,
                                              1).getEffects(player, player)
     return htmltext
Exemplo n.º 18
0
 def onEvent(self, event, st):
     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)
             st.getPlayer().setTarget(st.getPlayer())
             st.getPlayer().doCast(SkillTable.getInstance().getInfo(
                 skillId, level))
             htmltext = "31556-1.htm"
         else:
             htmltext = "You don't have required items"
     return htmltext
Exemplo n.º 19
0
 def onAdvEvent (self,event,npc,player) :
   if event == "chest_timer" :
     self.athrea = 0
     return
   if player.isClanLeader() : leaderst = st = player.getQuestState(qn)
   else :
       # non-leaders doing this quest need both their own quest state and the leader's
       st = player.getQuestState(qn)
       if not st: return
       leaderst = leader(player)

   if not leaderst :
       if DEBUG :
           debug = "Event can't find leader"
           print debug
           return debug
       return
   debug = ""
   htmltext = event
   if player.isClanLeader() :
       if event == "30756-07.htm" :
           st.playSound("ItemSound.quest_accept")
           st.set("cond","1")
           st.setState(State.STARTED)
           st.set("part","1")
       elif event == "30759-03.htm" :
           st.set("part","2")
           st.set("cond","2")
           st.set("dead_list"," ")
       elif event == "30759-07.htm" :
           st.takeItems(SYMBOL_OF_LOYALTY,1) #Item is not stackable, thus need to do this for each item
           st.takeItems(SYMBOL_OF_LOYALTY,1)
           st.takeItems(SYMBOL_OF_LOYALTY,1)
           st.giveItems(ANTIDOTE_RECIPE,1)
           st.set("part","3")
           st.set("cond","3")
           st.startQuestTimer("poison_timer",3600000)
           st.addNotifyOfDeath(player)
           skill = SkillTable.getInstance().getInfo(4082,1)
           npc.setTarget(player)
           npc.broadcastPacket(MagicSkillUse(npc,player,skill.getDisplayId(),1,skill.getHitTime(),0))
           npc.callSkill(skill, [player])
       elif event == "poison_timer" :
           st.exitQuest(1)
           if DEBUG :
               debug = "Times Up! Quest failed!"
               print debug
               return debug
           return
   elif event == "30757-05.htm" :
       if player.isClanLeader() : return "Only Clan Members can sacrifice themselves!"
       if st.getRandom(10) > 5 :
           htmltext = "30757-06.htm"
           st.giveItems(SYMBOL_OF_LOYALTY,1)
           deadlist = leaderst.get("dead_list").split()
           deadlist.append(player.getName())
           leaderst.set("dead_list"," ".join(deadlist))
       else :
           skill = SkillTable.getInstance().getInfo(4083,1)
           npc.setTarget(player)
           npc.broadcastPacket(MagicSkillUse(npc,player,skill.getDisplayId(),1,skill.getHitTime(),0))
           npc.callSkill(skill, [player])
           self.startQuestTimer(player.getName(),4000,npc,player,0)
   elif event == player.getName() :
       if player.isDead() :
           st.giveItems(SYMBOL_OF_LOYALTY,1)
           deadlist = leaderst.get("dead_list").split()
           deadlist.append(player.getName())
           leaderst.set("dead_list"," ".join(deadlist))
       elif DEBUG :
           debug = "player " + player.getName() + " didn't die!"
           print debug
           return debug
       return
   elif event == "30758-03.htm" :
       if not self.athrea :
           self.athrea = 1
           self.chests = 0
           leaderst.set("part","4")
           leaderst.set("chest_wins","0")
           for x,y,z in CHEST_LOCS :
               rand = st.getRandom(5)
               self.addSpawn(27173+rand,x,y,z,0,0,300000)
               self.startQuestTimer("chest_timer",300000,npc,player,0)
       else :
           htmltext = "30758-04.htm"
   elif event == "30758-07.htm" :
       if st.getQuestItemsCount(57) >= 10000 and not self.athrea :
           htmltext = "30758-08.htm"
           st.takeItems(57,10000)
   if DEBUG and debug :
       print debug
       return debug
   return htmltext
Exemplo n.º 20
0
    def onAdvEvent(self, event, npc, player):
        leaderst = 0
        st = 0
        if player.isClanLeader(): leaderst = player.getQuestState(qn)
        else:
            # non-leaders doing this quest need both their own quest state and the leader's
            st = player.getQuestState(qn)
            if not st: return
            leaderst = leader(player)
            if not leaderst: return

        htmltext = event
        #####  Leaders area  ######
        if event == "30756-03.htm":
            leaderst.setState(PART2)
            leaderst.set("cond", "1")
            leaderst.playSound("ItemSound.quest_accept")
        elif event == "30759-03.htm":
            leaderst.setState(PART3)
            leaderst.set("cond", "2")
            leaderst.set("dead_list", " ")
        elif event == "30759-07.htm":
            for i in range(3):
                leaderst.takeItems(SYMBOL_OF_LOYALTY, 1)
            leaderst.giveItems(ANTIDOTE_RECIPE, 1)
            leaderst.setState(PART4)
            leaderst.set("cond", "3")
            leaderst.set("ingredients", "0 0 0")
            leaderst.set("chest_count", "0")
            leaderst.set("chest_game", "0")
            leaderst.set("chest_try", "0")
            leaderst.startQuestTimer("poison_timer", 3600000)
            skill = SkillTable.getInstance().getInfo(4082, 1)
            npc.setTarget(player)
            npc.broadcastPacket(
                MagicSkillUser(npc, player, skill.getDisplayId(), 1,
                               skill.getSkillTime(), 0))
            npc.callSkill(skill, [player])
            leaderst.addNotifyOfDeath(player)
        elif event == "poison_timer":
            members_finnish(leaderst)
            leaderst.exitQuest(1)
            htmltext = "30759-09.htm"
        elif event == "chest_timer":
            htmltext = ""
            self.chest_game(leaderst, "stop")
            if DEBUG: htmltext = "DEBUG MESSAGE: chest timer event sent."


#####  Members area  ######
        elif event == "30757-04.htm":
            deadlist = leaderst.get("dead_list").split()
            deadlist.append(player.getName())
            leaderst.set("dead_list", " ".join(deadlist))
            player.reduceCurrentHp(player.getCurrentHp(), player)
            st.giveItems(SYMBOL_OF_LOYALTY, 1)
            st.playSound("ItemSound.quest_accept")
        elif event == "30757-05.htm":
            st.exitQuest(1)
        elif event == "30758-03.htm":
            self.chest_game(leaderst, "start")
        elif event == "30758-07.htm":
            if st.getQuestItemsCount(RETRY_ITEMS) < RETRY_PRICE:
                htmltext = "30758-06.htm"
            else:
                st.takeItems(RETRY_ITEMS, RETRY_PRICE)
        return htmltext
Exemplo n.º 21
0
 def onTalk (self,npc,player):
   htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
   st = player.getQuestState(qn)
   if not st: return htmltext
   id = st.getState()
   cond = st.getInt("cond")
   npcId = npc.getNpcId()

   if id == State.CREATED and npcId == CRONOS :
      if player.getLevel() < 45 and (st.getQuestItemsCount(3500) or st.getQuestItemsCount(3501) or st.getQuestItemsCount(3502)) :
         st.exitQuest(1)
         htmltext = "30610-01.htm"
      elif player.getLevel() >= 45 and ((st.getQuestItemsCount(3500) + st.getQuestItemsCount(3501) + st.getQuestItemsCount(3502)) >= 2) :
         st.exitQuest(1)
         htmltext = "30610-02.htm"
      elif player.getLevel() >= 45 and ((st.getQuestItemsCount(3500) + st.getQuestItemsCount(3501) + st.getQuestItemsCount(3502)) == 1) :
         if st.getQuestItemsCount(3500) == 1 :
            item = player.getInventory().getItemByItemId(3500)
            if item.getEnchantLevel() < 55 :
               htmltext = "30610-03.htm"
            else :
               htmltext = "30610-04.htm"
         elif st.getQuestItemsCount(3501) == 1 :
            item = player.getInventory().getItemByItemId(3501)
            if item.getEnchantLevel() < 55 :
               htmltext = "30610-03.htm"
            else :
               htmltext = "30610-04.htm"
         elif st.getQuestItemsCount(3502) == 1 :
            item = player.getInventory().getItemByItemId(3502)
            if item.getEnchantLevel() < 55 :
               htmltext = "30610-03.htm"
            else :
               htmltext = "30610-04.htm"
   elif id == State.STARTED :
      if npcId == CRONOS :
         htmltext = "30610-07.htm"
      if npcId == MIMYU :
         if st.getInt("id") == 1 :
            st.set("id","2")
            htmltext = "30747-01.htm"
         elif st.getInt("id") == 2 :
            summon = player.getPet()
            if summon :
               if summon.getControlItem().getObjectId() == st.getInt("summonOid"):
                  htmltext = "30747-04.htm"
               else :
                  htmltext = "30747-03.htm"
            else :
               htmltext = "30747-02.htm"
         elif st.getInt("id") == 0 :
            htmltext = "30747-07.htm"
         elif st.getInt("id") > 0 and st.getInt("id") < 15 and st.getQuestItemsCount(FT_LEAF) >= 1 :
            htmltext = "30747-11.htm"
         elif st.getInt("id") == 15 and st.getQuestItemsCount(FT_LEAF) == 0 :
            summon = player.getPet()
            if summon :
               if summon.getControlItem().getObjectId() == st.getInt("summonOid"):
                  st.set("id","16")
                  htmltext = "30747-13.htm"
               else :
                  htmltext = "30747-14.htm"
            else :
               htmltext = "30747-12.htm"
         elif st.getInt("id") == 16:
            summon = player.getPet()
            if summon :
               htmltext = "30747-15.htm"
            elif (st.getQuestItemsCount(3500) + st.getQuestItemsCount(3501) + st.getQuestItemsCount(3502)) == 1 :
               if st.getQuestItemsCount(3500) == 1 :
                  item = player.getInventory().getItemByItemId(3500)
                  if item.getObjectId() == st.getInt("summonOid"):
                     #EvolvePet(player,item,4422)
                     st.takeItems(3500,1)
                     st.giveItems(4422,1)
                     htmltext = "30747-16.htm"
                     st.exitQuest(1)
                     st.playSound("ItemSound.quest_finish")
                  else :
                     npc.setTarget(player)
                     skill = SkillTable.getInstance().getInfo(4167,1)
                     if skill != None:
                        skill.getEffects(npc, player)
                     htmltext = "30747-18.htm"
               elif st.getQuestItemsCount(3501) == 1 :
                  item = player.getInventory().getItemByItemId(3501)
                  if item.getObjectId() == st.getInt("summonOid"):
                     #EvolvePet(player,item,4423)
                     st.takeItems(3501,1)
                     st.giveItems(4423,1)
                     htmltext = "30747-16.htm"
                     st.exitQuest(1)
                     st.playSound("ItemSound.quest_finish")
                  else :
                     npc.setTarget(player)
                     skill = SkillTable.getInstance().getInfo(4167,1)
                     if skill != None:
                        skill.getEffects(npc, player)
                     htmltext = "30747-18.htm"
               elif st.getQuestItemsCount(3502) == 1 :
                  item = player.getInventory().getItemByItemId(3502)
                  if item.getObjectId() == st.getInt("summonOid"):
                     #EvolvePet(player,item,4424)
                     st.takeItems(3502,1)
                     st.giveItems(4424,1)
                     htmltext = "30747-16.htm"
                     st.exitQuest(1)
                     st.playSound("ItemSound.quest_finish")
                  else :
                     npc.setTarget(player)
                     skill = SkillTable.getInstance().getInfo(4167,1)
                     if skill != None:
                        skill.getEffects(npc, player)
                     htmltext = "30747-18.htm"
               else :
                  htmltext = "30747-18.htm"
            elif (st.getQuestItemsCount(3500) + st.getQuestItemsCount(3501) + st.getQuestItemsCount(3502)) >= 2 :
               htmltext = "30747-17.htm"
   return htmltext
Exemplo n.º 22
0
 def onAdvEvent (self, event, npc, player) :
   htmltext = event
   st = player.getQuestState(qn)
   if event == "learn":
     htmltext = ""
     st2 = player.getQuestState("136_MoreThanMeetsTheEye")
     if player.isSubClassActive():
       htmltext = "8005-04.htm"
     elif not st2 or st2.getState() != State.COMPLETED :
       htmltext = "8005-03.htm"
     else:
       j=0
       for i in SKILLITEMS:
         j+=st.getQuestItemsCount(i)
       if j > 0:
         self.onAcquireSkillList(npc,player)
       else:
         htmltext = "8005-04.htm"
   elif event == "cancel":
     if st.getQuestItemsCount(57) < 10000000:
       htmltext = "8005-07.htm"
     elif player.getSubClasses().size() == 0:
       htmltext = "8005-03.htm"
     elif player.isSubClassActive():
       htmltext = "8005-04.htm"
     else:
       activeCertifications = 0
       for var in QUESTVARSITEMS:
         for i in range(Config.MAX_SUBCLASS):
           qvar = st.getGlobalQuestVar(var+str(i+1))
           if qvar.endswith(";") :
             activeCertifications += 1
           elif qvar != "" and qvar != "0" :
             activeCertifications += 1
       if activeCertifications == 0:
         htmltext = "8005-08.htm"
       else:
         for var in QUESTVARSITEMS:
           for i in range(Config.MAX_SUBCLASS):
             qvar = st.getGlobalQuestVar(var+str(i+1))
             if qvar.endswith(";"):
               skill = SkillTable.getInstance().getInfo(int(qvar.replace(";","")), 1)
               if skill:
                 qvar = st.getGlobalQuestVar(var+str(i+1))
                 skillId = int(qvar.replace(";",""))
                 skillLevel = player.getSkillLevel(skillId)
                 player.removeSkill(skill,skillLevel)
                 st.saveGlobalQuestVar(var+str(i+1), "0")
             elif qvar != "" and qvar != "0" :
               Item = player.getInventory().getItemByObjectId(int(qvar))
               if Item :
                 player.destroyItem(qn, int(qvar), 1, player, 0)
               else :
                 Item = player.getWarehouse().getItemByObjectId(int(qvar))
                 if Item :
                   print "Somehow " + player.getName() + " put certification book into warehouse!"
                   player.getWarehouse().destroyItem(qn, Item, 1, player, None)
                 else:
                   print "Somehow " + player.getName() + " his/her delete certification book!"
               st.saveGlobalQuestVar(var+str(i+1), "0")
         st.takeItems(57,10000000)
         htmltext = "8005-09.htm"
         player.sendSkillList()
   return htmltext