5768 【后端】【1.5】新增8-14天活动功能(制作成7日运营活动的模板)
| | |
| | | list MatchRange; //可匹配到的玩家段位区间 [从段位A, 到段位B],配[]代表只匹配本段位的
|
| | | };
|
| | |
|
| | | //周狂欢活动时间表
|
| | |
|
| | | struct tagActWeekParty
|
| | | {
|
| | | DWORD _CfgID; //配置ID
|
| | | char ActMark; //活动组标记
|
| | | list PlatformList; //活动平台列表["平台A", "平台A", ...],配[]代表所有
|
| | | list ServerIDList; //服务器ID列表
|
| | | char StartDate; //开启日期
|
| | | char EndDate; //结束日期
|
| | | BYTE IsDayReset; //是否每天重置
|
| | | BYTE ResetType; //重置类型,0-0点重置;1-5点重置
|
| | | dict NotifyInfoStart; //全服提示信息 - 相对开始时间
|
| | | dict NotifyInfoEnd; //全服提示信息 - 相对结束时间
|
| | | WORD LVLimit; //限制等级
|
| | | }; |
| | |
| | | BYTE NeedExp; //升级所需经验
|
| | | dict AddAttr; //属性
|
| | | }; |
| | |
|
| | | //周狂欢活动时间表
|
| | |
|
| | | struct tagActWeekParty
|
| | | {
|
| | | DWORD _CfgID; //配置ID
|
| | | char StartDate; //开启日期
|
| | | char EndDate; //结束日期
|
| | | BYTE IsDayReset; //是否每天重置
|
| | | BYTE ResetType; //重置类型,0-0点重置;1-5点重置
|
| | | WORD LVLimit; //限制等级
|
| | | list TemplateID; //模板编号
|
| | | dict PointAward; //总积分奖励
|
| | | };
|
| | |
|
| | | //周狂欢表
|
| | |
|
| | | struct tagWeekParty
|
| | | {
|
| | | BYTE _TemplateID; //模板ID
|
| | | BYTE ActionType; //活动条目ID
|
| | | DWORD TotalTimes; //可完成的总次数,0表示不限次数
|
| | | WORD SingleTimes; //单次领奖需要的次数
|
| | | list Reward; //奖励物品
|
| | | WORD Point; //积分
|
| | | }; |
| | |
| | | ("WORD", "LVUpScore", 0),
|
| | | ("list", "MatchRange", 0),
|
| | | ),
|
| | |
|
| | | "ActWeekParty":(
|
| | | ("DWORD", "CfgID", 1),
|
| | | ("char", "ActMark", 0),
|
| | | ("list", "PlatformList", 0),
|
| | | ("list", "ServerIDList", 0),
|
| | | ("char", "StartDate", 0),
|
| | | ("char", "EndDate", 0),
|
| | | ("BYTE", "IsDayReset", 0),
|
| | | ("BYTE", "ResetType", 0),
|
| | | ("dict", "NotifyInfoStart", 0),
|
| | | ("dict", "NotifyInfoEnd", 0),
|
| | | ("WORD", "LVLimit", 0),
|
| | | ),
|
| | | }
|
| | |
|
| | | |
| | |
| | | def GetLVUpScore(self): return self.LVUpScore # 升段位所需积分
|
| | | def GetMatchRange(self): return self.MatchRange # 可匹配到的玩家段位区间 [从段位A, 到段位B],配[]代表只匹配本段位的 |
| | |
|
| | | # 周狂欢活动时间表 |
| | | class IPY_ActWeekParty(): |
| | | |
| | | def __init__(self): |
| | | self.CfgID = 0
|
| | | self.ActMark = ""
|
| | | self.PlatformList = []
|
| | | self.ServerIDList = []
|
| | | self.StartDate = ""
|
| | | self.EndDate = ""
|
| | | self.IsDayReset = 0
|
| | | self.ResetType = 0
|
| | | self.NotifyInfoStart = {}
|
| | | self.NotifyInfoEnd = {}
|
| | | self.LVLimit = 0 |
| | | return |
| | | |
| | | def GetCfgID(self): return self.CfgID # 配置ID
|
| | | def GetActMark(self): return self.ActMark # 活动组标记
|
| | | def GetPlatformList(self): return self.PlatformList # 活动平台列表["平台A", "平台A", ...],配[]代表所有
|
| | | def GetServerIDList(self): return self.ServerIDList # 服务器ID列表
|
| | | def GetStartDate(self): return self.StartDate # 开启日期
|
| | | def GetEndDate(self): return self.EndDate # 结束日期
|
| | | def GetIsDayReset(self): return self.IsDayReset # 是否每天重置
|
| | | def GetResetType(self): return self.ResetType # 重置类型,0-0点重置;1-5点重置
|
| | | def GetNotifyInfoStart(self): return self.NotifyInfoStart # 全服提示信息 - 相对开始时间
|
| | | def GetNotifyInfoEnd(self): return self.NotifyInfoEnd # 全服提示信息 - 相对结束时间
|
| | | def GetLVLimit(self): return self.LVLimit # 限制等级 |
| | |
|
| | |
|
| | | def Log(msg, playerID=0, par=0):
|
| | | LogUI.Msg("%s\t%s\t%s" % (par, playerID, msg))
|
| | |
| | | self.ipyCrossRealmPKSeasonLen = len(self.ipyCrossRealmPKSeasonCache)
|
| | | self.ipyCrossRealmPKDanCache = self.__LoadFileData("CrossRealmPKDan", IPY_CrossRealmPKDan)
|
| | | self.ipyCrossRealmPKDanLen = len(self.ipyCrossRealmPKDanCache)
|
| | | self.ipyActWeekPartyCache = self.__LoadFileData("ActWeekParty", IPY_ActWeekParty)
|
| | | self.ipyActWeekPartyLen = len(self.ipyActWeekPartyCache)
|
| | | Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
|
| | | Log("IPY_DataMgr InitOK!")
|
| | | return
|
| | |
| | | def GetCrossRealmPKSeasonByIndex(self, index): return self.ipyCrossRealmPKSeasonCache[index]
|
| | | def GetCrossRealmPKDanCount(self): return self.ipyCrossRealmPKDanLen
|
| | | def GetCrossRealmPKDanByIndex(self, index): return self.ipyCrossRealmPKDanCache[index]
|
| | | def GetActWeekPartyCount(self): return self.ipyActWeekPartyLen
|
| | | def GetActWeekPartyByIndex(self, index): return self.ipyActWeekPartyCache[index]
|
| | |
|
| | | IPYData = IPY_DataMgr()
|
| | | def IPY_Data(): return IPYData
|
| | |
| | | OperationActionName_FlashSale = "ActFlashSale" # 限时抢购活动
|
| | | OperationActionName_WishingWell = "ActWishingWell" # 许愿池活动
|
| | | OperationActionName_TotalRecharge = "ActTotalRecharge" # 累计充值活动
|
| | | OperationActionName_WeekParty = "ActWeekParty" # 周狂欢活动
|
| | | OperationActionNameList = [OperationActionName_ExpRate, OperationActionName_CostRebate,
|
| | | OperationActionName_BossReborn,OperationActionName_SpringSale,
|
| | | OperationActionName_FlashGiftbag, OperationActionName_FairyCeremony,
|
| | | OperationActionName_RealmPoint, OperationActionName_FlashSale,
|
| | | OperationActionName_WishingWell, OperationActionName_TotalRecharge]
|
| | | OperationActionName_WishingWell, OperationActionName_TotalRecharge, |
| | | OperationActionName_WeekParty, ]
|
| | | #需要记录开启活动时的世界等级的运营活动
|
| | | NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell]
|
| | |
|
| | |
| | | Def_PDictType_LVAward, # 等级奖励领取信息记录5
|
| | | Def_PDictType_GoldGift, # 充值豪礼
|
| | | Def_PDictType_OpenServerCampaign, # 开服活动
|
| | | Def_PDictType_8,
|
| | | Def_PDictType_WeekParty,
|
| | | Def_PDictType_Family_Contribution, # 战盟贡献度
|
| | | Def_PDictType_10, # 10
|
| | | Def_PDictType_OfficialRank, # 官爵
|
| | |
| | | Def_PDict_HelpBattleCheckInCount = "HelpBattleCheckInCount" #助战登记次数, 登记次数*10+今日是否登记过
|
| | | Def_PDict_HelpBattleTotalCount = "HelpBattleTotalCount" #累计助战次数
|
| | | Def_PDict_FBRealHelpCount = "FBRealHelpCount_%s" #副本真实助战次数,仅针对真实进去打的副本,参数mapID
|
| | |
|
| | | #周狂欢
|
| | | Def_PDict_WeekPartyID = "WeekPartyID" # 玩家身上的BOSS复活活动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_PDictType_OnlinePrize
|
| | | Def_PDict1_OnlinePrizeCnt = "OnlinePrizeCnt" # 新手在线已领取奖励次数
|
| | |
| | | Def_RewardType_OpenFunc, # 功能开启奖励17
|
| | | Def_RewardType_TotalRecharge, # 累计充值奖励18
|
| | | Def_RewardType_IceLodeStar, # 冰晶矿脉星级奖励19
|
| | | )= range(20)
|
| | | Def_RewardType_WeekPartyAct, # 领取周狂欢活动奖励20
|
| | | Def_RewardType_WeekPartyPoint, # 领取周狂欢积分奖励21
|
| | | )= range(22)
|
| | |
|
| | |
|
| | | #boss复活相关活动定义
|
| | |
| | | Def_PPAct_VIPBoss, #vipBOSS 13
|
| | | ) = range(1, 13+1)
|
| | |
|
| | | #周狂欢活动定义
|
| | | WeekPartyActIDList = (
|
| | | Def_WPAct_RunTask, #师门悬赏 1
|
| | | Def_WPAct_XJMJ, #仙境秘境 2
|
| | | Def_WPAct_KirinHome, #麒麟之府 3
|
| | | Def_WPAct_QueenRelices, #娲皇遗迹 4
|
| | | Def_WPAct_IceLode, #冰晶矿脉 5
|
| | | Def_WPAct_Tower, #符印塔 6
|
| | | Def_WPAct_WorldBOSS, #世界boss 7
|
| | | Def_WPAct_BOSSHome, #boss之家 8
|
| | | Def_WPAct_FMT, #封魔坛 9
|
| | | Def_WPAct_GodArea, #古神禁地 10
|
| | | Def_WPAct_CrossPK, #跨服pk 11
|
| | | Def_WPAct_Recharge, #充值X仙玉 12
|
| | | Def_WPAct_GiftBag, #购买限时礼包 13
|
| | | Def_WPAct_FamilyRobBoss, #boss争夺战 14
|
| | | Def_WPAct_SWRH, #守卫人皇 15
|
| | | Def_WPAct_ElderBattlefield, #上古战场 16
|
| | | Def_WPAct_ChaosDemon, #混乱妖域 17
|
| | | Def_WPAct_XMZZ, #仙魔之争 18
|
| | | Def_WPAct_FamilyWar, #仙魔联赛 19
|
| | | ) = range(1, 19+1)
|
| | |
|
| | | # 套装枚举,普通套装,强化套装
|
| | | (EquipSuitType_Normal,
|
| | | EquipSuitType_Plus,
|
| | |
| | | import PlayerMagicWeapon
|
| | | import PlayerBossReborn
|
| | | import PlayerFairyCeremony
|
| | | import PlayerWeekParty
|
| | | import PlayerHorse
|
| | | import FBCommon
|
| | | import PyGameData
|
| | |
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_TaskCRun, addCnt)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_RunTask, addCnt)
|
| | | PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_RunTask, addCnt)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_RunTask, addCnt)
|
| | | elif missionType == QuestCommon.Def_Mission_Type_RunFamily:
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FamilyRunMission, addCnt)
|
| | | PlayerFamily.AddFamilyActivity(curPlayer, ShareDefine.FamilyActive_Task, addCnt)
|
| | |
| | | import PlayerSuccess
|
| | | import PlayerBossReborn
|
| | | import PlayerFairyCeremony
|
| | | import PlayerWeekParty
|
| | | import ItemControler
|
| | | import GameFuncComm
|
| | | import SkillShell
|
| | |
| | | FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_BZZD)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_XJMJ, 1)
|
| | | PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_XJMJ, 1)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_XJMJ, 1)
|
| | | FBCommon.UpdateFBEnterTick(curPlayer)
|
| | | gameFB.SetPlayerGameFBDict(playerID, FBPlayerDict_EnterLV, playerLV)
|
| | | PyGameData.g_bzzdPlayerKillNPCCntDict.pop(playerID, 0)
|
| | |
| | | import PlayerSuccess
|
| | | import FBHelpBattle
|
| | | import EventReport
|
| | | import PlayerWeekParty
|
| | |
|
| | | import math
|
| | |
|
| | |
| | | FBCommon.AddEnterFBCount(curPlayer, mapID, 1)
|
| | | joinType = FBCommon.GetFBJoinType(curPlayer, isHelpFight)
|
| | | EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_ChaosDemon, 0, ChConfig.CME_Log_Start, joinType)
|
| | | |
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_ChaosDemon, 1)
|
| | |
|
| | | fbStep = gameFB.GetFBStep()
|
| | | if fbStep <= FB_Step_Prepare:
|
| | |
| | | import SkillShell
|
| | | import EventReport
|
| | | import SkillCommon
|
| | | import PlayerWeekParty
|
| | |
|
| | | import random
|
| | | import time
|
| | |
| | | GameWorld.GetGameWorld().SetGameWorldDict(FBPlayerDict_TotalExp % playerID, 0)
|
| | | GameWorld.GetGameWorld().SetGameWorldDict(FBPlayerDict_TotalExpPoint % playerID, 0)
|
| | | EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_ElderBattlefield, 0, ChConfig.CME_Log_Start)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_ElderBattlefield, 1)
|
| | | else:
|
| | | rebornBuffLV = GameWorld.GetGameFB().GetPlayerGameFBDictByKey(playerID, FBPlayerDict_RebornBuffLV)
|
| | | __DoAddRebornBuff(curPlayer, rebornBuffLV, tick)
|
| | |
| | | import GameWorld
|
| | | import ChConfig
|
| | | import GameWorldProcess
|
| | | import PlayerWeekParty
|
| | | import PyGameData
|
| | | import ShareDefine
|
| | | import EventReport
|
| | |
| | | gameWorld.SetGameWorldDict(GameFBDict_LastEnterFbDay % playerID, openServerDay + 1)
|
| | | FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_FamilyInvade)
|
| | | EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_FamilyInvade, 0, ChConfig.CME_Log_Start)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_SWRH, 1)
|
| | | if familyID in PyGameData.g_swrhPlayerIDDict:
|
| | | if playerID not in PyGameData.g_swrhPlayerIDDict[familyID]:
|
| | | PyGameData.g_swrhPlayerIDDict[familyID].append(playerID)
|
| | |
| | | import ChPyNetSendPack
|
| | | import GameWorldProcess
|
| | | import PlayerDienstgrad
|
| | | import PlayerWeekParty
|
| | | import IpyGameDataPY
|
| | | import PlayerFamily
|
| | | import NetPackCommon
|
| | |
| | | if not FBCommon.GetHadDelTicket(curPlayer):
|
| | | FBCommon.SetHadDelTicket(curPlayer)
|
| | | FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_FamilyWar)
|
| | | |
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_FamilyWar, 1)
|
| | | isFinalMatch = gameFB.GetGameFBDictByKey(GameFBDict_IsFinalMatch)
|
| | | roundNum = gameFB.GetGameFBDictByKey(GameFBDict_RoundNum)
|
| | | groupID = gameFB.GetGameFBDictByKey(GameFBDict_GroupID)
|
| | |
| | | import PlayerControl
|
| | | import PlayerBossReborn
|
| | | import PlayerFairyCeremony
|
| | | import PlayerWeekParty
|
| | | import EventReport
|
| | | import time
|
| | |
|
| | |
| | | EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_GodArea, 0, ChConfig.CME_Log_Start)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_GodArea, 1)
|
| | | PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_GodArea, 1)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_GodArea, 1)
|
| | | elif __IsAngerFull(curPlayer):
|
| | | #怒气已满,退出副本
|
| | | GameWorld.DebugLog(" 副本里掉线重上 怒气已满,退出副本")
|
| | |
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import PlayerSuccess
|
| | | import PlayerWeekParty
|
| | | import BuffSkill
|
| | |
|
| | | import random
|
| | |
| | | FBCommon.Sync_FBPlayerFBInfoData(curPlayer, mapID) # 同步信息
|
| | | if not lastStar and not isInFBOnDay: #每日活动
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_IceLode)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_IceLode, 1)
|
| | |
|
| | | if isInFBOnDay: #在副本里过天,副本结束后再补发星级奖励
|
| | | CheckIceLodeStarAwardMail(curPlayer)
|
| | |
| | | addCnt += 1
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineid, 3, False, [mapID])
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_IceLode, addCnt)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_IceLode, addCnt)
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_IceLode, len(lineList))
|
| | | FBCommon.Sync_FBPlayerFBInfoData(curPlayer, mapID) # 同步信息
|
| | | # npcCountDict = {}
|
| | |
| | | import PlayerSuccess
|
| | | import PlayerControl
|
| | | import PlayerBossReborn
|
| | | import PlayerWeekParty
|
| | | import EventShell
|
| | | import EventReport
|
| | |
|
| | |
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KirinHome, 1, [lineID+1])
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KirinHomeEx, 1)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_KirinHome, 1)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_KirinHome, 1)
|
| | | EventShell.EventRespons_FBEvent(curPlayer, "kirinhome_%s" % (lineID+1))
|
| | | EventShell.EventRespons_FBEvent(curPlayer, "kirinhome_0")
|
| | |
|
| | |
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KirinHome, sweepCnt, [lineID])
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KirinHomeEx, 1)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_KirinHome, sweepCnt)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_KirinHome, sweepCnt)
|
| | | for _ in xrange(sweepCnt):
|
| | | EventReport.WriteEvent_FB(curPlayer, ChConfig.Def_FBMapID_KirinHome, 0, ChConfig.CME_Log_Start)
|
| | | GameWorld.DebugLog("扫荡奖励: 次数=%s,totalExp=%s,totalMoney=%s,jsonItemList=%s" % (sweepCnt, totalExp, totalMoney, jsonItemList))
|
| | |
| | | import ChPlayer
|
| | | import FBHelpBattle
|
| | | import IpyGameDataPY
|
| | | import PlayerWeekParty
|
| | |
|
| | |
|
| | | #阶段时间
|
| | |
| | | else:
|
| | | GameWorld.DebugLog("副本中过天,不增加挑战次数!", playerID)
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_QueenRelicsEx, 1)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_QueenRelices, 1)
|
| | | # 不可再挑战下一关了
|
| | | if not nextLineID:
|
| | | curPlayer.Sync_TimeTick(IPY_GameWorld.tttLeaveMap, 0, fbLineTime[Def_LeaveTime] * 1000, True)
|
| | |
| | | import PlayerMagicWeapon
|
| | | import PlayerBossReborn
|
| | | import PlayerFairyCeremony
|
| | | import PlayerWeekParty
|
| | | import EventReport
|
| | |
|
| | | FBDict_StartTick = 'FBDict_StartTick%s' #开始时间
|
| | |
| | | PlayerMagicWeapon.SetMWPrivilegeData(curPlayer, ChConfig.MWPrivilege_SealDemonAddAttr, addCnt, True)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_FMT, addCnt)
|
| | | PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_FMT, addCnt)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_FMT, addCnt)
|
| | | return prizeItemList
|
| | |
|
| | | def OnPickUpItem(curPlayer, curItem, tick):
|
| | |
| | | import PlayerSuccess
|
| | | import PlayerActivity
|
| | | import PlayerBillboard
|
| | | import PlayerWeekParty
|
| | | import EventReport
|
| | |
|
| | | import random
|
| | |
| | | #通关符印塔成就
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_PassRuneTower, 1, [passlv])
|
| | | PlayerBillboard.UpdateRuneTowerBillboard(curPlayer)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Tower, passlv, False)
|
| | | GameWorld.DebugLog(' 更新符印塔已通关数 %s' % passlv)
|
| | | return
|
| | |
|
| | |
| | | import ItemCommon
|
| | | import FormulaControl
|
| | | import NPCCustomRefresh
|
| | | import PlayerWeekParty
|
| | | import PlayerSuccess
|
| | | import PyGameData
|
| | | import EventReport
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_XMZZLastStartTime, curtime)
|
| | | #FBCommon.SetFBStep(FB_Step_Prepare, tick)
|
| | | #PrepareXMZZPK(curPlayer, tick)
|
| | | |
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_XMZZ, 1)
|
| | | msgInfo = str([1]) # 是否刚开始
|
| | | GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(curPlayer.GetID(), 0, 0, 'XMZZStartFight', msgInfo, len(msgInfo))
|
| | | curPlayer.SetHP(curPlayer.GetMaxHP())
|
| | |
| | | import NetPackCommon
|
| | | import ChPyNetSendPack
|
| | | import PlayerActivity
|
| | | import PlayerWeekParty
|
| | | import PlayerControl
|
| | | import IpyGameDataPY
|
| | | import SkillCommon
|
| | |
| | | if hurtType == FamilyHurtObjType_Player and hurtObj.hurtValue == 0 and hurtValue:
|
| | | if IsHorsePetRobBoss(curBoss.GetNPCID()):
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FamilyRobBoss)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_FamilyRobBoss, 1)
|
| | |
|
| | | hurtObj.hurtValue += hurtValue
|
| | | GameWorld.DebugLog(" 更新伤血%s: hurtType=%s,hurtID=%s,hurtValue=%s"
|
| | |
| | | ("BYTE", "NeedExp", 0),
|
| | | ("dict", "AddAttr", 0),
|
| | | ),
|
| | |
|
| | | "ActWeekParty":(
|
| | | ("DWORD", "CfgID", 1),
|
| | | ("char", "StartDate", 0),
|
| | | ("char", "EndDate", 0),
|
| | | ("BYTE", "IsDayReset", 0),
|
| | | ("BYTE", "ResetType", 0),
|
| | | ("WORD", "LVLimit", 0),
|
| | | ("list", "TemplateID", 0),
|
| | | ("dict", "PointAward", 0),
|
| | | ),
|
| | |
|
| | | "WeekParty":(
|
| | | ("BYTE", "TemplateID", 1),
|
| | | ("BYTE", "ActionType", 0),
|
| | | ("DWORD", "TotalTimes", 0),
|
| | | ("WORD", "SingleTimes", 0),
|
| | | ("list", "Reward", 0),
|
| | | ("WORD", "Point", 0),
|
| | | ),
|
| | | }
|
| | |
|
| | | |
| | |
| | | def GetNeedExp(self): return self.NeedExp # 升级所需经验
|
| | | def GetAddAttr(self): return self.AddAttr # 属性 |
| | |
|
| | | # 周狂欢活动时间表 |
| | | class IPY_ActWeekParty(): |
| | | |
| | | def __init__(self): |
| | | self.CfgID = 0
|
| | | self.StartDate = ""
|
| | | self.EndDate = ""
|
| | | self.IsDayReset = 0
|
| | | self.ResetType = 0
|
| | | self.LVLimit = 0
|
| | | self.TemplateID = []
|
| | | self.PointAward = {} |
| | | return |
| | | |
| | | def GetCfgID(self): return self.CfgID # 配置ID
|
| | | def GetStartDate(self): return self.StartDate # 开启日期
|
| | | def GetEndDate(self): return self.EndDate # 结束日期
|
| | | def GetIsDayReset(self): return self.IsDayReset # 是否每天重置
|
| | | def GetResetType(self): return self.ResetType # 重置类型,0-0点重置;1-5点重置
|
| | | def GetLVLimit(self): return self.LVLimit # 限制等级
|
| | | def GetTemplateID(self): return self.TemplateID # 模板编号
|
| | | def GetPointAward(self): return self.PointAward # 总积分奖励 |
| | | |
| | | # 周狂欢表 |
| | | class IPY_WeekParty(): |
| | | |
| | | def __init__(self): |
| | | self.TemplateID = 0
|
| | | self.ActionType = 0
|
| | | self.TotalTimes = 0
|
| | | self.SingleTimes = 0
|
| | | self.Reward = []
|
| | | self.Point = 0 |
| | | return |
| | | |
| | | def GetTemplateID(self): return self.TemplateID # 模板ID
|
| | | def GetActionType(self): return self.ActionType # 活动条目ID
|
| | | def GetTotalTimes(self): return self.TotalTimes # 可完成的总次数,0表示不限次数
|
| | | def GetSingleTimes(self): return self.SingleTimes # 单次领奖需要的次数
|
| | | def GetReward(self): return self.Reward # 奖励物品
|
| | | def GetPoint(self): return self.Point # 积分 |
| | |
|
| | |
|
| | | def Log(msg, playerID=0, par=0):
|
| | | LogUI.Msg("%s\t%s\t%s" % (par, playerID, msg))
|
| | |
| | | self.ipyCoatLen = len(self.ipyCoatCache)
|
| | | self.ipyCoatChestUpCache = self.__LoadFileData("CoatChestUp", IPY_CoatChestUp)
|
| | | self.ipyCoatChestUpLen = len(self.ipyCoatChestUpCache)
|
| | | self.ipyActWeekPartyCache = self.__LoadFileData("ActWeekParty", IPY_ActWeekParty)
|
| | | self.ipyActWeekPartyLen = len(self.ipyActWeekPartyCache)
|
| | | self.ipyWeekPartyCache = self.__LoadFileData("WeekParty", IPY_WeekParty)
|
| | | self.ipyWeekPartyLen = len(self.ipyWeekPartyCache)
|
| | | Log("IPY_FuncConfig count=%s" % len(self.ipyFuncConfigDict))
|
| | | Log("IPY_DataMgr InitOK!")
|
| | | return
|
| | |
| | | def GetCoatByIndex(self, index): return self.ipyCoatCache[index]
|
| | | def GetCoatChestUpCount(self): return self.ipyCoatChestUpLen
|
| | | def GetCoatChestUpByIndex(self, index): return self.ipyCoatChestUpCache[index]
|
| | | def GetActWeekPartyCount(self): return self.ipyActWeekPartyLen
|
| | | def GetActWeekPartyByIndex(self, index): return self.ipyActWeekPartyCache[index]
|
| | | def GetWeekPartyCount(self): return self.ipyWeekPartyLen
|
| | | def GetWeekPartyByIndex(self, index): return self.ipyWeekPartyCache[index]
|
| | |
|
| | | IPYData = IPY_DataMgr()
|
| | | def IPY_Data(): return IPYData
|
| | |
| | | import PlayerMagicWeapon
|
| | | import PlayerBossReborn
|
| | | import PlayerFairyCeremony
|
| | | import PlayerWeekParty
|
| | | import FamilyRobBoss
|
| | | import IpyGameDataPY
|
| | | import PyGameData
|
| | |
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_WorldBOSS)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_WorldBOSS, 1)
|
| | | PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_WorldBoss, 1)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_WorldBOSS, 1)
|
| | | if ChConfig.IsGameBoss(curNPC) and mapID == ChConfig.Def_FBMapID_BossHome:
|
| | | #BOSS之家
|
| | | # BOSS之家BOSS击杀成就
|
| | |
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_BOSSHome)
|
| | | PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_BOSSHome, 1)
|
| | | PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_BossHome, 1)
|
| | | |
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_BOSSHome, 1)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | import GameLogic_TrialTower
|
| | | import GameLogic_FamilyWar
|
| | | import PlayerBossReborn
|
| | | import PlayerWeekParty
|
| | | import Operate_EquipWash
|
| | | import PlayerTreasure
|
| | | import GameLogic_GodArea
|
| | |
| | | PlayerFreeGoods.OnLogin(curPlayer)
|
| | | # BOSS复活活动
|
| | | PlayerBossReborn.OnLogin(curPlayer)
|
| | | # 周狂欢活动
|
| | | PlayerWeekParty.OnLogin(curPlayer)
|
| | | # 仙界盛典活动
|
| | | PlayerFairyCeremony.OnLogin(curPlayer)
|
| | | # 分支下载奖励记录通知
|
| | |
| | | # 冰晶矿脉星级奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_IceLodeStar:
|
| | | GameLogic_IceLode.GetIceLodeStarAward(curPlayer, dataEx)
|
| | | # 领取周狂欢活动奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_WeekPartyAct:
|
| | | PlayerWeekParty.GetWeekPartyActionAward(curPlayer, dataEx, dataExStr)
|
| | | # 领取周狂欢积分奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_WeekPartyPoint:
|
| | | PlayerWeekParty.GetWeekPartyPointAward(curPlayer, dataEx, dataExStr)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | import PlayerGoldGift
|
| | | import PlayerActTotalRecharge
|
| | | import OpenServerCampaign
|
| | | import PlayerWeekParty
|
| | | import ItemCommon
|
| | |
|
| | | import time
|
| | |
| | | PlayerActTotalRecharge.AddTotalRechargeGold(curPlayer, orderCoin/100)
|
| | | #开服活动
|
| | | OpenServerCampaign.AddOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_Recharge, orderCoin)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Recharge, addVIPExp)
|
| | | GameWorld.Log("Billing: eventName=%s, %s" % (eventName, addDRDict), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | |
| | | import CrossRealmPlayer
|
| | | import FunctionNPCCommon
|
| | | import DataRecordPack
|
| | | import PlayerWeekParty
|
| | | import IPY_GameWorld
|
| | | import ItemControler
|
| | | import ItemCommon
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_CrossPK_TodayWinCount, todayWinCount)
|
| | | GameWorld.Log(" 增加今日已获胜次数: todayWinCount=%s" % todayWinCount, playerID)
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_CrossReamPK)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_CrossPK, 1)
|
| | | else:
|
| | | GameWorld.Log(" 不同天的PK结算不增加今日PK次数! ", playerID)
|
| | |
|
| | |
| | | import PlayerActTotalRecharge
|
| | | import PlayerSpringSale
|
| | | import PlayerBossReborn
|
| | | import PlayerWeekParty
|
| | | import PlayerFlashGiftbag
|
| | | import PlayerFairyCeremony
|
| | | import PlayerRefineStove
|
| | |
| | | elif actionName == ShareDefine.OperationActionName_WishingWell:
|
| | | PlayerWishingWell.RefreshWishingWellAction()
|
| | |
|
| | | elif actionName == ShareDefine.OperationActionName_WeekParty:
|
| | | PlayerWeekParty.RefreshOperationAction_WeekParty()
|
| | | |
| | | return
|
| | |
|
| | | if msgValue.isdigit():
|
| | |
| | | import DataRecordPack
|
| | | import ItemControler
|
| | | import IPY_GameWorld
|
| | | import PlayerWeekParty
|
| | | import ItemCommon
|
| | | import GameWorld
|
| | | import ChConfig
|
| | |
| | | PlayerControl.WorldNotify(0, notifyKey, [curPlayer.GetPlayerName(), rmb, giftbagIpyData.GetMainItemID()])
|
| | |
|
| | | SyncFlashGiftbagBuyCount(curPlayer, [giftbagID])
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_GiftBag, actGiftbagType, False)
|
| | | return True
|
| | |
|
| | | def SyncFlashGiftbagBuyCount(curPlayer, syncIDList=[], giftbagTypeList=[]):
|
New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package Player.PlayerWeekParty
|
| | | #
|
| | | # @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 NetPackCommon
|
| | | import ShareDefine
|
| | | import PyGameData
|
| | | import ItemCommon
|
| | |
|
| | |
|
| | | def OnLogin(curPlayer):
|
| | | isReset = __CheckPlayerWeekPartyAction(curPlayer)
|
| | | if not isReset:
|
| | | actCostRebateInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WeekParty, {})
|
| | | # 活动中同步活动信息
|
| | | if actCostRebateInfo.get(ShareDefine.ActKey_State):
|
| | | SyncWeekPartyInfo(curPlayer)
|
| | | SyncWeekPartyPlayerInfo(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | def RefreshOperationAction_WeekParty():
|
| | | playerManager = GameWorld.GetPlayerManager()
|
| | | for i in xrange(playerManager.GetPlayerCount()):
|
| | | curPlayer = playerManager.GetPlayerByIndex(i)
|
| | | if curPlayer == None or not curPlayer.GetInitOK():
|
| | | continue
|
| | | __CheckPlayerWeekPartyAction(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | | def __CheckPlayerWeekPartyAction(curPlayer):
|
| | | ## 检查玩家周狂欢活动数据信息
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | |
| | | actWeekPartyInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WeekParty, {})
|
| | | #WeekPartyID = actWeekPartyInfo.get(ShareDefine.ActKey_ID, 0)
|
| | | state = actWeekPartyInfo.get(ShareDefine.ActKey_State, 0)
|
| | | cfgID = actWeekPartyInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | passlv = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_TrialTower_PassLV)
|
| | | isOk = AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Tower, passlv, False)
|
| | | playerWeekPartyID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyID, 0, ChConfig.Def_PDictType_WeekParty) # 玩家身上的活动ID
|
| | | if not isOk and state:
|
| | | SyncWeekPartyPlayerInfo(curPlayer)
|
| | | # 活动ID 相同的话不处理
|
| | | if cfgID == playerWeekPartyID:
|
| | | #GameWorld.DebugLog("周狂欢活动ID不变,不处理!", curPlayer.GetPlayerID())
|
| | | return
|
| | | # 未领取的奖励邮件发放
|
| | | __SendWeekPartyMail(curPlayer, playerWeekPartyID)
|
| | | |
| | | if not cfgID:
|
| | | GameWorld.DebugLog(' 周狂欢活动重置!')
|
| | | curPlayer.ClearNomalDict(ChConfig.Def_PDictType_WeekParty)
|
| | | |
| | | GameWorld.DebugLog("周狂欢变更! state=%s,cfgID=%s,playerWeekPartyID=%s" % (state, cfgID, playerWeekPartyID), playerID)
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WeekPartyID, cfgID, ChConfig.Def_PDictType_WeekParty)
|
| | | |
| | | SyncWeekPartyInfo(curPlayer)
|
| | | return True
|
| | |
|
| | |
|
| | | def __SendWeekPartyMail(curPlayer, cfgID):
|
| | | # 未领取的奖励邮件发放
|
| | | actBossIpyData = IpyGameDataPY.GetIpyGameData("ActWeekParty", 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('WeekParty', tid)
|
| | | if not ipyData:
|
| | | continue
|
| | | singleTimes = ipyData.GetSingleTimes()
|
| | | curTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyCurTimes % (day, tid), 0, ChConfig.Def_PDictType_WeekParty)
|
| | | gotTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyGotTimes % (day, tid), 0, ChConfig.Def_PDictType_WeekParty)
|
| | | 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_WeekPartyPoint % day, 0, ChConfig.Def_PDictType_WeekParty)
|
| | | if curPoint < point:
|
| | | continue
|
| | | awardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyAwardRecord % day, 0, ChConfig.Def_PDictType_WeekParty)
|
| | | if awardRecord & pow(2, i):
|
| | | continue
|
| | | itemList = awardDict[point]
|
| | | for itemID, itemCnt, isBind in itemList:
|
| | | totalItemDict[itemID] = totalItemDict.get(itemID, 0) + itemCnt
|
| | | if not totalItemDict:
|
| | | return
|
| | | totalItemList = [[itemID, itemCnt, 1] for itemID, itemCnt in totalItemDict.items()]
|
| | | PlayerControl.SendMailByKey('SecondWeekReward', [curPlayer.GetID()], totalItemList)
|
| | | return
|
| | |
|
| | |
|
| | | def AddWeekPartyActionCnt(curPlayer, actionID, addCnt=1, isAdd=True):
|
| | | '''增加周狂欢相关活动完成次数'''
|
| | | #判断活动是否开启
|
| | | if not addCnt:
|
| | | return
|
| | | actWeekPartyInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WeekParty, {})
|
| | | state = actWeekPartyInfo.get(ShareDefine.ActKey_State, 0)
|
| | | cfgID = actWeekPartyInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | |
| | | if not state or not cfgID:
|
| | | return
|
| | | actBossIpyData = IpyGameDataPY.GetIpyGameData("ActWeekParty", cfgID)
|
| | | if not actBossIpyData:
|
| | | return
|
| | | templateIDList = actBossIpyData.GetTemplateID()
|
| | | dayIndex = actWeekPartyInfo.get(ShareDefine.ActKey_DayIndex, 0)
|
| | | if dayIndex >= len(templateIDList):
|
| | | return
|
| | | dayTidList = templateIDList[dayIndex]
|
| | | findTid = 0
|
| | | for tid in dayTidList:
|
| | | if tid / 100 == actionID:
|
| | | findTid = tid
|
| | | break
|
| | | if not findTid:
|
| | | return
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('WeekParty', findTid)
|
| | | if not ipyData:
|
| | | return
|
| | | totalTimes = ipyData.GetTotalTimes()
|
| | | curTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyCurTimes % (dayIndex, findTid), 0, ChConfig.Def_PDictType_WeekParty)
|
| | | if isAdd:
|
| | | addCnt = addCnt if totalTimes == 0 else min(totalTimes - curTimes, addCnt)
|
| | | if addCnt <= 0:
|
| | | return
|
| | | updTimes = curTimes + addCnt
|
| | | else:
|
| | | updTimes = min(addCnt, totalTimes)
|
| | | realAddCnt = updTimes - curTimes
|
| | | if realAddCnt <= 0:
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WeekPartyCurTimes % (dayIndex, findTid), updTimes, ChConfig.Def_PDictType_WeekParty)
|
| | | #加积分
|
| | | singleTimes = ipyData.GetSingleTimes()
|
| | | addPoint = (curTimes % singleTimes + realAddCnt)/singleTimes* ipyData.GetPoint()
|
| | | curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyPoint % dayIndex, 0, ChConfig.Def_PDictType_WeekParty)
|
| | | updPoint = curPoint + addPoint
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WeekPartyPoint % dayIndex, updPoint, ChConfig.Def_PDictType_WeekParty)
|
| | | GameWorld.DebugLog(' 增加周狂欢相关活动完成次数 dayIndex=%s, findTid=%s, realAddCnt=%s,addPoint=%s' % (dayIndex, findTid, realAddCnt, addPoint))
|
| | | SyncWeekPartyPlayerInfo(curPlayer, dayIndex, findTid)
|
| | | return True
|
| | |
|
| | |
|
| | | def GetWeekPartyActionAward(curPlayer, day, templateID):
|
| | | '''领取周狂欢活动奖励'''
|
| | | templateID = GameWorld.ToIntDef(templateID, 0)
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('WeekParty', templateID)
|
| | | if not ipyData:
|
| | | return
|
| | | singleTimes = ipyData.GetSingleTimes()
|
| | | curTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyCurTimes % (day, templateID), 0, ChConfig.Def_PDictType_WeekParty)
|
| | | gotTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyGotTimes % (day, templateID), 0, ChConfig.Def_PDictType_WeekParty)
|
| | | 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_WeekPartyGotTimes % (day, templateID), newGotTimes, ChConfig.Def_PDictType_WeekParty)
|
| | | for itemID, itemCnt in awardDict.items():
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 1, [IPY_GameWorld.rptItem])
|
| | | SyncWeekPartyPlayerInfo(curPlayer, day, templateID)
|
| | | return
|
| | |
|
| | |
|
| | | def GetWeekPartyPointAward(curPlayer, day, getPoint):
|
| | | ##领取周狂欢积分奖励
|
| | | getPoint = GameWorld.ToIntDef(getPoint, 0)
|
| | | actWeekPartyInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WeekParty, {})
|
| | | state = actWeekPartyInfo.get(ShareDefine.ActKey_State, 0)
|
| | | cfgID = actWeekPartyInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | if not state or not cfgID:
|
| | | return
|
| | | actBossIpyData = IpyGameDataPY.GetIpyGameData("ActWeekParty", cfgID)
|
| | | if not actBossIpyData:
|
| | | return
|
| | | curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyPoint % day, 0, ChConfig.Def_PDictType_WeekParty)
|
| | | 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_WeekPartyAwardRecord % day, 0, ChConfig.Def_PDictType_WeekParty)
|
| | | 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_WeekPartyAwardRecord % day, awardRecord | pow(2, getIndex), ChConfig.Def_PDictType_WeekParty)
|
| | | for itemID, itemCnt, isBind in itemList:
|
| | | ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem])
|
| | | SyncWeekPartyPlayerInfo(curPlayer, day)
|
| | | 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 SyncWeekPartyPlayerInfo(curPlayer, day=-1, templateID=-1):
|
| | | #通知当前次数、已领次数 |
| | | actWeekPartyInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WeekParty, {})
|
| | | state = actWeekPartyInfo.get(ShareDefine.ActKey_State, 0)
|
| | | cfgID = actWeekPartyInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | if not state or not cfgID:
|
| | | return
|
| | | actBossIpyData = IpyGameDataPY.GetIpyGameData("ActWeekParty", 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.tagMCWeekPartyPlayerInfo()
|
| | | packData.DayInfoList = []
|
| | | for cday in syncDayList:
|
| | | tiemInfo = ChPyNetSendPack.tagMCWeekPartyDayPlayerInfo()
|
| | | tiemInfo.DayIndex = cday
|
| | | tiemInfo.Point = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyPoint % cday, 0, ChConfig.Def_PDictType_WeekParty)
|
| | | tiemInfo.AwardRecord = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyAwardRecord % cday, 0, ChConfig.Def_PDictType_WeekParty)
|
| | | tiemInfo.TaskList = []
|
| | | for tID in templateIDList[cday]:
|
| | | if templateID != -1 and tID != templateID:
|
| | | continue
|
| | | tipyData = IpyGameDataPY.GetIpyGameData('WeekParty', tID)
|
| | | if not tipyData:
|
| | | continue
|
| | | taskInfo = ChPyNetSendPack.tagMCWeekPartyTaskInfo()
|
| | | taskInfo.TemplateID = tID
|
| | | taskInfo.CurTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyCurTimes % (cday, tID), 0, ChConfig.Def_PDictType_WeekParty)
|
| | | taskInfo.GotTimes = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_WeekPartyGotTimes % (cday, tID), 0, ChConfig.Def_PDictType_WeekParty)
|
| | | tiemInfo.TaskList.append(taskInfo)
|
| | | tiemInfo.ACount = len(tiemInfo.TaskList)
|
| | | packData.DayInfoList.append(tiemInfo)
|
| | | packData.Count = len(packData.DayInfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, packData)
|
| | | return
|
| | |
|
| | |
|
| | | def SyncWeekPartyInfo(curPlayer):
|
| | | actWeekPartyInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WeekParty, {})
|
| | | state = actWeekPartyInfo.get(ShareDefine.ActKey_State, 0)
|
| | | cfgID = actWeekPartyInfo.get(ShareDefine.ActKey_CfgID, 0)
|
| | | if not state or not cfgID:
|
| | | return
|
| | | actBossIpyData = IpyGameDataPY.GetIpyGameData("ActWeekParty", cfgID)
|
| | | if not actBossIpyData:
|
| | | return
|
| | | templateIDList = actBossIpyData.GetTemplateID()
|
| | | if not templateIDList:
|
| | | return
|
| | | pointAwardDict = actBossIpyData.GetPointAward()
|
| | | openServerDay = GameWorld.GetGameWorld().GetGameWorldDictByKey(ShareDefine.Def_Notify_WorldKey_ServerDay) + 1
|
| | | actInfo = ChPyNetSendPack.tagMCWeekPartyInfo()
|
| | | actInfo.Clear()
|
| | | actInfo.StartDate = GameWorld.GetOperationActionDateStr(actBossIpyData.GetStartDate(), openServerDay)
|
| | | actInfo.EndtDate = GameWorld.GetOperationActionDateStr(actBossIpyData.GetEndDate(), openServerDay)
|
| | | actInfo.IsDayReset = actBossIpyData.GetIsDayReset()
|
| | | actInfo.ResetType = actBossIpyData.GetResetType()
|
| | | actInfo.LimitLV = actBossIpyData.GetLVLimit()
|
| | | actInfo.DayInfoList = []
|
| | | tidList = []
|
| | | for day, dayActList in enumerate(templateIDList):
|
| | | dayInfo = ChPyNetSendPack.tagMCWeekPartyDayInfo()
|
| | | 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.tagMCWeekPartyItem()
|
| | | 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('WeekParty', tid)
|
| | | if not ipyData:
|
| | | GameWorld.ErrLog(' 周狂欢模板表找不到模板%s' % tid)
|
| | | continue
|
| | | tInfo = ChPyNetSendPack.tagMCWeekPartyAction()
|
| | | 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 itemList:
|
| | | awardItem = ChPyNetSendPack.tagMCWeekPartyItem()
|
| | | 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
|
| | |
| | | OperationActionName_FlashSale = "ActFlashSale" # 限时抢购活动
|
| | | OperationActionName_WishingWell = "ActWishingWell" # 许愿池活动
|
| | | OperationActionName_TotalRecharge = "ActTotalRecharge" # 累计充值活动
|
| | | OperationActionName_WeekParty = "ActWeekParty" # 周狂欢活动
|
| | | OperationActionNameList = [OperationActionName_ExpRate, OperationActionName_CostRebate,
|
| | | OperationActionName_BossReborn,OperationActionName_SpringSale,
|
| | | OperationActionName_FlashGiftbag, OperationActionName_FairyCeremony,
|
| | | OperationActionName_RealmPoint, OperationActionName_FlashSale,
|
| | | OperationActionName_WishingWell, OperationActionName_TotalRecharge]
|
| | | OperationActionName_WishingWell, OperationActionName_TotalRecharge, |
| | | OperationActionName_WeekParty, ]
|
| | | #需要记录开启活动时的世界等级的运营活动
|
| | | NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell]
|
| | |
|