From d3ebd3fcf64cd6cc9881d7a0d7bdf4549f49e3d1 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 01 十二月 2025 18:10:59 +0800
Subject: [PATCH] 358 【内政】红颜系统-服务端(增加专属信物ID字段,与解锁物品ID区分;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py       |   16 +++++++++-------
 PySysDB/PySysDBPY.h                                                                        |    1 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBeauty.py |   40 +++++++++++++---------------------------
 3 files changed, 23 insertions(+), 34 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index b56fd56..d43d617 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -968,6 +968,7 @@
 	BYTE		UnlockWay;	//解锁方式
     DWORD		UnlockValue;	//解锁方式值
 	BYTE		UnlockNeedCnt;	//解锁所需个数
+    DWORD		ExclusiveItemID;	//专属信物ID
 	list		TalentAttrIDList;	//天赋属性ID列表
 	list		TalentAttrValueList;	//天赋属性初始值
 	list		TalentPerLVAddList;	//天赋属性每级成长
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index e256cec..4f9b678 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -805,6 +805,7 @@
                         ("BYTE", "UnlockWay", 0),
                         ("DWORD", "UnlockValue", 0),
                         ("BYTE", "UnlockNeedCnt", 0),
+                        ("DWORD", "ExclusiveItemID", 0),
                         ("list", "TalentAttrIDList", 0),
                         ("list", "TalentAttrValueList", 0),
                         ("list", "TalentPerLVAddList", 0),
@@ -3345,13 +3346,14 @@
     def GetUnlockWay(self): return self.attrTuple[2] # 解锁方式 BYTE
     def GetUnlockValue(self): return self.attrTuple[3] # 解锁方式值 DWORD
     def GetUnlockNeedCnt(self): return self.attrTuple[4] # 解锁所需个数 BYTE
-    def GetTalentAttrIDList(self): return self.attrTuple[5] # 天赋属性ID列表 list
-    def GetTalentAttrValueList(self): return self.attrTuple[6] # 天赋属性初始值 list
-    def GetTalentPerLVAddList(self): return self.attrTuple[7] # 天赋属性每级成长 list
-    def GetEffType(self): return self.attrTuple[8] # 天赋效果类型 BYTE
-    def GetEffTypeValue(self): return self.attrTuple[9] # 效果类型值 BYTE
-    def GetEffValue(self): return self.attrTuple[10] # 效果初始值 BYTE
-    def GetEffPerLVAdd(self): return self.attrTuple[11] # 天赋效果每级成长 DWORD
+    def GetExclusiveItemID(self): return self.attrTuple[5] # 专属信物ID DWORD
+    def GetTalentAttrIDList(self): return self.attrTuple[6] # 天赋属性ID列表 list
+    def GetTalentAttrValueList(self): return self.attrTuple[7] # 天赋属性初始值 list
+    def GetTalentPerLVAddList(self): return self.attrTuple[8] # 天赋属性每级成长 list
+    def GetEffType(self): return self.attrTuple[9] # 天赋效果类型 BYTE
+    def GetEffTypeValue(self): return self.attrTuple[10] # 效果类型值 BYTE
+    def GetEffValue(self): return self.attrTuple[11] # 效果初始值 BYTE
+    def GetEffPerLVAdd(self): return self.attrTuple[12] # 天赋效果每级成长 DWORD
 
 # 红颜品质升级表
 class IPY_BeautyQualityLV():
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBeauty.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBeauty.py
index 3fe8f91..d1b6242 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBeauty.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBeauty.py
@@ -239,21 +239,15 @@
     quality = ipyData.GetBeautyQuality()
     curLV, curExp = GetBeautyLVInfo(curPlayer, beautyID)
     
-    isCommItem = True # 是否使用的常规通用物品
     commItemIDList = IpyGameDataPY.GetFuncEvalCfg("BeautyLVUP", 1)
     commExpList = IpyGameDataPY.GetFuncEvalCfg("BeautyLVUP", 2)
     if itemID in commItemIDList:
         index = commItemIDList.index(itemID)
         perExp = commExpList[index] if len(commExpList) > index else 0
     else:
-        isCommItem = False
-        unlockWay = ipyData.GetUnlockWay()
-        unlockValue = ipyData.GetUnlockValue()
-        if unlockWay != UnlockWay_Item:
-            GameWorld.DebugLog("非道具激活的不支持专属信物ID升级! beautyID=%s,unlockWay=%s" % (beautyID, unlockWay), playerID)
-            return
-        if itemID != unlockValue:
-            GameWorld.DebugLog("非该红颜专属信物ID! beautyID=%s,itemID=%s != %s" % (beautyID, itemID, unlockValue), playerID)
+        exclusiveItemID = ipyData.GetExclusiveItemID()
+        if itemID != exclusiveItemID:
+            GameWorld.DebugLog("非该红颜专属信物ID! beautyID=%s,itemID=%s != %s" % (beautyID, itemID, exclusiveItemID), playerID)
             return
         perExp = IpyGameDataPY.GetFuncCfg("BeautyLVUP", 3)
         
@@ -280,24 +274,16 @@
         if costItemCount < 1:
             return
         
-        if isCommItem:
-            costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, itemID, costItemCount)
-            lackCnt = costItemCount - bindCnt - unBindCnt
-            if lackCnt > 0:
-                costItemCount -= lackCnt
-                GameWorld.DebugLog("消耗道具不足,有多少消耗多少! itemID=%s,costItemCount=%s,bindCnt=%s,unBindCnt=%s,lackCnt=%s" 
-                                   % (itemID, costItemCount, bindCnt, unBindCnt, lackCnt))
-            # 扣除消耗
-            if costItemCount > 0:
-                ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, costItemCount, "Beauty")
-        else:
-            itemCount = ItemControler.GetItemCountByID(curPlayer, itemID)
-            if itemCount < costItemCount:
-                costItemCount = itemCount
-                
-            if costItemCount > 0:
-                ItemControler.SetItemCountByID(curPlayer, itemID, itemCount - costItemCount)
-                
+        costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, itemID, costItemCount)
+        lackCnt = costItemCount - bindCnt - unBindCnt
+        if lackCnt > 0:
+            costItemCount -= lackCnt
+            GameWorld.DebugLog("消耗道具不足,有多少消耗多少! itemID=%s,costItemCount=%s,bindCnt=%s,unBindCnt=%s,lackCnt=%s" 
+                               % (itemID, costItemCount, bindCnt, unBindCnt, lackCnt))
+        # 扣除消耗
+        if costItemCount > 0:
+            ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, costItemCount, "Beauty")
+            
     addExp = costItemCount * perExp
     updExp = curExp + addExp
     GameWorld.DebugLog("红颜加经验: beautyID=%s,quality=%s,curLV=%s,curExp=%s,addExp=%s,updExp=%s/%s,itemID=%s,costItemCount=%s,perExp=%s" 

--
Gitblit v1.8.0