From 6fe1261afc29cf9940ae6758c12c0056adf85110 Mon Sep 17 00:00:00 2001 From: xdh <xiefantasy@qq.com> Date: 星期一, 05 十一月 2018 15:17:03 +0800 Subject: [PATCH] 2281 【主干】仙盟宴会传功过并获得经验的玩家的,受别人邀请还可以再次获得经验 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCAI/AICommon.py | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 44 insertions(+), 1 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..7095fc6 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]) @@ -477,9 +519,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