From 9a5d8288ba607bdcd67cb93e03c7f09ece8b1569 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 13 三月 2026 14:29:24 +0800
Subject: [PATCH] 556 【付费功能】时装商店-服务端(优化时装转化碎片时A801通知,封包修改货币增加IsBind,同物品标记逻辑,时装转化标记=40;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py  |   10 +++++++---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py |   24 +++++++++++++++++-------
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py    |    8 ++++++--
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py           |    3 ++-
 4 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 17cf530..7870c7f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -4931,4 +4931,5 @@
 ItemSrcSign_GubaoEff, # 古宝效果额外产出 1
 ItemSrcSign_BeautyEff, # 红颜效果额外产出 2
 ItemSrcSign_TitleEff, # 称号效果额外产出 3
-) = range(1 + 3)
+ItemSrcSign_HeroSkinChange, # 武将时装转化 4
+) = range(1 + 4)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
index d0f7884..9005953 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetSendPack.py
@@ -13068,6 +13068,7 @@
     _fields_ = [
                   ("MoneyType", c_ubyte),    
                   ("MoneyValue", c_int),    
+                  ("IsBind", c_ubyte),    # 同物品IsBind标记逻辑
                   ]
 
     def __init__(self):
@@ -13082,6 +13083,7 @@
     def Clear(self):
         self.MoneyType = 0
         self.MoneyValue = 0
+        self.IsBind = 0
         return
 
     def GetLength(self):
@@ -13093,11 +13095,13 @@
     def OutputString(self):
         DumpString = '''// A8 01 获得奖励信息 //tagMCGiveAwardInfo:
                                 MoneyType:%d,
-                                MoneyValue:%d
+                                MoneyValue:%d,
+                                IsBind:%d
                                 '''\
                                 %(
                                 self.MoneyType,
-                                self.MoneyValue
+                                self.MoneyValue,
+                                self.IsBind
                                 )
         return DumpString
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
index 54a1cc8..15d3233 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/ItemControler.py
@@ -924,10 +924,6 @@
             tagItem.Clear()
             return True
         
-        if PlayerHero.AutoChangeToSkinPoint(curPlayer, tagItem):
-            tagItem.Clear()
-            return True
-        
         #增加副本次数
         if itemEff.GetEffectID() == ChConfig.Def_Effect_AddFBCnt:
             isAutoUse = itemEff.GetEffectValue(1)
@@ -964,7 +960,11 @@
             return self.PutItemInVPack(packIndex, tagItem, event)
         
         eventName, isForceEvent, addDict = event
-
+        
+        if PlayerHero.AutoChangeToSkinPoint(curPlayer, tagItem, eventName):
+            tagItem.Clear()
+            return True
+        
         #记录创建物品时的登录天
         if tagItem.GetItemTypeID() in ReadChConfig.GetEvalChConfig('OpenBoxByLoginDayCfg'):
             if tagItem.GetUserAttr(ShareDefine.Def_IudetCreateItemLoginDay) == 0:#没有设置过才设置
@@ -2290,6 +2290,7 @@
     '''通知玩家获得奖励信息
     @param giveItemInfo: 可以是列表 [[itemID,count,isBind], ...] 或  [[itemID,count], ...] 或  {itemID:count, ...}
     @param moneyInfo: 奖励货币信息 {moneyType:moneyValue, ...} moneyType 可以是字符串或数值
+                    moneyValue 也可以传入列表 [moneyValue, isBind],其中 isBind 同物品的 isBind 标记逻辑
     '''
     notifyItemList = []
     if isinstance(giveItemInfo, dict):
@@ -2303,14 +2304,23 @@
     clientPack.ExpPoint = exp / ChConfig.Def_PerPointValue
     clientPack.Exp = exp % ChConfig.Def_PerPointValue
     if moneyInfo and isinstance(moneyInfo, dict):
-        for moneyType, moneyValue in moneyInfo.items():
+        for moneyType, moneyValueInfo in moneyInfo.items():
             if isinstance(moneyType, str):
                 moneyType = int(moneyType)
-            if not moneyType or not moneyValue:
+            if not moneyType or not moneyValueInfo:
+                continue
+            isBind = 0
+            if isinstance(moneyValueInfo, int):
+                moneyValue = moneyValueInfo
+            elif isinstance(moneyValueInfo, list):
+                moneyValue = moneyValueInfo[0]
+                isBind = moneyValueInfo[1] if len(moneyValueInfo) > 1 else 0
+            else:
                 continue
             money = ChPyNetSendPack.tagMCGiveAwardMoney()
             money.MoneyType = moneyType
             money.MoneyValue = moneyValue
+            money.IsBind = isBind
             clientPack.MoneyList.append(money)
         clientPack.MoneyLen = len(clientPack.MoneyList)
     for itemInfo in notifyItemList:
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py
index 9300215..b46800b 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHero.py
@@ -1189,7 +1189,7 @@
     RefreshLordAttr(curPlayer) # 时装升星 - 全体属性
     return
 
-def AutoChangeToSkinPoint(curPlayer, curItem, notifyAward=True):
+def AutoChangeToSkinPoint(curPlayer, curItem, eventName):
     ## 获得皮肤时自动转化为皮肤碎片
     # @return: 是否成功转化
     itemID = curItem.GetItemTypeID()
@@ -1220,10 +1220,14 @@
     moneyValue = changePoint * itemCount
     GameWorld.DebugLog("武将皮肤不需要再升星了自动转化为皮肤碎片! itemID=%s,skinID=%s,skinQuality=%s,moneyValue=%s,itemCount=%s" 
                        % (itemID, skinID, skinQuality, moneyValue, itemCount))
-    if not PlayerControl.GiveMoney(curPlayer, moneyType, moneyValue, "HeroSkinChange", addDataDict, notifyAward=False):
+    if not PlayerControl.GiveMoney(curPlayer, moneyType, moneyValue, eventName, addDataDict, notifyAward=False):
         return
     curItem.Clear()
-    ItemControler.NotifyGiveAwardInfo(curPlayer, [], "HeroSkinChange", moneyInfo={moneyType:moneyValue}, dataEx=itemID)
+    
+    if eventName:
+        isBind = ItemControler.GetIsBindValue(srcSign=ChConfig.ItemSrcSign_HeroSkinChange)
+        ItemControler.NotifyGiveAwardInfo(curPlayer, [], eventName, moneyInfo={moneyType:[moneyValue, isBind]}, dataEx=itemID)
+        
     return True
 
 def GetItemHeroSkinIDDict():

--
Gitblit v1.8.0