Esempio n. 1
0
 def onAdvEvent (self,event,npc,player):
   if event == "prosnuca" :
     valik = self.addSpawn(VALAKAS,213004,-114890,-1635,30000,False,0)
     player.broadcastPacket(SocialAction(valik.getObjectId(),1))
     player.broadcastPacket(Earthquake(valik.getX(), valik.getY(), valik.getZ(),40,5))
     self.startQuestTimer("camera",2000, valik, player)
     self.startQuestTimer("camerg",22000, valik, player)
     DoorTable.getInstance().getDoor(24210004).closeMe()
     DoorTable.getInstance().getDoor(24210005).closeMe()
     DoorTable.getInstance().getDoor(24210006).closeMe()
     self.saveGlobalQuestVar("underattack", "1")
     self.startQuestTimer("vkrovatku",1800000,valik,None)
   elif event == "camera" :
     player.broadcastPacket(SpecialCamera(npc.getObjectId(),-1700,190,1,0,20000))
     self.startQuestTimer("camerb",2000, npc, player)
   elif event == "camerb" :
     player.broadcastPacket(SpecialCamera(npc.getObjectId(),-3500,22,-100,111,15000))
     self.startQuestTimer("camerc",4000, npc, player)
   elif event == "camerc" :
     player.broadcastPacket(SpecialCamera(npc.getObjectId(),-2700,190,15,1,20000))
     self.startQuestTimer("camerd",3000, npc, player)
   elif event == "camerd" :
     player.broadcastPacket(SpecialCamera(npc.getObjectId(),-1700,190,14,0,20000))
     self.startQuestTimer("camere",3000, npc, player)
   elif event == "camere" :
     player.broadcastPacket(SpecialCamera(npc.getObjectId(),-1700,190,15,0,20000))
     self.startQuestTimer("camerf",3000, npc, player)
   elif event == "camerf" :
     player.broadcastPacket(SpecialCamera(npc.getObjectId(),-1700,190,1,0,20000))
   elif event == "camerg" :
     player.broadcastPacket(SpecialCamera(npc.getObjectId(),-1700,190,1,0,25000))
     self.startQuestTimer("camerh",4000, npc, player)
   elif event == "camerh" :
     player.broadcastPacket(SpecialCamera(npc.getObjectId(),-1700,190,1,11,5000))
     npc.setTarget(npc)
     npc.doCast(SkillTable.getInstance().getInfo(4691,1))
   if event == "vkrovatku" :
     underatak = self.loadGlobalQuestVar("underattack")
     if underatak == "" :
       npc.deleteMe()
       self.deleteGlobalQuestVar("access")
       self.deleteGlobalQuestVar("underattack")
       self.cancelQuestTimer("vkrovatku",npc,None)
     else :
       self.deleteGlobalQuestVar("underattack")
       self.startQuestTimer("lastchek",60000, npc, player)
   if event == "lastchek" :
     underatak = self.loadGlobalQuestVar("underattack")
     if underatak == "" :
       npc.deleteMe()
       self.deleteGlobalQuestVar("access")
       self.deleteGlobalQuestVar("underattack")
       self.cancelQuestTimer("lastchek",npc,None)
     else :
       self.deleteGlobalQuestVar("underattack")
       self.startQuestTimer("vkrovatku",1800000,npc,None)
   elif event == "resp" :
     self.deleteGlobalQuestVar("ubit")
     self.cancelQuestTimer("resp",npc,None) 
   return
Esempio n. 2
0
 def onAdvEvent(self, event, npc, player):
     st = player.getQuestState(qn)
     if not st:
         return
     htmltext = event
     cond = st.getInt("cond")
     if htmltext == "31554-03a.htm":  # Giving 100 Splinter Stakato Chitins. Getting Recruit mark
         if st.getQuestItemsCount(CHITIN) >= count and cond == 1:
             st.set("cond", "2")
             st.takeItems(CHITIN, -1)
             st.giveItems(RECRUIT, 1)
             htmltext = "31554-04.htm"
     elif event == "31554-07.htm":  # Cancelling the quest
         st.exitQuest(1)
         st.playSound("ItemSound.quest_giveup")
     elif event in BUFF.keys() and cond == 3:  # Asking for buff
         skillId, level, coins = BUFF[event]
         if st.getQuestItemsCount(GOLDEN_RAM_COIN) >= coins:
             st.takeItems(GOLDEN_RAM_COIN, coins)
             npc.setTarget(player)
             npc.doCast(SkillTable.getInstance().getInfo(skillId, level))
             htmltext = "31556-1.htm"
         else:
             htmltext = "You don't have required items"
     return htmltext
Esempio n. 3
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
Esempio n. 4
0
 def onAttack (self,npc,player,damage,isPet):
   st = player.getQuestState(qn)
   if not st : return 
   if st.getState() != 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
Esempio n. 5
0
 def onKill(self, npc, player, isPet):
     st = player.getQuestState(qn)
     npcId = npc.getNpcId()
     if npcId == FR_GARDENER:
         self.startQuestTimer("buff", 1, npc, player)
     if npcId == FR_SERVANT:
         st.getPlayer().setTarget(self.IQ)
         st.getPlayer().useMagic(SkillTable.getInstance().getInfo(4480, 1), True, True)
     if npcId == FR_DOG:
         st.getPlayer().setTarget(self.IQ)
         st.getPlayer().useMagic(SkillTable.getInstance().getInfo(4481, 1), True, True)
     if npcId == ICE_CAPTAIN:
         st.getPlayer().setTarget(self.IQ)
         st.getPlayer().useMagic(SkillTable.getInstance().getInfo(4482, 1), True, True)
     if npcId == ICE_QUEEEN:
         self.cancelQuestTimer("vkrovatku", npc, None)
     return
Esempio n. 6
0
 def onAttack (self,npc,player,damage,isPet):
    npcId = npc.getNpcId()
    if npcId in HSMOBS:
      if (Rnd.get(2) == 1):
        if player.getFirstEffect(int(4554)):
          malaria = player.getFirstEffect(int(4554)).getLevel()
          if (Rnd.get(100) < 15):
            if malaria < 10:
              newmalaria = int(malaria + 1)
              npc.setTarget(player)
              npc.doCast(SkillTable.getInstance().getInfo(4554,newmalaria))
        else:
          npc.setTarget(player)
          npc.doCast(SkillTable.getInstance().getInfo(4554,1))
      elif npcId == 21317 or npcId == 21322 :
        if player.getFirstEffect(int(4553)):
          flu = player.getFirstEffect(int(4553)).getLevel()
          if (Rnd.get(100) < 15):
            if flu < 10:
              newflu = int(flu + 1)
              npc.setTarget(player)
              npc.doCast(SkillTable.getInstance().getInfo(4553,newflu))
        else:
          npc.setTarget(player)
          npc.doCast(SkillTable.getInstance().getInfo(4553,1))
      elif npcId == 21319 or npcId == 21316 :
        if player.getFirstEffect(int(4552)):
          holera = player.getFirstEffect(int(4552)).getLevel()
          if (Rnd.get(100) < 30):
            if holera < 10:
              newholera = int(holera + 1)
              npc.setTarget(player)
              npc.doCast(SkillTable.getInstance().getInfo(4552,newholera))
        else:
          npc.setTarget(player)
          npc.doCast(SkillTable.getInstance().getInfo(4552,1))
      else:
        if player.getFirstEffect(int(4551)):
          rheumatism = player.getFirstEffect(int(4551)).getLevel()
          if (Rnd.get(100) < 30):
            if rheumatism < 10:
              newrheumatism = int(rheumatism + 1)
              npc.setTarget(player)
              npc.doCast(SkillTable.getInstance().getInfo(4551,newrheumatism))
        else:
          npc.setTarget(player)
          npc.doCast(SkillTable.getInstance().getInfo(4551,1))
    return 
Esempio n. 7
0
 def onAdvEvent(self, event, npc, player):
     if event == "prosnuca":
         self.IQ = self.addSpawn(ICE_QUEEEN, 102727, -125655, -2846, 0, False, 0)
         self.startQuestTimer("vkrovatku", 1800000, self.IQ, None)
         self.cancelQuestTimer("prosnuca", npc, None)
     elif event == "captain":
         npc = self.addSpawn(ICE_CAPTAIN, 105804, -127721, -2769, 0, False, 0)
         self.startQuestTimer("sleepcap", 1800000, npc, None)
         self.cancelQuestTimer("prosnuca", npc, None)
     elif event == "resist":
         npc = self.addSpawn(FR_GARDENER, 111375, -126645, -2991, 0, False, 0)
         self.startQuestTimer("sleepres", 1800000, npc, None)
         self.cancelQuestTimer("resist", npc, None)
     elif event == "mdef":
         npc = self.addSpawn(FR_SERVANT, 108885, -129124, -3218, 0, False, 0)
         self.startQuestTimer("sleepmdef", 1800000, npc, None)
         self.cancelQuestTimer("mdef", npc, None)
     elif event == "pdef":
         npc = self.addSpawn(FR_DOG, 109784, -125793, -3142, 0, False, 0)
         self.startQuestTimer("sleeppdef", 1800000, npc, None)
         self.cancelQuestTimer("pdef", npc, None)
     elif event == "vkrovatku":
         npc.deleteMe()
         self.cancelQuestTimer("vkrovatku", npc, None)
     elif event == "sleepcap":
         npc.deleteMe()
         self.cancelQuestTimer("sleepcap", npc, None)
     elif event == "sleepres":
         npc.deleteMe()
         self.cancelQuestTimer("sleepres", npc, None)
     elif event == "sleepmdef":
         npc.deleteMe()
         self.cancelQuestTimer("sleepmdef", npc, None)
     elif event == "sleeppdef":
         npc.deleteMe()
         self.cancelQuestTimer("sleeppdef", npc, None)
     elif event == "open":
         self.deleteGlobalQuestVar("closed")
         self.deleteGlobalQuestVar("first")
         self.cancelQuestTimer("open", npc, None)
     elif event == "buff":
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4479, 1))
         return
     elif event == "teleout":
         if player:
             player.teleToLocation(115525, -125724, -3439)
             return "<html><body><font color=LEVEL>Time out...</font></body></html>"
         self.cancelQuestTimer("teleout", None, player)
     return
Esempio n. 8
0
 def onAttack (self,npc,player,damage,isPet):
   player.setTarget(player)
   player.doCast(SkillTable.getInstance().getInfo(5088,1))
   return
Esempio n. 9
0
	def onTalk (self, npc, player) :
		htmltext = "<html><body>You are either not carrying out your quest or don't meet the criteria.</body></html>"
		st = player.getQuestState(qn)
		if not st : return htmltext

		cond = st.getInt("cond")
		npcId = npc.getNpcId()

		if npcId == MUSHIKA :
			first = player.getQuestState("124_MeetingTheElroki")
			if st.getState() == COMPLETED :
				htmltext = "<html><body>This quest has already been completed.</body></html>"
			elif first and first.getState().getName() == 'Completed' and st.getState() == CREATED and player.getLevel() >= 76 :
				htmltext = "32114-01.htm"
			elif cond == 0 :
				htmltext = "32114-00.htm"
			elif cond == 1 :
				htmltext = "32114-07.htm"
			elif cond == 2 :
				htmltext = "32114-10.htm"
			elif cond >= 3 and cond < 8:
				htmltext = "32114-11.htm"
			elif cond == 8 :
				st.addExpAndSp(859195,86603)
				st.unset("cond")
				st.unset("pilar1")
				st.unset("pilar2")
				st.unset("pilar3")
				st.setState(COMPLETED)
				st.exitQuest(False)
				st.playSound("ItemSound.quest_finish")
				htmltext = "32114-12.htm"
		elif npcId == KARAKAWEI :
			if cond == 2 :
				htmltext = "32117-01.htm"
			elif cond == 3 :
				htmltext = "32117-09.htm"
			elif cond == 4 :
				st.takeItems(ORNITHOMIMUS_CLAW,-1)
				st.takeItems(DEINONYCHUS_BONE,-1)
				st.playSound("ItemSound.quest_middle")
				htmltext = "32117-10.htm"
			elif cond == 5 :
				htmltext = "32117-15.htm"
			elif cond == 6 or cond == 7 :
				htmltext = "32117-16.htm"
			elif cond == 8 :
				htmltext = "32117-17.htm"
		elif npcId == ULU_KAIMU :
			if cond == 5 :
				npc.doCast(SkillTable.getInstance().getInfo(5089,1))
				htmltext = "32119-01.htm"
			elif cond == 6 :
				htmltext = "32119-14.htm"
		elif npcId == BALU_KAIMU :
			if cond == 6 :
				npc.doCast(SkillTable.getInstance().getInfo(5089,1))
				htmltext = "32120-01.htm"
			elif cond == 7 :
				htmltext = "32120-16.htm"
		elif npcId == CHUTA_KAIMU :
			if cond == 7 :
				npc.doCast(SkillTable.getInstance().getInfo(5089,1))
				htmltext = "32121-01.htm"
			elif cond == 8 :
				htmltext = "32121-17.htm"
		return htmltext
Esempio n. 10
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
Esempio n. 11
0
 def onAdvEvent(self, event, npc, player):
     if event == "prosnuca":
         valik = self.addSpawn(VALAKAS, 213004, -114890, -1635, 30000,
                               False, 0)
         player.broadcastPacket(SocialAction(valik.getObjectId(), 1))
         player.broadcastPacket(
             Earthquake(valik.getX(), valik.getY(), valik.getZ(), 40, 5))
         self.startQuestTimer("camera", 2000, valik, player)
         self.startQuestTimer("camerg", 22000, valik, player)
         DoorTable.getInstance().getDoor(24210004).closeMe()
         DoorTable.getInstance().getDoor(24210005).closeMe()
         DoorTable.getInstance().getDoor(24210006).closeMe()
         self.saveGlobalQuestVar("underattack", "1")
         self.startQuestTimer("vkrovatku", 1800000, valik, None)
     elif event == "camera":
         player.broadcastPacket(
             SpecialCamera(npc.getObjectId(), -1700, 190, 1, 0, 20000))
         self.startQuestTimer("camerb", 2000, npc, player)
     elif event == "camerb":
         player.broadcastPacket(
             SpecialCamera(npc.getObjectId(), -3500, 22, -100, 111, 15000))
         self.startQuestTimer("camerc", 4000, npc, player)
     elif event == "camerc":
         player.broadcastPacket(
             SpecialCamera(npc.getObjectId(), -2700, 190, 15, 1, 20000))
         self.startQuestTimer("camerd", 3000, npc, player)
     elif event == "camerd":
         player.broadcastPacket(
             SpecialCamera(npc.getObjectId(), -1700, 190, 14, 0, 20000))
         self.startQuestTimer("camere", 3000, npc, player)
     elif event == "camere":
         player.broadcastPacket(
             SpecialCamera(npc.getObjectId(), -1700, 190, 15, 0, 20000))
         self.startQuestTimer("camerf", 3000, npc, player)
     elif event == "camerf":
         player.broadcastPacket(
             SpecialCamera(npc.getObjectId(), -1700, 190, 1, 0, 20000))
     elif event == "camerg":
         player.broadcastPacket(
             SpecialCamera(npc.getObjectId(), -1700, 190, 1, 0, 25000))
         self.startQuestTimer("camerh", 4000, npc, player)
     elif event == "camerh":
         player.broadcastPacket(
             SpecialCamera(npc.getObjectId(), -1700, 190, 1, 11, 5000))
         npc.setTarget(npc)
         npc.doCast(SkillTable.getInstance().getInfo(4691, 1))
     if event == "vkrovatku":
         underatak = self.loadGlobalQuestVar("underattack")
         if underatak == "":
             npc.deleteMe()
             self.deleteGlobalQuestVar("access")
             self.deleteGlobalQuestVar("underattack")
             self.cancelQuestTimer("vkrovatku", npc, None)
         else:
             self.deleteGlobalQuestVar("underattack")
             self.startQuestTimer("lastchek", 60000, npc, player)
     if event == "lastchek":
         underatak = self.loadGlobalQuestVar("underattack")
         if underatak == "":
             npc.deleteMe()
             self.deleteGlobalQuestVar("access")
             self.deleteGlobalQuestVar("underattack")
             self.cancelQuestTimer("lastchek", npc, None)
         else:
             self.deleteGlobalQuestVar("underattack")
             self.startQuestTimer("vkrovatku", 1800000, npc, None)
     elif event == "resp":
         self.deleteGlobalQuestVar("ubit")
         self.cancelQuestTimer("resp", npc, None)
     return
Esempio n. 12
0
 def onAttack(self, npc, player, damage, isPet):
     self.saveGlobalQuestVar("underattack", "1")
     maxHp = npc.getMaxHp()
     nowHp = npc.getCurrentHp()
     if nowHp < maxHp * 0.25:
         if (Rnd.get(100) < 50):
             if (Rnd.get(100) < 20):
                 npc.setTarget(npc)
                 npc.doCast(SkillTable.getInstance().getInfo(4690, 1))
             elif (Rnd.get(100) < 15):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4680, 1))
             elif (Rnd.get(100) < 25):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4685, 1))
             elif (Rnd.get(100) < 10):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4688, 1))
             elif (Rnd.get(100) < 35):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4683, 1))
             else:
                 if (Rnd.get(100) < 50):
                     npc.setTarget(player)
                     npc.doCast(SkillTable.getInstance().getInfo(4681, 1))
                 else:
                     npc.setTarget(player)
                     npc.doCast(SkillTable.getInstance().getInfo(4682, 1))
         elif (Rnd.get(100) < 20):
             npc.setTarget(player)
             npc.doCast(SkillTable.getInstance().getInfo(4690, 1))
         elif (Rnd.get(100) < 15):
             npc.setTarget(player)
             npc.doCast(SkillTable.getInstance().getInfo(4689, 1))
         else:
             npc.setTarget(player)
             npc.doCast(SkillTable.getInstance().getInfo(4684, 1))
     elif nowHp < maxHp * 0.5:
         if (Rnd.get(100) < 50):
             if (Rnd.get(100) < 5):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4690, 1))
             elif (Rnd.get(100) < 10):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4689, 1))
             elif (Rnd.get(100) < 15):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4685, 1))
             elif (Rnd.get(100) < 30):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4688, 1))
             elif (Rnd.get(100) < 20):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4683, 1))
             else:
                 if (Rnd.get(100) < 50):
                     npc.setTarget(player)
                     npc.doCast(SkillTable.getInstance().getInfo(4681, 1))
                 else:
                     npc.setTarget(player)
                     npc.doCast(SkillTable.getInstance().getInfo(4682, 1))
         elif (Rnd.get(100) < 5):
             npc.setTarget(player)
             npc.doCast(SkillTable.getInstance().getInfo(4690, 1))
         elif (Rnd.get(100) < 10):
             npc.setTarget(player)
             npc.doCast(SkillTable.getInstance().getInfo(4689, 1))
         else:
             npc.setTarget(player)
             npc.doCast(SkillTable.getInstance().getInfo(4684, 1))
     elif nowHp < maxHp * 0.75:
         if (Rnd.get(100) < 50):
             if (Rnd.get(100) < 0):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4690, 1))
             elif (Rnd.get(100) < 5):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4689, 1))
             elif (Rnd.get(100) < 7):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4685, 1))
             elif (Rnd.get(100) < 10):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4688, 1))
             elif (Rnd.get(100) < 15):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4683, 1))
             else:
                 if (Rnd.get(100) < 50):
                     npc.setTarget(player)
                     npc.doCast(SkillTable.getInstance().getInfo(4681, 1))
                 else:
                     npc.setTarget(player)
                     npc.doCast(SkillTable.getInstance().getInfo(4682, 1))
         elif (Rnd.get(100) < 0):
             npc.setTarget(player)
             npc.doCast(SkillTable.getInstance().getInfo(4690, 1))
         elif (Rnd.get(100) < 5):
             npc.setTarget(player)
             npc.doCast(SkillTable.getInstance().getInfo(4689, 1))
         else:
             npc.setTarget(player)
             npc.doCast(SkillTable.getInstance().getInfo(4684, 1))
     else:
         if (Rnd.get(100) < 50):
             if (Rnd.get(100) < 0):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4690, 1))
             elif (Rnd.get(100) < 5):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4689, 1))
             elif (Rnd.get(100) < 7):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4685, 1))
             elif (Rnd.get(100) < 10):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4688, 1))
             elif (Rnd.get(100) < 15):
                 npc.setTarget(player)
                 npc.doCast(SkillTable.getInstance().getInfo(4683, 1))
             else:
                 if (Rnd.get(100) < 50):
                     npc.setTarget(player)
                     npc.doCast(SkillTable.getInstance().getInfo(4681, 1))
                 else:
                     npc.setTarget(player)
                     npc.doCast(SkillTable.getInstance().getInfo(4682, 1))
         elif (Rnd.get(100) < 0):
             npc.setTarget(player)
             npc.doCast(SkillTable.getInstance().getInfo(4690, 1))
         elif (Rnd.get(100) < 10):
             npc.setTarget(player)
             npc.doCast(SkillTable.getInstance().getInfo(4689, 1))
         else:
             npc.setTarget(player)
             npc.doCast(SkillTable.getInstance().getInfo(4684, 1))
     return
Esempio n. 13
0
    def onTalk(self, npc, player):
        htmltext = "<html><body>You are either not carrying out your quest or don't meet the criteria.</body></html>"
        st = player.getQuestState(qn)
        if not st: return htmltext

        cond = st.getInt("cond")
        npcId = npc.getNpcId()

        if npcId == MUSHIKA:
            first = player.getQuestState("124_MeetingTheElroki")
            if st.getState() == COMPLETED:
                htmltext = "<html><body>This quest has already been completed.</body></html>"
            elif first and first.getState().getName(
            ) == 'Completed' and st.getState(
            ) == CREATED and player.getLevel() >= 76:
                htmltext = "32114-01.htm"
            elif cond == 0:
                htmltext = "32114-00.htm"
            elif cond == 1:
                htmltext = "32114-07.htm"
            elif cond == 2:
                htmltext = "32114-10.htm"
            elif cond >= 3 and cond < 8:
                htmltext = "32114-11.htm"
            elif cond == 8:
                st.addExpAndSp(859195, 86603)
                st.unset("cond")
                st.unset("pilar1")
                st.unset("pilar2")
                st.unset("pilar3")
                st.setState(COMPLETED)
                st.exitQuest(False)
                st.playSound("ItemSound.quest_finish")
                htmltext = "32114-12.htm"
        elif npcId == KARAKAWEI:
            if cond == 2:
                htmltext = "32117-01.htm"
            elif cond == 3:
                htmltext = "32117-09.htm"
            elif cond == 4:
                st.takeItems(ORNITHOMIMUS_CLAW, -1)
                st.takeItems(DEINONYCHUS_BONE, -1)
                st.playSound("ItemSound.quest_middle")
                htmltext = "32117-10.htm"
            elif cond == 5:
                htmltext = "32117-15.htm"
            elif cond == 6 or cond == 7:
                htmltext = "32117-16.htm"
            elif cond == 8:
                htmltext = "32117-17.htm"
        elif npcId == ULU_KAIMU:
            if cond == 5:
                npc.doCast(SkillTable.getInstance().getInfo(5089, 1))
                htmltext = "32119-01.htm"
            elif cond == 6:
                htmltext = "32119-14.htm"
        elif npcId == BALU_KAIMU:
            if cond == 6:
                npc.doCast(SkillTable.getInstance().getInfo(5089, 1))
                htmltext = "32120-01.htm"
            elif cond == 7:
                htmltext = "32120-16.htm"
        elif npcId == CHUTA_KAIMU:
            if cond == 7:
                npc.doCast(SkillTable.getInstance().getInfo(5089, 1))
                htmltext = "32121-01.htm"
            elif cond == 8:
                htmltext = "32121-17.htm"
        return htmltext
Esempio n. 14
0
 def onAttack(self, npc, player, damage, isPet):
     player.setTarget(player)
     player.doCast(SkillTable.getInstance().getInfo(5088, 1))
     return
Esempio n. 15
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
Esempio n. 16
0
 def onAttack (self,npc,player,damage,isPet):
   self.saveGlobalQuestVar("underattack", "1")
   maxHp = npc.getMaxHp()
   nowHp = npc.getCurrentHp()
   if nowHp < maxHp*0.25:
     if (Rnd.get(100) < 50):
       if (Rnd.get(100) < 20):
         npc.setTarget(npc)
         npc.doCast(SkillTable.getInstance().getInfo(4690,1))
       elif (Rnd.get(100) < 15):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4680,1))
       elif (Rnd.get(100) < 25):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4685,1))
       elif (Rnd.get(100) < 10):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4688,1))
       elif (Rnd.get(100) < 35):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4683,1))
       else:
         if (Rnd.get(100) < 50):
           npc.setTarget(player)
           npc.doCast(SkillTable.getInstance().getInfo(4681,1))
         else:
           npc.setTarget(player)
           npc.doCast(SkillTable.getInstance().getInfo(4682,1))  
     elif (Rnd.get(100) < 20):
       npc.setTarget(player)
       npc.doCast(SkillTable.getInstance().getInfo(4690,1))
     elif (Rnd.get(100) < 15):
       npc.setTarget(player)
       npc.doCast(SkillTable.getInstance().getInfo(4689,1))
     else:
       npc.setTarget(player)
       npc.doCast(SkillTable.getInstance().getInfo(4684,1))
   elif nowHp < maxHp*0.5:
     if (Rnd.get(100) < 50):
       if (Rnd.get(100) < 5):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4690,1))
       elif (Rnd.get(100) < 10):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4689,1))
       elif (Rnd.get(100) < 15):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4685,1))
       elif (Rnd.get(100) < 30):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4688,1))
       elif (Rnd.get(100) < 20):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4683,1))
       else:
         if (Rnd.get(100) < 50):
           npc.setTarget(player)
           npc.doCast(SkillTable.getInstance().getInfo(4681,1))
         else:
           npc.setTarget(player)
           npc.doCast(SkillTable.getInstance().getInfo(4682,1))
     elif (Rnd.get(100) < 5):
       npc.setTarget(player)
       npc.doCast(SkillTable.getInstance().getInfo(4690,1))
     elif (Rnd.get(100) < 10):
       npc.setTarget(player)
       npc.doCast(SkillTable.getInstance().getInfo(4689,1))
     else:
       npc.setTarget(player)
       npc.doCast(SkillTable.getInstance().getInfo(4684,1))
   elif nowHp < maxHp*0.75:
     if (Rnd.get(100) < 50):
       if (Rnd.get(100) < 0):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4690,1))
       elif (Rnd.get(100) < 5):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4689,1))
       elif (Rnd.get(100) < 7):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4685,1))
       elif (Rnd.get(100) < 10):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4688,1))
       elif (Rnd.get(100) < 15):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4683,1))
       else:
         if (Rnd.get(100) < 50):
           npc.setTarget(player)
           npc.doCast(SkillTable.getInstance().getInfo(4681,1))
         else:
           npc.setTarget(player)
           npc.doCast(SkillTable.getInstance().getInfo(4682,1))
     elif (Rnd.get(100) < 0):
       npc.setTarget(player)
       npc.doCast(SkillTable.getInstance().getInfo(4690,1))
     elif (Rnd.get(100) < 5):
       npc.setTarget(player)
       npc.doCast(SkillTable.getInstance().getInfo(4689,1))
     else:
       npc.setTarget(player)
       npc.doCast(SkillTable.getInstance().getInfo(4684,1))
   else:
     if (Rnd.get(100) < 50):
       if (Rnd.get(100) < 0):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4690,1))
       elif (Rnd.get(100) < 5):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4689,1))
       elif (Rnd.get(100) < 7):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4685,1))
       elif (Rnd.get(100) < 10):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4688,1))
       elif (Rnd.get(100) < 15):
         npc.setTarget(player)
         npc.doCast(SkillTable.getInstance().getInfo(4683,1))
       else:
         if (Rnd.get(100) < 50):
           npc.setTarget(player)
           npc.doCast(SkillTable.getInstance().getInfo(4681,1))
         else:
           npc.setTarget(player)
           npc.doCast(SkillTable.getInstance().getInfo(4682,1))
     elif (Rnd.get(100) < 0):
       npc.setTarget(player)
       npc.doCast(SkillTable.getInstance().getInfo(4690,1))
     elif (Rnd.get(100) < 10):
       npc.setTarget(player)
       npc.doCast(SkillTable.getInstance().getInfo(4689,1))
     else:
       npc.setTarget(player)
       npc.doCast(SkillTable.getInstance().getInfo(4684,1))
   return