From 65557ab9a6b7afe3b79f4f0be0d8f0532e4ff3f0 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 25 十一月 2025 16:18:21 +0800
Subject: [PATCH] 121 【武将】武将系统-服务端(增加武将等级属性;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py |   19 ++++++++++++++++++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py       |    6 +++++-
 PySysDB/PySysDBPY.h                                                                        |    2 ++
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 8227a10..fdf790c 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -249,6 +249,8 @@
 	DWORD		_Quality;	//品质
 	DWORD		_HeroLV;	//武将等级
 	list		UPCostItem;	// 升级到下级消耗道具
+	list		AttrIDList;	// 武将属性ID列表
+	list		AttrValueList;	// 累计总属性值列表
 };
 
 //推荐阵容表
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index 8941247..235b16d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -249,6 +249,8 @@
                         ("DWORD", "Quality", 1),
                         ("DWORD", "HeroLV", 1),
                         ("list", "UPCostItem", 0),
+                        ("list", "AttrIDList", 0),
+                        ("list", "AttrValueList", 0),
                         ),
 
                 "LineupRecommend":(
@@ -2511,7 +2513,9 @@
         
     def GetQuality(self): return self.attrTuple[0] # 品质 DWORD
     def GetHeroLV(self): return self.attrTuple[1] # 武将等级 DWORD
-    def GetUPCostItem(self): return self.attrTuple[2] #  升级到下级消耗道具 list
+    def GetUPCostItem(self): return self.attrTuple[2] #  升级到下级消耗道具 list
+    def GetAttrIDList(self): return self.attrTuple[3] #  武将属性ID列表 list
+    def GetAttrValueList(self): return self.attrTuple[4] #  累计总属性值列表 list
 
 # 推荐阵容表
 class IPY_LineupRecommend():
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
index 213bb6a..72f47e8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerOnline.py
@@ -453,6 +453,7 @@
     countryHeroInfo = {} # 国家武将统计 {country:[heroID, ...], ...}
     fetterHeroInfo = {} # 阵容羁绊武将统计信息 {fetterID:[heroID, ...], ...}
     heroSelfAttrInfo = {} # 武将自身属性 {heroID:{attrID:value, ...}, ...}
+    heroLVAttrInfo = {} # 武将等级属性 {heroID:{attrID:value, ...}, ...}
     heroStarTalentInfo = {} # 武将星级天赋属性 {heroID:{attrID:value, ...}, ...}
     heroBreakAttrInfo = {} # 武将突破潜能属性 {heroID:{attrID:value, ...}, ...}
     heroAwakeTalentInfo = {} # 武将觉醒天赋属性 {heroID:{attrID:value, ...}, ...}
@@ -519,6 +520,18 @@
         for k, v in heroIpyData.GetBatAttrDict().items():
             selfAttrDict[int(k)] = v
         heroSelfAttrInfo[heroID] = selfAttrDict
+        
+        # 等级属性
+        heroLVAttrDict = {}
+        heroLVIpyData = IpyGameDataPY.GetIpyGameData("HeroQualityLV", quality, heroLV)
+        if heroLVIpyData:
+            attrIDList = heroLVIpyData.GetAttrIDList()
+            attrValueList = heroLVIpyData.GetAttrValueList()
+            for aIndex in range(min(len(attrIDList), len(attrValueList))):
+                attrID = attrIDList[aIndex]
+                attrValue = attrValueList[aIndex]
+                heroLVAttrDict[attrID] = heroLVAttrDict.get(attrID, 0) + attrValue
+        heroLVAttrInfo[heroID] = heroLVAttrDict
         
         # 突破潜能
         breakAttrDict = {}
@@ -654,6 +667,7 @@
     GameWorld.DebugLog("    国家武将统计=%s" % countryHeroInfo, playerID)
     GameWorld.DebugLog("    羁绊武将统计=%s" % fetterHeroInfo, playerID)
     GameWorld.DebugLog("    武将自身属性=%s" % heroSelfAttrInfo, playerID)
+    GameWorld.DebugLog("    武将等级属性=%s" % heroLVAttrInfo, playerID)
     GameWorld.DebugLog("    武将吞噬属性=%s" % heroStarTalentInfo, playerID)
     GameWorld.DebugLog("    武将突破潜能=%s" % heroBreakAttrInfo, playerID)
     GameWorld.DebugLog("    武将觉醒天赋=%s" % heroAwakeTalentInfo, playerID)
@@ -685,6 +699,7 @@
         lineupHero.heroBatAttrDict = {}
         lineupHero.fightPower = 0
         
+        heroLVAttrDict = heroLVAttrInfo.get(heroID, {})
         starTalentAttrDict = heroStarTalentInfo.get(heroID, {})
         breakAttrDict = heroBreakAttrInfo.get(heroID, {})
         awakeTalentAttrDict = heroAwakeTalentInfo.get(heroID, {})
@@ -728,6 +743,7 @@
                 
             lineupHaloValue, lineupHaloPer = lineupHaloAttrInfo.get(attrID, 0), 0
             fetterValue, fetterPer = fetterAttrDict.get(attrID, 0), 0
+            heroLVValue, heroLVPer = heroLVAttrDict.get(attrID, 0), 0
             starTalentValue, starTalentPer = starTalentAttrDict.get(attrID, 0), 0
             breakLVValue, breakLVPer = breakAttrDict.get(attrID, 0), 0
             awakeTalentValue, awakeTalentPer = awakeTalentAttrDict.get(attrID, 0), 0
@@ -735,6 +751,7 @@
                 heroSelfPer = selfAttrDict.get(attrPerID, 0) / 10000.0
                 lineupHaloPer = lineupHaloAttrInfo.get(attrPerID, 0) / 10000.0
                 fetterPer = fetterAttrDict.get(attrPerID, 0) / 10000.0
+                heroLVPer = heroLVAttrDict.get(attrPerID, 0) / 10000.0
                 starTalentPer = starTalentAttrDict.get(attrPerID, 0) / 10000.0
                 breakLVPer = breakAttrDict.get(attrPerID, 0) / 10000.0
                 awakeTalentPer = awakeTalentAttrDict.get(attrPerID, 0) / 10000.0
@@ -744,7 +761,7 @@
                              "gubaoValue":gubaoValue, "gubaoPer":gubaoPer, "hjgValue":hjgValue, "hjgPer":hjgPer, "horseValue":horseValue, "horsePer":horsePer, 
                              "beautyValue":beautyValue, "beautyPer":beautyPer,
                              "lineupInitAddPer":lineupInitAddPer, "lineupLVAddPer":lineupLVAddPer, "lineupBreakLVAddPer":lineupBreakLVAddPer, "lineupStarAddPer":lineupStarAddPer,
-                             "heroSelfValue":heroSelfValue, "heroSelfPer":heroSelfPer, "inheritPer":inheritPer,
+                             "heroSelfValue":heroSelfValue, "heroSelfPer":heroSelfPer, "inheritPer":inheritPer, "heroLVValue":heroLVValue, "heroLVPer":heroLVPer,
                              "lineupHaloValue":lineupHaloValue, "lineupHaloPer":lineupHaloPer, "fetterValue":fetterValue, "fetterPer":fetterPer,
                              "starTalentValue":starTalentValue, "starTalentPer":starTalentPer, "breakLVValue":breakLVValue, "breakLVPer":breakLVPer,
                              "awakeTalentValue":awakeTalentValue, "awakeTalentPer":awakeTalentPer,

--
Gitblit v1.8.0