From c28ebaada1bf77812a102060e48ae79ec8364612 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 13 十二月 2019 16:27:13 +0800
Subject: [PATCH] 8353 【后端】个人BOSS修改(进入次数判断验证,没进入次数时也可以进入未过关过的线路)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ExitFB.py                              |    7 +++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/EnterFB.py                             |    7 ++++++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_PersonalBoss.py |   14 ++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                                        |    3 +++
 4 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index d27acf9..e05b503 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -1800,6 +1800,9 @@
 #跨服仙草园
 Def_FBMapID_CrossGrasslandXian = 32050
 
+#前端自定义场景地图
+ClientCustomScene = [Def_FBMapID_PersonalBoss]
+
 #注册上传跨服服务器数据后直接进入跨服服务器的地图
 RegisterEnter_CrossServerMapIDList = [Def_FBMapID_CrossPenglai, Def_FBMapID_CrossDemonKing, Def_FBMapID_CrossGrasslandLing, Def_FBMapID_CrossGrasslandXian]
 #跨服地图
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/EnterFB.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/EnterFB.py
index a228fff..107a2e5 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/EnterFB.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/EnterFB.py
@@ -19,6 +19,7 @@
 import PlayerControl
 import FBCommon
 import ChConfig
+import PlayerFB
 
 
 ## GM命令执行入口
@@ -37,7 +38,11 @@
     posY = paramList[3] if len(paramList) > 3 else 0
     if FBCommon.GetFBPDictValue(curPlayer, ChConfig.Def_PDict_LastEnterFBTick % mapID):
         FBCommon.SetFBPDictValue(curPlayer, ChConfig.Def_PDict_LastEnterFBTick % mapID, 0)
-    if mapID in ChConfig.Def_CrossMapIDList:
+        
+    tick = GameWorld.GetGameWorld().GetTick()
+    if mapID in ChConfig.ClientCustomScene:
+        PlayerFB.DoEnterCustomScene(curPlayer, mapID, lineID, tick)
+    elif mapID in ChConfig.Def_CrossMapIDList:
         PlayerControl.PlayerEnterCrossServer(curPlayer, mapID, lineID)
     else:
         PlayerControl.PlayerEnterFB(curPlayer, mapID, lineID, posX, posY)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ExitFB.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ExitFB.py
index 3789b02..25bb7fe 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ExitFB.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ExitFB.py
@@ -17,6 +17,8 @@
 
 import GameWorld
 import ChPlayer
+import PlayerControl
+import PlayerFB
 
 ## GM命令执行入口
 #  @param curPlayer 当前玩家
@@ -25,6 +27,11 @@
 #  @remarks 函数详细说明.
 def OnExec(curPlayer, paramList):
     tick = GameWorld.GetGameWorld().GetTick()
+    
+    if PlayerControl.GetCustomMapID(curPlayer):
+        PlayerFB.DoExitCustomScene(curPlayer)
+        return
+    
     isAll = paramList[0] if paramList else 0
     if isAll:
         copyMapPlayerManager = GameWorld.GetMapCopyPlayerManager()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_PersonalBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_PersonalBoss.py
index c7cd828..3412fe5 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_PersonalBoss.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_PersonalBoss.py
@@ -26,6 +26,20 @@
 import NPCCommon
 import ChConfig
 
+## 是否能够通过活动查询进入
+def OnEnterFBEvent(curPlayer, mapID, lineID, tick):
+    curfbStar = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
+    if not curfbStar:
+        #GameWorld.DebugLog("OnEnterFBEvent 首次进入个人boss免费!mapID=%s,lineID=%s" % (mapID, lineID))
+        return True
+    
+    enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID)
+    maxCnt = FBCommon.GetEnterFBMaxCnt(curPlayer, mapID)
+    if enterCnt >= maxCnt:
+        GameWorld.ErrLog("次数不足,无法进入个人boss! mapID=%s,lineID=%s" % (mapID, lineID), curPlayer.GetPlayerID())
+        return False
+    
+    return True
 
 ## 是否需要做进入副本通用检查条件逻辑,默认需要检查
 def OnNeedCheckCanEnterFBComm(curPlayer, mapID, lineID):

--
Gitblit v1.8.0