From 08495407cded2639b5de41960b38e4edb0fe0ad0 Mon Sep 17 00:00:00 2001 From: hch <305670599@qq.com> Date: 星期四, 23 八月 2018 21:48:56 +0800 Subject: [PATCH] fix:2818 子 【开发】新增境界压制技能 / 【后端】境界压制技能 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AICommon.py | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 42 insertions(+), 0 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 d449a62..0c3079f 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 @@ -395,6 +395,44 @@ #--------------------------------------------------------------------- + + +def GetCanUseRealmSuppressSkll(curNPC, curSkill): + if curSkill.GetFuncType() != ChConfig.Def_SkillFuncType_RealmSuppress: + # 非境界压制技能返回可用 + return True + + # 境界压制技能需判断 周围是否有低境界玩家 + npcRealmLV = NPCCommon.GetRealmLV(curNPC) + angryManager = curNPC.GetNPCAngry() + + for i in range(0, angryManager.GetAngryCount()) : + curAngry = angryManager.GetAngryValueTag(i) + if curAngry == None or curAngry.GetObjID() == 0: + continue + + #仇恨值 + curAngryValue = curAngry.GetAngryValue() + if curAngryValue == 0: + continue + + if curAngry.GetIsDisable(): + continue + + angryID = curAngry.GetObjID() + angryObjType = curAngry.GetObjType() + if angryObjType != IPY_GameWorld.gotPlayer: + continue + + curTag = GameWorld.GetObj(angryID, angryObjType) + if not curTag: + continue + if curTag.GetOfficialRank() < npcRealmLV: + return True + + return False + + ##NPC自动释放技能 # @param curNPC NPC实例 # @param curTag 攻击目标 @@ -453,6 +491,10 @@ if not CheckSkillTrigger(curNPC, triggerDict, index, tick): continue + # 境界压制需要根据仇恨列表中的玩家是否有压制 + if not GetCanUseRealmSuppressSkll(curNPC, useSkill): + continue + useCnt = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_SkillUseCnt % useSkill.GetSkillTypeID()) # 该技能已使用次数 useSkillList.append([useCnt, index, useSkill]) -- Gitblit v1.8.0