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/IpyGameDataPY.py | 23 +++++++++++++++++++++++
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py | 18 ++++++++++++++++--
PySysDB/PySysDBPY.h | 9 +++++++++
3 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index e34c63d..08a8847 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -460,6 +460,15 @@
dict AttrExDict; //特殊属性值字典 {attrKey:value, ...}
};
+//NPC表扩展
+
+struct tagNPCEx
+{
+ DWORD _NPCID; //NPCID
+ BYTE FightPowerLackAtkLimit; //战力不足限制攻击
+ DWORD SuppressFightPower; //推荐/压制战力
+};
+
//成长型怪物参数公式表
struct tagNPCStrengthen
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index aa409b1..378ca3d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -385,6 +385,12 @@
("dict", "AttrExDict", 0),
),
+ "NPCEx":(
+ ("DWORD", "NPCID", 1),
+ ("BYTE", "FightPowerLackAtkLimit", 0),
+ ("DWORD", "SuppressFightPower", 0),
+ ),
+
"NPCStrengthen":(
("DWORD", "NPCID", 1),
("BYTE", "IsStrengthenByPlayerCount", 0),
@@ -2668,6 +2674,19 @@
def GetAttrPer(self): return self.AttrPer # 对应等级表中的比例
def GetAttrSpecDict(self): return self.AttrSpecDict # 特殊属性值字典 {attrKey:value, ...}
def GetAttrExDict(self): return self.AttrExDict # 特殊属性值字典 {attrKey:value, ...}
+
+# NPC表扩展
+class IPY_NPCEx():
+
+ def __init__(self):
+ self.NPCID = 0
+ self.FightPowerLackAtkLimit = 0
+ self.SuppressFightPower = 0
+ return
+
+ def GetNPCID(self): return self.NPCID # NPCID
+ def GetFightPowerLackAtkLimit(self): return self.FightPowerLackAtkLimit # 战力不足限制攻击
+ def GetSuppressFightPower(self): return self.SuppressFightPower # 推荐/压制战力
# 成长型怪物参数公式表
class IPY_NPCStrengthen():
@@ -6007,6 +6026,8 @@
self.ipyPlayerLVLen = len(self.ipyPlayerLVCache)
self.ipyGMAttrCache = self.__LoadFileData("GMAttr", IPY_GMAttr)
self.ipyGMAttrLen = len(self.ipyGMAttrCache)
+ self.ipyNPCExCache = self.__LoadFileData("NPCEx", IPY_NPCEx)
+ self.ipyNPCExLen = len(self.ipyNPCExCache)
self.ipyNPCStrengthenCache = self.__LoadFileData("NPCStrengthen", IPY_NPCStrengthen)
self.ipyNPCStrengthenLen = len(self.ipyNPCStrengthenCache)
self.ipyNPCTimeLostHPCache = self.__LoadFileData("NPCTimeLostHP", IPY_NPCTimeLostHP)
@@ -6565,6 +6586,8 @@
def GetPlayerLVByIndex(self, index): return self.ipyPlayerLVCache[index]
def GetGMAttrCount(self): return self.ipyGMAttrLen
def GetGMAttrByIndex(self, index): return self.ipyGMAttrCache[index]
+ def GetNPCExCount(self): return self.ipyNPCExLen
+ def GetNPCExByIndex(self, index): return self.ipyNPCExCache[index]
def GetNPCStrengthenCount(self): return self.ipyNPCStrengthenLen
def GetNPCStrengthenByIndex(self, index): return self.ipyNPCStrengthenCache[index]
def GetNPCTimeLostHPCount(self): return self.ipyNPCTimeLostHPLen
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