From e1a7147dc7b7e8f9ba72cfa0065695a8d7c3bac6 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期二, 28 八月 2018 11:52:05 +0800
Subject: [PATCH] fix:2989 【后端】开服特惠由创角开启改为开服时开启
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py | 29 +++++++++++++++++++++--------
1 files changed, 21 insertions(+), 8 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 375083d..fbdfd98 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerTreasure.py
@@ -116,14 +116,24 @@
if not costItemList:
GameWorld.ErrLog("该寻宝类型索引不支持消耗道具寻宝!treasureType=%s,treasureIndex=%s" % (treasureType, treasureIndex), playerID)
return
- costItemID, costItemCount = costItemList[treasureIndex]
- if not costItemID or not costItemCount:
+ costItemID, costItemNeedCount = costItemList[treasureIndex]
+ if not costItemID or not costItemNeedCount:
return
costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, costItemID)
- if bindCnt + unBindCnt < costItemCount:
- GameWorld.DebugLog("寻宝消耗道具不足!costItemID=%s,costItemCount=%s,bindCnt=%s,unBindCnt=%s"
- % (costItemID, costItemCount, bindCnt, unBindCnt), playerID)
- return
+ lackCount = max(0, costItemNeedCount - bindCnt - unBindCnt)
+ delCostItemCount = costItemNeedCount - lackCount
+ lackCountCostMoney = 0
+ if lackCount > 0:
+ lackCountCostMoney = ItemCommon.GetAutoBuyItemNeedGold({costItemID:lackCount})
+ if lackCountCostMoney:
+ moneyType = IPY_GameWorld.TYPE_Price_Gold_Money
+ infoDict = {ChConfig.Def_Cost_Reason_SonKey:costItemID}
+ if not PlayerControl.HaveMoney(curPlayer, moneyType, lackCountCostMoney):
+ return
+ else:
+ GameWorld.DebugLog("寻宝消耗道具不足!costItemID=%s,costItemNeedCount=%s,bindCnt=%s,unBindCnt=%s"
+ % (costItemID, costItemNeedCount, bindCnt, unBindCnt), playerID)
+ return
# 仙玉寻宝
else:
@@ -298,8 +308,11 @@
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TreasureFreeTime % (treasureType, treasureIndex), curTime)
GameWorld.DebugLog("消耗免费次数,更新免费CD计算时间: %s" % curTime, playerID)
elif costType == 2:
- ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, costItemCount, ChConfig.ItemDel_Treasure)
- GameWorld.DebugLog("扣除寻宝道具,costItemID=%s,costItemCount=%s" % (costItemID, costItemCount), playerID)
+ ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, delCostItemCount, ChConfig.ItemDel_Treasure)
+ GameWorld.DebugLog("扣除寻宝道具,costItemID=%s,delCostItemCount=%s" % (costItemID, delCostItemCount), playerID)
+ if lackCountCostMoney:
+ infoDict = {"TreasureType":treasureType, "TreasureIndex":treasureIndex, "CostItemID":costItemID, "LackCount":lackCount}
+ PlayerControl.PayMoney(curPlayer, moneyType, lackCountCostMoney, ChConfig.Def_Cost_Treasure, infoDict, lackCount)
else:
infoDict = {"TreasureType":treasureType, "TreasureIndex":treasureIndex}
PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, costGold, ChConfig.Def_Cost_Treasure, infoDict)
--
Gitblit v1.8.0