8822 【主干】【BT2】 H.活动-节日祈愿 / 1、活动结束时,祝福瓶未领取,邮件按顺序发放 2、活动结束时,充值大礼未领取,邮件发放
3个文件已修改
87 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWish.py 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3833,6 +3833,7 @@
#节日祝福活动
Def_PDict_FeastWishID = "FeastWishID"  # 玩家身上的活动ID,唯一标识,取活动开始日期time值
Def_PDict_FeastWishTemplateID = "FeastWishTemplateID" # 玩家身上的模板ID
Def_PDict_FeastWishBottleValue = "FeastWishBottleValue_%s"  # 祝福瓶当前祝福值,参数(瓶子编号)
Def_PDict_FeastWishBottleGetState = "FeastWishBottleGetState_%s"  # 祝福瓶已领取记录,参数(瓶子编号),按记录索引二进制位存储是否已领取
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActTotalRecharge.py
@@ -138,7 +138,8 @@
        
    if batchPlayerIDList:
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_TotalRechargeAwardRecord % actNum, awardRecord)
        PlayerControl.SendMailBatch("TotalRechargeMail", batchPlayerIDList, batchAddItemList, batchParamList)
        mailTypeKey = "TotalRechargeMail40" if actNum == 3 else "TotalRechargeMail"
        PlayerControl.SendMailBatch(mailTypeKey, batchPlayerIDList, batchAddItemList, batchParamList)
        
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWish.py
@@ -58,25 +58,90 @@
    actID = actInfo.get(ShareDefine.ActKey_ID, 0)
    state = actInfo.get(ShareDefine.ActKey_State, 0)
    
    templateID = __GetWishTemplateID()
    playerActID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishID) # 玩家身上的活动ID
    playerTemplateID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishTemplateID) # 玩家身上的模板ID
    # 活动ID 相同的话不处理
    if actID == playerActID:
        GameWorld.DebugLog("节日祝福活动ID不变,不处理!", curPlayer.GetPlayerID())
        if state:
            if templateID and templateID != playerTemplateID:
                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishTemplateID, templateID)
        return
    GameWorld.DebugLog("节日祝福活动重置! actID=%s,playerActID=%s,state=%s" % (actID, playerActID, state), playerID)
    GameWorld.DebugLog("节日祝福活动重置! actID=%s,playerActID=%s,state=%s,templateID=%s,playerTemplateID=%s"
                       % (actID, playerActID, state, templateID, playerTemplateID), playerID)
    
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishID, actID)
    if not state:
        return
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishTemplateID, templateID)
    if playerTemplateID:
        __SendWishBottleItemMail(curPlayer, playerTemplateID)
    bottleNumList = GetWishBottleNumList()
    for bottleNum in bottleNumList:
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleValue % bottleNum, 0)
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum, 0)
        
    Sync_FeastWishActionInfo(curPlayer)
    Sync_FeastWishPlayerInfo(curPlayer)
    if state:
        Sync_FeastWishActionInfo(curPlayer)
        Sync_FeastWishPlayerInfo(curPlayer)
    return True
def __SendWishBottleItemMail(curPlayer, playerTemplateID):
    # 未领取的奖励邮件发放
    if not playerTemplateID:
        return
    bottleIpyDataList = IpyGameDataPY.GetIpyGameDataList("ActFeastWishBottle", playerTemplateID)
    if not bottleIpyDataList:
        return
    playerID = curPlayer.GetPlayerID()
    batchPlayerIDList, batchAddItemList, batchParamList = [], [], []
    for ipyData in bottleIpyDataList:
        bottleNum = ipyData.GetWishBottleNum()
        choosePrizeItemDict = ipyData.GetChoosePrizeItem()
        curWishValue = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishBottleValue % bottleNum)
        getState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum)
        getIndexList = []
        for recordIndex in choosePrizeItemDict.keys():
            if getState & pow(2, recordIndex):
                getIndexList.append(recordIndex)
        getTimes = len(getIndexList)
        maxTimes = ipyData.GetChooseTimeMax()
        if getTimes >= maxTimes:
            continue
        needGiveTimes = min(maxTimes - getTimes, curWishValue / ipyData.GetNeedWishValue())
        if not needGiveTimes:
            continue
        awardItemList = []
        for recordIndex, itemInfo in choosePrizeItemDict.items():
            if recordIndex in getIndexList:
                continue
            awardItemList.append(itemInfo)
            curWishValue = curWishValue - ipyData.GetNeedWishValue()
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleValue % bottleNum, curWishValue)
            getState = getState | pow(2, recordIndex)
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWishBottleGetState % bottleNum, getState)
        if not awardItemList:
            continue
        batchPlayerIDList.append([playerID])
        batchAddItemList.append(awardItemList)
        batchParamList.append([bottleNum])
    if batchPlayerIDList:
        PlayerControl.SendMailBatch("FeastWishBottleAwardMail", batchPlayerIDList, batchAddItemList, batchParamList)
    return
#// AA 10 节日祝福瓶选择奖励物品 #tagCMFeastWishBottleChooseItem
#
@@ -339,15 +404,15 @@
def __GetWishTemplateID():
    actInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FeastWish, {})
    if not actInfo:
        return
        return 0
    
    if not actInfo.get(ShareDefine.ActKey_State):
        return
        return 0
    
    cfgID = actInfo.get(ShareDefine.ActKey_CfgID)
    ipyData = IpyGameDataPY.GetIpyGameData("ActFeastWish", cfgID)
    if not ipyData:
        return
        return 0
    
    worldLV = actInfo.get(ShareDefine.ActKey_WorldLV)
    templateID = GameWorld.GetDictValueByRangeKey(ipyData.GetTemplateIDInfo(), worldLV, 0)