From 36ca116422692e921945cec810d36fc5c0951a93 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 04 九月 2025 11:51:18 +0800
Subject: [PATCH] 121 【武将】武将系统-服务端(满最大幸运时重置幸运为0)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py | 68 +++++++++++++++++++---------------
1 files changed, 38 insertions(+), 30 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 c694aee..1ebb559 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
@@ -794,6 +794,42 @@
GameWorld.DebugLog("背包类型初始格子数: packType=%s,initCount=%s" % (packType, initCount))
return initCount
+def GetPackOpenItemCnt(curPlayer, packType):
+ ## 获取对应背包已购买的格子数
+ openCntDict = IpyGameDataPY.GetFuncEvalCfg("OpenPack", 3, {})
+ if str(packType) not in openCntDict:
+ return 0
+ openCntList = openCntDict[str(packType)]
+ if not openCntList:
+ return 0
+
+ buyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_PackBuyCnt % packType)
+ openCnt = sum(openCntList[:buyCnt])
+ if buyCnt > len(openCntList):
+ addCnt = (buyCnt - len(openCntList)) * openCntList[-1]
+ openCnt += addCnt
+
+ return openCnt
+
+def SyncPackBuyCnt(curPlayer, packType=None):
+ ## 同步已购买格子次数信息
+ openCntDict = IpyGameDataPY.GetFuncEvalCfg("OpenPack", 3, {})
+ if not openCntDict:
+ return
+ syncTypeList = [str(packType)] if packType else openCntDict.keys()
+
+ clientPack = ChPyNetSendPack.tagSCPackBuyInfo()
+ clientPack.BuyInfoList = []
+ for packTypeStr in syncTypeList:
+ packType = int(packTypeStr)
+ buy = ChPyNetSendPack.tagSCPackBuy()
+ buy.PackType = packType
+ buy.BuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_PackBuyCnt % packType)
+ clientPack.BuyInfoList.append(buy)
+ clientPack.Count = len(clientPack.BuyInfoList)
+ NetPackCommon.SendFakePack(curPlayer, clientPack)
+ return
+
## 获得虚拟背包格子数
# @param packindex 背包索引
# @return 背包格子数
@@ -1950,13 +1986,6 @@
itemName = str(itemID) if not curItemData else curItemData.GetName()
itemName = "%s LV%s" % (itemName, plusLV + 1)
isNeedRecord = curItemData and ItemControler.IsRuneItemNeedRecord(curItemData, plusLV)
- if packIndex == ShareDefine.rptGatherSoul:
- itemID = ItemControler.GetGatherSoulItemID(itemKeyData)
- plusLV = ItemControler.GetGatherSoulItemPlusLV(itemKeyData)
- curItemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
- itemName = str(itemID) if not curItemData else curItemData.GetName()
- itemName = "%s LV%s" % (itemName, plusLV + 1)
- isNeedRecord = curItemData and ItemControler.IsGatherSoulItemNeedRecord(curItemData, plusLV)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_VPackItem % (packIndex, place), 0)
if isNeedRecord:
@@ -2103,37 +2132,16 @@
@param alchemyDiffLV: 是否过滤掉大于X级的炼丹等级物品,0-不过滤,1-过滤且读默认配置,>1-特殊功能指定的过滤等级
'''
resultWeightList = []
- itemNeedPlayerLVDict = IpyGameDataPY.GetFuncEvalCfg("AlchemyDiffLV", 2, {})
- if alchemyDiffLV or itemNeedPlayerLVDict:
- playerLV = curPlayer.GetLV()
- # 如果有指定大于1的等级则取指定等级,没有的话取默认等级差
- if alchemyDiffLV == 1:
- alchemyDiffLV = IpyGameDataPY.GetFuncCfg("AlchemyDiffLV", 1)
- curAlchemyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyLV)
- for itemInfo in weightList:
- itemID = itemInfo[1][0]
- if itemID: # 支持配置ID为0时代表不产出
- itemData = GameWorld.GetGameData().GetItemByTypeID(itemID)
- if not itemData:
- continue
- if GetItemClassLV(itemData) > curAlchemyLV + alchemyDiffLV:
- continue
- if itemID in itemNeedPlayerLVDict:
- if playerLV < itemNeedPlayerLVDict[itemID]:
- continue
- resultWeightList.append(itemInfo)
- else:
- resultWeightList = weightList
return resultWeightList
## =======================================================================================
-def SyncMakeItemAnswer(curPlayer, makeType, isSuccess, makeItemID):
+def SyncMakeItemAnswer(curPlayer, makeType, isSuccess, makeValue):
makeItemAnswer = ChPyNetSendPack.tagMCMakeItemAnswer()
makeItemAnswer.Clear()
makeItemAnswer.MakeType = makeType
makeItemAnswer.Result = isSuccess
- makeItemAnswer.MakeItemID = makeItemID
+ makeItemAnswer.MakeValue = makeValue
NetPackCommon.SendFakePack(curPlayer, makeItemAnswer)
return
--
Gitblit v1.8.0