Beispiel #1
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, 3))
         player.sendPacket(SocialAction(player, 15))
         st.playSound("ItemSound.quest_finish")
         st.exitQuest(False)
     return htmltext
Beispiel #2
0
 def onTalk(self, npc, player):
     htmltext = Quest.getNoQuestMsg(player)
     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.addExpAndSp(8064, 2368)
                 st.exitQuest(False)
                 st.saveGlobalQuestVar("1ClassQuestFinished", "1")
                 st.playSound("ItemSound.quest_finish")
                 player.sendPacket(SocialAction(player, 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
 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(44744, 3070)
         st.giveItems(57, 8090)
         st.takeItems(TONARS_REMAINS2, -1)
         st.giveItems(MARK_OF_WARSPIRIT, 1)
         st.getPlayer().sendPacket(SocialAction(st.getPlayer(), 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 #4
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        st = player.getQuestState(qn)
        if not st: return htmltext

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

        if npcId == 30414 and st.getInt("cond") == 0:
            htmltext = "30414-01.htm"
        elif npcId == 30414 and st.getInt("cond") != 0 and st.getQuestItemsCount(
                ROGELLIAS_LETTER) == 0 and st.getQuestItemsCount(APPETIZING_APPLE) == 0 and st.getQuestItemsCount(
            IMMORTAL_LOVE) == 0 and st.getQuestItemsCount(CHARM_OF_GRAIN) == 0 and st.getQuestItemsCount(
            SAP_OF_WORLD_TREE) == 0 and st.getQuestItemsCount(LUCKY_POTPOURI) == 0 and st.getQuestItemsCount(
            FERTILITY_PERIDOT) != 0 and (st.getQuestItemsCount(MAGICAL_POWERS_RUBY) == 0 or st.getQuestItemsCount(
            NOBILITY_AMETHYST) == 0 or st.getQuestItemsCount(PURE_AQUAMARINE) == 0):
            htmltext = "30414-11.htm"
        elif npcId == 30414 and st.getInt("cond") != 0 and st.getQuestItemsCount(ROGELLIAS_LETTER) != 0:
            htmltext = "30414-08.htm"
        elif npcId == 30157 and st.getInt("cond") != 0 and st.getQuestItemsCount(ROGELLIAS_LETTER) != 0:
            htmltext = "30157-01.htm"
        elif npcId == 30157 and st.getInt("cond") != 0 and st.getQuestItemsCount(
                CHARM_OF_GRAIN) != 0 and st.getQuestItemsCount(RED_DOWN) < 5:
            htmltext = "30157-03.htm"
        elif npcId == 30157 and st.getInt("cond") != 0 and st.getQuestItemsCount(
                CHARM_OF_GRAIN) != 0 and st.getQuestItemsCount(RED_DOWN) >= 5:
            st.takeItems(RED_DOWN, st.getQuestItemsCount(RED_DOWN))
            st.takeItems(CHARM_OF_GRAIN, st.getQuestItemsCount(CHARM_OF_GRAIN))
            if st.getQuestItemsCount(MAGICAL_POWERS_RUBY) == 0:
                st.giveItems(MAGICAL_POWERS_RUBY, 1)
            htmltext = "30157-04.htm"
        elif npcId == 30414 and st.getInt("cond") != 0 and st.getQuestItemsCount(
                CHARM_OF_GRAIN) != 0 and st.getQuestItemsCount(RED_DOWN) < 5:
            htmltext = "30414-09.htm"
        elif npcId == 30414 and st.getInt("cond") != 0 and st.getQuestItemsCount(
                CHARM_OF_GRAIN) != 0 and st.getQuestItemsCount(RED_DOWN) >= 5:
            htmltext = "30414-25.htm"
        elif npcId == 30414 and st.getInt("cond") != 0 and st.getQuestItemsCount(APPETIZING_APPLE) != 0:
            htmltext = "30414-15.htm"
        elif npcId == 30371 and st.getInt("cond") != 0 and st.getQuestItemsCount(APPETIZING_APPLE) != 0:
            htmltext = "30371-01.htm"
        elif npcId == 30371 and st.getInt("cond") != 0 and st.getQuestItemsCount(
                SAP_OF_WORLD_TREE) != 0 and st.getQuestItemsCount(GOLD_LEAVES) < 5:
            htmltext = "30371-03.htm"
        elif npcId == 30371 and st.getInt("cond") != 0 and st.getQuestItemsCount(
                SAP_OF_WORLD_TREE) != 0 and st.getQuestItemsCount(GOLD_LEAVES) >= 5:
            st.takeItems(GOLD_LEAVES, st.getQuestItemsCount(GOLD_LEAVES))
            st.takeItems(SAP_OF_WORLD_TREE, st.getQuestItemsCount(SAP_OF_WORLD_TREE))
            if st.getQuestItemsCount(PURE_AQUAMARINE) == 0:
                st.giveItems(PURE_AQUAMARINE, 1)
            htmltext = "30371-04.htm"
        elif npcId == 30414 and st.getInt("cond") != 0 and st.getQuestItemsCount(
                SAP_OF_WORLD_TREE) != 0 and st.getQuestItemsCount(GOLD_LEAVES) < 5:
            htmltext = "30414-16.htm"
        elif npcId == 30414 and st.getInt("cond") != 0 and st.getQuestItemsCount(
                CHARM_OF_GRAIN) != 0 and st.getQuestItemsCount(GOLD_LEAVES) >= 5:
            htmltext = "30414-26.htm"
        elif npcId == 30414 and st.getInt("cond") != 0 and st.getQuestItemsCount(IMMORTAL_LOVE) != 0:
            htmltext = "30414-19.htm"
        elif npcId == 30423 and st.getInt("cond") != 0 and st.getQuestItemsCount(IMMORTAL_LOVE) != 0:
            st.takeItems(IMMORTAL_LOVE, st.getQuestItemsCount(IMMORTAL_LOVE))
            if st.getQuestItemsCount(LUCKY_POTPOURI) == 0:
                st.giveItems(LUCKY_POTPOURI, 1)
            htmltext = "30423-01.htm"
        elif npcId == 30423 and st.getInt("cond") != 0 and st.getQuestItemsCount(
                LUCKY_POTPOURI) != 0 and st.getQuestItemsCount(AMETHYST) < 2:
            htmltext = "30423-02.htm"
        elif npcId == 30423 and st.getInt("cond") != 0 and st.getQuestItemsCount(
                LUCKY_POTPOURI) != 0 and st.getQuestItemsCount(AMETHYST) >= 2:
            st.takeItems(AMETHYST, st.getQuestItemsCount(AMETHYST))
            st.takeItems(LUCKY_POTPOURI, st.getQuestItemsCount(LUCKY_POTPOURI))
            if st.getQuestItemsCount(NOBILITY_AMETHYST) == 0:
                st.giveItems(NOBILITY_AMETHYST, 1)
            htmltext = "30423-03.htm"
        elif npcId == 30414 and st.getInt("cond") != 0 and st.getQuestItemsCount(
                LUCKY_POTPOURI) != 0 and st.getQuestItemsCount(AMETHYST) < 2:
            htmltext = "30414-20.htm"
        elif npcId == 30414 and st.getInt("cond") != 0 and st.getQuestItemsCount(
                LUCKY_POTPOURI) != 0 and st.getQuestItemsCount(AMETHYST) >= 2:
            htmltext = "30414-27.htm"
        elif npcId == 30414 and st.getInt("cond") != 0 and st.getQuestItemsCount(
                ROGELLIAS_LETTER) == 0 and st.getQuestItemsCount(APPETIZING_APPLE) == 0 and st.getQuestItemsCount(
            IMMORTAL_LOVE) == 0 and st.getQuestItemsCount(CHARM_OF_GRAIN) == 0 and st.getQuestItemsCount(
            SAP_OF_WORLD_TREE) == 0 and st.getQuestItemsCount(LUCKY_POTPOURI) == 0 and st.getQuestItemsCount(
            FERTILITY_PERIDOT) != 0 and st.getQuestItemsCount(MAGICAL_POWERS_RUBY) != 0 and st.getQuestItemsCount(
            NOBILITY_AMETHYST) != 0 and st.getQuestItemsCount(PURE_AQUAMARINE) != 0:
            st.takeItems(MAGICAL_POWERS_RUBY, st.getQuestItemsCount(MAGICAL_POWERS_RUBY))
            st.takeItems(PURE_AQUAMARINE, st.getQuestItemsCount(PURE_AQUAMARINE))
            st.takeItems(NOBILITY_AMETHYST, st.getQuestItemsCount(NOBILITY_AMETHYST))
            st.takeItems(FERTILITY_PERIDOT, st.getQuestItemsCount(FERTILITY_PERIDOT))
            isFinished = st.getGlobalQuestVar("1ClassQuestFinished")
            if isFinished == "":
                if player.getLevel() >= 20:
                    st.addExpAndSp(32053, 2253)
                elif player.getLevel() == 19:
                    st.addExpAndSp(45612, 2923)
                else:
                    st.addExpAndSp(59172, 3592)
                st.giveItems(57, 16380)
            st.set("cond", "0")
            st.exitQuest(False)
            st.saveGlobalQuestVar("1ClassQuestFinished", "1")
            st.playSound("ItemSound.quest_finish")
            player.sendPacket(SocialAction(player, 3))
            if st.getQuestItemsCount(ETERNITY_DIAMOND) == 0:
                st.giveItems(ETERNITY_DIAMOND, 1)
            htmltext = "30414-24.htm"
        return htmltext
Beispiel #5
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        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 == "":
                if player.getLevel() >= 20:
                    st.addExpAndSp(32053, 1993)
                elif player.getLevel() == 19:
                    st.addExpAndSp(45612, 2663)
                else:
                    st.addExpAndSp(59172, 3332)
                st.giveItems(57, 16380)
            player.sendPacket(SocialAction(player, 3))
            st.set("cond", "0")
            st.exitQuest(False)
            st.saveGlobalQuestVar("1ClassQuestFinished", "1")
            st.playSound("ItemSound.quest_finish")
        return htmltext
Beispiel #6
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        st = player.getQuestState(qn)
        if not st: return htmltext

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

        squire = st.getQuestItemsCount(MARK_OF_ESQUIRE)
        coin1, coin2, coin3, coin4, coin5, coin6 = st.getQuestItemsCount(
            COIN_OF_LORDS1
        ), st.getQuestItemsCount(COIN_OF_LORDS2), st.getQuestItemsCount(
            COIN_OF_LORDS3), st.getQuestItemsCount(
                COIN_OF_LORDS4), st.getQuestItemsCount(
                    COIN_OF_LORDS5), st.getQuestItemsCount(COIN_OF_LORDS6)
        guards_mark1, guards_mark2, guards_mark3 = st.getQuestItemsCount(
            GLUDIO_GUARDS_MARK1), st.getQuestItemsCount(
                GLUDIO_GUARDS_MARK2), st.getQuestItemsCount(
                    GLUDIO_GUARDS_MARK3)
        church_mark1, church_mark2, church_mark3 = st.getQuestItemsCount(
            EINHASAD_CHURCH_MARK1), st.getQuestItemsCount(
                EINHASAD_CHURCH_MARK2), st.getQuestItemsCount(
                    EINHASAD_CHURCH_MARK3)
        cond = st.getInt("cond")
        if id == State.COMPLETED:
            htmltext = Quest.getAlreadyCompletedMsg(player)

        elif npcId == 30417:
            if cond == 0:
                htmltext = "30417-01.htm"
            elif cond == 1 and squire:
                if (coin1 + coin2 + coin3 + coin4 + coin5 + coin6) < 3:
                    htmltext = "30417-09.htm"
                elif (coin1 + coin2 + coin3 + coin4 + coin5 + coin6) == 3:
                    htmltext = "30417-10.htm"
                elif 3 < (coin1 + coin2 + coin3 + coin4 + coin5 + coin6) < 6:
                    htmltext = "30417-11.htm"
                elif (coin1 + coin2 + coin3 + coin4 + coin5 + coin6) == 6:
                    htmltext = "30417-12.htm"
                    if player.getLevel() >= 20:
                        st.addExpAndSp(32053, 2315)
                    elif player.getLevel() == 19:
                        st.addExpAndSp(45612, 2985)
                    else:
                        st.addExpAndSp(59172, 3654)
                    st.giveItems(57, 16380)
                    for item in range(1162, 1180):
                        st.takeItems(item, -1)
                    st.takeItems(MARK_OF_ESQUIRE, -1)
                    st.giveItems(SWORD_OF_RITUAL, 1)
                    st.set("cond", "0")
                    st.exitQuest(False)
                    st.playSound("ItemSound.quest_finish")
                    player.sendPacket(SocialAction(player, 3))
        elif npcId == 30332 and cond == 1 and squire:
            if not guards_mark1 and not coin1:
                htmltext = "30332-01.htm"
            elif guards_mark1:
                if st.getQuestItemsCount(BUGBEAR_NECKLACE) < 10:
                    htmltext = "30332-03.htm"
                else:
                    htmltext = "30332-04.htm"
                    st.takeItems(BUGBEAR_NECKLACE, -1)
                    st.takeItems(GLUDIO_GUARDS_MARK1, 1)
                    st.giveItems(COIN_OF_LORDS1, 1)
            elif coin1:
                htmltext = "30332-05.htm"
        elif npcId == 30289 and cond == 1 and squire:
            if not church_mark1 and not coin2:
                htmltext = "30289-01.htm"
            elif church_mark1:
                if st.getQuestItemsCount(EINHASAD_CRUCIFIX) < 12:
                    htmltext = "30289-04.htm"
                else:
                    htmltext = "30289-05.htm"
                    st.takeItems(EINHASAD_CRUCIFIX, -1)
                    st.takeItems(EINHASAD_CHURCH_MARK1, 1)
                    st.giveItems(COIN_OF_LORDS2, 1)
            elif coin2:
                htmltext = "30289-06.htm"
        elif npcId == 30379 and cond == 1 and squire:
            if not coin3 and not guards_mark2:
                htmltext = "30379-01.htm"
            elif guards_mark2:
                if st.getQuestItemsCount(POISON_SPIDER_LEG1) < 20:
                    htmltext = "30379-03.htm"
                else:
                    htmltext = "30379-04.htm"
                    st.takeItems(POISON_SPIDER_LEG1, -1)
                    st.takeItems(GLUDIO_GUARDS_MARK2, 1)
                    st.giveItems(COIN_OF_LORDS3, 1)
            elif coin3:
                htmltext = "30379-05.htm"
        elif npcId == 30037 and cond == 1 and squire:
            if not coin4 and not church_mark2:
                htmltext = "30037-01.htm"
            elif church_mark2:
                if st.getQuestItemsCount(LIZARDMAN_TOTEM) < 20:
                    htmltext = "30037-03.htm"
                else:
                    htmltext = "30037-04.htm"
                    st.takeItems(LIZARDMAN_TOTEM, -1)
                    st.takeItems(EINHASAD_CHURCH_MARK2, 1)
                    st.giveItems(COIN_OF_LORDS4, 1)
            elif coin4:
                htmltext = "30037-05.htm"
        elif npcId == 30039 and cond == 1 and squire:
            if not guards_mark3 and not coin5:
                htmltext = "30039-01.htm"
            elif guards_mark3:
                if st.getQuestItemsCount(GIANT_SPIDER_HUSK) < 20:
                    htmltext = "30039-03.htm"
                else:
                    htmltext = "30039-04.htm"
                    st.takeItems(GIANT_SPIDER_HUSK, -1)
                    st.takeItems(GLUDIO_GUARDS_MARK3, 1)
                    st.giveItems(COIN_OF_LORDS5, 1)
            elif coin5:
                htmltext = "30039-05.htm"
        elif npcId == 30031 and cond == 1 and squire:
            if not church_mark3 and not coin6:
                htmltext = "30031-01.htm"
            elif church_mark3:
                if st.getQuestItemsCount(HORRIBLE_SKULL) < 10:
                    htmltext = "30031-03.htm"
                else:
                    htmltext = "30031-04.htm"
                    st.takeItems(HORRIBLE_SKULL, -1)
                    st.takeItems(EINHASAD_CHURCH_MARK3, 1)
                    st.giveItems(COIN_OF_LORDS6, 1)
            elif coin6:
                htmltext = "30031-05.htm"
        elif npcId == 30311 and cond == 1 and squire:
            htmltext = "30311-01.htm"
        elif npcId == 30653 and cond == 1 and squire:
            htmltext = "30653-01.htm"
        return htmltext
Beispiel #7
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        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()
        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 == "":
                if player.getLevel() >= 20:
                    st.addExpAndSp(32053, 2315)
                elif player.getLevel() == 19:
                    st.addExpAndSp(45612, 2863)
                else:
                    st.addExpAndSp(59172, 3532)
                st.giveItems(57, 16380)
            st.set("cond", "0")
            st.exitQuest(False)
            st.saveGlobalQuestVar("1ClassQuestFinished", "1")
            st.playSound("ItemSound.quest_finish")
            player.sendPacket(SocialAction(player, 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 #8
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        st = player.getQuestState(qn)
        if not st: return htmltext

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

        if npcId == 30421 and st.getInt("cond") == 0:
            if st.getQuestItemsCount(JEWEL_OF_DARKNESS) == 0:
                htmltext = "30421-01.htm"
                return htmltext
            else:
                htmltext = "30421-04.htm"
        elif npcId == 30421 and st.getInt("cond") == 1:
            if st.getQuestItemsCount(SEEDS_OF_DESPAIR) and st.getQuestItemsCount(
                    SEEDS_OF_HORROR) and st.getQuestItemsCount(SEEDS_OF_LUNACY) and st.getQuestItemsCount(
                SEEDS_OF_ANGER):
                htmltext = "30421-16.htm"
                st.takeItems(SEEDS_OF_HORROR, 1)
                st.takeItems(SEEDS_OF_ANGER, 1)
                st.takeItems(SEEDS_OF_LUNACY, 1)
                st.takeItems(SEEDS_OF_DESPAIR, 1)
                st.giveItems(JEWEL_OF_DARKNESS, 1)
                isFinished = st.getGlobalQuestVar("1ClassQuestFinished")
                if isFinished == "":
                    if player.getLevel() >= 20:
                        st.addExpAndSp(32053, 2863)
                    elif player.getLevel() == 19:
                        st.addExpAndSp(45612, 2863)
                    else:
                        st.addExpAndSp(59172, 3532)
                    st.giveItems(57, 16380)
                st.set("cond", "0")
                st.exitQuest(False)
                st.saveGlobalQuestVar("1ClassQuestFinished", "1")
                st.playSound("ItemSound.quest_finish")
                player.sendPacket(SocialAction(player, 3))
            elif st.getQuestItemsCount(SEEDS_OF_DESPAIR) == 1 and st.getQuestItemsCount(
                    FAMILYS_ASHES) == 0 and st.getQuestItemsCount(LUCKY_KEY) == 0 and st.getQuestItemsCount(
                CANDLE) == 0 and st.getQuestItemsCount(HUB_SCENT) == 0 and st.getQuestItemsCount(
                KNEE_BONE) == 0 and st.getQuestItemsCount(HEART_OF_LUNACY) == 0:
                htmltext = "30421-17.htm"
            elif st.getQuestItemsCount(SEEDS_OF_DESPAIR) == 1 and st.getInt("id") == 1 and st.getQuestItemsCount(
                    SEEDS_OF_ANGER) == 0:
                htmltext = "30421-08.htm"
            elif st.getQuestItemsCount(SEEDS_OF_DESPAIR) == 1 and st.getInt("id") == 2 and st.getQuestItemsCount(
                    SEEDS_OF_HORROR):
                htmltext = "30421-19.htm"
            elif st.getQuestItemsCount(SEEDS_OF_DESPAIR) == 1 and st.getInt("id") == 3 and st.getQuestItemsCount(
                    HEART_OF_LUNACY) == 0:
                htmltext = "30421-13.htm"
        elif npcId == 30419 and st.getInt("cond") == 1:
            if st.getQuestItemsCount(HUB_SCENT) == 0 and st.getQuestItemsCount(HEART_OF_LUNACY) == 0:
                htmltext = "30419-01.htm"
                st.giveItems(HUB_SCENT, 1)
            elif st.getQuestItemsCount(HUB_SCENT) and st.getQuestItemsCount(HEART_OF_LUNACY) < 3:
                htmltext = "30419-02.htm"
            elif st.getQuestItemsCount(HUB_SCENT) and st.getQuestItemsCount(HEART_OF_LUNACY) >= 3:
                htmltext = "30419-03.htm"
                st.giveItems(SEEDS_OF_LUNACY, 1)
                st.takeItems(HEART_OF_LUNACY, 3)
                st.takeItems(HUB_SCENT, 1)
        elif npcId == 30415 and st.getInt("cond") == 1 and st.getQuestItemsCount(SEEDS_OF_ANGER) == 0:
            if st.getQuestItemsCount(SEEDS_OF_DESPAIR) == 1 and st.getQuestItemsCount(
                    FAMILYS_ASHES) == 0 and st.getQuestItemsCount(LUCKY_KEY) == 0:
                htmltext = "30415-01.htm"
            elif st.getQuestItemsCount(SEEDS_OF_DESPAIR) == 1 and st.getQuestItemsCount(
                    FAMILYS_ASHES) < 3 and st.getQuestItemsCount(LUCKY_KEY) == 1:
                htmltext = "30415-04.htm"
            elif st.getQuestItemsCount(SEEDS_OF_DESPAIR) == 1 and st.getQuestItemsCount(
                    FAMILYS_ASHES) >= 3 and st.getQuestItemsCount(LUCKY_KEY) == 1:
                htmltext = "30415-05.htm"
                st.giveItems(SEEDS_OF_ANGER, 1)
                st.takeItems(FAMILYS_ASHES, 3)
                st.takeItems(LUCKY_KEY, 1)
        elif npcId == 30415 and st.getInt("cond") == 1 and st.getQuestItemsCount(SEEDS_OF_ANGER) == 1:
            htmltext = "30415-06.htm"
        elif npcId == 30418 and st.getInt("cond") > 0 and st.getQuestItemsCount(SEEDS_OF_HORROR) == 0:
            if st.getQuestItemsCount(SEEDS_OF_DESPAIR) == 1 and st.getQuestItemsCount(
                    CANDLE) == 0 and st.getQuestItemsCount(KNEE_BONE) == 0:
                htmltext = "30418-01.htm"
            elif st.getQuestItemsCount(SEEDS_OF_DESPAIR) == 1 and st.getQuestItemsCount(
                    CANDLE) == 1 and st.getQuestItemsCount(KNEE_BONE) < 2:
                htmltext = "30418-03.htm"
            elif st.getQuestItemsCount(SEEDS_OF_DESPAIR) == 1 and st.getQuestItemsCount(
                    CANDLE) == 1 and st.getQuestItemsCount(KNEE_BONE) >= 2:
                htmltext = "30418-04.htm"
                st.giveItems(SEEDS_OF_HORROR, 1)
                st.takeItems(CANDLE, 1)
                st.takeItems(KNEE_BONE, 2)
        return htmltext
Beispiel #9
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        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 == "":
                if player.getLevel() >= 20:
                    st.addExpAndSp(32053, 2131)
                elif player.getLevel() == 19:
                    st.addExpAndSp(45612, 2801)
                else:
                    st.addExpAndSp(59172, 3470)
                st.giveItems(57, 16380)
            player.sendPacket(SocialAction(player, 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)
                if player.getLevel() >= 20:
                    st.addExpAndSp(16026, 1065)
                elif player.getLevel() == 19:
                    st.addExpAndSp(22806, 1400)
                else:
                    st.addExpAndSp(29586, 1735)
                st.giveItems(57, 8190)
                player.sendPacket(SocialAction(player, 3))
                st.unset("cond")
                st.exitQuest(False)
                st.playSound("ItemSound.quest_finish")
        return htmltext
Beispiel #10
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        st = player.getQuestState(qn)
        if not st: return htmltext

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

        if npcId == 30391 and st.getInt("cond") == 0:
            # Talking to Parina before completing this quest
            htmltext = "30391-04.htm"
            return htmltext
        elif npcId == 30391 and st.getInt("cond") != 0 and (
                st.getQuestItemsCount(FLAME_EARING) == 0
                or st.getQuestItemsCount(WIND_BANGEL) == 0
                or st.getQuestItemsCount(WATER_NECKLACE) == 0
                or st.getQuestItemsCount(EARTH_RING) == 0):
            htmltext = "30391-05.htm"
        elif npcId == 30411 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(
                    MAP_OF_LUSTER) == 0 and st.getQuestItemsCount(
                        FLAME_EARING) == 0:
            # Taking to the Flame salamander for the first time
            # gains us the MAP_OF_LUSTER
            # and flags cond = 2
            if st.getQuestItemsCount(MAP_OF_LUSTER) == 0:
                st.giveItems(MAP_OF_LUSTER, 1)
            htmltext = "30411-01.htm"
            st.set("cond", "2")
        elif npcId == 30411 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(
                    MAP_OF_LUSTER) != 0 and st.getQuestItemsCount(
                        KEY_OF_FLAME) == 0:
            # Talking to the Flame Salamander more than once
            # without the KEY_OF_FLAME
            # But with the MAP_OF_LUSTER
            # results in the following text
            htmltext = "30411-02.htm"
        elif npcId == 30411 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(
                    MAP_OF_LUSTER) != 0 and st.getQuestItemsCount(
                        KEY_OF_FLAME) != 0:
            # Talking to the Flame Salamander when Cond != 0
            # while we have a KEY_OF_FLAME from the ratmen and the MAP_OF_LUSTER

            # Remove both Items and give a FLAME_EARING
            # Set the cond flag to 4 to signify we have State.COMPLETED the first part
            st.takeItems(KEY_OF_FLAME, st.getQuestItemsCount(KEY_OF_FLAME))
            st.takeItems(MAP_OF_LUSTER, st.getQuestItemsCount(MAP_OF_LUSTER))
            if st.getQuestItemsCount(FLAME_EARING) == 0:
                st.giveItems(FLAME_EARING, 1)
            htmltext = "30411-03.htm"
            st.set("cond", "4")
        elif npcId == 30411 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(FLAME_EARING) != 0:
            # Talking to the Flame Salamander
            # after finishing the Fire component results
            # in the following text
            htmltext = "30411-04.htm"
        elif npcId == 30412 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(
                    FLAME_EARING) != 0 and st.getQuestItemsCount(
                        BROKEN_BRONZE_MIRROR) == 0 and st.getQuestItemsCount(
                            WIND_BANGEL) == 0:
            # Talking to the Wind Sylph for the first time
            # With a FLAME_EARING (fire component complete)

            # Gives us a BROKEN_BRONZE_MIRROR
            # and sets cond = 5
            if st.getQuestItemsCount(BROKEN_BRONZE_MIRROR) == 0:
                st.giveItems(BROKEN_BRONZE_MIRROR, 1)
            htmltext = "30412-01.htm"
            st.set("cond", "5")
        elif npcId == 30412 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(
                    BROKEN_BRONZE_MIRROR) != 0 and st.getQuestItemsCount(
                        WIND_FEATHER) == 0:
            # Talking to the Wind Sylph for a second time
            # results in the following text
            htmltext = "30412-02.htm"
        elif npcId == 30412 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(
                    BROKEN_BRONZE_MIRROR) != 0 and st.getQuestItemsCount(
                        WIND_FEATHER) != 0:
            # Talking to the Wind Sylph with cond != 0
            # while having a BROKEN_BRONZE_MIRROR and a WIND_FEATHER

            # Removes both items
            # Gives a WIND_BANGEL
            # and sets cond = 7
            st.takeItems(WIND_FEATHER, st.getQuestItemsCount(WIND_FEATHER))
            st.takeItems(BROKEN_BRONZE_MIRROR,
                         st.getQuestItemsCount(BROKEN_BRONZE_MIRROR))
            if st.getQuestItemsCount(WIND_BANGEL) == 0:
                st.giveItems(WIND_BANGEL, 1)
            htmltext = "30412-03.htm"
            st.set("cond", "7")
        elif npcId == 30412 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(WIND_BANGEL) != 0:
            # Talking to the Wind Sylph after we get the WIND_BANGLE
            # results in the following text
            htmltext = "30412-04.htm"
        elif npcId == 30410 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(
                    BROKEN_BRONZE_MIRROR) != 0 and st.getQuestItemsCount(
                        WIND_FEATHER) == 0:
            # Talking to the Lizardman of the Wastelands for the first time
            # begins this conversation
            htmltext = "30410-01.htm"
        elif npcId == 30410 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(
                    BROKEN_BRONZE_MIRROR) != 0 and st.getQuestItemsCount(
                        WIND_FEATHER) != 0:
            # Talking to the Lizardman of the Wastelands after obtaining
            # the WIND_FEATHER
            htmltext = "30410-04.htm"
        elif npcId == 30413 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(
                    WIND_BANGEL) != 0 and st.getQuestItemsCount(
                        RAMAS_DIARY) == 0 and st.getQuestItemsCount(
                            WATER_NECKLACE) == 0:
            # Talking to the Water Undine for the first time
            # gives RAMAS_DIARY
            # and sets cond = 8
            if st.getQuestItemsCount(RAMAS_DIARY) == 0:
                st.giveItems(RAMAS_DIARY, 1)
            htmltext = "30413-01.htm"
            st.set("cond", "8")
        elif npcId == 30413 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(
                    RAMAS_DIARY) != 0 and st.getQuestItemsCount(
                        SPARKLE_PEBBLE) < 2:
            # Talking to the Water Undine for a second time
            # without 2 SPARKLE_PEBLE
            htmltext = "30413-02.htm"
        elif npcId == 30413 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(
                    RAMAS_DIARY) != 0 and st.getQuestItemsCount(
                        SPARKLE_PEBBLE) >= 2:
            # Talking to the Water Undine with the 2 SPARKLE_PEBLE

            # removes both items
            # and gives WATER_NECKLACE
            # sets cond = 10
            st.takeItems(SPARKLE_PEBBLE, st.getQuestItemsCount(SPARKLE_PEBBLE))
            st.takeItems(RAMAS_DIARY, st.getQuestItemsCount(RAMAS_DIARY))
            if st.getQuestItemsCount(WATER_NECKLACE) == 0:
                st.giveItems(WATER_NECKLACE, 1)
            htmltext = "30413-03.htm"
            st.set("cond", "10")
        elif npcId == 30413 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(WATER_NECKLACE) != 0:
            # Talking to the Water Undine after completing it's task
            htmltext = "30413-04.htm"
        elif npcId == 30409 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(
                    WATER_NECKLACE) != 0 and st.getQuestItemsCount(
                        RUST_GOLD_COIN) == 0 and st.getQuestItemsCount(
                            EARTH_RING) == 0:
            # Talking to the Earth Snake for the first time
            if st.getQuestItemsCount(RUST_GOLD_COIN) == 0:
                st.giveItems(RUST_GOLD_COIN, 1)
            htmltext = "30409-01.htm"
            st.set("cond", "11")
        elif npcId == 30409 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(
                    RUST_GOLD_COIN) != 0 and st.getQuestItemsCount(
                        RED_SOIL) == 0:
            # Talking to the Earth Snake for a second time
            # without RED_SOIL
            htmltext = "30409-02.htm"
        elif npcId == 30409 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(
                    RUST_GOLD_COIN) != 0 and st.getQuestItemsCount(
                        RED_SOIL) != 0:
            # Talking to the Earth Snake afket collecting the RED_SOIL

            # Gives EARTH_RING
            # and sets cond = 13
            st.takeItems(RED_SOIL, st.getQuestItemsCount(RED_SOIL))
            st.takeItems(RUST_GOLD_COIN, st.getQuestItemsCount(RUST_GOLD_COIN))
            if st.getQuestItemsCount(EARTH_RING) == 0:
                st.giveItems(EARTH_RING, 1)
            htmltext = "30409-03.htm"
            st.set("cond", "13")
        elif npcId == 30409 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(EARTH_RING) != 0:
            # Talking to the Earth Snake after completing his task
            htmltext = "30409-03.htm"
        elif npcId == 30391 and st.getInt(
                "cond") != 0 and st.getQuestItemsCount(
                    FLAME_EARING) != 0 and st.getQuestItemsCount(
                        WIND_BANGEL) != 0 and st.getQuestItemsCount(
                            WATER_NECKLACE) != 0 and st.getQuestItemsCount(
                                EARTH_RING) != 0:
            # Talking to Parina after gathering all 4 tokens
            # Gains BEAD_OF_SEASON
            # Resets cond so these NPC's will no longer speak to you
            # and Sets the quest as State.COMPLETED
            st.takeItems(FLAME_EARING, st.getQuestItemsCount(FLAME_EARING))
            st.takeItems(WIND_BANGEL, st.getQuestItemsCount(WIND_BANGEL))
            st.takeItems(WATER_NECKLACE, st.getQuestItemsCount(WATER_NECKLACE))
            st.takeItems(EARTH_RING, st.getQuestItemsCount(EARTH_RING))
            if player.getLevel() >= 20:
                st.addExpAndSp(32053, 2315)
            elif player.getLevel() == 19:
                st.addExpAndSp(45612, 2985)
            else:
                st.addExpAndSp(59172, 3654)
            st.giveItems(57, 16380)
            st.set("cond", "0")
            st.exitQuest(False)
            st.saveGlobalQuestVar("1ClassQuestFinished", "1")
            player.sendPacket(SocialAction(player, 3))
            st.playSound("ItemSound.quest_finish")
            if st.getQuestItemsCount(BEAD_OF_SEASON) == 0:
                st.giveItems(BEAD_OF_SEASON, 1)
            htmltext = "30391-06.htm"

        return htmltext
Beispiel #11
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        st = player.getQuestState(qn)
        if not st: return htmltext

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

        if id == State.CREATED:
            st.set("cond", "0")
            st.set("onlyone", "0")
        if npcId == 30416 and st.getInt("cond") == 0:
            if st.getQuestItemsCount(IRON_HEART) == 0:
                htmltext = "30416-01.htm"
            else:
                htmltext = "30416-04.htm"
        elif npcId == 30416 and st.getInt("cond") >= 1:
            if st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 0 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 0 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 1 and st.getQuestItemsCount(IRON_HEART) == 0:
                htmltext = "30416-06.htm"
                st.takeItems(ARKENIA_RECOMMEND, 1)
                st.giveItems(IRON_HEART, 1)
                isFinished = st.getGlobalQuestVar("1ClassQuestFinished")
                if isFinished == "":
                    if player.getLevel() >= 20:
                        st.addExpAndSp(32053, 3583)
                    elif player.getLevel() == 19:
                        st.addExpAndSp(45612, 3583)
                    else:
                        st.addExpAndSp(59172, 4252)
                    st.giveItems(57, 16380)
                player.sendPacket(SocialAction(player, 3))
                st.set("cond", "0")
                st.exitQuest(False)
                st.saveGlobalQuestVar("1ClassQuestFinished", "1")
                st.playSound("ItemSound.quest_finish")
            elif st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 1 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 0 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 0 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 0 and st.getQuestItemsCount(
                                IRON_HEART) == 0 and st.getQuestItemsCount(
                                    SHILENS_CALL) == 0:
                htmltext = "30416-07.htm"
            elif st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 1 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 0 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 0 and st.getQuestItemsCount(
                                IRON_HEART) == 0 and st.getQuestItemsCount(
                                    SHILENS_CALL) == 0:
                htmltext = "30416-08.htm"
            elif st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 0 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 0 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 0 and st.getQuestItemsCount(
                                IRON_HEART) == 0 and st.getQuestItemsCount(
                                    SHILENS_CALL) == 0:
                htmltext = "30416-09.htm"
            elif st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 0 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 1 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 0 and st.getQuestItemsCount(
                                IRON_HEART) == 0 and st.getQuestItemsCount(
                                    SHILENS_CALL) == 0:
                htmltext = "30416-10.htm"
            elif st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 0 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 0 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 0 and st.getQuestItemsCount(
                                IRON_HEART) == 0 and st.getQuestItemsCount(
                                    SHILENS_CALL) == 1:
                htmltext = "30416-11.htm"
        elif npcId == 30419 and st.getInt("cond") >= 1:
            if st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 0 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 0 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 0 and st.getQuestItemsCount(
                                IRON_HEART) == 0 and st.getQuestItemsCount(
                                    SHILENS_CALL) == 1:
                htmltext = "30419-01.htm"
            elif st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 1 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 0 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 0 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 0 and st.getQuestItemsCount(
                                IRON_HEART) == 0 and st.getQuestItemsCount(
                                    SHILENS_CALL) == 0:
                htmltext = "30419-07.htm"
            elif st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 0 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 1 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 0 and st.getQuestItemsCount(
                                IRON_HEART) == 0 and st.getQuestItemsCount(
                                    SHILENS_CALL) == 0:
                htmltext = "30419-08.htm"
                st.giveItems(ARKENIA_RECOMMEND, 1)
                st.takeItems(SHILENS_TEARS, 1)
                st.set("cond", "7")
                st.playSound("ItemSound.quest_middle")
            elif st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 0 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 0 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 1 and st.getQuestItemsCount(
                                IRON_HEART) == 0 and st.getQuestItemsCount(
                                    SHILENS_CALL) == 0:
                htmltext = "30419-09.htm"
            elif st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 1 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 0 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 0 and st.getQuestItemsCount(
                                IRON_HEART) == 0 and st.getQuestItemsCount(
                                    SHILENS_CALL) == 0:
                htmltext = "30419-10.htm"
            elif st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 0 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 0 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 0 and st.getQuestItemsCount(
                                IRON_HEART) == 0 and st.getQuestItemsCount(
                                    SHILENS_CALL) == 0:
                htmltext = "30419-11.htm"
        elif npcId == 30382 and st.getInt("cond") >= 1:
            if st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 1 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 0 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 0 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 0 and st.getQuestItemsCount(
                                IRON_HEART) == 0 and st.getQuestItemsCount(
                                    SHILENS_CALL
                                ) == 0 and st.getQuestItemsCount(
                                    ONYX_BEASTS_MOLAR) == 0:
                htmltext = "30382-01.htm"
            elif st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 1 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 0 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 0 and st.getQuestItemsCount(
                                IRON_HEART) == 0 and st.getQuestItemsCount(
                                    SHILENS_CALL
                                ) == 0 and st.getQuestItemsCount(
                                    ONYX_BEASTS_MOLAR) == 0:
                htmltext = "30382-05.htm"
            elif st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 1 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 0 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 0 and st.getQuestItemsCount(
                                IRON_HEART) == 0 and st.getQuestItemsCount(
                                    SHILENS_CALL
                                ) == 0 and st.getQuestItemsCount(
                                    ONYX_BEASTS_MOLAR) < 10:
                htmltext = "30382-06.htm"
            elif st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 1 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 0 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 0 and st.getQuestItemsCount(
                                IRON_HEART) == 0 and st.getQuestItemsCount(
                                    SHILENS_CALL
                                ) == 0 and st.getQuestItemsCount(
                                    ONYX_BEASTS_MOLAR) >= 10:
                st.set("cond", "5")
                st.playSound("ItemSound.quest_middle")
                htmltext = "30382-07.htm"
                st.takeItems(ONYX_BEASTS_MOLAR, 10)
                st.takeItems(LEIKANS_NOTE, 1)
            elif st.getQuestItemsCount(SHILENS_TEARS) == 1:
                htmltext = "30382-08.htm"
            elif st.getInt("cond") >= 1 and st.getQuestItemsCount(
                    ARKENIAS_LETTER) == 0 and st.getQuestItemsCount(
                        LEIKANS_NOTE) == 0 and st.getQuestItemsCount(
                            SHILENS_TEARS) == 0 and st.getQuestItemsCount(
                                ARKENIA_RECOMMEND
                            ) == 0 and st.getQuestItemsCount(
                                IRON_HEART) == 0 and st.getQuestItemsCount(
                                    SHILENS_CALL
                                ) == 0 and st.getQuestItemsCount(
                                    ONYX_BEASTS_MOLAR) == 0:
                htmltext = "30382-09.htm"
        return htmltext
Beispiel #12
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        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 = Quest.getAlreadyCompletedMsg(player)

        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(62912, 4080)
            st.giveItems(7562, 49)
            st.giveItems(ADENA, 11464)
            player.sendPacket(SocialAction(player, 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))
        elif npcId == 30650 and cond >= 9 and st.getQuestItemsCount(
                GREY_BADGE) and st.getQuestItemsCount(BOOK_OF_GERALD):
            htmltext = "30650-04.htm"
            st.giveAdena(100000, False)
            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 #13
0
 def onTalk(self, npc, player):
     htmltext = Quest.getNoQuestMsg(player)
     st = player.getQuestState(qn)
     if not st: return htmltext
     npcId = npc.getNpcId()
     id = st.getState()
     cond = st.getInt("cond")
     if id == State.COMPLETED:
         htmltext = Quest.getAlreadyCompletedMsg(player)
     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, 3))
             st.takeItems(Recommend, -1)
             st.giveItems(certificate, 1)
             st.exitQuest(False)
             st.playSound("ItemSound.quest_finish")
             st.giveItems(57, 35597)
             st.addExpAndSp(196875, 13510)
     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 #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 == "":
             if player.getLevel() >= 20:
                 st.addExpAndSp(32053, 2299)
             elif player.getLevel() == 19:
                 st.addExpAndSp(45612, 2969)
             else:
                 st.addExpAndSp(59172, 3638)
             st.giveItems(57, 16380)
         player.sendPacket(SocialAction(player, 3))
         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 onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        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)
            if player.getLevel() >= 20:
                st.addExpAndSp(16026, 1149)
            elif player.getLevel() == 19:
                st.addExpAndSp(22806, 1484)
            else:
                st.addExpAndSp(29586, 1819)
            st.giveItems(57, 8190)
            player.sendPacket(SocialAction(player, 3))
            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 #16
0
 def onEvent(self, event, st):
     htmltext = event
     player = st.getPlayer()
     if event == "30527_1":
         if player.getClassId().getId() != 0x35:
             if player.getClassId().getId() == 0x38:
                 htmltext = "30527-02a.htm"
             else:
                 htmltext = "30527-02.htm"
         else:
             if player.getLevel() < 18:
                 htmltext = "30527-03.htm"
             else:
                 if st.getQuestItemsCount(PASS_FINAL) != 0:
                     htmltext = "30527-04.htm"
                 else:
                     htmltext = "30527-05.htm"
                     return htmltext
     elif event == "30527_2":
         htmltext = "30527-11.htm"
         st.takeItems(TOTEM_SPIRIT_CLAW, 1)
         st.giveItems(TATARUS_LETTER, 1)
     elif event == "1":
         st.set("id", "0")
         st.set("cond", "1")
         st.setState(State.STARTED)
         st.playSound("ItemSound.quest_accept")
         htmltext = "30527-06.htm"
         st.giveItems(SILVERYS_RING, 1)
     elif event == "30317_1":
         htmltext = "30317-02.htm"
     elif event == "30317_2":
         htmltext = "30317-05.htm"
     elif event == "30317_3":
         htmltext = "30317-03.htm"
     elif event == "30317_4":
         htmltext = "30317-04.htm"
         st.giveItems(KLUTOS_LETTER, 1)
         st.set("cond", "4")
     elif event == "30317_5":
         htmltext = "30317-06.htm"
     elif event == "30317_6":
         htmltext = "30317-07.htm"
         st.giveItems(KLUTOS_LETTER, 1)
         st.set("cond", "4")
     elif event == "30317_7":
         if st.getQuestItemsCount(PASS_1ST) and st.getQuestItemsCount(PASS_2ND) and st.getQuestItemsCount(
                 SECRET_BOX2):
             htmltext = "30317-10.htm"
             st.takeItems(PASS_1ST, 1)
             st.takeItems(PASS_2ND, 1)
             st.takeItems(SECRET_BOX2, 1)
             st.giveItems(PASS_FINAL, 1)
             isFinished = st.getGlobalQuestVar("1ClassQuestFinished")
             if isFinished == "":
                 if player.getLevel() >= 20:
                     st.addExpAndSp(32053, 3245)
                 elif player.getLevel() == 19:
                     st.addExpAndSp(45612, 3015)
                 else:
                     st.addExpAndSp(59172, 3684)
                 st.giveItems(57, 16380)
             st.set("cond", "0")
             st.exitQuest(False)
             st.saveGlobalQuestVar("1ClassQuestFinished", "1")
             st.playSound("ItemSound.quest_finish")
             player.sendPacket(SocialAction(player, 3))
         else:
             htmltext = "30317-08.htm"
     elif event == "30317_8":
         htmltext = "30317-11.htm"
     elif event == "30317_9":
         if st.getQuestItemsCount(PASS_1ST) and st.getQuestItemsCount(PASS_2ND) and st.getQuestItemsCount(
                 SECRET_BOX2):
             htmltext = "30317-12.htm"
             st.takeItems(PASS_1ST, 1)
             st.takeItems(PASS_2ND, 1)
             st.takeItems(SECRET_BOX2, 1)
             st.giveItems(PASS_FINAL, 1)
             if player.getLevel() >= 20:
                 st.addExpAndSp(16026, 1172)
             elif player.getLevel() == 19:
                 st.addExpAndSp(22806, 1507)
             else:
                 st.addExpAndSp(29586, 1842)
             st.giveItems(57, 8190)
             st.set("cond", "0")
             st.exitQuest(False)
             st.playSound("ItemSound.quest_finish")
             player.sendPacket(SocialAction(player, 3))
         else:
             htmltext = "30317-08.htm"
     elif event == "30298_1":
         htmltext = "30298-02.htm"
     elif event == "30298_2":
         htmltext = "30298-03.htm"
         st.takeItems(KLUTOS_LETTER, 1)
         st.giveItems(FOOTPRINT, 1)
         st.set("cond", "5")
     elif event == "30298_3":
         htmltext = "30298-06.htm"
         st.takeItems(SECRET_BOX1, 1)
         st.takeItems(FOOTPRINT, 1)
         st.giveItems(SECRET_BOX2, 1)
         st.giveItems(PASS_2ND, 1)
         st.set("cond", "7")
     return htmltext
Beispiel #17
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(51473, 3338)
         st.giveItems(57, 9380)
         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(), 3))
     elif event == "30103_4":
         st.addExpAndSp(51473, 3338)
         st.giveItems(57, 9380)
         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(), 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 #18
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        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 = Quest.getAlreadyCompletedMsg(player)

        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, 3))
                    st.addExpAndSp(72411, 4832)
                    st.giveItems(57, 13136)
                    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 #19
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        st = player.getQuestState(qn)
        if not st: return htmltext

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

        cond = st.getInt("cond")
        if npcId == 30524 and cond == 0:
            htmltext = "30524-01.htm"
        elif npcId == 30524 and cond and st.getQuestItemsCount(PIPIS_LETTER):
            htmltext = "30524-06.htm"
        elif npcId == 30524 and cond and st.getQuestItemsCount(
                PIPIS_LETTER) == 0:
            htmltext = "30524-07.htm"
        elif npcId == 30519 and cond and st.getQuestItemsCount(PIPIS_LETTER):
            htmltext = "30519-01.htm"
        elif npcId == 30519 and cond and (
            (st.getQuestItemsCount(CHALIS_AXE) +
             st.getQuestItemsCount(BRONKS_INGOT) +
             st.getQuestItemsCount(ZIMENFS_POTION))
                == 1) and ((st.getInt("id") / 10) == 0):
            htmltext = "30519-05.htm"
        elif npcId == 30519 and cond and (
            (st.getQuestItemsCount(CHALIS_AXE) +
             st.getQuestItemsCount(BRONKS_INGOT) +
             st.getQuestItemsCount(ZIMENFS_POTION))
                == 1) and ((st.getInt("id") / 10)):
            htmltext = "30519-08.htm"
        elif npcId == 30519 and cond and ((st.getQuestItemsCount(CHALIS_PAY) +
                                           st.getQuestItemsCount(BRONKS_PAY) +
                                           st.getQuestItemsCount(ZIMENFS_PAY))
                                          == 1) and (st.getInt("id") < 50):
            htmltext = "30519-12.htm"
        elif npcId == 30519 and cond and ((st.getQuestItemsCount(CHALIS_PAY) +
                                           st.getQuestItemsCount(BRONKS_PAY) +
                                           st.getQuestItemsCount(ZIMENFS_PAY))
                                          == 1) and (st.getInt("id") >= 50):
            htmltext = "30519-15.htm"
            st.giveItems(MIONS_LETTER, 1)
            st.takeItems(CHALIS_PAY, 1)
            st.takeItems(ZIMENFS_PAY, 1)
            st.takeItems(BRONKS_PAY, 1)
            st.set("cond", "4")
        elif npcId == 30519 and cond and st.getQuestItemsCount(MIONS_LETTER):
            htmltext = "30519-13.htm"
        elif npcId == 30519 and cond and (
                st.getQuestItemsCount(BEAR_PIC)
                or st.getQuestItemsCount(TARANTULA_PIC)
                or st.getQuestItemsCount(BEAD_PARCEL)
                or st.getQuestItemsCount(ROUTS_TP_SCROLL)
                or st.getQuestItemsCount(SUCCUBUS_UNDIES)):
            htmltext = "30519-14.htm"
        elif npcId == 30517 and cond and st.getQuestItemsCount(
                CHALIS_AXE) == 1 and st.getInt("id") < 20:
            htmltext = "30517-01.htm"
            st.takeItems(CHALIS_AXE, 1)
            st.giveItems(CHALIS_PAY, 1)
            if st.getInt("id") >= 50:
                st.set("cond", "3")
            st.set("id", str(st.getInt("id") + 10))
        elif npcId == 30517 and cond and st.getQuestItemsCount(
                CHALIS_AXE) == 1 and st.getInt("id") >= 20:
            htmltext = "30517-02.htm"
            st.takeItems(CHALIS_AXE, 1)
            st.giveItems(CHALIS_PAY, 1)
            if st.getInt("id") >= 50:
                st.set("cond", "3")
            st.set("id", str(st.getInt("id") + 10))
        elif npcId == 30517 and cond and st.getQuestItemsCount(
                CHALIS_PAY) == 1:
            htmltext = "30517-03.htm"
        elif npcId == 30525 and cond and st.getQuestItemsCount(
                BRONKS_INGOT) == 1 and st.getInt("id") < 20:
            htmltext = "30525-01.htm"
            st.takeItems(BRONKS_INGOT, 1)
            st.giveItems(BRONKS_PAY, 1)
            if st.getInt("id") >= 50:
                st.set("cond", "3")
            st.set("id", str(st.getInt("id") + 10))
        elif npcId == 30525 and cond and st.getQuestItemsCount(
                BRONKS_INGOT) == 1 and st.getInt("id") >= 20:
            htmltext = "30525-02.htm"
            st.takeItems(BRONKS_INGOT, 1)
            st.giveItems(BRONKS_PAY, 1)
            if st.getInt("id") >= 50:
                st.set("cond", "3")
            st.set("id", str(st.getInt("id") + 10))
        elif npcId == 30525 and cond and st.getQuestItemsCount(
                BRONKS_PAY) == 1:
            htmltext = "30525-03.htm"
        elif npcId == 30538 and cond and st.getQuestItemsCount(
                ZIMENFS_POTION) == 1 and st.getInt("id") < 20:
            htmltext = "30538-01.htm"
            st.takeItems(ZIMENFS_POTION, 1)
            st.giveItems(ZIMENFS_PAY, 1)
            if st.getInt("id") >= 50:
                st.set("cond", "3")
            st.set("id", str(st.getInt("id") + 10))
        elif npcId == 30538 and cond and st.getQuestItemsCount(
                ZIMENFS_POTION) == 1 and st.getInt("id") >= 20:
            htmltext = "30538-02.htm"
            st.takeItems(ZIMENFS_POTION, 1)
            st.giveItems(ZIMENFS_PAY, 1)
            if st.getInt("id") >= 50:
                st.set("cond", "3")
            st.set("id", str(st.getInt("id") + 10))
        elif npcId == 30538 and cond and st.getQuestItemsCount(
                ZIMENFS_PAY) == 1:
            htmltext = "30538-03.htm"
        elif npcId == 30556 and cond and st.getQuestItemsCount(
                MIONS_LETTER) == 1:
            htmltext = "30556-01.htm"
            st.takeItems(MIONS_LETTER, 1)
            st.giveItems(BEAR_PIC, 1)
            st.set("cond", "5")
            st.set("id", str(0))
        elif npcId == 30556 and cond and st.getQuestItemsCount(
                BEAR_PIC) == 1 and st.getQuestItemsCount(HONEY_JAR) < 5:
            htmltext = "30556-02.htm"
        elif npcId == 30556 and cond and st.getQuestItemsCount(
                BEAR_PIC) == 1 and st.getQuestItemsCount(HONEY_JAR) >= 5:
            htmltext = "30556-03.htm"
            st.takeItems(HONEY_JAR, st.getQuestItemsCount(HONEY_JAR))
            st.takeItems(BEAR_PIC, 1)
            st.giveItems(TARANTULA_PIC, 1)
            st.set("cond", "7")
        elif npcId == 30556 and cond and st.getQuestItemsCount(
                TARANTULA_PIC) == 1 and st.getQuestItemsCount(BEAD) < 20:
            htmltext = "30556-04.htm"
        elif npcId == 30556 and cond and st.getQuestItemsCount(
                TARANTULA_PIC) == 1 and st.getQuestItemsCount(BEAD) >= 20:
            htmltext = "30556-05.htm"
            st.takeItems(BEAD, st.getQuestItemsCount(BEAD))
            st.takeItems(TARANTULA_PIC, 1)
            st.giveItems(BEAD_PARCEL, 1)
            st.set("cond", "9")
        elif npcId == 30556 and cond and st.getQuestItemsCount(BEAD_PARCEL):
            htmltext = "30556-06.htm"
        elif npcId == 30556 and cond and (
                st.getQuestItemsCount(ROUTS_TP_SCROLL)
                or st.getQuestItemsCount(SUCCUBUS_UNDIES)):
            htmltext = "30556-07.htm"
        elif npcId == 30316 and cond and st.getQuestItemsCount(
                BEAD_PARCEL) == 1:
            htmltext = "30316-01.htm"
        elif npcId == 30316 and cond and st.getQuestItemsCount(
                ROUTS_TP_SCROLL) == 1:
            htmltext = "30316-04.htm"
        elif npcId == 30316 and cond and st.getQuestItemsCount(
                SUCCUBUS_UNDIES) == 1:
            htmltext = "30316-05.htm"
            st.takeItems(SUCCUBUS_UNDIES, 1)
            st.giveItems(RING_OF_RAVEN, 1)
            isFinished = st.getGlobalQuestVar("1ClassQuestFinished")
            if isFinished == "":
                if player.getLevel() >= 20:
                    st.addExpAndSp(16026, 1770)
                elif player.getLevel() == 19:
                    st.addExpAndSp(22806, 2105)
                else:
                    st.addExpAndSp(29586, 2440)
                st.giveItems(57, 8190)
            st.set("cond", "0")
            st.exitQuest(False)
            st.saveGlobalQuestVar("1ClassQuestFinished", "1")
            st.playSound("ItemSound.quest_finish")
            player.sendPacket(SocialAction(player, 3))
        elif npcId == 30557 and cond and st.getQuestItemsCount(
                ROUTS_TP_SCROLL) == 1:
            htmltext = "30557-01.htm"
        return htmltext
Beispiel #20
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        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 = Quest.getAlreadyCompletedMsg(player)

        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(44744, 3070)
                    st.giveItems(57, 8090)
                    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(), 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 #21
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        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 = Quest.getAlreadyCompletedMsg(player)

        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(59997, 4004)
            st.giveItems(57, 10884)
            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, 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 #22
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        st = player.getQuestState(qn)
        if not st: return htmltext

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

        if npcId == 30379 and st.getInt("cond") == 0:
            htmltext = "30379-01.htm"
        elif npcId == 30379 and st.getInt("cond"):
            if st.getQuestItemsCount(
                    HORSESHOE_OF_LIGHT) == 0 and HaveAllStolenItems(st):
                htmltext = "30379-09.htm"
                isFinished = st.getGlobalQuestVar("1ClassQuestFinished")
                if isFinished == "":
                    if player.getLevel() >= 20:
                        st.addExpAndSp(32053, 2023)
                    elif player.getLevel() == 19:
                        st.addExpAndSp(45612, 2693)
                    else:
                        st.addExpAndSp(59172, 3362)
                    st.giveItems(57, 16380)
                st.giveItems(BEZIQUES_RECOMMENDATION, 1)
                st.takeItems(NETIS_BOW, 1)
                st.takeItems(NETIS_DAGGER, 1)
                st.takeItems(WANTED_BILL, 1)
                for i in STOLEN_ITEM.keys():
                    st.takeItems(STOLEN_ITEM[i], -1)
                st.set("cond", "0")
                st.exitQuest(False)
                st.saveGlobalQuestVar("1ClassQuestFinished", "1")
                st.playSound("ItemSound.quest_finish")
                player.sendPacket(SocialAction(player, 3))
            elif st.getQuestItemsCount(
                    HORSESHOE_OF_LIGHT
            ) == 0 and st.getQuestItemsCount(BEZIQUES_LETTER) > 0:
                htmltext = "30379-07.htm"
            elif st.getQuestItemsCount(HORSESHOE_OF_LIGHT) > 0:
                htmltext = "30379-08.htm"
                st.takeItems(HORSESHOE_OF_LIGHT, 1)
                st.giveItems(WANTED_BILL, 1)
                st.set("cond", "5")
            elif st.getQuestItemsCount(NETIS_BOW) and st.getQuestItemsCount(
                    NETIS_DAGGER) and st.getQuestItemsCount(WANTED_BILL) == 0:
                htmltext = "30379-10.htm"
            elif st.getQuestItemsCount(WANTED_BILL):
                htmltext = "30379-11.htm"
        elif npcId == 30425 and st.getInt(
                "cond") and st.getQuestItemsCount(BEZIQUES_LETTER) > 0:
            htmltext = "30425-01.htm"
        elif npcId == 30425 and st.getInt("cond") and st.getQuestItemsCount(
                HORSESHOE_OF_LIGHT) == 0 and st.getQuestItemsCount(
                    BEZIQUES_LETTER) == 0:
            if st.getQuestItemsCount(SPATOIS_BONES) < 10:
                htmltext = "30425-06.htm"
            elif st.getQuestItemsCount(WANTED_BILL):
                htmltext = "30425-08.htm"
            elif st.getQuestItemsCount(SPATOIS_BONES) >= 10:
                htmltext = "30425-07.htm"
                st.takeItems(SPATOIS_BONES,
                             st.getQuestItemsCount(SPATOIS_BONES))
                st.giveItems(HORSESHOE_OF_LIGHT, 1)
                st.set("cond", "4")
        elif npcId == 30425 and st.getInt(
                "cond") and st.getQuestItemsCount(HORSESHOE_OF_LIGHT) > 0:
            htmltext = "30425-08.htm"
        return htmltext
Beispiel #23
0
 def onEvent(self, event, st):
     htmltext = event
     classid = st.getPlayer().getClassId().getId()
     level = st.getPlayer().getLevel()
     squire = st.getQuestItemsCount(MARK_OF_ESQUIRE)
     player = st.getPlayer()
     coin1, coin2, coin3, coin4, coin5, coin6 = st.getQuestItemsCount(
         COIN_OF_LORDS1
     ), st.getQuestItemsCount(COIN_OF_LORDS2), st.getQuestItemsCount(
         COIN_OF_LORDS3), st.getQuestItemsCount(
             COIN_OF_LORDS4), st.getQuestItemsCount(
                 COIN_OF_LORDS5), st.getQuestItemsCount(COIN_OF_LORDS6)
     guards_mark1, guards_mark2, guards_mark3 = st.getQuestItemsCount(
         GLUDIO_GUARDS_MARK1), st.getQuestItemsCount(
             GLUDIO_GUARDS_MARK2), st.getQuestItemsCount(
                 GLUDIO_GUARDS_MARK3)
     church_mark1, church_mark2, church_mark3 = st.getQuestItemsCount(
         EINHASAD_CHURCH_MARK1), st.getQuestItemsCount(
             EINHASAD_CHURCH_MARK2), st.getQuestItemsCount(
                 EINHASAD_CHURCH_MARK3)
     if event == "30417-02a.htm":
         if classid == 0x00:
             if level >= 18:
                 if st.getQuestItemsCount(SWORD_OF_RITUAL) > 0:
                     htmltext = "30417-04.htm"
                 else:
                     htmltext = "30417-05.htm"
             else:
                 htmltext = "30417-02.htm"
                 st.exitQuest(1)
         elif classid != 0x04:
             htmltext = "30417-03.htm"
             st.exitQuest(1)
     elif event == "30417-08.htm":
         if st.getInt("cond") == 0 and classid == 0x00 and level >= 18:
             st.set("id", "0")
             st.set("cond", "1")
             st.setState(State.STARTED)
             st.playSound("ItemSound.quest_accept")
             st.giveItems(MARK_OF_ESQUIRE, 1)
         else:
             htmltext = Quest.getNoQuestMsg(player)
     elif event == "30332-02.htm":
         if squire and not guards_mark1 and not coin1:
             st.giveItems(GLUDIO_GUARDS_MARK1, 1)
         else:
             htmltext = Quest.getNoQuestMsg(player)
     elif event == "30289-03.htm":
         if squire and not church_mark1 and not coin2:
             st.giveItems(EINHASAD_CHURCH_MARK1, 1)
         else:
             htmltext = Quest.getNoQuestMsg(player)
     elif event == "30379-02.htm":
         if squire and not guards_mark2 and not coin3:
             st.giveItems(GLUDIO_GUARDS_MARK2, 1)
         else:
             htmltext = Quest.getNoQuestMsg(player)
     elif event == "30037-02.htm":
         if squire and not church_mark2 and not coin4:
             st.giveItems(EINHASAD_CHURCH_MARK2, 1)
         else:
             htmltext = Quest.getNoQuestMsg(player)
     elif event == "30039-02.htm":
         if squire and not guards_mark3 and not coin5:
             st.giveItems(GLUDIO_GUARDS_MARK3, 1)
         else:
             htmltext = Quest.getNoQuestMsg(player)
     elif event == "30031-02.htm":
         if squire and not church_mark3 and not coin6:
             st.giveItems(EINHASAD_CHURCH_MARK3, 1)
         else:
             htmltext = Quest.getNoQuestMsg(player)
     elif event == "30417-13.htm":
         if squire and (coin1 + coin2 + coin3 + coin4 + coin5 + coin6) >= 3:
             if player.getLevel() >= 20:
                 st.addExpAndSp(16026, 1157)
             elif player.getLevel() == 19:
                 st.addExpAndSp(22806, 1492)
             else:
                 st.addExpAndSp(29586, 1827)
             st.giveItems(57, 8190)
             for item in range(1162, 1180):
                 st.takeItems(item, -1)
             st.takeItems(MARK_OF_ESQUIRE, -1)
             st.giveItems(SWORD_OF_RITUAL, 1)
             st.set("cond", "0")
             st.exitQuest(False)
             st.saveGlobalQuestVar("1ClassQuestFinished", "1")
             st.playSound("ItemSound.quest_finish")
             player.sendPacket(SocialAction(player, 3))
         else:
             htmltext = Quest.getNoQuestMsg(player)
     elif event == "30417-14.htm":
         if squire and (coin1 + coin2 + coin3 + coin4 + coin5 + coin6) >= 3:
             if player.getLevel() >= 20:
                 st.addExpAndSp(16026, 1157)
             elif player.getLevel() == 19:
                 st.addExpAndSp(22806, 1492)
             else:
                 st.addExpAndSp(29586, 1827)
             st.giveItems(57, 8190)
             for item in range(1162, 1180):
                 st.takeItems(item, -1)
             st.takeItems(MARK_OF_ESQUIRE, -1)
             st.giveItems(SWORD_OF_RITUAL, 1)
             st.set("cond", "0")
             st.exitQuest(False)
             st.playSound("ItemSound.quest_finish")
             player.sendPacket(SocialAction(player, 3))
         else:
             htmltext = Quest.getNoQuestMsg(player)
     return htmltext
Beispiel #24
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        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()
        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 == "":
                    if player.getLevel() >= 20:
                        st.addExpAndSp(32053, 2621)
                    elif player.getLevel() == 19:
                        st.addExpAndSp(45612, 3291)
                    else:
                        st.addExpAndSp(59172, 3960)
                    st.giveItems(57, 16380)
                player.sendPacket(SocialAction(player, 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 #25
0
    def onTalk(self, npc, player):

        npcId = npc.getNpcId()
        htmltext = Quest.getNoQuestMsg(player)
        st = player.getQuestState(qn)
        if not st: return htmltext

        id = st.getState()
        if id == State.COMPLETED:
            htmltext = Quest.getAlreadyCompletedMsg(player)
        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.rewardItems(1060, 100)  # Lesser Healing Potions
                    for item in range(4412, 4417):
                        st.rewardItems(item, 10)  # Echo crystals
                    st.addExpAndSp(41478, 3555)
                    player.sendPacket(SocialAction(player, 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 #26
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        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 == "":
                    if player.getLevel() >= 20:
                        st.addExpAndSp(32053, 2315)
                    elif player.getLevel() == 19:
                        st.addExpAndSp(45612, 2985)
                    else:
                        st.addExpAndSp(59172, 3332)
                    st.giveItems(57, 16380)
                player.sendPacket(SocialAction(player, 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
Beispiel #27
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        st = player.getQuestState(qn)
        if not st: return htmltext

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

        if npcId == 30330 and st.getInt("cond") == 0:
            htmltext = "30330-01.htm"
        elif npcId == 30330 and st.getInt("cond"):
            if st.getQuestItemsCount(SIDRAS_LETTER1) == 1:
                htmltext = "30330-07.htm"
            elif st.getQuestItemsCount(BLANK_SHEET1) > 0 or st.getQuestItemsCount(BLOODY_RUNE1) == 1:
                htmltext = "30330-08.htm"
            elif st.getQuestItemsCount(ANDARIEL_BOOK) == 0 and st.getQuestItemsCount(
                    PRAYER_OF_ADON) + st.getQuestItemsCount(GARMIEL_BOOK) + st.getQuestItemsCount(
                PENITENTS_MARK) + st.getQuestItemsCount(ASHEN_BONES) > 0:
                htmltext = "30330-09.htm"
            elif st.getQuestItemsCount(ANDARIEL_BOOK) == 1 and st.getQuestItemsCount(GARMIEL_BOOK) == 1:
                htmltext = "30330-10.htm"
                st.takeItems(ANDARIEL_BOOK, 1)
                st.takeItems(GARMIEL_BOOK, 1)
                st.giveItems(ORB_OF_ABYSS, 1)
                isFinished = st.getGlobalQuestVar("1ClassQuestFinished")
                if isFinished == "":
                    if player.getLevel() >= 20:
                        st.addExpAndSp(32053, 2653)
                    elif player.getLevel() == 19:
                        st.addExpAndSp(45612, 3323)
                    else:
                        st.addExpAndSp(59172, 3992)
                    st.giveItems(57, 16380)
                st.set("cond", "0")
                st.exitQuest(False)
                st.saveGlobalQuestVar("1ClassQuestFinished", "1")
                st.playSound("ItemSound.quest_finish")
                player.sendPacket(SocialAction(player, 3))
        elif npcId == 30377 and st.getInt("cond"):
            if st.getQuestItemsCount(SIDRAS_LETTER1) == 1:
                htmltext = "30377-01.htm"
            elif st.getQuestItemsCount(BLANK_SHEET1) == 5 and st.getQuestItemsCount(BLOODY_RUNE1) == 0:
                htmltext = "30377-03.htm"
            elif st.getQuestItemsCount(BLOODY_RUNE1) > 0 and st.getQuestItemsCount(BLOODY_RUNE1) < 5:
                htmltext = "30377-04.htm"
            elif st.getQuestItemsCount(BLOODY_RUNE1) >= 5:
                htmltext = "30377-05.htm"
                st.takeItems(BLOODY_RUNE1, st.getQuestItemsCount(BLOODY_RUNE1))
                st.giveItems(GARMIEL_BOOK, 1)
                st.giveItems(PRAYER_OF_ADON, 1)
                st.set("cond", "4")
            elif st.getQuestItemsCount(PRAYER_OF_ADON) + st.getQuestItemsCount(PENITENTS_MARK) + st.getQuestItemsCount(
                    ASHEN_BONES) > 0:
                htmltext = "30377-06.htm"
            elif st.getQuestItemsCount(ANDARIEL_BOOK) == 1 and st.getQuestItemsCount(GARMIEL_BOOK) == 1:
                htmltext = "30377-07.htm"
        elif npcId == 30375 and st.getInt("cond"):
            if st.getQuestItemsCount(PRAYER_OF_ADON) == 1:
                htmltext = "30375-01.htm"
            elif st.getQuestItemsCount(PENITENTS_MARK) == 1 and st.getQuestItemsCount(
                    ASHEN_BONES) == 0 and st.getQuestItemsCount(ANDARIEL_BOOK) == 0:
                htmltext = "30375-05.htm"
            elif st.getQuestItemsCount(PENITENTS_MARK) == 1 and st.getQuestItemsCount(
                    ASHEN_BONES) < 10 and st.getQuestItemsCount(ASHEN_BONES) > 0:
                htmltext = "30375-06.htm"
            elif st.getQuestItemsCount(PENITENTS_MARK) == 1 and st.getQuestItemsCount(ASHEN_BONES) >= 10:
                htmltext = "30375-07.htm"
                st.takeItems(ASHEN_BONES, st.getQuestItemsCount(ASHEN_BONES))
                st.takeItems(PENITENTS_MARK, st.getQuestItemsCount(PENITENTS_MARK))
                st.giveItems(ANDARIEL_BOOK, 1)
                st.set("cond", "7")
            elif st.getQuestItemsCount(ANDARIEL_BOOK) == 1:
                htmltext = "30375-08.htm"
        return htmltext
Beispiel #28
0
    def onTalk(self, npc, player):
        htmltext = Quest.getNoQuestMsg(player)
        st = player.getQuestState(qn)
        if not st: return htmltext

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

        if npcId == 30293 and st.getInt("cond") == 0:
            if st.getQuestItemsCount(LEAF_OF_ORACLE) == 0:
                htmltext = "30293-01.htm"
                return htmltext
            else:
                htmltext = "30293-04.htm"
        elif npcId == 30293 and st.getInt("cond") and st.getQuestItemsCount(CRYSTAL_MEDALLION):
            if st.getQuestItemsCount(MONEY_OF_SWINDLER) == 0 and st.getQuestItemsCount(
                    DAIRY_OF_ALLANA) == 0 and st.getQuestItemsCount(
                LIZARD_CAPTAIN_ORDER) == 0 and st.getQuestItemsCount(HALF_OF_DAIRY) == 0:
                if st.getInt("cond"):
                    htmltext = "30293-09.htm"
                else:
                    htmltext = "30293-06.htm"
            else:
                if st.getQuestItemsCount(MONEY_OF_SWINDLER) == 1 and st.getQuestItemsCount(
                        DAIRY_OF_ALLANA) == 1 and st.getQuestItemsCount(
                    LIZARD_CAPTAIN_ORDER) == 1 and st.getQuestItemsCount(HALF_OF_DAIRY) == 0:
                    htmltext = "30293-08.htm"
                    st.takeItems(MONEY_OF_SWINDLER, 1)
                    st.takeItems(DAIRY_OF_ALLANA, 1)
                    st.takeItems(LIZARD_CAPTAIN_ORDER, 1)
                    st.takeItems(CRYSTAL_MEDALLION, 1)
                    st.giveItems(LEAF_OF_ORACLE, 1)
                    isFinished = st.getGlobalQuestVar("1ClassQuestFinished")
                    if isFinished == "":
                        if player.getLevel() >= 20:
                            st.addExpAndSp(32053, 2039)
                        elif player.getLevel() == 19:
                            st.addExpAndSp(45612, 2709)
                        else:
                            st.addExpAndSp(59172, 3378)
                        st.giveItems(57, 16380)
                    st.set("cond", "0")
                    st.exitQuest(False)
                    st.saveGlobalQuestVar("1ClassQuestFinished", "1")
                    st.playSound("ItemSound.quest_finish")
                    player.sendPacket(SocialAction(player, 3))
                else:
                    htmltext = "30293-07.htm"
        elif npcId == 30424 and st.getInt("cond") and st.getQuestItemsCount(CRYSTAL_MEDALLION):
            if st.getQuestItemsCount(MONEY_OF_SWINDLER) == 0 and st.getQuestItemsCount(
                    DAIRY_OF_ALLANA) == 0 and st.getQuestItemsCount(
                LIZARD_CAPTAIN_ORDER) == 0 and st.getQuestItemsCount(HALF_OF_DAIRY) == 0:
                if st.getInt("cond") > 2:
                    htmltext = "30424-05.htm"
                else:
                    htmltext = "30424-01.htm"
            elif st.getQuestItemsCount(MONEY_OF_SWINDLER) == 0 and st.getQuestItemsCount(
                    DAIRY_OF_ALLANA) == 0 and st.getQuestItemsCount(
                LIZARD_CAPTAIN_ORDER) == 1 and st.getQuestItemsCount(HALF_OF_DAIRY) == 0:
                htmltext = "30424-02.htm"
                st.giveItems(HALF_OF_DAIRY, 1)
                st.set("cond", "4")
            elif st.getQuestItemsCount(MONEY_OF_SWINDLER) == 0 and st.getQuestItemsCount(
                    DAIRY_OF_ALLANA) == 0 and st.getQuestItemsCount(
                LIZARD_CAPTAIN_ORDER) == 1 and st.getQuestItemsCount(HALF_OF_DAIRY) == 1:
                if st.getInt("cond") and st.getQuestItemsCount(TAMATOS_NECKLACE) == 0:
                    htmltext = "30424-06.htm"
                else:
                    htmltext = "30424-03.htm"
            elif st.getQuestItemsCount(MONEY_OF_SWINDLER) == 1 and st.getQuestItemsCount(
                    DAIRY_OF_ALLANA) == 0 and st.getQuestItemsCount(
                LIZARD_CAPTAIN_ORDER) == 1 and st.getQuestItemsCount(HALF_OF_DAIRY) == 1:
                htmltext = "30424-04.htm"
                st.takeItems(HALF_OF_DAIRY, 1)
                st.giveItems(DAIRY_OF_ALLANA, 1)
                st.set("cond", "7")
            else:
                if st.getQuestItemsCount(MONEY_OF_SWINDLER) == 1 and st.getQuestItemsCount(
                        LIZARD_CAPTAIN_ORDER) == 1 and st.getQuestItemsCount(
                    HALF_OF_DAIRY) == 0 and st.getQuestItemsCount(DAIRY_OF_ALLANA):
                    htmltext = "30424-05.htm"
        elif npcId == 30428 and st.getInt("cond") and st.getQuestItemsCount(
                CRYSTAL_MEDALLION) and st.getQuestItemsCount(LIZARD_CAPTAIN_ORDER):
            if st.getQuestItemsCount(TAMATOS_NECKLACE) == 1:
                st.giveItems(MONEY_OF_SWINDLER, 1)
                st.takeItems(TAMATOS_NECKLACE, 1)
                st.set("cond", "6")
                htmltext = "30428-04.htm"
            else:
                if st.getQuestItemsCount(MONEY_OF_SWINDLER) > 0:
                    htmltext = "30428-05.htm"
                else:
                    if st.getInt("cond") > 4:
                        htmltext = "30428-06.htm"
                    else:
                        htmltext = "30428-01.htm"
        return htmltext
Beispiel #29
0
    def onTalk(self, npc, player):

        npcId = npc.getNpcId()
        htmltext = Quest.getNoQuestMsg(player)
        st = player.getQuestState(qn)
        if not st: return htmltext

        id = st.getState()
        if npcId == 30568 and id == State.COMPLETED:
            htmltext = Quest.getAlreadyCompletedMsg(player)
        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.rewardItems(LESSER_HEALING_ID, 100)
                st.giveItems(BUTCHER_ID, 1)
                st.rewardItems(CRYSTAL_BATTLE, 10)
                st.rewardItems(CRYSTAL_LOVE, 10)
                st.rewardItems(CRYSTAL_SOLITUDE, 10)
                st.rewardItems(CRYSTAL_FEAST, 10)
                st.rewardItems(CRYSTAL_CELEBRATION, 10)
                # 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, 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 #30
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 == "":
             if player.getLevel() >= 20:
                 st.addExpAndSp(16026, 1264)
             elif player.getLevel() == 19:
                 st.addExpAndSp(22806, 1599)
             else:
                 st.addExpAndSp(29586, 1934)
             st.giveItems(57, 8190)
         player.sendPacket(SocialAction(player, 3))
         st.set("cond", "0")
         st.set("onlyone", "1")
         st.exitQuest(False)
         st.saveGlobalQuestVar("1ClassQuestFinished", "1")
         st.playSound("ItemSound.quest_finish")
     return htmltext