From b49ad3d0dca73df86fcfeb276e5b45567c71e1ed Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期二, 14 五月 2019 19:43:01 +0800 Subject: [PATCH] 6778 【后端】【2.0】任务接口开发(技能专精升级改为指定专精类型,判断专精技能个数及设置专精技能个数增加支持指定专精类型) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBossReborn.py | 47 +++++++++++++++++++++++++++++------------------ 1 files changed, 29 insertions(+), 18 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 5e300bb..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,18 +67,21 @@ if bossRebornID == playerBossRebornID: #GameWorld.DebugLog("BOSS复活活动ID不变,不处理!", curPlayer.GetPlayerID()) return - actBossIpyData = IpyGameDataPY.GetIpyGameData("ActBossReborn", actBossRebornInfo.get(ShareDefine.ActKey_CfgID, 0)) - if not actBossIpyData: - return - templateID = actBossIpyData.GetTemplateID() + 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: @@ -89,7 +93,7 @@ return True -def __SendBossRebornMail(curPlayer, playerTemplateID): +def __SendBossRebornMail(curPlayer, playerTemplateID, playerWorldLV): # 未领取的奖励邮件发放 ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition("BossReborn", {'TemplateID':playerTemplateID}, True) if not ipyDataList: @@ -104,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) #去掉复活点道具 @@ -150,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) @@ -165,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 @@ -210,9 +216,10 @@ 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 - actBossIpyData = IpyGameDataPY.GetIpyGameData("ActBossReborn", actBossRebornInfo.get(ShareDefine.ActKey_CfgID, 0)) + actBossIpyData = IpyGameDataPY.GetIpyGameData("ActBossReborn", cfgID) if not actBossIpyData: return templateID = actBossIpyData.GetTemplateID() @@ -221,10 +228,13 @@ 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 = actBossIpyData.GetStartDate() - actInfo.EndtDate = actBossIpyData.GetEndDate() + 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: @@ -233,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