From 0c227b568dceb8124cf1e8611df0fb27c6efa6ac Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 25 三月 2019 21:35:46 +0800
Subject: [PATCH] 6385 【后端】【2.0】五行灵根开发(优化洗点)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py | 28 ++++++++++++----------------
1 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py
index dedd5c9..462c1f3 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py
@@ -134,19 +134,14 @@
return
def __GetItemList(itemDict, job, worldLV):
- #{世界等级范围:[(物品ID,个数,是否绑定), ...]},若物品ID要区分职业则配{世界等级范围:[({职业:物品ID,..},个数,是否绑定), ...]}
- itemList = []
- itemInfoList = GameWorld.GetDictValueByRangeKey(itemDict, worldLV, [])
- for itemInfo in itemInfoList:
- if type(itemInfo[0]) == dict:
- itemID = itemInfo[0].get(job)
- if not itemID:
- GameWorld.ErrLog('累计充值奖励未配置该职业itemDict=%s,job=%s'%(itemDict, job))
- continue
- else:
- itemID = itemInfo[0]
- itemList.append([itemID, itemInfo[1], itemInfo[2]])
- return itemList
+ #{世界等级范围:{职业:[(物品ID,个数,是否绑定), ...]}}
+ itemInfoDict = GameWorld.GetDictValueByRangeKey(itemDict, worldLV, {})
+ if str(job) not in itemInfoDict:
+ GameWorld.ErrLog('累计充值奖励未配置该职业itemDict=%s,job=%s'%(itemDict, job))
+ return []
+ else:
+ return itemInfoDict[str(job)]
+
def AddTotalRechargeGold(curPlayer, addGold):
if addGold <= 0:
@@ -234,7 +229,7 @@
PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName(), needGold])
for itemID, itemCount, isBind in awardItemList:
- ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, isBind, [IPY_GameWorld.rptItem])
+ ItemControler.GivePlayerItem(curPlayer, itemID, itemCount, 0, [IPY_GameWorld.rptItem])
addDataDict = {"TemplateID":templateID, "NeedGold":needGold, "AwardIndex":awardIndex,
"ItemList":str(awardItemList)}
@@ -267,6 +262,7 @@
if not templateIDList:
return
job = curPlayer.GetJob()
+ actWorldLV = actTotalRechargeInfo.get(ShareDefine.ActKey_WorldLV, 0)
openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
actInfo = ChPyNetSendPack.tagMCActTotalRechargeInfo()
actInfo.StartDate = GameWorld.GetOperationActionDateStr(ipyData.GetStartDate(), openServerDay)
@@ -286,8 +282,8 @@
awardInfo.AwardIndex = ipyData.GetAwardIndex()
awardInfo.NeedGold = ipyData.GetNeedGold()
awardInfo.AwardItem = []
- awardItemDict = ipyData.GetAwardItem()
- for itemID, itemCount, isBind in awardItemDict.get(str(job), []):
+ awardItemList = __GetItemList(ipyData.GetAwardItem(), job, actWorldLV)
+ for itemID, itemCount, isBind in awardItemList:
awardItem = ChPyNetSendPack.tagMCTotalRechargeAwardItem()
awardItem.ItemID = itemID
awardItem.ItemCount = itemCount
--
Gitblit v1.8.0