Beispiel #1
0
 def onAdvEvent(self, event, npc, pc):
     if event == "actions":
         sayNpc = self.addSpawn(32549, -185612, 240750, 1569, 0, False, 0)
         self.startQuestTimer("say", 60000, sayNpc, None, True)
         self.startQuestTimer("REPORT1", 40000, sayNpc, None)
         yy = -31
         for x in range(-184975, -185530, -95):
             yy += 31
             xx = 0
             for y in range(240860, 241085, 88):
                 actNpc = self.addSpawn(32619, x - xx, y - yy, 1570, 37600,
                                        False, 0)
                 xx += 27
                 actNpc.setIsParalyzed(True)
                 self.startQuestTimer("act", 60000, actNpc, None, True)
     elif event == "say":
         npc.broadcastPacket(
             NpcSay(npc.getObjectId(), 0, npc.getNpcId(), "實施3次刺擊!"))
     elif event in REPORTS.keys():
         check, report, nextEvent = REPORTS[event]
         self.isCheck = check
         npc.broadcastPacket(
             NpcSay(npc.getObjectId(), 1, npc.getNpcId(), report))
         self.startQuestTimer(nextEvent, 300000, npc, None)
     elif event == "act":
         self.startQuestTimer("act1", 3000, npc, None)
         self.startQuestTimer("act2", 7000, npc, None)
         self.startQuestTimer("act3", 11000, npc, None)
     elif event == "act1":
         npc.broadcastPacket(SocialAction(npc.getObjectId(), 4))
     elif event == "act2":
         npc.broadcastPacket(SocialAction(npc.getObjectId(), 4))
     elif event == "act3":
         npc.broadcastPacket(SocialAction(npc.getObjectId(), 4))
     return
Beispiel #2
0
 def onAdvEvent(self, event, npc, player):
     htmltext = event
     st = player.getQuestState(qn)
     if not st: return
     player = st.getPlayer()
     if event == "32138-04.htm":
         st.set("cond", "1")
         st.setState(State.STARTED)
         st.playSound("ItemSound.quest_accept")
     elif event == "32133-06.htm":
         st.set("cond", "6")
         st.playSound("ItemSound.quest_accept")
     elif event == "32138-09.htm":
         st.set("cond", "7")
         st.playSound("ItemSound.quest_accept")
     elif event == "32138-12.htm":
         st.takeItems(MUERTOS_CLAW, -1)
         st.giveItems(57, 8799)
         st.giveItems(LESSER_HEALING_POTIONS, 100)
         for item in ECHO:
             st.giveItems(item, 10)
         newbie = player.getNewbie()
         if newbie | NEWBIE_REWARD != newbie:
             player.setNewbie(newbie | NEWBIE_REWARD)
             st.giveItems(SOULSHOT_FOR_BEGINNERS, 7000)
             st.playTutorialVoice("tutorial_voice_026")
         st.giveItems(WARRIORS_SWORD, 1)
         st.addExpAndSp(20739, 1777)
         player.sendPacket(SocialAction(player.getObjectId(), 3))
         player.sendPacket(SocialAction(player.getObjectId(), 15))
         st.playSound("ItemSound.quest_finish")
         st.exitQuest(False)
     return htmltext
Beispiel #3
0
 def onTalk (self,npc,player):
     htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
     st = player.getQuestState(qn)
     if not st : return htmltext
     npcId = npc.getNpcId()
     id = st.getState()
     cond = st.getInt("cond")
     if id == State.COMPLETED :
         htmltext = "32197-07.htm"
     elif npcId == Gwain :
         if player.getLevel() < 18 :
             htmltext = "32197-00a.htm"
             st.exitQuest(1)
         elif player.getClassId().getId() != 123 :
             htmltext = "32197-00b.htm"
             st.exitQuest(1)
         elif id == State.CREATED :
             htmltext = "32197-01.htm"
         elif cond < 4 :
             htmltext = "32197-03.htm"
         elif cond == 4 :
             htmltext = "32197-04.htm"
             st.takeItems(Shubain_Rec,-1)
             st.set("cond","5")
         elif cond == 5 :
             if not st.getQuestItemsCount(Heart) :
                 htmltext = "32197-05.htm"
             else :
                 st.takeItems(Heart,-1)
                 st.giveItems(Gwain_Rec,1)
                 isFinished = st.getGlobalQuestVar("1ClassQuestFinished")
                 if isFinished == "" :
                   st.giveItems(57,81900)
                   st.addExpAndSp(228064,13773)
                 st.exitQuest(False)
                 st.saveGlobalQuestVar("1ClassQuestFinished","1")
                 st.playSound("ItemSound.quest_finish")
                 player.sendPacket(SocialAction(player.getObjectId(),3))
                 htmltext = "32197-06.htm"
     elif npcId == Shubain :
         if cond == 1 :
             htmltext = "32194-01.htm"
         elif cond == 2 :
             if st.getQuestItemsCount(Head) < 5 :
                 htmltext = "32194-03.htm"
             else :
                 htmltext = "32194-04.htm"
                 st.takeItems(Head,-1)
                 st.set("cond","3")
         elif cond == 3 :
             if st.getQuestItemsCount(Leg) < 10 :
                 htmltext = "32194-05.htm"
             else :
                 htmltext = "32194-06.htm"
                 st.takeItems(Leg,-1)
                 st.giveItems(Shubain_Rec,1)
                 st.set("cond","4")
         elif cond > 3 :
             htmltext = "32194-07.htm"
     return htmltext
Beispiel #4
0
 def onAdvEvent (self,event,npc, player) :
   if event == "1" :
      machine_instance = self.FindTemplate(Strange_Machine)
      if machine_instance :
        npc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, machine_instance)
        machine_instance.broadcastPacket(SpecialCamera(machine_instance.getObjectId(),1,-200,15,10000,20000))
      else :
        print "Dr Chaos AI: problem finding Strange Machine (npcid = "+Strange_Machine+"). Error: not spawned!"
      self.startQuestTimer("2",2000,npc,player)
      self.startQuestTimer("3",10000,npc,player)
   elif event == "2" :
      npc.broadcastPacket(SocialAction(npc.getObjectId(),3))
   elif event == "3" :
      npc.broadcastPacket(SpecialCamera(npc.getObjectId(),1,-150,10,3000,20000))
      self.startQuestTimer("4",2500,npc,player)
   elif event == "4" :
      npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, L2CharPosition(96055,-110759,-3312,0))
      self.startQuestTimer("5",2000,npc,player)
   elif event == "5" :
      player.teleToLocation(94832,-112624,-3304)
      npc.teleToLocation(-113091,-243942,-15536)
      if self.isGolemSpawned == 0 :
         golem = self.addSpawn(25512,94640,-112496,-3336,0,False,0)
         self.isGolemSpawned == 1
         self.startQuestTimer("6",1000,golem,player)
         player.sendPacket(PlaySound(1,"Rm03_A",0,0,0,0,0))
   elif event == "6" :
      npc.broadcastPacket(SpecialCamera(npc.getObjectId(),30,-200,20,6000,8000))
   return
Beispiel #5
0
 def onEvent(self, event, st):
     htmltext = event
     player = st.getPlayer()
     if event == "30587_1":
         if player.getClassId().getId() != 0x2c:
             if player.getClassId().getId() == 0x2f:
                 htmltext = "30587-02a.htm"
                 st.exitQuest(1)
             else:
                 htmltext = "30587-02.htm"
                 st.exitQuest(1)
         else:
             if player.getLevel() < 18:
                 htmltext = "30587-03.htm"
             else:
                 if st.getQuestItemsCount(KHAVATARI_TOTEM) != 0:
                     htmltext = "30587-04.htm"
                 else:
                     htmltext = "30587-05.htm"
     elif event == "1":
         st.set("id", "0")
         st.set("cond", "1")
         st.setState(State.STARTED)
         st.playSound("ItemSound.quest_accept")
         htmltext = "30587-06.htm"
         st.giveItems(POMEGRANATE, 1)
     elif event == "30587-09a.htm":
         st.takeItems(ROSHEEKS_LETTER, 1)
         st.giveItems(GANTAKIS_LETTER, 1)
         st.set("cond", "9")
         st.playSound("ItemSound.quest_middle")
     elif event == "30587-09b.htm":
         st.takeItems(ROSHEEKS_LETTER, 1)
         st.giveItems(GANTAKIS_LETTER, 1)
         st.set("cond", "14")
         st.playSound("ItemSound.quest_middle")
     elif event == "32056-03.htm":
         st.set("cond", "15")
         st.playSound("ItemSound.quest_middle")
     elif event == "32056-08.htm":
         st.set("cond", "19")
         st.playSound("ItemSound.quest_middle")
         st.takeItems(8546, -1)
     elif event == "31979-03.htm":
         st.takeItems(SCROLL_FIERY_SPIRIT, 1)
         st.giveItems(KHAVATARI_TOTEM, 1)
         isFinished = st.getGlobalQuestVar("1ClassQuestFinished")
         if isFinished == "":
             st.giveItems(57, 81900)
             st.addExpAndSp(295862, 19344)
         player.sendPacket(SocialAction(player.getObjectId(), 3))
         st.set("cond", "0")
         st.set("onlyone", "1")
         st.exitQuest(False)
         st.saveGlobalQuestVar("1ClassQuestFinished", "1")
         st.playSound("ItemSound.quest_finish")
     return htmltext
Beispiel #6
0
 def onEvent(self, event, st):
     htmltext = event
     if event == "1":
         htmltext = "30510-05.htm"
         for var in STATS:
             st.set(var, "1")
         st.setState(State.STARTED)
         st.set("progress", "PART1")
         st.playSound("ItemSound.quest_accept")
     elif event == "30630_1":
         htmltext = "30630-02.htm"
     elif event == "30630_2":
         htmltext = "30630-03.htm"
     elif event == "30630_3":
         htmltext = "30630-04.htm"
         st.giveItems(ORIMS_CONTRACT, 1)
         st.set("Orim", "2")
     elif event == "30682_1":
         htmltext = "30682-02.htm"
         st.giveItems(PEKIRONS_TOTEM, 1)
         st.set("Perkiron", "2")
     elif event == "30515_1":
         htmltext = "30515-02.htm"
         st.giveItems(MANAKIAS_TOTEM, 1)
         st.set("Manakia", "2")
         st.set("Manakia_Queen", "2")
     elif event == "30507_1":
         htmltext = "30507-02.htm"
         st.giveItems(RACOYS_TOTEM, 1)
         st.set("Racoy", "2")
     elif event == "30030_1":
         htmltext = "30030-02.htm"
     elif event == "30030_2":
         htmltext = "30030-03.htm"
     elif event == "30030_3":
         htmltext = "30030-04.htm"
         st.giveItems(VIVIANTES_LETTER, 1)
         st.set("Racoy", "3")
     elif event == "30649_1":
         htmltext = "30649-02.htm"
     elif event == "30649_2":
         st.takeItems(WARSPIRIT_TOTEM, -1)
         st.takeItems(BRAKIS_REMAINS2, -1)
         st.takeItems(HERMODTS_REMAINS2, -1)
         st.takeItems(KIRUNAS_REMAINS2, -1)
         st.addExpAndSp(447444, 30704)
         st.takeItems(TONARS_REMAINS2, -1)
         st.giveItems(MARK_OF_WARSPIRIT, 1)
         st.getPlayer().sendPacket(
             SocialAction(st.getPlayer().getObjectId(), 3))
         st.giveItems(7562, 92)
         htmltext = "30649-03.htm"
         for var in STATS:
             st.unset(var)
         st.exitQuest(False)
         st.playSound("ItemSound.quest_finish")
     return htmltext
Beispiel #7
0
    def onSkillSee(self, npc, player, skill, targets, isPet):
        # this behavior is only run when the target of skill is the passed npc (chest)
        # i.e. when the player is attempting to open the chest using a skill
        if not npc in targets: return
        # gather some values on local variables
        npcId = npc.getNpcId()
        skillId = skill.getId()
        # check if the npc and skills used are valid for this script.  Exit if invalid.
        if npcId not in self.feedableBeasts: return
        if skillId not in [SKILL_GOLDEN_SPICE, SKILL_CRYSTAL_SPICE]: return
        # more value gathering on local variables

        # first gather some values on local variables
        objectId = npc.getObjectId()
        growthLevel = 3  # if a mob is in feedableBeasts but not in growthCapableMobs, then it's at max growth (3)
        if self.growthCapableMobs.has_key(npcId):
            growthLevel = self.growthCapableMobs[npcId][0]
        # prevent exploit which allows 2 players to simultaneously raise the same 0-growth beast
        # If the mob is at 0th level (when it still listens to all feeders) lock it to the first feeder!
        if (growthLevel == 0) and self.feedInfo.has_key(objectId):
            return
        else:
            self.feedInfo[objectId] = player.getObjectId()

        food = 0
        if skillId == SKILL_GOLDEN_SPICE:
            food = GOLDEN_SPICE
        elif skillId == SKILL_CRYSTAL_SPICE:
            food = CRYSTAL_SPICE

        # display the social action of the beast eating the food.
        npc.broadcastPacket(SocialAction(objectId, 2))

        # if this pet can't grow, it's all done.
        if npcId in self.growthCapableMobs.keys():
            # do nothing if this mob doesn't eat the specified food (food gets consumed but has no effect).
            if len(self.growthCapableMobs[npcId][1][food]) == 0: return

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

            if growthLevel > 0:
                # check if this is the same player as the one who raised it from growth 0.
                # if no, then do not allow a chance to raise the pet (food gets consumed but has no effect).
                if self.feedInfo[objectId] != player.getObjectId(): return

            # Polymorph the mob, with a certain chance, given its current growth level
            if Rnd.get(100) < self.growthCapableMobs[npcId][2]:
                self.spawnNext(npc, growthLevel, player, food)
        elif npcId in self.tamedBeasts:
            if skillId == npc.getFoodType():
                npc.onReceiveFood()
                mytext = [
                    "Refills! Yeah!",
                    "I am such a gluttonous beast, it is embarrassing! Ha ha",
                    "Your cooperative feeling has been getting better and better.",
                    "I will help you!",
                    "The weather is really good.  Wanna go for a picnic?",
                    "I really like you! This is tasty...",
                    "If you do not have to leave this place, then I can help you.",
                    "What can I help you with?",
                    "I am not here only for food!", "Yam, yam, yam, yam, yam!"
                ]
                npc.broadcastPacket(
                    CreatureSay(objectId, 0, npc.getName(),
                                mytext[Rnd.get(len(mytext))]))
        return
Beispiel #8
0
    def onTalk(self, npc, player):
        htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
        st = player.getQuestState(qn)
        if not st: return htmltext

        npcId = npc.getNpcId()
        id = st.getState()
        if npcId != 30328 and id != State.STARTED: return htmltext

        if npcId == 30328 and st.getInt("cond") == 0:
            htmltext = "30328-01.htm"
            return htmltext
        elif npcId == 30328 and st.getInt(
                "cond") and st.getQuestItemsCount(REORIA_LETTER2) > 0:
            htmltext = "30328-06.htm"
        elif npcId == 30328 and st.getInt("cond") and st.getQuestItemsCount(
                REORIA_LETTER2) == 0 and st.getQuestItemsCount(
                    HONORARY_GUARD) == 0:
            htmltext = "30328-08.htm"
        elif npcId == 30337 and st.getInt("cond") and st.getQuestItemsCount(
                REORIA_LETTER2) > 0 and st.getQuestItemsCount(
                    PRIGUNS_TEAR_LETTER1) + st.getQuestItemsCount(
                        PRIGUNS_TEAR_LETTER2) + st.getQuestItemsCount(
                            PRIGUNS_TEAR_LETTER3) + st.getQuestItemsCount(
                                PRIGUNS_TEAR_LETTER4) == 0:
            htmltext = "30337-01.htm"
        elif npcId == 30337 and st.getQuestItemsCount(
                MORETTIS_LETTER) < 1 and st.getQuestItemsCount(
                    PRIGUNS_LETTER) == 0 and st.getQuestItemsCount(
                        HONORARY_GUARD) == 0:
            if st.getQuestItemsCount(
                    PRIGUNS_TEAR_LETTER1) + st.getQuestItemsCount(
                        PRIGUNS_TEAR_LETTER2) + st.getQuestItemsCount(
                            PRIGUNS_TEAR_LETTER3) + st.getQuestItemsCount(
                                PRIGUNS_TEAR_LETTER4) < 1:
                htmltext = "30337-04.htm"
            elif st.getQuestItemsCount(
                    PRIGUNS_TEAR_LETTER1) + st.getQuestItemsCount(
                        PRIGUNS_TEAR_LETTER2) + st.getQuestItemsCount(
                            PRIGUNS_TEAR_LETTER3) + st.getQuestItemsCount(
                                PRIGUNS_TEAR_LETTER4
                            ) > 0 and st.getQuestItemsCount(
                                PRIGUNS_TEAR_LETTER1) + st.getQuestItemsCount(
                                    PRIGUNS_TEAR_LETTER2
                                ) + st.getQuestItemsCount(
                                    PRIGUNS_TEAR_LETTER3
                                ) + st.getQuestItemsCount(
                                    PRIGUNS_TEAR_LETTER4) < 4:
                htmltext = "30337-05.htm"
            else:
                htmltext = "30337-06.htm"
                st.takeItems(PRIGUNS_TEAR_LETTER1, 1)
                st.takeItems(PRIGUNS_TEAR_LETTER2, 1)
                st.takeItems(PRIGUNS_TEAR_LETTER3, 1)
                st.takeItems(PRIGUNS_TEAR_LETTER4, 1)
                st.giveItems(MORETTIS_HERB, 1)
                st.giveItems(MORETTIS_LETTER, 1)
                st.set("cond", "4")
                st.playSound("ItemSound.quest_middle")
        elif npcId == 30334 and st.getInt("cond"):
            htmltext = "30334-01.htm"
        elif npcId == 30426 and st.getInt("cond") and st.getQuestItemsCount(
                MORETTIS_LETTER) and st.getQuestItemsCount(MORETTIS_HERB):
            if st.getQuestItemsCount(RUSTED_KEY) < 1:
                htmltext = "30426-01.htm"
                st.set("cond", "5")
                st.playSound("ItemSound.quest_middle")
            else:
                htmltext = "30426-02.htm"
                st.takeItems(RUSTED_KEY, 1)
                st.takeItems(MORETTIS_HERB, 1)
                st.takeItems(MORETTIS_LETTER, 1)
                st.giveItems(PRIGUNS_LETTER, 1)
                st.set("cond", "7")
                st.playSound("ItemSound.quest_middle")
        elif npcId == 30426 and st.getInt("cond") and st.getQuestItemsCount(
                PRIGUNS_LETTER):
            htmltext = "30426-04.htm"
        elif npcId == 30337 and st.getInt(
                "cond") and st.getQuestItemsCount(PRIGUNS_LETTER) > 0:
            if st.getQuestItemsCount(MORETTIS_HERB):
                htmltext = "30337-09.htm"
            else:
                htmltext = "30337-07.htm"
                st.takeItems(PRIGUNS_LETTER, 1)
                st.giveItems(HONORARY_GUARD, 1)
                st.set("cond", "8")
                st.playSound("ItemSound.quest_middle")
        elif npcId == 30337 and st.getInt(
                "cond") and st.getQuestItemsCount(HONORARY_GUARD) > 0:
            htmltext = "30337-08.htm"
        elif npcId == 30328 and st.getInt(
                "cond") and st.getQuestItemsCount(HONORARY_GUARD) > 0:
            htmltext = "30328-07.htm"
            st.takeItems(HONORARY_GUARD, 1)
            st.giveItems(REORIA_RECOMMENDATION, 1)
            isFinished = st.getGlobalQuestVar("1ClassQuestFinished")
            if isFinished == "":
                st.giveItems(57, 81900)
                st.addExpAndSp(160267, 9966)
            player.sendPacket(SocialAction(player.getObjectId(), 3))
            st.set("cond", "0")
            st.exitQuest(False)
            st.saveGlobalQuestVar("1ClassQuestFinished", "1")
            st.playSound("ItemSound.quest_finish")
        return htmltext
Beispiel #9
0
    def onTalk(self, npc, player):
        htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
        st = player.getQuestState(qn)
        if not st: return htmltext

        npcId = npc.getNpcId()
        id = st.getState()
        if npcId != 30585 and id != State.STARTED: return htmltext

        if npcId == 30585 and st.getInt("cond") == 0:
            htmltext = "30585-01.htm"
        elif npcId == 30585 and st.getInt("cond") == 12:
            htmltext = "30585-11a.htm"
        elif npcId == 31979 and st.getInt("cond") == 12:
            htmltext = "31979-01.htm"
            st.playSound("ItemSound.quest_middle")
            st.set("cond", "13")
        elif npcId == 31979 and st.getInt("cond") == 21:
            htmltext = "31979-03.htm"
            st.giveItems(MASK_OF_MEDIUM, 1)
            st.giveItems(57, 81900)
            st.addExpAndSp(295862, 18194)
            player.sendPacket(SocialAction(player.getObjectId(), 3))
            player.sendPacket(SocialAction(player.getObjectId(), 15))
            st.set("cond", "0")
            st.exitQuest(False)
            st.playSound("ItemSound.quest_finish")
        elif npcId == 31979 and st.getInt("cond") == 13:
            htmltext = "31979-02.htm"
        elif npcId == 32057 and st.getInt("cond") == 13:
            htmltext = "32057-01.htm"
        elif npcId == 32057 and st.getInt("cond") == 14:
            htmltext = "32057-03.htm"
        elif npcId == 32057 and st.getInt("cond") == 20:
            htmltext = "32057-04.htm"
        elif npcId == 32057 and st.getInt("cond") == 21:
            htmltext = "32057-05.htm"
        elif npcId == 32090 and st.getInt("cond") == 15:
            htmltext = "32090-01.htm"
            st.playSound("ItemSound.quest_middle")
            st.set("cond", "16")
        elif npcId == 32090 and st.getInt("cond") == 16:
            htmltext = "32090-01.htm"
        elif npcId == 32090 and st.getInt("cond") == 17:
            htmltext = "32090-02.htm"
        elif npcId == 32090 and st.getInt("cond") == 18:
            htmltext = "32090-05.htm"
        elif npcId == 32090 and st.getInt("cond") == 19:
            htmltext = "32090-06.htm"
            st.playSound("ItemSound.quest_middle")
            st.set("cond", "20")
        elif npcId == 32090 and st.getInt("cond") == 20:
            htmltext = "32090-06.htm"
        elif npcId == 30585 and st.getInt("cond") and st.getQuestItemsCount(
                FIRE_CHARM) == 1 and (
                    (st.getQuestItemsCount(KASHA_BEAR_PELT) +
                     st.getQuestItemsCount(KASHA_BSPIDER_HUSK) +
                     st.getQuestItemsCount(FIERY_EGG1)) < 3):
            htmltext = "30585-07.htm"
        elif npcId == 30585 and st.getInt("cond") and st.getQuestItemsCount(
                FIRE_CHARM) == 1 and (
                    (st.getQuestItemsCount(KASHA_BEAR_PELT) +
                     st.getQuestItemsCount(KASHA_BSPIDER_HUSK) +
                     st.getQuestItemsCount(FIERY_EGG1)) >= 3):
            htmltext = "30585-08.htm"
            st.takeItems(FIRE_CHARM, 1)
            st.takeItems(KASHA_BEAR_PELT, 1)
            st.takeItems(KASHA_BSPIDER_HUSK, 1)
            st.takeItems(FIERY_EGG1, 1)
            st.giveItems(HESTUI_MASK, 1)
            st.giveItems(FIERY_EGG2, 1)
            st.set("cond", "3")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30585 and st.getInt("cond") and st.getQuestItemsCount(
                HESTUI_MASK) == 1 and st.getQuestItemsCount(FIERY_EGG2) == 1:
            htmltext = "30585-09.htm"
        elif npcId == 30585 and st.getInt("cond") and st.getQuestItemsCount(
                TOTEM_SPIRIT_CLAW) == 1:
            htmltext = "30585-10.htm"
        elif npcId == 30585 and st.getInt("cond") and st.getQuestItemsCount(
                TATARUS_LETTER) == 1:
            htmltext = "30585-12.htm"
        elif npcId == 30585 and st.getInt("cond") and (
                st.getQuestItemsCount(GRIZZLY_BLOOD)
                or st.getQuestItemsCount(FLAME_CHARM)
                or st.getQuestItemsCount(BLOOD_CAULDRON)
                or st.getQuestItemsCount(SPIRIT_NET)
                or st.getQuestItemsCount(BOUND_DURKA_SPIRIT)
                or st.getQuestItemsCount(TOTEM_SPIRIT_BLOOD)):
            htmltext = "30585-13.htm"
        elif npcId == 30592 and st.getInt("cond") and st.getQuestItemsCount(
                HESTUI_MASK) and st.getQuestItemsCount(FIERY_EGG2):
            htmltext = "30592-01.htm"
        elif npcId == 30592 and st.getInt("cond") and st.getQuestItemsCount(
                TOTEM_SPIRIT_CLAW):
            htmltext = "30592-04.htm"
        elif npcId == 30592 and st.getInt("cond") and (
                st.getQuestItemsCount(GRIZZLY_BLOOD)
                or st.getQuestItemsCount(FLAME_CHARM)
                or st.getQuestItemsCount(BLOOD_CAULDRON)
                or st.getQuestItemsCount(SPIRIT_NET)
                or st.getQuestItemsCount(BOUND_DURKA_SPIRIT)
                or st.getQuestItemsCount(TOTEM_SPIRIT_BLOOD)
                or st.getQuestItemsCount(TATARUS_LETTER)):
            htmltext = "30592-05.htm"
        elif npcId == 30502 and st.getInt("cond") and st.getQuestItemsCount(
                TATARUS_LETTER):
            htmltext = "30502-01.htm"
            st.giveItems(FLAME_CHARM, 1)
            st.takeItems(TATARUS_LETTER, 1)
            st.set("cond", "6")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30502 and st.getInt("cond") and st.getQuestItemsCount(
                FLAME_CHARM) == 1 and st.getQuestItemsCount(GRIZZLY_BLOOD) < 3:
            htmltext = "30502-02.htm"
        elif npcId == 30502 and st.getInt("cond") and st.getQuestItemsCount(
                FLAME_CHARM
        ) == 1 and st.getQuestItemsCount(GRIZZLY_BLOOD) >= 3:
            htmltext = "30502-03.htm"
            st.takeItems(FLAME_CHARM, 1)
            st.takeItems(GRIZZLY_BLOOD, st.getQuestItemsCount(GRIZZLY_BLOOD))
            st.giveItems(BLOOD_CAULDRON, 1)
            st.set("cond", "8")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30502 and st.getInt("cond") and st.getQuestItemsCount(
                BLOOD_CAULDRON) == 1:
            htmltext = "30502-04.htm"
        elif npcId == 30502 and st.getInt("cond") and (
                st.getQuestItemsCount(BOUND_DURKA_SPIRIT) == 1
                or st.getQuestItemsCount(SPIRIT_NET) == 1):
            htmltext = "30502-05.htm"
        elif npcId == 30502 and st.getInt("cond") and st.getQuestItemsCount(
                TOTEM_SPIRIT_BLOOD) == 1:
            htmltext = "30502-06.htm"
        elif npcId == 30593 and st.getInt("cond") and st.getQuestItemsCount(
                BLOOD_CAULDRON):
            htmltext = "30593-01.htm"
        elif npcId == 30593 and st.getInt("cond") and st.getQuestItemsCount(
                SPIRIT_NET) and st.getQuestItemsCount(BOUND_DURKA_SPIRIT) == 0:
            htmltext = "30593-04.htm"
        elif npcId == 30593 and st.getInt("cond") and st.getQuestItemsCount(
                SPIRIT_NET) == 0 and st.getQuestItemsCount(BOUND_DURKA_SPIRIT):
            htmltext = "30593-05.htm"
            st.takeItems(BOUND_DURKA_SPIRIT, 1)
            st.giveItems(TOTEM_SPIRIT_BLOOD, 1)
            st.set("cond", "11")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30593 and st.getInt(
                "cond") == 1 and st.getQuestItemsCount(TOTEM_SPIRIT_BLOOD):
            htmltext = "30593-06.htm"
        return htmltext
Beispiel #10
0
    def onTalk(self, npc, player):
        htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
        st = player.getQuestState(qn)
        if not st: return htmltext

        npcId = npc.getNpcId()
        id = st.getState()
        if npcId != 30648 and id != State.STARTED: return htmltext

        cond = st.getInt("cond")
        if npcId == 30648 and cond == 0 and id == State.CREATED:
            if (player.getClassId().getId() in [0x0f, 0x1d, 0x2a, 0x32]):
                if player.getLevel() >= 35:
                    htmltext = "30648-03.htm"
                else:
                    htmltext = "30648-01.htm"
                    st.exitQuest(1)
            else:
                htmltext = "30648-02.htm"
                st.exitQuest(1)
        elif npcId == 30648 and cond == 0 and id == State.COMPLETED:
            htmltext = "<html><body>這是已經完成的任務。</body></html>"

        elif npcId == 30648 and cond == 1 and st.getQuestItemsCount(
                VOUCHER_OF_TRIAL):
            htmltext = "30648-09.htm"
        elif npcId == 30648 and cond == 17 and st.getQuestItemsCount(
                BOOK_OF_SAGE):
            st.addExpAndSp(629125, 40803)
            st.giveItems(7562, 49)
            st.giveItems(ADENA, 114649)
            player.sendPacket(SocialAction(player.getObjectId(), 3))
            htmltext = "30648-10.htm"
            st.giveItems(MARK_OF_PILGRIM, 1)
            st.takeItems(BOOK_OF_SAGE, 1)
            st.exitQuest(False)
            st.playSound("ItemSound.quest_finish")
            st.unset("cond")
        elif npcId == 30571 and cond == 1 and st.getQuestItemsCount(
                VOUCHER_OF_TRIAL):
            htmltext = "30571-01.htm"
            st.takeItems(VOUCHER_OF_TRIAL, 1)
            st.set("cond", "2")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30571 and cond == 2:
            htmltext = "30571-02.htm"
        elif npcId == 30571 and cond in [
                5, 6
        ] and st.getQuestItemsCount(SPIRIT_OF_FLAME):
            htmltext = "30571-03.htm"
            st.set("cond", "6")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30649 and cond == 2:
            htmltext = "30649-01.htm"
            st.set("cond", "3")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30649 and cond == 3:
            htmltext = "30649-02.htm"
        elif npcId == 30649 and cond == 4 and st.getQuestItemsCount(
                ESSENSE_OF_FLAME):
            htmltext = "30649-03.htm"
        elif npcId == 30550 and cond == 6 and st.getQuestItemsCount(
                SPIRIT_OF_FLAME):
            htmltext = "30550-01.htm"
            st.giveItems(TAG_OF_RUMOR, 1)
            st.set("cond", "7")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30550 and cond == 7:
            htmltext = "30550-02.htm"
        elif npcId == 30650 and cond == 7 and st.getQuestItemsCount(
                TAG_OF_RUMOR):
            htmltext = st.showHtmlFile("30650-01.htm").replace(
                "RequiredAdena", str(100000 * int(Config.RATE_DROP_ADENA)))
        elif npcId == 30650 and cond >= 9 and st.getQuestItemsCount(
                GREY_BADGE) and st.getQuestItemsCount(BOOK_OF_GERALD):
            htmltext = "30650-04.htm"
            rate = int(Config.RATE_QUESTS_REWARD)
            if rate == 0: rate = 1
            st.giveItems(ADENA, int(100000 * Config.RATE_DROP_ADENA / rate))
            st.takeItems(BOOK_OF_GERALD, 1)
        elif npcId == 30651 and cond == 7 and st.getQuestItemsCount(
                TAG_OF_RUMOR):
            htmltext = "30651-01.htm"
            st.giveItems(GREY_BADGE, 1)
            st.takeItems(TAG_OF_RUMOR, 1)
            st.set("cond", "9")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30651 and cond == 8 and st.getQuestItemsCount(
                TAG_OF_RUMOR):
            htmltext = "30651-02.htm"
            st.giveItems(GREY_BADGE, 1)
            st.takeItems(TAG_OF_RUMOR, 1)
            st.set("cond", "9")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30651 and cond == 9:
            htmltext = "30651-03.htm"
        elif npcId == 30117 and cond == 8:
            htmltext = "30117-01.htm"
            st.set("cond", "9")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30117 and cond == 9:
            htmltext = "30117-02.htm"
        elif npcId == 30036 and cond == 9:
            htmltext = "30036-01.htm"
            st.giveItems(PICTURE_OF_NAHIR, 1)
            st.set("cond", "10")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30036 and cond == 10:
            htmltext = "30036-02.htm"
        elif npcId == 30036 and cond == 11:
            htmltext = "30036-03.htm"
            st.giveItems(STATUE_OF_EINHASAD, 1)
            st.takeItems(PICTURE_OF_NAHIR, 1)
            st.takeItems(HAIR_OF_NAHIR, 1)
            st.set("cond", "12")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30036 and cond == 12 and st.getQuestItemsCount(
                STATUE_OF_EINHASAD):
            htmltext = "30036-04.htm"
        elif npcId == 30362 and cond == 12:
            htmltext = "30362-01.htm"
            st.set("cond", "13")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30362 and cond == 13:
            htmltext = "30362-02.htm"
        elif npcId == 30362 and cond == 15 and st.getQuestItemsCount(
                BOOK_OF_DARKNESS):
            htmltext = "30362-03.htm"
        elif npcId == 30362 and cond == 16:
            htmltext = "30362-06.htm"
        elif npcId == 30362 and cond == 15 and st.getQuestItemsCount(
                BOOK_OF_DARKNESS) == 0:
            htmltext = "30362-07.htm"
        elif npcId == 30652 and cond == 14 and st.getQuestItemsCount(
                DEBRIS_OF_WILLOW):
            htmltext = "30652-01.htm"
        elif npcId == 30652 and cond == 15 and st.getQuestItemsCount(
                BOOK_OF_DARKNESS):
            htmltext = "30652-03.htm"
        elif npcId == 30612 and cond == 16:
            htmltext = "30612-01.htm"
            st.giveItems(BOOK_OF_SAGE, 1)
            if st.getQuestItemsCount(BOOK_OF_DARKNESS):
                st.takeItems(BOOK_OF_DARKNESS, 1)
            st.set("cond", "17")
            st.playSound("ItemSound.quest_middle")
            st.takeItems(GREY_BADGE, 1)
            st.takeItems(SPIRIT_OF_FLAME, 1)
            st.takeItems(STATUE_OF_EINHASAD, 1)
        elif npcId == 30612 and cond == 17:
            htmltext = "30612-02.htm"
        return htmltext
Beispiel #11
0
    def onTalk(self, npc, player):

        npcId = npc.getNpcId()
        htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
        st = player.getQuestState(qn)
        if not st: return htmltext

        id = st.getState()
        if id == State.COMPLETED:
            htmltext = "<html><body>這是已經完成的任務。</body></html>"
        elif npcId == 30218 and id == State.CREATED:
            if player.getLevel() >= 10 and player.getRace().ordinal() == 1:
                htmltext = "30218-02.htm"
                return htmltext
            elif player.getRace().ordinal() != 1:
                htmltext = "30218-00.htm"
                st.exitQuest(1)
            else:
                htmltext = "30218-10.htm"
                st.exitQuest(1)
        elif npcId == 30218 and st.getInt("cond"):
            if st.getQuestItemsCount(KABOO_CHIEF_TORC1):
                htmltext = "30218-06.htm"
                if st.getQuestItemsCount(KENDNELLS_ORDER1):
                    st.takeItems(KENDNELLS_ORDER1, 1)
                if st.getQuestItemsCount(KENDNELLS_ORDER2):
                    st.takeItems(KENDNELLS_ORDER2, 1)
                if st.getQuestItemsCount(KENDNELLS_ORDER3):
                    st.takeItems(KENDNELLS_ORDER3, 1)
                if st.getQuestItemsCount(KENDNELLS_ORDER4):
                    st.takeItems(KENDNELLS_ORDER4, 1)
                st.takeItems(KABOO_CHIEF_TORC1, 1)
                n = st.getRandom(100)
                if n < 25:
                    st.giveItems(KENDNELLS_ORDER5, 1)
                elif n < 50:
                    st.giveItems(KENDNELLS_ORDER6, 1)
                elif n < 75:
                    st.giveItems(KENDNELLS_ORDER7, 1)
                else:
                    st.giveItems(KENDNELLS_ORDER8, 1)
                st.set("cond", "3")
            elif st.getQuestItemsCount(
                    KENDNELLS_ORDER1) or st.getQuestItemsCount(
                        KENDNELLS_ORDER2) or st.getQuestItemsCount(
                            KENDNELLS_ORDER3) or st.getQuestItemsCount(
                                KENDNELLS_ORDER4):
                htmltext = "30218-05.htm"
            elif st.getQuestItemsCount(KABOO_CHIEF_TORC2):
                if st.getInt("id") != 105:
                    st.set("id", "105")
                    htmltext = "30218-08.htm"
                    if st.getQuestItemsCount(KENDNELLS_ORDER5):
                        st.takeItems(KENDNELLS_ORDER5, 1)
                    if st.getQuestItemsCount(KENDNELLS_ORDER6):
                        st.takeItems(KENDNELLS_ORDER6, 1)
                    if st.getQuestItemsCount(KENDNELLS_ORDER7):
                        st.takeItems(KENDNELLS_ORDER7, 1)
                    if st.getQuestItemsCount(KENDNELLS_ORDER8):
                        st.takeItems(KENDNELLS_ORDER8, 1)
                    st.takeItems(KABOO_CHIEF_TORC2, 1)
                    newbie = player.getNewbie()
                    mage = player.getClassId().isMage()
                    st.giveItems(57, 17599)
                    if mage:
                        st.giveItems(RED_SUNSET_STAFF, 1)
                        st.giveItems(SPIRITSHOT_NO_GRADE, 500)
                    else:
                        st.giveItems(RED_SUNSET_SWORD, 1)
                        st.giveItems(SOULSHOT_NO_GRADE, 1000)
                    if newbie | NEWBIE_REWARD != newbie:
                        player.setNewbie(newbie | NEWBIE_REWARD)
                        if mage:
                            st.playTutorialVoice("tutorial_voice_027")
                            st.giveItems(SPIRITSHOT_NO_GRADE_FOR_BEGINNERS,
                                         3000)
                        else:
                            st.playTutorialVoice("tutorial_voice_026")
                            st.giveItems(SOULSHOT_NO_GRADE_FOR_BEGINNERS, 7000)
                        st.playSound("ItemSound.quest_tutorial")
                    st.giveItems(1060, int(
                        100 *
                        Config.RATE_QUESTS_REWARD))  # Lesser Healing Potions
                    for item in range(4412, 4417):
                        st.giveItems(item, int(
                            10 * Config.RATE_QUESTS_REWARD))  # Echo crystals
                    st.addExpAndSp(41478, 3555)
                    player.sendPacket(SocialAction(player.getObjectId(), 3))
                    st.exitQuest(False)
                    st.playSound("ItemSound.quest_finish")
                    st.unset("cond")
            elif st.getQuestItemsCount(
                    KENDNELLS_ORDER5) or st.getQuestItemsCount(
                        KENDNELLS_ORDER6) or st.getQuestItemsCount(
                            KENDNELLS_ORDER7) or st.getQuestItemsCount(
                                KENDNELLS_ORDER8):
                htmltext = "30218-07.htm"
        return htmltext
Beispiel #12
0
    def onTalk(self, npc, player):
        htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
        st = player.getQuestState(qn)
        if not st: return htmltext

        npcId = npc.getNpcId()
        id = st.getState()
        if npcId != KARUKIA and id != State.STARTED: return htmltext

        playerClassID = player.getClassId().getId()
        playerLvl = player.getLevel()
        cond = st.getInt("cond")

        if npcId == KARUKIA and cond == 0:
            if playerLvl >= 18 and playerClassID == 0x2c and st.getQuestItemsCount(
                    MARK_OF_RAIDER) == 0 and st.getQuestItemsCount(
                        GOBLIN_DWELLING_MAP) == 0:
                htmltext = "30570-01.htm"
            elif playerClassID != 0x2c:
                if playerClassID == 0x2d:
                    htmltext = "30570-02a.htm"
                else:
                    htmltext = "30570-03.htm"
            elif playerLvl < 18 and playerClassID == 0x2c:
                htmltext = "30570-02.htm"
            elif playerLvl >= 18 and playerClassID == 0x2c and st.getQuestItemsCount(
                    MARK_OF_RAIDER) == 1:
                htmltext = "30570-04.htm"
            else:
                htmltext = "30570-02.htm"
        elif npcId == KARUKIA and cond and st.getQuestItemsCount(
                GOBLIN_DWELLING_MAP
        ) == 1 and st.getQuestItemsCount(KURUKA_RATMAN_TOOTH) < 10:
            htmltext = "30570-06.htm"
        elif npcId == KARUKIA and cond and st.getQuestItemsCount(
                GOBLIN_DWELLING_MAP) == 1 and st.getQuestItemsCount(
                    KURUKA_RATMAN_TOOTH) >= 10 and st.getQuestItemsCount(
                        BETRAYER_UMBAR_REPORT) == 0:
            htmltext = "30570-07.htm"
        elif npcId == KARUKIA and cond > 5:
            htmltext = "30570-07b.htm"
        elif npcId == KARUKIA and cond and st.getQuestItemsCount(
                BETRAYER_UMBAR_REPORT
        ) and st.getQuestItemsCount(HEAD_OF_BETRAYER) < 2:
            htmltext = "30570-08.htm"
        elif npcId == KARUKIA and cond and st.getQuestItemsCount(
                BETRAYER_UMBAR_REPORT) and st.getQuestItemsCount(
                    HEAD_OF_BETRAYER) == 2:
            htmltext = "30570-09.htm"
        elif npcId == KASMAN and cond and st.getQuestItemsCount(
                BETRAYER_UMBAR_REPORT) and st.getQuestItemsCount(
                    HEAD_OF_BETRAYER) == 0:
            htmltext = "30501-01.htm"
        elif npcId == KASMAN and cond and st.getQuestItemsCount(
                HEAD_OF_BETRAYER) > 0 and st.getQuestItemsCount(
                    HEAD_OF_BETRAYER) < 2:
            htmltext = "30501-02.htm"
        elif npcId == KASMAN and cond and st.getQuestItemsCount(
                HEAD_OF_BETRAYER) == 2:
            htmltext = "30501-03.htm"
            st.takeItems(HEAD_OF_BETRAYER, -1)
            st.takeItems(BETRAYER_UMBAR_REPORT, -1)
            st.giveItems(MARK_OF_RAIDER, 1)
            isFinished = st.getGlobalQuestVar("1ClassQuestFinished")
            if isFinished == "":
                st.giveItems(57, 81900)
                st.addExpAndSp(295862, 17354)
            player.sendPacket(SocialAction(player.getObjectId(), 3))
            st.unset("cond")
            st.exitQuest(False)
            st.saveGlobalQuestVar("1ClassQuestFinished", "1")
            st.playSound("ItemSound.quest_finish")
        elif npcId == TAZEER:
            if cond == 5:
                htmltext = "31978-01.htm"
            elif cond == 6:
                htmltext = "31978-04.htm"
            elif cond == 7:
                htmltext = "31978-05.htm"
                st.takeItems(TIMORA_ORC_HEAD, -1)
                st.giveItems(MARK_OF_RAIDER, 1)
                st.giveItems(57, 81900)
                st.addExpAndSp(160267, 10656)
                player.sendPacket(SocialAction(player.getObjectId(), 3))
                st.unset("cond")
                st.exitQuest(False)
                st.playSound("ItemSound.quest_finish")
        return htmltext
Beispiel #13
0
    def onTalk(self, npc, player):
        htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
        st = player.getQuestState(qn)
        if not st: return htmltext

        npcId = npc.getNpcId()
        id = st.getState()
        if npcId != 30104 and id != State.STARTED: return htmltext

        if npcId == 30104 and st.getInt("cond") == 0 and st.getInt(
                "onlyone") == 0:
            if player.getRace().ordinal() != 4:
                htmltext = "30104-01.htm"
                st.exitQuest(1)
            else:
                if player.getLevel() < 37:
                    htmltext = "30104-02.htm"
                    st.exitQuest(1)
                else:
                    htmltext = "30104-03.htm"
        elif npcId == 30104 and st.getInt("cond") == 0 and st.getInt(
                "onlyone") == 1:
            htmltext = "<html><body>這是已經完成的任務。</body></html>"

        elif npcId == 30104 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) == 1:
            if st.getQuestItemsCount(
                    OLD_ACCOUNT_BOOK_ID) and st.getQuestItemsCount(
                        BLESSED_SEED_ID) and st.getQuestItemsCount(
                            RECIPE_OF_EMILLY_ID) and st.getQuestItemsCount(
                                LILITH_ELVEN_WAFER_ID):
                htmltext = "30104-06.htm"
            else:
                htmltext = "30104-05.htm"
        elif npcId == 30104 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    PARMANS_INSTRUCTIONS_ID) == 1:
            if player.getLevel() < 37:
                htmltext = "30104-09.htm"
            else:
                htmltext = "30104-10.htm"
                st.giveItems(RING_OF_TESTIMONY2_ID, 1)
                st.takeItems(PARMANS_INSTRUCTIONS_ID, 1)
                st.giveItems(PARMANS_LETTER_ID, 1)
        elif npcId == 30104 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY2_ID) and st.getQuestItemsCount(
                        PARMANS_LETTER_ID) and st.getQuestItemsCount(
                            MAPHR_TABLET_FRAGMENT_ID) == 0:
            htmltext = "30104-11.htm"
        elif npcId == 30104 and st.getInt("cond") >= 1 and (
                st.getQuestItemsCount(CLAY_DOUGH_ID)
                or st.getQuestItemsCount(PATTERN_OF_KEYHOLE_ID)
                or st.getQuestItemsCount(NIKOLAS_LIST_ID)
        ) and st.getQuestItemsCount(RING_OF_TESTIMONY2_ID) == 1:
            htmltext = "30104-12.htm"
        elif npcId == 30104 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY2_ID) and st.getQuestItemsCount(
                        MAPHR_TABLET_FRAGMENT_ID):
            st.addExpAndSp(599979, 40040)
            st.giveItems(57, 108841)
            st.giveItems(7562, 50)
            st.takeItems(RING_OF_TESTIMONY2_ID, 1)
            st.giveItems(MARK_OF_PROSPERITY_ID, 1)
            st.takeItems(MAPHR_TABLET_FRAGMENT_ID, 1)
            htmltext = "30104-13.htm"
            st.set("cond", "0")
            st.set("onlyone", "1")
            st.exitQuest(False)
            st.playSound("ItemSound.quest_finish")
            player.sendPacket(SocialAction(player.getObjectId(), 3))
        elif npcId == 30531 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    OLD_ACCOUNT_BOOK_ID) == 0 and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) == 0 and st.getQuestItemsCount(
                            RING_OF_TESTIMONY1_ID) == 1:
            htmltext = "30531-01.htm"
        elif npcId == 30531 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID):
            if st.getQuestItemsCount(
                    RECEIPT_OF_CONTRIBUTION1_ID) and st.getQuestItemsCount(
                        RECEIPT_OF_CONTRIBUTION2_ID) and st.getQuestItemsCount(
                            RECEIPT_OF_CONTRIBUTION3_ID
                        ) and st.getQuestItemsCount(
                            RECEIPT_OF_CONTRIBUTION4_ID
                        ) and st.getQuestItemsCount(
                            RECEIPT_OF_CONTRIBUTION5_ID):
                htmltext = "30531-05.htm"
                st.giveItems(OLD_ACCOUNT_BOOK_ID, 1)
                st.takeItems(COLLECTION_LICENSE_ID, 1)
                st.takeItems(RECEIPT_OF_CONTRIBUTION1_ID, 1)
                st.takeItems(RECEIPT_OF_CONTRIBUTION2_ID, 1)
                st.takeItems(RECEIPT_OF_CONTRIBUTION3_ID, 1)
                st.takeItems(RECEIPT_OF_CONTRIBUTION4_ID, 1)
                st.takeItems(RECEIPT_OF_CONTRIBUTION5_ID, 1)
                if st.getQuestItemsCount(
                        OLD_ACCOUNT_BOOK_ID) and st.getQuestItemsCount(
                            BLESSED_SEED_ID) and st.getQuestItemsCount(
                                RECIPE_OF_EMILLY_ID) and st.getQuestItemsCount(
                                    LILITH_ELVEN_WAFER_ID):
                    st.set("cond", "2")
                    st.playSound("ItemSound.quest_middle")
            else:
                htmltext = "30531-04.htm"
        elif npcId == 30531 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        OLD_ACCOUNT_BOOK_ID) and st.getQuestItemsCount(
                            COLLECTION_LICENSE_ID) == 0:
            htmltext = "30531-06.htm"
        elif npcId == 30531 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY2_ID) == 1:
            htmltext = "30531-07.htm"
        elif npcId == 30532 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE1_ID) and st.getQuestItemsCount(
                                RECEIPT_OF_CONTRIBUTION1_ID
                            ) == 0 and st.getQuestItemsCount(
                                CONTRIBUTION_OF_CHALI_ID) == 0:
            htmltext = "30532-01.htm"
            st.takeItems(LOCKIRINS_NOTICE1_ID, 1)
        elif npcId == 30532 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            RECEIPT_OF_CONTRIBUTION1_ID
                        ) == 0 and st.getQuestItemsCount(
                            CONTRIBUTION_OF_CHALI_ID
                        ) == 0 and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE1_ID) == 0:
            htmltext = "30532-02.htm"
        elif npcId == 30532 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            CONTRIBUTION_OF_CHALI_ID
                        ) and st.getQuestItemsCount(
                            RECEIPT_OF_CONTRIBUTION1_ID
                        ) == 0 and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE1_ID) == 0:
            htmltext = "30532-03.htm"
            st.giveItems(RECEIPT_OF_CONTRIBUTION1_ID, 1)
            st.takeItems(CONTRIBUTION_OF_CHALI_ID, 1)
        elif npcId == 30532 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    CONTRIBUTION_OF_CHALI_ID) == 0 and st.getQuestItemsCount(
                        LOCKIRINS_NOTICE1_ID) == 0 and st.getQuestItemsCount(
                            RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                                COLLECTION_LICENSE_ID
                            ) and st.getQuestItemsCount(
                                RECEIPT_OF_CONTRIBUTION1_ID):
            htmltext = "30532-04.htm"
        elif npcId == 30533 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE2_ID
                        ) and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE2_ID
                        ) == 1 and st.getQuestItemsCount(
                            RECEIPT_OF_CONTRIBUTION2_ID
                        ) == 0 and (
                            st.getQuestItemsCount(CONTRIBUTION_OF_MION_ID) +
                            st.getQuestItemsCount(CONTRIBUTION_OF_MARIFE_ID) <
                            2):
            htmltext = "30533-01.htm"
            st.takeItems(LOCKIRINS_NOTICE2_ID, 1)
        elif npcId == 30533 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE2_ID
                        ) == 0 and st.getQuestItemsCount(
                            RECEIPT_OF_CONTRIBUTION2_ID
                        ) == 0 and (
                            st.getQuestItemsCount(CONTRIBUTION_OF_MION_ID) +
                            st.getQuestItemsCount(CONTRIBUTION_OF_MARIFE_ID) <
                            2):
            htmltext = "30533-02.htm"
        elif npcId == 30533 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            RECEIPT_OF_CONTRIBUTION2_ID
                        ) == 0 and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE2_ID
                        ) == 0 and (
                            st.getQuestItemsCount(CONTRIBUTION_OF_MION_ID) +
                            st.getQuestItemsCount(CONTRIBUTION_OF_MARIFE_ID) >=
                            2):
            htmltext = "30533-03.htm"
            st.takeItems(CONTRIBUTION_OF_MARIFE_ID, 1)
            st.giveItems(RECEIPT_OF_CONTRIBUTION2_ID, 1)
            st.takeItems(CONTRIBUTION_OF_MION_ID, 1)
        elif npcId == 30533 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    LOCKIRINS_NOTICE2_ID) == 0 and st.getQuestItemsCount(
                        RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                            COLLECTION_LICENSE_ID
                        ) and st.getQuestItemsCount(
                            RECEIPT_OF_CONTRIBUTION2_ID
                        ) and (st.getQuestItemsCount(CONTRIBUTION_OF_MION_ID) +
                               st.getQuestItemsCount(CONTRIBUTION_OF_MARIFE_ID)
                               < 2):
            htmltext = "30533-04.htm"
        elif npcId == 30534 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE3_ID) and st.getQuestItemsCount(
                                RECEIPT_OF_CONTRIBUTION3_ID
                            ) == 0 and st.getQuestItemsCount(
                                PROCURATION_OF_TOROCCO_ID) == 0:
            htmltext = "30534-01.htm"
            st.takeItems(LOCKIRINS_NOTICE3_ID, 1)
        elif npcId == 30534 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RECEIPT_OF_CONTRIBUTION3_ID
                ) == 0 and st.getQuestItemsCount(
                    PROCURATION_OF_TOROCCO_ID) == 0 and st.getQuestItemsCount(
                        LOCKIRINS_NOTICE3_ID) == 0 and st.getQuestItemsCount(
                            RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                                COLLECTION_LICENSE_ID):
            htmltext = "30534-02.htm"
        elif npcId == 30534 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            PROCURATION_OF_TOROCCO_ID
                        ) and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE3_ID
                        ) == 0 and st.getQuestItemsCount(
                            RECEIPT_OF_CONTRIBUTION3_ID) == 0:
            htmltext = "30534-03.htm"
        elif npcId == 30534 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            RECEIPT_OF_CONTRIBUTION3_ID
                        ) and st.getQuestItemsCount(
                            PROCURATION_OF_TOROCCO_ID
                        ) == 0 and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE3_ID) == 0:
            htmltext = "30534-04.htm"
        elif npcId == 30535 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE4_ID) and st.getQuestItemsCount(
                                RECEIPT_OF_CONTRIBUTION4_ID
                            ) == 0 and st.getQuestItemsCount(
                                RECEIPT_OF_BOLTER_ID) == 0:
            htmltext = "30535-01.htm"
            st.takeItems(LOCKIRINS_NOTICE4_ID, 1)
        elif npcId == 30535 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RECEIPT_OF_CONTRIBUTION4_ID
                ) == 0 and st.getQuestItemsCount(
                    RECEIPT_OF_BOLTER_ID) == 0 and st.getQuestItemsCount(
                        LOCKIRINS_NOTICE4_ID) == 0 and st.getQuestItemsCount(
                            RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                                COLLECTION_LICENSE_ID):
            htmltext = "30535-02.htm"
        elif npcId == 30535 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            RECEIPT_OF_BOLTER_ID) and st.getQuestItemsCount(
                                RECEIPT_OF_CONTRIBUTION4_ID
                            ) == 0 and st.getQuestItemsCount(
                                LOCKIRINS_NOTICE4_ID) == 0:
            htmltext = "30535-03.htm"
            st.giveItems(RECEIPT_OF_CONTRIBUTION4_ID, 1)
            st.takeItems(RECEIPT_OF_BOLTER_ID, 1)
        elif npcId == 30535 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            RECEIPT_OF_CONTRIBUTION4_ID
                        ) and st.getQuestItemsCount(
                            RECEIPT_OF_BOLTER_ID
                        ) == 0 and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE4_ID) == 0:
            htmltext = "30535-04.htm"
        elif npcId == 30536 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE5_ID) and st.getQuestItemsCount(
                                RECEIPT_OF_CONTRIBUTION5_ID
                            ) == 0 and st.getQuestItemsCount(
                                CONTRIBUTION_OF_TOMA_ID) == 0:
            htmltext = "30536-01.htm"
            st.takeItems(LOCKIRINS_NOTICE5_ID, 1)
        elif npcId == 30536 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RECEIPT_OF_CONTRIBUTION5_ID
                ) == 0 and st.getQuestItemsCount(
                    CONTRIBUTION_OF_TOMA_ID) == 0 and st.getQuestItemsCount(
                        LOCKIRINS_NOTICE5_ID) == 0 and st.getQuestItemsCount(
                            RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                                COLLECTION_LICENSE_ID):
            htmltext = "30536-02.htm"
        elif npcId == 30536 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            CONTRIBUTION_OF_TOMA_ID) and st.getQuestItemsCount(
                                RECEIPT_OF_CONTRIBUTION5_ID
                            ) == 0 and st.getQuestItemsCount(
                                LOCKIRINS_NOTICE5_ID) == 0:
            htmltext = "30536-03.htm"
            st.giveItems(RECEIPT_OF_CONTRIBUTION5_ID, 1)
            st.takeItems(CONTRIBUTION_OF_TOMA_ID, 1)
        elif npcId == 30536 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            RECEIPT_OF_CONTRIBUTION5_ID
                        ) and st.getQuestItemsCount(
                            CONTRIBUTION_OF_TOMA_ID
                        ) == 0 and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE5_ID) == 0:
            htmltext = "30536-04.htm"
        elif npcId == 30517 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RECEIPT_OF_CONTRIBUTION1_ID
                ) == 0 and st.getQuestItemsCount(
                    CONTRIBUTION_OF_CHALI_ID) == 0 and st.getQuestItemsCount(
                        LOCKIRINS_NOTICE1_ID) == 0 and st.getQuestItemsCount(
                            RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                                COLLECTION_LICENSE_ID):
            htmltext = "30517-01.htm"
            st.giveItems(CONTRIBUTION_OF_CHALI_ID, 1)
        elif npcId == 30517 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            CONTRIBUTION_OF_CHALI_ID
                        ) and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE1_ID
                        ) == 0 and st.getQuestItemsCount(
                            RECEIPT_OF_CONTRIBUTION1_ID) == 0:
            htmltext = "30517-02.htm"
        elif npcId == 30519 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RECEIPT_OF_CONTRIBUTION2_ID
                ) == 0 and st.getQuestItemsCount(
                    CONTRIBUTION_OF_MION_ID) == 0 and st.getQuestItemsCount(
                        LOCKIRINS_NOTICE2_ID) == 0 and st.getQuestItemsCount(
                            RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                                COLLECTION_LICENSE_ID):
            htmltext = "30519-01.htm"
            st.giveItems(CONTRIBUTION_OF_MION_ID, 1)
        elif npcId == 30519 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            CONTRIBUTION_OF_MION_ID) and st.getQuestItemsCount(
                                RECEIPT_OF_CONTRIBUTION2_ID
                            ) == 0 and st.getQuestItemsCount(
                                LOCKIRINS_NOTICE2_ID) == 0:
            htmltext = "30519-02.htm"
        elif npcId == 30553 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RECEIPT_OF_CONTRIBUTION2_ID
                ) == 0 and st.getQuestItemsCount(
                    CONTRIBUTION_OF_MARIFE_ID) == 0 and st.getQuestItemsCount(
                        LOCKIRINS_NOTICE2_ID) == 0 and st.getQuestItemsCount(
                            MARIFES_REQUEST_ID) == 0 and st.getQuestItemsCount(
                                RING_OF_TESTIMONY1_ID
                            ) and st.getQuestItemsCount(COLLECTION_LICENSE_ID):
            htmltext = "30553-01.htm"
            st.giveItems(MARIFES_REQUEST_ID, 1)
        elif npcId == 30553 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            MARIFES_REQUEST_ID) and st.getQuestItemsCount(
                                RECEIPT_OF_CONTRIBUTION2_ID
                            ) == 0 and st.getQuestItemsCount(
                                CONTRIBUTION_OF_MARIFE_ID
                            ) == 0 and st.getQuestItemsCount(
                                LOCKIRINS_NOTICE2_ID) == 0:
            if st.getQuestItemsCount(ANIMAL_SKIN_ID) < 100:
                htmltext = "30553-02.htm"
            else:
                htmltext = "30553-03.htm"
                st.takeItems(ANIMAL_SKIN_ID, 100)
                st.giveItems(CONTRIBUTION_OF_MARIFE_ID, 1)
                st.takeItems(MARIFES_REQUEST_ID, 1)
        elif npcId == 30553 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            CONTRIBUTION_OF_MARIFE_ID
                        ) and st.getQuestItemsCount(
                            RECEIPT_OF_CONTRIBUTION2_ID
                        ) == 0 and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE2_ID
                        ) == 0 and st.getQuestItemsCount(
                            MARIFES_REQUEST_ID) == 0:
            htmltext = "30553-04.htm"
        elif npcId == 30555 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RECEIPT_OF_CONTRIBUTION3_ID
                ) == 0 and st.getQuestItemsCount(
                    PROCURATION_OF_TOROCCO_ID) == 0 and st.getQuestItemsCount(
                        LOCKIRINS_NOTICE3_ID) == 0 and st.getQuestItemsCount(
                            RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                                COLLECTION_LICENSE_ID):
            htmltext = "30555-01.htm"
        elif npcId == 30555 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            PROCURATION_OF_TOROCCO_ID
                        ) and st.getQuestItemsCount(
                            RECEIPT_OF_CONTRIBUTION3_ID
                        ) == 0 and st.getQuestItemsCount(
                            LOCKIRINS_NOTICE3_ID) == 0:
            htmltext = "30555-03.htm"
        elif npcId == 30554 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RECEIPT_OF_CONTRIBUTION4_ID
                ) == 0 and st.getQuestItemsCount(
                    RECEIPT_OF_BOLTER_ID) == 0 and st.getQuestItemsCount(
                        LOCKIRINS_NOTICE4_ID) == 0 and st.getQuestItemsCount(
                            RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                                COLLECTION_LICENSE_ID):
            htmltext = "30554-01.htm"
            st.giveItems(RECEIPT_OF_BOLTER_ID, 1)
        elif npcId == 30554 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            RECEIPT_OF_BOLTER_ID) and st.getQuestItemsCount(
                                RECEIPT_OF_CONTRIBUTION4_ID
                            ) == 0 and st.getQuestItemsCount(
                                LOCKIRINS_NOTICE4_ID) == 0:
            htmltext = "30554-02.htm"
        elif npcId == 30556 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RECEIPT_OF_CONTRIBUTION5_ID
                ) == 0 and st.getQuestItemsCount(
                    CONTRIBUTION_OF_TOMA_ID) == 0 and st.getQuestItemsCount(
                        LOCKIRINS_NOTICE5_ID) == 0 and st.getQuestItemsCount(
                            RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                                COLLECTION_LICENSE_ID):
            htmltext = "30556-01.htm"
            st.giveItems(CONTRIBUTION_OF_TOMA_ID, 1)
        elif npcId == 30556 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        COLLECTION_LICENSE_ID) and st.getQuestItemsCount(
                            CONTRIBUTION_OF_TOMA_ID) and st.getQuestItemsCount(
                                RECEIPT_OF_CONTRIBUTION5_ID
                            ) == 0 and st.getQuestItemsCount(
                                LOCKIRINS_NOTICE5_ID) == 0:
            htmltext = "30556-02.htm"
        elif npcId == 30597 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) == 1 and st.getQuestItemsCount(
                        BLESSED_SEED_ID) == 0:
            htmltext = "30597-01.htm"
        elif npcId == 30597 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) == 1 and st.getQuestItemsCount(
                        BLESSED_SEED_ID) == 1:
            htmltext = "30597-03.htm"
        elif npcId == 30597 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY2_ID) == 1:
            htmltext = "30597-04.htm"
        elif npcId == 30005 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) == 1 and st.getQuestItemsCount(
                        LILITH_ELVEN_WAFER_ID) == 0 and st.getQuestItemsCount(
                            CRYSTAL_BROOCH_ID) == 0:
            htmltext = "30005-01.htm"
        elif npcId == 30005 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    LILITH_ELVEN_WAFER_ID) == 0 and st.getQuestItemsCount(
                        RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                            CRYSTAL_BROOCH_ID):
            htmltext = "30005-05.htm"
        elif npcId == 30005 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        LILITH_ELVEN_WAFER_ID):
            htmltext = "30005-06.htm"
        elif npcId == 30005 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY2_ID) == 1:
            htmltext = "30005-07.htm"
        elif npcId == 30368 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    CRYSTAL_BROOCH_ID) and st.getQuestItemsCount(
                        RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                            LILITH_ELVEN_WAFER_ID) == 0:
            htmltext = "30368-01.htm"
        elif npcId == 30368 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        LILITH_ELVEN_WAFER_ID) and st.getQuestItemsCount(
                            CRYSTAL_BROOCH_ID) == 0:
            htmltext = "30368-04.htm"
        elif npcId == 30368 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY2_ID) == 1:
            htmltext = "30368-05.htm"
        elif npcId == 30466 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) == 1 and st.getQuestItemsCount(
                        RECIPE_OF_EMILLY_ID) == 0 and st.getQuestItemsCount(
                            BRIGHTS_LIST_ID) == 0 and st.getQuestItemsCount(
                                MANDRAGORA_BOUQUET_ID) == 0:
            htmltext = "30466-01.htm"
        elif npcId == 30466 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RECIPE_OF_EMILLY_ID) == 0 and st.getQuestItemsCount(
                        RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                            BRIGHTS_LIST_ID):
            if st.getQuestItemsCount(
                    MANDRAGORA_PETAL_ID) < 20 or st.getQuestItemsCount(
                        CRIMSON_MOSS_ID) < 10:
                htmltext = "30466-04.htm"
            else:
                htmltext = "30466-05.htm"
                st.takeItems(MANDRAGORA_PETAL_ID,
                             st.getQuestItemsCount(MANDRAGORA_PETAL_ID))
                st.takeItems(CRIMSON_MOSS_ID,
                             st.getQuestItemsCount(CRIMSON_MOSS_ID))
                st.giveItems(MANDRAGORA_BOUQUET_ID, 1)
                st.takeItems(BRIGHTS_LIST_ID, 1)
        elif npcId == 30466 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        MANDRAGORA_BOUQUET_ID) and st.getQuestItemsCount(
                            RECIPE_OF_EMILLY_ID
                        ) == 0 and st.getQuestItemsCount(BRIGHTS_LIST_ID) == 0:
            htmltext = "30466-06.htm"
        elif npcId == 30466 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        RECIPE_OF_EMILLY_ID):
            htmltext = "30466-07.htm"
        elif npcId == 30466 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY2_ID) == 1:
            htmltext = "30466-08.htm"
        elif npcId == 30620 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        MANDRAGORA_BOUQUET_ID) and st.getQuestItemsCount(
                            RECIPE_OF_EMILLY_ID
                        ) == 0 and st.getQuestItemsCount(BRIGHTS_LIST_ID) == 0:
            htmltext = "30620-01.htm"
        elif npcId == 30620 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY1_ID) and st.getQuestItemsCount(
                        RECIPE_OF_EMILLY_ID):
            htmltext = "30620-04.htm"
        elif npcId == 30620 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY2_ID) == 1:
            htmltext = "30620-05.htm"
        elif npcId == 30621 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY2_ID) == 1 and st.getQuestItemsCount(
                        CLAY_DOUGH_ID) == 0 and st.getQuestItemsCount(
                            PATTERN_OF_KEYHOLE_ID
                        ) == 0 and st.getQuestItemsCount(
                            NIKOLAS_LIST_ID) == 0 and st.getQuestItemsCount(
                                MAPHR_TABLET_FRAGMENT_ID) == 0:
            htmltext = "30621-01.htm"
        elif npcId == 30621 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY2_ID) and st.getQuestItemsCount(
                        CLAY_DOUGH_ID) and st.getQuestItemsCount(
                            PATTERN_OF_KEYHOLE_ID
                        ) == 0 and st.getQuestItemsCount(
                            NIKOLAS_LIST_ID) == 0 and st.getQuestItemsCount(
                                MAPHR_TABLET_FRAGMENT_ID) == 0:
            htmltext = "30621-05.htm"
        elif npcId == 30621 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY2_ID) and st.getQuestItemsCount(
                        PATTERN_OF_KEYHOLE_ID) and st.getQuestItemsCount(
                            CLAY_DOUGH_ID) == 0 and st.getQuestItemsCount(
                                NIKOLAS_LIST_ID
                            ) == 0 and st.getQuestItemsCount(
                                MAPHR_TABLET_FRAGMENT_ID) == 0:
            htmltext = "30621-06.htm"
            st.giveItems(NIKOLAS_LIST_ID, 1)
            st.takeItems(PATTERN_OF_KEYHOLE_ID, 1)
            st.giveItems(RP_TITAN_KEY_ID, 1)
            st.takeItems(PARMANS_LETTER_ID, 1)
            st.set("cond", "7")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30621 and st.getInt(
                "cond"
        ) >= 1 and st.getQuestItemsCount(
                RING_OF_TESTIMONY2_ID
        ) and st.getQuestItemsCount(NIKOLAS_LIST_ID) and st.getQuestItemsCount(
                CLAY_DOUGH_ID) == 0 and st.getQuestItemsCount(
                    PATTERN_OF_KEYHOLE_ID) == 0 and st.getQuestItemsCount(
                        MAPHR_TABLET_FRAGMENT_ID
                    ) == 0 and st.getQuestItemsCount(KEY_OF_TITAN_ID) == 0:
            htmltext = "30621-07.htm"
        elif npcId == 30621 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY2_ID) and st.getQuestItemsCount(
                        NIKOLAS_LIST_ID) and st.getQuestItemsCount(
                            KEY_OF_TITAN_ID) and st.getQuestItemsCount(
                                CLAY_DOUGH_ID) == 0 and st.getQuestItemsCount(
                                    PATTERN_OF_KEYHOLE_ID
                                ) == 0 and st.getQuestItemsCount(
                                    MAPHR_TABLET_FRAGMENT_ID) == 0:
            htmltext = "30621-08.htm"
        elif npcId == 30621 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY2_ID) and st.getQuestItemsCount(
                        MAPHR_TABLET_FRAGMENT_ID) and st.getQuestItemsCount(
                            CLAY_DOUGH_ID) == 0 and st.getQuestItemsCount(
                                PATTERN_OF_KEYHOLE_ID
                            ) == 0 and st.getQuestItemsCount(
                                NIKOLAS_LIST_ID) == 0:
            htmltext = "30621-09.htm"
        elif npcId == 30622 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY2_ID) and st.getQuestItemsCount(
                        CLAY_DOUGH_ID) and st.getQuestItemsCount(
                            PATTERN_OF_KEYHOLE_ID) == 0:
            htmltext = "30622-01.htm"
        elif npcId == 30622 and st.getInt(
                "cond") >= 1 and st.getQuestItemsCount(
                    RING_OF_TESTIMONY2_ID) and st.getQuestItemsCount(
                        KEY_OF_TITAN_ID) and st.getQuestItemsCount(
                            MAPHR_TABLET_FRAGMENT_ID) == 0:
            htmltext = "30622-03.htm"
        return htmltext
Beispiel #14
0
 def onEvent(self, event, st):
     htmltext = event
     player = st.getPlayer()
     if event == "1":
         st.set("id", "0")
         st.set("cond", "1")
         st.setState(State.STARTED)
         st.playSound("ItemSound.quest_accept")
         htmltext = "30585-06.htm"
         st.giveItems(FIRE_CHARM, 1)
     elif event == "32057_1":
         htmltext = "32057-02.htm"
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "14")
     elif event == "32057_2":
         htmltext = "32057-05.htm"
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "21")
     elif event == "32090_1":
         htmltext = "32090-04.htm"
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "18")
     elif event == "30585_1":
         if player.getClassId().getId() != 0x31:
             if player.getClassId().getId() == 0x32:
                 htmltext = "30585-02a.htm"
             else:
                 htmltext = "30585-02.htm"
         else:
             if player.getLevel() < 18:
                 htmltext = "30585-03.htm"
             else:
                 if st.getQuestItemsCount(MASK_OF_MEDIUM) != 0:
                     htmltext = "30585-04.htm"
                 else:
                     htmltext = "30585-05.htm"
                     return htmltext
     elif event == "30585_1a":
         htmltext = "30585-10a.htm"
     elif event == "30585_2":
         htmltext = "30585-11.htm"
         st.takeItems(TOTEM_SPIRIT_CLAW, 1)
         st.giveItems(TATARUS_LETTER, 1)
         st.set("cond", "5")
         st.playSound("ItemSound.quest_middle")
     elif event == "30585_3":
         htmltext = "30585-11a.htm"
         st.takeItems(TOTEM_SPIRIT_CLAW, 1)
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "12")
     elif event == "30592_1":
         htmltext = "30592-02.htm"
     elif event == "30592_2":
         htmltext = "30592-03.htm"
         st.takeItems(HESTUI_MASK, 1)
         st.takeItems(FIERY_EGG2, 1)
         st.giveItems(TOTEM_SPIRIT_CLAW, 1)
         st.set("cond", "4")
         st.playSound("ItemSound.quest_middle")
     elif event == "30502_2":
         htmltext = "30502-07.htm"
         st.takeItems(TOTEM_SPIRIT_BLOOD,
                      st.getQuestItemsCount(TOTEM_SPIRIT_BLOOD))
         st.giveItems(MASK_OF_MEDIUM, 1)
         isFinished = st.getGlobalQuestVar("1ClassQuestFinished")
         if isFinished == "":
             st.giveItems(57, 81900)
             st.addExpAndSp(295862, 18194)
         player.sendPacket(SocialAction(player.getObjectId(), 3))
         player.sendPacket(SocialAction(player.getObjectId(), 15))
         st.set("cond", "0")
         st.exitQuest(False)
         st.saveGlobalQuestVar("1ClassQuestFinished", "1")
         st.playSound("ItemSound.quest_finish")
     elif event == "30593_1":
         htmltext = "30593-02.htm"
     elif event == "30593_2":
         htmltext = "30593-03.htm"
         st.takeItems(BLOOD_CAULDRON, 1)
         st.giveItems(SPIRIT_NET, 1)
         st.set("cond", "9")
         st.playSound("ItemSound.quest_middle")
     return htmltext
Beispiel #15
0
 def onAdvEvent(self, event, npc, player):
     htmltext = event
     st = player.getQuestState(qn)
     if not st: return
     if event == "1":
         htmltext = "30103-06.htm"
         st.set("cond", "1")
         st.setState(State.STARTED)
         st.playSound("ItemSound.quest_accept")
         st.giveItems(VALKONS_RECOMMEND_ID, 1)
         st.takeItems(ADENA_ID, 2000)
     elif event == "30103_1":
         htmltext = "30103-04.htm"
     elif event == "30103_2":
         if st.getQuestItemsCount(ADENA_ID) >= 2000:
             htmltext = "30103-05.htm"
         else:
             htmltext = "30103-05a.htm"
     elif event == "30103_3":
         htmltext = "30103-09a.htm"
         st.set("cond", "0")
         st.set("onlyone", "1")
         st.exitQuest(False)
         st.playSound("ItemSound.quest_finish")
         st.addExpAndSp(514739, 33384)
         st.giveItems(57, 93803)
         st.giveItems(7562, 85)
         st.takeItems(JOURNEYMAN_RING_ID, -1)
         st.takeItems(ALLTRANS_INSTRUCTIONS_ID, 1)
         st.takeItems(RP_JOURNEYMAN_RING_ID, 1)
         st.giveItems(MARK_OF_GUILDSMAN_ID, 1)
         st.getPlayer().sendPacket(
             SocialAction(st.getPlayer().getObjectId(), 3))
     elif event == "30103_4":
         st.addExpAndSp(514739, 33384)
         st.giveItems(57, 93803)
         st.giveItems(7562, 85)
         htmltext = "30103-09b.htm"
         st.set("cond", "0")
         st.set("onlyone", "1")
         st.exitQuest(False)
         st.playSound("ItemSound.quest_finish")
         st.takeItems(JOURNEYMAN_RING_ID, -1)
         st.takeItems(ALLTRANS_INSTRUCTIONS_ID, 1)
         st.takeItems(RP_JOURNEYMAN_RING_ID, 1)
         st.giveItems(MARK_OF_GUILDSMAN_ID, 1)
         st.getPlayer().sendPacket(
             SocialAction(st.getPlayer().getObjectId(), 3))
     elif event == "30283_1":
         htmltext = "30283-03.htm"
         st.giveItems(ALLTRANS_INSTRUCTIONS_ID, 1)
         st.takeItems(VALKONS_RECOMMEND_ID, 1)
         st.giveItems(RP_JOURNEYMAN_RING_ID, 1)
         st.takeItems(MANDRAGORA_BERRY_ID, 1)
         st.giveItems(ALLTRANS_RECOMMEND1_ID, 1)
         st.giveItems(ALLTRANS_RECOMMEND2_ID, 1)
         st.playSound("ItemSound.quest_middle")
         st.set("cond", "5")
     elif event == "30210_1":
         htmltext = "30210-02.htm"
     elif event == "30210_2":
         htmltext = "30210-03.htm"
     elif event == "30210_3":
         htmltext = "30210-04.htm"
         st.giveItems(NORMANS_INSTRUCTIONS_ID, 1)
         st.takeItems(ALLTRANS_RECOMMEND1_ID, 1)
         st.giveItems(NORMANS_RECEIPT_ID, 1)
     elif event == "30210_4":
         htmltext = "30210-08.htm"
     elif event == "30210_5":
         htmltext = "30210-09.htm"
     elif event == "30210_6":
         htmltext = "30210-10.htm"
         st.takeItems(DUNINGS_KEY_ID, st.getQuestItemsCount(DUNINGS_KEY_ID))
         st.giveItems(NORMANS_LIST_ID, 1)
         st.takeItems(NORMANS_INSTRUCTIONS_ID, 1)
     elif event == "30688_1":
         htmltext = "30688-02.htm"
         st.giveItems(DUNINGS_INSTRUCTIONS_ID, 1)
         st.takeItems(NORMANS_RECEIPT_ID, 1)
     elif event == "30298_1":
         htmltext = "30298-03.htm"
     elif event == "30298_2":
         if st.getPlayer().getClassId().getId() == 0x36:
             htmltext = "30298-04.htm"
             st.giveItems(PINTERS_INSTRUCTIONS_ID, 1)
             st.takeItems(ALLTRANS_RECOMMEND2_ID, 1)
         else:
             htmltext = "30298-05.htm"
             st.giveItems(RP_AMBER_BEAD_ID, 1)
             st.takeItems(ALLTRANS_RECOMMEND2_ID, 1)
             st.giveItems(PINTERS_INSTRUCTIONS_ID, 1)
     return htmltext
Beispiel #16
0
    def onTalk(self, npc, player):
        htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
        st = player.getQuestState(qn)
        if not st: return htmltext

        npcId = npc.getNpcId()
        id = st.getState()
        if npcId != 30022 and id != State.STARTED: return htmltext

        npcId = npc.getNpcId()
        htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
        id = st.getState()
        if npcId == 30022 and st.getInt("cond") == 0:
            if st.getQuestItemsCount(MARK_OF_FAITH) == 0:
                htmltext = "30022-01.htm"
                return htmltext
            else:
                htmltext = "30022-04.htm"
        elif npcId == 30022 and st.getInt("cond") and st.getQuestItemsCount(
                LETTER_OF_ORDER2) == 1 and st.getQuestItemsCount(
                    LEMONIELLS_COVENANT) == 0:
            htmltext = "30022-07.htm"
        elif npcId == 30022 and st.getInt("cond") and st.getQuestItemsCount(
                LETTER_OF_ORDER2) == 1 and st.getQuestItemsCount(
                    LEMONIELLS_COVENANT) == 1:
            htmltext = "30022-09.htm"
            st.takeItems(LETTER_OF_ORDER2, 1)
            st.takeItems(LEMONIELLS_COVENANT, 1)
            st.giveItems(MARK_OF_FAITH, 1)
            isFinished = st.getGlobalQuestVar("1ClassQuestFinished")
            if isFinished == "":
                st.addExpAndSp(295862, 17664)
                st.giveItems(57, 81900)
            st.set("cond", "0")
            st.exitQuest(False)
            st.saveGlobalQuestVar("1ClassQuestFinished", "1")
            st.playSound("ItemSound.quest_finish")
            player.sendPacket(SocialAction(player.getObjectId(), 3))
        elif npcId == 30022 and st.getInt("cond") and st.getQuestItemsCount(
                LETTER_OF_ORDER1) == 1:
            if st.getQuestItemsCount(
                    BOOK_OF_VIVI) == 1 and st.getQuestItemsCount(
                        BOOK_OF_SIMLON) > 0 and st.getQuestItemsCount(
                            BOOK_OF_PRAGA) == 1:
                htmltext = "30022-08.htm"
                st.takeItems(BOOK_OF_PRAGA, 1)
                st.takeItems(BOOK_OF_VIVI, 1)
                st.takeItems(BOOK_OF_SIMLON, 3)
                st.takeItems(LETTER_OF_ORDER1, 1)
                st.giveItems(LETTER_OF_ORDER2, 1)
                st.set("cond", "3")
            else:
                htmltext = "30022-06.htm"
        elif npcId == 30253 and st.getInt("cond") and st.getQuestItemsCount(
                LETTER_OF_ORDER1) == 1:
            if st.getQuestItemsCount(BOOK_OF_SIMLON) == 0:
                htmltext = "30253-01.htm"
                st.giveItems(BOOK_OF_SIMLON, 3)
            elif st.getQuestItemsCount(BOOK_OF_SIMLON) > 0:
                htmltext = "30253-02.htm"
        elif npcId == 30030 and st.getInt("cond") and st.getQuestItemsCount(
                LETTER_OF_ORDER1) == 1:
            if st.getQuestItemsCount(BOOK_OF_VIVI) == 0:
                htmltext = "30030-01.htm"
                st.giveItems(BOOK_OF_VIVI, 1)
            elif st.getQuestItemsCount(BOOK_OF_VIVI) == 1:
                htmltext = "30030-02.htm"
        elif npcId == 30333 and st.getInt("cond") and st.getQuestItemsCount(
                LETTER_OF_ORDER1) == 1:
            if st.getQuestItemsCount(
                    BOOK_OF_PRAGA) == 0 and st.getQuestItemsCount(
                        NECKLACE_OF_MOTHER) == 0:
                htmltext = "30333-01.htm"
                st.giveItems(NECKLACE_OF_MOTHER, 1)
            elif st.getQuestItemsCount(
                    BOOK_OF_PRAGA) == 0 and st.getQuestItemsCount(
                        NECKLACE_OF_MOTHER) == 1 and st.getQuestItemsCount(
                            PENDANT_OF_MOTHER) == 0:
                htmltext = "30333-02.htm"
            elif st.getQuestItemsCount(
                    BOOK_OF_PRAGA) == 0 and st.getQuestItemsCount(
                        NECKLACE_OF_MOTHER) == 1 and st.getQuestItemsCount(
                            PENDANT_OF_MOTHER) == 1:
                htmltext = "30333-03.htm"
                st.takeItems(NECKLACE_OF_MOTHER, 1)
                st.takeItems(PENDANT_OF_MOTHER, 1)
                st.giveItems(BOOK_OF_PRAGA, 1)
                st.set("cond", "2")
            elif st.getQuestItemsCount(BOOK_OF_PRAGA) > 0:
                htmltext = "30333-04.htm"
        elif npcId == 30408 and st.getInt("cond"):
            if st.getQuestItemsCount(LETTER_OF_ORDER2) == 0:
                htmltext = "30408-02.htm"
            elif st.getQuestItemsCount(
                    LETTER_OF_ORDER2) == 1 and st.getQuestItemsCount(
                        BOOK_OF_LEMONIELL) == 0 and st.getQuestItemsCount(
                            LEMONIELLS_COVENANT
                        ) == 0 and st.getQuestItemsCount(
                            CERTIFICATE_OF_GALLINT) == 0:
                htmltext = "30408-01.htm"
                st.giveItems(BOOK_OF_LEMONIELL, 1)
                st.set("cond", "4")
            elif st.getQuestItemsCount(
                    LETTER_OF_ORDER2) == 1 and st.getQuestItemsCount(
                        BOOK_OF_LEMONIELL) == 1 and st.getQuestItemsCount(
                            LEMONIELLS_COVENANT
                        ) == 0 and st.getQuestItemsCount(
                            CERTIFICATE_OF_GALLINT) == 0:
                htmltext = "30408-03.htm"
            elif st.getQuestItemsCount(
                    LETTER_OF_ORDER2) == 1 and st.getQuestItemsCount(
                        BOOK_OF_LEMONIELL) == 0 and st.getQuestItemsCount(
                            LEMONIELLS_COVENANT
                        ) == 0 and st.getQuestItemsCount(
                            CERTIFICATE_OF_GALLINT) == 1:
                htmltext = "30408-04.htm"
                st.takeItems(CERTIFICATE_OF_GALLINT, 1)
                st.giveItems(LEMONIELLS_COVENANT, 1)
                st.set("cond", "6")
            elif st.getQuestItemsCount(
                    LETTER_OF_ORDER2) == 1 and st.getQuestItemsCount(
                        BOOK_OF_LEMONIELL) == 0 and st.getQuestItemsCount(
                            LEMONIELLS_COVENANT
                        ) == 1 and st.getQuestItemsCount(
                            CERTIFICATE_OF_GALLINT) == 0:
                htmltext = "30408-05.htm"
        elif npcId == 30017 and st.getInt("cond") and st.getQuestItemsCount(
                LETTER_OF_ORDER2) == 1 and st.getQuestItemsCount(
                    LEMONIELLS_COVENANT) == 0:
            if st.getQuestItemsCount(
                    BOOK_OF_LEMONIELL) == 1 and st.getQuestItemsCount(
                        CERTIFICATE_OF_GALLINT) == 0:
                htmltext = "30017-01.htm"
                st.takeItems(BOOK_OF_LEMONIELL, 1)
                st.giveItems(CERTIFICATE_OF_GALLINT, 1)
                st.set("cond", "5")
            elif st.getQuestItemsCount(
                    BOOK_OF_LEMONIELL) == 0 and st.getQuestItemsCount(
                        CERTIFICATE_OF_GALLINT) == 1:
                htmltext = "30017-02.htm"
        return htmltext
Beispiel #17
0
    def onTalk(self, npc, player):
        htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
        st = player.getQuestState(qn)
        if not st: return htmltext
        cond = st.getInt("cond")
        npcId = npc.getNpcId()
        id = st.getState()
        if npcId != 30690 and id != State.STARTED: return htmltext

        if id == State.COMPLETED:
            htmltext = "<html><body>這是已經完成的任務。</body></html>"

        elif id == State.CREATED:
            st.set("cond", "0")
            if npcId == NPC[3]:
                if player.getClassId().getId() in [0x07, 0x16, 0x23, 0x36]:
                    if player.getLevel() > 38:
                        if player.getClassId().getId() == 0x36:
                            htmltext = "30690-04.htm"
                        else:
                            htmltext = "30690-03.htm"
                    else:
                        htmltext = "30690-02.htm"
                        st.exitQuest(1)
                else:
                    htmltext = "30690-01.htm"
                    st.exitQuest(1)
        else:
            if npcId == NPC[3]:
                if cond == 1:
                    htmltext = "30690-06.htm"
                elif cond > 1 and cond < 19:
                    htmltext = "30690-07.htm"
                elif cond == 19:
                    st.addExpAndSp(447444, 30704)
                    st.giveItems(57, 80903)
                    st.giveItems(7562, 82)
                    htmltext = "30690-08.htm"
                    st.set("cond", "0")
                    st.exitQuest(False)
                    st.playSound("ItemSound.quest_finish")
                    st.takeItems(ALANKELLS_RECOMMEND, 1)
                    st.giveItems(MARK_OF_SEARCHER, 1)
                    st.getPlayer().sendPacket(
                        SocialAction(st.getPlayer().getObjectId(), 3))
            elif npcId == NPC[0]:
                if cond == 1:
                    htmltext = "30291-01.htm"
                    st.takeItems(LUTHERS_LETTER, 1)
                    st.giveItems(ALANKELLS_WARRANT, 1)
                    st.set("cond", "2")
                    st.playSound("ItemSound.quest_middle")
                elif cond == 2:
                    htmltext = "30291-02.htm"
                elif cond > 2 and cond < 7:
                    htmltext = "30291-03.htm"
                elif cond == 7:
                    htmltext = "30291-04.htm"
                elif cond == 8:
                    htmltext = "30291-08.htm"
                elif cond == 13 or cond == 14:
                    htmltext = "30291-09.htm"
                elif cond == 16:
                    htmltext = "30291-10.htm"
                elif cond == 18:
                    htmltext = "30291-11.htm"
                    st.takeItems(ALANKELLS_ORDER, 1)
                    st.takeItems(COMBINED_MAP, 1)
                    st.takeItems(GOLD_BAR, -1)
                    st.giveItems(ALANKELLS_RECOMMEND, 1)
                    st.set("cond", "19")
                    st.playSound("ItemSound.quest_middle")
                elif cond == 19:
                    htmltext = "30291-12.htm"
            elif npcId == NPC[4]:
                if cond == 2:
                    htmltext = "30728-01.htm"
                    st.takeItems(ALANKELLS_WARRANT, 1)
                    st.giveItems(LEIRYNNS_ORDER1, 1)
                    st.set("cond", "3")
                    st.playSound("ItemSound.quest_middle")
                elif cond == 3:
                    htmltext = "30728-02.htm"
                elif cond == 4:
                    htmltext = "30728-03.htm"
                    st.takeItems(DELU_TOTEM, -1)
                    st.takeItems(LEIRYNNS_ORDER1, 1)
                    st.giveItems(LEIRYNNS_ORDER2, 1)
                    st.set("cond", "5")
                    st.playSound("ItemSound.quest_middle")
                elif cond == 5:
                    htmltext = "30728-04.htm"
                elif cond == 6:
                    htmltext = "30728-05.htm"
                    st.takeItems(CHIEF_KALKIS_FANG, 1)
                    st.takeItems(LEIRYNNS_ORDER2, 1)
                    st.giveItems(LEIRYNNS_REPORT, 1)
                    st.set("cond", "7")
                    st.playSound("ItemSound.quest_middle")
                elif cond == 7:
                    htmltext = "30728-06.htm"
                elif cond == 8:
                    htmltext = "30728-07.htm"
            elif npcId == NPC[5]:
                if cond == 8:
                    htmltext = "30729-01.htm"
                    st.takeItems(ALANKELLS_LETTER, 1)
                    st.giveItems(WINE_CATALOG, 1)
                    st.set("cond", "9")
                    st.playSound("ItemSound.quest_middle")
                elif cond == 9:
                    htmltext = "30729-02.htm"
                elif cond == 12:
                    htmltext = "30729-03.htm"
                    st.takeItems(WINE_CATALOG, 1)
                    st.takeItems(MALRUKIAN_WINE, 1)
                    st.set("cond", "13")
                    st.playSound("ItemSound.quest_middle")
                    st.giveItems(OLD_ORDER, 1)
                elif cond == 13:
                    htmltext = "30729-04.htm"
                elif cond in [8, 14]:
                    htmltext = "30729-05.htm"
            elif npcId == NPC[1]:
                if cond == 10:
                    htmltext = "30420-02.htm"
                elif cond == 11:
                    htmltext = "30420-03.htm"
                    st.takeItems(TWEETYS_CONTRACT, 1)
                    st.takeItems(RED_SPORE_DUST, -1)
                    st.set("cond", "12")
                    st.playSound("ItemSound.quest_middle")
                    st.giveItems(MALRUKIAN_WINE, 1)
                elif cond in [12, 13]:
                    htmltext = "30420-04.htm"
                elif cond == 9:
                    htmltext = "30420-01.htm"
            elif npcId == NPC[6]:
                if cond == 13:
                    htmltext = "30730-01.htm"
                elif cond == 14:
                    htmltext = "30730-02.htm"
                elif cond == 15:
                    htmltext = "30730-03.htm"
                    st.takeItems(LAMBERTS_MAP, 1)
                    st.takeItems(TORN_MAP_PIECE2, 4)
                    st.takeItems(TORN_MAP_PIECE1, 4)
                    st.takeItems(REXS_DIARY, 1)
                    st.takeItems(SOLTS_MAP, 1)
                    st.takeItems(MAKELS_MAP, 1)
                    st.set("cond", "16")
                    st.giveItems(COMBINED_MAP, 1)
                elif cond > 15:
                    htmltext = "30730-04.htm"
            elif npcId == NPC[7] and cond == 16:
                htmltext = "30627-01.htm"
            elif npcId == NPC[2]:
                if cond == 17:
                    htmltext = "30628-01.htm"
                else:
                    htmltext = "<html><body>You haven't got a Key for this Chest.</body></html>"
        return htmltext
Beispiel #18
0
    def onTalk(self, npc, player):
        htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
        st = player.getQuestState(qn)
        if not st: return htmltext
        npcId = npc.getNpcId()
        id = st.getState()
        cond = st.getInt("cond")
        if npcId != 30587 and id != State.STARTED: return htmltext

        if npcId == 30587 and st.getInt("cond") == 0 and st.getInt(
                "onlyone") == 0:
            htmltext = "30587-01.htm"
        elif npcId == 30587 and st.getInt("cond") == 0 and st.getInt(
                "onlyone") == 1:
            htmltext = "30587-04.htm"
        elif npcId == 30587 and st.getInt("cond") and st.getQuestItemsCount(
                SCROLL_FIERY_SPIRIT) == 0 and st.getQuestItemsCount(
                    POMEGRANATE) == 1 and st.getQuestItemsCount(
                        GANTAKIS_LETTER) == 0 and st.getQuestItemsCount(
                            ROSHEEKS_LETTER) == 0 and (
                                (st.getQuestItemsCount(LEATHER_POUCH1) +
                                 st.getQuestItemsCount(LEATHER_POUCH2) +
                                 st.getQuestItemsCount(LEATHER_POUCH3) +
                                 st.getQuestItemsCount(LEATHER_POUCH1FULL) +
                                 st.getQuestItemsCount(LEATHER_POUCH2FULL) +
                                 st.getQuestItemsCount(LEATHER_POUCH3FULL))
                                == 0):
            htmltext = "30587-07.htm"
        elif npcId == 30587 and st.getInt("cond") and st.getQuestItemsCount(
                SCROLL_FIERY_SPIRIT) == 0 and st.getQuestItemsCount(
                    POMEGRANATE) == 0 and st.getQuestItemsCount(
                        GANTAKIS_LETTER) == 0 and st.getQuestItemsCount(
                            ROSHEEKS_LETTER) == 0 and (
                                (st.getQuestItemsCount(LEATHER_POUCH1) +
                                 st.getQuestItemsCount(LEATHER_POUCH2) +
                                 st.getQuestItemsCount(LEATHER_POUCH3) +
                                 st.getQuestItemsCount(LEATHER_POUCH1FULL) +
                                 st.getQuestItemsCount(LEATHER_POUCH2FULL) +
                                 st.getQuestItemsCount(LEATHER_POUCH3FULL))
                                == 1):
            htmltext = "30587-08.htm"
        elif npcId == 30587 and st.getInt("cond") and st.getQuestItemsCount(
                SCROLL_FIERY_SPIRIT) == 1 and st.getQuestItemsCount(
                    POMEGRANATE) == 0 and st.getQuestItemsCount(
                        GANTAKIS_LETTER) == 0 and st.getQuestItemsCount(
                            ROSHEEKS_LETTER) == 1 and (
                                (st.getQuestItemsCount(LEATHER_POUCH1) +
                                 st.getQuestItemsCount(LEATHER_POUCH2) +
                                 st.getQuestItemsCount(LEATHER_POUCH3) +
                                 st.getQuestItemsCount(LEATHER_POUCH1FULL) +
                                 st.getQuestItemsCount(LEATHER_POUCH2FULL) +
                                 st.getQuestItemsCount(LEATHER_POUCH3FULL))
                                == 0):
            htmltext = "30587-09.htm"
        elif npcId == 30587 and st.getInt("cond") >= 14:
            htmltext = "30587-09b.htm"
        elif npcId == 30587 and st.getInt("cond") and st.getQuestItemsCount(
                SCROLL_FIERY_SPIRIT) == 1 and st.getQuestItemsCount(
                    POMEGRANATE) == 0 and st.getQuestItemsCount(
                        GANTAKIS_LETTER) == 1 and st.getQuestItemsCount(
                            ROSHEEKS_LETTER) == 0 and (
                                (st.getQuestItemsCount(LEATHER_POUCH1) +
                                 st.getQuestItemsCount(LEATHER_POUCH2) +
                                 st.getQuestItemsCount(LEATHER_POUCH3) +
                                 st.getQuestItemsCount(LEATHER_POUCH1FULL) +
                                 st.getQuestItemsCount(LEATHER_POUCH2FULL) +
                                 st.getQuestItemsCount(LEATHER_POUCH3FULL))
                                == 0):
            htmltext = "30587-10.htm"
        elif npcId == 30587 and st.getInt("cond") and st.getQuestItemsCount(
                SCROLL_FIERY_SPIRIT) == 1 and st.getQuestItemsCount(
                    POMEGRANATE) == 0 and st.getQuestItemsCount(
                        GANTAKIS_LETTER) == 0 and st.getQuestItemsCount(
                            ROSHEEKS_LETTER) == 0 and (
                                (st.getQuestItemsCount(LEATHER_POUCH1) +
                                 st.getQuestItemsCount(LEATHER_POUCH2) +
                                 st.getQuestItemsCount(LEATHER_POUCH3) +
                                 st.getQuestItemsCount(LEATHER_POUCH1FULL) +
                                 st.getQuestItemsCount(LEATHER_POUCH2FULL) +
                                 st.getQuestItemsCount(LEATHER_POUCH3FULL))
                                == 0):
            htmltext = "30587-11.htm"
        elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount(
                POMEGRANATE):
            htmltext = "30590-01.htm"
            st.takeItems(POMEGRANATE, 1)
            st.giveItems(LEATHER_POUCH1, 1)
            st.set("cond", "2")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount(
                LEATHER_POUCH1) and st.getQuestItemsCount(
                    LEATHER_POUCH1FULL) == 0:
            htmltext = "30590-02.htm"
        elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount(
                LEATHER_POUCH1) == 0 and st.getQuestItemsCount(
                    LEATHER_POUCH1FULL):
            htmltext = "30590-03.htm"
            st.takeItems(LEATHER_POUCH1FULL, 1)
            st.giveItems(LEATHER_POUCH2, 1)
            st.set("cond", "4")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount(
                LEATHER_POUCH2) == 1 and st.getQuestItemsCount(
                    LEATHER_POUCH2FULL) == 0:
            htmltext = "30590-04.htm"
        elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount(
                LEATHER_POUCH2) == 0 and st.getQuestItemsCount(
                    LEATHER_POUCH2FULL) == 1:
            htmltext = "30590-05.htm"
            st.takeItems(LEATHER_POUCH2FULL, 1)
            st.giveItems(LEATHER_POUCH3, 1)
            st.set("cond", "6")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount(
                LEATHER_POUCH3) == 1 and st.getQuestItemsCount(
                    LEATHER_POUCH3FULL) == 0:
            htmltext = "30590-06.htm"
        elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount(
                LEATHER_POUCH3) == 0 and st.getQuestItemsCount(
                    LEATHER_POUCH3FULL) == 1:
            htmltext = "30590-07.htm"
            st.takeItems(LEATHER_POUCH3FULL, 1)
            st.giveItems(SCROLL_FIERY_SPIRIT, 1)
            st.giveItems(ROSHEEKS_LETTER, 1)
            st.set("cond", "8")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount(
                ROSHEEKS_LETTER) == 1 and st.getQuestItemsCount(
                    SCROLL_FIERY_SPIRIT) == 1:
            htmltext = "30590-08.htm"
        elif npcId == 30590 and st.getInt("cond") and st.getQuestItemsCount(
                ROSHEEKS_LETTER) == 0 and st.getQuestItemsCount(
                    SCROLL_FIERY_SPIRIT) == 1:
            htmltext = "30590-09.htm"
        elif npcId == 30501 and st.getInt("cond") and st.getQuestItemsCount(
                GANTAKIS_LETTER):
            htmltext = "30501-01.htm"
            st.takeItems(GANTAKIS_LETTER, 1)
            st.giveItems(FIG, 1)
            st.set("cond", "10")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30501 and st.getInt("cond") and st.getQuestItemsCount(
                FIG) and (st.getQuestItemsCount(LEATHER_PURSE4) == 0
                          or st.getQuestItemsCount(LEATHER_POUCH4FULL) == 0):
            htmltext = "30501-02.htm"
        elif npcId == 30501 and st.getInt("cond") and st.getQuestItemsCount(
                FIG) == 0 and (st.getQuestItemsCount(LEATHER_PURSE4) == 1 or
                               st.getQuestItemsCount(LEATHER_POUCH4FULL) == 1):
            htmltext = "30501-03.htm"
        elif npcId == 30501 and st.getInt("cond") and st.getQuestItemsCount(
                SCROLL_IRON_WILL):
            htmltext = "30501-04.htm"
            st.takeItems(SCROLL_IRON_WILL, 1)
            st.takeItems(SCROLL_FIERY_SPIRIT, 1)
            st.takeItems(TORUKUS_LETTER, 1)
            st.giveItems(KHAVATARI_TOTEM, 1)
            st.giveItems(57, 81900)
            st.addExpAndSp(295862, 19344)
            player.sendPacket(SocialAction(player.getObjectId(), 3))
            st.set("cond", "0")
            st.set("onlyone", "1")
            st.exitQuest(False)
            st.playSound("ItemSound.quest_finish")
        elif npcId == 30591 and st.getInt("cond") and st.getQuestItemsCount(
                FIG):
            htmltext = "30591-01.htm"
            st.takeItems(FIG, 1)
            st.giveItems(LEATHER_PURSE4, 1)
            st.set("cond", "11")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30591 and st.getInt("cond") and st.getQuestItemsCount(
                LEATHER_PURSE4) and st.getQuestItemsCount(
                    LEATHER_POUCH4FULL) == 0:
            htmltext = "30591-02.htm"
        elif npcId == 30591 and st.getInt("cond") and st.getQuestItemsCount(
                LEATHER_PURSE4) == 0 and st.getQuestItemsCount(
                    LEATHER_POUCH4FULL) == 1:
            htmltext = "30591-03.htm"
            st.takeItems(LEATHER_POUCH4FULL, 1)
            st.giveItems(SCROLL_IRON_WILL, 1)
            st.giveItems(TORUKUS_LETTER, 1)
            st.set("cond", "13")
            st.playSound("ItemSound.quest_middle")
        elif npcId == 30591 and st.getInt("cond") and st.getQuestItemsCount(
                SCROLL_IRON_WILL) == 1 and st.getQuestItemsCount(
                    TORUKUS_LETTER) == 1:
            htmltext = "30591-04.htm"
        elif npcId == 32056:
            if cond == 14:
                htmltext = "32056-01.htm"
            elif cond == 15:
                htmltext = "32056-04.htm"
            elif cond == 16:
                htmltext = "32056-05.htm"
                st.set("cond", "17")
                st.playSound("ItemSound.quest_middle")
                st.takeItems(8545, -1)
            elif cond == 17:
                htmltext = "32056-06.htm"
            elif cond == 18:
                htmltext = "32056-07.htm"
            elif cond == 19:
                htmltext = "32056-09.htm"
        elif npcId == 31979:
            if cond == 19:
                htmltext = "31979-01.htm"
        return htmltext
Beispiel #19
0
    def onTalk(self, npc, player):

        npcId = npc.getNpcId()
        htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
        st = player.getQuestState(qn)
        if not st: return htmltext

        id = st.getState()
        if npcId == 30568 and id == State.COMPLETED:
            htmltext = "<html><body>這是已經完成的任務。</body></html>"
        elif npcId == 30568 and id == State.CREATED:
            if player.getRace().ordinal() != 3:
                htmltext = "30568-00.htm"
                st.exitQuest(1)
            elif player.getLevel() >= 10:
                htmltext = "30568-02.htm"
                return htmltext
            else:
                htmltext = "30568-01.htm"
                st.exitQuest(1)
        elif npcId == 30568 and st.getInt("cond") == 1 and (
                st.getQuestItemsCount(HATOSS_ORDER1_ID)
                or st.getQuestItemsCount(HATOSS_ORDER2_ID)
                or st.getQuestItemsCount(HATOSS_ORDER3_ID)) and (
                    (st.getQuestItemsCount(LETTER_TO_ELF_ID) +
                     st.getQuestItemsCount(LETTER_TO_HUMAN_ID) +
                     st.getQuestItemsCount(LETTER_TO_DARKELF_ID)) == 0):
            htmltext = "30568-04.htm"
        elif npcId == 30568 and st.getInt("cond") == 1 and (
                st.getQuestItemsCount(HATOSS_ORDER1_ID)
                or st.getQuestItemsCount(HATOSS_ORDER2_ID)
                or st.getQuestItemsCount(HATOSS_ORDER3_ID)) and (
                    (st.getQuestItemsCount(LETTER_TO_ELF_ID) +
                     st.getQuestItemsCount(LETTER_TO_HUMAN_ID) +
                     st.getQuestItemsCount(LETTER_TO_DARKELF_ID)) == 1):
            htmltext = "30568-05.htm"
        elif npcId == 30568 and st.getInt("cond") == 1 and (
                st.getQuestItemsCount(HATOSS_ORDER1_ID)
                or st.getQuestItemsCount(HATOSS_ORDER2_ID)
                or st.getQuestItemsCount(HATOSS_ORDER3_ID)) and (
                    (st.getQuestItemsCount(LETTER_TO_ELF_ID) +
                     st.getQuestItemsCount(LETTER_TO_HUMAN_ID) +
                     st.getQuestItemsCount(LETTER_TO_DARKELF_ID)) == 2):
            htmltext = "30568-08.htm"
        elif npcId == 30568 and st.getInt("cond") == 1 and (
                st.getQuestItemsCount(HATOSS_ORDER1_ID)
                or st.getQuestItemsCount(HATOSS_ORDER2_ID)
                or st.getQuestItemsCount(HATOSS_ORDER3_ID)) and (
                    (st.getQuestItemsCount(LETTER_TO_ELF_ID) +
                     st.getQuestItemsCount(LETTER_TO_HUMAN_ID) +
                     st.getQuestItemsCount(LETTER_TO_DARKELF_ID)) == 3):
            if st.getInt("id") != 107:
                st.set("id", "107")
                htmltext = "30568-10.htm"
                st.takeItems(LETTER_TO_DARKELF_ID, 1)
                st.takeItems(LETTER_TO_HUMAN_ID, 1)
                st.takeItems(LETTER_TO_ELF_ID, 1)
                st.takeItems(HATOSS_ORDER3_ID, 1)
                st.giveItems(57, 14666)
                st.giveItems(LESSER_HEALING_ID,
                             int(100 * Config.RATE_QUESTS_REWARD))
                st.giveItems(BUTCHER_ID, 1)
                st.giveItems(CRYSTAL_BATTLE,
                             int(10 * Config.RATE_QUESTS_REWARD))
                st.giveItems(CRYSTAL_LOVE, int(10 * Config.RATE_QUESTS_REWARD))
                st.giveItems(CRYSTAL_SOLITUDE,
                             int(10 * Config.RATE_QUESTS_REWARD))
                st.giveItems(CRYSTAL_FEAST,
                             int(10 * Config.RATE_QUESTS_REWARD))
                st.giveItems(CRYSTAL_CELEBRATION,
                             int(10 * Config.RATE_QUESTS_REWARD))
                # check the player state against this quest newbie rewarding mark.
                newbie = player.getNewbie()
                if newbie | NEWBIE_REWARD != newbie:
                    player.setNewbie(newbie | NEWBIE_REWARD)
                    if player.getClassId().isMage():
                        st.giveItems(SPIRITSHOT_NO_GRADE_FOR_BEGINNERS, 3000)
                        st.playTutorialVoice("tutorial_voice_027")
                    else:
                        st.giveItems(SOULSHOT_NO_GRADE_FOR_BEGINNERS, 7000)
                        st.playTutorialVoice("tutorial_voice_026")
                st.unset("cond")
                st.addExpAndSp(34565, 2962)
                player.sendPacket(SocialAction(player.getObjectId(), 3))
                st.exitQuest(False)
                st.playSound("ItemSound.quest_finish")
        elif npcId == 30580 and st.getInt(
                "cond") == 1 and id == State.STARTED and (
                    st.getQuestItemsCount(HATOSS_ORDER1_ID)
                    or st.getQuestItemsCount(HATOSS_ORDER2_ID)
                    or st.getQuestItemsCount(HATOSS_ORDER3_ID)):
            htmltext = "30580-01.htm"
        return htmltext
Beispiel #20
0
    def onTalk(self, npc, player):
        htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
        st = player.getQuestState(qn)
        if not st: return htmltext

        npcId = npc.getNpcId()
        id = st.getState()
        if npcId != 30329 and id != State.STARTED: return htmltext

        npcId = npc.getNpcId()
        htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
        id = st.getState()
        if npcId == 30329 and st.getInt("cond") == 0:
            htmltext = "30329-01.htm"
        elif npcId == 30329 and st.getInt("cond"):
            if st.getQuestItemsCount(
                    PALLUS_TALISMAN) == 1 and st.getQuestItemsCount(
                        LYCANTHROPE_SKULL) == 0:
                htmltext = "30329-07.htm"
            elif st.getQuestItemsCount(
                    PALLUS_TALISMAN) == 1 and st.getQuestItemsCount(
                        LYCANTHROPE_SKULL) > 0 and st.getQuestItemsCount(
                            LYCANTHROPE_SKULL) < 13:
                htmltext = "30329-08.htm"
            elif st.getQuestItemsCount(
                    PALLUS_TALISMAN
            ) == 1 and st.getQuestItemsCount(LYCANTHROPE_SKULL) >= 13:
                htmltext = "30329-09.htm"
            elif st.getQuestItemsCount(COFFIN_ETERNAL_REST) == 1:
                htmltext = "30329-11.htm"
                st.takeItems(COFFIN_ETERNAL_REST, 1)
                st.giveItems(GAZE_OF_ABYSS, 1)
                isFinished = st.getGlobalQuestVar("1ClassQuestFinished")
                if isFinished == "":
                    st.giveItems(57, 81900)
                    st.addExpAndSp(295862, 19804)
                player.sendPacket(SocialAction(player.getObjectId(), 3))
                st.set("cond", "0")
                st.exitQuest(False)
                st.saveGlobalQuestVar("1ClassQuestFinished", "1")
                st.playSound("ItemSound.quest_finish")
            elif st.getQuestItemsCount(
                    MORTE_TALISMAN) or st.getQuestItemsCount(VIRGILS_LETTER):
                htmltext = "30329-12.htm"
        elif npcId == 30422 and st.getInt("cond"):
            if st.getQuestItemsCount(VIRGILS_LETTER):
                htmltext = "30422-01.htm"
            elif st.getQuestItemsCount(
                    MORTE_TALISMAN) and st.getQuestItemsCount(
                        TRIMDEN_SILK) == 0 and st.getQuestItemsCount(
                            PREDATOR_CARAPACE) == 0:
                htmltext = "30422-03.htm"
            elif st.getQuestItemsCount(
                    MORTE_TALISMAN) and st.getQuestItemsCount(
                        TRIMDEN_SILK) > 0 and st.getQuestItemsCount(
                            PREDATOR_CARAPACE) == 0:
                htmltext = "30422-04.htm"
            elif st.getQuestItemsCount(
                    MORTE_TALISMAN) and st.getQuestItemsCount(
                        TRIMDEN_SILK
                    ) == 0 and st.getQuestItemsCount(PREDATOR_CARAPACE) > 0:
                htmltext = "30422-04.htm"
            elif st.getQuestItemsCount(
                    MORTE_TALISMAN) and st.getQuestItemsCount(
                        TRIMDEN_SILK) >= 5 and st.getQuestItemsCount(
                            PREDATOR_CARAPACE) > 0:
                htmltext = "30422-05.htm"
        return htmltext
Beispiel #21
0
    def onTalk(self, npc, player):
        htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
        st = player.getQuestState(qn)
        if not st: return htmltext

        npcId = npc.getNpcId()
        id = st.getState()
        if npcId != 30514 and id != State.STARTED: return htmltext

        if id == State.CREATED:  # Check if is starting the quest
            st.set("cond", "0")
            st.set("id", "0")
            if npcId == 30514:
                if player.getRace().ordinal() == 3 and player.getClassId(
                ).getId() in [45, 47, 50]:
                    if player.getLevel() >= 37:
                        htmltext = "30514-03.htm"
                    else:
                        htmltext = "30514-01.htm"
                        st.exitQuest(1)
                else:
                    htmltext = "30514-02.htm"
                    st.exitQuest(1)
        elif id == State.COMPLETED:  # Check if the quest is already made
            if npcId == 30514:
                htmltext = "<html><body>這是已經完成的任務。</body></html>"

        else:  # The quest it self
            try:
                cond = st.getInt("cond")
            except:
                cond = None
            # Default text after condition 4 for the bellow NPCs
            if npcId == 30501 and cond >= 5:
                htmltext = "30501-11.htm"
            elif npcId == 30515 and cond >= 5:
                htmltext = "30515-08.htm"
            elif npcId == 30615 and cond >= 5:
                htmltext = "30615-08.htm"
            elif npcId == 30616 and cond >= 5:
                htmltext = "30616-08.htm"
            elif npcId == 30617 and cond >= 5:
                htmltext = "30617-07.htm"
            elif npcId == 30618 and cond >= 5:
                htmltext = "30618-05.htm"
            elif npcId == 30619 and cond >= 5:
                htmltext = "30619-07.htm"
            elif npcId == 30565 and cond in [8, 9, 10]:  # Paagrio Lord Kakai
                htmltext = "30565-01.htm"
            # Condition Oriented code for optimal performance
            elif cond == 1:  # Trial of Vokian
                if npcId == 30514 and st.getQuestItemsCount(
                        VOKIYANS_ORDER1
                ) and (st.getQuestItemsCount(MANASHEN_SHARD) < 10
                       or st.getQuestItemsCount(TYRANT_TALON) < 10
                       or st.getQuestItemsCount(GUARDIAN_BASILISK_FANG) < 10):
                    htmltext = "30514-06.htm"
                # Begin of the cross compatible code
                elif CROSS_COMPATIBLE:
                    if st.getQuestItemsCount(
                            VOKIYANS_ORDER1) and st.getQuestItemsCount(
                                MANASHEN_SHARD
                            ) == 10 and st.getQuestItemsCount(
                                TYRANT_TALON) == 10 and st.getQuestItemsCount(
                                    GUARDIAN_BASILISK_FANG) == 10:
                        st.set("cond", "2")
                    elif st.getQuestItemsCount(
                            NECKLACE_OF_AUTHORITY) and st.getQuestItemsCount(
                                VOKIYANS_ORDER2):
                        st.set("cond", "3")
                    elif st.getQuestItemsCount(
                            NECKLACE_OF_AUTHORITY) and st.getQuestItemsCount(
                                CHIANTAS_ORDER1):
                        st.set("cond", "4")
                    elif st.getQuestItemsCount(NECKLACE_OF_AUTHORITY) and (
                            st.getQuestItemsCount(CHIANTAS_ORDER2) or
                        (st.getQuestItemsCount(CHIANTAS_ORDER1)
                         and st.getQuestItemsCount(SCEPTER_OF_BREKA)
                         and st.getQuestItemsCount(SCEPTER_OF_VUKU)
                         and st.getQuestItemsCount(SCEPTER_OF_TUREK)
                         and st.getQuestItemsCount(SCEPTER_OF_TUNATH)
                         and st.getQuestItemsCount(SCEPTER_OF_ENKU))):
                        st.set("cond", "5")
                    elif st.getQuestItemsCount(
                            NECKLACE_OF_AUTHORITY) and st.getQuestItemsCount(
                                CHIANTAS_ORDER3):
                        if st.getQuestItemsCount(
                                TAMLIN_ORC_SKULL
                        ) == 20 and st.getQuestItemsCount(
                                TIMAK_ORC_HEAD) == 20:
                            st.set("cond", "7")
                        else:
                            st.set("cond", "6")
                    elif st.getQuestItemsCount(SCEPTER_BOX):
                        st.set("cond", "8")
                    elif st.getQuestItemsCount(TANAPIS_ORDER1):
                        if st.getQuestItemsCount(SCEPTER_OF_TANTOS):
                            st.set("cond", "10")
                        else:
                            st.set("cond", "9")
                    elif st.getQuestItemsCount(RITUAL_BOX):
                        st.set("cond", "11")
                # end of the cross compatible code
            elif cond == 2:  # Return to Vokian
                if npcId == 30514:
                    if st.getQuestItemsCount(
                            VOKIYANS_ORDER1) and st.getQuestItemsCount(
                                MANASHEN_SHARD
                            ) == 10 and st.getQuestItemsCount(
                                TYRANT_TALON) == 10 and st.getQuestItemsCount(
                                    GUARDIAN_BASILISK_FANG) == 10:
                        htmltext = "30514-08.htm"
                        st.giveItems(VOKIYANS_ORDER2, 1)
                        st.giveItems(NECKLACE_OF_AUTHORITY, 1)
                        st.set("cond", "3")
                        st.takeItems(VOKIYANS_ORDER1, 1)
                        st.takeItems(MANASHEN_SHARD, 10)
                        st.takeItems(TYRANT_TALON, 10)
                        st.takeItems(GUARDIAN_BASILISK_FANG, 10)
            elif cond == 3:  # Chianta, Chief of the Gandi Tribe
                if npcId == 30514:
                    htmltext = "30514-09.htm"
                elif npcId == 30642 and st.getQuestItemsCount(
                        NECKLACE_OF_AUTHORITY) and st.getQuestItemsCount(
                            VOKIYANS_ORDER2):
                    htmltext = "30642-01.htm"
            elif cond == 4:  # Five Unique and Honorable Deaths
                if npcId == 30514 and st.getQuestItemsCount(VOKIYANS_ORDER2):
                    htmltext = "30514-10.htm"
                elif npcId == 30642:
                    htmltext = "30642-04.htm"
                elif npcId == 30515 and st.getQuestItemsCount(
                        NECKLACE_OF_AUTHORITY) and st.getQuestItemsCount(
                            CHIANTAS_ORDER1):
                    htmltext = "30515-01.htm"
                elif npcId == 30501 and st.getQuestItemsCount(
                        NECKLACE_OF_AUTHORITY) and st.getQuestItemsCount(
                            CHIANTAS_ORDER1):
                    htmltext = "30501-01.htm"
                elif npcId == 30615:  # Chief of Breka Orcs
                    if st.getQuestItemsCount(MANAKIAS_LETTER1):
                        htmltext = "30615-02.htm"
                    elif st.getQuestItemsCount(GLOVE_OF_VOLTAR):
                        htmltext = "30615-05.htm"
                        st.playSound("Itemsound.quest_before_battle")
                        st.addSpawn(27080, 80117, 120039, -2259)
                        st.addSpawn(27081, 80058, 120038, -2259)
                    elif st.getQuestItemsCount(
                            PASHIKAS_HEAD) and st.getQuestItemsCount(
                                VULTUS_HEAD):
                        htmltext = "30615-06.htm"
                        st.giveItems(SCEPTER_OF_BREKA, 1)
                        st.takeItems(PASHIKAS_HEAD, 1)
                        st.takeItems(VULTUS_HEAD, 1)
                        if st.getQuestItemsCount(
                                SCEPTER_OF_BREKA) and st.getQuestItemsCount(
                                    SCEPTER_OF_ENKU) and st.getQuestItemsCount(
                                        SCEPTER_OF_VUKU
                                    ) and st.getQuestItemsCount(
                                        SCEPTER_OF_TUREK
                                    ) and st.getQuestItemsCount(
                                        SCEPTER_OF_TUNATH):
                            st.set("cond", "5")
                            st.playSound("Itemsound.quest_middle")
                        else:
                            st.playSound("Itemsound.quest_itemget")
                    elif st.getQuestItemsCount(SCEPTER_OF_BREKA):
                        htmltext = "30615-07.htm"
                    else:
                        htmltext = "30615-01.htm"
                elif npcId == 30616:  # Chief of Enku Orcs
                    if st.getQuestItemsCount(MANAKIAS_LETTER2):
                        htmltext = "30616-02.htm"
                    elif st.getQuestItemsCount(GLOVE_OF_KEPRA):
                        htmltext = "30616-05.htm"
                        st.playSound("Itemsound.quest_before_battle")
                        st.addSpawn(27082, 17710, 189813, -3581)
                        st.addSpawn(27082, 17674, 189798, -3581)
                        st.addSpawn(27082, 17770, 189852, -3581)
                        st.addSpawn(27082, 17803, 189873, -3581)
                    elif st.getQuestItemsCount(ENKU_OVERLORD_HEAD) == 4:
                        htmltext = "30616-06.htm"
                        st.giveItems(SCEPTER_OF_ENKU, 1)
                        st.takeItems(ENKU_OVERLORD_HEAD, 4)
                        if st.getQuestItemsCount(
                                SCEPTER_OF_BREKA) and st.getQuestItemsCount(
                                    SCEPTER_OF_ENKU) and st.getQuestItemsCount(
                                        SCEPTER_OF_VUKU
                                    ) and st.getQuestItemsCount(
                                        SCEPTER_OF_TUREK
                                    ) and st.getQuestItemsCount(
                                        SCEPTER_OF_TUNATH):
                            st.set("cond", "5")
                            st.playSound("Itemsound.quest_middle")
                        else:
                            st.playSound("Itemsound.quest_itemget")
                    elif st.getQuestItemsCount(SCEPTER_OF_ENKU):
                        htmltext = "30616-07.htm"
                    else:
                        htmltext = "30616-01.htm"
                elif npcId == 30617:  # Chief of Turek Orcs
                    if st.getQuestItemsCount(KASMANS_LETTER2):
                        htmltext = "30617-02.htm"
                    elif st.getQuestItemsCount(GLOVE_OF_BURAI):
                        htmltext = "30617-05.htm"
                        st.playSound("Itemsound.quest_before_battle")
                        st.addSpawn(27083, -94292, 110781, -3701)
                        st.addSpawn(27083, -94293, 110861, -3701)
                    elif st.getQuestItemsCount(MAKUM_BUGBEAR_HEAD) == 2:
                        htmltext = "30617-06.htm"
                        st.giveItems(SCEPTER_OF_TUREK, 1)
                        st.takeItems(MAKUM_BUGBEAR_HEAD, 2)
                        if st.getQuestItemsCount(
                                SCEPTER_OF_BREKA) and st.getQuestItemsCount(
                                    SCEPTER_OF_ENKU) and st.getQuestItemsCount(
                                        SCEPTER_OF_VUKU
                                    ) and st.getQuestItemsCount(
                                        SCEPTER_OF_TUREK
                                    ) and st.getQuestItemsCount(
                                        SCEPTER_OF_TUNATH):
                            st.set("cond", "5")
                            st.playSound("Itemsound.quest_middle")
                        else:
                            st.playSound("Itemsound.quest_itemget")
                    elif st.getQuestItemsCount(SCEPTER_OF_TUREK):
                        htmltext = "30617-07.htm"
                    else:
                        htmltext = "30617-01.htm"
                elif npcId == 30618:  # Chief of Tunath Orcs
                    if st.getQuestItemsCount(KASMANS_LETTER3):
                        htmltext = "30618-02.htm"
                    elif st.getQuestItemsCount(SCEPTER_OF_TUNATH):
                        htmltext = "30618-04.htm"
                    else:
                        htmltext = "30618-01.htm"
                elif npcId == 30619:  # Chief of Vuku Orcs
                    if st.getQuestItemsCount(KASMANS_LETTER1):
                        htmltext = "30619-02.htm"
                    elif st.getQuestItemsCount(DRIKOS_CONTRACT):
                        if st.getQuestItemsCount(STAKATO_DRONE_HUSK1) == 30:
                            htmltext = "30619-05.htm"
                            st.giveItems(SCEPTER_OF_VUKU, 1)
                            st.takeItems(STAKATO_DRONE_HUSK1, 30)
                            st.takeItems(DRIKOS_CONTRACT, 1)
                            if st.getQuestItemsCount(
                                    SCEPTER_OF_BREKA
                            ) and st.getQuestItemsCount(
                                    SCEPTER_OF_ENKU) and st.getQuestItemsCount(
                                        SCEPTER_OF_VUKU
                                    ) and st.getQuestItemsCount(
                                        SCEPTER_OF_TUREK
                                    ) and st.getQuestItemsCount(
                                        SCEPTER_OF_TUNATH):
                                st.set("cond", "5")
                                st.playSound("Itemsound.quest_middle")
                            else:
                                st.playSound("Itemsound.quest_itemget")
                        else:
                            htmltext = "30619-04.htm"
                    elif st.getQuestItemsCount(SCEPTER_OF_VUKU):
                        htmltext = "30619-06.htm"
                    else:
                        htmltext = "30619-01.htm"
            elif cond == 5:  # Return to Chianta
                if npcId == 30642 and st.getQuestItemsCount(
                        NECKLACE_OF_AUTHORITY):
                    if st.getQuestItemsCount(
                            CHIANTAS_ORDER1) and st.getQuestItemsCount(
                                SCEPTER_OF_BREKA) and st.getQuestItemsCount(
                                    SCEPTER_OF_VUKU) and st.getQuestItemsCount(
                                        SCEPTER_OF_TUREK
                                    ) and st.getQuestItemsCount(
                                        SCEPTER_OF_TUNATH
                                    ) and st.getQuestItemsCount(
                                        SCEPTER_OF_ENKU):
                        htmltext = "30642-05.htm"
                    elif st.getQuestItemsCount(CHIANTAS_ORDER2):
                        if player.getLevel() >= 37:
                            htmltext = "30642-09.htm"
                            st.giveItems(CHIANTAS_ORDER3, 1)
                            st.set("cond", "6")
                            st.takeItems(CHIANTAS_ORDER2, 1)
                        else:
                            htmltext = "30642-08.htm"
            elif cond == 6:  # Punish The Betrayers
                if npcId == 30642 and st.getQuestItemsCount(
                        NECKLACE_OF_AUTHORITY) and st.getQuestItemsCount(
                            CHIANTAS_ORDER3):
                    htmltext = "30642-10.htm"
            elif cond == 7:  # The Punishment Ends
                if npcId == 30642 and st.getQuestItemsCount(
                        TAMLIN_ORC_SKULL) == 20 and st.getQuestItemsCount(
                            TIMAK_ORC_HEAD) == 20:
                    st.giveItems(SCEPTER_BOX, 1)
                    st.set("cond", "8")
                    st.takeItems(NECKLACE_OF_AUTHORITY, 1)
                    st.takeItems(CHIANTAS_ORDER3, 1)
                    st.takeItems(TAMLIN_ORC_SKULL, 20)
                    st.takeItems(TIMAK_ORC_HEAD, 20)
                    htmltext = "30642-11.htm"
            elif cond == 8:  # Priest of the Immortal Plateau
                if npcId == 30642 and st.getQuestItemsCount(SCEPTER_BOX):
                    htmltext = "30642-12.htm"
                elif npcId == 30571 and st.getQuestItemsCount(SCEPTER_BOX):
                    htmltext = "30571-01.htm"
            elif cond == 9:  # The Scepter of Tantos
                if npcId == 30571 and st.getQuestItemsCount(TANAPIS_ORDER1):
                    htmltext = "30571-04.htm"
                elif npcId == 30642 and st.getQuestItemsCount(TANAPIS_ORDER1):
                    htmltext = "30642-13.htm"
            elif cond == 10:  # Recovered Scepter of Tantos
                if npcId == 30571 and st.getQuestItemsCount(
                        TANAPIS_ORDER1) and st.getQuestItemsCount(
                            SCEPTER_OF_TANTOS):
                    htmltext = "30571-05.htm"
                    st.giveItems(RITUAL_BOX, 1)
                    st.set("cond", "11")
                    st.takeItems(SCEPTER_OF_TANTOS, 1)
                    st.takeItems(TANAPIS_ORDER1, 1)
            elif cond == 11:  # To the Lord of Flame
                if npcId == 30571 and st.getQuestItemsCount(RITUAL_BOX):
                    htmltext = "30571-06.htm"
                elif npcId == 30565 and st.getQuestItemsCount(RITUAL_BOX):
                    player.sendPacket(SocialAction(player.getObjectId(), 3))
                    st.addExpAndSp(724113, 48324)
                    st.giveItems(57, 131360)
                    st.giveItems(7562, 109)
                    htmltext = "30565-02.htm"
                    st.giveItems(MARK_OF_GLORY, 1)
                    st.takeItems(RITUAL_BOX, 1)
                    st.set("cond", "0")
                    st.exitQuest(False)
                    st.playSound("ItemSound.quest_finish")
                else:
                    htmltext = "30565-01.htm"
        return htmltext
Beispiel #22
0
 def onTalk(self, npc, player):
     htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
     st = player.getQuestState(qn)
     if not st: return htmltext
     npcId = npc.getNpcId()
     id = st.getState()
     cond = st.getInt("cond")
     if id == State.COMPLETED:
         htmltext = "<html><body>這是已經完成的任務。</body></html>"
     elif npcId == Vitus:
         if player.getClassId().getId() not in [125, 126
                                                ] or player.getLevel() < 39:
             htmltext = "<html><body>Only Troopers or Warders are allowed to take this quest! Go away before I get angry!<br>You must be level 39 or higher to undertake this quest.</body></html>"
             st.exitQuest(1)
         elif id == State.CREATED:
             htmltext = "32213-01.htm"
         elif cond >= 1 and cond <= 3:
             htmltext = "32213-04.htm"
         elif cond >= 4 and cond < 17:
             htmltext = "32213-05.htm"
         elif cond == 17 and st.getQuestItemsCount(Recommend) == 1:
             htmltext = "32213-06.htm"
             player.sendPacket(SocialAction(player.getObjectId(), 3))
             st.takeItems(Recommend, -1)
             st.giveItems(certificate, 1)
             st.exitQuest(False)
             st.playSound("ItemSound.quest_finish")
             st.addExpAndSp(189831, 21526)
     elif npcId == Kekropus:
         if cond == 1:
             htmltext = "32138-00.htm"
         elif cond == 2:
             htmltext = "32138-04.htm"
         elif cond == 14:
             htmltext = "32138-05.htm"
         elif cond == 15:
             htmltext = "32138-07.htm"
         elif cond == 16:
             htmltext = "32138-08.htm"
         elif cond == 17:
             htmltext = "32138-12.htm"
     elif npcId == Casca:
         if cond == 2:
             htmltext = "32139-01.htm"
         elif cond == 3:
             htmltext = "32139-03.htm"
         elif cond == 4:
             htmltext = "32139-05.htm"
         elif cond == 13:
             htmltext = "32139-06.htm"
         elif cond == 14:
             htmltext = "32139-09.htm"
     elif npcId == Holst:
         if cond == 4:
             htmltext = "32199-01.htm"
         elif cond == 5:
             htmltext = "32199-03.htm"
             st.set("cond", "6")
             st.playSound("ItemSound.quest_middle")
         elif cond == 6:
             htmltext = "32199-04.htm"
     elif npcId == Harlan:
         if cond == 6:
             htmltext = "30074-01.htm"
         elif cond == 7:
             htmltext = "30074-02.htm"
     elif npcId == Jacob:
         if cond == 6:
             htmltext = "30073-01.htm"
             st.set("cond", "7")
             st.playSound("ItemSound.quest_middle")
         elif cond == 7:
             htmltext = "30073-02.htm"
     elif npcId == Lucas:
         if cond == 7:
             htmltext = "30071-01.htm"
         elif cond == 8:
             htmltext = "30071-03.htm"
     elif npcId == Xaber:
         if cond == 8:
             htmltext = "30075-01.htm"
         elif cond == 9:
             htmltext = "30075-02.htm"
     elif npcId == Liam:
         if cond == 8:
             htmltext = "30076-01.htm"
             st.set("cond", "9")
             st.playSound("ItemSound.quest_middle")
         elif cond == 9:
             htmltext = "30076-02.htm"
     elif npcId == Zerome:
         if cond == 9:
             htmltext = "30124-01.htm"
         elif cond == 10:
             htmltext = "30124-02.htm"
     elif npcId == Vesa:
         if cond == 9:
             htmltext = "30123-01.htm"
             st.set("cond", "10")
             st.playSound("ItemSound.quest_middle")
         elif cond == 10:
             htmltext = "30123-02.htm"
     elif npcId == Meldina:
         if cond == 10:
             htmltext = "32214-01.htm"
         elif cond == 11:
             htmltext = "32214-03.htm"
     elif npcId == Felton:
         if cond == 11:
             htmltext = "30879-01.htm"
         elif cond == 12:
             htmltext = "30879-04.htm"
     elif npcId == CargoBox:
         if cond == 12:
             htmltext = "32243-01.htm"
             if st.getInt("angel") == 0 and self.isAngelSpawned == 0:
                 angel = st.addSpawn(27332, 36198, 191949, -3728, 180000)
                 angel.broadcastPacket(
                     NpcSay(
                         angel.getObjectId(), 0, angel.getNpcId(),
                         player.getName() +
                         "! Step back from the confounded box! I will take it myself!"
                     ))
                 angel.setRunning()
                 angel.addDamageHate(player, 0, 999)
                 angel.getAI().setIntention(
                     CtrlIntention.AI_INTENTION_ATTACK, player)
                 self.isAngelSpawned = 1
                 self.startQuestTimer("angel_cleanup", 180000, angel,
                                      player)
             elif self.isKatenarSpawned == 0 and st.getInt("angel") == 1:
                 katenar = st.addSpawn(32242, 36110, 191921, -3712, 60000)
                 katenar.broadcastPacket(
                     NpcSay(katenar.getObjectId(), 0, katenar.getNpcId(),
                            "I am late!"))
                 self.isKatenarSpawned == 1
                 self.startQuestTimer("katenar_cleanup", 60000, katenar,
                                      player)
                 htmltext = "32243-02.htm"
         elif cond == 13:
             htmltext = "32243-03.htm"
     return htmltext
Beispiel #23
0
 def onTalk (self,npc,player):
   htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
   st = player.getQuestState(qn)
   if not st : return htmltext

   npcId = npc.getNpcId()
   id = st.getState()
   if npcId != 30327 and id != State.STARTED : return htmltext

   if id == State.CREATED :
     st.set("cond","0")
     cond=0
   else :
     cond=st.getInt("cond")
   if npcId == 30327 :
        if cond == 0 :
            htmltext = "30327-01.htm"
        elif cond == 1 :
            if st.getQuestItemsCount(TOPAZ_PIECE)==0 :
              htmltext = "30327-07.htm"
            else:
              htmltext = "30327-08.htm"
        elif cond == 2 :
            if st.getQuestItemsCount(SORIUS_LETTER1) == 0 :
              st.giveItems(SORIUS_LETTER1,1)
            st.set("cond","3")
            htmltext = "30327-09.htm"
        elif cond in [3, 4, 5] :
            htmltext = "30327-11.htm"
        elif cond == 6 :
            st.takeItems(KLUTO_BOX,-1)
            isFinished = st.getGlobalQuestVar("1ClassQuestFinished")
            if isFinished == "" : 
              st.giveItems(57,81900)
              st.addExpAndSp(228064,14925)
            player.sendPacket(SocialAction(player.getObjectId(),3))
            st.set("cond","0")
            st.exitQuest(False)
            st.playSound("ItemSound.quest_finish")
            st.saveGlobalQuestVar("1ClassQuestFinished","1")
            if st.getQuestItemsCount(ELVEN_KNIGHT_BROOCH) == 0 :
              st.giveItems(ELVEN_KNIGHT_BROOCH,1)
            htmltext = "30327-10.htm"
   elif npcId == 30317 :
        if cond == 3 :
            htmltext = "30317-01.htm"
        elif  cond == 4 :
            if st.getQuestItemsCount(EMERALD_PIECE)==0 :
              htmltext = "30317-03.htm"
            else:
              htmltext = "30317-04.htm"
        elif cond == 5 :
            st.takeItems(EMERALD_PIECE,-1)
            st.takeItems(TOPAZ_PIECE,-1)
            if st.getQuestItemsCount(KLUTO_BOX) == 0 :
              st.giveItems(KLUTO_BOX,1)
            st.takeItems(KLUTO_MEMO,-1)
            st.set("cond","6")
            htmltext = "30317-05.htm"
        elif cond == 6 :
            htmltext = "30317-06.htm"
   return htmltext