From 1782c735395d735b103c77ec201f31956383b89c Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期四, 27 六月 2019 09:53:22 +0800
Subject: [PATCH] 4261 【BUG】【2.0.100】蓬莱仙境里击杀boss,不加活跃

---
 ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyBoss.py |   49 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyBoss.py b/ServerPython/CoreServerGroup/GameServer/Script/Player/PlayerFamilyBoss.py
index 23c4a01..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
 
 
@@ -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