From 90ddd0d1e43a80160893fe735e79b5877efbfb7f Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期三, 15 一月 2025 15:20:14 +0800
Subject: [PATCH] 10371 【越南】【英文】【BT】【砍树】所有寻宝类型都加上每日寻宝次数上限

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 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 be6bc5d..97a2280 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
@@ -65,9 +65,11 @@
     for i in xrange(ipyDataMgr.GetTreasureSetCount()):
         ipyData = ipyDataMgr.GetTreasureSetByIndex(i)
         treasureType = ipyData.GetTreasureType()
-        if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureFreeCount % (treasureType)):
+        if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureCountToday % (treasureType)) and \
+            not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureFreeCount % (treasureType)):
             continue
         syncTypeList.append(treasureType)
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureCountToday % (treasureType), 0)
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureFreeCount % (treasureType), 0)
     if syncTypeList:
         Sync_TreasureInfo(curPlayer, syncTypeList)
@@ -85,6 +87,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_TreasureCountToday % (treasureType), 0)
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureLuck % (treasureType), 0)
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureCntAward % (treasureType), 0)
         
@@ -138,6 +141,13 @@
     treasureCount = treasureCountList[treasureIndex]
     if not treasureCount:
         GameWorld.DebugLog("没有寻宝次数配置!", playerID)
+        return
+    dailyMaxCount = setIpyData.GetDailyMaxCount()
+    curTreasureCountToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureCountToday % (treasureType)) # 今日已寻宝次数
+    updTreasureCountToday = curTreasureCountToday + treasureCount
+    if dailyMaxCount and updTreasureCountToday > dailyMaxCount:
+        GameWorld.DebugLog("寻宝后将超过每日最大次数,无法寻宝! treasureCount(%s) + curTreasureCountToday(%s) = %s > %s" 
+                           % (treasureCount, curTreasureCountToday, updTreasureCountToday, dailyMaxCount), playerID)
         return
     
     packType = setIpyData.GetPackType()
@@ -380,6 +390,7 @@
         GameWorld.DebugLog("扣除货币,costGoldType=%s,costGold=%s" % (costGoldType, costGold), playerID)
         
     # 加数据
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureCountToday % (treasureType), updTreasureCountToday)
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureCount % (treasureType), updTreasureCount)
     for luckyGridNum in luckyGridNumList:
         if luckyGridNum in getGridResult:
@@ -433,8 +444,8 @@
     if mailItemList:
         PlayerControl.SendMailByKey("HappyXBUnEnough", [playerID], mailItemList)
         
-    GameWorld.DebugLog("寻宝成功: treasureType=%s,updTreasureCount=%s,updLuck=%s,addScoreType=%s,addScore=%s,gridNumCountInfo=%s" 
-                       % (treasureType, updTreasureCount, updLuck, addScoreType, addScore, gridNumCountInfo), playerID)
+    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("    treasureResult=%s" % (treasureResult), playerID)
     GameWorld.DebugLog("    mailItemList=%s" % (mailItemList), playerID)
     
@@ -561,6 +572,7 @@
         tTypeInfo.TreasureType = tType
         tTypeInfo.LuckValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureLuck % (tType))
         tTypeInfo.TreasureCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureCount % (tType))
+        tTypeInfo.TreasureCountToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureCountToday % (tType))
         tTypeInfo.FreeCountToday = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureFreeCount % (tType))
         tTypeInfo.TreasureCntAward = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_TreasureCntAward % (tType))
         for gridNumStr in gridNumMaxLimitInfo.keys():

--
Gitblit v1.8.0