9673 【后端】【越南】【BT7】【主干】古神战场增加玩家掉落BUFF功能
3个文件已修改
68 ■■■■■ 已修改文件
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
@@ -5163,6 +5163,10 @@
    
    if curNPC.GetType() != ChConfig.ntTouchKill:
        return
    if not FBLogic.OnCanMoveTouchNPC(curPlayer, curNPC, tick):
        return
    #副本
    FBLogic.OnMoveTouchNPC(curPlayer, curNPC, tick)
    
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBLogic.py
@@ -2287,6 +2287,16 @@
    
    return
def OnCanMoveTouchNPC(curPlayer, curNPC, tick):
    ## 检查可否触碰NPC逻辑
    do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
    callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnCanMoveTouchNPC"))
    if callFunc:
        return callFunc(curPlayer, curNPC, tick)
    return True
def OnMoveTouchNPC(curPlayer, curNPC, tick):
    ## 触碰NPC处理逻辑
    do_FBLogic_ID = __GetFBLogic_MapID(GameWorld.GetMap().GetMapID())
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_CrossBattlefield.py
@@ -1464,6 +1464,11 @@
    
    if atkObjType == IPY_GameWorld.gotPlayer:
        NotifyBattlefieldHelp(False, atkObj) # 击杀的暂只实时通知自己
        # 玩家被玩家击杀,掉落个人buff
        if defObjType == IPY_GameWorld.gotPlayer:
            DoDropPersonBuffOnKilled(atkObj, defObj, tick)
    return
def DoFB_NPCDead(curNPC):
@@ -1834,6 +1839,55 @@
            NotifyBattlefieldHelp()
    return
def DoDropPersonBuffOnKilled(atkPlayer, defPlayer, tick):
    dropPersonBuffNPCList = IpyGameDataPY.GetFuncEvalCfg("CrossBattlefieldDropPersonBuff", 1)
    if not dropPersonBuffNPCList:
        return
    dropNPCIDList = []
    for npcID in dropPersonBuffNPCList:
        npcData = GameWorld.GetGameData().FindNPCDataByID(npcID)
        if not npcData:
            continue
        buffID = npcData.GetSkill1()
        if not buffID:
            continue
        findBuff = SkillCommon.FindBuffByID(defPlayer, buffID)[0]
        if not findBuff:
            continue
        if findBuff.GetLayer():
            dropNPCIDList.extend([npcID] * findBuff.GetLayer())
        else:
            dropNPCIDList.append(npcID)
    count = 0
    defPosX, defPosY = defPlayer.GetPosX(), defPlayer.GetPosY()
    while dropNPCIDList and count < 100:
        count += 1
        dropX, dropY = GameMap.GetNearbyPosByDis(defPosX, defPosY, 5)
        if not dropX:
            continue
        npcID = dropNPCIDList.pop(0)
        NPCCommon.SummonMapNpc(npcID, dropX, dropY, playerID=atkPlayer.GetPlayerID())
    return
def OnCanMoveTouchNPC(curPlayer, curNPC, tick):
    ## 检查可否触碰NPC逻辑
    summonPlayerID = curNPC.GetDictByKey(ChConfig.Def_NPC_Dict_SummonMapNPCPlayerID)
    if not summonPlayerID:
        return True
    if summonPlayerID == curPlayer.GetPlayerID():
        #GameWorld.DebugLog("OnCanMoveTouchNPC summonPlayerID=%s,owner=True" % summonPlayerID, curNPC.GetID())
        return True
    protectTick = IpyGameDataPY.GetFuncCfg("CrossBattlefieldDropPersonBuff", 2) * 1000
    passTick = tick - curNPC.GetActionTick()
    if passTick < protectTick:
        #GameWorld.DebugLog("OnCanMoveTouchNPC in protect! passTick=%s < protectTick=%s" % (passTick, protectTick), curNPC.GetID())
        return False
    return True
def OnMoveTouchNPC(curPlayer, curNPC, tick):
    ## 触碰NPC处理逻辑
    npcID = curNPC.GetNPCID()