|  |  | 
 |  |  | 
 | 
 |  |  |     
 | 
 |  |  | #---------------------------------------------------------------------
 | 
 |  |  | 
 | 
 |  |  | 
 | 
 |  |  | 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 攻击目标
 | 
 |  |  | 
 |  |  |             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])
 | 
 |  |  |         
 | 
 |  |  | 
 |  |  | # @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]
 | 
 |  |  |         
 | 
 |  |  |         #血量未到
 |