Exemplo n.º 1
0
def isCorrectMaster(npc, player):
    charTemp = CharTemplateTable.getInstance().getTemplate(player.getClassId())
    currentRace = charTemp.race
    if ((npc.getVillageMasterRace() == Race.Human)
            and (currentRace == Race.Human or currentRace == Race.Elf)
            and npc.getVillageMasterTeachType() == ClassType.Fighter
            and not player.isMageClass()):
        return True
    elif ((npc.getVillageMasterRace() == Race.Human)
          and (currentRace == Race.Human or currentRace == Race.Elf)
          and npc.getVillageMasterTeachType() == ClassType.Mystic
          and player.getClassId().getId() in WIZARDCLASSES):
        return True
    elif ((npc.getVillageMasterRace() == Race.Human)
          and (currentRace == Race.Human or currentRace == Race.Elf)
          and npc.getVillageMasterTeachType() == ClassType.Mystic
          and player.getClassId().getId() in SUMMONERCLASSES):
        return True
    elif ((npc.getVillageMasterRace() == Race.Human)
          and (currentRace == Race.Human or currentRace == Race.Elf)
          and npc.getVillageMasterTeachType() == ClassType.Priest
          and player.getClassId().getId() in HEALERCLASSES):
        return True
    elif ((npc.getVillageMasterRace() == Race.Human)
          and (currentRace == Race.Human or currentRace == Race.Elf)
          and npc.getVillageMasterTeachType() == ClassType.Priest
          and player.getClassId().getId() in ENCHANTERCLASSES
          and player.isMageClass()):
        return True
    elif (npc.getVillageMasterRace() == Race.DarkElf
          and currentRace == Race.DarkElf):
        return True
    elif (npc.getVillageMasterRace() == Race.Orc and currentRace == Race.Orc):
        return True
    elif (npc.getVillageMasterRace() == Race.Dwarf
          and currentRace == Race.Dwarf):
        return True
    elif (npc.getVillageMasterRace() == Race.Kamael
          and currentRace == Race.Kamael):
        return True
    return False
Exemplo n.º 2
0
def isCorrectMaster(npc, player):
  charTemp = CharTemplateTable.getInstance().getTemplate(player.getClassId())
  currentRace = charTemp.race
  if ((npc.getVillageMasterRace() == Race.Human) and (currentRace == Race.Human or currentRace == Race.Elf) and npc.getVillageMasterTeachType() == ClassType.Fighter and not player.isMageClass()):
    return True
  elif ((npc.getVillageMasterRace() == Race.Human) and (currentRace == Race.Human or currentRace == Race.Elf) and npc.getVillageMasterTeachType() == ClassType.Mystic and player.getClassId().getId() in WIZARDCLASSES):
    return True
  elif ((npc.getVillageMasterRace() == Race.Human) and (currentRace == Race.Human or currentRace == Race.Elf) and npc.getVillageMasterTeachType() == ClassType.Mystic and player.getClassId().getId() in SUMMONERCLASSES):
    return True
  elif ((npc.getVillageMasterRace() == Race.Human) and (currentRace == Race.Human or currentRace == Race.Elf) and npc.getVillageMasterTeachType() == ClassType.Priest and player.getClassId().getId() in HEALERCLASSES):
    return True
  elif ((npc.getVillageMasterRace() == Race.Human) and (currentRace == Race.Human or currentRace == Race.Elf) and npc.getVillageMasterTeachType() == ClassType.Priest and player.getClassId().getId() in ENCHANTERCLASSES and player.isMageClass()):
    return True
  elif (npc.getVillageMasterRace() == Race.DarkElf and currentRace == Race.DarkElf):
    return True
  elif (npc.getVillageMasterRace() == Race.Orc and currentRace == Race.Orc):
    return True
  elif (npc.getVillageMasterRace() == Race.Dwarf and currentRace == Race.Dwarf):
    return True
  elif (npc.getVillageMasterRace() == Race.Kamael and currentRace == Race.Kamael):
    return True
  return False
Exemplo n.º 3
0
 def onAdvEvent(self, event, npc, player):
     st = player.getQuestState(qn)
     htmltext = event
     if event == "GetCertified":
         if player.isSubClassActive():
             if isCorrectMaster(npc, player):
                 if player.getLevel() >= 65:
                     return "CertificationList.htm"
                 else:
                     return "9002-08.htm"
             else:
                 return "9002-04.htm"
         else:
             return "9002-03.htm"
     elif event == "Obtain65":
         html = "<html><body>副職業實力認證:<br>你打算接受%class%等級%level%的認證-%skilltype%。切記!一旦領取這個認證的話,除了用特別的方法取消認證之前,就算刪除這個職業後重新培養後再來,也無法再次得到認證。<br>那麼,要接受認證嗎?<br><a action=\"bypass -h Quest 9002_SubClassCertification %event%\">接受認證</a><br><a action=\"bypass -h Quest 9002_SubClassCertification 9002-05.htm\">不接受認證</a></body></html>"
         htmltext = html.replace("%level%", "65").replace(
             "%class%",
             str(CharTemplateTable.getInstance().getClassNameById(
                 player.getActiveClass()))).replace("%skilltype%",
                                                    "共同技能").replace(
                                                        "%event%",
                                                        "lvl65Emergent")
     elif event == "Obtain70":
         html = "<html><body>副職業實力認證:<br>你打算接受%class%等級%level%的認證-%skilltype%。切記!一旦領取這個認證的話,除了用特別的方法取消認證之前,就算刪除這個職業後重新培養後再來,也無法再次得到認證。<br>那麼,要接受認證嗎?<br><a action=\"bypass -h Quest 9002_SubClassCertification %event%\">接受認證</a><br><a action=\"bypass -h Quest 9002_SubClassCertification 9002-05.htm\">不接受認證</a></body></html>"
         htmltext = html.replace("%level%", "70").replace(
             "%class%",
             str(CharTemplateTable.getInstance().getClassNameById(
                 player.getActiveClass()))).replace("%skilltype%",
                                                    "共同技能").replace(
                                                        "%event%",
                                                        "lvl70Emergent")
     elif event == "Obtain75":
         html = "<html><body>副職業實力認證:<br>你打算接受%class%等級%level%的認證-%skilltype%。切記!一旦領取這個認證的話,除了用特別的方法取消認證之前,就算刪除這個職業後重新培養後再來,也無法再次得到認證。<br>那麼,要接受認證嗎?<br><a action=\"bypass -h Quest 9002_SubClassCertification %event1%\">接受共同認證</a><br><a action=\"bypass -h Quest 9002_SubClassCertification %event2%\">接受特殊認證</a><br><a action=\"bypass -h Quest 9002_SubClassCertification 9002-05.htm\">不接受認證</a></body></html>"
         htmltext = html.replace("%level%", "75").replace(
             "%class%",
             str(CharTemplateTable.getInstance().getClassNameById(
                 player.getActiveClass()))).replace(
                     "%skilltype%", "共同、特殊技能").replace(
                         "%event1%",
                         "lvl75Class").replace("%event2%", "lvl75Master")
     elif event == "Obtain80":
         html = "<html><body>副職業實力認證:<br>你打算接受%class%等級%level%的認證-%skilltype%。切記!一旦領取這個認證的話,除了用特別的方法取消認證之前,就算刪除這個職業後重新培養後再來,也無法再次得到認證。<br>那麼,要接受認證嗎?<br><a action=\"bypass -h Quest 9002_SubClassCertification %event%\">接受認證</a><br><a action=\"bypass -h Quest 9002_SubClassCertification 9002-05.htm\">不接受認證</a></body></html>"
         htmltext = html.replace("%level%", "80").replace(
             "%class%",
             str(CharTemplateTable.getInstance().getClassNameById(
                 player.getActiveClass()))).replace(
                     "%skilltype%", "終極技能").replace("%event%", "lvl80Class")
     elif event.startswith("lvl"):
         level = int(event[3:5])
         type = event.replace(event[0:5], "")
         prefix = "-" + str(player.getClassIndex())
         if type == "Emergent":
             isAvailable65 = st.getGlobalQuestVar("EmergentAbility65" +
                                                  prefix)
             isAvailable70 = st.getGlobalQuestVar("EmergentAbility70" +
                                                  prefix)
             if event == "lvl65Emergent":
                 if isAvailable65 == "" or isAvailable65 == "0":
                     if player.getLevel() > 64:
                         itemId = COMMONITEM
                         var = "EmergentAbility" + str(level) + prefix
                         getCertified(player, itemId, var)
                         return "9002-07.htm"
                     else:
                         html = "<html><body>副職業實力認證:<br>你的實力還不到可以領取等級%level%的認證,更加培養一下實力再來吧。</body></html>"
                         htmltext = html.replace("%level%", (event[3:5]))
                         return htmltext
                 else:
                     return "9002-06.htm"
             elif event == "lvl70Emergent":
                 if isAvailable70 == "" or isAvailable70 == "0":
                     if player.getLevel() > 69:
                         itemId = COMMONITEM
                         var = "EmergentAbility" + str(level) + prefix
                         getCertified(player, itemId, var)
                         return "9002-07.htm"
                     else:
                         html = "<html><body>副職業實力認證:<br>你的實力還不到可以領取等級%level%的認證,更加培養一下實力再來吧。</body></html>"
                         htmltext = html.replace("%level%", (event[3:5]))
                         return htmltext
                 else:
                     return "9002-06.htm"
         elif type == "Master":
             isAvailable = st.getGlobalQuestVar("ClassAbility75" + prefix)
             if isAvailable == "" or isAvailable == "0":
                 if player.getLevel() > 74:
                     itemId = ENHANCEDITEM
                     var = "ClassAbility" + str(level) + prefix
                     getCertified(player, itemId, var)
                     return "9002-07.htm"
                 else:
                     html = "<html><body>副職業實力認證:<br>你的實力還不到可以領取等級%level%的認證,更加培養一下實力再來吧。</body></html>"
                     htmltext = html.replace("%level%", (event[3:5]))
                     return htmltext
             else:
                 return "9002-06.htm"
         elif type == "Class":
             if level == 75:
                 isAvailable = st.getGlobalQuestVar("ClassAbility75" +
                                                    prefix)
                 if isAvailable == "" or isAvailable == "0":
                     if player.getLevel() > 74:
                         itemId = CLASSITEMS[getClassIndex(player)]
                         var = "ClassAbility" + str(level) + prefix
                         getCertified(player, itemId, var)
                         return "9002-07.htm"
                     else:
                         html = "<html><body>副職業實力認證:<br>你的實力還不到可以領取等級%level%的認證,更加培養一下實力再來吧。</body></html>"
                         htmltext = html.replace("%level%", (event[3:5]))
                         return htmltext
                 else:
                     return "9002-06.htm"
             elif level == 80:
                 isAvailable = st.getGlobalQuestVar("ClassAbility80" +
                                                    prefix)
                 if isAvailable == "" or isAvailable == "0":
                     if player.getLevel() > 79:
                         itemId = TRANSFORMITEMS[getClassIndex(player)]
                         var = "ClassAbility" + str(level) + prefix
                         getCertified(player, itemId, var)
                         return "9002-07.htm"
                     else:
                         html = "<html><body>副職業實力認證:<br>你的實力還不到可以領取等級%level%的認證,更加培養一下實力再來吧。</body></html>"
                         htmltext = html.replace("%level%", (event[3:5]))
                         return htmltext
                 else:
                     return "9002-06.htm"
     return htmltext
Exemplo n.º 4
0
 def onAdvEvent (self, event, npc, player) :
   st = player.getQuestState(qn)
   htmltext = event
   if event == "GetCertified":
     if player.isSubClassActive():
       if isCorrectMaster(npc, player):
         if player.getLevel() >= 65:
           return "CertificationList.htm"
         else:
           return "9002-08.htm"
       else:
         return "9002-04.htm"
     else:
       return "9002-03.htm"
   elif event == "Obtain65":
     html = "<html><body>副職業實力認證:<br>你打算接受%class%等級%level%的認證-%skilltype%。切記!一旦領取這個認證的話,除了用特別的方法取消認證之前,就算刪除這個職業後重新培養後再來,也無法再次得到認證。<br>那麼,要接受認證嗎?<br><a action=\"bypass -h Quest 9002_SubClassCertification %event%\">接受認證</a><br><a action=\"bypass -h Quest 9002_SubClassCertification 9002-05.htm\">不接受認證</a></body></html>"
     htmltext = html.replace("%level%","65").replace("%class%",str(CharTemplateTable.getInstance().getClassNameById(player.getActiveClass()))).replace("%skilltype%","共同技能").replace("%event%","lvl65Emergent")
   elif event == "Obtain70":
     html = "<html><body>副職業實力認證:<br>你打算接受%class%等級%level%的認證-%skilltype%。切記!一旦領取這個認證的話,除了用特別的方法取消認證之前,就算刪除這個職業後重新培養後再來,也無法再次得到認證。<br>那麼,要接受認證嗎?<br><a action=\"bypass -h Quest 9002_SubClassCertification %event%\">接受認證</a><br><a action=\"bypass -h Quest 9002_SubClassCertification 9002-05.htm\">不接受認證</a></body></html>"
     htmltext = html.replace("%level%","70").replace("%class%",str(CharTemplateTable.getInstance().getClassNameById(player.getActiveClass()))).replace("%skilltype%","共同技能").replace("%event%","lvl70Emergent")
   elif event == "Obtain75":
     html = "<html><body>副職業實力認證:<br>你打算接受%class%等級%level%的認證-%skilltype%。切記!一旦領取這個認證的話,除了用特別的方法取消認證之前,就算刪除這個職業後重新培養後再來,也無法再次得到認證。<br>那麼,要接受認證嗎?<br><a action=\"bypass -h Quest 9002_SubClassCertification %event1%\">接受共同認證</a><br><a action=\"bypass -h Quest 9002_SubClassCertification %event2%\">接受特殊認證</a><br><a action=\"bypass -h Quest 9002_SubClassCertification 9002-05.htm\">不接受認證</a></body></html>"
     htmltext = html.replace("%level%","75").replace("%class%",str(CharTemplateTable.getInstance().getClassNameById(player.getActiveClass()))).replace("%skilltype%","共同、特殊技能").replace("%event1%","lvl75Class").replace("%event2%","lvl75Master")
   elif event == "Obtain80":
     html = "<html><body>副職業實力認證:<br>你打算接受%class%等級%level%的認證-%skilltype%。切記!一旦領取這個認證的話,除了用特別的方法取消認證之前,就算刪除這個職業後重新培養後再來,也無法再次得到認證。<br>那麼,要接受認證嗎?<br><a action=\"bypass -h Quest 9002_SubClassCertification %event%\">接受認證</a><br><a action=\"bypass -h Quest 9002_SubClassCertification 9002-05.htm\">不接受認證</a></body></html>"
     htmltext = html.replace("%level%","80").replace("%class%",str(CharTemplateTable.getInstance().getClassNameById(player.getActiveClass()))).replace("%skilltype%","終極技能").replace("%event%","lvl80Class") 
   elif event.startswith("lvl"):
     level = int(event[3:5])
     type = event.replace(event[0:5],"")
     prefix = "-" + str(player.getClassIndex())
     if type == "Emergent":
       isAvailable65 = st.getGlobalQuestVar("EmergentAbility65" + prefix)
       isAvailable70 = st.getGlobalQuestVar("EmergentAbility70" + prefix)
       if event == "lvl65Emergent":
         if isAvailable65 == "" or isAvailable65 == "0":
           if player.getLevel() > 64:
             itemId = COMMONITEM
             var = "EmergentAbility" + str(level) + prefix
             getCertified(player, itemId, var)
             return "9002-07.htm"
           else:
             html = "<html><body>副職業實力認證:<br>你的實力還不到可以領取等級%level%的認證,更加培養一下實力再來吧。</body></html>"
             htmltext = html.replace("%level%",(event[3:5]))
             return htmltext
         else:
           return "9002-06.htm"
       elif event == "lvl70Emergent":
         if isAvailable70 == "" or isAvailable70 == "0":
           if player.getLevel() > 69:
             itemId = COMMONITEM
             var = "EmergentAbility" + str(level) + prefix
             getCertified(player, itemId, var)
             return "9002-07.htm"
           else:
             html = "<html><body>副職業實力認證:<br>你的實力還不到可以領取等級%level%的認證,更加培養一下實力再來吧。</body></html>"
             htmltext = html.replace("%level%",(event[3:5]))
             return htmltext
         else:
           return "9002-06.htm"
     elif type == "Master":
       isAvailable = st.getGlobalQuestVar("ClassAbility75" + prefix)
       if isAvailable == "" or isAvailable == "0":
         if player.getLevel() > 74:
           itemId = ENHANCEDITEM
           var = "ClassAbility" + str(level) + prefix
           getCertified(player, itemId, var)
           return "9002-07.htm"
         else:
           html = "<html><body>副職業實力認證:<br>你的實力還不到可以領取等級%level%的認證,更加培養一下實力再來吧。</body></html>"
           htmltext = html.replace("%level%",(event[3:5]))
           return htmltext
       else:
         return "9002-06.htm"
     elif type == "Class": 
       if level == 75:
         isAvailable = st.getGlobalQuestVar("ClassAbility75" + prefix)
         if isAvailable == "" or isAvailable == "0":
           if player.getLevel() > 74:
             itemId = CLASSITEMS[getClassIndex(player)]
             var = "ClassAbility" + str(level) + prefix
             getCertified(player, itemId, var)
             return "9002-07.htm"
           else:
             html = "<html><body>副職業實力認證:<br>你的實力還不到可以領取等級%level%的認證,更加培養一下實力再來吧。</body></html>"
             htmltext = html.replace("%level%",(event[3:5]))
             return htmltext
         else:
           return "9002-06.htm"
       elif level == 80:
         isAvailable = st.getGlobalQuestVar("ClassAbility80" + prefix)
         if isAvailable == "" or isAvailable == "0":
           if player.getLevel() > 79:  
             itemId = TRANSFORMITEMS[getClassIndex(player)]
             var = "ClassAbility" + str(level) + prefix
             getCertified(player, itemId, var)
             return "9002-07.htm"
           else:
             html = "<html><body>副職業實力認證:<br>你的實力還不到可以領取等級%level%的認證,更加培養一下實力再來吧。</body></html>"
             htmltext = html.replace("%level%",(event[3:5]))
             return htmltext
         else:
           return "9002-06.htm"
   return htmltext