xdh
2018-11-12 297de92ab4234a2ec6c84a0b93861a41bc71d1b3
4631 【后端】【1.3.0】上古战场增加机器人投放、分线逻辑优化
6个文件已修改
325 ■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/NormalNPC_Attack_Player.py 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ElderBattlefield.py 257 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/NormalNPC_Attack_Player.py
@@ -22,7 +22,7 @@
import ChEquip
import GameWorld
import EventShell
import SkillShell
import FBLogic
import GameObj
import NPCCommon
import ChNPC
@@ -113,11 +113,14 @@
    else:
        #通知玩家
        if curTagPlayer.GetMapID() != ChConfig.Def_FBMapID_XMZZ:
            if curNormalNPC.GetType() == ChConfig.ntRobot:
                PlayerControl.NotifyCode(curTagPlayer, 'RobotKill_1', [curNormalNPC.GetObjID(), curNormalNPC.GetNPCID()])
            else:
            PlayerControl.NotifyCode(curTagPlayer, 'GeRen_chenxin_279029', [curNormalNPC.GetNPCID()])
        #玩家已经死亡
        playerControl = PlayerControl.PlayerControl(curTagPlayer)
        playerControl.SetDead()
        FBLogic.DoFBOnNPCKill_Player(curNormalNPC, curTagPlayer, tick)
        #触发玩家死亡事件
        EventShell.EventRespons_PlayerEvent(curTagPlayer, "player_dead")
    return True
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -1798,7 +1798,7 @@
Def_NoPlayerNeedProcessRefreshPointMap = [Def_FBMapID_SealDemon, Def_FBMapID_GodArea, Def_FBMapID_BossHome]
# 可重复进的副本
Def_NoLimitEnterCntMap = [Def_FBMapID_FamilyParty, Def_FBMapID_FamilyWar, Def_FBMapID_FamilyInvade]
Def_NoLimitEnterCntMap = [Def_FBMapID_FamilyParty, Def_FBMapID_FamilyWar, Def_FBMapID_FamilyInvade, Def_FBMapID_ElderBattlefield]
# 无玩家时不自动关闭的自伸缩副本
Def_NoPlayerNotCloseAutoSizeMap = [Def_FBMapID_FamilyInvade, Def_FBMapID_FamilyBossMap]
@@ -4938,8 +4938,9 @@
ntPet,
ntTouchKill, #触碰后自杀类 17
ntUndeath, #不死类型 18
ntRobot, #上古战场机器人类型 19
ntMax
) = range(20)
) = range(21)
(Def_SkillFuncType_Common, #0为通用技能
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
@@ -355,6 +355,16 @@
    
    return
def DoFBOnNPCKill_Player(curNPC, curPlayer, tick):
    ## 副本内NPC杀人
    do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
    callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "DoFBOnNPCKill_Player"))
    if callFunc:
        #GameWorld.Log("副本逻辑不可使用   GameLogic_%d"%(mapID))
        return  callFunc(curNPC, curPlayer, tick)
    return
#---------------------------------------------------------------------
## 任务专用,触发事件(副本内攻击人)
#  @param curPlayer 攻击者
@@ -1897,14 +1907,14 @@
#  @param mapID 玩家
#  @param tick 当前时间
#  @return None-未找到,线路id - 0~N
def GetFBLineMaxPlayerCount(mapID):
def GetFBLineMaxPlayerCount(mapID, lineID):
    
    do_FBLogic_ID = __GetFBLogic_MapID(mapID)
    
    callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "GetFBLineMaxPlayerCount"))
    
    if callFunc:
        return callFunc()
        return callFunc(lineID)
    
    return 0
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_ElderBattlefield.py
@@ -34,6 +34,7 @@
import NPCCustomRefresh
import SkillShell
import EventReport
import SkillCommon
import random
import time
@@ -41,20 +42,25 @@
#------------------------------------------------------------------------------
#
# 副本玩家字典key
FBPlayerDict_Score = 'FBPD_Score%s'   # 玩家当前积分
FBPlayerDict_KillCnt = 'FBPD_KillCnt'   # 玩家当前杀敌数
FBPD_LastCheckTick = 'FBPD_LastCheckTick'   # 检查刷怪时间
FBPD_LastCheckTick = 'FBPD_LastCheckTick'  # 检查刷buff时间
FBPD_LastCheckTick1 = 'FBPD_LastCheckTick1'  # 检查刷机器人时间
FBPlayerDict_ContKillCntEx = 'FBPD_ContKillCntEx'   # 玩家当前总连杀数
FBPlayerDict_TotalExp = 'FBPlayerDict_TotalExp%s'   # 获得的总经验
FBPlayerDict_TotalExpPoint = 'FBPlayerDict_TotalExpPoint%s'   # 获得的总经验点
FBPlayerDict_EnemyID = 'FBPD_EnemyID'   # 玩家最近一个仇敌ID
FBPlayerDict_RebornBuffLV = 'RebornBuffLV'  # 玩家当前复活BUFFLV
Map_ElderBattlefield_StartTick = "Map_ElderBattlefield_StartTick"     # 副本开始时间
Map_ElderBattlefield_TopPlayer = "Map_ElderBattlefield_TopPlayer"     # 积分王
#
(
Def_PlayerCnt,  # 真人数量
Def_RobotCnt,  # 机器人最大数量
Def_TotalCnt,  # 真人+机器人总和
) = range(3)
#当前副本地图的状态
(
@@ -63,22 +69,26 @@
FB_Step_Over, # 副本结束
) = range(3)
def OnLogin(curPlayer):
    OnElderBattlefieldFBResult(curPlayer, True)
    return
def OnElderBattlefieldStateChange(state, tick):
    #活动状态变更
    mapID = GameWorld.GetMap().GetMapID()
    if mapID != ChConfig.Def_FBMapID_ElderBattlefield:
        return
#    mapID = GameWorld.GetMap().GetMapID()
#    if mapID != ChConfig.Def_FBMapID_ElderBattlefield:
#        return
    GameWorld.DebugLog('    上古战场活动状态变更 state=%s' % state)
    if state == 1:
        GameWorld.GetGameWorld().SetGameWorldDict(Map_ElderBattlefield_StartTick, tick)
        GameWorld.GetGameWorld().SetGameWorldDict(Map_ElderBattlefield_TopPlayer, 0)
#    else:
#        GiveJoinPrize()
#        FBCommon.DoLogic_FBKickAllPlayer()
#        GameWorldProcess.CloseFB(tick)
    else:
        GiveJoinPrize()
    return
##开启副本
# @param tick 时间戳
@@ -115,6 +125,7 @@
    return True
##是否可以进入
# @param ask 请求结构体
# @param tick 时间戳
@@ -124,6 +135,7 @@
    
    #可进入
    return IPY_GameWorld.cmeAccept
##玩家进入副本
# @param curPlayer 玩家实例
@@ -146,7 +158,7 @@
    
    if not FBCommon.GetHadDelTicket(curPlayer):
        FBCommon.SetHadDelTicket(curPlayer)
        FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_ElderBattlefield)
        if FBCommon.AddEnterFBCount(curPlayer, ChConfig.Def_FBMapID_ElderBattlefield):
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_ElderBattlefieldStage, 0)
        GameWorld.GetGameWorld().SetGameWorldDict(FBPlayerDict_Score % playerID, 0)
        GameWorld.GetGameWorld().SetGameWorldDict(FBPlayerDict_TotalExp % playerID, 0)
@@ -155,7 +167,6 @@
    
    DoFBHelp(curPlayer, tick)
    return
##副本玩家进入点, 玩家分散在半径3格范围
@@ -168,6 +179,7 @@
def OnGetFBEnterPos(curPlayer, mapID, lineId, ipyEnterPosInfo, tick):
    return random.choice(ipyEnterPosInfo)
## 获取层随机坐标点
def __GetRandPos():
    ipyEnterPosInfo = FBCommon.GetFBLineEnterPosInfo(ChConfig.Def_FBMapID_ElderBattlefield, 0)
@@ -175,6 +187,7 @@
    dist = 3 if len(enterPos) <= 2 else enterPos[2]
    posPoint = GameMap.GetEmptyPlaceInArea(enterPos[0], enterPos[1], dist)
    return posPoint.GetPosX(), posPoint.GetPosY()
##玩家退出副本
# @param curPlayer 玩家实例
@@ -184,21 +197,30 @@
    buffIDList = IpyGameDataPY.GetFuncEvalCfg('ElderBattlefieldBuff')
    for buffID in buffIDList:
        BuffSkill.DelBuffBySkillID(curPlayer, buffID, tick)
    return
##玩家主动离开副本.
# @param curPlayer 玩家实例
# @param tick 时间戳
# @return 返回值无意义
def DoPlayerLeaveFB(curPlayer, tick):
    OnElderBattlefieldFBResult(curPlayer)
    return
##玩家切换地图
def DoPlayerChangeMapLogic(curPlayer):
    OnElderBattlefieldFBResult(curPlayer)
    #副本的连杀,仇敌,死亡BUFF重置,积分不重置
    playerID = curPlayer.GetID()
    gameFB = GameWorld.GetGameFB()
    gameFB.SetPlayerGameFBDict(playerID, FBPlayerDict_ContKillCntEx, 0)
    gameFB.SetPlayerGameFBDict(playerID, FBPlayerDict_EnemyID, 0)
    return
##副本总逻辑计时器
# @param tick 时间戳
@@ -212,13 +234,25 @@
            FBCommon.SetFBStep(FB_Step_Fighting, tick)
    elif fbStep == FB_Step_Fighting:
        if not FBCommon.GetFBFuncOpenState(ChConfig.Def_FBMapID_ElderBattlefield):
            GiveJoinPrize()
            #GiveJoinPrize()
            #积分王
            topPlayerID = GameWorld.GetGameWorld().GetGameWorldDictByKey(Map_ElderBattlefield_TopPlayer)
            if topPlayerID:
                topAwardList = IpyGameDataPY.GetFuncEvalCfg('ElderBattlefieldTopAward')
                if topAwardList:
                    PlayerControl.SendMailByKey("ElderBattlefieldTopMail", [topPlayerID], topAwardList)
                    PlayerControl.WorldNotify(0, 'ElderBattlefieldBest', [PyGameData.g_sgzztopPlayerName, topAwardList[0][0]])
                GameWorld.GetGameWorld().SetGameWorldDict(Map_ElderBattlefield_TopPlayer, 0)
            FBCommon.SetFBStep(FB_Step_Over, tick)
            FBCommon.DoLogic_FBKickAllPlayer()
            GameWorldProcess.CloseFB(tick)
        else:
            __CheckRefreshBuffNPC(tick)
            __RefreshRobot(tick)
    return
def __CheckRefreshBuffNPC(tick):
    #检查buffnpc刷怪
@@ -235,7 +269,7 @@
    rmarkList = [] #可刷怪的标识点
    npcCnt = 0
    gameNPC = GameWorld.GetNPCManager()
    for i in range(0, gameNPC.GetCustomNPCRefreshCount()):
    for i in xrange(gameNPC.GetCustomNPCRefreshCount()):
        npcRefresh = gameNPC.GetCustomNPCRefreshAt(i)
        rmark = npcRefresh.GetRefreshMark()
        if rmark not in allRmark:
@@ -243,7 +277,6 @@
        npcCnt += npcRefresh.GetCount()
        if not npcRefresh.GetCount():
            rmarkList.append(rmark)
    
    needAddCnt = maxCnt- npcCnt
    if not needAddCnt:
@@ -257,33 +290,84 @@
    return
def __RefreshRobot(tick):
    ##刷新机器人
    gameFB = GameWorld.GetGameFB()
    lastCheckTick = gameFB.GetGameFBDictByKey(FBPD_LastCheckTick1)
    if lastCheckTick and tick - lastCheckTick < 2000:
        return
    gameFB.SetGameFBDict(FBPD_LastCheckTick1, tick)
    fblineid = GameWorld.GetGameWorld().GetLineID()
    g_elderBattleRobotDieList = PyGameData.g_elderBattleRobotDieDict.get(fblineid, [])
    robotCfgDict = IpyGameDataPY.GetFuncEvalCfg('ElderBattlefieldCfg', 3, {})
    lineID = GameWorld.GetGameWorld().GetPropertyID() - 1
    if lineID not in robotCfgDict:
        return
    rmarkList = IpyGameDataPY.GetFuncEvalCfg('ElderBattlefieldRobot', 5)
    curNPCCnt = 0
    robotCntDict = {}
    gameNPC = GameWorld.GetNPCManager()
    for i in xrange(gameNPC.GetCustomNPCRefreshCount()):
        npcRefresh = gameNPC.GetCustomNPCRefreshAt(i)
        rmark = npcRefresh.GetRefreshMark()
        if rmark not in rmarkList:
            continue
        cnt = npcRefresh.GetCount()
        robotCntDict[rmark] = cnt
        curNPCCnt += cnt
    robotCfg = robotCfgDict[lineID]
    curPlayerCnt = GameWorld.GetMapCopyPlayerManager().GetPlayerCount()
    maxRobotCnt = min(robotCfg[Def_TotalCnt] - curPlayerCnt, robotCfg[Def_RobotCnt])
    extraCnt = maxRobotCnt - curNPCCnt - len(g_elderBattleRobotDieList)
    rebornTime = IpyGameDataPY.GetFuncCfg('ElderBattlefieldRobot')
    rebornCnt = 0
    for dieTick in g_elderBattleRobotDieList:
        if tick - dieTick < rebornTime * 1000:
            break
        rebornCnt += 1
    PyGameData.g_elderBattleRobotDieDict[fblineid] = g_elderBattleRobotDieList[rebornCnt:]
    refreshCnt = rebornCnt + extraCnt
    #GameWorld.DebugLog('    刷新机器人 rebornCnt=%s,extraCnt=%s,refreshCnt=%s,robotCntDict=%s'%(rebornCnt, extraCnt,refreshCnt,robotCntDict))
    if refreshCnt > 0:
        npcID = IpyGameDataPY.GetFuncEvalCfg('ElderBattlefieldRobot', 2, {}).get(lineID, 0)
        if not npcID:
            return
        random.shuffle(rmarkList)
        hasRefreshCnt = 0
        for i, rMark in enumerate(rmarkList):
            if hasRefreshCnt >=refreshCnt:
                break
            curCnt = robotCntDict.get(rMark, 0)
            cnt = 1 if i < len(rmarkList)-1 else refreshCnt-hasRefreshCnt
            hasRefreshCnt += cnt
            curMaxCnt = curCnt+cnt
            NPCCustomRefresh.SetNPCRefresh(rMark, [(npcID, cnt)], curMaxCnt, cnt)
        NPCCustomRefresh.ProcessAllNPCRefresh(tick)
    return
##战斗逻辑
# @param tick  时钟
# @return 无意义
# @remarks 战斗逻辑
def GiveJoinPrize():
    copyMapPlayerManager = GameWorld.GetMapCopyPlayerManager()
    for i in xrange(copyMapPlayerManager.GetPlayerCount()):
        curPlayer = copyMapPlayerManager.GetPlayerByIndex(i)
        if curPlayer == None or curPlayer.IsEmpty():
    playerManager = GameWorld.GetPlayerManager()
    for i in xrange(playerManager.GetPlayerCount()):
        curPlayer = playerManager.GetPlayerByIndex(i)
        if curPlayer == None or not curPlayer.GetInitOK():
            continue
        OnElderBattlefieldFBResult(curPlayer)
        
    #积分王
    topPlayerID = GameWorld.GetGameWorld().GetGameWorldDictByKey(Map_ElderBattlefield_TopPlayer)
    if topPlayerID:
        topAwardList = IpyGameDataPY.GetFuncEvalCfg('ElderBattlefieldTopAward')
        if topAwardList:
            PlayerControl.SendMailByKey("ElderBattlefieldTopMail", [topPlayerID], topAwardList)
            PlayerControl.WorldNotify(0, 'ElderBattlefieldBest', [PyGameData.g_sgzztopPlayerName, topAwardList[0][0]])
        GameWorld.GetGameWorld().SetGameWorldDict(Map_ElderBattlefield_TopPlayer, 0)
    return
def OnElderBattlefieldFBResult(curPlayer):
def OnElderBattlefieldFBResult(curPlayer, isLogin=False):
    # 玩家处理上古战场结算信息
    GameWorld.DebugLog('    玩家处理上古战场结算信息 %s' % curPlayer.GetPlayerID())
    GameWorld.DebugLog('    玩家处理上古战场结算信息 , isLogin=%s' % isLogin, curPlayer.GetPlayerID())
    lineID = 0 #GameWorld.GetGameWorld().GetPropertyID() -1
    fbRewardDict = FBCommon.GetFBLineReward(ChConfig.Def_FBMapID_ElderBattlefield, lineID)
    
@@ -298,20 +382,20 @@
        rewardItemList.append([itemID, itemCnt, 1])
    for itemID, itemCnt in succAwardDict.items():
        rewardItemList.append([itemID, itemCnt, 1])
    needSpace = len(rewardItemList)
    emptySpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, needSpace)
    if emptySpace < needSpace:
    mapID = GameWorld.GetMap().GetMapID()
    if mapID != ChConfig.Def_FBMapID_ElderBattlefield or isLogin or emptySpace < needSpace:
        PlayerControl.SendMailByKey("ElderBattlefieldMail", [curPlayer.GetPlayerID()], rewardItemList)
    else:
        for itemID, itemCnt, isBind in rewardItemList:
            ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem], event=["ElderBattlefield", False, {}])
    overDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(itemList), FBCommon.Over_succItemInfo:FBCommon.GetJsonItemList(succAwardDict.items())}
    FBCommon.NotifyFBOver(curPlayer, ChConfig.Def_FBMapID_ElderBattlefield, lineID, 1, overDict)
    #结算过,重置阶段
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_ElderBattlefieldStage, 0)
    return
def __AddElderBattlefieldPlayerScore(curPlayer, gameFB, addValue):
@@ -367,6 +451,7 @@
#---------------------------------------------------------------------
##获得副本帮助信息, 用于通知阵营比分条
# @param curPlayer 玩家实例
# @param tick 时间戳
@@ -397,6 +482,10 @@
    FBCommon.Notify_FBHelp(curPlayer, helpDict)
    return
def DoFBOnNPCKill_Player(curNPC, curPlayer, tick):
    if curNPC.GetNPCID() in IpyGameDataPY.GetFuncEvalCfg('ElderBattlefieldRobot', 2, {}).values():
        DoFBOnKill_Player(curNPC, curPlayer, tick)
    return
##处理副本中杀死玩家逻辑
# @param curPlayer 玩家实例
@@ -404,9 +493,12 @@
# @param tick 时间戳
# @return 布尔值
# @remarks 处理副本中杀死玩家逻辑
def DoFBOnKill_Player(curPlayer, defender, tick):
def DoFBOnKill_Player(atkobj, defender, tick):
    gameFB = GameWorld.GetGameFB()
    playerID = curPlayer.GetPlayerID()
    atkIsPlayer = atkobj.GetGameObjType() == IPY_GameWorld.gotPlayer
    addScore = 0
    if atkIsPlayer:
        playerID = atkobj.GetPlayerID()
    GameWorld.DebugLog("DoFBOnKill_Player", playerID)
    
    # 击杀方处理
@@ -420,41 +512,46 @@
    perCnt = IpyGameDataPY.GetFuncCfg('ElderBattlefieldSys', 3)
    if contKillCntEx >= baseCnt and contKillCntEx % perCnt == 0:
        sysIndex = min((contKillCntEx - baseCnt) / perCnt, len(ckillSysList)-1)
        PlayerControl.FBNotify(ckillSysList[sysIndex], [curPlayer.GetName(), contKillCntEx])
        PlayerControl.NotifyCode(curPlayer, 'AncientBattlefield_10', [contKillCntEx])
            PlayerControl.FBNotify(ckillSysList[sysIndex], [atkobj.GetName(), contKillCntEx])
            PlayerControl.NotifyCode(atkobj, 'AncientBattlefield_10', [contKillCntEx])
    if contKillCntEx == 5:
        PlayerControl.NotifyCode(curPlayer, 'AncientBattlefield_10', [5])
            PlayerControl.NotifyCode(atkobj, 'AncientBattlefield_10', [5])
  
    # 击杀方成就
    PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_ElderBattlefieldKill, 1)
    PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_ElderBattlefieldConKill, 1, [contKillCntEx])
    # 被杀方处理
    tagPlayerID = defender.GetPlayerID()
    defContKillCntEx = gameFB.GetPlayerGameFBDictByKey(tagPlayerID, FBPlayerDict_ContKillCntEx)
    if defContKillCntEx >=baseCnt:
        PlayerControl.FBNotify('AncientBattlefield_7', [curPlayer.GetName(), defender.GetName(),defContKillCntEx])
    gameFB.SetPlayerGameFBDict(tagPlayerID, FBPlayerDict_ContKillCntEx, 0)
        PlayerSuccess.DoAddSuccessProgress(atkobj, ShareDefine.SuccType_ElderBattlefieldKill, 1)
        PlayerSuccess.DoAddSuccessProgress(atkobj, ShareDefine.SuccType_ElderBattlefieldConKill, 1, [contKillCntEx])
    
    addScore = IpyGameDataPY.GetFuncCfg('ElderBattlefieldCfg', 2)
    
    # 被杀方处理
    tagPlayerID = 0
    if defender.GetGameObjType() == IPY_GameWorld.gotPlayer:
        tagPlayerID = defender.GetPlayerID()
        defContKillCntEx = gameFB.GetPlayerGameFBDictByKey(tagPlayerID, FBPlayerDict_ContKillCntEx)
        if defContKillCntEx >= baseCnt:
            if atkIsPlayer:
                PlayerControl.FBNotify('AncientBattlefield_7', [atkobj.GetName(), defender.GetName(), defContKillCntEx])
            else:
                PlayerControl.FBNotify('AncientBattlefield_robot', [atkobj.GetNPCID(), atkobj.GetObjID(), defender.GetName(), defContKillCntEx])
        gameFB.SetPlayerGameFBDict(tagPlayerID, FBPlayerDict_ContKillCntEx, 0)
    #记录仇人
        if atkIsPlayer:
    gameFB.SetPlayerGameFBDict(tagPlayerID, FBPlayerDict_EnemyID, playerID)
    if tagPlayerID == gameFB.GetPlayerGameFBDictByKey(playerID, FBPlayerDict_EnemyID):
        #击杀仇人广播
        PlayerControl.NotifyCode(curPlayer, 'AncientBattlefield_8')
                PlayerControl.NotifyCode(atkobj, 'AncientBattlefield_8')
        gameFB.SetPlayerGameFBDict(playerID, FBPlayerDict_EnemyID, 0)
        addScore += IpyGameDataPY.GetFuncCfg('ElderBattlefieldPoint', 2)
    if tagPlayerID == GameWorld.GetGameWorld().GetGameWorldDictByKey(Map_ElderBattlefield_TopPlayer):
        addScore += IpyGameDataPY.GetFuncCfg('ElderBattlefieldPoint', 1)
    updScore = __AddElderBattlefieldPlayerScore(curPlayer, gameFB, addScore)
    if atkIsPlayer:
        updScore = __AddElderBattlefieldPlayerScore(atkobj, gameFB, addScore)
    GameWorld.DebugLog("击杀玩家: 击杀=%s,连杀=%s,tagPlayerID=%s,updScore=%s" 
                       % (killCnt, contKillCntEx, tagPlayerID, updScore), playerID)
    DoFBHelp(curPlayer, tick)
        DoFBHelp(atkobj, tick)
    if defender.GetGameObjType() == IPY_GameWorld.gotPlayer:
    DoFBHelp(defender, tick)
    return True
@@ -469,7 +566,9 @@
    fbStep = gameFB.GetFBStep()
#    if fbStep != FB_State_Fight:
#        return
    if curNPC.GetNPCID() in IpyGameDataPY.GetFuncEvalCfg('ElderBattlefieldRobot', 2, {}).values():
        DoFBOnKill_Player(curPlayer, curNPC, tick)
        __OnRobotDie(tick)
    npcid = curNPC.GetNPCID()
    killNPCScoreDict = IpyGameDataPY.GetFuncEvalCfg('ElderBattlefieldCfg', 1)
    addScore = killNPCScoreDict.get(npcid)
@@ -477,6 +576,20 @@
        return
    __AddElderBattlefieldPlayerScore(curPlayer, gameFB, addScore)
    DoFBHelp(curPlayer, tick)
    return
def DoFB_Npc_KillNPC(attacker, curNPC, tick):
    if curNPC.GetNPCID() in IpyGameDataPY.GetFuncEvalCfg('ElderBattlefieldRobot', 2, {}).values():
        __OnRobotDie(tick)
    return
def __OnRobotDie(tick):
    #记录机器人死亡时间
    lineID = GameWorld.GetGameWorld().GetLineID()
    if lineID in PyGameData.g_elderBattleRobotDieDict:
        PyGameData.g_elderBattleRobotDieDict[lineID].append(tick)
    else:
        PyGameData.g_elderBattleRobotDieDict[lineID] = [tick]
    return
def OnMoveTouchNPC(curPlayer, curNPC, tick):
@@ -505,6 +618,7 @@
def CheckPlayersRelation_IsFriend(curPlayer, curTagPlayer):
    return not CanAttackPlayer(curPlayer, curTagPlayer)
##副本中,攻击队友逻辑
# @param curPlayer 玩家实例
# @param curTagPlayer 目标玩家实例
@@ -512,6 +626,7 @@
# @remarks
def DoCanAttackTeamer(curPlayer, curTagPlayer):
    return CanAttackPlayer(curPlayer, curTagPlayer)
##副本中,是否可攻击
# @param curPlayer 玩家实例
@@ -534,12 +649,29 @@
def OnPlayerReborn():
    return True
## 重置副本复活玩家坐标点
# @param None
# @return 无意义
def OnResetFBRebornPlacePos(curPlayer, rebornPlace, tick):
    __SetPlayerRandomPos(curPlayer)
    #复活加buff
    playerID = curPlayer.GetID()
    rebornBuffLV = GameWorld.GetGameFB().GetPlayerGameFBDictByKey(playerID, FBPlayerDict_RebornBuffLV)
    if rebornBuffLV >= IpyGameDataPY.GetFuncCfg('ElderBattlefieldRobot', 4):
    return
    skillBuffID = IpyGameDataPY.GetFuncCfg('ElderBattlefieldRobot', 3) + rebornBuffLV
    skillBuff = GameWorld.GetGameData().GetSkillBySkillID(skillBuffID)
    if not skillBuff:
        GameWorld.Log("上古复活加buff   找不到技能%s" % skillBuffID)
        return
    GameWorld.GetGameFB().SetPlayerGameFBDict(playerID, FBPlayerDict_RebornBuffLV, rebornBuffLV+1)
    buffType = SkillCommon.GetBuffType(skillBuff)
    BuffSkill.DoAddBuff(curPlayer, buffType, skillBuff, tick)
    return
## 设置玩家随机坐标点
def __SetPlayerRandomPos(curPlayer):
@@ -551,10 +683,11 @@
## 获取副本线路最大玩家人数
#  @param None
#  @return 
def GetFBLineMaxPlayerCount():
    return IpyGameDataPY.GetFuncCfg('ElderBattlefieldCfg', 3)
def GetFBLineMaxPlayerCount(lineID):
    cfg = IpyGameDataPY.GetFuncEvalCfg('ElderBattlefieldCfg', 3, {}).get(lineID)
    if not cfg:
        return 20
    return cfg[Def_PlayerCnt]
## -------------------------------------------------------------------------------------------------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/RemoteQuery/GY_Query_EnterFB.py
@@ -65,25 +65,37 @@
        resultLineID = -1  # 结果lineID
        
        gameWorldManager = GameWorld.GetGameWorld()
        maxPlayerCount = FBLogic.GetFBLineMaxPlayerCount(tagMapID)
        maxPlayerCount = FBLogic.GetFBLineMaxPlayerCount(tagMapID, tagMapLineID)
        
        GameWorld.Log("    DoLogic()  tagMapID=%s,maxPlayerCount=%s" % (tagMapID, maxPlayerCount))
        for index in range(gameWorldManager.GetGameWorldCount()):
        GameWorld.Log("    DoLogic()  tagMapID=%s,tagMapLineID=%s,maxPlayerCount=%s" % (tagMapID, tagMapLineID,maxPlayerCount))
        firstEmptyGameWorld = None
        sameLineGameWorldList = []
        for index in xrange(gameWorldManager.GetGameWorldCount()):
            gameWorld = IPY_GameWorld.IPY_GameWorld(index)
            playerManager = gameWorld.GetMapCopyPlayerManagerByFbIndex(index)
            propertyID = gameWorld.GetPropertyID()
            GameWorld.Log("    DoLogic()  check gameworld index=%s,propertyID=%s,playerCount=%s" \
                          % (index, propertyID, playerManager.GetPlayerCount()))
            curPlayerCnt = playerManager.GetPlayerCount()
#            GameWorld.Log("    DoLogic()  check gameworld index=%s,propertyID=%s,playerCount=%s" \
#                          % (index, propertyID, curPlayerCnt))
            if propertyID == 0 and not firstEmptyGameWorld:
                firstEmptyGameWorld = gameWorld
            # 如果不是同一线路属性的,则跳过
            # 如果当前人数超过额定人数,则跳过
            if propertyID == 0 or (propertyID == tagMapPropertyID \
                                   and playerManager.GetPlayerCount() < maxPlayerCount):
                gameWorld.SetPropertyID(tagMapPropertyID)
                if propertyID == 0:
                    gameWorld.SetFBFirstOpen(1) # 开启副本
                resultLineID = gameWorld.GetLineID()
            if propertyID == tagMapPropertyID and curPlayerCnt < maxPlayerCount:
                sameLineGameWorldList.append([gameWorld, curPlayerCnt])
        findGameWorld = None
        if sameLineGameWorldList:
            sameLineGameWorldList.sort(key=lambda asd:asd[1])
            findGameWorld = sameLineGameWorldList[0][0]
        elif firstEmptyGameWorld:
            findGameWorld = firstEmptyGameWorld
        if findGameWorld:
            if findGameWorld.GetPropertyID() == 0:
                findGameWorld.SetFBFirstOpen(1) # 开启副本
            findGameWorld.SetPropertyID(tagMapPropertyID)
            resultLineID = findGameWorld.GetLineID()
                GameWorld.Log("    DoLogic()  check ok!resultLineID=%s" % (resultLineID))
                break
            
#===================================================================================================
#    # 战盟家园
@@ -137,9 +149,7 @@
        resultLineID = -1  # 结果lineID
        
        gameWorldManager = GameWorld.GetGameWorld()
        maxPlayerCount = FBLogic.GetFBLineMaxPlayerCount(tagMapID)
        GameWorld.Log("    DoLogic()  tagMapID=%s,maxPlayerCount=%s" % (tagMapID, maxPlayerCount))
        GameWorld.Log("    DoLogic()  tagMapID=%s,tagMapLineID=%s" % (tagMapID, tagMapLineID))
        findGameWord = None
        for index in range(gameWorldManager.GetGameWorldCount()):
            gameWorld = IPY_GameWorld.IPY_GameWorld(index)
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/PyGameData.py
@@ -66,3 +66,5 @@
g_npcKillerInfo = {} # NPC击杀者信息 {(lineID, objID, npcID):[killerDict, curTeam, hurtType, hurtID], ...}
g_familyPartyInfo = {} #[ [[familyID, familyName, 答题数量]], top名字,top答题数量]
g_elderBattleRobotDieDict = {} #上古战场机器人死亡时间{lineid:[]}