Core/Battlegrounds: Rework Eye of the Storm

Port From (https://github.com/TrinityCore/TrinityCore/commit/32af4bf8fa2936904a6bebe16445e66ef26340ce)
This commit is contained in:
hondacrx
2024-03-02 14:46:47 -05:00
parent 80c7110988
commit d0c623ba39
8 changed files with 348 additions and 717 deletions
@@ -72,7 +72,9 @@ namespace Framework.Constants
public const uint SpellArenaPreparation = 32727; // Use This One, 32728 Not Correct public const uint SpellArenaPreparation = 32727; // Use This One, 32728 Not Correct
public const uint SpellPreparation = 44521; // Preparation public const uint SpellPreparation = 44521; // Preparation
public const uint SpellSpiritHealMana = 44535; // Spirit Heal public const uint SpellSpiritHealMana = 44535; // Spirit Heal
public const uint SpellRecentlyDroppedFlag = 42792; // Recently Dropped Flag public const uint SpellRecentlyDroppedAllianceFlag = 42792; // makes Alliance flag unselectable
public const uint SpellRecentlyDroppedHordeFlag = 42792; // makes Horde flag unselectable
public const uint SpellRecentlyDroppedNeutralFlag = 42792; // makes Neutral flag unselectable
public const uint SpellAuraPlayerInactive = 43681; // Inactive public const uint SpellAuraPlayerInactive = 43681; // Inactive
public const uint SpellHonorableDefender25y = 68652; // +50% Honor When Standing At A Capture Point That You Control, 25yards Radius (Added In 3.2) public const uint SpellHonorableDefender25y = 68652; // +50% Honor When Standing At A Capture Point That You Control, 25yards Radius (Added In 3.2)
public const uint SpellHonorableDefender60y = 66157; // +50% Honor When Standing At A Capture Point That You Control, 60yards Radius (Added In 3.2), Probably For 40+ Player Battlegrounds public const uint SpellHonorableDefender60y = 66157; // +50% Honor When Standing At A Capture Point That You Control, 60yards Radius (Added In 3.2), Probably For 40+ Player Battlegrounds
@@ -37,7 +37,7 @@ namespace Game.BattleGrounds.Zones.AlteracValley
for (byte j = 0; j < 9; j++) for (byte j = 0; j < 9; j++)
m_Team_QuestStatus[i][j] = 0; m_Team_QuestStatus[i][j] = 0;
_captainBuffTimer[i].Reset(120000 + RandomHelper.URand(0, 4) * 60); //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes @todo get the right times _captainBuffTimer[i] = new(120000 + RandomHelper.URand(0, 4) * 60); //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes @todo get the right times
} }
_mineInfo[(byte)AlteracValleyMine.North] = new AlteracValleyMineInfo(Team.Other, new StaticMineInfo(WorldStateIds.IrondeepMineOwner, WorldStateIds.IrondeepMineAllianceControlled, WorldStateIds.IrondeepMineHordeControlled, WorldStateIds.IrondeepMineTroggControlled, (byte)TextIds.IrondeepMineAllianceTaken, (byte)TextIds.IrondeepMineHordeTaken)); _mineInfo[(byte)AlteracValleyMine.North] = new AlteracValleyMineInfo(Team.Other, new StaticMineInfo(WorldStateIds.IrondeepMineOwner, WorldStateIds.IrondeepMineAllianceControlled, WorldStateIds.IrondeepMineHordeControlled, WorldStateIds.IrondeepMineTroggControlled, (byte)TextIds.IrondeepMineAllianceTaken, (byte)TextIds.IrondeepMineHordeTaken));
@@ -53,7 +53,7 @@ namespace Game.BattleGrounds.Zones.AlteracValley
InitNode(i, Team.Horde, true); InitNode(i, Team.Horde, true);
InitNode(AVNodes.SnowfallGrave, Team.Other, false); //give snowfall neutral owner InitNode(AVNodes.SnowfallGrave, Team.Other, false); //give snowfall neutral owner
_mineResourceTimer.Reset(MiscConst.MineResourceTimer); _mineResourceTimer = new(MiscConst.MineResourceTimer);
StartMessageIds[BattlegroundConst.EventIdSecond] = (uint)BroadcastTextIds.StartOneMinute; StartMessageIds[BattlegroundConst.EventIdSecond] = (uint)BroadcastTextIds.StartOneMinute;
StartMessageIds[BattlegroundConst.EventIdThird] = (uint)BroadcastTextIds.StartHalfMinute; StartMessageIds[BattlegroundConst.EventIdThird] = (uint)BroadcastTextIds.StartHalfMinute;
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,6 @@
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved. // Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information. // Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
namespace Game.BattleGrounds.Zones namespace Game.BattleGrounds.Zones
{ {
class BgIsleofConquest : Battleground class BgIsleofConquest : Battleground
@@ -2,11 +2,10 @@
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information. // Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
using Framework.Constants; using Framework.Constants;
using Game.Entities;
using Game.Networking.Packets;
using Game.DataStorage; using Game.DataStorage;
using System.Collections.Generic; using Game.Entities;
using System; using System;
using System.Collections.Generic;
namespace Game.BattleGrounds.Zones namespace Game.BattleGrounds.Zones
{ {
@@ -401,7 +400,7 @@ namespace Game.BattleGrounds.Zones
if (set) if (set)
{ {
player.CastSpell(player, BattlegroundConst.SpellRecentlyDroppedFlag, true); player.CastSpell(player, BattlegroundConst.SpellRecentlyDroppedNeutralFlag, true);
UpdateFlagState(team, WSGFlagState.OnGround); UpdateFlagState(team, WSGFlagState.OnGround);
if (team == Team.Alliance) if (team == Team.Alliance)
@@ -3615,7 +3615,7 @@ namespace Game.Entities
return newFlag.GetState(); return newFlag.GetState();
} }
ObjectGuid GetFlagCarrierGUID() public ObjectGuid GetFlagCarrierGUID()
{ {
if (GetGoType() != GameObjectTypes.NewFlag) if (GetGoType() != GameObjectTypes.NewFlag)
return ObjectGuid.Empty; return ObjectGuid.Empty;
+15 -4
View File
@@ -321,7 +321,7 @@ namespace Game.Entities
return; return;
if (!GetCombatManager().HasPvPCombat()) if (!GetCombatManager().HasPvPCombat())
{ {
RemoveAurasDueToSpell(PlayerConst.SpellPvpRulesEnabled); RemoveAurasDueToSpell(PlayerConst.SpellPvpRulesEnabled);
UpdateItemLevelAreaBasedScaling(); UpdateItemLevelAreaBasedScaling();
} }
@@ -493,7 +493,7 @@ namespace Game.Entities
return m_bgBattlegroundQueueID[i].mercenary; return m_bgBattlegroundQueueID[i].mercenary;
return false; return false;
} }
public WorldLocation GetBattlegroundEntryPoint() { return m_bgData.joinPos; } public WorldLocation GetBattlegroundEntryPoint() { return m_bgData.joinPos; }
public bool InBattleground() { return m_bgData.bgInstanceID != 0; } public bool InBattleground() { return m_bgData.bgInstanceID != 0; }
@@ -520,10 +520,21 @@ namespace Game.Entities
return false; return false;
} }
bool hasRecentlyDroppedFlagDebuff = HasAura(aura =>
{
if (aura.GetSpellInfo().Id == BattlegroundConst.SpellRecentlyDroppedAllianceFlag)
return true;
else if (aura.GetSpellInfo().Id == BattlegroundConst.SpellRecentlyDroppedHordeFlag)
return true;
else if (aura.GetSpellInfo().Id == BattlegroundConst.SpellRecentlyDroppedNeutralFlag)
return true;
return false;
});
// BUG: sometimes when player clicks on flag in AB - client won't send gameobject_use, only gameobject_report_use packet // BUG: sometimes when player clicks on flag in AB - client won't send gameobject_use, only gameobject_report_use packet
// Note: Mount, stealth and invisibility will be removed when used // Note: Mount, stealth and invisibility will be removed when used
return (!IsTotalImmune() && // Damage immune return (!IsTotalImmune() && // Damage immune
!HasAura(BattlegroundConst.SpellRecentlyDroppedFlag) && // Still has recently held flag debuff !hasRecentlyDroppedFlagDebuff && // Still has recently held flag debuff
IsAlive()); // Alive IsAlive()); // Alive
} }
@@ -615,7 +626,7 @@ namespace Game.Entities
} }
public bool IsDeserter() { return HasAura(26013); } public bool IsDeserter() { return HasAura(26013); }
public bool CanJoinToBattleground(BattlegroundTemplate bg) public bool CanJoinToBattleground(BattlegroundTemplate bg)
{ {
RBACPermissions perm = RBACPermissions.JoinNormalBg; RBACPermissions perm = RBACPermissions.JoinNormalBg;
-2
View File
@@ -908,8 +908,6 @@ namespace Game.Spells
case 23333: // Warsong Flag case 23333: // Warsong Flag
case 23335: // Silverwing Flag case 23335: // Silverwing Flag
return map_id == 489 && player != null && player.InBattleground() ? SpellCastResult.SpellCastOk : SpellCastResult.RequiresArea; return map_id == 489 && player != null && player.InBattleground() ? SpellCastResult.SpellCastOk : SpellCastResult.RequiresArea;
case 34976: // Netherstorm Flag
return map_id == 566 && player != null && player.InBattleground() ? SpellCastResult.SpellCastOk : SpellCastResult.RequiresArea;
case 2584: // Waiting to Resurrect case 2584: // Waiting to Resurrect
case 42792: // Recently Dropped Flag case 42792: // Recently Dropped Flag
case 43681: // Inactive case 43681: // Inactive