From fc3f5ce2d3362ca59a04c1b1aba43f8cfbcf79b1 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 09 一月 2026 10:34:11 +0800
Subject: [PATCH] 271 【内政】古宝系统-服务端(古宝升星增加验证同品质x个x星条件;修复古宝月卡特权领奖会越领越多bug;)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGubao.py      |   15 +++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py           |    6 ++++--
 PySysDB/PySysDBPY.h                                                                            |    1 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py |    2 +-
 4 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 0780048..7fe30a5 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -972,6 +972,7 @@
 {
 	BYTE		_GubaoQuality;	//古宝品质
 	BYTE		GubaoStar;	//古宝星级
+	list		QualityStarCond;	//需同品质X个X星
 	BYTE		StarUPNeedSelfCnt;	//升到本星消耗本体碎片数量
 	list		StarUPNeedItemList;	//消耗其他物品列表 [[物品ID,个数], ...]
 };
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index fda62e0..707ea02 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -811,6 +811,7 @@
                 "GubaoStar":(
                         ("BYTE", "GubaoQuality", 1),
                         ("BYTE", "GubaoStar", 0),
+                        ("list", "QualityStarCond", 0),
                         ("BYTE", "StarUPNeedSelfCnt", 0),
                         ("list", "StarUPNeedItemList", 0),
                         ),
@@ -3395,8 +3396,9 @@
         
     def GetGubaoQuality(self): return self.attrTuple[0] # 古宝品质 BYTE
     def GetGubaoStar(self): return self.attrTuple[1] # 古宝星级 BYTE
-    def GetStarUPNeedSelfCnt(self): return self.attrTuple[2] # 升到本星消耗本体碎片数量 BYTE
-    def GetStarUPNeedItemList(self): return self.attrTuple[3] # 消耗其他物品列表 [[物品ID,个数], ...] list
+    def GetQualityStarCond(self): return self.attrTuple[2] # 需同品质X个X星 list
+    def GetStarUPNeedSelfCnt(self): return self.attrTuple[3] # 升到本星消耗本体碎片数量 BYTE
+    def GetStarUPNeedItemList(self): return self.attrTuple[4] # 消耗其他物品列表 [[物品ID,个数], ...] list
 
 # 古宝品质升级表
 class IPY_GubaoLV():
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
index 0baf95c..370e38a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
@@ -260,7 +260,7 @@
             
         dayAwardDict = IpyGameDataPY.GetFuncEvalCfg("InvestDay", 3, {})
         if str(investType) in dayAwardDict:
-            rewardItemList = dayAwardDict[str(investType)]
+            rewardItemList += dayAwardDict[str(investType)]
             
     if not rewardItemList:
         return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGubao.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGubao.py
index 3b63218..f0a8fa4 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGubao.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGubao.py
@@ -135,9 +135,24 @@
     if not nextIpyData:
         GameWorld.DebugLog("古宝已满星! gubaoID=%s,quality=%s,star=%s" % (gubaoID, quality, star), playerID)
         return
+    qualityStarCond = nextIpyData.GetQualityStarCond() # 需同品质X个X星
     needSelfCnt = nextIpyData.GetStarUPNeedSelfCnt()
     needItemList = nextIpyData.GetStarUPNeedItemList()
     
+    if qualityStarCond and len(qualityStarCond) == 2:
+        needGBCnt, needGBStar = qualityStarCond
+        condGubaoCnt = 0
+        ipyDataMgr = IpyGameDataPY.IPY_Data()
+        for index in xrange(ipyDataMgr.GetGubaoCount()):
+            gbIpyData = ipyDataMgr.GetGubaoByIndex(index)
+            _, gbStar, _ = GetGubaoInfo(curPlayer, gbIpyData.GetGubaoID())
+            if gbIpyData.GetGubaoQuality() == quality and gbStar >= needGBStar:
+                condGubaoCnt += 1
+        if condGubaoCnt < needGBCnt:
+            GameWorld.DebugLog("古宝升星所需同品质星级古宝数不足! quality=%s,nextStar=%s,condGubaoCnt=%s < %s,needGBStar=%s" 
+                               % (quality, nextStar, condGubaoCnt, needGBCnt, needGBStar), playerID)
+            return
+        
     if needItemList:
         itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
         lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(needItemList, itemPack)

--
Gitblit v1.8.0