From e58a11b68c724d3c05daad923fbac4c1cba77d0f Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期二, 18 九月 2018 11:29:44 +0800
Subject: [PATCH] fix:3604 【后端】潜力0级时增加战力 3609 【后端】法宝之魂改为由各个法宝单独觉醒,取消激活条件

---
 ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py |   76 ++++++++++++++++++++++++++++++++++++--
 1 files changed, 72 insertions(+), 4 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
index 50b7182..9a89e05 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/GameWorldLogic/GameWorldBoss.py
@@ -112,8 +112,8 @@
     isMapNeedShunt = IsMapNeedBossShunt(mapID)
     isAlive = __GetIsAlive(bossID)
     
-    GameWorld.DebugLog("击杀世界boss DoGameWorldBossOnKilled...bossID=%s,hurtValue=%s,mapID=%s,tick=%s,isMapNeedShunt=%s,isAlive=%s" 
-                       % (bossID, hurtValue, mapID, tick, isMapNeedShunt, isAlive))
+    GameWorld.Log("击杀世界boss DoGameWorldBossOnKilled...bossID=%s,hurtValue=%s,mapID=%s,tick=%s,isMapNeedShunt=%s,isAlive=%s" 
+                  % (bossID, hurtValue, mapID, tick, isMapNeedShunt, isAlive))
     if isMapNeedShunt and not isAlive:
         GameWorld.DebugLog("需要分流的地图boss被击杀,但是当前boss全局状态为死亡状态,不再更新boss击杀信息!")
         return
@@ -134,7 +134,10 @@
         # 全服广播世界boss变更信息
         Sync_BossInfo(None, [bossID])
         SendMapServerBossKilledCnt(bossID)
-
+        
+    horsePetRobBossIDList = IpyGameDataPY.GetFuncEvalCfg("FairyGrabBossID", 1)
+    if bossID in horsePetRobBossIDList:
+        OnFamilyKillHorsePetRobBoss(killPlayerName)
     return
 
 def __UpdateBossRefreshList(bossID, killedTime=0, refreshTime=0):
@@ -483,6 +486,10 @@
     bossID = IpyGameDataPY.GetFuncCfg('DogzFBRefreshCfg', 2)
     onlineCnt = __GetBossOnlineHeroCnt(bossID)[0]
     GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_BossOnlineHeroCnt % bossID, onlineCnt)
+    
+    #仙盟击杀骑宠boss数
+    if PyGameData.g_familyKillHorsePetRobBossCntDict:
+        GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_FamilyKillHorsePetRobBossCnt, PyGameData.g_familyKillHorsePetRobBossCntDict)
     return
 
 
@@ -911,10 +918,13 @@
     PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_BossRebornPoint, updPoint)
     if curPoint+addPoint >= totalPoint:
         #重生boss
+        rebornCnt = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_BossRebornCnt)
+        PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_BossRebornCnt, rebornCnt+1)
+        
         killBossCntLimitDict = IpyGameDataPY.GetFuncEvalCfg('KillBossCntLimit', 1, {})
         canRebornBossIDList = []
         for bidlist, bkey in killBossCntLimitDict.items():
-            if bkey not in [0, 1]:
+            if bkey not in [ShareDefine.Def_Boss_Func_World, ShareDefine.Def_Boss_Func_Home]:
                 continue
             canRebornBossIDList += list(bidlist)
         
@@ -948,6 +958,8 @@
 def ResetBossRebornPoint():
     ## 重置boss复活点
     PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_BossRebornPoint, 0)
+    PlayerDBGSEvent.SetDBGSTrig_ByKey(PlayerDBGSEvent.Def_BossRebornCnt, 0)
+    
     # 活动开启时设置参数 服务器人数
     lvLimit = IpyGameDataPY.GetFuncCfg('ServerActivePlayerCnt')
     yesterdayPlayerCnt = len([1 for lv in PyGameData.g_yesterdayPlayerLVDict.values() if lv >= lvLimit]) #参数昨日活跃人数
@@ -999,6 +1011,7 @@
     if not totalPoint:
         totalPoint = SetBossRebornNeedPoint()
     packData.TotalPoint = totalPoint
+    packData.RebornCnt = PlayerDBGSEvent.GetDBGSTrig_ByKey(PlayerDBGSEvent.Def_BossRebornCnt)
     playerManager = GameWorld.GetPlayerManager()
     if not curPlayer:
         for i in xrange(playerManager.GetActivePlayerCount()):
@@ -1047,6 +1060,61 @@
 
 ## -----------------------------------------------------------------------------------------------
 
+def OnFamilyKillHorsePetRobBoss(killFamilyName):
+    ## 仙盟击杀骑宠boss
+    
+    family = GameWorld.GetFamilyManager().FindFamilyByName(killFamilyName)
+    if not family:
+        GameWorld.ErrLog("找不到该仙盟名: killFamilyName=%s" % killFamilyName)
+        return
+    
+    familyID = family.GetID()
+    PyGameData.g_familyKillHorsePetRobBossCntDict[familyID] = PyGameData.g_familyKillHorsePetRobBossCntDict.get(familyID, 0) + 1
+    GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_FamilyKillHorsePetRobBossCnt, PyGameData.g_familyKillHorsePetRobBossCntDict)
+    GameWorld.Log("骑宠争夺仙盟击杀Boss数统计: %s" % PyGameData.g_familyKillHorsePetRobBossCntDict)
+    return
+
+def SyncMapServer_HorsePetRobBossPlayerCount():
+    ## 活动开始前,同步有效活动人数到地图,作为Boss属性成长系数用
+    
+    diffWorldLV = int(IpyGameDataPY.GetFuncCfg("FairyGrabBossID", 3))
+    funcLimitLV = PlayerControl.GetFuncLimitLV(ShareDefine.GameFuncID_HorsePetRobBoss)
+    curWorldLV = PlayerDBGSEvent.GetDBGSTrig_ByKey(ShareDefine.Def_Notify_WorldKey_WorldAverageLv)
+    minLV = max(funcLimitLV, curWorldLV + diffWorldLV)
+    
+    playerCount = 0
+    playerManager = GameWorld.GetPlayerManager()
+    for i in xrange(playerManager.GetActivePlayerCount()):
+        findPlayer = playerManager.GetActivePlayerAt(i)
+        if findPlayer == None or not findPlayer.GetInitOK():
+            continue
+        
+        if PlayerControl.GetIsTJG(findPlayer):
+            continue
+        
+        if not findPlayer.GetFamilyID():
+            continue
+        
+        if findPlayer.GetLV() < minLV:
+            continue
+        
+        playerCount += 1
+        
+    GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_HorsePetRobBossPlayerCount, playerCount)
+    GameWorld.Log("同步骑宠争夺有效参与人数: playerCount=%s,minLV=%s,funcLimitLV=%s,curWorldLV=%s,diffWorldLV=%s" 
+                  % (playerCount, minLV, funcLimitLV, curWorldLV, diffWorldLV))
+    return
+
+def OnHorsePetRobBossActionChange(isOpen):
+    ## 骑宠争夺活动状态变更
+    
+    # 无论开关都重置, 服务器活动中维护暂时不处理
+    PyGameData.g_familyKillHorsePetRobBossCntDict = {}
+    GameWorld.SendMapServerMsgEx(ShareDefine.Def_Notify_WorldKey_FamilyKillHorsePetRobBossCnt, PyGameData.g_familyKillHorsePetRobBossCntDict)
+    
+    
+    return
+
 def MapServer_HorsePetRobBossHurtPlayer(msgInfo):
     ## 骑宠争夺boss伤血玩家同步
     GameWorld.Log("骑宠争夺boss伤血玩家同步: %s" % str(msgInfo))

--
Gitblit v1.8.0