From 54257275bdaa30fb8d38da4144050511825d0d84 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 16 五月 2019 11:01:45 +0800
Subject: [PATCH] 3583 3524 【BUG】【2.0】妖王副本没有boss(进入副本如果boss已经被击杀则弹出结算界面)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossDemonKing.py |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossDemonKing.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossDemonKing.py
index 40c7705..abc8c73 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossDemonKing.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossDemonKing.py
@@ -29,6 +29,7 @@
 import ChItem
 
 FBDict_IsOver = 'FBDict_IsOver' #是否已结算, 结算时的tick
+FBDict_IsPlayerOver = 'IsPlayerOver_%s' #玩家是否已经结算掉落的,参数playerID
 
 g_ownerInfo = {} # 归属者信息 {funcLineID:[ownerID, ownerName], }
 
@@ -90,6 +91,11 @@
     PyGameData.g_fbPickUpItemDict.pop(playerID, 0)
     if not GameWorld.IsCrossServer():
         PlayerFairyDomain.SetFairyDomainFBEventState(curPlayer, ChConfig.Def_FBMapID_DemonKing, funcLineID, PlayerFairyDomain.FDEventState_Visiting)
+        
+    gameFB = GameWorld.GetGameFB()
+    ## 副本已经结束,但是没有结算掉落的玩家直接通知结束
+    if gameFB.GetGameFBDictByKey(FBDict_IsOver) and not gameFB.GetGameFBDictByKey(FBDict_IsPlayerOver % playerID):
+        __NotifyFBOver(curPlayer, 0)
     return
 
 ## 副本总逻辑计时器
@@ -105,6 +111,7 @@
 
 ## 关闭副本
 def OnCloseFB(tick):
+    global g_ownerInfo
     funcLineID = GetCurFBFuncLineID()
     g_ownerInfo.pop(funcLineID, None)
     GameWorld.GetGameWorld().SetPropertyID(0)
@@ -148,6 +155,8 @@
 
 ## 执行副本杀怪逻辑
 def __FBNPCOnKilled(curNPC, tick):
+    global g_ownerInfo
+    
     bossID = curNPC.GetNPCID()
     funcLineID = GetCurFBFuncLineID()
     if bossID != GetCurFBLineBOSSID(lineID=funcLineID):
@@ -178,6 +187,7 @@
         if not curPlayer:
             continue
         playerID = curPlayer.GetPlayerID()
+        gameFB.SetGameFBDict(FBDict_IsPlayerOver % playerID, 1)
         isOwner = playerID == ownerID
         if isOwner:
             ownerName = curPlayer.GetPlayerName()
@@ -242,11 +252,16 @@
     if not isItemAllPickUp:
         return
     
-    isPass = 1
+    __NotifyFBOver(curPlayer, 1)
+    return
+
+def __NotifyFBOver(curPlayer, isPass):
+    global g_ownerInfo
+    playerID = curPlayer.GetPlayerID()
     mapID = ChConfig.Def_FBMapID_CrossDemonKing if GameWorld.IsCrossServer() else ChConfig.Def_FBMapID_DemonKing
     funcLineID = GetCurFBFuncLineID()
     leaveTick = FBCommon.GetFBLineStepTime(mapID, funcLineID) * 1000
-    ownerID, ownerName = g_ownerInfo.pop(funcLineID, [0, ""])
+    ownerID, ownerName = g_ownerInfo.get(funcLineID, [0, ""])
     jsonItemList = PyGameData.g_fbPickUpItemDict.pop(playerID, [])
     overDict = {FBCommon.Over_ownerID:ownerID, FBCommon.Over_ownerName:ownerName, FBCommon.Over_itemInfo:jsonItemList}
     FBCommon.NotifyFBOver(curPlayer, mapID, funcLineID, isPass, overDict)

--
Gitblit v1.8.0