hxp
2019-05-29 be35331b8931d2829f014749a827a1c37c78feff
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
@@ -446,18 +446,18 @@
#  @return
def SetFBPropertyMark(propertyMark, setPlayer=None):
    GameWorld.GetGameFB().SetGameFBDict(ChConfig.Map_FBDict_PropertyMark, propertyMark + 1) # 存储时+1才能判断是否存储过
    if setPlayer != None:
        PlayerControl.SetFBFuncLineID(setPlayer, propertyMark)
        GameWorld.DebugLog("SetFBPropertyMark 设置玩家副本功能线路ID: %s" % propertyMark, setPlayer.GetPlayerID())
        return
    playerManager = GameWorld.GetMapCopyPlayerManager()
    for index in xrange(playerManager.GetPlayerCount()):
        curPlayer = playerManager.GetPlayerByIndex(index)
        if not curPlayer.GetPlayerID():
            continue
        PlayerControl.SetFBFuncLineID(curPlayer, propertyMark)
        GameWorld.DebugLog("SetFBPropertyMark 广播玩家副本功能线路ID: %s" % propertyMark, curPlayer.GetPlayerID())
#    if setPlayer != None:
#        PlayerControl.SetFBFuncLineID(setPlayer, propertyMark)
#        GameWorld.DebugLog("SetFBPropertyMark 设置玩家副本功能线路ID: %s" % propertyMark, setPlayer.GetPlayerID())
#        return
#
#    playerManager = GameWorld.GetMapCopyPlayerManager()
#    for index in xrange(playerManager.GetPlayerCount()):
#        curPlayer = playerManager.GetPlayerByIndex(index)
#        if not curPlayer.GetPlayerID():
#            continue
#        PlayerControl.SetFBFuncLineID(curPlayer, propertyMark)
#        GameWorld.DebugLog("SetFBPropertyMark 广播玩家副本功能线路ID: %s" % propertyMark, curPlayer.GetPlayerID())
    return
## 是否已经扣除入场券/进入次数等
@@ -471,6 +471,15 @@
#  @return
def SetHadDelTicket(curPlayer, delSign=1):
    GameWorld.GetGameFB().SetPlayerGameFBDict(curPlayer.GetID(), ChConfig.FBPlayerDict_IsDelTicket, delSign)
    return
## 自定义场景阶段
def GetCustomMapStep(curPlayer, mapID, lineID):
    return curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_CustomMapStep % (mapID, lineID))
def SetCustomMapStep(curPlayer, mapID, lineID, step):
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_CustomMapStep % (mapID, lineID), step)
    if step == ChConfig.CustomMapStep_Over:
        PlayerControl.SetCustomMap(curPlayer, 0, 0)
    return
def GetCurSingleFBPlayer():
@@ -1018,6 +1027,35 @@
    #可以进入
    return True
#---------------------------------------------------------------------
def Sync_FBNPC(mapID=0, npcIDList=[], curPlayer=None):
    ## 同步当前副本NPC给副本中的所有玩家
    if not mapID:
        mapID = GameWorld.GetMap().GetMapID()
        mapID = GetRecordMapID(mapID)
    npcCntDict = {}
    gameNPCManager = GameWorld.GetNPCManager()
    for index in xrange(gameNPCManager.GetNPCCount()):
        curNPC = gameNPCManager.GetNPCByIndex(index)
        npcID = curNPC.GetNPCID()
        if not npcID:
            continue
        if curNPC.GetGameNPCObjType() == IPY_GameWorld.gnotPet:
            continue
        if npcIDList and npcID not in npcIDList:
            continue
        npcCntDict[npcID] = npcCntDict.get(npcID, 0) + 1
    if curPlayer:
        NPCCommon.SyncNPCCntInfo(curPlayer, mapID, npcCntDict)
    else:
        playerManager = GameWorld.GetMapCopyPlayerManager()
        for i in xrange(playerManager.GetPlayerCount()):
            curPlayer = playerManager.GetPlayerByIndex(i)
            if curPlayer.GetID() == 0:
                continue
            NPCCommon.SyncNPCCntInfo(curPlayer, mapID, npcCntDict)
    return npcCntDict
##获得地图上的NPC列表
# @param 无参数
# @return 返回值, NPC实例列表[curNPC,curNPC,,,,,]
@@ -1998,7 +2036,7 @@
def AddFbEncourageBuff(curPlayer, key, tick, ownerID=0):
    curPlayerID = curPlayer.GetID()
    GameWorld.Log("AddFbEncourageBuff() curPlayerID=%s" % curPlayerID)
    ownerID = ownerID or curPlayer.GetID()
    gameFB = GameWorld.GetGameFB()
    encourageLV = gameFB.GetPlayerGameFBDictByKey(ownerID, key)
    if not encourageLV: