ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossGrassland.py
@@ -14,3 +14,72 @@
#-------------------------------------------------------------------------------
#"""Version = 2019-04-15 16:30"""
#-------------------------------------------------------------------------------
import GameWorld
import GameWorldProcess
import NPCCustomRefresh
import PyGameData
def OnEnterFBEvent(curPlayer, mapID, lineID, tick):
    return True
## 开启副本
def OnOpenFB(tick):
    gameWorld = GameWorld.GetGameWorld()
    realMapID, copyMapID = gameWorld.GetRealMapID(), gameWorld.GetCopyMapID()
    key = (realMapID, copyMapID)
    if key in PyGameData.g_crossFuncLineDataCache:
        refreshNPCInfo = PyGameData.g_crossFuncLineDataCache[key]
        GameWorld.DebugLog("副本开启根据保存的虚拟线路标试点刷怪信息刷怪: realMapID=%s,copyMapID=%s,refreshNPCInfo=%s" % (realMapID, copyMapID, refreshNPCInfo))
        NPCCustomRefresh.OnFBOpenSetRandomRefreshNPCInfo(refreshNPCInfo, tick)
    return
def GetCurFBFuncLineID():
    ## 获取本线路功能线路ID
    return GameWorld.GetGameWorld().GetPropertyID() % 10000 / 10
def GetCurFBLineZoneID():
    ## 获取本线路所属跨服分区
    return GameWorld.GetGameWorld().GetPropertyID() / 10000
## 进副本
def DoEnterFB(curPlayer, tick):
    playerID = curPlayer.GetPlayerID()
    zoneID = GetCurFBLineZoneID()
    funcLineID = GetCurFBFuncLineID()
    GameWorld.Log("DoEnterFB zoneID=%s,funcLineID=%s" % (zoneID, funcLineID), playerID)
    return
## 副本总逻辑计时器
def OnProcess(tick):
    #gameFB = GameWorld.GetGameFB()
    return
## 关闭副本
def OnCloseFB(tick):
    gameWorld = GameWorld.GetGameWorld()
    refreshNPCInfo = NPCCustomRefresh.GetCopyMapRandomRefreshNPCInfo()
    if refreshNPCInfo:
        realMapID, copyMapID = gameWorld.GetRealMapID(), gameWorld.GetCopyMapID()
        key = (realMapID, copyMapID)
        PyGameData.g_crossFuncLineDataCache[key] = refreshNPCInfo
        GameWorld.DebugLog("缓存虚拟线路标试点刷怪信息: realMapID=%s,copyMapID=%s,refreshNPCInfo=%s" % (realMapID, copyMapID, refreshNPCInfo))
    GameWorld.GetGameWorld().SetPropertyID(0)
    return
## 玩家退出副本
def DoExitFB(curPlayer, tick):
    return
##玩家主动离开副本.
def DoPlayerLeaveFB(curPlayer, tick):
    gameWorld = GameWorld.GetGameWorld()
    #最后一人退出副本则关闭地图
    if gameWorld.GetMapCopyPlayerManager().GetPlayerCount() == 1:
        GameWorldProcess.CloseFB(tick)
    return