From 498a2f1f681cf7519532da0deff6ab02dd13564b Mon Sep 17 00:00:00 2001 From: xdh <xiefantasy@qq.com> Date: 星期三, 09 一月 2019 11:37:03 +0800 Subject: [PATCH] 5768 【后端】【1.5】新增8-14天活动功能(制作成7日运营活动的模板) --- ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py | 47 ++++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py | 3 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_IceLode.py | 3 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ChaosDemon.py | 3 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py | 2 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py | 2 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_KirinHome.py | 3 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py | 70 ++++++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py | 11 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py | 2 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_TrialTower.py | 2 PySysDB/PySysDBPY.h | 26 ++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ElderBattlefield.py | 2 ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py | 4 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_QueenRelics.py | 2 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py | 4 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyInvade.py | 2 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SealDemon.py | 2 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWeekParty.py | 374 ++++++++++++++++++++++++++++++++++ ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py | 2 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFlashGiftbag.py | 4 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py | 2 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py | 4 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_GodArea.py | 2 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_XMZZ.py | 3 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py | 4 PySysDB/PySysDBG.h | 16 + ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 36 +++ 28 files changed, 627 insertions(+), 10 deletions(-) diff --git a/PySysDB/PySysDBG.h b/PySysDB/PySysDBG.h index 617ab5c..3fd8260 100644 --- a/PySysDB/PySysDBG.h +++ b/PySysDB/PySysDBG.h @@ -470,3 +470,19 @@ 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; //限制等级 +}; \ No newline at end of file diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h index b97f526..03f35a6 100644 --- a/PySysDB/PySysDBPY.h +++ b/PySysDB/PySysDBPY.h @@ -1514,4 +1514,30 @@ DWORD _LV; //等级 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; //积分 }; \ No newline at end of file diff --git a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py index f717018..e3da4dc 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/IpyGameDataPY.py @@ -396,6 +396,20 @@ ("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), + ), } @@ -1163,6 +1177,35 @@ def GetDanLV(self): return self.DanLV # 段位等级 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): @@ -1258,6 +1301,8 @@ 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 @@ -1494,6 +1539,8 @@ 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 diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py index 62a0a18..b2a89aa 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py @@ -228,11 +228,13 @@ 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] diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py index f5f6b9d..b4f5ec6 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py @@ -3260,7 +3260,7 @@ 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, # 官爵 @@ -3713,6 +3713,13 @@ 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" # 新手在线已领取奖励次数 @@ -5125,7 +5132,9 @@ 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复活相关活动定义 @@ -5162,6 +5171,29 @@ 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, diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py index 08baab8..c0b8d23 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py @@ -59,6 +59,7 @@ import PlayerMagicWeapon import PlayerBossReborn import PlayerFairyCeremony +import PlayerWeekParty import PlayerHorse import FBCommon import PyGameData @@ -5240,6 +5241,7 @@ 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) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py index 97dfced..28778dd 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_BZZD.py @@ -32,6 +32,7 @@ import PlayerSuccess import PlayerBossReborn import PlayerFairyCeremony +import PlayerWeekParty import ItemControler import GameFuncComm import SkillShell @@ -185,6 +186,7 @@ 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) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ChaosDemon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ChaosDemon.py index f46c5f0..e25fdf0 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ChaosDemon.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ChaosDemon.py @@ -32,6 +32,7 @@ import PlayerSuccess import FBHelpBattle import EventReport +import PlayerWeekParty import math @@ -162,7 +163,7 @@ 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: diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ElderBattlefield.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ElderBattlefield.py index 0c48d53..09ce446 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ElderBattlefield.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ElderBattlefield.py @@ -35,6 +35,7 @@ import SkillShell import EventReport import SkillCommon +import PlayerWeekParty import random import time @@ -170,6 +171,7 @@ 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) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyInvade.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyInvade.py index 1a168a6..964418c 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyInvade.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyInvade.py @@ -24,6 +24,7 @@ import GameWorld import ChConfig import GameWorldProcess +import PlayerWeekParty import PyGameData import ShareDefine import EventReport @@ -173,6 +174,7 @@ 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) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py index 8a77571..fd05d57 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_FamilyWar.py @@ -28,6 +28,7 @@ import ChPyNetSendPack import GameWorldProcess import PlayerDienstgrad +import PlayerWeekParty import IpyGameDataPY import PlayerFamily import NetPackCommon @@ -521,7 +522,7 @@ 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) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_GodArea.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_GodArea.py index 7612f74..628fdde 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_GodArea.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_GodArea.py @@ -23,6 +23,7 @@ import PlayerControl import PlayerBossReborn import PlayerFairyCeremony +import PlayerWeekParty import EventReport import time @@ -143,6 +144,7 @@ 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(" 副本里掉线重上 怒气已满,退出副本") diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_IceLode.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_IceLode.py index db95d49..cf27561 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_IceLode.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_IceLode.py @@ -33,6 +33,7 @@ import ChPyNetSendPack import NetPackCommon import PlayerSuccess +import PlayerWeekParty import BuffSkill import random @@ -563,6 +564,7 @@ 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) @@ -678,6 +680,7 @@ 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 = {} diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_KirinHome.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_KirinHome.py index 543206d..0d70a36 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_KirinHome.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_KirinHome.py @@ -27,6 +27,7 @@ import PlayerSuccess import PlayerControl import PlayerBossReborn +import PlayerWeekParty import EventShell import EventReport @@ -389,6 +390,7 @@ 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") @@ -490,6 +492,7 @@ 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)) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_QueenRelics.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_QueenRelics.py index 38c0480..9fc1d3b 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_QueenRelics.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_QueenRelics.py @@ -33,6 +33,7 @@ import ChPlayer import FBHelpBattle import IpyGameDataPY +import PlayerWeekParty #阶段时间 @@ -520,6 +521,7 @@ 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) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SealDemon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SealDemon.py index 17c5a8e..7226ad5 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SealDemon.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_SealDemon.py @@ -36,6 +36,7 @@ import PlayerMagicWeapon import PlayerBossReborn import PlayerFairyCeremony +import PlayerWeekParty import EventReport FBDict_StartTick = 'FBDict_StartTick%s' #开始时间 @@ -550,6 +551,7 @@ 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): diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_TrialTower.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_TrialTower.py index 7611ce3..9d45cd4 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_TrialTower.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_TrialTower.py @@ -34,6 +34,7 @@ import PlayerSuccess import PlayerActivity import PlayerBillboard +import PlayerWeekParty import EventReport import random @@ -103,6 +104,7 @@ #通关符印塔成就 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 diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_XMZZ.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_XMZZ.py index 1f31053..0d9bbe8 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_XMZZ.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_XMZZ.py @@ -27,6 +27,7 @@ import ItemCommon import FormulaControl import NPCCustomRefresh +import PlayerWeekParty import PlayerSuccess import PyGameData import EventReport @@ -137,7 +138,7 @@ 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()) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py index d02f52a..773a247 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py @@ -21,6 +21,7 @@ import NetPackCommon import ChPyNetSendPack import PlayerActivity +import PlayerWeekParty import PlayerControl import IpyGameDataPY import SkillCommon @@ -200,6 +201,7 @@ 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" diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py index 2825e23..1fe83aa 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py @@ -1191,6 +1191,26 @@ ("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), + ), } @@ -3626,6 +3646,48 @@ def GetLV(self): return self.LV # 等级 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): @@ -3877,6 +3939,10 @@ 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 @@ -4269,6 +4335,10 @@ 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 diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py index 74b8512..1266f07 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py @@ -52,6 +52,7 @@ import PlayerMagicWeapon import PlayerBossReborn import PlayerFairyCeremony +import PlayerWeekParty import FamilyRobBoss import IpyGameDataPY import PyGameData @@ -4974,6 +4975,7 @@ 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击杀成就 @@ -4982,7 +4984,7 @@ 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 diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py index 00674aa..118bec5 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py @@ -78,6 +78,7 @@ import GameLogic_TrialTower import GameLogic_FamilyWar import PlayerBossReborn +import PlayerWeekParty import Operate_EquipWash import PlayerTreasure import GameLogic_GodArea @@ -692,6 +693,8 @@ PlayerFreeGoods.OnLogin(curPlayer) # BOSS复活活动 PlayerBossReborn.OnLogin(curPlayer) + # 周狂欢活动 + PlayerWeekParty.OnLogin(curPlayer) # 仙界盛典活动 PlayerFairyCeremony.OnLogin(curPlayer) # 分支下载奖励记录通知 @@ -5312,7 +5315,13 @@ # 冰晶矿脉星级奖励 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 diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py index 954cf21..711919b 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py @@ -47,6 +47,7 @@ import PlayerGoldGift import PlayerActTotalRecharge import OpenServerCampaign +import PlayerWeekParty import ItemCommon import time @@ -290,6 +291,7 @@ 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 diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py index a0e5641..a2a665c 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCrossRealmPK.py @@ -24,6 +24,7 @@ import CrossRealmPlayer import FunctionNPCCommon import DataRecordPack +import PlayerWeekParty import IPY_GameWorld import ItemControler import ItemCommon @@ -308,6 +309,7 @@ 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) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py index a6d40c5..1ca199f 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerEventCounter.py @@ -80,6 +80,7 @@ import PlayerActTotalRecharge import PlayerSpringSale import PlayerBossReborn +import PlayerWeekParty import PlayerFlashGiftbag import PlayerFairyCeremony import PlayerRefineStove @@ -1302,6 +1303,9 @@ elif actionName == ShareDefine.OperationActionName_WishingWell: PlayerWishingWell.RefreshWishingWellAction() + elif actionName == ShareDefine.OperationActionName_WeekParty: + PlayerWeekParty.RefreshOperationAction_WeekParty() + return if msgValue.isdigit(): diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFlashGiftbag.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFlashGiftbag.py index da6d380..bca97e7 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFlashGiftbag.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFlashGiftbag.py @@ -24,6 +24,7 @@ import DataRecordPack import ItemControler import IPY_GameWorld +import PlayerWeekParty import ItemCommon import GameWorld import ChConfig @@ -171,8 +172,9 @@ orderIpyData = GetFlashGiftbagIDOrderInfoIpyData(giftbagID, appID) rmb = 0 if not orderIpyData else int(orderIpyData.GetPayRMBNum()) 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=[]): diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWeekParty.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWeekParty.py new file mode 100644 index 0000000..fbb033b --- /dev/null +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWeekParty.py @@ -0,0 +1,374 @@ +#!/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 diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py index 62a0a18..b2a89aa 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py @@ -228,11 +228,13 @@ 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] -- Gitblit v1.8.0