From 31a441bf2842217a4fb215ae25d6e836980f52d4 Mon Sep 17 00:00:00 2001 From: xdh <xiefantasy@qq.com> Date: 星期四, 24 一月 2019 10:17:34 +0800 Subject: [PATCH] 5924 【后端】【1.5.100】诛仙Boss功能(杀人不红名) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AICommon.py | 45 +++++++++++++++++++++++++-------------------- 1 files changed, 25 insertions(+), 20 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AICommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AICommon.py index 0c3079f..09a4ecf 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AICommon.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AICommon.py @@ -333,18 +333,21 @@ useSkill = changeSkill #GameWorld.DebugLog("----随机技能 %s"%useSkill.GetSkillID()) - if PetControl.IsPet(curNPC): - petOwner = PetControl.GetPetOwner(curNPC) - - if petOwner == None: - GameWorld.ErrLog("宠物(%s)找不到主人"%curNPC.GetRolePet().PetID) - return False - - #血量条件判定 - effect = SkillCommon.GetSkillEffectByEffectID(useSkill, ChConfig.Def_Skill_Effect_HPPerLimit) - if effect: - if GameObj.GetHP(petOwner)*ChConfig.Def_MaxRateValue/GameObj.GetMaxHP(petOwner) >= effect.GetEffectValue(0): - return False + #=========================================================================== + # 改成被动触发 + # if PetControl.IsPet(curNPC): + # petOwner = PetControl.GetPetOwner(curNPC) + # + # if petOwner == None: + # GameWorld.ErrLog("宠物(%s)找不到主人"%curNPC.GetRolePet().PetID) + # return False + # + # #血量条件判定 + # effect = SkillCommon.GetSkillEffectByEffectID(useSkill, ChConfig.Def_Skill_Effect_HPPerLimit) + # if effect: + # if GameObj.GetHP(petOwner)*ChConfig.Def_MaxRateValue/GameObj.GetMaxHP(petOwner) >= effect.GetEffectValue(0): + # return False + #=========================================================================== skillTag = SkillShell.GetSkillAffectTag(useSkill) skillAim = SkillShell.GetSkillFireAim(useSkill) @@ -480,12 +483,13 @@ if SkillShell.GetSkillFireAim(useSkill) == ChConfig.Def_UseSkillAim_Obj: # 主目标对象判定, 不能释放则不进入队列 curSkillUseTag = SkillShell.GetSkillAffectTag(useSkill) - hurtTypeList = ChConfig.Def_Dict_UseSkillTag_ObjType.get(curSkillUseTag) - if not hurtTypeList: - continue - - if tagObjType not in hurtTypeList: - continue + if curSkillUseTag != ChConfig.Def_UseSkillTag_AppointNPC: + hurtTypeList = ChConfig.Def_Dict_UseSkillTag_ObjType.get(curSkillUseTag) + if not hurtTypeList: + continue + + if tagObjType not in hurtTypeList: + continue if triggerDict != {}: if not CheckSkillTrigger(curNPC, triggerDict, index, tick): @@ -502,7 +506,7 @@ return False useSkillList.sort() # 按使用次数优先升序排,使用次数低的优先判断使用 - #GameWorld.DebugLog('技能使用顺序 = useSkillList%s' % str(useSkillList), curNPC.GetID()) + GameWorld.DebugLog('技能使用顺序 = useSkillList%s' % str(useSkillList), curNPC.GetID()) for useCnt, index, useSkill in useSkillList: if DoNPCUseSkill(curNPC, curTag, useSkill, tagDist, tick): @@ -519,9 +523,10 @@ # @return 布尔值 def CheckSkillTrigger(curNPC, triggerDict, npcSkillindex, tick): skillInfo = triggerDict.get(npcSkillindex) + if skillInfo != None: #当前血量 - hpPercent = int(curNPC.GetHP()/float(GameObj.GetMaxHP(curNPC))*100) + hpPercent = int(GameObj.GetHP(curNPC)/float(GameObj.GetMaxHP(curNPC))*100) checkHP = skillInfo[0] #血量未到 -- Gitblit v1.8.0