xdh
2019-01-28 5054ef8e509abc644c37bc349adbe448ed4f49a5
5926 【后端】【1.5.100】新增节日巡礼
7个文件已修改
1个文件已添加
497 ■■■■■ 已修改文件
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerNewFairyCeremony.py 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWeekParty.py 447 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerNewFairyCeremony.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWeekParty.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerNewFairyCeremony.py
@@ -51,7 +51,7 @@
    billboardCnt = billBoard.GetCount()
    
    for index in range(0, billboardCnt):
        ipyData = IpyGameDataPY.GetIpyGameData('UniquenessArrive', worldLvNum, index + 1)
        ipyData = IpyGameDataPY.GetIpyGameData('NewUniquenessArrive', worldLvNum, index + 1)
        if not ipyData:
            break
        objBillboard = billBoard.At(index)
@@ -63,7 +63,7 @@
            continue
        
        awardList = awardInfoDict[str(job)]
        PlayerCompensation.SendMailByKey('CeremonyRank', [playerID], awardList, [objBillboard.GetName1(), index + 1])
        PlayerCompensation.SendMailByKey('NewCeremonyRank', [playerID], awardList, [objBillboard.GetName1(), index + 1])
        
    GameWorld.DebugLog('    活动结束  绝版降临给奖励  worldLvNum=%s, billboardCnt=%s' % (worldLvNum, billboardCnt))
    return
@@ -71,7 +71,7 @@
def __GetFCWorldLVIndex(fcType):
    #获取活动世界等级档
    playerFCWorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_OActWorldLV % ShareDefine.OperationActionName_NewFairyCeremony)
    fcWorldlvDict = IpyGameDataPY.GetFuncEvalCfg('CeremonyWorldLv', 1, {})
    fcWorldlvDict = IpyGameDataPY.GetFuncEvalCfg('NewCeremonyWorldLv', 1, {})
    if str(fcType) not in fcWorldlvDict:
        return 0
    worldLVIndex = 0
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3291,8 +3291,8 @@
Def_PDictType_LVAward,  # 等级奖励领取信息记录5
Def_PDictType_GoldGift,  # 充值豪礼
Def_PDictType_OpenServerCampaign,  # 开服活动
Def_PDictType_WeekParty,
Def_PDictType_Family_Contribution,    # 战盟贡献度
Def_PDictType_WeekParty, #周狂欢
Def_PDictType_FeastWeekParty,    # 节日巡礼
Def_PDictType_LoginAward,    # 登录奖励运营活动
Def_PDictType_OfficialRank,    # 官爵
Def_PDictType_Horse,    # 坐骑
@@ -3757,11 +3757,18 @@
Def_PDict_FBRealHelpCount = "FBRealHelpCount_%s" #副本真实助战次数,仅针对真实进去打的副本,参数mapID
#周狂欢
Def_PDict_WeekPartyID = "WeekPartyID"  # 玩家身上的BOSS复活活动ID,唯一标识,取活动开始日期time值
Def_PDict_WeekPartyID = "WeekPartyID"  # 玩家身上的活动ID,唯一标识,取活动开始日期time值
Def_PDict_WeekPartyCurTimes = "WeekPartyCurTimes_%s_%s" #当前完成次数 参数(第X天,模板ID)
Def_PDict_WeekPartyGotTimes = "WeekPartyGotTimes_%s_%s" #当前已领次数 参数(第X天,模板ID)
Def_PDict_WeekPartyAwardRecord = "WeekPartyAwardRecord_%s" #积分领奖记录  参数(第X天)
Def_PDict_WeekPartyPoint = "WeekPartyPoint_%s" #当天积分  参数(第X天)
#节日巡礼周狂欢
Def_PDict_FeastWeekPartyID = "FeastWeekPartyID"  # 玩家身上的活动ID,唯一标识,取活动开始日期time值
Def_PDict_FeastWeekPartyCurTimes = "FeastWPCurTimes_%s_%s" #当前完成次数 参数(第X天,模板ID)
Def_PDict_FeastWeekPartyGotTimes = "FeastWPGotTimes_%s_%s" #当前已领次数 参数(第X天,模板ID)
Def_PDict_FeastWeekPartyAwardRecord = "FeastWPAward_%s" #积分领奖记录  参数(第X天)
Def_PDict_FeastWeekPartyPoint = "FeastWPPoint_%s" #当天积分  参数(第X天)
#登录奖励运营活动
Def_PDict_LoginAwardID = "LoginAwardID"  # 玩家身上的BOSS复活活动ID,唯一标识,取活动开始日期time值
@@ -5206,7 +5213,9 @@
Def_RewardType_ActLoginAwardAct, # 领取登录奖励活动奖励22
Def_RewardType_NewFairyCRecharge, # 新仙界盛典充值大礼23
Def_RewardType_NewFairyCParty, # 新仙界盛典全民来嗨24
)= range(25)
Def_RewardType_FeastWeekPartyAct, # 领取周狂欢活动奖励25
Def_RewardType_FeastWeekPartyPoint, # 领取周狂欢积分奖励26
)= range(27)
#boss复活相关活动定义
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/DataRecordPack.py
@@ -1628,4 +1628,11 @@
    
    #发送封包
    SendEventPack("WeekPartyPoint", dataDict, curPlayer)
    return
def DR_FeastWeekPartyPoint(curPlayer, dayIndex, point):
    ##节日巡礼
    dataDict = {'PlayerID':curPlayer.GetPlayerID(),
                'AccID':curPlayer.GetAccID(), 'dayIndex':dayIndex, 'point':point}
    #发送封包
    SendEventPack("FeastWeekPartyPoint", dataDict, curPlayer)
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -79,6 +79,7 @@
import GameLogic_FamilyWar
import PlayerBossReborn
import PlayerWeekParty
import PlayerFeastWeekParty
import PlayerActLogin
import Operate_EquipWash
import PlayerTreasure
@@ -708,6 +709,8 @@
    PlayerBossReborn.OnLogin(curPlayer)
    # 周狂欢活动
    PlayerWeekParty.OnLogin(curPlayer)
    # 节日巡礼活动
    PlayerFeastWeekParty.OnLogin(curPlayer)
    # 登录奖励活动
    PlayerActLogin.OnLogin(curPlayer)
    # 仙界盛典活动
@@ -5353,6 +5356,12 @@
    # 领取新仙界盛典全民来嗨
    elif rewardType == ChConfig.Def_RewardType_NewFairyCParty:
        PlayerNewFairyCeremony.GetFCPartyAward(curPlayer, dataEx)
    # 领取节日巡礼活动奖励
    elif rewardType == ChConfig.Def_RewardType_FeastWeekPartyAct:
        PlayerWeekParty.GetWeekPartyActionAward(curPlayer, dataEx, dataExStr)
    # 领取节日巡礼积分奖励
    elif rewardType == ChConfig.Def_RewardType_FeastWeekPartyPoint:
        PlayerFeastWeekParty.GetFeastWeekPartyPointAward(curPlayer, dataEx, dataExStr)
    return
    
    
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py
@@ -80,6 +80,7 @@
import PlayerSpringSale
import PlayerBossReborn
import PlayerWeekParty
import PlayerFeastWeekParty
import PlayerActLogin
import PlayerFlashGiftbag
import PlayerFairyCeremony
@@ -1312,6 +1313,10 @@
                
            elif actionName == ShareDefine.OperationActionName_LoginAward:
                PlayerActLogin.RefreshOperationAction_LoginAward()
            elif actionName == ShareDefine.OperationActionName_FeastWeekParty:
                PlayerFeastWeekParty.RefreshOperationAction_FeastWeekParty()
            return
        
        if msgValue.isdigit():
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFeastWeekParty.py
New file
@@ -0,0 +1,447 @@
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
##@package Player.PlayerFeastWeekParty
#
# @todo:节日巡礼
# @author xdh
# @date 2018-07-12 16:50
# @version 1.0
#
#
# 详细描述: 节日巡礼
#
#---------------------------------------------------------------------
"""Version = 2018-07-12 16:50"""
#---------------------------------------------------------------------
import IPY_GameWorld
import GameWorld
import ChConfig
import IpyGameDataPY
import PlayerControl
import ItemControler
import ChPyNetSendPack
import Operate_EquipStone
import DataRecordPack
import PlayerGodWeapon
import NetPackCommon
import ShareDefine
import PyGameData
import ItemCommon
def OnLogin(curPlayer):
    isReset = __CheckPlayerFeastWeekPartyAction(curPlayer)
    if not isReset:
        actCostRebateInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FeastWeekParty, {})
        # 活动中同步活动信息
        SyncFeastWeekPartyInfo(curPlayer)
        if actCostRebateInfo.get(ShareDefine.ActKey_State):
            SyncFeastWeekPartyPlayerInfo(curPlayer)
    return
def RefreshOperationAction_FeastWeekParty():
    playerManager = GameWorld.GetPlayerManager()
    for i in xrange(playerManager.GetPlayerCount()):
        curPlayer = playerManager.GetPlayerByIndex(i)
        if curPlayer == None or not curPlayer.GetInitOK():
            continue
        __CheckPlayerFeastWeekPartyAction(curPlayer)
    return
def __CheckPlayerFeastWeekPartyAction(curPlayer):
    ## 检查玩家节日巡礼活动数据信息
    playerID = curPlayer.GetPlayerID()
    actFeastWeekPartyInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FeastWeekParty, {})
    #FeastWeekPartyID = actFeastWeekPartyInfo.get(ShareDefine.ActKey_ID, 0)
    state = actFeastWeekPartyInfo.get(ShareDefine.ActKey_State, 0)
    cfgID = actFeastWeekPartyInfo.get(ShareDefine.ActKey_CfgID, 0)
    passlv = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_TrialTower_PassLV)
    if state:
        #每天都要触发
        AddFeastWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Tower, passlv, False, True, False)
        AddFeastWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Login, 1, False, False)
        AddFeastWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Stone, Operate_EquipStone.GetTotalStoneLV(curPlayer), False, True, False)
        AddFeastWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_GodWeapon, PlayerGodWeapon.GetGodWeaponTotalLV(curPlayer), False, True, False)
        SyncFeastWeekPartyPlayerInfo(curPlayer)
    playerFeastWeekPartyID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWeekPartyID, 0, ChConfig.Def_PDictType_FeastWeekParty)  # 玩家身上的活动ID
    # 活动ID 相同的话不处理
    if cfgID == playerFeastWeekPartyID:
        #GameWorld.DebugLog("节日巡礼活动ID不变,不处理!", curPlayer.GetPlayerID())
        return
    CheckFeastWeekPartyActionCnt(curPlayer)
    # 未领取的奖励邮件发放
    if playerFeastWeekPartyID:
        __SendFeastWeekPartyMail(curPlayer, playerFeastWeekPartyID)
    if not cfgID:
        GameWorld.DebugLog('    节日巡礼活动重置!')
        curPlayer.ClearNomalDict(ChConfig.Def_PDictType_FeastWeekParty)
    GameWorld.DebugLog("节日巡礼变更! state=%s,cfgID=%s,playerFeastWeekPartyID=%s" % (state, cfgID, playerFeastWeekPartyID), playerID)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWeekPartyID, cfgID, ChConfig.Def_PDictType_FeastWeekParty)
    SyncFeastWeekPartyInfo(curPlayer)
    return True
def __SendFeastWeekPartyMail(curPlayer, cfgID):
    # 未领取的奖励邮件发放
    actBossIpyData = IpyGameDataPY.GetIpyGameData("ActFeastWeekParty", cfgID)
    if not actBossIpyData:
        return
    templateIDList = actBossIpyData.GetTemplateID()
    if not templateIDList:
        return
    totalItemDict = {}
    for day, tidList in enumerate(templateIDList):
        for tid in tidList:
            ipyData = IpyGameDataPY.GetIpyGameData('FeastWeekParty', tid)
            if not ipyData:
                continue
            singleTimes = ipyData.GetSingleTimes()
            curTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWeekPartyCurTimes % (day, tid), 0, ChConfig.Def_PDictType_FeastWeekParty)
            gotTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWeekPartyGotTimes % (day, tid), 0, ChConfig.Def_PDictType_FeastWeekParty)
            canGotCnt = (curTimes - gotTimes) / singleTimes
            if not canGotCnt:
                continue
            itemDict = __GetAwardItem(curPlayer, ipyData, canGotCnt)
            GameWorld.AddDictValue(totalItemDict, itemDict)
    #积分奖励
    for day, awardDict in actBossIpyData.GetPointAward().items():
        pointList = awardDict.keys()
        pointList.sort()
        for i, point in enumerate(pointList):
            curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWeekPartyPoint % day, 0, ChConfig.Def_PDictType_FeastWeekParty)
            if curPoint < point:
                continue
            awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWeekPartyAwardRecord % day, 0, ChConfig.Def_PDictType_FeastWeekParty)
            if awardRecord & pow(2, i):
                continue
            itemList = awardDict[point]
            for itemID, itemCnt, isBind in itemList:
                totalItemDict[itemID] = totalItemDict.get(itemID, 0) + itemCnt
            DataRecordPack.DR_FeastWeekPartyPoint(curPlayer, day, point)
    if not totalItemDict:
        return
    totalItemList = [[itemID, itemCnt, 1] for itemID, itemCnt in totalItemDict.items()]
    PlayerControl.SendMailByKey('SecondWeekReward2', [curPlayer.GetID()], totalItemList)
    return
def AddFeastWeekPartyActionCnt(curPlayer, actionID, addCnt=1, isAdd=True, isCompatible=False, isSync=True):
    '''增加节日巡礼相关活动完成次数'''
    #判断活动是否开启
    if not addCnt:
        return
    actFeastWeekPartyInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FeastWeekParty, {})
    state = actFeastWeekPartyInfo.get(ShareDefine.ActKey_State, 0)
    cfgID = actFeastWeekPartyInfo.get(ShareDefine.ActKey_CfgID, 0)
    if not state or not cfgID:
        return
    actBossIpyData = IpyGameDataPY.GetIpyGameData("ActFeastWeekParty", cfgID)
    if not actBossIpyData:
        return
    templateIDList = actBossIpyData.GetTemplateID()
    dayIndex = actFeastWeekPartyInfo.get(ShareDefine.ActKey_DayIndex, 0)
    if dayIndex >= len(templateIDList):
        return
    if actionID in ChConfig.AheadFinishWPActList:
        isFind = False
        for day, dayTidList in enumerate(templateIDList[dayIndex:]):
            findTid = 0
            for tid in dayTidList:
                if tid / 100 == actionID:
                    findTid = tid
                    break
            if not findTid:
                continue
            ipyData = IpyGameDataPY.GetIpyGameData('FeastWeekParty', findTid)
            if not ipyData:
                continue
            totalTimes = ipyData.GetTotalTimes()
            if addCnt != totalTimes:
                continue
            dayIndex = day + dayIndex
            isFind = True
            break
        if not isFind:
            return
    dayTidList = templateIDList[dayIndex]
    findTid = 0
    for tid in dayTidList:
        if tid / 100 == actionID:
            findTid = tid
            break
    if not findTid:
        return
    ipyData = IpyGameDataPY.GetIpyGameData('FeastWeekParty', findTid)
    if not ipyData:
        return
    totalTimes = ipyData.GetTotalTimes()
    curTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWeekPartyCurTimes % (dayIndex, findTid), 0, ChConfig.Def_PDictType_FeastWeekParty)
    if isAdd:
        addCnt = addCnt if totalTimes == 0 else min(totalTimes - curTimes, addCnt)
        if addCnt <= 0:
            return
        updTimes = curTimes + addCnt
    else:
        if not isCompatible and addCnt != totalTimes:
            return
        updTimes = min(addCnt, totalTimes)
    realAddCnt = updTimes - curTimes
    if realAddCnt <= 0:
        return
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWeekPartyCurTimes % (dayIndex, findTid), updTimes, ChConfig.Def_PDictType_FeastWeekParty)
    #加积分
    singleTimes = ipyData.GetSingleTimes()
    addPoint = (curTimes % singleTimes + realAddCnt)/singleTimes* ipyData.GetPoint()
    curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWeekPartyPoint % dayIndex, 0, ChConfig.Def_PDictType_FeastWeekParty)
    updPoint = curPoint + addPoint
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWeekPartyPoint % dayIndex, updPoint, ChConfig.Def_PDictType_FeastWeekParty)
    GameWorld.DebugLog('   增加节日巡礼相关活动完成次数 dayIndex=%s, findTid=%s, realAddCnt=%s,addPoint=%s' % (dayIndex, findTid, realAddCnt, addPoint))
    if isSync:
        SyncFeastWeekPartyPlayerInfo(curPlayer, dayIndex, findTid)
    return True
def CheckFeastWeekPartyActionCnt(curPlayer):
    ipyDataMgr = IpyGameDataPY.IPY_Data()
    for actionType in ChConfig.AheadFinishWPActList:
        if actionType == ChConfig.Def_WPAct_Horse:
            for i in xrange(ipyDataMgr.GetHorseCount()):
                ipyData = ipyDataMgr.GetHorseByIndex(i)
                index = ipyData.GetHorseID()
                lv = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % index, 0, ChConfig.Def_PDictType_Horse)
                if lv:
                    AddFeastWeekPartyActionCnt(curPlayer, actionType, index, False)
        elif actionType == ChConfig.Def_WPAct_Pet:
            petDataPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptPet)
            for petDataIndex in range(petDataPack.GetCount()):
                petItem = petDataPack.GetAt(petDataIndex)
                if petItem.IsEmpty():
                    continue
                petNPCID = petItem.GetUserAttr(ShareDefine.Def_IudetPet_NPCID)
                AddFeastWeekPartyActionCnt(curPlayer, actionType, petNPCID, False)
        elif actionType == ChConfig.Def_WPAct_Dogz:
            for i in xrange(ipyDataMgr.GetDogzCount()):
                ipyData = ipyDataMgr.GetDogzByIndex(i)
                if GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_PDict_DogzFightState, i):
                    AddFeastWeekPartyActionCnt(curPlayer, actionType, ipyData.GetDogzID(), False)
        elif actionType == ChConfig.Def_WPAct_Rune:
            runeHoleCnt = IpyGameDataPY.GetFuncCfg("RuneUnlock", 4)
            for holeNum in xrange(1, runeHoleCnt + 1):
                runeData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Rune_Data % holeNum, 0)
                if not runeData:
                    continue
                runeItemID = ItemControler.GetRuneItemID(runeData)
                itemData = GameWorld.GetGameData().GetItemByTypeID(runeItemID)
                if not itemData:
                    continue
                itemColor = itemData.GetItemColor()
                AddFeastWeekPartyActionCnt(curPlayer, actionType, itemColor, False)
    return
def GetFeastWeekPartyActionAward(curPlayer, day, templateID):
    '''领取节日巡礼活动奖励'''
    templateID = GameWorld.ToIntDef(templateID, 0)
    ipyData = IpyGameDataPY.GetIpyGameData('FeastWeekParty', templateID)
    if not ipyData:
        return
    singleTimes = ipyData.GetSingleTimes()
    curTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWeekPartyCurTimes % (day, templateID), 0, ChConfig.Def_PDictType_FeastWeekParty)
    gotTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWeekPartyGotTimes % (day, templateID), 0, ChConfig.Def_PDictType_FeastWeekParty)
    if curTimes - gotTimes < singleTimes:
        return
    #给奖励
    awardDict = __GetAwardItem(curPlayer, ipyData)
    # 检查背包
    needSpace = len(awardDict)
    packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
    if needSpace > packSpace:
        PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
        return
    #更新次数 每次领奖只领一次
    newGotTimes = gotTimes + singleTimes
    #GameWorld.Log('  actionID=%s,curTimes=%s,gotTimes=%s,singleTimes=%s,newGotTimes=%s'%(actionID, curTimes, gotTimes,singleTimes, newGotTimes))
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWeekPartyGotTimes % (day, templateID), newGotTimes, ChConfig.Def_PDictType_FeastWeekParty)
    for itemID, itemCnt in awardDict.items():
        ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 1, [IPY_GameWorld.rptItem])
    SyncFeastWeekPartyPlayerInfo(curPlayer, day, templateID)
    return
def GetFeastWeekPartyPointAward(curPlayer, day, getPoint):
    ##领取节日巡礼积分奖励
    getPoint = GameWorld.ToIntDef(getPoint, 0)
    actFeastWeekPartyInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FeastWeekParty, {})
    state = actFeastWeekPartyInfo.get(ShareDefine.ActKey_State, 0)
    cfgID = actFeastWeekPartyInfo.get(ShareDefine.ActKey_CfgID, 0)
    if not state or not cfgID:
        return
    actBossIpyData = IpyGameDataPY.GetIpyGameData("ActFeastWeekParty", cfgID)
    if not actBossIpyData:
        return
    curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWeekPartyPoint % day, 0, ChConfig.Def_PDictType_FeastWeekParty)
    if curPoint < getPoint:
        return
    pointAwardDict = actBossIpyData.GetPointAward().get(day, {})
    pointList = pointAwardDict.keys()
    pointList.sort()
    if getPoint not in pointList:
        return
    getIndex = pointList.index(getPoint)
    awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWeekPartyAwardRecord % day, 0, ChConfig.Def_PDictType_FeastWeekParty)
    if awardRecord & pow(2, getIndex):
        GameWorld.Log(' 领取节日巡礼积分奖励, 已领取 day=%s, getPoint=%s' % (day, getPoint))
        return
    itemList = pointAwardDict[getPoint]
    needSpace = len(itemList)
    packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
    if needSpace > packSpace:
        PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
        return
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FeastWeekPartyAwardRecord % day, awardRecord | pow(2, getIndex), ChConfig.Def_PDictType_FeastWeekParty)
    for itemID, itemCnt, isBind in itemList:
        ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem])
    SyncFeastWeekPartyPlayerInfo(curPlayer, day)
    DataRecordPack.DR_FeastWeekPartyPoint(curPlayer, day, getPoint)
    return
def __GetAwardItem(curPlayer, ipyData, times=1):
    awardDict = {}
    for itemID, itemCnt, isbind in ipyData.GetReward():
        if not itemID or not itemCnt:
            continue
        awardDict[itemID] = awardDict.get(itemID, 0) + itemCnt * times
    return awardDict
def SyncFeastWeekPartyPlayerInfo(curPlayer, day=-1, templateID=-1):
    #通知当前次数、已领次数
    actFeastWeekPartyInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FeastWeekParty, {})
    state = actFeastWeekPartyInfo.get(ShareDefine.ActKey_State, 0)
    cfgID = actFeastWeekPartyInfo.get(ShareDefine.ActKey_CfgID, 0)
    if not state or not cfgID:
        return
    actBossIpyData = IpyGameDataPY.GetIpyGameData("ActFeastWeekParty", cfgID)
    if not actBossIpyData:
        return
    templateIDList = actBossIpyData.GetTemplateID()
    if not templateIDList:
        return
    if day != -1:
        if day >= len(templateIDList):
            return
        syncDayList = [day]
    else:
        syncDayList = range(len(templateIDList))
    packData = ChPyNetSendPack.tagMCFeastWeekPartyPlayerInfo()
    packData.DayInfoList = []
    for cday in syncDayList:
        tiemInfo = ChPyNetSendPack.tagMCFeastWeekPartyDayPlayerInfo()
        tiemInfo.DayIndex = cday
        tiemInfo.Point = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWeekPartyPoint % cday, 0, ChConfig.Def_PDictType_FeastWeekParty)
        tiemInfo.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWeekPartyAwardRecord % cday, 0, ChConfig.Def_PDictType_FeastWeekParty)
        tiemInfo.TaskList = []
        for tID in templateIDList[cday]:
            if templateID != -1 and tID != templateID:
                continue
            tipyData = IpyGameDataPY.GetIpyGameData('FeastWeekParty', tID)
            if not tipyData:
                continue
            taskInfo = ChPyNetSendPack.tagMCFeastWeekPartyTaskInfo()
            taskInfo.TemplateID = tID
            taskInfo.CurTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWeekPartyCurTimes % (cday, tID), 0, ChConfig.Def_PDictType_FeastWeekParty)
            taskInfo.GotTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FeastWeekPartyGotTimes % (cday, tID), 0, ChConfig.Def_PDictType_FeastWeekParty)
            tiemInfo.TaskList.append(taskInfo)
        tiemInfo.ACount = len(tiemInfo.TaskList)
        packData.DayInfoList.append(tiemInfo)
    packData.Count = len(packData.DayInfoList)
    NetPackCommon.SendFakePack(curPlayer, packData)
    return
def SyncFeastWeekPartyInfo(curPlayer):
    actFeastWeekPartyInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_FeastWeekParty, {})
    state = actFeastWeekPartyInfo.get(ShareDefine.ActKey_State, 0)
    cfgID = actFeastWeekPartyInfo.get(ShareDefine.ActKey_CfgID, 0)
    if not cfgID:
        return
    actBossIpyData = IpyGameDataPY.GetIpyGameData("ActFeastWeekParty", cfgID)
    if not actBossIpyData:
        return
    templateIDList = actBossIpyData.GetTemplateID()
    if not templateIDList:
        return
    pointAwardDict = actBossIpyData.GetPointAward()
    actInfo = ChPyNetSendPack.tagMCFeastWeekPartyInfo()
    actInfo.Clear()
    actInfo.StartDate = actBossIpyData.GetStartDate()
    actInfo.EndtDate = actBossIpyData.GetEndDate()
    actInfo.AdvanceMinutes = actBossIpyData.GetAdvanceMinutes()
    actInfo.IsDayReset = actBossIpyData.GetIsDayReset()
    actInfo.ResetType = actBossIpyData.GetResetType()
    actInfo.LimitLV = actBossIpyData.GetLVLimit()
    actInfo.DayInfoList = []
    tidList = []
    for day, dayActList in enumerate(templateIDList):
        dayInfo = ChPyNetSendPack.tagMCFeastWeekPartyDayInfo()
        dayInfo.TemplateList = dayActList
        dayInfo.ActCnt = len(dayActList)
        for tid in dayActList:
            if tid not in tidList:
                tidList.append(tid)
        dayInfo.PItemInfo = []
        for point, itemList in pointAwardDict.get(day, {}).items():
            for itemID, itemCnt, isBind in itemList:
                awardItem = ChPyNetSendPack.tagMCFeastWeekPartyItem()
                awardItem.ItemID = itemID
                awardItem.ItemCnt = itemCnt
                awardItem.IsBind = isBind
                awardItem.NeedPoint = point
                dayInfo.PItemInfo.append(awardItem)
        dayInfo.PCount = len(dayInfo.PItemInfo)
        actInfo.DayInfoList.append(dayInfo)
    actInfo.DayCnt = len(actInfo.DayInfoList)
    actInfo.ActionInfo = []
    for tid in tidList:
        ipyData = IpyGameDataPY.GetIpyGameData('FeastWeekParty', tid)
        if not ipyData:
            GameWorld.ErrLog('    节日巡礼模板表找不到模板%s' % tid)
            continue
        tInfo = ChPyNetSendPack.tagMCFeastWeekPartyAction()
        tInfo.TemplateID = tid
        tInfo.ActionType = ipyData.GetActionType()
        tInfo.TotalTimes = ipyData.GetTotalTimes()
        tInfo.SingleTimes = ipyData.GetSingleTimes()
        tInfo.Point = ipyData.GetPoint()
        tInfo.ItemInfo = []
        for itemID, itemCnt, isBind in ipyData.GetReward():
            awardItem = ChPyNetSendPack.tagMCFeastWeekPartyItem()
            awardItem.ItemID = itemID
            awardItem.ItemCnt = itemCnt
            awardItem.IsBind = isBind
            awardItem.NeedPoint = 0
            tInfo.ItemInfo.append(awardItem)
        tInfo.Count = len(tInfo.ItemInfo)
        actInfo.ActionInfo.append(tInfo)
    actInfo.TCount = len(actInfo.ActionInfo)
    NetPackCommon.SendFakePack(curPlayer, actInfo)
    return
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerNewFairyCeremony.py
@@ -108,7 +108,7 @@
            GameWorld.ErrLog('    邮件发放充值大礼奖励 CeremonyRecharge 未配置奖励 worldLvNum=%s' % worldLvNum)
        else:
            awardList = awardInfoDict[str(worldLvNum)]
            PlayerControl.SendMailByKey('CeremonyPayPack', [playerID], awardList, [playerName])
            PlayerControl.SendMailByKey('NewCeremonyPayPack', [playerID], awardList, [playerName])
    #全民来嗨
    worldLvNum = __GetFCWorldLVIndex(curPlayer, Def_FC_Party)
    curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_NewFCPartyCurPoint)
@@ -134,7 +134,7 @@
        awardList = awardInfoDict[str(job)]
        partyAwardList += awardList
    if partyAwardList:
        PlayerControl.SendMailByKey('CeremonyHaiPoint', [playerID], partyAwardList, [playerName])
        PlayerControl.SendMailByKey('NewCeremonyHaiPoint', [playerID], partyAwardList, [playerName])
    return
def __IsAtFCAction():
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWeekParty.py
@@ -26,6 +26,7 @@
import ItemControler
import ChPyNetSendPack
import Operate_EquipStone
import PlayerFeastWeekParty
import DataRecordPack
import PlayerGodWeapon
import NetPackCommon
@@ -140,6 +141,7 @@
def AddWeekPartyActionCnt(curPlayer, actionID, addCnt=1, isAdd=True, isCompatible=False, isSync=True):
    '''增加周狂欢相关活动完成次数'''
    PlayerFeastWeekParty.AddFeastWeekPartyActionCnt(curPlayer, actionID, addCnt, isAdd, isCompatible, isSync)
    #判断活动是否开启
    if not addCnt:
        return