From 367fd9c77f82b2c7960dc9281c270e550d3ecbb0 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 30 一月 2026 15:23:37 +0800
Subject: [PATCH] 438 【方案】方案预设-服务端(修复当前流派子方案切换时如切武将方案,定军阁进攻武将不会刷新的bug;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py |   36 ++++++++++++++++++++++--------------
 1 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
index 31fcbc8..95fef53 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
@@ -573,19 +573,10 @@
         return
     
     gwLV = max(1, curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MGGanwuLV))
-    gwIpyData = IpyGameDataPY.GetIpyGameData("MGGanwuLV", gwLV)
     colorIpyData = IpyGameDataPY.GetIpyGameData("MGGuayuQuality", itemColor)
     typeIpyData = IpyGameDataPY.GetIpyGameData("MGGuayuType", itemType)
-    if not gwIpyData or not colorIpyData or not typeIpyData:
+    if not colorIpyData or not typeIpyData:
         return
-    
-    # 四维基础值、加成值
-    baseAttrDict = {ChConfig.AttrID_Atk:[gwIpyData.GetAtkBase(), colorIpyData.GetAtkPlus()],
-                    ChConfig.AttrID_Def:[gwIpyData.GetDefBase(), colorIpyData.GetDefPlus()],
-                    ChConfig.AttrID_MaxHP:[gwIpyData.GetHPBase(), colorIpyData.GetHPPlus()],
-                    ChConfig.AttrID_AtkSpeed:[gwIpyData.GetAtkSpeedBase(), colorIpyData.GetAtkSpeedPlus()],
-                    }
-    batAttrBaseDict = gwIpyData.GetBatAttrBaseDict() # 其他战斗属性基础值字典,{属性ID:基础值, ...}
     
     # 四维占比
     attrProportion = typeIpyData.GetBaseAttrProportion()
@@ -596,11 +587,23 @@
     if not itemLV:
         # 随机等级
         lowLV, highLV = IpyGameDataPY.GetFuncEvalCfg("MinggeTY", 2)
-        randLVList = range(max(gwLV + lowLV, 1), gwLV + highLV)
+        randLVList = range(max(gwLV + lowLV, 1), gwLV + highLV + 1)
         itemLV = random.choice(randLVList)
     equipAttrDict[str(ShareDefine.Def_IudetItemLV)] = itemLV
     
-    GameWorld.DebugLog("生成命格卦玉: itemID=%s,itemLV=%s,itemColor=%s,itemType=%s" % (itemID, itemLV, itemColor, itemType), playerID)
+    gwIpyData = IpyGameDataPY.GetIpyGameData("MGGanwuLV", itemLV)
+    if not gwIpyData:
+        return
+    
+    # 四维基础值、加成值
+    baseAttrDict = {ChConfig.AttrID_Atk:[gwIpyData.GetAtkBase(), colorIpyData.GetAtkPlus()],
+                    ChConfig.AttrID_Def:[gwIpyData.GetDefBase(), colorIpyData.GetDefPlus()],
+                    ChConfig.AttrID_MaxHP:[gwIpyData.GetHPBase(), colorIpyData.GetHPPlus()],
+                    ChConfig.AttrID_AtkSpeed:[gwIpyData.GetAtkSpeedBase(), colorIpyData.GetAtkSpeedPlus()],
+                    }
+    batAttrBaseDict = gwIpyData.GetBatAttrBaseDict() # 其他战斗属性基础值字典,{属性ID:基础值, ...}
+    
+    GameWorld.DebugLog("生成命格卦玉: gwLV=%s,itemID=%s,itemLV=%s,itemColor=%s,itemType=%s" % (gwLV, itemID, itemLV, itemColor, itemType), playerID)
     legendAttrIDList = setAttrDict.get(str(ShareDefine.Def_IudetLegendAttrID))
     legendAttrValueList = setAttrDict.get(str(ShareDefine.Def_IudetLegendAttrValue))
     if legendAttrIDList != None and legendAttrValueList != None and len(legendAttrIDList) == len(legendAttrValueList):
@@ -609,8 +612,13 @@
     else:
         fixedAttrID = typeIpyData.GetFixedAttrID() # 固定属性
         attrIDLib = typeIpyData.GetAttrIDLib() # 随机属性库
-        libAttrCnt = colorIpyData.GetAttrLibCnt() # 随机属性个数
-        
+        libAttrCnt = 0 # 随机属性个数
+        libAttrCntNeedLVList = IpyGameDataPY.GetFuncEvalCfg("MinggeCfg", 1)
+        for needGWLV in libAttrCntNeedLVList:
+            if itemLV >= needGWLV:
+                libAttrCnt += 1
+            else:
+                break
         attrRangeDefault = colorIpyData.GetAttrRange()
         attrRangeDict = colorIpyData.GetAttrRangeDict()
         

--
Gitblit v1.8.0