From bd61f5e92fad5dc02f693747fde8fdb86ee01c5c Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 06 十二月 2019 20:46:52 +0800 Subject: [PATCH] 8346 【恺英】【后端】协助系统(初版,可完成协助完整流程,增加新NPC伤血管理,支持协助、支持超过20亿伤害) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py | 23 ++++++++++++++++++++--- 1 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py index 4a78d00..1b8199b 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py @@ -87,6 +87,7 @@ import FunctionNPCCommon import CrossRealmPlayer import CrossPlayerData +import NPCHurtManager import ChNetSendPack import PlayerCoat import PlayerState @@ -1522,6 +1523,10 @@ NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FromFBLineID, lineID) GameWorld.DebugLog("进入副本时,最后一次离开的可返回的副本ID更新!mapID=%s,lineID=%s,Pos(%s,%s)" % (mapID, lineID, posX, posY)) + # 离开地图,暂时只处理离开中立、组队副本 + if curPlayer.GetMapID() in IpyGameDataPY.GetFuncEvalCfg("MapLine", 4) or GameWorld.GetMap().GetMapFBType() == IPY_GameWorld.fbtTeam: + NPCHurtManager.OnPlayerLeaveMap(curPlayer) + # 从副本中切图 if GameWorld.GetMap().GetMapFBType() != IPY_GameWorld.fbtNull: #默认回满血 @@ -2347,8 +2352,9 @@ def __GetBossShuntLineID(curPlayer, curMapID, curLineID, tagMapID, npcID, lineIDList): '''获取目标地图boss分流线路 根据人数分流玩家,优先分配到活着的线路 - 队伍无视任何规则,默认分配到队伍队员多的那条线 - + 队伍默认分配到队伍队员多的那条线 + 协助默认分配到目标玩家线路,优先级最高 + 前端: 1.在中立地图的时候,显示当前线路BOSS的状态 2.在常规地图的时候,显示玩家击杀BOSS的CD时间 @@ -2384,10 +2390,14 @@ lineIDList.remove(activityLineID) GameWorld.DebugLog(" 非1线的活动线路不参与分流: activityLineID=%s,lineIDList=%s" % (activityLineID, lineIDList), playerID) + assistTagPlayerID = GetAssistTagPlayerID(curPlayer) for lineID in lineIDList: key = (tagMapID, lineID) # boss分流玩家信息{(mapID, lineID):{playerID:[bossID, teamID, relatedTick], ...}, ...} shuntPlayerDict = PyGameData.g_bossShuntPlayerInfo.get(key, {}) + if assistTagPlayerID and assistTagPlayerID in shuntPlayerDict: + GameWorld.DebugLog(" 分流到协助目标玩家线路 assistTagPlayerID=%s,lineID=%s" % (assistTagPlayerID, lineID), playerID) + return lineID playerCount = 0 teamPlayerCount = 0 for shuntPlayerID, shuntInfo in shuntPlayerDict.items(): @@ -5893,13 +5903,20 @@ curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ForbidenTalk, value, False) return +## 协助目标玩家ID +def SetAssistTagPlayerID(curPlayer, value): + curPlayer.SetExAttr1(value, True, False) # 不通知GameServer + NPCHurtManager.OnSetAssistTagPlayerID(curPlayer, value) + return +def GetAssistTagPlayerID(curPlayer): return curPlayer.GetExAttr1() + ## 队伍相关审核开关状态, joinReqCheck-入队申请是否需要审核; inviteCheck-组队邀请是否需要审核; def SetTeamCheckStateEx(curPlayer, joinReqCheck, inviteCheck): return SetTeamCheckState(curPlayer, joinReqCheck * 10 + inviteCheck) def SetTeamCheckState(curPlayer, checkState): return curPlayer.SetExAttr2(checkState, False, True) def GetTeamCheckState(curPlayer): return curPlayer.GetExAttr2() ## 副本功能线路ID, 这里做db存储,防止在合并地图副本中掉线重上时前端无法加载正确的场景资源,登录加载场景时机为0102包 -def SetFBFuncLineID(curPlayer, funcLineID): return curPlayer.SetExAttr3(funcLineID, False, False) +def SetFBFuncLineID(curPlayer, funcLineID): return curPlayer.SetExAttr3(funcLineID, False, True) def GetFBFuncLineID(curPlayer): return curPlayer.GetExAttr3() ## 跨服状态所在地图ID: 0-非跨服状态,非0-跨服状态对应的地图ID -- Gitblit v1.8.0