From 6b57f89ec2ba764c6509c4120e210758e4faa7e8 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期六, 01 九月 2018 14:59:54 +0800 Subject: [PATCH] Add: 3163 【后端】装备评分新参数:技能减伤 --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py index d6f129b..f8fd7c7 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FamilyRobBoss.py @@ -20,6 +20,7 @@ import IPY_GameWorld import NetPackCommon import ChPyNetSendPack +import PlayerActivity import PlayerControl import IpyGameDataPY import NPCCommon @@ -80,6 +81,10 @@ if not g_familyOwnerBossHurt: g_familyOwnerBossHurt = FamilyOwnerBossHurt() return g_familyOwnerBossHurt + +def IsHorsePetRobBoss(bossID): + ## 是否骑宠争夺bossID + return bossID in IpyGameDataPY.GetFuncEvalCfg("FairyGrabBossID", 1) def OnGMPrintFamilyOwnerBossHurt(curPlayer, curNPC): ## GM显示仙盟归属boss伤血信息 @@ -181,6 +186,12 @@ hurtName = familyName if hurtType == FamilyHurtObjType_Family else playerName objHurtDict[hurtID] = FamilyHurtObj(familyID, hurtType, hurtID, hurtName) hurtObj = objHurtDict[hurtID] + + # 玩家对该boss第一次造成伤害 + if hurtType == FamilyHurtObjType_Player and hurtObj.hurtValue == 0 and hurtValue: + if IsHorsePetRobBoss(curBoss.GetNPCID()): + PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FamilyRobBoss) + hurtObj.hurtValue += hurtValue GameWorld.DebugLog(" 更新伤血%s: hurtType=%s,hurtID=%s,hurtValue=%s" % (mark, hurtType, hurtID, hurtObj.hurtValue), playerID) @@ -311,7 +322,7 @@ GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "FamilyOwnerBossInfo", syncMsg, len(syncMsg)) # 伤血在NPCCommon统一清 - return + return ownerFamilyName def RefreshFamilyOwnerNPCHurt(npcControl, curNPC, tick, refreshInterval): ## 仙盟归属boss刷新伤血列表 @@ -401,7 +412,7 @@ for clearHurtFamilyID in clearHurtFamilyIDList: npcFamilyNowHurtDict.pop(clearHurtFamilyID, 0) - npcFamilyPlayerIDDict.pop(clearHurtFamilyID, 0) + #npcFamilyPlayerIDDict.pop(clearHurtFamilyID, 0) GameWorld.Log("清除仙盟伤血: lineID=%s,objID=%s,bossID=%s" % (lineID, objID, bossID)) # 排序 @@ -498,6 +509,13 @@ key = (lineID, objID, bossID) hurtMgr = GetFamilyHurtMgr() + + # 同步对骑宠争夺boss有伤血的玩家ID到GameServer + familyHurtPlayerIDListDict = hurtMgr.familyPlayerIDDict.get(key, {}) + if IsHorsePetRobBoss(bossID) and familyHurtPlayerIDListDict: + syncMsg = str([bossID, familyHurtPlayerIDListDict]) + GameWorld.GetPlayerManager().GameServer_QueryPlayerResult(0, 0, 0, "HorsePetRobBossHurtPlayer", syncMsg, len(syncMsg)) + hurtMgr.ClearNPCHurt(key) GameWorld.DebugLog("ClearFamilyOwnerBossHurt lineID=%s, objID=%s, bossID=%s" % (lineID, objID, bossID)) -- Gitblit v1.8.0