From 8bb1b16496579e13cc294273b24a2fe2dcdcb84c Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期五, 26 七月 2019 21:24:43 +0800 Subject: [PATCH] 8180 【后端】【主干】优化组队打BOSS(境界不受boss压制的队员各自掉一份,优化争夺模式不对队友造成伤害) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBattle.py | 6 +++++- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py | 35 ++++++++++++++++++++++++++++------- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py | 5 +++++ 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py index e9dafbf..bb91cc4 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Attack/AttackLogic/AttackCommon.py @@ -2762,6 +2762,11 @@ if IsSameServer(curPlayer, tagPlayer): return ChConfig.Type_Relation_Friend, ChConfig.Def_PASysMessage_NotAttackServer + # 锁定模式(不可攻击队友) + elif curPlayerAttackMode == IPY_GameWorld.amContest: + if CanAlikeTeam(curPlayer, tagPlayer): + return ChConfig.Type_Relation_Friend, ChConfig.Def_PASysMessage_NotAttackTeam + # 全体模式 elif curPlayerAttackMode == IPY_GameWorld.amAll: pass 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 9f14d12..5b31ada 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py @@ -4676,13 +4676,23 @@ if maxPlayerLV < curPlayer.GetLV(): maxPlayerLV = curPlayer.GetLV() dropPlayer = curPlayer + + if isGameBoss and curPlayer.GetOfficialRank() < GetRealmLV(curNPC): + GameWorld.Log("玩家境界不足,无法获得Boss归属奖励! playerRealmLV=%s,npcID=%s,npcRealmLV=%s" + % (curPlayer.GetOfficialRank(), npcID, GetRealmLV(curNPC)), curPlayer.GetPlayerID()) + continue + self.__KilledByPlayerSetPrize(curPlayer) ownerPlayerList.append(curPlayer) self.__ownerPlayerList = ownerPlayerList - #调用物品掉落 - self.__NPCDropItem(dropPlayer, hurtType, hurtID, ownerPlayerList) - + #调用物品掉落,boss一人一份 + if isGameBoss: + for curPlayer in ownerPlayerList: + self.__NPCDropItem(curPlayer, ChConfig.Def_NPCHurtTypePlayer, curPlayer.GetPlayerID(), [curPlayer]) + elif dropPlayer: + self.__NPCDropItem(dropPlayer, hurtType, hurtID, ownerPlayerList) + #被队伍杀死 elif curTeam != None: self.__KilledByTeamSetPrize(curTeam, hurtType, hurtID) @@ -5112,8 +5122,15 @@ teamMaxLV = 0 dropPlayer = None ownerPlayerList = [] + npcID = curNPC.GetNPCID() + isGameBoss = ChConfig.IsGameBoss(curNPC) #遍历队伍,半径为一屏半的距离内的所有队伍/团队成员,可以获得经验 for curPlayer in playerlist: + if isGameBoss and curPlayer.GetOfficialRank() < GetRealmLV(curNPC): + GameWorld.Log("队员境界不足,无法获得Boss归属奖励! playerRealmLV=%s,npcID=%s,npcRealmLV=%s" + % (curPlayer.GetOfficialRank(), npcID, GetRealmLV(curNPC)), curPlayer.GetPlayerID()) + continue + curPlayerLV = curPlayer.GetLV() if teamMaxLV < curPlayerLV: teamMaxLV = curPlayerLV @@ -5124,9 +5141,13 @@ self.__DoNormalTeamExp(curPlayer) self.__KillNPCFuncEx(curPlayer, curNPC, maxHurtID, True) self.__ownerPlayerList = ownerPlayerList - - #调用物品掉落 - self.__NPCDropItem(dropPlayer, hurtType, hurtID, ownerPlayerList) + + #调用物品掉落,boss一人一份 + if isGameBoss: + for curPlayer in ownerPlayerList: + self.__NPCDropItem(curPlayer, ChConfig.Def_NPCHurtTypePlayer, curPlayer.GetPlayerID(), [curPlayer]) + elif dropPlayer: + self.__NPCDropItem(dropPlayer, hurtType, hurtID, ownerPlayerList) #GameWorld.Log("队伍杀死怪物奖励,逻辑成功结束") return @@ -5360,7 +5381,7 @@ # 在地上添加物品(统一接口) dropNPCID = 0 if not ChConfig.IsGameBoss(curNPC) else curNPCID - specOwnerIDList = self.__AllKillerDict.keys() if (len(self.__AllKillerDict) > 1 or dropType == ChConfig.Def_NPCHurtTypeSpecial) else [] + specOwnerIDList = [player.GetPlayerID() for player in self.__ownerPlayerList] if dropType == ChConfig.Def_NPCHurtTypeSpecial else [] curMapItem = ChItem.AddMapDropItem(posX, posY, curItem, ownerInfo=[dropType, ownerID, specOwnerIDList], dropNPCID=dropNPCID) #设置该物品生前拥有者(那个NPC掉落的) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBattle.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBattle.py index 6e68615..2bd221a 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBattle.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerBattle.py @@ -316,7 +316,11 @@ if curTag == None or curTag.IsEmpty(): return - + if curPlayer.GetAttackMode() == IPY_GameWorld.amContest: + if curPlayer.GetTeamID() and curPlayer.GetTeamID() == curTag.GetTeamID(): + #GameWorld.DebugLog("锁定模式不锁定队友") + return + #这里不验证是否死亡 curPlayer.SetDict(ChConfig.Def_PlayerKey_SelectObjID, clientData.ID) curPlayer.SetDict(ChConfig.Def_PlayerKey_SelectObjType, clientData.Type) -- Gitblit v1.8.0