From 3432541b467d53ffe4ed3872c734e76638e30df8 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 24 十月 2025 17:58:12 +0800
Subject: [PATCH] 302 【公会】BOSS讨伐-服务端

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py |   30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
index 1fca1bb..cebd907 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
@@ -78,6 +78,7 @@
             ItemControler.RecycleItem(curPlayer, costItemID, recycleItemMail)
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureFreeCount % (treasureType), 0)
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureCount % (treasureType), 0)
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureCountEx % (treasureType), 0)
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureCountToday % (treasureType), 0)
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureLuck % (treasureType), 0)
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureCntAward % (treasureType), 0)
@@ -240,6 +241,20 @@
         gridNumCountInfo[int(gridNumStr)] = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureGridCnt % (treasureType, gridNumStr))
     GameWorld.DebugLog("gridNumMaxLimitInfo=%s,gridNumCountInfo=%s" % (gridNumMaxLimitInfo, gridNumCountInfo), playerID)
     
+    treasureCountEx = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureCountEx % (treasureType)) # 当前第x次单抽、x抽
+    curIndexCount, maxIndexCount = 0, 0
+    beSureCountByIndexDict = {}
+    beSureCountByIndexList = ipyData.GetGridItemRateList4() # 第x次x抽必出,最多支持定制到9次
+    if beSureCountByIndexList and treasureIndex < len(beSureCountByIndexList):
+        beSureCountByIndexDict = beSureCountByIndexList[treasureIndex]
+        maxIndexCount = min(9, max(beSureCountByIndexDict))
+        curIndexCount = GameWorld.GetDataByDigitPlace(treasureCountEx, treasureIndex) + 1
+    rateByIndexCount = 0 # 第x次x抽必出可产出个数
+    rateByIndexCountList = []
+    if curIndexCount <= maxIndexCount and curIndexCount in beSureCountByIndexDict:
+        rateByIndexCountList = [[10000, beSureCountByIndexDict[curIndexCount]]]
+        rateByIndexCount = 1 # 可扩展支持产出多个,暂定单次抽奖仅定制产出1个
+        
     # 单抽产出优先级: 幸运物品 > 必出 > 保底 > 普通
     # 连抽没有优先级限制,只要满足条件即可产出
     getGridResult = []
@@ -275,6 +290,13 @@
         if not curRateList and ensureCount and updTreasureCount % ensureCount == 0 and ensureRateList:
             curRateList = GetRemoveLimitGridRateList(ensureRateList, gridNumCountInfo, gridNumMaxLimitInfo)
             GameWorld.DebugLog("    【满%s次数必出饼图】: %s" % (ensureCount, curRateList), playerID)
+            
+        # 第x次x抽必出,优先级较低
+        if not curRateList and rateByIndexCountList and rateByIndexCount > 0:
+            rateByIndexCount -= 1
+            curRateList = rateByIndexCountList
+            GameWorld.DebugLog("    【第x次x抽必出】: treasureIndex=%s,curIndexCount=%s,rateByIndexCount=%s,%s" 
+                               % (treasureIndex, curIndexCount, rateByIndexCount, rateByIndexCountList), playerID)
             
         doCount = 0
         while doCount <= 50: # 限制最大次数
@@ -388,6 +410,10 @@
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureLuck % (treasureType), updLuck)
     for gridNum, updCount in gridNumCountInfo.items():
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureGridCnt % (treasureType, gridNum), updCount)
+    if curIndexCount <= maxIndexCount:
+        treasureCountEx = GameWorld.ChangeDataByDigitPlace(treasureCountEx, treasureIndex, curIndexCount)
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureCountEx % (treasureType), treasureCountEx)
+        GameWorld.DebugLog("更新第x次x抽次数: treasureIndex=%s,curIndexCount=%s,maxIndexCount=%s,treasureCountEx=%s" % (treasureIndex, curIndexCount, maxIndexCount, treasureCountEx))
         
     addScoreType = setIpyData.GetAwardMoneyType() # 额外奖励货币类型
     addScore = setIpyData.GetAwardMoneyValue() # 单次奖励货币数
@@ -436,8 +462,8 @@
     if mailItemList:
         PlayerControl.SendMailByKey("HappyXBUnEnough", [playerID], mailItemList)
         
-    GameWorld.DebugLog("寻宝成功: treasureType=%s,updTreasureCount=%s(%s),updLuck=%s,addScoreType=%s,addScore=%s,gridNumCountInfo=%s" 
-                       % (treasureType, updTreasureCount, updTreasureCountToday, updLuck, addScoreType, addScore, gridNumCountInfo), playerID)
+    GameWorld.DebugLog("寻宝成功: treasureType=%s,updTreasureCount=%s(%s),updLuck=%s,addScoreType=%s,addScore=%s,gridNumCountInfo=%s,treasureCountEx=%s" 
+                       % (treasureType, updTreasureCount, updTreasureCountToday, updLuck, addScoreType, addScore, gridNumCountInfo, treasureCountEx), playerID)
     GameWorld.DebugLog("    treasureResult=%s" % (treasureResult), playerID)
     GameWorld.DebugLog("    mailItemList=%s" % (mailItemList), playerID)
     

--
Gitblit v1.8.0