示例#1
0
  def onAdvEvent (self,event,npc,player) :
    htmltext = "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>"
    st = player.getQuestState(qn)

    if event == "Enter" : 
      FourSepulchersManager.getInstance().tryEntry(npc,player)
      return

    if not st : return

    elif event == "accept" :
      if int(st.get("cond")) == 0 :
        if st.getPlayer().getLevel() >= 74 :
          st.setState(State.STARTED)
          st.playSound("ItemSound.quest_accept")
          htmltext = "31453-12.htm"
          st.set("cond","1")
        else :
          htmltext = "31453-SNG.htm"
          st.exitQuest(1)

    elif event == "11" :
      if st.getQuestItemsCount(SEALED_BOX) >= 1 :
        htmltext = "31454-1.htm"
        st.takeItems(SEALED_BOX,1)
        if st.getRandom(1000000) < 700000 :
          cnt = 1370 + st.getRandom(1374)
          st.giveItems(REWARDS[0],cnt)

        if st.getRandom(1000000) < 2 :
          st.giveItems(REWARDS[1],1)

        if st.getRandom(1000000) < 2 :
          st.giveItems(REWARDS[2],1)

        if st.getRandom(1000000) < 8 :
          st.giveItems(REWARDS[3],1)

        if st.getRandom(1000000) < 54858 :
          st.giveItems(REWARDS[4],1)

        if st.getRandom(1000000) < 2 :
          st.giveItems(REWARDS[5],1)

        if st.getRandom(1000000) < 3841 :
          st.giveItems(REWARDS[6],1)

        if st.getRandom(1000000) < 3201 :
          st.giveItems(REWARDS[7],1)

        if st.getRandom(1000000) < 6401 :
          st.giveItems(REWARDS[8],1)

        if st.getRandom(1000000) < 440 :
          st.giveItems(REWARDS[9],1)

        if st.getRandom(1000000) < 440 :
          st.giveItems(REWARDS[10],1)

        if st.getRandom(1000000) < 483 :
          st.giveItems(REWARDS[11],1)

      else :
        htmltext = "31454-NG.htm"

    elif event == "12" :
      if st.getQuestItemsCount(GOBLETS[0]) >= 1 and st.getQuestItemsCount(GOBLETS[1]) >= 1 and st.getQuestItemsCount(GOBLETS[2]) >= 1 and st.getQuestItemsCount(GOBLETS[3]) >= 1 :
        st.takeItems(GOBLETS[0],1)
        st.takeItems(GOBLETS[1],1)
        st.takeItems(GOBLETS[2],1)
        st.takeItems(GOBLETS[3],1)
        st.giveItems(ANTIQUE_BROOCH,1)
        st.set("cond","2")
        st.playSound("ItemSound.quest_finish")
        htmltext = "31453-22.htm"
      else :
        htmltext = "31453-FNG.htm"

    elif event == "13" :
      st.playSound("ItemSound.quest_accept")
      st.exitQuest(1)
      htmltext = "END.htm"

    elif event == "14" :
      st.playSound("ItemSound.quest_accept")
      htmltext = "CONTINUE.htm"

    # Ghost Chamberlain of Elmoreden: Teleport to 4th sepulcher
    elif event == "15" :
      if st.getQuestItemsCount(ANTIQUE_BROOCH) >= 1 :
        st.getPlayer().teleToLocation(178298,-84574,-7216)
        htmltext = None
      elif st.getQuestItemsCount(GRAVE_PASS) >= 1 :
        st.takeItems(GRAVE_PASS,1)
        st.getPlayer().teleToLocation(178298,-84574,-7216)
        htmltext = None
      else :
        htmltext = "NG.htm"

    # Ghost Chamberlain of Elmoreden: Teleport to Imperial Tomb entrance
    elif event == "16" :
      if st.getQuestItemsCount(ANTIQUE_BROOCH) >= 1 :
        st.getPlayer().teleToLocation(186942,-75602,-2834)
        htmltext = None
      elif st.getQuestItemsCount(GRAVE_PASS) >= 1 :
        st.takeItems(GRAVE_PASS,1)
        st.getPlayer().teleToLocation(186942,-75602,-2834)
        htmltext = None
      else :
        htmltext = "NG.htm"

    # Teleport to Pilgrims Temple
    elif event == "17" :
      if st.getQuestItemsCount(ANTIQUE_BROOCH) >= 1 :
        st.getPlayer().teleToLocation(169590,-90218,-2914)
        htmltext = None
      elif st.getQuestItemsCount(GRAVE_PASS) >= 1 :
        st.takeItems(GRAVE_PASS,1)
        st.getPlayer().teleToLocation(169590,-90218,-2914)
        htmltext = None
      else :
        htmltext = "NG.htm"

    return htmltext
示例#2
0
 def onTalk (self,npc,player):
    htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
    st = player.getQuestState(qn)
    npcId = npc.getNpcId()
    id = st.getState()
    cond = st.getInt("cond")
    four = st.getInt("four")
    wigoth = st.getInt("wigoth")
    box = st.getInt("box")
    if not st : return htmltext

    if id == State.CREATED :
       if npcId == NS : # 無名的靈魂
          if st.getPlayer().getLevel() > 73 :
             htmltext = str(npcId)+"-01.htm"
          else:
             htmltext = str(npcId)+"-00.htm"
             st.exitQuest(1)

    elif id == State.STARTED :
       if npcId == NS : # 無名的靈魂
          if cond == 1 :
             if st.getQuestItemsCount(ALECTIA) and st.getQuestItemsCount(TISHAS) and st.getQuestItemsCount(MEKARA) and st.getQuestItemsCount(MORIGUL) :
                htmltext = str(npcId)+"-16.htm"
             else :
                htmltext = str(npcId)+"-13.htm"
          elif four == 2 or cond == 2 :
             htmltext = str(npcId)+"-19.htm"

       elif npcId == WGA : # 威格特的亡靈 - 皇帝陵墓(擊敗哈里夏的影子後)
          st.set("box","2")
          st.set("party","0")
          if st.getQuestItemsCount(ALECTIA) + st.getQuestItemsCount(TISHAS) + st.getQuestItemsCount(MEKARA) + st.getQuestItemsCount(MORIGUL) <= 1:
             htmltext = str(npcId)+"-01.htm"
             st.set("wigoth","1")
          elif st.getQuestItemsCount(ALECTIA) + st.getQuestItemsCount(TISHAS) + st.getQuestItemsCount(MEKARA) + st.getQuestItemsCount(MORIGUL) == 2:
             htmltext = str(npcId)+"-02.htm"
             st.set("wigoth","2")
          elif st.getQuestItemsCount(ALECTIA) + st.getQuestItemsCount(TISHAS) + st.getQuestItemsCount(MEKARA) + st.getQuestItemsCount(MORIGUL) == 3:
             htmltext = str(npcId)+"-04.htm"
             st.set("wigoth","3")
          elif st.getQuestItemsCount(ALECTIA) + st.getQuestItemsCount(TISHAS) + st.getQuestItemsCount(MEKARA) + st.getQuestItemsCount(MORIGUL) == 4:
             htmltext = str(npcId)+"-05.htm"
             st.set("wigoth","4")
          elif st.getQuestItemsCount(ALECTIA) + st.getQuestItemsCount(TISHAS) + st.getQuestItemsCount(MEKARA) + st.getQuestItemsCount(MORIGUL) > 4:
             htmltext = str(npcId)+"-05.htm"

       elif npcId == WGB : # 威格特的亡靈 - 巡禮者寺院
          if st.getInt("box") != 2 : return "任務尚未完成。"
          if four==1 :
             if st.getQuestItemsCount(RELIC_PART) < 1000 and st.getQuestItemsCount(SEALED_BOX) > 0 :
                htmltext = str(npcId)+"-02.htm"
             elif st.getQuestItemsCount(RELIC_PART) > 999 and st.getQuestItemsCount(SEALED_BOX) == 0 :
                htmltext = str(npcId)+"-03.htm"
             elif st.getQuestItemsCount(RELIC_PART) > 999 and st.getQuestItemsCount(SEALED_BOX) > 0 :
                htmltext = str(npcId)+"-04.htm"
             elif st.getQuestItemsCount(RELIC_PART) == 0 and st.getQuestItemsCount(SEALED_BOX) == 0 :
                htmltext = str(npcId)+"-01.htm"
          elif four==2 :
             if st.getQuestItemsCount(RELIC_PART) < 1000 and st.getQuestItemsCount(SEALED_BOX) > 0 :
                htmltext = str(npcId)+"-06.htm"
             elif st.getQuestItemsCount(RELIC_PART) > 999 and st.getQuestItemsCount(SEALED_BOX) == 0 :
                htmltext = str(npcId)+"-07.htm"
             elif st.getQuestItemsCount(RELIC_PART) > 999 and st.getQuestItemsCount(SEALED_BOX) > 0 :
                htmltext = str(npcId)+"-08.htm"
             elif st.getQuestItemsCount(RELIC_PART) == 0 and st.getQuestItemsCount(SEALED_BOX) == 0 :
                htmltext = str(npcId)+"-05.htm"

       elif npcId in [COEA,COEB] : # 艾爾摩亞丁侍衛的亡靈
          htmltext = str(npcId)+"-01.htm"

       elif npcId in [CSM,ESM,GSM,JSM]: # 陵墓管理員
         if FourSepulchersManager.getInstance().IsEntryTime() :
             if player.isInParty():
                if not player.getParty().isLeader(player):
                   return "只有隊長可以申請。"
                else:
                   partyMembers = [player]
                   party = player.getParty()
                   if party :
                      partyMembers = party.getPartyMembers().toArray()
                      for player in partyMembers :
                          pst = player.getQuestState(qn)
                          pst.set("party","0")
                      if player.getParty().getMemberCount()==2:
                         st.set("party","2")
                      elif player.getParty().getMemberCount()==3:
                         st.set("party","3")
                      elif player.getParty().getMemberCount()==4:
                         st.set("party","4")
                      elif player.getParty().getMemberCount()==5:
                         st.set("party","5")
                      elif player.getParty().getMemberCount()==6:
                         st.set("party","6")
                      elif player.getParty().getMemberCount()==7:
                         st.set("party","7")
                      elif player.getParty().getMemberCount()==8:
                         st.set("party","8")
                      else:
                         st.set("party","9")
                   htmltext = str(npcId)+"-01.htm"
             else :
                  st.set("party","1")
                  htmltext = str(npcId)+"-01.htm"
         else :
             htmltext = str(npcId)+"-02.htm"

       elif npcId in HGKB : # 男爵禮拜堂守門人
        if FourSepulchersManager.getInstance().IsAttackTime() :
           if player.isInParty():
              if not player.getParty().isLeader(player):
                 return "只有隊長可以申請。"
              if not st.getInt("party")==player.getParty().getMemberCount():
                 return "隊伍成員錯誤。"
              if st.getQuestItemsCount(HALLS_KEY) :
                 partyMembers = [player]
                 party = player.getParty()
                 if party :
                    partyMembers = party.getPartyMembers().toArray()
                    for player in partyMembers :
                        pst = player.getQuestState(qn)
                        if pst.getQuestItemsCount(HALLS_KEY) < 1:
                           return "隊伍成員沒有全部拿到鑰匙。"
                    for player in partyMembers :
                        npc.onBypassFeedback(player,"open_gate")
                    for player in partyMembers :
                        pst = player.getQuestState(qn)
                        pst.takeItems(HALLS_KEY,-1)
                        return
                 return
              else:
                 return HGKB_MSG
           else :
              if st.getInt("party") != 1:
                 return "隊伍成員錯誤。"
              else:
                 if st.getQuestItemsCount(HALLS_KEY) :
                    npc.onBypassFeedback(player,"open_gate")
                    return
                 else:
                    return HGKB_MSG
        else :
            return "條件不符,無法進入。"
       elif npcId in HGKV : # 子爵禮拜堂守門人
        if FourSepulchersManager.getInstance().IsAttackTime() :
           if player.isInParty():
              if not player.getParty().isLeader(player):
                 return "只有隊長可以申請。"
              if not st.getInt("party")==player.getParty().getMemberCount():
                 return "隊伍成員錯誤。"
              if st.getQuestItemsCount(HALLS_KEY) :
                 partyMembers = [player]
                 party = player.getParty()
                 if party :
                    partyMembers = party.getPartyMembers().toArray()
                    for player in partyMembers :
                        pst = player.getQuestState(qn)
                        if pst.getQuestItemsCount(HALLS_KEY) < 1:
                           return "隊伍成員沒有全部拿到鑰匙。"
                    for player in partyMembers :
                        npc.onBypassFeedback(player,"open_gate")
                    for player in partyMembers :
                        pst = player.getQuestState(qn)
                        pst.takeItems(HALLS_KEY,-1)
                        return
                 return
              else:
                 return HGKV_MSG
           else :
              if st.getInt("party") != 1:
                 return "隊伍成員錯誤。"
              else:
                 if st.getQuestItemsCount(HALLS_KEY) :
                    npc.onBypassFeedback(player,"open_gate")
                    return
                 else:
                    return HGKV_MSG
        else :
            return "條件不符,無法進入。"
       elif npcId in HGKC : # 伯爵禮拜堂守門人
        if FourSepulchersManager.getInstance().IsAttackTime() :
           if player.isInParty():
              if not player.getParty().isLeader(player):
                 return "只有隊長可以申請。"
              if not st.getInt("party")==player.getParty().getMemberCount():
                 return "隊伍成員錯誤。"
              if st.getQuestItemsCount(HALLS_KEY) :
                 partyMembers = [player]
                 party = player.getParty()
                 if party :
                    partyMembers = party.getPartyMembers().toArray()
                    for player in partyMembers :
                        pst = player.getQuestState(qn)
                        if pst.getQuestItemsCount(HALLS_KEY) < 1:
                           return "隊伍成員沒有全部拿到鑰匙。"
                    for player in partyMembers :
                        npc.onBypassFeedback(player,"open_gate")
                    for player in partyMembers :
                        pst = player.getQuestState(qn)
                        pst.takeItems(HALLS_KEY,-1)
                        return
                 return
              else:
                 return HGKC_MSG
           else :
              if st.getInt("party") != 1:
                 return "隊伍成員錯誤。"
              else:
                 if st.getQuestItemsCount(HALLS_KEY) :
                    npc.onBypassFeedback(player,"open_gate")
                    return
                 else:
                    return HGKC_MSG
        else :
            return "條件不符,無法進入。"
       elif npcId in HGKM : # 侯爵禮拜堂守門人
        if FourSepulchersManager.getInstance().IsAttackTime() :
           if player.isInParty():
              if not player.getParty().isLeader(player):
                 return "只有隊長可以申請。"
              if not st.getInt("party")==player.getParty().getMemberCount():
                 return "隊伍成員錯誤。"
              if st.getQuestItemsCount(HALLS_KEY) :
                 partyMembers = [player]
                 party = player.getParty()
                 if party :
                    partyMembers = party.getPartyMembers().toArray()
                    for player in partyMembers :
                        pst = player.getQuestState(qn)
                        if pst.getQuestItemsCount(HALLS_KEY) < 1:
                           return "隊伍成員沒有全部拿到鑰匙。"
                    for player in partyMembers :
                        npc.onBypassFeedback(player,"open_gate")
                    for player in partyMembers :
                        pst = player.getQuestState(qn)
                        pst.takeItems(HALLS_KEY,-1)
                        return
                 return
              else:
                 return HGKM_MSG
           else :
              if st.getInt("party") != 1:
                 return "隊伍成員錯誤。"
              else:
                 if st.getQuestItemsCount(HALLS_KEY) :
                    npc.onBypassFeedback(player,"open_gate")
                    return
                 else:
                    return HGKM_MSG
        else :
            return "條件不符,無法進入。"
       elif npcId in HGKD : # 公爵禮拜堂守門人
        if FourSepulchersManager.getInstance().IsAttackTime() :
           if player.isInParty():
              if not player.getParty().isLeader(player):
                 return "只有隊長可以申請。"
              if not st.getInt("party")==player.getParty().getMemberCount():
                 return "隊伍成員錯誤。"
              if st.getQuestItemsCount(HALLS_KEY) :
                 partyMembers = [player]
                 party = player.getParty()
                 if party :
                    partyMembers = party.getPartyMembers().toArray()
                    for player in partyMembers :
                        pst = player.getQuestState(qn)
                        if pst.getQuestItemsCount(HALLS_KEY) < 1:
                           return "隊伍成員沒有全部拿到鑰匙。"
                    for player in partyMembers :
                        npc.onBypassFeedback(player,"open_gate")
                    for player in partyMembers :
                        pst = player.getQuestState(qn)
                        pst.takeItems(HALLS_KEY,-1)
                        return
                 return
              else:
                 return HGKD_MSG
           else :
              if st.getInt("party") != 1:
                 return "隊伍成員錯誤。"
              else:
                 if st.getQuestItemsCount(HALLS_KEY) :
                    npc.onBypassFeedback(player,"open_gate")
                    return
                 else:
                    return HGKD_MSG
        else :
            return "條件不符,無法進入。"

    return htmltext
示例#3
0
    def onAdvEvent(self, event, npc, player):
        st = player.getQuestState(qn)

        if event == "Enter":
            FourSepulchersManager.getInstance().tryEntry(npc, player)
            return

        if not st: return

        elif event == "11":
            if st.getQuestItemsCount(SEALED_BOX) >= 1:
                htmltext = "31454-1.htm"
                st.takeItems(SEALED_BOX, 1)
                if st.getRandom(1000000) < 700000:
                    cnt = 1370 + st.getRandom(1374)
                    st.giveItems(REWARDS[0], cnt)

                if st.getRandom(1000000) < 2:
                    st.giveItems(REWARDS[1], 1)

                if st.getRandom(1000000) < 2:
                    st.giveItems(REWARDS[2], 1)

                if st.getRandom(1000000) < 8:
                    st.giveItems(REWARDS[3], 1)

                if st.getRandom(1000000) < 54858:
                    st.giveItems(REWARDS[4], 1)

                if st.getRandom(1000000) < 2:
                    st.giveItems(REWARDS[5], 1)

                if st.getRandom(1000000) < 3841:
                    st.giveItems(REWARDS[6], 1)

                if st.getRandom(1000000) < 3201:
                    st.giveItems(REWARDS[7], 1)

                if st.getRandom(1000000) < 6401:
                    st.giveItems(REWARDS[8], 1)

                if st.getRandom(1000000) < 440:
                    st.giveItems(REWARDS[9], 1)

                if st.getRandom(1000000) < 440:
                    st.giveItems(REWARDS[10], 1)

                if st.getRandom(1000000) < 483:
                    st.giveItems(REWARDS[11], 1)

            else:
                return "31454-NG.htm"

        elif event == "12":
            if st.getQuestItemsCount(
                    GOBLETS[0]) >= 1 and st.getQuestItemsCount(
                        GOBLETS[1]) >= 1 and st.getQuestItemsCount(
                            GOBLETS[2]) >= 1 and st.getQuestItemsCount(
                                GOBLETS[3]) >= 1:
                st.takeItems(GOBLETS[0], 1)
                st.takeItems(GOBLETS[1], 1)
                st.takeItems(GOBLETS[2], 1)
                st.takeItems(GOBLETS[3], 1)
                st.giveItems(ANTIQUE_BROOCH, 1)
                st.set("cond", "2")
                st.playSound("ItemSound.quest_finish")
                return "31453-22.htm"
            else:
                return "31453-FNG.htm"

        elif event == "13":
            st.playSound("ItemSound.quest_accept")
            st.exitQuest(1)
            return "END.htm"

        elif event == "14":
            st.playSound("ItemSound.quest_accept")
            return "CONTINUE.htm"

        # Ghost Chamberlain of Elmoreden: Teleport to 4th sepulcher
        elif event == "15":
            if st.getQuestItemsCount(ANTIQUE_BROOCH) >= 1:
                st.getPlayer().teleToLocation(178298, -84574, -7216)
                return
            elif st.getQuestItemsCount(GRAVE_PASS) >= 1:
                st.takeItems(GRAVE_PASS, 1)
                st.getPlayer().teleToLocation(178298, -84574, -7216)
                return
            else:
                return "NG.htm"

        # Ghost Chamberlain of Elmoreden: Teleport to Imperial Tomb entrance
        elif event == "16":
            if st.getQuestItemsCount(ANTIQUE_BROOCH) >= 1:
                st.getPlayer().teleToLocation(186942, -75602, -2834)
                return
            elif st.getQuestItemsCount(GRAVE_PASS) >= 1:
                st.takeItems(GRAVE_PASS, 1)
                st.getPlayer().teleToLocation(186942, -75602, -2834)
                return
            else:
                return "NG.htm"

        # Teleport to Pilgrims Temple
        elif event == "17":
            if st.getQuestItemsCount(ANTIQUE_BROOCH) >= 1:
                st.getPlayer().teleToLocation(169590, -90218, -2914)
                return
            elif st.getQuestItemsCount(GRAVE_PASS) >= 1:
                st.takeItems(GRAVE_PASS, 1)
                st.getPlayer().teleToLocation(169590, -90218, -2914)
                return
            else:
                return "NG.htm"
示例#4
0
 def onAdvEvent(self, event, npc, player):
     htmltext = event
     st = player.getQuestState(qn)
     htmltext = event
     if event == "Enter":
         FourSepulchersManager.getInstance().tryEntry(npc, player)
         return
     if not st: return
     elif event == "accept":
         if int(st.get("cond")) == 0:
             if st.getPlayer().getLevel() >= 74:
                 st.setState(State.STARTED)
                 st.playSound("ItemSound.quest_accept")
                 htmltext = "31453-13.htm"
                 st.set("cond", "1")
             else:
                 htmltext = "31453-12.htm"
                 st.exitQuest(1)
     elif event == "11":
         if st.getQuestItemsCount(SEALED_BOX) >= 1:
             htmltext = "31454-13.htm"
             st.takeItems(SEALED_BOX, 1)
             reward = 0
             rnd = st.getRandom(5)
             if rnd == 0:
                 st.giveItems(57, 10000)
                 reward = 1
             elif rnd == 1:
                 if st.getRandom(1000) < 848:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 43:
                         st.giveItems(1884, 42)
                     elif i < 66:
                         st.giveItems(1895, 36)
                     elif i < 184:
                         st.giveItems(1876, 4)
                     elif i < 250:
                         st.giveItems(1881, 6)
                     elif i < 287:
                         st.giveItems(5549, 8)
                     elif i < 484:
                         st.giveItems(1874, 1)
                     elif i < 681:
                         st.giveItems(1889, 1)
                     elif i < 799:
                         st.giveItems(1877, 1)
                     elif i < 902:
                         st.giveItems(1894, 1)
                     else:
                         st.giveItems(4043, 1)
                 if st.getRandom(1000) < 323:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 335:
                         st.giveItems(1888, 1)
                     elif i < 556:
                         st.giveItems(4040, 1)
                     elif i < 725:
                         st.giveItems(1890, 1)
                     elif i < 872:
                         st.giveItems(5550, 1)
                     elif i < 962:
                         st.giveItems(1893, 1)
                     elif i < 986:
                         st.giveItems(4046, 1)
                     else:
                         st.giveItems(4048, 1)
             elif rnd == 2:
                 if st.getRandom(1000) < 847:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 148:
                         st.giveItems(1878, 8)
                     elif i < 175:
                         st.giveItems(1882, 24)
                     elif i < 273:
                         st.giveItems(1879, 4)
                     elif i < 322:
                         st.giveItems(1880, 6)
                     elif i < 357:
                         st.giveItems(1885, 6)
                     elif i < 554:
                         st.giveItems(1875, 1)
                     elif i < 685:
                         st.giveItems(1883, 1)
                     elif i < 803:
                         st.giveItems(5220, 1)
                     elif i < 901:
                         st.giveItems(4039, 1)
                     else:
                         st.giveItems(4044, 1)
                 if st.getRandom(1000) < 251:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 350:
                         st.giveItems(1887, 1)
                     elif i < 587:
                         st.giveItems(4042, 1)
                     elif i < 798:
                         st.giveItems(1886, 1)
                     elif i < 922:
                         st.giveItems(4041, 1)
                     elif i < 966:
                         st.giveItems(1892, 1)
                     elif i < 996:
                         st.giveItems(1891, 1)
                     else:
                         st.giveItems(4047, 1)
             elif rnd == 3:
                 if st.getRandom(1000) < 31:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 223:
                         st.giveItems(730, 1)
                     elif i < 893:
                         st.giveItems(948, 1)
                     else:
                         st.giveItems(960, 1)
                 if st.getRandom(1000) < 5:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 202:
                         st.giveItems(729, 1)
                     elif i < 928:
                         st.giveItems(947, 1)
                     else:
                         st.giveItems(959, 1)
             elif rnd == 4:
                 if st.getRandom(1000) < 329:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 88:
                         st.giveItems(6698, 1)
                     elif i < 185:
                         st.giveItems(6699, 1)
                     elif i < 238:
                         st.giveItems(6700, 1)
                     elif i < 262:
                         st.giveItems(6701, 1)
                     elif i < 292:
                         st.giveItems(6702, 1)
                     elif i < 356:
                         st.giveItems(6703, 1)
                     elif i < 420:
                         st.giveItems(6704, 1)
                     elif i < 482:
                         st.giveItems(6705, 1)
                     elif i < 554:
                         st.giveItems(6706, 1)
                     elif i < 576:
                         st.giveItems(6707, 1)
                     elif i < 640:
                         st.giveItems(6708, 1)
                     elif i < 704:
                         st.giveItems(6709, 1)
                     elif i < 777:
                         st.giveItems(6710, 1)
                     elif i < 799:
                         st.giveItems(6711, 1)
                     elif i < 863:
                         st.giveItems(6712, 1)
                     elif i < 927:
                         st.giveItems(6713, 1)
                     else:
                         st.giveItems(6714, 1)
                 if st.getRandom(1000) < 54:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 100:
                         st.giveItems(6688, 1)
                     elif i < 198:
                         st.giveItems(6689, 1)
                     elif i < 298:
                         st.giveItems(6690, 1)
                     elif i < 398:
                         st.giveItems(6691, 1)
                     elif i < 499:
                         st.giveItems(7579, 1)
                     elif i < 601:
                         st.giveItems(6693, 1)
                     elif i < 703:
                         st.giveItems(6694, 1)
                     elif i < 801:
                         st.giveItems(6695, 1)
                     elif i < 902:
                         st.giveItems(6696, 1)
                     else:
                         st.giveItems(6697, 1)
             if reward == 0:
                 if st.getRandom(2) == 0:
                     htmltext = "31454-14.htm"
                 else:
                     htmltext = "31454-15.htm"
     elif event == "12":
         if st.getQuestItemsCount(
                 GOBLETS[0]) >= 1 and st.getQuestItemsCount(
                     GOBLETS[1]) >= 1 and st.getQuestItemsCount(
                         GOBLETS[2]) >= 1 and st.getQuestItemsCount(
                             GOBLETS[3]) >= 1:
             st.takeItems(GOBLETS[0], -1)
             st.takeItems(GOBLETS[1], -1)
             st.takeItems(GOBLETS[2], -1)
             st.takeItems(GOBLETS[3], -1)
             st.giveItems(ANTIQUE_BROOCH, 1)
             st.set("cond", "2")
             st.playSound("ItemSound.quest_finish")
             htmltext = "31453-16.htm"
         else:
             htmltext = "31453-14.htm"
     elif event == "13":
         st.playSound("ItemSound.quest_finish")
         st.exitQuest(1)
         htmltext = "31453-18.htm"
     elif event == "14":
         htmltext = "31453-13.htm"
         if st.getInt("cond") == 2:
             htmltext = "31453-19.htm"
     # Ghost Chamberlain of Elmoreden: Teleport to 4th sepulcher
     elif event == "15":
         if st.getQuestItemsCount(ANTIQUE_BROOCH) >= 1:
             st.getPlayer().teleToLocation(178298, -84574, -7216)
             htmltext = None
         elif st.getQuestItemsCount(GRAVE_PASS) >= 1:
             st.takeItems(GRAVE_PASS, 1)
             st.getPlayer().teleToLocation(178298, -84574, -7216)
             htmltext = None
         else:
             htmltext = "" + str(npc.getNpcId()) + "-0.htm"
     # Ghost Chamberlain of Elmoreden: Teleport to Imperial Tomb entrance
     elif event == "16":
         if st.getQuestItemsCount(ANTIQUE_BROOCH) >= 1:
             st.getPlayer().teleToLocation(186942, -75602, -2834)
             htmltext = None
         elif st.getQuestItemsCount(GRAVE_PASS) >= 1:
             st.takeItems(GRAVE_PASS, 1)
             st.getPlayer().teleToLocation(186942, -75602, -2834)
             htmltext = None
         else:
             htmltext = "" + str(npc.getNpcId()) + "-0.htm"
     # Teleport to Pilgrims Temple
     elif event == "17":
         if st.getQuestItemsCount(ANTIQUE_BROOCH) >= 1:
             st.getPlayer().teleToLocation(169590, -90218, -2914)
         else:
             st.takeItems(GRAVE_PASS, 1)
             st.getPlayer().teleToLocation(169590, -90218, -2914)
         htmltext = "31452-6.htm"
     elif event == "18":
         if st.getQuestItemsCount(GOBLETS[0]) + st.getQuestItemsCount(
                 GOBLETS[1]) + st.getQuestItemsCount(
                     GOBLETS[2]) + st.getQuestItemsCount(GOBLETS[3]) < 3:
             htmltext = "31452-3.htm"
         elif st.getQuestItemsCount(GOBLETS[0]) + st.getQuestItemsCount(
                 GOBLETS[1]) + st.getQuestItemsCount(
                     GOBLETS[2]) + st.getQuestItemsCount(GOBLETS[3]) == 3:
             htmltext = "31452-4.htm"
         elif st.getQuestItemsCount(GOBLETS[0]) + st.getQuestItemsCount(
                 GOBLETS[1]) + st.getQuestItemsCount(
                     GOBLETS[2]) + st.getQuestItemsCount(GOBLETS[3]) >= 4:
             htmltext = "31452-5.htm"
     elif event == "19":
         if st.getQuestItemsCount(SEALED_BOX) >= 1:
             htmltext = "31919-3.htm"
             st.takeItems(SEALED_BOX, 1)
             reward = 0
             rnd = st.getRandom(5)
             if rnd == 0:
                 st.giveItems(57, 10000)
                 reward = 1
             elif rnd == 1:
                 if st.getRandom(1000) < 848:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 43:
                         st.giveItems(1884, 42)
                     elif i < 66:
                         st.giveItems(1895, 36)
                     elif i < 184:
                         st.giveItems(1876, 4)
                     elif i < 250:
                         st.giveItems(1881, 6)
                     elif i < 287:
                         st.giveItems(5549, 8)
                     elif i < 484:
                         st.giveItems(1874, 1)
                     elif i < 681:
                         st.giveItems(1889, 1)
                     elif i < 799:
                         st.giveItems(1877, 1)
                     elif i < 902:
                         st.giveItems(1894, 1)
                     else:
                         st.giveItems(4043, 1)
                 if st.getRandom(1000) < 323:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 335:
                         st.giveItems(1888, 1)
                     elif i < 556:
                         st.giveItems(4040, 1)
                     elif i < 725:
                         st.giveItems(1890, 1)
                     elif i < 872:
                         st.giveItems(5550, 1)
                     elif i < 962:
                         st.giveItems(1893, 1)
                     elif i < 986:
                         st.giveItems(4046, 1)
                     else:
                         st.giveItems(4048, 1)
             elif rnd == 2:
                 if st.getRandom(1000) < 847:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 148:
                         st.giveItems(1878, 8)
                     elif i < 175:
                         st.giveItems(1882, 24)
                     elif i < 273:
                         st.giveItems(1879, 4)
                     elif i < 322:
                         st.giveItems(1880, 6)
                     elif i < 357:
                         st.giveItems(1885, 6)
                     elif i < 554:
                         st.giveItems(1875, 1)
                     elif i < 685:
                         st.giveItems(1883, 1)
                     elif i < 803:
                         st.giveItems(5220, 1)
                     elif i < 901:
                         st.giveItems(4039, 1)
                     else:
                         st.giveItems(4044, 1)
                 if st.getRandom(1000) < 251:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 350:
                         st.giveItems(1887, 1)
                     elif i < 587:
                         st.giveItems(4042, 1)
                     elif i < 798:
                         st.giveItems(1886, 1)
                     elif i < 922:
                         st.giveItems(4041, 1)
                     elif i < 966:
                         st.giveItems(1892, 1)
                     elif i < 996:
                         st.giveItems(1891, 1)
                     else:
                         st.giveItems(4047, 1)
             elif rnd == 3:
                 if st.getRandom(1000) < 31:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 223:
                         st.giveItems(730, 1)
                     elif i < 893:
                         st.giveItems(948, 1)
                     else:
                         st.giveItems(960, 1)
                 if st.getRandom(1000) < 5:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 202:
                         st.giveItems(729, 1)
                     elif i < 928:
                         st.giveItems(947, 1)
                     else:
                         st.giveItems(959, 1)
             elif rnd == 4:
                 if st.getRandom(1000) < 329:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 88:
                         st.giveItems(6698, 1)
                     elif i < 185:
                         st.giveItems(6699, 1)
                     elif i < 238:
                         st.giveItems(6700, 1)
                     elif i < 262:
                         st.giveItems(6701, 1)
                     elif i < 292:
                         st.giveItems(6702, 1)
                     elif i < 356:
                         st.giveItems(6703, 1)
                     elif i < 420:
                         st.giveItems(6704, 1)
                     elif i < 482:
                         st.giveItems(6705, 1)
                     elif i < 554:
                         st.giveItems(6706, 1)
                     elif i < 576:
                         st.giveItems(6707, 1)
                     elif i < 640:
                         st.giveItems(6708, 1)
                     elif i < 704:
                         st.giveItems(6709, 1)
                     elif i < 777:
                         st.giveItems(6710, 1)
                     elif i < 799:
                         st.giveItems(6711, 1)
                     elif i < 863:
                         st.giveItems(6712, 1)
                     elif i < 927:
                         st.giveItems(6713, 1)
                     else:
                         st.giveItems(6714, 1)
                 if st.getRandom(1000) < 54:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 100:
                         st.giveItems(6688, 1)
                     elif i < 198:
                         st.giveItems(6689, 1)
                     elif i < 298:
                         st.giveItems(6690, 1)
                     elif i < 398:
                         st.giveItems(6691, 1)
                     elif i < 499:
                         st.giveItems(7579, 1)
                     elif i < 601:
                         st.giveItems(6693, 1)
                     elif i < 703:
                         st.giveItems(6694, 1)
                     elif i < 801:
                         st.giveItems(6695, 1)
                     elif i < 902:
                         st.giveItems(6696, 1)
                     else:
                         st.giveItems(6697, 1)
             if reward == 0:
                 if st.getRandom(2) == 0:
                     htmltext = "31919-4.htm"
                 else:
                     htmltext = "31919-5.htm"
         else:
             htmltext = "31919-6.htm"
     elif event == "20":  #增加NPC 31920-START
         if st.getQuestItemsCount(SEALED_BOX) >= 1:
             htmltext = "31920-3.htm"
             st.takeItems(SEALED_BOX, 1)
             reward = 0
             rnd = st.getRandom(5)
             if rnd == 0:
                 st.giveItems(57, 10000)
                 reward = 1
             elif rnd == 1:
                 if st.getRandom(1000) < 848:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 43:
                         st.giveItems(1884, 42)
                     elif i < 66:
                         st.giveItems(1895, 36)
                     elif i < 184:
                         st.giveItems(1876, 4)
                     elif i < 250:
                         st.giveItems(1881, 6)
                     elif i < 287:
                         st.giveItems(5549, 8)
                     elif i < 484:
                         st.giveItems(1874, 1)
                     elif i < 681:
                         st.giveItems(1889, 1)
                     elif i < 799:
                         st.giveItems(1877, 1)
                     elif i < 902:
                         st.giveItems(1894, 1)
                     else:
                         st.giveItems(4043, 1)
                 if st.getRandom(1000) < 323:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 335:
                         st.giveItems(1888, 1)
                     elif i < 556:
                         st.giveItems(4040, 1)
                     elif i < 725:
                         st.giveItems(1890, 1)
                     elif i < 872:
                         st.giveItems(5550, 1)
                     elif i < 962:
                         st.giveItems(1893, 1)
                     elif i < 986:
                         st.giveItems(4046, 1)
                     else:
                         st.giveItems(4048, 1)
             elif rnd == 2:
                 if st.getRandom(1000) < 847:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 148:
                         st.giveItems(1878, 8)
                     elif i < 175:
                         st.giveItems(1882, 24)
                     elif i < 273:
                         st.giveItems(1879, 4)
                     elif i < 322:
                         st.giveItems(1880, 6)
                     elif i < 357:
                         st.giveItems(1885, 6)
                     elif i < 554:
                         st.giveItems(1875, 1)
                     elif i < 685:
                         st.giveItems(1883, 1)
                     elif i < 803:
                         st.giveItems(5220, 1)
                     elif i < 901:
                         st.giveItems(4039, 1)
                     else:
                         st.giveItems(4044, 1)
                 if st.getRandom(1000) < 251:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 350:
                         st.giveItems(1887, 1)
                     elif i < 587:
                         st.giveItems(4042, 1)
                     elif i < 798:
                         st.giveItems(1886, 1)
                     elif i < 922:
                         st.giveItems(4041, 1)
                     elif i < 966:
                         st.giveItems(1892, 1)
                     elif i < 996:
                         st.giveItems(1891, 1)
                     else:
                         st.giveItems(4047, 1)
             elif rnd == 3:
                 if st.getRandom(1000) < 31:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 223:
                         st.giveItems(730, 1)
                     elif i < 893:
                         st.giveItems(948, 1)
                     else:
                         st.giveItems(960, 1)
                 if st.getRandom(1000) < 5:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 202:
                         st.giveItems(729, 1)
                     elif i < 928:
                         st.giveItems(947, 1)
                     else:
                         st.giveItems(959, 1)
             elif rnd == 4:
                 if st.getRandom(1000) < 329:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 88:
                         st.giveItems(6698, 1)
                     elif i < 185:
                         st.giveItems(6699, 1)
                     elif i < 238:
                         st.giveItems(6700, 1)
                     elif i < 262:
                         st.giveItems(6701, 1)
                     elif i < 292:
                         st.giveItems(6702, 1)
                     elif i < 356:
                         st.giveItems(6703, 1)
                     elif i < 420:
                         st.giveItems(6704, 1)
                     elif i < 482:
                         st.giveItems(6705, 1)
                     elif i < 554:
                         st.giveItems(6706, 1)
                     elif i < 576:
                         st.giveItems(6707, 1)
                     elif i < 640:
                         st.giveItems(6708, 1)
                     elif i < 704:
                         st.giveItems(6709, 1)
                     elif i < 777:
                         st.giveItems(6710, 1)
                     elif i < 799:
                         st.giveItems(6711, 1)
                     elif i < 863:
                         st.giveItems(6712, 1)
                     elif i < 927:
                         st.giveItems(6713, 1)
                     else:
                         st.giveItems(6714, 1)
                 if st.getRandom(1000) < 54:
                     reward = 1
                     i = st.getRandom(1000)
                     if i < 100:
                         st.giveItems(6688, 1)
                     elif i < 198:
                         st.giveItems(6689, 1)
                     elif i < 298:
                         st.giveItems(6690, 1)
                     elif i < 398:
                         st.giveItems(6691, 1)
                     elif i < 499:
                         st.giveItems(7579, 1)
                     elif i < 601:
                         st.giveItems(6693, 1)
                     elif i < 703:
                         st.giveItems(6694, 1)
                     elif i < 801:
                         st.giveItems(6695, 1)
                     elif i < 902:
                         st.giveItems(6696, 1)
                     else:
                         st.giveItems(6697, 1)
             if reward == 0:
                 if st.getRandom(2) == 0:
                     htmltext = "31920-4.htm"
                 else:
                     htmltext = "31920-5.htm"
         else:
             htmltext = "31920-6.htm"  #增加NPC 31920-END
     elif event.isdigit() and int(event) in RCP_REWARDS:
         st.takeItems(RELIC, 1000)
         st.giveItems(int(event), 1)
         htmltext = "31454-17.htm"
     return htmltext
示例#5
0
    def onTalk(self, npc, player):
        htmltext = "<html><body>目前沒有執行任務,或條件不符。</body></html>"
        st = player.getQuestState(qn)
        npcId = npc.getNpcId()
        id = st.getState()
        cond = st.getInt("cond")
        four = st.getInt("four")
        wigoth = st.getInt("wigoth")
        box = st.getInt("box")
        if not st:
            return htmltext

        if id == State.CREATED:
            if npcId == NS:  # 無名的靈魂
                if st.getPlayer().getLevel() > 73:
                    htmltext = str(npcId) + "-01.htm"
                else:
                    htmltext = str(npcId) + "-00.htm"
                    st.exitQuest(1)

        elif id == State.STARTED:
            if npcId == NS:  # 無名的靈魂
                if cond == 1:
                    if (
                        st.getQuestItemsCount(ALECTIA)
                        and st.getQuestItemsCount(TISHAS)
                        and st.getQuestItemsCount(MEKARA)
                        and st.getQuestItemsCount(MORIGUL)
                    ):
                        htmltext = str(npcId) + "-16.htm"
                    else:
                        htmltext = str(npcId) + "-13.htm"
                elif four == 2 or cond == 2:
                    htmltext = str(npcId) + "-19.htm"

            elif npcId == WGA:  # 威格特的亡靈 - 皇帝陵墓(擊敗哈里夏的影子後)
                st.set("box", "2")
                st.set("party", "0")
                if (
                    st.getQuestItemsCount(ALECTIA)
                    + st.getQuestItemsCount(TISHAS)
                    + st.getQuestItemsCount(MEKARA)
                    + st.getQuestItemsCount(MORIGUL)
                    <= 1
                ):
                    htmltext = str(npcId) + "-01.htm"
                    st.set("wigoth", "1")
                elif (
                    st.getQuestItemsCount(ALECTIA)
                    + st.getQuestItemsCount(TISHAS)
                    + st.getQuestItemsCount(MEKARA)
                    + st.getQuestItemsCount(MORIGUL)
                    == 2
                ):
                    htmltext = str(npcId) + "-02.htm"
                    st.set("wigoth", "2")
                elif (
                    st.getQuestItemsCount(ALECTIA)
                    + st.getQuestItemsCount(TISHAS)
                    + st.getQuestItemsCount(MEKARA)
                    + st.getQuestItemsCount(MORIGUL)
                    == 3
                ):
                    htmltext = str(npcId) + "-04.htm"
                    st.set("wigoth", "3")
                elif (
                    st.getQuestItemsCount(ALECTIA)
                    + st.getQuestItemsCount(TISHAS)
                    + st.getQuestItemsCount(MEKARA)
                    + st.getQuestItemsCount(MORIGUL)
                    == 4
                ):
                    htmltext = str(npcId) + "-05.htm"
                    st.set("wigoth", "4")
                elif (
                    st.getQuestItemsCount(ALECTIA)
                    + st.getQuestItemsCount(TISHAS)
                    + st.getQuestItemsCount(MEKARA)
                    + st.getQuestItemsCount(MORIGUL)
                    > 4
                ):
                    htmltext = str(npcId) + "-05.htm"

            elif npcId == WGB:  # 威格特的亡靈 - 巡禮者寺院
                if st.getInt("box") != 2:
                    return "任務尚未完成。"
                if four == 1:
                    if st.getQuestItemsCount(RELIC_PART) < 1000 and st.getQuestItemsCount(SEALED_BOX) > 0:
                        htmltext = str(npcId) + "-02.htm"
                    elif st.getQuestItemsCount(RELIC_PART) > 999 and st.getQuestItemsCount(SEALED_BOX) == 0:
                        htmltext = str(npcId) + "-03.htm"
                    elif st.getQuestItemsCount(RELIC_PART) > 999 and st.getQuestItemsCount(SEALED_BOX) > 0:
                        htmltext = str(npcId) + "-04.htm"
                    elif st.getQuestItemsCount(RELIC_PART) == 0 and st.getQuestItemsCount(SEALED_BOX) == 0:
                        htmltext = str(npcId) + "-01.htm"
                elif four == 2:
                    if st.getQuestItemsCount(RELIC_PART) < 1000 and st.getQuestItemsCount(SEALED_BOX) > 0:
                        htmltext = str(npcId) + "-06.htm"
                    elif st.getQuestItemsCount(RELIC_PART) > 999 and st.getQuestItemsCount(SEALED_BOX) == 0:
                        htmltext = str(npcId) + "-07.htm"
                    elif st.getQuestItemsCount(RELIC_PART) > 999 and st.getQuestItemsCount(SEALED_BOX) > 0:
                        htmltext = str(npcId) + "-08.htm"
                    elif st.getQuestItemsCount(RELIC_PART) == 0 and st.getQuestItemsCount(SEALED_BOX) == 0:
                        htmltext = str(npcId) + "-05.htm"

            elif npcId in [COEA, COEB]:  # 艾爾摩亞丁侍衛的亡靈
                htmltext = str(npcId) + "-01.htm"

            elif npcId in [CSM, ESM, GSM, JSM]:  # 陵墓管理員
                if FourSepulchersManager.getInstance().IsEntryTime():
                    if player.isInParty():
                        if not player.getParty().isLeader(player):
                            return "只有隊長可以申請。"
                        else:
                            partyMembers = [player]
                            party = player.getParty()
                            if party:
                                partyMembers = party.getPartyMembers().toArray()
                                for player in partyMembers:
                                    pst = player.getQuestState(qn)
                                    pst.set("party", "0")
                                if player.getParty().getMemberCount() == 2:
                                    st.set("party", "2")
                                elif player.getParty().getMemberCount() == 3:
                                    st.set("party", "3")
                                elif player.getParty().getMemberCount() == 4:
                                    st.set("party", "4")
                                elif player.getParty().getMemberCount() == 5:
                                    st.set("party", "5")
                                elif player.getParty().getMemberCount() == 6:
                                    st.set("party", "6")
                                elif player.getParty().getMemberCount() == 7:
                                    st.set("party", "7")
                                elif player.getParty().getMemberCount() == 8:
                                    st.set("party", "8")
                                else:
                                    st.set("party", "9")
                            htmltext = str(npcId) + "-01.htm"
                    else:
                        st.set("party", "1")
                        htmltext = str(npcId) + "-01.htm"
                else:
                    htmltext = str(npcId) + "-02.htm"

            elif npcId in HGKB:  # 男爵禮拜堂守門人
                if FourSepulchersManager.getInstance().IsAttackTime():
                    if player.isInParty():
                        if not player.getParty().isLeader(player):
                            return "只有隊長可以申請。"
                        if not st.getInt("party") == player.getParty().getMemberCount():
                            return "隊伍成員錯誤。"
                        if st.getQuestItemsCount(HALLS_KEY):
                            partyMembers = [player]
                            party = player.getParty()
                            if party:
                                partyMembers = party.getPartyMembers().toArray()
                                for player in partyMembers:
                                    pst = player.getQuestState(qn)
                                    if pst.getQuestItemsCount(HALLS_KEY) < 1:
                                        return "隊伍成員沒有全部拿到鑰匙。"
                                for player in partyMembers:
                                    npc.onBypassFeedback(player, "open_gate")
                                for player in partyMembers:
                                    pst = player.getQuestState(qn)
                                    pst.takeItems(HALLS_KEY, -1)
                                    return
                            return
                        else:
                            return HGKB_MSG
                    else:
                        if st.getInt("party") != 1:
                            return "隊伍成員錯誤。"
                        else:
                            if st.getQuestItemsCount(HALLS_KEY):
                                npc.onBypassFeedback(player, "open_gate")
                                return
                            else:
                                return HGKB_MSG
                else:
                    return "條件不符,無法進入。"
            elif npcId in HGKV:  # 子爵禮拜堂守門人
                if FourSepulchersManager.getInstance().IsAttackTime():
                    if player.isInParty():
                        if not player.getParty().isLeader(player):
                            return "只有隊長可以申請。"
                        if not st.getInt("party") == player.getParty().getMemberCount():
                            return "隊伍成員錯誤。"
                        if st.getQuestItemsCount(HALLS_KEY):
                            partyMembers = [player]
                            party = player.getParty()
                            if party:
                                partyMembers = party.getPartyMembers().toArray()
                                for player in partyMembers:
                                    pst = player.getQuestState(qn)
                                    if pst.getQuestItemsCount(HALLS_KEY) < 1:
                                        return "隊伍成員沒有全部拿到鑰匙。"
                                for player in partyMembers:
                                    npc.onBypassFeedback(player, "open_gate")
                                for player in partyMembers:
                                    pst = player.getQuestState(qn)
                                    pst.takeItems(HALLS_KEY, -1)
                                    return
                            return
                        else:
                            return HGKV_MSG
                    else:
                        if st.getInt("party") != 1:
                            return "隊伍成員錯誤。"
                        else:
                            if st.getQuestItemsCount(HALLS_KEY):
                                npc.onBypassFeedback(player, "open_gate")
                                return
                            else:
                                return HGKV_MSG
                else:
                    return "條件不符,無法進入。"
            elif npcId in HGKC:  # 伯爵禮拜堂守門人
                if FourSepulchersManager.getInstance().IsAttackTime():
                    if player.isInParty():
                        if not player.getParty().isLeader(player):
                            return "只有隊長可以申請。"
                        if not st.getInt("party") == player.getParty().getMemberCount():
                            return "隊伍成員錯誤。"
                        if st.getQuestItemsCount(HALLS_KEY):
                            partyMembers = [player]
                            party = player.getParty()
                            if party:
                                partyMembers = party.getPartyMembers().toArray()
                                for player in partyMembers:
                                    pst = player.getQuestState(qn)
                                    if pst.getQuestItemsCount(HALLS_KEY) < 1:
                                        return "隊伍成員沒有全部拿到鑰匙。"
                                for player in partyMembers:
                                    npc.onBypassFeedback(player, "open_gate")
                                for player in partyMembers:
                                    pst = player.getQuestState(qn)
                                    pst.takeItems(HALLS_KEY, -1)
                                    return
                            return
                        else:
                            return HGKC_MSG
                    else:
                        if st.getInt("party") != 1:
                            return "隊伍成員錯誤。"
                        else:
                            if st.getQuestItemsCount(HALLS_KEY):
                                npc.onBypassFeedback(player, "open_gate")
                                return
                            else:
                                return HGKC_MSG
                else:
                    return "條件不符,無法進入。"
            elif npcId in HGKM:  # 侯爵禮拜堂守門人
                if FourSepulchersManager.getInstance().IsAttackTime():
                    if player.isInParty():
                        if not player.getParty().isLeader(player):
                            return "只有隊長可以申請。"
                        if not st.getInt("party") == player.getParty().getMemberCount():
                            return "隊伍成員錯誤。"
                        if st.getQuestItemsCount(HALLS_KEY):
                            partyMembers = [player]
                            party = player.getParty()
                            if party:
                                partyMembers = party.getPartyMembers().toArray()
                                for player in partyMembers:
                                    pst = player.getQuestState(qn)
                                    if pst.getQuestItemsCount(HALLS_KEY) < 1:
                                        return "隊伍成員沒有全部拿到鑰匙。"
                                for player in partyMembers:
                                    npc.onBypassFeedback(player, "open_gate")
                                for player in partyMembers:
                                    pst = player.getQuestState(qn)
                                    pst.takeItems(HALLS_KEY, -1)
                                    return
                            return
                        else:
                            return HGKM_MSG
                    else:
                        if st.getInt("party") != 1:
                            return "隊伍成員錯誤。"
                        else:
                            if st.getQuestItemsCount(HALLS_KEY):
                                npc.onBypassFeedback(player, "open_gate")
                                return
                            else:
                                return HGKM_MSG
                else:
                    return "條件不符,無法進入。"
            elif npcId in HGKD:  # 公爵禮拜堂守門人
                if FourSepulchersManager.getInstance().IsAttackTime():
                    if player.isInParty():
                        if not player.getParty().isLeader(player):
                            return "只有隊長可以申請。"
                        if not st.getInt("party") == player.getParty().getMemberCount():
                            return "隊伍成員錯誤。"
                        if st.getQuestItemsCount(HALLS_KEY):
                            partyMembers = [player]
                            party = player.getParty()
                            if party:
                                partyMembers = party.getPartyMembers().toArray()
                                for player in partyMembers:
                                    pst = player.getQuestState(qn)
                                    if pst.getQuestItemsCount(HALLS_KEY) < 1:
                                        return "隊伍成員沒有全部拿到鑰匙。"
                                for player in partyMembers:
                                    npc.onBypassFeedback(player, "open_gate")
                                for player in partyMembers:
                                    pst = player.getQuestState(qn)
                                    pst.takeItems(HALLS_KEY, -1)
                                    return
                            return
                        else:
                            return HGKD_MSG
                    else:
                        if st.getInt("party") != 1:
                            return "隊伍成員錯誤。"
                        else:
                            if st.getQuestItemsCount(HALLS_KEY):
                                npc.onBypassFeedback(player, "open_gate")
                                return
                            else:
                                return HGKD_MSG
                else:
                    return "條件不符,無法進入。"

        return htmltext