From 4a5de5f9b8f4617bdb7f6d4733fcc0200e458d65 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 22 十一月 2021 17:02:25 +0800
Subject: [PATCH] 9367 【BT5】【主干】战力压制拓展到21亿以上

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
index 29f3bbf..c217d01 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -114,11 +114,25 @@
         return max(curNPC.GetCurLV(), curNPC.GetLV())
     return curNPC.GetLV()
 
+def GetNPCDataEx(npcID):
+    ## 获取NPC扩展数据表,可热更
+    npcDataEx = IpyGameDataPY.GetIpyGameDataNotLog("NPCEx", npcID)
+    if not npcDataEx:
+        if False: # 不可能成立的条件,只为了 . 出代码提示
+            npcDataEx = IpyGameDataPY.IPY_NPCEx()
+        return npcDataEx
+    return npcDataEx
+
 def GetRealmLV(curNPC): return curNPC.GetMAtkMin()      # NPC表中此字段含义改成境界等级
 def SetRealmLV(curNPC, realmLV): return curNPC.SetMAtkMin(realmLV)      # NPC表中此字段含义改成境界等级
 def GetIsLVSuppress(curNPC): return curNPC.GetWindDef() # 风防代表是否等级压制
-def GetSuppressFightPower(curNPC): return curNPC.GetThunderDef() # 雷防代表压制战力
-def SetSuppressFightPower(curNPC, value): return curNPC.SetThunderDef(value)
+def GetFightPowerLackAtkLimit(curNPC): # 战力不足限制攻击,默认不限制
+    npcDataEx = GetNPCDataEx(curNPC.GetNPCID())
+    return npcDataEx.GetFightPowerLackAtkLimit() if npcDataEx else 0
+def GetSuppressFightPower(curNPC):
+    npcDataEx = GetNPCDataEx(curNPC.GetNPCID())
+    return npcDataEx.GetSuppressFightPower() if npcDataEx else curNPC.GetThunderDef() # 雷防代表压制战力
+def SetSuppressFightPower(curNPC, value): return curNPC.SetThunderDef(min(value, ShareDefine.Def_UpperLimit_DWord))
 def GetCommendFightPower(curNPC): return curNPC.GetFireDef() # 火防代表推荐战力
 def GetDropOwnerType(curNPC): return curNPC.GetThunderAtk() # 雷攻代表掉落归属类型
 def GetFaction(curNPC): return curNPC.GetCountry()

--
Gitblit v1.8.0