From bc5f3f1c88d225109fa39a85b209ef13f5fb52a9 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 06 二月 2026 21:28:13 +0800
Subject: [PATCH] 66 【公会】基础主体-服务端(跨服公会所有基本功能支持、跨服砍价支持;修改查看目标公会、查看目标玩家方式;)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py | 49 ++++++++++++++++++++++++++++++++-----------------
1 files changed, 32 insertions(+), 17 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 9823111..19e6d2b 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
@@ -30,6 +30,7 @@
import ChItem
import IpyGameDataPY
import ChPyNetSendPack
+import GameWorldEvent
import NetPackCommon
import PyGameData
import ChEquip
@@ -51,7 +52,7 @@
#---------------------------------------------------------------------
def InitPyItem():
- if PyGameData.InitPyItem:
+ if PyGameData.g_initPyItem:
return
GameWorld.Log("加载物品数据...")
@@ -94,8 +95,10 @@
if PyGameData.AutoTransformCountItemIDList:
GameWorld.Log("自动转化为物品个数的物品ID列表: %s" % PyGameData.AutoTransformCountItemIDList)
GameWorld.Log("货币类型1个数量对应物品ID: %s" % PyGameData.MoneyItemIDDict)
-
- PyGameData.InitPyItem = True
+ if not PyGameData.MoneyItemIDDict:
+ GameWorld.SendGameErrorEx("InitPyItemError", "启动加载物品数据异常! itemCount=%s" % gameData.GetItemCount())
+ PyGameData.g_initPyItem = True
+ GameWorldEvent.OnServerInitOK()
return
def GetMoneyItemID(moneyType):
@@ -572,18 +575,11 @@
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()],
- }
# 四维占比
attrProportion = typeIpyData.GetBaseAttrProportion()
@@ -593,11 +589,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):
@@ -606,8 +614,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()
@@ -629,12 +642,14 @@
# 其他战斗属性
else:
+ baseValue = batAttrBaseDict.get(attrID, 0)
attrRange = attrRangeDict.get(attrID, attrRangeDefault)
if not attrRange or len(attrRange) != 2:
continue
attrMin, attrMax = attrRange
- attrValue = random.randint(attrMin, attrMax)
- GameWorld.DebugLog(" attrID=%s,attrValue=%s(%s~%s)" % (attrID, attrValue, attrMin, attrMax), playerID)
+ plusValue = random.randint(attrMin, attrMax)
+ attrValue = baseValue + plusValue
+ GameWorld.DebugLog(" attrID=%s,attrValue=%s,baseValue=%s,plusValue=%s,(%s~%s)" % (attrID, attrValue, baseValue, plusValue, attrMin, attrMax), playerID)
legendAttrIDList.append(attrID)
legendAttrValueList.append(attrValue)
--
Gitblit v1.8.0