| | |
| | | if skillTag != ChConfig.Def_UseSkillTag_PetMaster:
|
| | | return False
|
| | |
|
| | | if not PetControl.IsPet(curNPC):
|
| | | if not PetControl.IsPetNPC(curNPC):
|
| | | GameWorld.ErrLog("NPCID %s AI %s 非宠物,无法获得主人释放技能"%(curNPC.GetNPCID(), curNPC.GetAIType()))
|
| | | return False
|
| | |
|
| | | petOwner = PetControl.GetPetOwner(curNPC)
|
| | | petOwner = PetControl.GetPetNPCOwner(curNPC)
|
| | |
|
| | | if petOwner == None:
|
| | | GameWorld.ErrLog("宠物(%s)对主人释放技能,找不到主人"%curNPC.GetRolePet().PetID)
|
| | |
| | |
|
| | | # 宠物对主人释放技能
|
| | | elif skillAffectTag == ChConfig.Def_UseSkillTag_PetMaster:
|
| | | if not PetControl.IsPet(attacker):
|
| | | if not PetControl.IsPetNPC(attacker):
|
| | | GameWorld.ErrLog("该NPC非宠物,无法获得主人释放技能")
|
| | | return False
|
| | |
|
| | | petOwner = PetControl.GetPetOwner(attacker)
|
| | | petOwner = PetControl.GetPetNPCOwner(attacker)
|
| | |
|
| | | if petOwner == None:
|
| | | GameWorld.ErrLog("宠物(%s)对主人释放技能,找不到主人"%attacker.GetRolePet().PetID)
|
| | |
| | |
|
| | | else:
|
| | | if affectTag == ChConfig.Def_UseSkillTag_PetMaster:
|
| | | if not PetControl.IsPet(attacker):
|
| | | if not PetControl.IsPetNPC(attacker):
|
| | | return False
|
| | |
|
| | | petOwner = PetControl.GetPetOwner(attacker)
|
| | | petOwner = PetControl.GetPetNPCOwner(attacker)
|
| | | if petOwner == None:
|
| | | return False
|
| | |
|
| | |
| | | ## 获取技能总等级
|
| | | # @param curPlayer
|
| | | # @return allSkillLV:总技能等级
|
| | | def GetAllSkillLV(curPlayer, funcType):
|
| | | allSkillLV = 0
|
| | | def GetAllSkillInfo(curPlayer, funcTypeList):
|
| | | # @return: {funcType:{skillID:skillLV, ...}, ...}
|
| | | skillDict = {}
|
| | | skillManager = curPlayer.GetSkillManager()
|
| | | for i in xrange(skillManager.GetSkillCount()):
|
| | | curPlayerSkill = skillManager.GetSkillByIndex(i)
|
| | | if curPlayerSkill == None:
|
| | | continue
|
| | | if curPlayerSkill.GetFuncType() != funcType:
|
| | | funcType = curPlayerSkill.GetFuncType()
|
| | | if funcType not in funcTypeList:
|
| | | continue
|
| | | skillLV = curPlayerSkill.GetSkillLV()
|
| | | allSkillLV += skillLV
|
| | | return allSkillLV
|
| | | if funcType not in skillDict:
|
| | | skillDict[funcType] = {}
|
| | | skillLVDict = skillDict[funcType]
|
| | | skillLVDict[curPlayerSkill.GetSkillID()] = curPlayerSkill.GetSkillLV()
|
| | | return skillDict
|