示例#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,Attributes.FIRE,10)
         st.playSound("ItemSound.quest_middle")
     elif event == "32326-03.htm" :
         st.set("cond","8")
         st.giveItems(YangSword,1,Attributes.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,Attributes.FIRE,10)
     elif event == "32326-06.htm" :
         if st.getQuestItemsCount(YangSword):
            st.takeItems(YangSword,1)
            htmltext = "32326-07.htm"
         st.giveItems(YangSword,1,Attributes.EARTH,10)
     elif event == "32325-09.htm" :
         st.set("cond","5")
         SkillTable.getInstance().getInfo(2635,1).getEffects(player,player)
         st.giveItems(YinSword,1,Attributes.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,Attributes.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
示例#2
0
文件: __init__.py 项目: impos89/l2emu
 def onAttack (self,npc,player,damage,isPet,skill):
   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
示例#3
0
    def onAttack(self, npc, player, damage, isPet, skill):
        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
示例#4
0
文件: tears.py 项目: Qvinticom/l2emu
def castInvul(self):
    if self.spawned:
        skill = SkillTable.getInstance().getInfo(5225, 1)
        if skill != None:
            self.tears.doCast(skill)
            self.startQuestTimer("CastInvul", 180000, None, None)
    return
示例#5
0
文件: tears.py 项目: impos89/l2emu
def castInvul(self):
	if self.spawned:
		skill = SkillTable.getInstance().getInfo(5225,1)
		if skill != None:
			self.tears.doCast(skill)
			self.startQuestTimer("CastInvul", 180000, None, None)
	return
示例#6
0
文件: __init__.py 项目: impos89/l2emu
 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
示例#7
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
示例#8
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
示例#9
0
文件: __init__.py 项目: impos89/l2emu
 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
示例#10
0
    def onTalk(self, npc, player):
        htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</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
示例#11
0
文件: __init__.py 项目: impos89/l2emu
 def onTalk (self,npc,player):
   htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</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