From 4d195938a96ccbf392307ac20fe17c2b9605e84e Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 17 十二月 2024 15:24:03 +0800
Subject: [PATCH] 10341 【后端】【越南】【英文】【BT】【砍树】寻宝多抽优化(道具不足时支持使用对应货币扣除)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py | 13 +++++++++++--
1 files changed, 11 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 785cee8..18f4fbc 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
@@ -173,9 +173,18 @@
delCostItemCount = costItemNeedCount - lackCount
lackCountCostMoney = 0
if lackCount > 0:
- lackCountCostMoney = ItemCommon.GetAutoBuyItemNeedGold({costItemID:lackCount})
+ costGoldList = setIpyData.GetCostMoneyList() # 消耗货币列表
+ costGoldType = setIpyData.GetCostMoneyType() # 消耗货币类型
+ if not costGoldType or not costGoldList or treasureIndex >= len(costGoldList) or not costGoldList[treasureIndex]:
+ GameWorld.ErrLog("寻宝道具不足,该寻宝类型不支持消耗货币寻宝! treasureType=%s,treasureIndex=%s" % (treasureType, treasureIndex), playerID)
+ return
+ costGold = costGoldList[treasureIndex]
+ perItemGold = int(costGold / costItemNeedCount) # 道具单价
+ lackCountCostMoney = perItemGold * lackCount
+ GameWorld.DebugLog("寻宝道具不足,使用对应货币扣除: costItemID=%s,perItemGold=%s,lackCount=%s,lackCountCostMoney=%s,costGoldType=%s"
+ % (costItemID, perItemGold, lackCount, lackCountCostMoney, costGoldType), playerID)
if lackCountCostMoney:
- moneyType = IPY_GameWorld.TYPE_Price_Gold_Paper
+ moneyType = costGoldType
infoDict = {ChConfig.Def_Cost_Reason_SonKey:costItemID}
if not PlayerControl.HaveMoney(curPlayer, moneyType, lackCountCostMoney):
return
--
Gitblit v1.8.0