hxp
2019-06-17 5c0d309ecb9aebef468660a09700a2b78dee78b8
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBossReborn.py
@@ -67,6 +67,8 @@
    if bossRebornID == playerBossRebornID:
        #GameWorld.DebugLog("BOSS复活活动ID不变,不处理!", curPlayer.GetPlayerID())
        return
    actWorldLV = actBossRebornInfo.get(ShareDefine.ActKey_WorldLV, 0)
    playerWorldLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BRActionWorldLV)
    
    templateID = 0
    if cfgID:
@@ -78,8 +80,8 @@
                       % (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:
@@ -91,7 +93,7 @@
    return True
def __SendBossRebornMail(curPlayer, playerTemplateID):
def __SendBossRebornMail(curPlayer, playerTemplateID, playerWorldLV):
    # 未领取的奖励邮件发放
    ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition("BossReborn", {'TemplateID':playerTemplateID}, True)
    if not ipyDataList:
@@ -106,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)
    
    #去掉复活点道具
@@ -152,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)
@@ -167,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
@@ -224,6 +228,7 @@
    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()
@@ -238,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