| | |
| | | # summonList.append(summonNPC)
|
| | | # summonIndex += 1
|
| | |
|
| | | |
| | | changeMapID = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ChangeMapID)
|
| | | # 更新最后一次离开的非中立常规地图, 从中立地图退出时需要回到该地方,必须在 DoResetWorldPosAndClear 之前更新
|
| | | if GameWorld.GetMap().GetMapFBType() == IPY_GameWorld.fbtNull and curPlayer.GetMapID() not in IpyGameDataPY.GetFuncEvalCfg("MapLine", 4):
|
| | | mapID = curPlayer.GetMapID()
|
| | | posX = curPlayer.GetPosX()
|
| | | posY = curPlayer.GetPosY()
|
| | | lineID = curPlayer.GetClientLineID()
|
| | | lineID = curPlayer.GetClientLineID() # 常规地图用分线ID
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FromMapID, mapID)
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FromPosX, posX)
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FromPosY, posY)
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FromLineID, lineID)
|
| | | GameWorld.DebugLog("最后一次离开的非中立常规地图更新!mapID=%s,lineID=%s,Pos(%s,%s)" % (mapID, lineID, posX, posY))
|
| | | else:
|
| | | mapID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FromMapID)
|
| | | posX = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FromPosX)
|
| | | posY = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FromPosY)
|
| | | lineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FromLineID)
|
| | | GameWorld.DebugLog("最后一次离开的非中立常规地图不变!mapID=%s,lineID=%s,Pos(%s,%s)" % (mapID, lineID, posX, posY))
|
| | | # 当前是可返回的副本地图 且 目标地图为副本
|
| | | elif curPlayer.GetMapID() in ChConfig.Def_CanBackFBMap and curPlayer.GetMapID() != changeMapID \
|
| | | and GameWorld.GetMap().GetMapFBTypeByMapID(changeMapID) != IPY_GameWorld.fbtNull:
|
| | | mapID = curPlayer.GetMapID()
|
| | | posX = curPlayer.GetPosX()
|
| | | posY = curPlayer.GetPosY()
|
| | | lineID = GetFBFuncLineID(curPlayer) # 副本用功能线路ID
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FromFBMapID, mapID)
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FromFBPosX, posX)
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FromFBPosY, posY)
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FromFBLineID, lineID)
|
| | | GameWorld.DebugLog("进入副本时,最后一次离开的可返回的副本ID更新!mapID=%s,lineID=%s,Pos(%s,%s)" % (mapID, lineID, posX, posY))
|
| | |
|
| | | # 从副本中切图
|
| | | if GameWorld.GetMap().GetMapFBType() != IPY_GameWorld.fbtNull:
|
| | |
| | | if GameWorld.IsCrossServer():
|
| | | CrossRealmPlayer.PlayerExitCrossServer(curPlayer)
|
| | | return
|
| | |
|
| | | |
| | | funcLineID = 0
|
| | | enterFBFree = False
|
| | | #中立地图回到上一次非中立常规地图
|
| | | if curPlayer.GetMapID() in IpyGameDataPY.GetFuncEvalCfg("MapLine", 4):
|
| | | if curPlayer.GetMapID() in IpyGameDataPY.GetFuncEvalCfg("MapLine", 4) or curPlayer.GetMapID() in ChConfig.Def_CanBackFBMap:
|
| | | mapID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FromMapID)
|
| | | posX = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FromPosX)
|
| | | posY = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FromPosY)
|
| | | lineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FromLineID)
|
| | | # 重置
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FromMapID, 0)
|
| | | # 老号支持,本来就在中立地图的,返回新手村
|
| | | if not mapID:
|
| | | # {ְҵ:[dataMapID,posX,posY], ...}
|
| | |
| | | mapID, posX, posY = mapInfoList[0]
|
| | | #离开副本
|
| | | else:
|
| | | mapID = curPlayer.GetFromMapID()
|
| | | posX = curPlayer.GetFromPosX()
|
| | | posY = curPlayer.GetFromPosY()
|
| | | lineID = curPlayer.GetFromLineID()
|
| | | |
| | | fromFBMapID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FromFBMapID)
|
| | | # 回到上一次可返回的副本里
|
| | | if fromFBMapID:
|
| | | mapID = fromFBMapID
|
| | | posX = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FromFBPosX)
|
| | | posY = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FromFBPosY)
|
| | | lineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FromFBLineID)
|
| | | funcLineID = lineID # 回副本的要指定功能线路ID
|
| | | enterFBFree = True # 返回的免费进入
|
| | | # 重置
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FromFBMapID, 0)
|
| | | GameWorld.DebugLog("离开副本,返回可之前可返回的副本! fromFBMapID=%s,lineID=%s,posXY(%s,%s)" % (mapID, lineID, posX, posY))
|
| | | else:
|
| | | mapID = curPlayer.GetFromMapID()
|
| | | posX = curPlayer.GetFromPosX()
|
| | | posY = curPlayer.GetFromPosY()
|
| | | lineID = curPlayer.GetFromLineID()
|
| | | |
| | | if mapID == curPlayer.GetMapID():
|
| | | # 如果在同一张地图, 取DB重生点, 普通地图下线重上时FromMapID会被设置为本地图
|
| | | gameMap = GameWorld.GetMap()
|
| | |
| | | # ChangePlayerAction(curPlayer, IPY_GameWorld.paNull)
|
| | | #===============================================================================================
|
| | |
|
| | | PlayerResetWorldPosFB(curPlayer, mapID, posX, posY, False, lineID)
|
| | | PlayerResetWorldPosFB(curPlayer, mapID, posX, posY, False, lineID, funcLineID=funcLineID, enterFBFree=enterFBFree)
|
| | |
|
| | | #在空闲或者移动状态下,才能锁死玩家
|
| | | if curPlayer.GetPlayerAction() in [IPY_GameWorld.paNull] or curPlayer.IsMoving():
|
| | |
| | | curMapID = GameWorld.GetMap().GetMapID()
|
| | | if curMapID in fbEnableTransportMap and mapID in fbEnableTransportMap[curMapID]:
|
| | | canFBMoveToOther = True
|
| | | if curMapID == ChConfig.Def_FBMapID_BossHome:
|
| | | if curMapID in ChConfig.Def_CanBackFBMap:
|
| | | canFBMoveToOther = True
|
| | | toMapFBType = GameWorld.GetMap().GetMapFBTypeByMapID(mapID)
|
| | | if toMapFBType == IPY_GameWorld.fbtNull:
|
| | |
| | | # @param funcLineID 副本功能线路ID,由前端请求
|
| | | # @return 返回值无意义
|
| | | # @remarks 玩家切换到指定副本ID
|
| | | def PlayerResetWorldPosFB(curPlayer, mapID, posX, posY, takeTruck, fbID=0, msg='', canLock=True, funcLineID=0):
|
| | | def PlayerResetWorldPosFB(curPlayer, mapID, posX, posY, takeTruck, fbID=0, msg='', canLock=True, funcLineID=0, enterFBFree=False):
|
| | | '''
|
| | | 参数说明:
|
| | | @param fbID:
|
| | |
| | | msg = FBLogic.GetPlayerResetWorldPosFBMsg(curPlayer, mapID, funcLineID)
|
| | |
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_ReqFBFuncLine, funcLineID)
|
| | | |
| | | GameWorld.Log("玩家请求开始切图: sceneMapID=%s,posX=%s,posY=%s,takeTruck=%s,fbID=%s,msg=%s,funcLineID=%s,tick=%s,lastTransTick=%s"
|
| | | % (sceneMapID, posX, posY, takeTruck, fbID, msg, funcLineID, tick, lastTransTick), curPlayer.GetPlayerID())
|
| | | if enterFBFree:
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_EnterFBFree, 1)
|
| | | GameWorld.DebugLog(" 本次免费进入副本!")
|
| | | curPlayer.ResetWorldPosReq(sceneMapID, posX, posY, takeTruck, fbID, msg)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ChangeMapID, sceneMapID)
|
| | |
|