From f3fd1d3c52fc2c3c49254db83a8fba108f3acc8b Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 19 四月 2019 16:12:26 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/SnxxServerCode
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBossReborn.py | 49 +++++++++++++++++++++++++++++++++----------------
1 files changed, 33 insertions(+), 16 deletions(-)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBossReborn.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBossReborn.py
index dc7b415..0457521 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBossReborn.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBossReborn.py
@@ -59,6 +59,7 @@
actBossRebornInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_BossReborn, {})
bossRebornID = actBossRebornInfo.get(ShareDefine.ActKey_ID, 0)
state = actBossRebornInfo.get(ShareDefine.ActKey_State, 0)
+ cfgID = actBossRebornInfo.get(ShareDefine.ActKey_CfgID, 0)
playerBossRebornID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BossRebornID) # 玩家身上的活动ID
@@ -66,15 +67,21 @@
if bossRebornID == playerBossRebornID:
#GameWorld.DebugLog("BOSS复活活动ID不变,不处理!", curPlayer.GetPlayerID())
return
- templateID = actBossRebornInfo.get(ShareDefine.ActKey_TemplateID, 0)
+ actWorldLV = actBossRebornInfo.get(ShareDefine.ActKey_WorldLV, 0)
+ playerWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BRActionWorldLV)
+
+ templateID = 0
+ if cfgID:
+ actBossIpyData = IpyGameDataPY.GetIpyGameData("ActBossReborn", cfgID)
+ templateID = 0 if not actBossIpyData else actBossIpyData.GetTemplateID()
playerTemplateID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BossRebornTemplateID)
GameWorld.DebugLog("BOSS复活重置! costRebateID=%s,playerCostRebateID=%s,state=%s,templateID=%s,playerTemplateID=%s"
% (bossRebornID, playerBossRebornID, state, templateID, playerTemplateID), playerID)
# 未领取的奖励邮件发放
- __SendBossRebornMail(curPlayer, playerTemplateID)
-
+ __SendBossRebornMail(curPlayer, playerTemplateID, playerWorldLV)
+ PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BRActionWorldLV, actWorldLV)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BossRebornID, bossRebornID)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BossRebornTemplateID, templateID)
for brid in ChConfig.BossRebornActIDList:
@@ -86,7 +93,7 @@
return True
-def __SendBossRebornMail(curPlayer, playerTemplateID):
+def __SendBossRebornMail(curPlayer, playerTemplateID, playerWorldLV):
# 未领取的奖励邮件发放
ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition("BossReborn", {'TemplateID':playerTemplateID}, True)
if not ipyDataList:
@@ -101,7 +108,7 @@
canGotCnt = (curTimes - gotTimes) / singleTimes
if not canGotCnt:
continue
- itemDict = __GetAwardItem(curPlayer, ipyData, canGotCnt)
+ itemDict = __GetAwardItem(curPlayer, ipyData, playerWorldLV, canGotCnt)
GameWorld.AddDictValue(totalItemDict, itemDict)
#去掉复活点道具
@@ -147,9 +154,9 @@
gotTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BRActionGotTimes % actionID)
if curTimes - gotTimes < singleTimes:
return
-
+ playerWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BRActionWorldLV)
#给奖励
- awardDict = __GetAwardItem(curPlayer, ipyData)
+ awardDict = __GetAwardItem(curPlayer, ipyData, playerWorldLV)
# 检查背包
needSpace = len(awardDict)
packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
@@ -162,14 +169,16 @@
#GameWorld.Log(' actionID=%s,curTimes=%s,gotTimes=%s,singleTimes=%s,newGotTimes=%s'%(actionID, curTimes, gotTimes,singleTimes, newGotTimes))
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BRActionGotTimes % actionID, newGotTimes)
for itemID, itemCnt in awardDict.items():
- ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 1, [IPY_GameWorld.rptItem])
+ ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [IPY_GameWorld.rptItem])
SyncBossRebornPlayerInfo(curPlayer, actionID)
return
-def __GetAwardItem(curPlayer, ipyData, times=1):
+def __GetAwardItem(curPlayer, ipyData, worldLV, times=1):
awardDict = {}
- for itemID, itemCnt, isbind in ipyData.GetReward():
+
+ awardList = GameWorld.GetDictValueByRangeKey(ipyData.GetReward(), worldLV, [])
+ for itemID, itemCnt, isbind in awardList:
if not itemID or not itemCnt:
continue
awardDict[itemID] = awardDict.get(itemID, 0) + itemCnt * times
@@ -207,19 +216,26 @@
def SyncBossRebornInfo(curPlayer):
actBossRebornInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_BossReborn, {})
state = actBossRebornInfo.get(ShareDefine.ActKey_State, 0)
- if not state:
+ cfgID = actBossRebornInfo.get(ShareDefine.ActKey_CfgID, 0)
+ if not state or not cfgID:
return
- templateID = actBossRebornInfo.get(ShareDefine.ActKey_TemplateID, 0)
+ actBossIpyData = IpyGameDataPY.GetIpyGameData("ActBossReborn", cfgID)
+ if not actBossIpyData:
+ return
+ templateID = actBossIpyData.GetTemplateID()
if not templateID:
return
ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition("BossReborn", {'TemplateID':templateID}, True)
if not ipyDataList:
return
+ worldLV = actBossRebornInfo.get(ShareDefine.ActKey_WorldLV, 0)
+ openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
actInfo = ChPyNetSendPack.tagMCBossRebornInfo()
actInfo.Clear()
- actInfo.StartDate = actBossRebornInfo.get(ShareDefine.ActKey_StartDate, "")
- actInfo.EndtDate = actBossRebornInfo.get(ShareDefine.ActKey_EndDate, "")
- actInfo.LimitLV = actBossRebornInfo.get(ShareDefine.ActKey_LVLimit, 0)
+ actInfo.StartDate = GameWorld.GetOperationActionDateStr(actBossIpyData.GetStartDate(), openServerDay)
+ actInfo.EndtDate = GameWorld.GetOperationActionDateStr(actBossIpyData.GetEndDate(), openServerDay)
+ actInfo.ResetType = actBossIpyData.GetResetType()
+ actInfo.LimitLV = actBossIpyData.GetLVLimit()
actInfo.TaskInfo = []
for ipyData in ipyDataList:
taskInfo = ChPyNetSendPack.tagMCBossRebornTaskInfo()
@@ -227,7 +243,8 @@
taskInfo.TotalTimes = ipyData.GetTotalTimes()
taskInfo.SingleTimes = ipyData.GetSingleTimes()
taskInfo.AwardItem = []
- for itemID, itemCnt, isBind in ipyData.GetReward():
+ awardList = GameWorld.GetDictValueByRangeKey(ipyData.GetReward(), worldLV, [])
+ for itemID, itemCnt, isBind in awardList:
awardItem = ChPyNetSendPack.tagMCBossRebornAwardItem()
awardItem.ItemID = itemID
awardItem.ItemCount = itemCnt
--
Gitblit v1.8.0