9415 【BT】【后端】古神战场(战斗开始增加分配阵营广播;战斗阶段退出重进坐标默认分配到本阵营安全区;水晶NPCID配置key改为字符串)
1个文件已修改
21 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py
@@ -482,7 +482,7 @@
def GetBFStepTime(): return IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldFB", 1) # 阶段时间
def GetCrystalNPCIDList(): # 水晶资源NPCID列表
    crystalNPCIDPosDict = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldCrystal", 1, {})
    return crystalNPCIDPosDict.keys()
    return [int(npcID) for npcID in crystalNPCIDPosDict.keys()]
def GetGuardNPCIDList(): return IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldGuard", 1) # 守卫NPCID列表
def GetPersonBuffIDList(): return IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldPersonBuff", 1) # 个人buffID列表
def GetFactionBuffIDList(): return IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldFactionBuff", 1) # 阵营buffID列表
@@ -512,7 +512,7 @@
    # 刷水晶
    crystalNPCIDPosDict = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldCrystal", 1, {})
    for npcID, posInfo in crystalNPCIDPosDict.items():
        NPCCommon.SummonMapNpc(npcID, posInfo[0], posInfo[1])
        NPCCommon.SummonMapNpc(int(npcID), posInfo[0], posInfo[1])
        
    # 刷守卫
    rebornGurad()
@@ -754,6 +754,7 @@
        allotPlayerFaction(playerID, fightPower, curPlayer, fbStep, tick)
        
    FBCommon.NotifyCopyMapPlayerFBHelp(tick, DoFBHelp, 0, refreshCrossBattlefield)
    PlayerControl.FBNotify("CrossBattlefieldStartFighting")
    return
def allotPlayerFaction(playerID, fightPower, curPlayer, allotStep, tick):
@@ -814,8 +815,8 @@
        
    if curPlayer:
        curPlayer.SetFaction(faction)
        if isAllot:
            __RandFactionRebornArea(curPlayer)
        #if isAllot:
        __RandFactionRebornArea(curPlayer, False)
            
    return
@@ -857,10 +858,10 @@
    __RandFactionRebornArea(curPlayer)
    return
def __RandFactionRebornArea(curPlayer):
def __RandFactionRebornArea(curPlayer, includeCrystal=True):
    ## 随机阵营复活点: 营地 + 已占领的资源点  随机
    faction = curPlayer.GetFaction()      
    posInfo = getRandFactionRebornPos(faction)
    posInfo = getRandFactionRebornPos(faction, includeCrystal)
    if posInfo:
        posX, posY = posInfo
    else:
@@ -868,21 +869,23 @@
    curPlayer.ResetPos(posX, posY)
    return
def getRandFactionRebornPos(faction):
def getRandFactionRebornPos(faction, includeCrystal=True):
    rebornPosList = []    
    factionSafeAreaRandPosList = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldFB", 3)
    if faction and faction <= len(factionSafeAreaRandPosList):
        safePosX, safePosY, _ = factionSafeAreaRandPosList[faction - 1]
        rebornPosList.append([safePosX, safePosY, 3])
        
    # 包含占领的水晶
    if includeCrystal:
    crystalNPCIDPosDict = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldCrystal", 1, {})
    worldObj = GetBattleWorld()
    for npcID, ownerFaction in worldObj.crystalFactionInfo.items():
        if ownerFaction != faction:
            continue
        if npcID not in crystalNPCIDPosDict:
            if str(npcID) not in crystalNPCIDPosDict:
            continue
        posInfo = crystalNPCIDPosDict[npcID]
            posInfo = crystalNPCIDPosDict[str(npcID)]
        rebornPosList.append([posInfo[0], posInfo[1], 3])
        
    if not rebornPosList: