From dcec4a9b39a53106bd80dfb41fad83e7319e728e Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期一, 10 七月 2023 18:49:54 +0800 Subject: [PATCH] 9823 9265【主干】【小7】【骨折】跨服云购修改 --- ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyBoss.py | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 50 insertions(+), 1 deletions(-) diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyBoss.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyBoss.py index d22858e..717d12e 100644 --- a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyBoss.py +++ b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyBoss.py @@ -24,6 +24,8 @@ import NetPackCommon import ShareDefine import IpyGameDataPY +import PlayerDBGSEvent +import PlayerControl import ChConfig import time @@ -88,6 +90,7 @@ # @return None def OnLogin(curPlayer): NotifyFamilyBossFBInfo(curPlayer) + NotifyAllFamilyBossState(curPlayer) return @@ -182,7 +185,7 @@ #通知地图服务器刷新 PlayerFamily.SendPack_MapServer_PlayerFamilyRefresh(curFamily) GameWorld.Log(" __DoOpenCostLogic 扣除家族兽粮=%s OK!, familyID=%s,playerFamilyLV=%s" - % (foodCost, curFamily.GetFamilyID(), curMember.GetFamilyLV()), curPlayer.GetPlayerID()) + % (foodCost, curPlayer.GetFamilyID(), curMember.GetFamilyLV()), curPlayer.GetPlayerID()) return True @@ -272,4 +275,50 @@ +#############################多仙盟BOSS############################# +def OnAllFamilyBossStateChange(isOpen): + if isOpen: + #本次开启时间距离上次击杀时间超过1小时则重置 + lastKillTime = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_AllFamilyBossTime) + curTime = int(time.time()) + if abs(curTime-lastKillTime)> 3600: + PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_AllFamilyBossTime, 0) + #通知 + NotifyAllFamilyBossState() + return + +def AllFamilyBossKilled(): + if PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_AllFamilyBossTime): + GameWorld.Log('多仙盟Boss已被击杀,不可重复!!') + return + curTime = int(time.time()) + PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_AllFamilyBossTime, curTime) + GameWorld.Log('多仙盟Boss被击杀!!') + NotifyAllFamilyBossState() + return + +def NotifyAllFamilyBossState(curPlayer=None): + lastKillTime = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_AllFamilyBossTime) + bossInfo = ChPyNetSendPack.tagGCAllFamilyBossInfo() + bossInfo.IsEnd = 1 if lastKillTime else 0 + + if curPlayer == None: + playerManager = GameWorld.GetPlayerManager() + for i in xrange(playerManager.GetActivePlayerCount()): + curPlayer = playerManager.GetActivePlayerAt(i) + if curPlayer == None or not curPlayer.GetInitOK(): + continue + if PlayerControl.GetIsTJG(curPlayer): + continue + NetPackCommon.SendFakePack(curPlayer, bossInfo) + else: + if PlayerControl.GetIsTJG(curPlayer): + return + NetPackCommon.SendFakePack(curPlayer, bossInfo) + return + +#是否在仙盟BOSS活动中 +def IsInAllFamilyBoss(lineID=-1): + state1 = GameWorld.GetGameWorld().GetDictByKey(ShareDefine.Def_Notify_WorldKey_DailyActionState % ShareDefine.DailyActionID_FamilyBoss1) + return state1 \ No newline at end of file -- Gitblit v1.8.0