From cb452abc7bcda94073cfe0d136e831252374853d Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 07 二月 2026 19:30:57 +0800
Subject: [PATCH] 129 【战斗】战斗系统-服务端(NPC成长表增加等级字段;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py     |   32 +++++++++++++++++---------------
 PySysDB/PySysDBPY.h                                                                      |    1 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py |   11 ++++++++++-
 3 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 9f3c012..311584f 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -60,6 +60,7 @@
 struct NPCStronger 
 {
 	DWORD		_NPCID;	//NPCID
+	WORD		NPCLV;	//等级段
 	float		AtkRatio;	//攻击系数
 	float		DefRatio;	//防御系数
 	float		MaxHPRatio;	//生命系数
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
index 74a1e71..6ae0ee6 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/TurnAttack.py
@@ -855,7 +855,16 @@
     reModelID = lineupIpyData.GetReModelID()
     lvReIpyData = None
     heroIpyData = IpyGameDataPY.GetIpyGameData("Hero", heroID) if heroID else None
-    npcStronger = IpyGameDataPY.GetIpyGameDataNotLog("NPCStronger", npcID)
+    npcStronger = None
+    npcStrongerList = IpyGameDataPY.GetIpyGameDataListNotLog("NPCStronger", npcID)
+    if npcStrongerList and strongerLV:
+        for strongerData in npcStrongerList:
+            if not strongerData.GetNPCLV() or strongerLV <= strongerData.GetNPCLV():
+                npcStronger = strongerData
+                break
+        if not npcStronger:
+            npcStronger = npcStrongerList[-1] # 找不到时取最后一条
+            
     if npcStronger and strongerLV:
         lvReIpyData = IpyGameDataPY.GetIpyGameData("LVReValue", reModelID, strongerLV)
         if lvReIpyData:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 75121d5..20a6e83 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -84,6 +84,7 @@
 
                 "NPCStronger":(
                         ("DWORD", "NPCID", 1),
+                        ("WORD", "NPCLV", 0),
                         ("float", "AtkRatio", 0),
                         ("float", "DefRatio", 0),
                         ("float", "MaxHPRatio", 0),
@@ -2173,21 +2174,22 @@
         return
         
     def GetNPCID(self): return self.attrTuple[0] # NPCID DWORD
-    def GetAtkRatio(self): return self.attrTuple[1] # 攻击系数 float
-    def GetDefRatio(self): return self.attrTuple[2] # 防御系数 float
-    def GetMaxHPRatio(self): return self.attrTuple[3] # 生命系数 float
-    def GetStunRateRatio(self): return self.attrTuple[4] # float
-    def GetSuperHitRateRatio(self): return self.attrTuple[5] # float
-    def GetComboRateRatio(self): return self.attrTuple[6] # float
-    def GetMissRateRatio(self): return self.attrTuple[7] # float
-    def GetParryRateRatio(self): return self.attrTuple[8] # float
-    def GetSuckHPPerRatio(self): return self.attrTuple[9] # float
-    def GetStunRateDefRatio(self): return self.attrTuple[10] # float
-    def GetSuperHitRateDefRatio(self): return self.attrTuple[11] # float
-    def GetComboRateDefRatio(self): return self.attrTuple[12] # float
-    def GetMissRateDefRatio(self): return self.attrTuple[13] # float
-    def GetParryRateDefRatio(self): return self.attrTuple[14] # float
-    def GetSuckHPPerDefRatio(self): return self.attrTuple[15] # float
+    def GetNPCLV(self): return self.attrTuple[1] # 等级段 WORD
+    def GetAtkRatio(self): return self.attrTuple[2] # 攻击系数 float
+    def GetDefRatio(self): return self.attrTuple[3] # 防御系数 float
+    def GetMaxHPRatio(self): return self.attrTuple[4] # 生命系数 float
+    def GetStunRateRatio(self): return self.attrTuple[5] # float
+    def GetSuperHitRateRatio(self): return self.attrTuple[6] # float
+    def GetComboRateRatio(self): return self.attrTuple[7] # float
+    def GetMissRateRatio(self): return self.attrTuple[8] # float
+    def GetParryRateRatio(self): return self.attrTuple[9] # float
+    def GetSuckHPPerRatio(self): return self.attrTuple[10] # float
+    def GetStunRateDefRatio(self): return self.attrTuple[11] # float
+    def GetSuperHitRateDefRatio(self): return self.attrTuple[12] # float
+    def GetComboRateDefRatio(self): return self.attrTuple[13] # float
+    def GetMissRateDefRatio(self): return self.attrTuple[14] # float
+    def GetParryRateDefRatio(self): return self.attrTuple[15] # float
+    def GetSuckHPPerDefRatio(self): return self.attrTuple[16] # float
 
 # 技能表
 class IPY_Skill():

--
Gitblit v1.8.0