From 68e048256ca3e40cbc6e73cfd0937663cd41d63c Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 27 十二月 2019 20:50:44 +0800 Subject: [PATCH] Merge branch 'master' of http://mobile.173on.com:10010/r/SnxxServerCode --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py | 74 ++++++++++++++++++------------------ 1 files changed, 37 insertions(+), 37 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py index 89936b0..5f574ff 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py @@ -5297,41 +5297,38 @@ elif ownerType == ChConfig.Def_NPCHurtTypeTeam: curTeam = GameWorld.GetTeamManager().FindTeam(ownerID) - if not curTeam: - return - - # 因为有击杀次数限制,所以不是所有的队员都可以获得归属,所以这里设置为特殊指定玩家掉落 - hurtType, hurtID = ChConfig.Def_NPCHurtTypeSpecial, 0 - if isDead: - GameWorld.Log("队伍成员数: %s" % (curTeam.GetMemberCount())) - refreshPoint = curNPC.GetRefreshPosAt(curNPC.GetCurRefreshPointIndex()) - for i in xrange(curTeam.GetMemberCount()): - curTeamPlayer = curTeam.GetMember(i) - if curTeamPlayer == None or curTeamPlayer.GetPlayerID() == 0: - if isDead: - GameWorld.Log(" i=%s, 成员不存在!" % (i)) - continue - - if curTeamPlayer.GetCopyMapID() == GameWorld.GetGameWorld().GetCopyMapID() \ - and (not hurtList or hurtList.HaveHurtValue(curTeamPlayer.GetPlayerID()))\ - and self.GetIsInRefreshPoint(curTeamPlayer.GetPosX(), curTeamPlayer.GetPosY(), refreshPoint) \ - and AttackCommon.CheckKillNPCByCnt(curTeamPlayer, curNPC, False) and curTeamPlayer.GetVisible(): - self.__AddDropOwnerPlayerBuff(curTeamPlayer, tick) - killerDict[curTeamPlayer.GetPlayerID()] = curTeamPlayer - if isDead: - GameWorld.Log(" i=%s, 成员有归属权! memPlayerID=%s,背包剩余空格=%s" - % (i, curTeamPlayer.GetPlayerID(), ItemCommon.GetItemPackSpace(curTeamPlayer, IPY_GameWorld.rptItem))) - - # 不同线、或者距离超出boss范围的队员不加归属buff - else: - isOk = BuffSkill.DelBuffBySkillID(curTeamPlayer, ChConfig.Def_SkillID_DropOwnerBuff, tick, buffOwner=curNPC) - if isOk: - GameWorld.DebugLog("删除归属队员buff: teamID=%s,playerID=%s" % (ownerID, curTeamPlayer.GetPlayerID())) - if isDead: - GameWorld.Log(" i=%s, 成员无归属权! memPlayerID=%s,copyMapID=%s,pos(%s,%s),CheckKillNPCByCnt=%s" - % (i, curTeamPlayer.GetPlayerID(), curTeamPlayer.GetCopyMapID(), - curTeamPlayer.GetPosX(), curTeamPlayer.GetPosY(), - AttackCommon.CheckKillNPCByCnt(curTeamPlayer, curNPC, False))) + if curTeam: + # 因为有击杀次数限制,所以不是所有的队员都可以获得归属,所以这里设置为特殊指定玩家掉落 + hurtType, hurtID = ChConfig.Def_NPCHurtTypeSpecial, 0 + if isDead: + GameWorld.Log("队伍成员数: %s" % (curTeam.GetMemberCount())) + refreshPoint = curNPC.GetRefreshPosAt(curNPC.GetCurRefreshPointIndex()) + for i in xrange(curTeam.GetMemberCount()): + curTeamPlayer = curTeam.GetMember(i) + if curTeamPlayer == None or curTeamPlayer.GetPlayerID() == 0: + if isDead: + GameWorld.Log(" i=%s, 成员不存在!" % (i)) + continue + + if curTeamPlayer.GetCopyMapID() == GameWorld.GetGameWorld().GetCopyMapID() \ + and (not hurtList or hurtList.HaveHurtValue(curTeamPlayer.GetPlayerID()))\ + and AttackCommon.CheckKillNPCByCnt(curTeamPlayer, curNPC, False) and curTeamPlayer.GetVisible(): + self.__AddDropOwnerPlayerBuff(curTeamPlayer, tick) + killerDict[curTeamPlayer.GetPlayerID()] = curTeamPlayer + if isDead: + GameWorld.Log(" i=%s, 成员有归属权! memPlayerID=%s,背包剩余空格=%s" + % (i, curTeamPlayer.GetPlayerID(), ItemCommon.GetItemPackSpace(curTeamPlayer, IPY_GameWorld.rptItem))) + + # 不同线、或者距离超出boss范围的队员不加归属buff + else: + isOk = BuffSkill.DelBuffBySkillID(curTeamPlayer, ChConfig.Def_SkillID_DropOwnerBuff, tick, buffOwner=curNPC) + if isOk: + GameWorld.DebugLog("删除归属队员buff: teamID=%s,playerID=%s" % (ownerID, curTeamPlayer.GetPlayerID())) + if isDead: + GameWorld.Log(" i=%s, 成员无归属权! memPlayerID=%s,copyMapID=%s,pos(%s,%s),CheckKillNPCByCnt=%s" + % (i, curTeamPlayer.GetPlayerID(), curTeamPlayer.GetCopyMapID(), + curTeamPlayer.GetPosX(), curTeamPlayer.GetPosY(), + AttackCommon.CheckKillNPCByCnt(curTeamPlayer, curNPC, False))) elif ownerType == ChConfig.Def_NPCHurtTypeFamily: @@ -5355,8 +5352,11 @@ if isDead: #key = (GameWorld.GetGameWorld().GetLineID(), curNPC.GetID(), npcID) teamID = curTeam.GetTeamID() if curTeam else 0 - if killerDict: - PyGameData.g_npcKillerInfo[key] = killerDict, curTeam, hurtType, hurtID + # 伤血归属的强制记录,即使空的也记录,因为有助战,伤血第一团队伤害可能还在但是归属玩家可能离线 + if dropOwnerType == ChConfig.DropOwnerType_MaxHurt: + PyGameData.g_npcKillerInfo[key] = killerDict, None, hurtType, hurtID + if not killerDict: + GameWorld.Log("伤血归属boss没有归属玩家!") elif ownerType == ChConfig.Def_NPCHurtTypeFamily: PyGameData.g_npcKillerInfo[key] = {}, None, hurtType, hurtID -- Gitblit v1.8.0