From 26a116683bd08fe6705f12d6386068a801b702b9 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 03 四月 2020 18:11:33 +0800
Subject: [PATCH] 4475 【主干】免费送的3个仙盟,概率随机重名导致无法创建(手动创建与系统随机仙盟名相同的默认当做创建该系统仙盟,防止重复)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCHurtManager.py |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCHurtManager.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCHurtManager.py
index 9482636..73a3458 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCHurtManager.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCHurtManager.py
@@ -779,6 +779,7 @@
                     overDict = {FBCommon.Over_isAssist:1, FBCommon.Over_money:FBCommon.GetJsonMoneyList({assistMoneyType:addAssistMoney}),
                                 FBCommon.Over_itemInfo:[]}
                     FBCommon.NotifyFBOver(assistPlayer, mapID, PlayerControl.GetFBFuncLineID(assistPlayer), 1, overDict)
+                    assistPlayer.Sync_TimeTick(IPY_GameWorld.tttLeaveMap, 0, 10000, True)
                     
                 if noAssistPlayer:
                     todayGiftCount = assistPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GetThanksGiftCount % liheItemID)
@@ -886,9 +887,17 @@
 def OnPlayerLeaveMap(curPlayer):
     ## 玩家离开地图处理
     
+    mapID = curPlayer.GetMapID()
+    mapType = GameWorld.GetMap().GetMapFBType()
+    changeMapID = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ChangeMapID)
+    changeLineID = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ChangeLineID)
+    
     playerID = curPlayer.GetPlayerID()
     for hurtList in PyGameData.g_npcHurtDict.values():
         if hurtList.IsNoAssistPlayer(playerID) or hurtList.IsAssistPlayer(playerID):
+            if mapType == IPY_GameWorld.fbtNull and mapID == changeMapID and changeLineID == hurtList.lineID:
+                #GameWorld.DebugLog("玩家同地图切线,当前伤血lineID为目标线路,不清伤血!changeLineID=%s" % changeLineID, playerID)
+                continue
             GameWorld.DebugLog("玩家离开地图, 删除boss伤血玩家!npcID=%s" % (hurtList.npcID), playerID)
             hurtList.DelHurtPlayer(playerID, "LeaveMap")
             break
@@ -924,11 +933,19 @@
     defendHurtList.Clear()
     return
 
+def GetBossLineID(npcID):
+    sealDemonIpyData = IpyGameDataPY.GetIpyGameDataNotLog("SealDemon", npcID)
+    if sealDemonIpyData:
+        lineID = sealDemonIpyData.GetLineID()
+    else:
+        lineID = GameWorld.GetGameWorld().GetLineID()
+    return lineID
+
 def DeletePlayerHurtList(curNPC):
     ## 删除伤血列表
-    lineID = GameWorld.GetGameWorld().GetLineID()
     objID = curNPC.GetID()
     npcID = curNPC.GetNPCID()
+    lineID = GetBossLineID(npcID)
     key = (lineID, objID, npcID)
     if key in PyGameData.g_npcHurtDict:
         hurtList =PyGameData.g_npcHurtDict.pop(key)
@@ -938,9 +955,9 @@
 
 def GetPlayerHurtList(curNPC):
     ## 获取伤血列表,可能为None
-    lineID = GameWorld.GetGameWorld().GetLineID()
     objID = curNPC.GetID()
     npcID = curNPC.GetNPCID()
+    lineID = GetBossLineID(npcID)
     return GetPlayerHurtListEx(lineID, objID, npcID)
 def GetPlayerHurtListEx(lineID, objID, npcID):
     ## 获取伤血列表,可能为None

--
Gitblit v1.8.0