From ae9308c1cbf285a2add0ef5215fbdf04585b9931 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 10 Jul 2022 14:59:20 -0400 Subject: [PATCH] Core/WorldStates: Migrate battleground worldstates to new system Port From (https://github.com/TrinityCore/TrinityCore/commit/5dbfaecd5c020fd4c3b3dfc235580849c39ce7db) --- .../Framework/Constants/BattleGroundsConst.cs | 10 - Source/Game/Arenas/Arena.cs | 22 +- Source/Game/Arenas/Zones/BladesEdgeArena.cs | 6 - Source/Game/Arenas/Zones/DalaranSewers.cs | 6 - Source/Game/Arenas/Zones/NagrandArena.cs | 6 - Source/Game/Arenas/Zones/RingofValor.cs | 6 - Source/Game/Arenas/Zones/RuinsofLordaeron.cs | 6 - Source/Game/BattleGrounds/BattleGround.cs | 28 +- .../Game/BattleGrounds/Zones/ArathiBasin.cs | 204 +++++---- Source/Game/BattleGrounds/Zones/EyeofStorm.cs | 82 +--- .../BattleGrounds/Zones/StrandofAncients.cs | 387 +++++++--------- .../Game/BattleGrounds/Zones/WarsongGluch.cs | 141 ++---- Source/Game/Entities/GameObject/GameObject.cs | 2 +- Source/Game/Entities/Player/Player.cs | 424 +++--------------- Source/Game/Entities/Transport.cs | 1 + Source/Scripts/World/Achievements.cs | 192 -------- .../world/master/2022_07_10_00_world.sql | 298 ++++++++++++ 17 files changed, 693 insertions(+), 1128 deletions(-) create mode 100644 sql/updates/world/master/2022_07_10_00_world.sql diff --git a/Source/Framework/Constants/BattleGroundsConst.cs b/Source/Framework/Constants/BattleGroundsConst.cs index de24591b3..8924627ac 100644 --- a/Source/Framework/Constants/BattleGroundsConst.cs +++ b/Source/Framework/Constants/BattleGroundsConst.cs @@ -233,16 +233,6 @@ namespace Framework.Constants Even = 2 // teams even: N vs N players } - public enum BattlegroundCriteriaId - { - ResilientVictory, - SaveTheDay, - EverythingCounts, - AvPerfection, - DefenseOfTheAncients, - NotEvenAScratch, - } - public struct BattlegroundBroadcastTexts { public const uint AllianceWins = 10633; diff --git a/Source/Game/Arenas/Arena.cs b/Source/Game/Arenas/Arena.cs index 4dd866add..c7577e9c7 100644 --- a/Source/Game/Arenas/Arena.cs +++ b/Source/Game/Arenas/Arena.cs @@ -77,16 +77,10 @@ namespace Game.Arenas CheckWinConditions(); } - public override void FillInitialWorldStates(InitWorldStates packet) - { - packet.AddState(ArenaWorldStates.AlivePlayersGreen, GetAlivePlayersCountByTeam(Team.Horde)); - packet.AddState(ArenaWorldStates.AlivePlayersGold, GetAlivePlayersCountByTeam(Team.Alliance)); - } - void UpdateArenaWorldState() { - UpdateWorldState(ArenaWorldStates.AlivePlayersGreen, GetAlivePlayersCountByTeam(Team.Horde)); - UpdateWorldState(ArenaWorldStates.AlivePlayersGold, GetAlivePlayersCountByTeam(Team.Alliance)); + UpdateWorldState(ArenaWorldStates.AlivePlayersGreen, (int)GetAlivePlayersCountByTeam(Team.Horde)); + UpdateWorldState(ArenaWorldStates.AlivePlayersGold, (int)GetAlivePlayersCountByTeam(Team.Alliance)); } public override void HandleKillPlayer(Player victim, Player killer) @@ -309,7 +303,15 @@ namespace Game.Arenas struct ArenaWorldStates { - public const uint AlivePlayersGreen = 3600; - public const uint AlivePlayersGold = 3601; + public const int AlivePlayersGreen = 3600; + public const int AlivePlayersGold = 3601; + public const int ShowAlivePlayers = 3610; + public const int TimeRemaining = 8529; + public const int ShowTimeRemaining = 8524; + public const int GreenTeamExtraLives = 15480; + public const int GoldTeamExtraLives = 15481; + public const int ShowExtraLives = 13401; + public const int SoloShuffleRound = 21427; + public const int ShowSoloShuffleRound = 21322; } } diff --git a/Source/Game/Arenas/Zones/BladesEdgeArena.cs b/Source/Game/Arenas/Zones/BladesEdgeArena.cs index 8fd75ae25..0335525c2 100644 --- a/Source/Game/Arenas/Zones/BladesEdgeArena.cs +++ b/Source/Game/Arenas/Zones/BladesEdgeArena.cs @@ -75,12 +75,6 @@ namespace Game.Arenas } } - public override void FillInitialWorldStates(InitWorldStates packet) - { - packet.AddState(0x9f3, 1); - base.FillInitialWorldStates(packet); - } - public override bool SetupBattleground() { bool result = true; diff --git a/Source/Game/Arenas/Zones/DalaranSewers.cs b/Source/Game/Arenas/Zones/DalaranSewers.cs index 451d3425e..4f4bfe14c 100644 --- a/Source/Game/Arenas/Zones/DalaranSewers.cs +++ b/Source/Game/Arenas/Zones/DalaranSewers.cs @@ -84,12 +84,6 @@ namespace Game.Arenas } } - public override void FillInitialWorldStates(InitWorldStates packet) - { - packet.AddState(3610, 1); - base.FillInitialWorldStates(packet); - } - public override bool SetupBattleground() { bool result = true; diff --git a/Source/Game/Arenas/Zones/NagrandArena.cs b/Source/Game/Arenas/Zones/NagrandArena.cs index 1dc54e173..7d66e376c 100644 --- a/Source/Game/Arenas/Zones/NagrandArena.cs +++ b/Source/Game/Arenas/Zones/NagrandArena.cs @@ -72,12 +72,6 @@ namespace Game.Arenas } } - public override void FillInitialWorldStates(InitWorldStates packet) - { - packet.AddState(0xa11, 1); - base.FillInitialWorldStates(packet); - } - public override bool SetupBattleground() { bool result = true; diff --git a/Source/Game/Arenas/Zones/RingofValor.cs b/Source/Game/Arenas/Zones/RingofValor.cs index f60c72cd5..c78be8d26 100644 --- a/Source/Game/Arenas/Zones/RingofValor.cs +++ b/Source/Game/Arenas/Zones/RingofValor.cs @@ -121,12 +121,6 @@ namespace Game.Arenas } } - public override void FillInitialWorldStates(InitWorldStates packet) - { - packet.AddState(0xe1a, 1); - base.FillInitialWorldStates(packet); - } - public override void PostUpdateImpl(uint diff) { if (GetStatus() != BattlegroundStatus.InProgress) diff --git a/Source/Game/Arenas/Zones/RuinsofLordaeron.cs b/Source/Game/Arenas/Zones/RuinsofLordaeron.cs index 2f514f364..b28fa8ba5 100644 --- a/Source/Game/Arenas/Zones/RuinsofLordaeron.cs +++ b/Source/Game/Arenas/Zones/RuinsofLordaeron.cs @@ -93,12 +93,6 @@ namespace Game.Arenas break; } } - - public override void FillInitialWorldStates(InitWorldStates packet) - { - packet.AddState(0xbba, 1); - base.FillInitialWorldStates(packet); - } } struct RuinsofLordaeronObjectTypes diff --git a/Source/Game/BattleGrounds/BattleGround.cs b/Source/Game/BattleGrounds/BattleGround.cs index b07e20a93..06d59d448 100644 --- a/Source/Game/BattleGrounds/BattleGround.cs +++ b/Source/Game/BattleGrounds/BattleGround.cs @@ -635,22 +635,14 @@ namespace Game.BattleGrounds } } - public void UpdateWorldState(uint variable, uint value, bool hidden = false) + public void UpdateWorldState(int worldStateId, int value, bool hidden = false) { - UpdateWorldState worldstate = new(); - worldstate.VariableID = variable; - worldstate.Value = (int)value; - worldstate.Hidden = hidden; - SendPacketToAll(worldstate); + Global.WorldStateMgr.SetValue(worldStateId, value, hidden, GetBgMap()); } - public void UpdateWorldState(uint variable, bool value, bool hidden = false) + public void UpdateWorldState(uint worldStateId, int value, bool hidden = false) { - UpdateWorldState worldstate = new(); - worldstate.VariableID = variable; - worldstate.Value = value ? 1 : 0; - worldstate.Hidden = hidden; - SendPacketToAll(worldstate); + Global.WorldStateMgr.SetValue((int)worldStateId, value, hidden, GetBgMap()); } public virtual void EndBattleground(Team winner) @@ -958,8 +950,6 @@ namespace Game.BattleGrounds PlayerScores.Clear(); - ResetBGSubclass(); - _playerPositions.Clear(); } @@ -1883,12 +1873,6 @@ namespace Game.BattleGrounds trigger, player.GetMapId(), player.GetPositionX(), player.GetPositionY(), player.GetPositionZ()); } - public virtual bool CheckAchievementCriteriaMeet(uint criteriaId, Player source, Unit target, uint miscvalue1 = 0) - { - Log.outError(LogFilter.Battleground, "Battleground.CheckAchievementCriteriaMeet: No implementation for criteria {0}", criteriaId); - return false; - } - public virtual bool SetupBattleground() { return true; @@ -1967,10 +1951,8 @@ namespace Game.BattleGrounds public virtual void StartingEventCloseDoors() { } public virtual void StartingEventOpenDoors() { } - public virtual void ResetBGSubclass() { } // must be implemented in BG subclass public virtual void DestroyGate(Player player, GameObject go) { } - public virtual bool IsAllNodesControlledByTeam(Team team) { return false; } public BattlegroundQueueTypeId GetQueueId() { return m_queueId; } public uint GetInstanceID() { return m_InstanceID; } @@ -2029,8 +2011,6 @@ namespace Game.BattleGrounds public void SetBgMap(BattlegroundMap map) { m_Map = map; } BattlegroundMap FindBgMap() { return m_Map; } - public virtual void FillInitialWorldStates(InitWorldStates data) { } - Group GetBgRaid(Team team) { return m_BgRaids[GetTeamIndexByTeamId(team)]; } public static int GetTeamIndexByTeamId(Team team) { return team == Team.Alliance ? TeamId.Alliance : TeamId.Horde; } diff --git a/Source/Game/BattleGrounds/Zones/ArathiBasin.cs b/Source/Game/BattleGrounds/Zones/ArathiBasin.cs index f7f32348c..1dcf8d7b4 100644 --- a/Source/Game/BattleGrounds/Zones/ArathiBasin.cs +++ b/Source/Game/BattleGrounds/Zones/ArathiBasin.cs @@ -47,7 +47,6 @@ namespace Game.BattleGrounds.Zones m_lastTick[i] = 0; m_HonorScoreTics[i] = 0; m_ReputationScoreTics[i] = 0; - m_TeamScores500Disadvantage[i] = false; } m_HonorTics = 0; @@ -163,14 +162,19 @@ namespace Game.BattleGrounds.Zones m_TeamScores[team] = MaxTeamScore; if (team == TeamId.Alliance) - UpdateWorldState(ABWorldStates.ResourcesAlly, m_TeamScores[team]); + UpdateWorldState(ABWorldStates.ResourcesAlly, (int)m_TeamScores[team]); else - UpdateWorldState(ABWorldStates.ResourcesHorde, m_TeamScores[team]); + UpdateWorldState(ABWorldStates.ResourcesHorde, (int)m_TeamScores[team]); // update achievement flags // we increased m_TeamScores[team] so we just need to check if it is 500 more than other teams resources int otherTeam = (team + 1) % SharedConst.PvpTeamsCount; if (m_TeamScores[team] > m_TeamScores[otherTeam] + 500) - m_TeamScores500Disadvantage[otherTeam] = true; + { + if (team == TeamId.Alliance) + UpdateWorldState(ABWorldStates.Had500DisadvantageHorde, 1); + else + UpdateWorldState(ABWorldStates.Had500DisadvantageAlliance, 1); + } } } @@ -290,51 +294,49 @@ namespace Game.BattleGrounds.Zones SpawnBGObject(obj, BattlegroundConst.RespawnOneDay); } - public override void FillInitialWorldStates(InitWorldStates packet) - { - byte[] plusArray = { 0, 2, 3, 0, 1 }; - - // Node icons - for (byte node = 0; node < ABBattlegroundNodes.DynamicNodesCount; ++node) - packet.AddState(NodeIcons[node], (m_Nodes[node] == 0)); - - // Node occupied states - for (byte node = 0; node < ABBattlegroundNodes.DynamicNodesCount; ++node) - for (byte i = 1; i < ABBattlegroundNodes.DynamicNodesCount; ++i) - packet.AddState(NodeStates[node] + plusArray[i], ((int)m_Nodes[node] == i)); - - // How many bases each team owns - byte ally = 0, horde = 0; - for (byte node = 0; node < ABBattlegroundNodes.DynamicNodesCount; ++node) - if (m_Nodes[node] == ABNodeStatus.AllyOccupied) - ++ally; - else if (m_Nodes[node] == ABNodeStatus.HordeOccupied) - ++horde; - - packet.AddState(ABWorldStates.OccupiedBasesAlly, ally); - packet.AddState(ABWorldStates.OccupiedBasesHorde, horde); - - // Team scores - packet.AddState(ABWorldStates.ResourcesMax, MaxTeamScore); - packet.AddState(ABWorldStates.ResourcesWarning, WarningNearVictoryScore); - packet.AddState(ABWorldStates.ResourcesAlly, m_TeamScores[TeamId.Alliance]); - packet.AddState(ABWorldStates.ResourcesHorde, m_TeamScores[TeamId.Horde]); - - // other unknown - packet.AddState(0x745, 0x2); - } - void _SendNodeUpdate(byte node) { // Send node owner state update to refresh map icons on client - byte[] plusArray = { 0, 2, 3, 0, 1 }; + int[] idPlusArray = { 0, 2, 3, 0, 1 }; + int[] statePlusArray = { 0, 2, 0, 2, 0 }; if (m_prevNodes[node] != 0) - UpdateWorldState(NodeStates[node] + plusArray[(int)m_prevNodes[node]], 0); + UpdateWorldState(NodeStates[node] + idPlusArray[(int)m_prevNodes[node]], 0); else UpdateWorldState(NodeIcons[node], 0); - UpdateWorldState(NodeStates[node] + plusArray[(byte)m_Nodes[node]], 1); + UpdateWorldState(NodeStates[node] + idPlusArray[(byte)m_Nodes[node]], 1); + + switch (node) + { + case ABBattlegroundNodes.NodeStables: + UpdateWorldState(ABWorldStates.StablesIconNew, (int)m_Nodes[node] + statePlusArray[(int)m_Nodes[node]]); + UpdateWorldState(ABWorldStates.StablesHordeControlState, m_Nodes[node] == ABNodeStatus.HordeOccupied ? 2 : (m_Nodes[node] == ABNodeStatus.HordeContested ? 1 : 0)); + UpdateWorldState(ABWorldStates.StablesAllianceControlState, m_Nodes[node] == ABNodeStatus.AllyOccupied ? 2 : (m_Nodes[node] == ABNodeStatus.AllyContested ? 1 : 0)); + break; + case ABBattlegroundNodes.NodeBlacksmith: + UpdateWorldState(ABWorldStates.BlacksmithIconNew, (int)m_Nodes[node] + statePlusArray[(int)m_Nodes[node]]); + UpdateWorldState(ABWorldStates.BlacksmithHordeControlState, m_Nodes[node] == ABNodeStatus.HordeOccupied ? 2 : (m_Nodes[node] == ABNodeStatus.HordeContested ? 1 : 0)); + UpdateWorldState(ABWorldStates.BlacksmithAllianceControlState, m_Nodes[node] == ABNodeStatus.AllyOccupied ? 2 : (m_Nodes[node] == ABNodeStatus.AllyContested ? 1 : 0)); + break; + case ABBattlegroundNodes.NodeFarm: + UpdateWorldState(ABWorldStates.FarmIconNew, (int)m_Nodes[node] + statePlusArray[(int)m_Nodes[node]]); + UpdateWorldState(ABWorldStates.FarmHordeControlState, m_Nodes[node] == ABNodeStatus.HordeOccupied ? 2 : (m_Nodes[node] == ABNodeStatus.HordeContested ? 1 : 0)); + UpdateWorldState(ABWorldStates.FarmAllianceControlState, m_Nodes[node] == ABNodeStatus.AllyOccupied ? 2 : (m_Nodes[node] == ABNodeStatus.AllyContested ? 1 : 0)); + break; + case ABBattlegroundNodes.NodeLumberMill: + UpdateWorldState(ABWorldStates.LumberMillIconNew, (int)m_Nodes[node] + statePlusArray[(int)m_Nodes[node]]); + UpdateWorldState(ABWorldStates.LumberMillHordeControlState, m_Nodes[node] == ABNodeStatus.HordeOccupied ? 2 : (m_Nodes[node] == ABNodeStatus.HordeContested ? 1 : 0)); + UpdateWorldState(ABWorldStates.LumberMillAllianceControlState, m_Nodes[node] == ABNodeStatus.AllyOccupied ? 2 : (m_Nodes[node] == ABNodeStatus.AllyContested ? 1 : 0)); + break; + case ABBattlegroundNodes.NodeGoldMine: + UpdateWorldState(ABWorldStates.GoldMineIconNew, (int)m_Nodes[node] + statePlusArray[(int)m_Nodes[node]]); + UpdateWorldState(ABWorldStates.GoldMineHordeControlState, m_Nodes[node] == ABNodeStatus.HordeOccupied ? 2 : (m_Nodes[node] == ABNodeStatus.HordeContested ? 1 : 0)); + UpdateWorldState(ABWorldStates.GoldMineAllianceControlState, m_Nodes[node] == ABNodeStatus.AllyOccupied ? 2 : (m_Nodes[node] == ABNodeStatus.AllyContested ? 1 : 0)); + break; + default: + break; + } // How many bases each team owns byte ally = 0, horde = 0; @@ -581,6 +583,9 @@ namespace Game.BattleGrounds.Zones } } + UpdateWorldState(ABWorldStates.ResourcesMax, MaxTeamScore); + UpdateWorldState(ABWorldStates.ResourcesWarning, WarningNearVictoryScore); + return true; } @@ -595,7 +600,6 @@ namespace Game.BattleGrounds.Zones m_lastTick[i] = 0; m_HonorScoreTics[i] = 0; m_ReputationScoreTics[i] = 0; - m_TeamScores500Disadvantage[i] = false; } m_IsInformedNearVictory = false; @@ -689,28 +693,6 @@ namespace Game.BattleGrounds.Zones return true; } - public override bool IsAllNodesControlledByTeam(Team team) - { - uint count = 0; - for (int i = 0; i < ABBattlegroundNodes.DynamicNodesCount; ++i) - if ((team == Team.Alliance && m_Nodes[i] == ABNodeStatus.AllyOccupied) || - (team == Team.Horde && m_Nodes[i] == ABNodeStatus.HordeOccupied)) - ++count; - - return count == ABBattlegroundNodes.DynamicNodesCount; - } - - public override bool CheckAchievementCriteriaMeet(uint criteriaId, Player player, Unit target, uint miscvalue) - { - switch ((BattlegroundCriteriaId)criteriaId) - { - case BattlegroundCriteriaId.ResilientVictory: - return m_TeamScores500Disadvantage[GetTeamIndexByTeamId(GetPlayerTeam(player.GetGUID()))]; - } - - return base.CheckAchievementCriteriaMeet(criteriaId, player, target, miscvalue); - } - /// /// Nodes info: /// 0: neutral @@ -729,8 +711,6 @@ namespace Game.BattleGrounds.Zones bool m_IsInformedNearVictory; uint m_HonorTics; uint m_ReputationTics; - // need for achievements - bool[] m_TeamScores500Disadvantage = new bool[SharedConst.PvpTeamsCount]; //Const public const uint NotABBGWeekendHonorTicks = 260; @@ -751,7 +731,7 @@ namespace Game.BattleGrounds.Zones public const int FlagCapturingTime = 60000; public const int WarningNearVictoryScore = 1400; - public const int MaxTeamScore = 1600; + public const int MaxTeamScore = 1500; public const uint ExploitTeleportLocationAlliance = 3705; public const uint ExploitTeleportLocationHorde = 3706; @@ -800,9 +780,9 @@ namespace Game.BattleGrounds.Zones new Position(714.61f, 646.15f, -10.87f, 4.34f) // horde starting base }; - public static uint[] NodeStates = { 1767, 1782, 1772, 1792, 1787 }; + public static int[] NodeStates = { 1767, 1782, 1772, 1792, 1787 }; - public static uint[] NodeIcons = { 1842, 1846, 1845, 1844, 1843 }; + public static int[] NodeIcons = { 1842, 1846, 1845, 1844, 1843 }; } class BattlegroundABScore : BattlegroundScore @@ -854,40 +834,58 @@ namespace Game.BattleGrounds.Zones #region Consts struct ABWorldStates { - public const uint OccupiedBasesHorde = 1778; - public const uint OccupiedBasesAlly = 1779; - public const uint ResourcesAlly = 1776; - public const uint ResourcesHorde = 1777; - public const uint ResourcesMax = 1780; - public const uint ResourcesWarning = 1955; - /* - public const uint StableIcon = 1842; //Stable Map Icon (None) - public const uint StableStateAlience = 1767; //Stable Map State (Alience) - public const uint StableStateHorde = 1768; //Stable Map State (Horde) - public const uint StableStateConAli = 1769; //Stable Map State (Con Alience) - public const uint StableStateConHor = 1770; //Stable Map State (Con Horde) - public const uint FarmIcon = 1845; //Farm Map Icon (None) - public const uint FarmStateAlience = 1772; //Farm State (Alience) - public const uint FarmStateHorde = 1773; //Farm State (Horde) - public const uint FarmStateConAli = 1774; //Farm State (Con Alience) - public const uint FarmStateConHor = 1775; //Farm State (Con Horde) + public const int OccupiedBasesHorde = 1778; + public const int OccupiedBasesAlly = 1779; + public const int ResourcesAlly = 1776; + public const int ResourcesHorde = 1777; + public const int ResourcesMax = 1780; + public const int ResourcesWarning = 1955; - public const uint BlacksmithIcon = 1846; //Blacksmith Map Icon (None) - public const uint BlacksmithStateAlience = 1782; //Blacksmith Map State (Alience) - public const uint BlacksmithStateHorde = 1783; //Blacksmith Map State (Horde) - public const uint BlacksmithStateConAli = 1784; //Blacksmith Map State (Con Alience) - public const uint BlacksmithStateConHor = 1785; //Blacksmith Map State (Con Horde) - public const uint LumbermillIcon = 1844; //Lumber Mill Map Icon (None) - public const uint LumbermillStateAlience = 1792; //Lumber Mill Map State (Alience) - public const uint LumbermillStateHorde = 1793; //Lumber Mill Map State (Horde) - public const uint LumbermillStateConAli = 1794; //Lumber Mill Map State (Con Alience) - public const uint LumbermillStateConHor = 1795; //Lumber Mill Map State (Con Horde) - public const uint GoldmineIcon = 1843; //Gold Mine Map Icon (None) - public const uint GoldmineStateAlience = 1787; //Gold Mine Map State (Alience) - public const uint GoldmineStateHorde = 1788; //Gold Mine Map State (Horde) - public const uint GoldmineStateConAli = 1789; //Gold Mine Map State (Con Alience - public const uint GoldmineStateConHor = 1790; //Gold Mine Map State (Con Horde) - */ + public const int StableIcon = 1842; // Stable Map Icon (None) + public const int StableStateAlience = 1767; // Stable Map State (Alience) + public const int StableStateHorde = 1768; // Stable Map State (Horde) + public const int StableStateConAli = 1769; // Stable Map State (Con Alience) + public const int StableStateConHor = 1770; // Stable Map State (Con Horde) + public const int FarmIcon = 1845; // Farm Map Icon (None) + public const int FarmStateAlience = 1772; // Farm State (Alience) + public const int FarmStateHorde = 1773; // Farm State (Horde) + public const int FarmStateConAli = 1774; // Farm State (Con Alience) + public const int FarmStateConHor = 1775; // Farm State (Con Horde) + public const int BlacksmithIcon = 1846; // Blacksmith Map Icon (None) + public const int BlacksmithStateAlience = 1782; // Blacksmith Map State (Alience) + public const int BlacksmithStateHorde = 1783; // Blacksmith Map State (Horde) + public const int BlacksmithStateConAli = 1784; // Blacksmith Map State (Con Alience) + public const int BlacksmithStateConHor = 1785; // Blacksmith Map State (Con Horde) + public const int LumbermillIcon = 1844; // Lumber Mill Map Icon (None) + public const int LumbermillStateAlience = 1792; // Lumber Mill Map State (Alience) + public const int LumbermillStateHorde = 1793; // Lumber Mill Map State (Horde) + public const int LumbermillStateConAli = 1794; // Lumber Mill Map State (Con Alience) + public const int LumbermillStateConHor = 1795; // Lumber Mill Map State (Con Horde) + public const int GoldmineIcon = 1843; // Gold Mine Map Icon (None) + public const int GoldmineStateAlience = 1787; // Gold Mine Map State (Alience) + public const int GoldmineStateHorde = 1788; // Gold Mine Map State (Horde) + public const int GoldmineStateConAli = 1789; // Gold Mine Map State (Con Alience + public const int GoldmineStateConHor = 1790; // Gold Mine Map State (Con Horde) + + public const int Had500DisadvantageAlliance = 3644; + public const int Had500DisadvantageHorde = 3645; + + public const int FarmIconNew = 8808; // Farm Map Icon + public const int LumberMillIconNew = 8805; // Lumber Mill Map Icon + public const int BlacksmithIconNew = 8799; // Blacksmith Map Icon + public const int GoldMineIconNew = 8809; // Gold Mine Map Icon + public const int StablesIconNew = 5834; // Stable Map Icon + + public const int FarmHordeControlState = 17328; + public const int FarmAllianceControlState = 17325; + public const int LumberMillHordeControlState = 17330; + public const int LumberMillAllianceControlState = 17326; + public const int BlacksmithHordeControlState = 17327; + public const int BlacksmithAllianceControlState = 17324; + public const int GoldMineHordeControlState = 17329; + public const int GoldMineAllianceControlState = 17323; + public const int StablesHordeControlState = 17331; + public const int StablesAllianceControlState = 17322; } // Note: code uses that these IDs follow each other @@ -1006,8 +1004,6 @@ namespace Game.BattleGrounds.Zones public uint TextHordeClaims; } - - enum ABNodeStatus { Neutral = 0, diff --git a/Source/Game/BattleGrounds/Zones/EyeofStorm.cs b/Source/Game/BattleGrounds/Zones/EyeofStorm.cs index b731765f5..fddc8b13a 100644 --- a/Source/Game/BattleGrounds/Zones/EyeofStorm.cs +++ b/Source/Game/BattleGrounds/Zones/EyeofStorm.cs @@ -300,8 +300,8 @@ namespace Game.BattleGrounds.Zones BattlegroundPointCaptureStatus captureStatus = GetPointCaptureStatus(point); if (m_LastPointCaptureStatus[point] != captureStatus) { - UpdateWorldState(EotSMisc.m_PointsIconStruct[point].WorldStateAllianceStatusBarIcon, (uint)(captureStatus == BattlegroundPointCaptureStatus.AllianceControlled ? 2 : (captureStatus == BattlegroundPointCaptureStatus.AllianceCapturing ? 1 : 0))); - UpdateWorldState(EotSMisc.m_PointsIconStruct[point].WorldStateHordeStatusBarIcon, (uint)(captureStatus == BattlegroundPointCaptureStatus.HordeControlled ? 2 : (captureStatus == BattlegroundPointCaptureStatus.HordeCapturing ? 1 : 0))); + UpdateWorldState(EotSMisc.m_PointsIconStruct[point].WorldStateAllianceStatusBarIcon, (int)(captureStatus == BattlegroundPointCaptureStatus.AllianceControlled ? 2 : (captureStatus == BattlegroundPointCaptureStatus.AllianceCapturing ? 1 : 0))); + UpdateWorldState(EotSMisc.m_PointsIconStruct[point].WorldStateHordeStatusBarIcon, (int)(captureStatus == BattlegroundPointCaptureStatus.HordeControlled ? 2 : (captureStatus == BattlegroundPointCaptureStatus.HordeCapturing ? 1 : 0))); m_LastPointCaptureStatus[point] = captureStatus; } } @@ -320,9 +320,9 @@ namespace Game.BattleGrounds.Zones } if (team == TeamId.Alliance) - UpdateWorldState(EotSWorldStateIds.AllianceResources, score); + UpdateWorldState(EotSWorldStateIds.AllianceResources, (int)score); else - UpdateWorldState(EotSWorldStateIds.HordeResources, score); + UpdateWorldState(EotSWorldStateIds.HordeResources, (int)score); } public override void EndBattleground(Team winner) @@ -342,9 +342,9 @@ namespace Game.BattleGrounds.Zones void UpdatePointsCount(Team team) { if (team == Team.Alliance) - UpdateWorldState(EotSWorldStateIds.AllianceBase, m_TeamPointsCount[TeamId.Alliance]); + UpdateWorldState(EotSWorldStateIds.AllianceBase, (int)m_TeamPointsCount[TeamId.Alliance]); else - UpdateWorldState(EotSWorldStateIds.HordeBase, m_TeamPointsCount[TeamId.Horde]); + UpdateWorldState(EotSWorldStateIds.HordeBase, (int)m_TeamPointsCount[TeamId.Horde]); } void UpdatePointsIcons(Team team, int Point) @@ -638,8 +638,8 @@ namespace Game.BattleGrounds.Zones player.CastSpell(player, BattlegroundConst.SpellRecentlyDroppedFlag, true); player.CastSpell(player, EotSMisc.SpellPlayerDroppedFlag, true); //this does not work correctly :((it should remove flag carrier name) - UpdateWorldState(EotSWorldStateIds.NetherstormFlagStateHorde, (uint)EotSFlagState.WaitRespawn); - UpdateWorldState(EotSWorldStateIds.NetherstormFlagStateAlliance, (uint)EotSFlagState.WaitRespawn); + UpdateWorldState(EotSWorldStateIds.NetherstormFlagStateHorde, (int)EotSFlagState.WaitRespawn); + UpdateWorldState(EotSWorldStateIds.NetherstormFlagStateAlliance, (int)EotSFlagState.WaitRespawn); if (GetPlayerTeam(player.GetGUID()) == Team.Alliance) SendBroadcastText(EotSBroadcastTexts.FlagDropped, ChatMsg.BgSystemAlliance, null); @@ -654,12 +654,12 @@ namespace Game.BattleGrounds.Zones if (GetPlayerTeam(player.GetGUID()) == Team.Alliance) { - UpdateWorldState(EotSWorldStateIds.NetherstormFlagStateAlliance, (uint)EotSFlagState.OnPlayer); + UpdateWorldState(EotSWorldStateIds.NetherstormFlagStateAlliance, (int)EotSFlagState.OnPlayer); PlaySoundToAll(EotSSoundIds.FlagPickedUpAlliance); } else { - UpdateWorldState(EotSWorldStateIds.NetherstormFlagStateHorde, (uint)EotSFlagState.OnPlayer); + UpdateWorldState(EotSWorldStateIds.NetherstormFlagStateHorde, (int)EotSFlagState.OnPlayer); PlaySoundToAll(EotSSoundIds.FlagPickedUpHorde); } @@ -847,54 +847,6 @@ namespace Game.BattleGrounds.Zones return true; } - public override void FillInitialWorldStates(InitWorldStates packet) - { - packet.AddState(EotSWorldStateIds.HordeBase, m_TeamPointsCount[TeamId.Horde]); - packet.AddState(EotSWorldStateIds.AllianceBase, m_TeamPointsCount[TeamId.Alliance]); - packet.AddState(0xAB6, 0x0); - packet.AddState(0xAB5, 0x0); - packet.AddState(0xAB4, 0x0); - packet.AddState(0xAB3, 0x0); - packet.AddState(0xAB2, 0x0); - packet.AddState(0xAB1, 0x0); - packet.AddState(0xAB0, 0x0); - packet.AddState(0xAAF, 0x0); - - packet.AddState((EotSWorldStateIds.DraeneiRuinsHordeControl), (m_PointOwnedByTeam[EotSPoints.DraeneiRuins] == Team.Horde && m_PointState[EotSPoints.DraeneiRuins] == EotSPointState.UnderControl)); - packet.AddState((EotSWorldStateIds.DraeneiRuinsAllianceControl), (m_PointOwnedByTeam[EotSPoints.DraeneiRuins] == Team.Alliance && m_PointState[EotSPoints.DraeneiRuins] == EotSPointState.UnderControl)); - packet.AddState((EotSWorldStateIds.DraeneiRuinsUncontrol), (m_PointState[EotSPoints.DraeneiRuins] != EotSPointState.UnderControl)); - packet.AddState((EotSWorldStateIds.MageTowerAllianceControl), (m_PointOwnedByTeam[EotSPoints.MageTower] == Team.Alliance && m_PointState[EotSPoints.MageTower] == EotSPointState.UnderControl)); - packet.AddState((EotSWorldStateIds.MageTowerHordeControl), (m_PointOwnedByTeam[EotSPoints.MageTower] == Team.Horde && m_PointState[EotSPoints.MageTower] == EotSPointState.UnderControl)); - packet.AddState((EotSWorldStateIds.MageTowerUncontrol), (m_PointState[EotSPoints.MageTower] != EotSPointState.UnderControl)); - packet.AddState((EotSWorldStateIds.FelReaverHordeControl), (m_PointOwnedByTeam[EotSPoints.FelReaver] == Team.Horde && m_PointState[EotSPoints.FelReaver] == EotSPointState.UnderControl)); - packet.AddState((EotSWorldStateIds.FelReaverAllianceControl), (m_PointOwnedByTeam[EotSPoints.FelReaver] == Team.Alliance && m_PointState[EotSPoints.FelReaver] == EotSPointState.UnderControl)); - packet.AddState((EotSWorldStateIds.FelReaverUncontrol), (m_PointState[EotSPoints.FelReaver] != EotSPointState.UnderControl)); - packet.AddState((EotSWorldStateIds.BloodElfHordeControl), (m_PointOwnedByTeam[EotSPoints.BloodElf] == Team.Horde && m_PointState[EotSPoints.BloodElf] == EotSPointState.UnderControl)); - packet.AddState((EotSWorldStateIds.BloodElfAllianceControl), (m_PointOwnedByTeam[EotSPoints.BloodElf] == Team.Alliance && m_PointState[EotSPoints.BloodElf] == EotSPointState.UnderControl)); - packet.AddState((EotSWorldStateIds.BloodElfUncontrol), (m_PointState[EotSPoints.BloodElf] != EotSPointState.UnderControl)); - packet.AddState((EotSWorldStateIds.NetherstormFlag), (m_FlagState == EotSFlagState.OnBase)); - - packet.AddState(0xAD2, 0x1); - packet.AddState(0xAD1, 0x1); - - packet.AddState(EotSWorldStateIds.HordeResources, GetTeamScore(TeamId.Horde)); - packet.AddState(EotSWorldStateIds.AllianceResources, GetTeamScore(TeamId.Alliance)); - packet.AddState(EotSWorldStateIds.MaxResources, EotSScoreIds.MaxTeamScore); - - packet.AddState(0xA05, 0x8E); - packet.AddState(0xAA0, 0x0); - packet.AddState(0xA9F, 0x0); - packet.AddState(0xA9E, 0x0); - packet.AddState(0xC0D, 0x17B); - - for (byte point = 0; point < EotSPoints.PointsMax; ++point) - { - BattlegroundPointCaptureStatus captureStatus = GetPointCaptureStatus(point); - packet.AddState(EotSMisc.m_PointsIconStruct[point].WorldStateAllianceStatusBarIcon, captureStatus == BattlegroundPointCaptureStatus.AllianceControlled ? 2 : (captureStatus == BattlegroundPointCaptureStatus.AllianceCapturing ? 1 : 0u)); - packet.AddState(EotSMisc.m_PointsIconStruct[point].WorldStateHordeStatusBarIcon, captureStatus == BattlegroundPointCaptureStatus.HordeControlled ? 2 : (captureStatus == BattlegroundPointCaptureStatus.HordeCapturing ? 1 : 0u)); - } - } - public override WorldSafeLocsEntry GetClosestGraveYard(Player player) { uint g_id; @@ -952,16 +904,6 @@ namespace Game.BattleGrounds.Zones return Global.ObjectMgr.GetWorldSafeLoc(team == Team.Alliance ? EotSMisc.ExploitTeleportLocationAlliance : EotSMisc.ExploitTeleportLocationHorde); } - public override bool IsAllNodesControlledByTeam(Team team) - { - uint count = 0; - for (int i = 0; i < EotSPoints.PointsMax; ++i) - if (m_PointOwnedByTeam[i] == team && m_PointState[i] == EotSPointState.UnderControl) - ++count; - - return count == EotSPoints.PointsMax; - } - public override Team GetPrematureWinner() { if (GetTeamScore(TeamId.Alliance) > GetTeamScore(TeamId.Horde)) @@ -1189,7 +1131,7 @@ namespace Game.BattleGrounds.Zones public const uint ProgressBarPercentGrey = 2720; //100 = Empty (Only Grey); 0 = Blue|Red (No Grey) public const uint ProgressBarStatus = 2719; //50 Init!; 48 ... Hordak Bere .. 33 .. 0 = Full 100% Hordacky; 100 = Full Alliance public const uint ProgressBarShow = 2718; //1 Init; 0 Druhy Send - Bez Messagu; 1 = Controlled Aliance - public const uint NetherstormFlag = 2757; + public const uint NetherstormFlag = 8863; //Set To 2 When Flag Is Picked Up; And To 1 If It Is Dropped public const uint NetherstormFlagStateAlliance = 9808; public const uint NetherstormFlagStateHorde = 9809; @@ -1373,7 +1315,7 @@ namespace Game.BattleGrounds.Zones struct EotSScoreIds { public const uint WarningNearVictoryScore = 1400; - public const uint MaxTeamScore = 1600; + public const uint MaxTeamScore = 1500; } enum EotSFlagState diff --git a/Source/Game/BattleGrounds/Zones/StrandofAncients.cs b/Source/Game/BattleGrounds/Zones/StrandofAncients.cs index c7699b57c..2789376a2 100644 --- a/Source/Game/BattleGrounds/Zones/StrandofAncients.cs +++ b/Source/Game/BattleGrounds/Zones/StrandofAncients.cs @@ -36,7 +36,6 @@ namespace Game.BattleGrounds.Zones SignaledRoundTwo = false; SignaledRoundTwoHalfMin = false; InitSecondRound = false; - _gateDestroyed = false; Attackers = TeamId.Alliance; TotalTime = 0; EndRoundTimer = 0; @@ -44,13 +43,12 @@ namespace Game.BattleGrounds.Zones Status = SAStatus.NotStarted; for (byte i = 0; i < GateStatus.Length; ++i) - GateStatus[i] = SAGateState.Ok; + GateStatus[i] = SAGateState.HordeGateOk; for (byte i = 0; i < 2; i++) { RoundScores[i].winner = TeamId.Alliance; RoundScores[i].time = 0; - _allVehiclesAlive[i] = true; } } @@ -59,11 +57,8 @@ namespace Game.BattleGrounds.Zones TotalTime = 0; Attackers = (RandomHelper.URand(0, 1) != 0 ? TeamId.Alliance : TeamId.Horde); for (byte i = 0; i <= 5; i++) - GateStatus[i] = SAGateState.Ok; + GateStatus[i] = SAGateState.HordeGateOk; ShipsStarted = false; - _gateDestroyed = false; - _allVehiclesAlive[TeamId.Alliance] = true; - _allVehiclesAlive[TeamId.Horde] = true; Status = SAStatus.Warmup; } @@ -94,7 +89,7 @@ namespace Game.BattleGrounds.Zones DelCreature(i); for (byte i = 0; i < GateStatus.Length; ++i) - GateStatus[i] = SAGateState.Ok; + GateStatus[i] = Attackers == TeamId.Horde ? SAGateState.AllianceGateOk : SAGateState.HordeGateOk; if (!AddCreature(SAMiscConst.NpcEntries[SACreatureTypes.Kanrethad], SACreatureTypes.Kanrethad, SAMiscConst.NpcSpawnlocs[SACreatureTypes.Kanrethad])) { @@ -223,13 +218,13 @@ namespace Game.BattleGrounds.Zones } //Player may enter BEFORE we set up BG - lets update his worldstates anyway... - UpdateWorldState(SAWorldStateIds.RightGyHorde, GraveyardStatus[SAGraveyards.RightCapturableGy] == TeamId.Horde ? 1 : 0u); - UpdateWorldState(SAWorldStateIds.LeftGyHorde, GraveyardStatus[SAGraveyards.LeftCapturableGy] == TeamId.Horde ? 1 : 0u); - UpdateWorldState(SAWorldStateIds.CenterGyHorde, GraveyardStatus[SAGraveyards.CentralCapturableGy] == TeamId.Horde ? 1 : 0u); + UpdateWorldState(SAWorldStateIds.RightGyHorde, GraveyardStatus[SAGraveyards.RightCapturableGy] == TeamId.Horde ? 1 : 0); + UpdateWorldState(SAWorldStateIds.LeftGyHorde, GraveyardStatus[SAGraveyards.LeftCapturableGy] == TeamId.Horde ? 1 : 0); + UpdateWorldState(SAWorldStateIds.CenterGyHorde, GraveyardStatus[SAGraveyards.CentralCapturableGy] == TeamId.Horde ? 1 : 0); - UpdateWorldState(SAWorldStateIds.RightGyAlliance, GraveyardStatus[SAGraveyards.RightCapturableGy] == TeamId.Alliance ? 1 : 0u); - UpdateWorldState(SAWorldStateIds.LeftGyAlliance, GraveyardStatus[SAGraveyards.LeftCapturableGy] == TeamId.Alliance ? 1 : 0u); - UpdateWorldState(SAWorldStateIds.CenterGyAlliance, GraveyardStatus[SAGraveyards.CentralCapturableGy] == TeamId.Alliance ? 1 : 0u); + UpdateWorldState(SAWorldStateIds.RightGyAlliance, GraveyardStatus[SAGraveyards.RightCapturableGy] == TeamId.Alliance ? 1 : 0); + UpdateWorldState(SAWorldStateIds.LeftGyAlliance, GraveyardStatus[SAGraveyards.LeftCapturableGy] == TeamId.Alliance ? 1 : 0); + UpdateWorldState(SAWorldStateIds.CenterGyAlliance, GraveyardStatus[SAGraveyards.CentralCapturableGy] == TeamId.Alliance ? 1 : 0); if (Attackers == TeamId.Alliance) { @@ -258,6 +253,7 @@ namespace Game.BattleGrounds.Zones UpdateWorldState(SAWorldStateIds.AllianceDefenceToken, 1); } + UpdateWorldState(SAWorldStateIds.AttackerTeam, Attackers); UpdateWorldState(SAWorldStateIds.PurpleGate, 1); UpdateWorldState(SAWorldStateIds.RedGate, 1); UpdateWorldState(SAWorldStateIds.BlueGate, 1); @@ -287,8 +283,8 @@ namespace Game.BattleGrounds.Zones if (ShipsStarted) return; - DoorOpen(SAObjectTypes.BoatOne); - DoorOpen(SAObjectTypes.BoatTwo); + GetBGObject(SAObjectTypes.BoatOne).SetGoState(GameObjectState.TransportStopped); + GetBGObject(SAObjectTypes.BoatTwo).SetGoState(GameObjectState.TransportStopped); for (int i = SAObjectTypes.BoatOne; i <= SAObjectTypes.BoatTwo; i++) { @@ -333,6 +329,7 @@ namespace Game.BattleGrounds.Zones if (Status == SAStatus.Warmup) { EndRoundTimer = SATimers.RoundLength; + UpdateWorldState(SAWorldStateIds.Timer, (int)(GameTime.GetGameTime() + EndRoundTimer)); if (TotalTime >= SATimers.WarmupLength) { Creature c = GetBGCreature(SACreatureTypes.Kanrethad); @@ -356,6 +353,7 @@ namespace Game.BattleGrounds.Zones else EndRoundTimer = SATimers.RoundLength; + UpdateWorldState(SAWorldStateIds.Timer, (int)(GameTime.GetGameTime() + EndRoundTimer)); if (TotalTime >= 60000) { Creature c = GetBGCreature(SACreatureTypes.Kanrethad); @@ -428,57 +426,10 @@ namespace Game.BattleGrounds.Zones } } if (Status == SAStatus.RoundOne || Status == SAStatus.RoundTwo) - { - SendTime(); UpdateDemolisherSpawns(); - } } } - public override void StartingEventCloseDoors() { } - - public override void StartingEventOpenDoors() { } - - public override void FillInitialWorldStates(InitWorldStates packet) - { - bool allyAttacks = Attackers == TeamId.Alliance; - bool hordeAttacks = Attackers == TeamId.Horde; - - packet.AddState(SAWorldStateIds.AncientGate, (uint)GateStatus[SAObjectTypes.AncientGate]); - packet.AddState(SAWorldStateIds.YellowGate, (uint)GateStatus[SAObjectTypes.YellowGate]); - packet.AddState(SAWorldStateIds.GreenGate, (uint)GateStatus[SAObjectTypes.GreenGate]); - packet.AddState(SAWorldStateIds.BlueGate, (uint)GateStatus[SAObjectTypes.BlueGate]); - packet.AddState(SAWorldStateIds.RedGate, (uint)GateStatus[SAObjectTypes.RedGate]); - packet.AddState(SAWorldStateIds.PurpleGate, (uint)GateStatus[SAObjectTypes.PurpleGate]); - - packet.AddState(SAWorldStateIds.BonusTimer, 0); - - packet.AddState(SAWorldStateIds.HordeAttacks, hordeAttacks); - packet.AddState(SAWorldStateIds.AllyAttacks, allyAttacks); - - // Time will be sent on first update... - packet.AddState(SAWorldStateIds.EnableTimer, TimerEnabled); - packet.AddState(SAWorldStateIds.TimerMins, 0); - packet.AddState(SAWorldStateIds.TimerSecTens, 0); - packet.AddState(SAWorldStateIds.TimerSecDecs, 0); - - packet.AddState(SAWorldStateIds.RightGyHorde, GraveyardStatus[SAGraveyards.RightCapturableGy] == TeamId.Horde); - packet.AddState(SAWorldStateIds.LeftGyHorde, GraveyardStatus[SAGraveyards.LeftCapturableGy] == TeamId.Horde); - packet.AddState(SAWorldStateIds.CenterGyHorde, GraveyardStatus[SAGraveyards.CentralCapturableGy] == TeamId.Horde); - - packet.AddState(SAWorldStateIds.RightGyAlliance, GraveyardStatus[SAGraveyards.RightCapturableGy] == TeamId.Alliance); - packet.AddState(SAWorldStateIds.LeftGyAlliance, GraveyardStatus[SAGraveyards.LeftCapturableGy] == TeamId.Alliance); - packet.AddState(SAWorldStateIds.CenterGyAlliance, GraveyardStatus[SAGraveyards.CentralCapturableGy] == TeamId.Alliance); - - packet.AddState(SAWorldStateIds.HordeDefenceToken, allyAttacks); - packet.AddState(SAWorldStateIds.AllianceDefenceToken, hordeAttacks); - - packet.AddState(SAWorldStateIds.LeftAttTokenHrd, hordeAttacks); - packet.AddState(SAWorldStateIds.RightAttTokenHrd, hordeAttacks); - packet.AddState(SAWorldStateIds.RightAttTokenAll, allyAttacks); - packet.AddState(SAWorldStateIds.LeftAttTokenAll, allyAttacks); - } - public override void AddPlayer(Player player) { bool isInBattleground = IsPlayerInBattleground(player.GetGUID()); @@ -561,85 +512,84 @@ namespace Game.BattleGrounds.Zones TitanRelicActivated(invoker.ToPlayer()); break; case GameObjectTypes.DestructibleBuilding: + { + SAGateInfo gate = GetGate(obj.GetEntry()); + if (gate != null) { - SAGateInfo gate = GetGate(obj.GetEntry()); - if (gate != null) + uint gateId = gate.GateId; + + // damaged + if (eventId == go.GetGoInfo().DestructibleBuilding.DamagedEvent) { - uint gateId = gate.GateId; + GateStatus[gateId] = Attackers == TeamId.Horde ? SAGateState.AllianceGateDamaged : SAGateState.HordeGateDamaged; - // damaged - if (eventId == go.GetGoInfo().DestructibleBuilding.DamagedEvent) + Creature c = obj.FindNearestCreature(SharedConst.WorldTrigger, 500.0f); + if (c) + SendChatMessage(c, (byte)gate.DamagedText, invoker); + + PlaySoundToAll(Attackers == TeamId.Alliance ? SASoundIds.WallAttackedAlliance : SASoundIds.WallAttackedHorde); + } + // destroyed + else if (eventId == go.GetGoInfo().DestructibleBuilding.DestroyedEvent) + { + GateStatus[gate.GateId] = Attackers == TeamId.Horde ? SAGateState.AllianceGateDestroyed : SAGateState.HordeGateDestroyed; + + if (gateId < 5) + DelObject((int)gateId + 14); + + Creature c = obj.FindNearestCreature(SharedConst.WorldTrigger, 500.0f); + if (c) + SendChatMessage(c, (byte)gate.DestroyedText, invoker); + + PlaySoundToAll(Attackers == TeamId.Alliance ? SASoundIds.WallDestroyedAlliance : SASoundIds.WallDestroyedHorde); + + bool rewardHonor = true; + switch (gateId) { - GateStatus[gateId] = SAGateState.Damaged; - - Creature c = obj.FindNearestCreature(SharedConst.WorldTrigger, 500.0f); - if (c) - SendChatMessage(c, (byte)gate.DamagedText, invoker); - - PlaySoundToAll(Attackers == TeamId.Alliance ? SASoundIds.WallAttackedAlliance : SASoundIds.WallAttackedHorde); + case SAObjectTypes.GreenGate: + if (IsGateDestroyed(SAObjectTypes.BlueGate)) + rewardHonor = false; + break; + case SAObjectTypes.BlueGate: + if (IsGateDestroyed(SAObjectTypes.GreenGate)) + rewardHonor = false; + break; + case SAObjectTypes.RedGate: + if (IsGateDestroyed(SAObjectTypes.PurpleGate)) + rewardHonor = false; + break; + case SAObjectTypes.PurpleGate: + if (IsGateDestroyed(SAObjectTypes.RedGate)) + rewardHonor = false; + break; + default: + break; } - // destroyed - else if (eventId == go.GetGoInfo().DestructibleBuilding.DestroyedEvent) + + if (invoker) { - GateStatus[gate.GateId] = SAGateState.Destroyed; - _gateDestroyed = true; - - if (gateId < 5) - DelObject((int)gateId + 14); - - Creature c = obj.FindNearestCreature(SharedConst.WorldTrigger, 500.0f); - if (c) - SendChatMessage(c, (byte)gate.DestroyedText, invoker); - - PlaySoundToAll(Attackers == TeamId.Alliance ? SASoundIds.WallDestroyedAlliance : SASoundIds.WallDestroyedHorde); - - bool rewardHonor = true; - switch (gateId) + Unit unit = invoker.ToUnit(); + if (unit) { - case SAObjectTypes.GreenGate: - if (GateStatus[SAObjectTypes.BlueGate] == SAGateState.Destroyed) - rewardHonor = false; - break; - case SAObjectTypes.BlueGate: - if (GateStatus[SAObjectTypes.GreenGate] == SAGateState.Destroyed) - rewardHonor = false; - break; - case SAObjectTypes.RedGate: - if (GateStatus[SAObjectTypes.PurpleGate] == SAGateState.Destroyed) - rewardHonor = false; - break; - case SAObjectTypes.PurpleGate: - if (GateStatus[SAObjectTypes.RedGate] == SAGateState.Destroyed) - rewardHonor = false; - break; - default: - break; - } - - if (invoker) - { - Unit unit = invoker.ToUnit(); - if (unit) + Player player = unit.GetCharmerOrOwnerPlayerOrPlayerItself(); + if (player) { - Player player = unit.GetCharmerOrOwnerPlayerOrPlayerItself(); - if (player) - { - UpdatePlayerScore(player, ScoreType.DestroyedWall, 1); - if (rewardHonor) - UpdatePlayerScore(player, ScoreType.BonusHonor, GetBonusHonorFromKill(1)); - } + UpdatePlayerScore(player, ScoreType.DestroyedWall, 1); + if (rewardHonor) + UpdatePlayerScore(player, ScoreType.BonusHonor, GetBonusHonorFromKill(1)); } } - - UpdateObjectInteractionFlags(); } - else - break; - UpdateWorldState(gate.WorldState, (uint)GateStatus[gateId]); + UpdateObjectInteractionFlags(); } - break; + else + break; + + UpdateWorldState(gate.WorldState, (int)GateStatus[gateId]); } + break; + } default: break; } @@ -651,7 +601,9 @@ namespace Game.BattleGrounds.Zones if (creature.GetEntry() == SACreatureIds.Demolisher) { UpdatePlayerScore(killer, ScoreType.DestroyedDemolisher, 1); - _allVehiclesAlive[Attackers] = false; + uint worldStateId = Attackers == TeamId.Horde ? SAWorldStateIds.DestroyedHordeVehicles : SAWorldStateIds.DestroyedAllianceVehicles; + int currentDestroyedVehicles = Global.WorldStateMgr.GetValue((int)worldStateId, GetBgMap()); + UpdateWorldState(worldStateId, currentDestroyedVehicles + 1); } } @@ -732,29 +684,21 @@ namespace Game.BattleGrounds.Zones return closest; } - void SendTime() - { - uint end_of_round = (EndRoundTimer - TotalTime); - UpdateWorldState(SAWorldStateIds.TimerMins, end_of_round / 60000); - UpdateWorldState(SAWorldStateIds.TimerSecTens, (end_of_round % 60000) / 10000); - UpdateWorldState(SAWorldStateIds.TimerSecDecs, ((end_of_round % 60000) % 10000) / 1000); - } - bool CanInteractWithObject(uint objectId) { switch (objectId) { case SAObjectTypes.TitanRelic: - if (GateStatus[SAObjectTypes.AncientGate] != SAGateState.Destroyed || GateStatus[SAObjectTypes.YellowGate] != SAGateState.Destroyed) + if (!IsGateDestroyed(SAObjectTypes.AncientGate) || !IsGateDestroyed(SAObjectTypes.YellowGate)) return false; goto case SAObjectTypes.CentralFlag; case SAObjectTypes.CentralFlag: - if (GateStatus[SAObjectTypes.RedGate] != SAGateState.Destroyed && GateStatus[SAObjectTypes.PurpleGate] != SAGateState.Destroyed) + if (!IsGateDestroyed(SAObjectTypes.RedGate) && !IsGateDestroyed(SAObjectTypes.PurpleGate)) return false; goto case SAObjectTypes.LeftFlag; case SAObjectTypes.LeftFlag: case SAObjectTypes.RightFlag: - if (GateStatus[SAObjectTypes.GreenGate] != SAGateState.Destroyed && GateStatus[SAObjectTypes.BlueGate] != SAGateState.Destroyed) + if (!IsGateDestroyed(SAObjectTypes.GreenGate) && !IsGateDestroyed(SAObjectTypes.BlueGate)) return false; break; default: @@ -830,77 +774,77 @@ namespace Game.BattleGrounds.Zones switch (i) { case SAGraveyards.LeftCapturableGy: + { + flag = SAObjectTypes.LeftFlag; + DelObject(flag); + AddObject(flag, (SAMiscConst.ObjEntries[flag] - (teamId == TeamId.Alliance ? 0 : 1u)), + SAMiscConst.ObjSpawnlocs[flag], 0, 0, 0, 0, BattlegroundConst.RespawnOneDay); + + npc = SACreatureTypes.Rigspark; + Creature rigspark = AddCreature(SAMiscConst.NpcEntries[npc], (int)npc, SAMiscConst.NpcSpawnlocs[npc], Attackers); + if (rigspark) + rigspark.GetAI().Talk(SATextIds.SparklightRigsparkSpawn); + + for (byte j = SACreatureTypes.Demolisher7; j <= SACreatureTypes.Demolisher8; j++) { - flag = SAObjectTypes.LeftFlag; - DelObject(flag); - AddObject(flag, (SAMiscConst.ObjEntries[flag] - (teamId == TeamId.Alliance ? 0 : 1u)), - SAMiscConst.ObjSpawnlocs[flag], 0, 0, 0, 0, BattlegroundConst.RespawnOneDay); - - npc = SACreatureTypes.Rigspark; - Creature rigspark = AddCreature(SAMiscConst.NpcEntries[npc], (int)npc, SAMiscConst.NpcSpawnlocs[npc], Attackers); - if (rigspark) - rigspark.GetAI().Talk(SATextIds.SparklightRigsparkSpawn); - - for (byte j = SACreatureTypes.Demolisher7; j <= SACreatureTypes.Demolisher8; j++) - { - AddCreature(SAMiscConst.NpcEntries[j], j, SAMiscConst.NpcSpawnlocs[j], (Attackers == TeamId.Alliance ? TeamId.Horde : TeamId.Alliance), 600); - Creature dem = GetBGCreature(j); - if (dem) - dem.SetFaction(SAMiscConst.Factions[Attackers]); - } - - UpdateWorldState(SAWorldStateIds.LeftGyAlliance, GraveyardStatus[i] == TeamId.Alliance); - UpdateWorldState(SAWorldStateIds.LeftGyHorde, GraveyardStatus[i] == TeamId.Horde); - - Creature c = source.FindNearestCreature(SharedConst.WorldTrigger, 500.0f); - if (c) - SendChatMessage(c, teamId == TeamId.Alliance ? SATextIds.WestGraveyardCapturedA : SATextIds.WestGraveyardCapturedH, source); + AddCreature(SAMiscConst.NpcEntries[j], j, SAMiscConst.NpcSpawnlocs[j], (Attackers == TeamId.Alliance ? TeamId.Horde : TeamId.Alliance), 600); + Creature dem = GetBGCreature(j); + if (dem) + dem.SetFaction(SAMiscConst.Factions[Attackers]); } - break; + + UpdateWorldState(SAWorldStateIds.LeftGyAlliance, GraveyardStatus[i] == TeamId.Alliance ? 1 : 0); + UpdateWorldState(SAWorldStateIds.LeftGyHorde, GraveyardStatus[i] == TeamId.Horde ? 1 : 0); + + Creature c = source.FindNearestCreature(SharedConst.WorldTrigger, 500.0f); + if (c) + SendChatMessage(c, teamId == TeamId.Alliance ? SATextIds.WestGraveyardCapturedA : SATextIds.WestGraveyardCapturedH, source); + } + break; case SAGraveyards.RightCapturableGy: + { + flag = SAObjectTypes.RightFlag; + DelObject(flag); + AddObject(flag, (SAMiscConst.ObjEntries[flag] - (teamId == TeamId.Alliance ? 0 : 1u)), + SAMiscConst.ObjSpawnlocs[flag], 0, 0, 0, 0, BattlegroundConst.RespawnOneDay); + + npc = SACreatureTypes.Sparklight; + Creature sparklight = AddCreature(SAMiscConst.NpcEntries[npc], (int)npc, SAMiscConst.NpcSpawnlocs[npc], Attackers); + if (sparklight) + sparklight.GetAI().Talk(SATextIds.SparklightRigsparkSpawn); + + for (byte j = SACreatureTypes.Demolisher5; j <= SACreatureTypes.Demolisher6; j++) { - flag = SAObjectTypes.RightFlag; - DelObject(flag); - AddObject(flag, (SAMiscConst.ObjEntries[flag] - (teamId == TeamId.Alliance ? 0 : 1u)), - SAMiscConst.ObjSpawnlocs[flag], 0, 0, 0, 0, BattlegroundConst.RespawnOneDay); + AddCreature(SAMiscConst.NpcEntries[j], j, SAMiscConst.NpcSpawnlocs[j], Attackers == TeamId.Alliance ? TeamId.Horde : TeamId.Alliance, 600); - npc = SACreatureTypes.Sparklight; - Creature sparklight = AddCreature(SAMiscConst.NpcEntries[npc], (int)npc, SAMiscConst.NpcSpawnlocs[npc], Attackers); - if (sparklight) - sparklight.GetAI().Talk(SATextIds.SparklightRigsparkSpawn); - - for (byte j = SACreatureTypes.Demolisher5; j <= SACreatureTypes.Demolisher6; j++) - { - AddCreature(SAMiscConst.NpcEntries[j], j, SAMiscConst.NpcSpawnlocs[j], Attackers == TeamId.Alliance ? TeamId.Horde : TeamId.Alliance, 600); - - Creature dem = GetBGCreature(j); - if (dem) - dem.SetFaction(SAMiscConst.Factions[Attackers]); - } - - UpdateWorldState(SAWorldStateIds.RightGyAlliance, GraveyardStatus[i] == TeamId.Alliance); - UpdateWorldState(SAWorldStateIds.RightGyHorde, GraveyardStatus[i] == TeamId.Horde); - - Creature c = source.FindNearestCreature(SharedConst.WorldTrigger, 500.0f); - if (c) - SendChatMessage(c, teamId == TeamId.Alliance ? SATextIds.EastGraveyardCapturedA : SATextIds.EastGraveyardCapturedH, source); + Creature dem = GetBGCreature(j); + if (dem) + dem.SetFaction(SAMiscConst.Factions[Attackers]); } - break; + + UpdateWorldState(SAWorldStateIds.RightGyAlliance, GraveyardStatus[i] == TeamId.Alliance ? 1 : 0); + UpdateWorldState(SAWorldStateIds.RightGyHorde, GraveyardStatus[i] == TeamId.Horde ? 1 : 0); + + Creature c = source.FindNearestCreature(SharedConst.WorldTrigger, 500.0f); + if (c) + SendChatMessage(c, teamId == TeamId.Alliance ? SATextIds.EastGraveyardCapturedA : SATextIds.EastGraveyardCapturedH, source); + } + break; case SAGraveyards.CentralCapturableGy: - { - flag = SAObjectTypes.CentralFlag; - DelObject(flag); - AddObject(flag, (SAMiscConst.ObjEntries[flag] - (teamId == TeamId.Alliance ? 0 : 1u)), - SAMiscConst.ObjSpawnlocs[flag], 0, 0, 0, 0, BattlegroundConst.RespawnOneDay); + { + flag = SAObjectTypes.CentralFlag; + DelObject(flag); + AddObject(flag, (SAMiscConst.ObjEntries[flag] - (teamId == TeamId.Alliance ? 0 : 1u)), + SAMiscConst.ObjSpawnlocs[flag], 0, 0, 0, 0, BattlegroundConst.RespawnOneDay); - UpdateWorldState(SAWorldStateIds.CenterGyAlliance, GraveyardStatus[i] == TeamId.Alliance); - UpdateWorldState(SAWorldStateIds.CenterGyHorde, GraveyardStatus[i] == TeamId.Horde); + UpdateWorldState(SAWorldStateIds.CenterGyAlliance, GraveyardStatus[i] == TeamId.Alliance ? 1 : 0); + UpdateWorldState(SAWorldStateIds.CenterGyHorde, GraveyardStatus[i] == TeamId.Horde ? 1 : 0); - Creature c = source.FindNearestCreature(SharedConst.WorldTrigger, 500.0f); - if (c) - SendChatMessage(c, teamId == TeamId.Alliance ? SATextIds.SouthGraveyardCapturedA : SATextIds.SouthGraveyardCapturedH, source); - } - break; + Creature c = source.FindNearestCreature(SharedConst.WorldTrigger, 500.0f); + if (c) + SendChatMessage(c, teamId == TeamId.Alliance ? SATextIds.SouthGraveyardCapturedA : SATextIds.SouthGraveyardCapturedH, source); + } + break; default: //ABORT(); break; @@ -981,7 +925,7 @@ namespace Game.BattleGrounds.Zones void ToggleTimer() { TimerEnabled = !TimerEnabled; - UpdateWorldState(SAWorldStateIds.EnableTimer, TimerEnabled); + UpdateWorldState(SAWorldStateIds.EnableTimer, TimerEnabled ? 1 : 0); } public override void EndBattleground(Team winner) @@ -1063,17 +1007,10 @@ namespace Game.BattleGrounds.Zones } } - public override bool CheckAchievementCriteriaMeet(uint criteriaId, Player source, Unit target, uint miscValue) + bool IsGateDestroyed(uint gateId) { - switch ((BattlegroundCriteriaId)criteriaId) - { - case BattlegroundCriteriaId.NotEvenAScratch: - return _allVehiclesAlive[GetTeamIndexByTeamId(GetPlayerTeam(source.GetGUID()))]; - case BattlegroundCriteriaId.DefenseOfTheAncients: - return GetTeamIndexByTeamId(GetPlayerTeam(source.GetGUID())) != Attackers && !_gateDestroyed; - } - - return base.CheckAchievementCriteriaMeet(criteriaId, source, target, miscValue); + Cypher.Assert(gateId < SAMiscConst.Gates.Length); + return GateStatus[gateId] == SAGateState.AllianceGateDestroyed || GateStatus[gateId] == SAGateState.HordeGateDestroyed; } public override bool IsSpellAllowed(uint spellId, Player player) @@ -1149,12 +1086,6 @@ namespace Game.BattleGrounds.Zones // for know if second round has been init bool InitSecondRound; Dictionary DemoliserRespawnList = new(); - - // Achievement: Defense of the Ancients - bool _gateDestroyed; - - // Achievement: Not Even a Scratch - bool[] _allVehiclesAlive = new bool[SharedConst.PvpTeamsCount]; } class BattlegroundSAScore : BattlegroundScore @@ -1455,9 +1386,14 @@ namespace Game.BattleGrounds.Zones enum SAGateState { - Ok = 1, - Damaged = 2, - Destroyed = 3 + // alliance is defender + AllianceGateOk = 1, + AllianceGateDamaged = 2, + AllianceGateDestroyed = 3, + // horde is defender + HordeGateOk = 4, + HordeGateDamaged = 5, + HordeGateDestroyed = 6, } enum SAEventIds @@ -1574,9 +1510,7 @@ namespace Game.BattleGrounds.Zones struct SAWorldStateIds { - public const uint TimerMins = 3559; - public const uint TimerSecTens = 3560; - public const uint TimerSecDecs = 3561; + public const uint Timer = 3557; public const uint AllyAttacks = 4352; public const uint HordeAttacks = 4353; public const uint PurpleGate = 3614; @@ -1599,6 +1533,9 @@ namespace Game.BattleGrounds.Zones public const uint CenterGyHorde = 3634; public const uint BonusTimer = 3571; public const uint EnableTimer = 3564; + public const uint AttackerTeam = 3690; + public const uint DestroyedAllianceVehicles = 3955; + public const uint DestroyedHordeVehicles = 3956; } struct SACreatureTypes diff --git a/Source/Game/BattleGrounds/Zones/WarsongGluch.cs b/Source/Game/BattleGrounds/Zones/WarsongGluch.cs index 5ea24c5e3..d31b7c5b7 100644 --- a/Source/Game/BattleGrounds/Zones/WarsongGluch.cs +++ b/Source/Game/BattleGrounds/Zones/WarsongGluch.cs @@ -37,7 +37,7 @@ namespace Game.BattleGrounds.Zones { if (GetStatus() == BattlegroundStatus.InProgress) { - if (GetElapsedTime() >= 27 * Time.Minute * Time.InMilliseconds) + if (GetElapsedTime() >= 17 * Time.Minute * Time.InMilliseconds) { if (GetTeamScore(TeamId.Alliance) == 0) { @@ -55,12 +55,6 @@ namespace Game.BattleGrounds.Zones else EndBattleground(Team.Alliance); } - // first update needed after 1 minute of game already in progress - else if (GetElapsedTime() > (_minutesElapsed * Time.Minute * Time.InMilliseconds) + 3 * Time.Minute * Time.InMilliseconds) - { - ++_minutesElapsed; - UpdateWorldState(WSGWorldStates.StateTimer, (uint)(25 - _minutesElapsed)); - } if (_flagState[TeamId.Alliance] == WSGFlagState.WaitRespawn) { @@ -172,9 +166,6 @@ namespace Game.BattleGrounds.Zones } for (int i = WSGObjectTypes.AFlag; i <= WSGObjectTypes.Berserkbuff2; ++i) SpawnBGObject(i, BattlegroundConst.RespawnOneDay); - - UpdateWorldState(WSGWorldStates.StateTimerActive, 1); - UpdateWorldState(WSGWorldStates.StateTimer, 25); } public override void StartingEventOpenDoors() @@ -192,8 +183,11 @@ namespace Game.BattleGrounds.Zones SpawnBGObject(WSGObjectTypes.DoorH3, BattlegroundConst.RespawnOneDay); SpawnBGObject(WSGObjectTypes.DoorH4, BattlegroundConst.RespawnOneDay); + UpdateWorldState(WSGWorldStates.StateTimerActive, 1); + UpdateWorldState(WSGWorldStates.StateTimer, (int)(GameTime.GetGameTime() + 15 * Time.Minute)); + // players joining later are not eligibles - TriggerGameEvent( 8563); + TriggerGameEvent(8563); } public override void AddPlayer(Player player) @@ -326,8 +320,6 @@ namespace Game.BattleGrounds.Zones if (winner != 0) { - UpdateWorldState(WSGWorldStates.FlagUnkAlliance, 0); - UpdateWorldState(WSGWorldStates.FlagUnkHorde, 0); UpdateWorldState(WSGWorldStates.FlagStateAlliance, 1); UpdateWorldState(WSGWorldStates.FlagStateHorde, 1); UpdateWorldState(WSGWorldStates.StateTimerActive, 0); @@ -413,18 +405,12 @@ namespace Game.BattleGrounds.Zones if (set) { player.CastSpell(player, BattlegroundConst.SpellRecentlyDroppedFlag, true); - UpdateFlagState(team, WSGFlagState.WaitRespawn); + UpdateFlagState(team, WSGFlagState.OnGround); if (team == Team.Alliance) - { SendBroadcastText(WSGBroadcastTexts.HordeFlagDropped, ChatMsg.BgSystemHorde, player); - UpdateWorldState(WSGWorldStates.FlagUnkHorde, 0xFFFFFFFF); - } else - { SendBroadcastText(WSGBroadcastTexts.AllianceFlagDropped, ChatMsg.BgSystemAlliance, player); - UpdateWorldState(WSGWorldStates.FlagUnkAlliance, 0xFFFFFFFF); - } _flagsDropTimer[GetTeamIndexByTeamId(GetOtherTeam(team))] = WSGTimerOrScore.FlagDropTime; } @@ -448,7 +434,6 @@ namespace Game.BattleGrounds.Zones _flagState[TeamId.Alliance] = WSGFlagState.OnPlayer; //update world state to show correct flag carrier UpdateFlagState(Team.Horde, WSGFlagState.OnPlayer); - UpdateWorldState(WSGWorldStates.FlagUnkAlliance, 1); player.CastSpell(player, WSGSpellId.SilverwingFlag, true); player.StartCriteriaTimer(CriteriaStartEvent.BeSpellTarget, WSGSpellId.SilverwingFlagPicked); if (_flagState[1] == WSGFlagState.OnPlayer) @@ -466,7 +451,6 @@ namespace Game.BattleGrounds.Zones _flagState[TeamId.Horde] = WSGFlagState.OnPlayer; //update world state to show correct flag carrier UpdateFlagState(Team.Alliance, WSGFlagState.OnPlayer); - UpdateWorldState(WSGWorldStates.FlagUnkHorde, 1); player.CastSpell(player, WSGSpellId.WarsongFlag, true); player.StartCriteriaTimer(CriteriaStartEvent.BeSpellTarget, WSGSpellId.WarsongFlagPicked); if (_flagState[0] == WSGFlagState.OnPlayer) @@ -500,7 +484,6 @@ namespace Game.BattleGrounds.Zones player.CastSpell(player, WSGSpellId.FocusedAssault, true); else if (_flagDebuffState == 2) player.CastSpell(player, WSGSpellId.BrutalAssault, true); - UpdateWorldState(WSGWorldStates.FlagUnkAlliance, 1); } //called in HandleGameObjectUseOpcode: //target_obj.Delete(); @@ -533,7 +516,6 @@ namespace Game.BattleGrounds.Zones player.CastSpell(player, WSGSpellId.FocusedAssault, true); else if (_flagDebuffState == 2) player.CastSpell(player, WSGSpellId.BrutalAssault, true); - UpdateWorldState(WSGWorldStates.FlagUnkHorde, 1); } //called in HandleGameObjectUseOpcode: //target_obj.Delete(); @@ -571,18 +553,39 @@ namespace Game.BattleGrounds.Zones void UpdateFlagState(Team team, WSGFlagState value) { - if (team == Team.Alliance) - UpdateWorldState(WSGWorldStates.FlagStateAlliance, (uint)value); + int transformValueToOtherTeamControlWorldState(WSGFlagState value) + { + switch (value) + { + case WSGFlagState.OnBase: + case WSGFlagState.OnGround: + case WSGFlagState.WaitRespawn: + return 1; + case WSGFlagState.OnPlayer: + return 2; + default: + return 0; + } + }; + + if (team == Team.Horde) + { + UpdateWorldState(WSGWorldStates.FlagStateAlliance, (int)value); + UpdateWorldState(WSGWorldStates.FlagControlHorde, transformValueToOtherTeamControlWorldState(value)); + } else - UpdateWorldState(WSGWorldStates.FlagStateHorde, (uint)value); + { + UpdateWorldState(WSGWorldStates.FlagStateHorde, (int)value); + UpdateWorldState(WSGWorldStates.FlagControlAlliance, transformValueToOtherTeamControlWorldState(value)); + } } void UpdateTeamScore(int team) { if (team == TeamId.Alliance) - UpdateWorldState(WSGWorldStates.FlagCapturesAlliance, GetTeamScore(team)); + UpdateWorldState(WSGWorldStates.FlagCapturesAlliance, (int)GetTeamScore(team)); else - UpdateWorldState(WSGWorldStates.FlagCapturesHorde, GetTeamScore(team)); + UpdateWorldState(WSGWorldStates.FlagCapturesHorde, (int)GetTeamScore(team)); } public override void HandleAreaTrigger(Player player, uint trigger, bool entered) @@ -723,7 +726,6 @@ namespace Game.BattleGrounds.Zones m_HonorWinKills = 1; m_HonorEndKills = 2; } - _minutesElapsed = 0; _lastFlagCaptureTeam = 0; _bothFlagsKept = false; _flagDebuffState = 0; @@ -805,46 +807,6 @@ namespace Game.BattleGrounds.Zones return Global.ObjectMgr.GetWorldSafeLoc(team == Team.Alliance ? ExploitTeleportLocationAlliance : ExploitTeleportLocationHorde); } - public override void FillInitialWorldStates(InitWorldStates packet) - { - packet.AddState(WSGWorldStates.FlagCapturesAlliance, GetTeamScore(TeamId.Alliance)); - packet.AddState(WSGWorldStates.FlagCapturesHorde, GetTeamScore(TeamId.Horde)); - - if (_flagState[TeamId.Alliance] == WSGFlagState.OnGround) - packet.AddState(WSGWorldStates.FlagUnkAlliance, 0xFFFFFFFF); - else if (_flagState[TeamId.Alliance] == WSGFlagState.OnPlayer) - packet.AddState(WSGWorldStates.FlagUnkAlliance, 1); - else - packet.AddState(WSGWorldStates.FlagUnkAlliance, 0); - - if (_flagState[TeamId.Horde] == WSGFlagState.OnGround) - packet.AddState(WSGWorldStates.FlagUnkHorde, 0xFFFFFFFF); - else if (_flagState[TeamId.Horde] == WSGFlagState.OnPlayer) - packet.AddState(WSGWorldStates.FlagUnkHorde, 1); - else - packet.AddState(WSGWorldStates.FlagUnkHorde, 0); - - packet.AddState(WSGWorldStates.FlagCapturesMax, (int)WSGTimerOrScore.MaxTeamScore); - - if (GetStatus() == BattlegroundStatus.InProgress) - { - packet.AddState(WSGWorldStates.StateTimerActive, 1); - packet.AddState(WSGWorldStates.StateTimer, 25u - _minutesElapsed); - } - else - packet.AddState(WSGWorldStates.StateTimerActive, 0); - - if (_flagState[TeamId.Horde] == WSGFlagState.OnPlayer) - packet.AddState(WSGWorldStates.FlagStateHorde, 2); - else - packet.AddState(WSGWorldStates.FlagStateHorde, 1); - - if (_flagState[TeamId.Alliance] == WSGFlagState.OnPlayer) - packet.AddState(WSGWorldStates.FlagStateAlliance, 2); - else - packet.AddState(WSGWorldStates.FlagStateAlliance, 1); - } - public override Team GetPrematureWinner() { if (GetTeamScore(TeamId.Alliance) > GetTeamScore(TeamId.Horde)) @@ -855,23 +817,6 @@ namespace Game.BattleGrounds.Zones return base.GetPrematureWinner(); } - public override bool CheckAchievementCriteriaMeet(uint criteriaId, Player player, Unit target, uint miscValue) - { - switch (criteriaId) - { - case (uint)BattlegroundCriteriaId.SaveTheDay: - if (target) - { - Player playerTarget = target.ToPlayer(); - if (playerTarget) - return GetFlagState(GetPlayerTeam(playerTarget.GetGUID())) == WSGFlagState.OnBase; - } - return false; - } - - return base.CheckAchievementCriteriaMeet(criteriaId, player, target, miscValue); - } - public override ObjectGuid GetFlagPickerGUID(int team = -1) { if (team == TeamId.Alliance || team == TeamId.Horde) @@ -910,7 +855,6 @@ namespace Game.BattleGrounds.Zones int _flagSpellForceTimer; bool _bothFlagsKept; byte _flagDebuffState; // 0 - no debuffs, 1 - focused assault, 2 - brutal assault - byte _minutesElapsed; uint[][] Honor = { @@ -964,12 +908,13 @@ namespace Game.BattleGrounds.Zones MapComplete, RewardNum } + enum WSGFlagState { - OnBase = 0, - WaitRespawn = 1, + OnBase = 1, OnPlayer = 2, - OnGround = 3 + OnGround = 3, + WaitRespawn = 4 } struct WSGObjectTypes @@ -994,6 +939,7 @@ namespace Game.BattleGrounds.Zones public const int Berserkbuff2 = 17; public const int Max = 18; } + public sealed class WSGObjectEntry { public const uint DoorA1 = 179918; @@ -1022,14 +968,17 @@ namespace Game.BattleGrounds.Zones struct WSGWorldStates { - public const uint FlagUnkAlliance = 1545; - public const uint FlagUnkHorde = 1546; - // FlagUnk = 1547; + public const uint FlagStateAlliance = 1545; + public const uint FlagStateHorde = 1546; + public const uint FlagStateNeutral = 1547; // Unused + public const uint HordeFlagCountPickedUp = 17712; // Brawl + public const uint AllianceFlagCountPickedUp = 17713; // Brawl public const uint FlagCapturesAlliance = 1581; public const uint FlagCapturesHorde = 1582; public const uint FlagCapturesMax = 1601; - public const uint FlagStateHorde = 2338; - public const uint FlagStateAlliance = 2339; + public const uint FlagCapturesMaxNew = 17303; + public const uint FlagControlHorde = 2338; + public const uint FlagControlAlliance = 2339; public const uint StateTimer = 4248; public const uint StateTimerActive = 4247; } diff --git a/Source/Game/Entities/GameObject/GameObject.cs b/Source/Game/Entities/GameObject/GameObject.cs index f709dc13c..2c8fe8d2e 100644 --- a/Source/Game/Entities/GameObject/GameObject.cs +++ b/Source/Game/Entities/GameObject/GameObject.cs @@ -3182,7 +3182,7 @@ namespace Game.Entities packet.CapturePointInfo.CaptureTotalDuration = TimeSpan.FromMilliseconds(GetGoInfo().CapturePoint.CaptureTime); packet.CapturePointInfo.CaptureTime = m_goValue.CapturePoint.AssaultTimer; bg.SendPacketToAll(packet); - bg.UpdateWorldState(GetGoInfo().CapturePoint.worldState1, (byte)m_goValue.CapturePoint.State); + bg.UpdateWorldState((int)GetGoInfo().CapturePoint.worldState1, (byte)m_goValue.CapturePoint.State); } } } diff --git a/Source/Game/Entities/Player/Player.cs b/Source/Game/Entities/Player/Player.cs index 9470282ec..49bc4dabc 100644 --- a/Source/Game/Entities/Player/Player.cs +++ b/Source/Game/Entities/Player/Player.cs @@ -896,7 +896,7 @@ namespace Game.Entities return m_petStable; } - + // last used pet number (for BG's) public uint GetLastPetNumber() { return m_lastpetnumber; } public void SetLastPetNumber(uint petnumber) { m_lastpetnumber = petnumber; } @@ -1287,19 +1287,19 @@ namespace Game.Entities switch ((CurrencyTypes)currency.Id) { case CurrencyTypes.ApexisCrystals: - { - uint apexiscap = WorldConfig.GetUIntValue(WorldCfg.CurrencyMaxApexisCrystals); - if (apexiscap > 0) - cap = apexiscap; - break; - } + { + uint apexiscap = WorldConfig.GetUIntValue(WorldCfg.CurrencyMaxApexisCrystals); + if (apexiscap > 0) + cap = apexiscap; + break; + } case CurrencyTypes.JusticePoints: - { - uint justicecap = WorldConfig.GetUIntValue(WorldCfg.CurrencyMaxJusticePoints); - if (justicecap > 0) - cap = justicecap; - break; - } + { + uint justicecap = WorldConfig.GetUIntValue(WorldCfg.CurrencyMaxJusticePoints); + if (justicecap > 0) + cap = justicecap; + break; + } } return cap; @@ -2201,7 +2201,7 @@ namespace Game.Entities m_ExtraFlags &= ~PlayerExtraFlags.AcceptWhispers; } public bool IsGameMaster() { return m_ExtraFlags.HasAnyFlag(PlayerExtraFlags.GMOn); } - public bool IsGameMasterAcceptingWhispers() { return IsGameMaster() && IsAcceptWhispers(); } + public bool IsGameMasterAcceptingWhispers() { return IsGameMaster() && IsAcceptWhispers(); } public bool CanBeGameMaster() { return GetSession().HasPermission(RBACPermissions.CommandGm); } public void SetGameMaster(bool on) { @@ -2497,18 +2497,18 @@ namespace Game.Entities switch ((GossipOption)gossipOptionType) { case GossipOption.Gossip: + { + if (menuItemData.GossipActionPoi != 0) + PlayerTalkClass.SendPointOfInterest(menuItemData.GossipActionPoi); + + if (menuItemData.GossipActionMenuId != 0) { - if (menuItemData.GossipActionPoi != 0) - PlayerTalkClass.SendPointOfInterest(menuItemData.GossipActionPoi); - - if (menuItemData.GossipActionMenuId != 0) - { - PrepareGossipMenu(source, menuItemData.GossipActionMenuId); - SendPreparedGossip(source); - } - - break; + PrepareGossipMenu(source, menuItemData.GossipActionMenuId); + SendPreparedGossip(source); } + + break; + } case GossipOption.Outdoorpvp: Global.OutdoorPvPMgr.HandleGossipOption(this, source.ToCreature(), gossipListId); break; @@ -2562,18 +2562,18 @@ namespace Game.Entities SendPreparedGossip(source); break; case GossipOption.Battlefield: + { + BattlegroundTypeId bgTypeId = Global.BattlegroundMgr.GetBattleMasterBG(source.GetEntry()); + + if (bgTypeId == BattlegroundTypeId.None) { - BattlegroundTypeId bgTypeId = Global.BattlegroundMgr.GetBattleMasterBG(source.GetEntry()); - - if (bgTypeId == BattlegroundTypeId.None) - { - Log.outError(LogFilter.Player, "a user (guid {0}) requested Battlegroundlist from a npc who is no battlemaster", GetGUID().ToString()); - return; - } - - Global.BattlegroundMgr.SendBattlegroundList(this, guid, bgTypeId); - break; + Log.outError(LogFilter.Player, "a user (guid {0}) requested Battlegroundlist from a npc who is no battlemaster", GetGUID().ToString()); + return; } + + Global.BattlegroundMgr.SendBattlegroundList(this, guid, bgTypeId); + break; + } case GossipOption.Transmogrifier: GetSession().SendOpenTransmogrifier(guid); break; @@ -2589,7 +2589,7 @@ namespace Game.Entities return GetGossipTextId(GetDefaultGossipMenuForSource(source), source); } - + public uint GetGossipTextId(uint menuId, WorldObject source) { uint textId = SharedConst.DefaultGossipMessage; @@ -2869,7 +2869,7 @@ namespace Game.Entities public void SendBindPointUpdate() { BindPointUpdate packet = new(); - packet.BindPosition = new (homebind.GetPositionX(), homebind.GetPositionY(), homebind.GetPositionZ()); + packet.BindPosition = new(homebind.GetPositionX(), homebind.GetPositionY(), homebind.GetPositionZ()); packet.BindMapID = homebind.GetMapId(); packet.BindAreaID = homebindAreaId; SendPacket(packet); @@ -2904,7 +2904,6 @@ namespace Game.Entities void SendInitWorldStates(uint zoneId, uint areaId) { // data depends on zoneid/mapid... - Battleground bg = GetBattleground(); uint mapid = GetMapId(); OutdoorPvP pvp = Global.OutdoorPvPMgr.GetOutdoorPvPToZoneId(zoneId); @@ -2969,182 +2968,6 @@ namespace Game.Entities packet.AddState(2324, 0); // AQ_SANDWORM_SW packet.AddState(2325, 0); // AQ_SANDWORM_E break; - case 2597: // Alterac Valley - if (bg && bg.GetTypeID(true) == BattlegroundTypeId.AV) - bg.FillInitialWorldStates(packet); - else - { - packet.AddState(1966, 1); // AV_SNOWFALL_N - packet.AddState(1330, 1); // AV_FROSTWOLFHUT_H_C - packet.AddState(1329, 0); // AV_FROSTWOLFHUT_A_C - packet.AddState(1326, 0); // AV_AID_A_A - packet.AddState(1393, 0); // East Frostwolf Tower Horde Assaulted - UNUSED - packet.AddState(1392, 0); // West Frostwolf Tower Horde Assaulted - UNUSED - packet.AddState(1383, 1); // AV_FROSTWOLFE_CONTROLLED - packet.AddState(1382, 1); // AV_FROSTWOLFW_CONTROLLED - packet.AddState(1360, 1); // AV_N_MINE_N - packet.AddState(1348, 0); // AV_ICEBLOOD_A_A - packet.AddState(1334, 0); // AV_PIKEGRAVE_H_C - packet.AddState(1333, 1); // AV_PIKEGRAVE_A_C - packet.AddState(1304, 0); // AV_STONEHEART_A_A - packet.AddState(1303, 0); // AV_STONEHEART_H_A - packet.AddState(1396, 0); // unk - packet.AddState(1395, 0); // Iceblood Tower Horde Assaulted - UNUSED - packet.AddState(1394, 0); // Towerpoint Horde Assaulted - UNUSED - packet.AddState(1391, 0); // unk - packet.AddState(1390, 0); // AV_ICEBLOOD_ASSAULTED - packet.AddState(1389, 0); // AV_TOWERPOINT_ASSAULTED - packet.AddState(1388, 0); // AV_FROSTWOLFE_ASSAULTED - packet.AddState(1387, 0); // AV_FROSTWOLFW_ASSAULTED - packet.AddState(1386, 1); // unk - packet.AddState(1385, 1); // AV_ICEBLOOD_CONTROLLED - packet.AddState(1384, 1); // AV_TOWERPOINT_CONTROLLED - packet.AddState(1381, 0); // AV_STONEH_ASSAULTED - packet.AddState(1380, 0); // AV_ICEWING_ASSAULTED - packet.AddState(1379, 0); // AV_DUNN_ASSAULTED - packet.AddState(1378, 0); // AV_DUNS_ASSAULTED - packet.AddState(1377, 0); // Stoneheart Bunker Alliance Assaulted - UNUSED - packet.AddState(1376, 0); // Icewing Bunker Alliance Assaulted - UNUSED - packet.AddState(1375, 0); // Dunbaldar South Alliance Assaulted - UNUSED - packet.AddState(1374, 0); // Dunbaldar North Alliance Assaulted - UNUSED - packet.AddState(1373, 0); // AV_STONEH_DESTROYED - packet.AddState(966, 0); // AV_UNK_02 - packet.AddState(964, 0); // AV_UNK_01 - packet.AddState(962, 0); // AV_STORMPIKE_COMMANDERS - packet.AddState(1302, 1); // AV_STONEHEART_A_C - packet.AddState(1301, 0); // AV_STONEHEART_H_C - packet.AddState(950, 0); // AV_STORMPIKE_LIEUTENANTS - packet.AddState(1372, 0); // AV_ICEWING_DESTROYED - packet.AddState(1371, 0); // AV_DUNN_DESTROYED - packet.AddState(1370, 0); // AV_DUNS_DESTROYED - packet.AddState(1369, 0); // unk - packet.AddState(1368, 0); // AV_ICEBLOOD_DESTROYED - packet.AddState(1367, 0); // AV_TOWERPOINT_DESTROYED - packet.AddState(1366, 0); // AV_FROSTWOLFE_DESTROYED - packet.AddState(1365, 0); // AV_FROSTWOLFW_DESTROYED - packet.AddState(1364, 1); // AV_STONEH_CONTROLLED - packet.AddState(1363, 1); // AV_ICEWING_CONTROLLED - packet.AddState(1362, 1); // AV_DUNN_CONTROLLED - packet.AddState(1361, 1); // AV_DUNS_CONTROLLED - packet.AddState(1359, 0); // AV_N_MINE_H - packet.AddState(1358, 0); // AV_N_MINE_A - packet.AddState(1357, 1); // AV_S_MINE_N - packet.AddState(1356, 0); // AV_S_MINE_H - packet.AddState(1355, 0); // AV_S_MINE_A - packet.AddState(1349, 0); // AV_ICEBLOOD_H_A - packet.AddState(1347, 1); // AV_ICEBLOOD_H_C - packet.AddState(1346, 0); // AV_ICEBLOOD_A_C - packet.AddState(1344, 0); // AV_SNOWFALL_H_A - packet.AddState(1343, 0); // AV_SNOWFALL_A_A - packet.AddState(1342, 0); // AV_SNOWFALL_H_C - packet.AddState(1341, 0); // AV_SNOWFALL_A_C - packet.AddState(1340, 0); // AV_FROSTWOLF_H_A - packet.AddState(1339, 0); // AV_FROSTWOLF_A_A - packet.AddState(1338, 1); // AV_FROSTWOLF_H_C - packet.AddState(1337, 0); // AV_FROSTWOLF_A_C - packet.AddState(1336, 0); // AV_PIKEGRAVE_H_A - packet.AddState(1335, 0); // AV_PIKEGRAVE_A_A - packet.AddState(1332, 0); // AV_FROSTWOLFHUT_H_A - packet.AddState(1331, 0); // AV_FROSTWOLFHUT_A_A - packet.AddState(1328, 0); // AV_AID_H_A - packet.AddState(1327, 0); // AV_AID_H_C - packet.AddState(1325, 1); // AV_AID_A_C - } - break; - case 3277: // Warsong Gulch - if (bg && bg.GetTypeID(true) == BattlegroundTypeId.WS) - bg.FillInitialWorldStates(packet); - else - { - packet.AddState(1581, 0); // alliance flag captures - packet.AddState(1582, 0); // horde flag captures - packet.AddState(1545, 0); // unk, set to 1 on alliance flag pickup... - packet.AddState(1546, 0); // unk, set to 1 on horde flag pickup, after drop it's -1 - packet.AddState(1547, 2); // unk - packet.AddState(1601, 3); // unk (max flag captures?) - packet.AddState(2338, 1); // horde (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) - packet.AddState(2339, 1); // alliance (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) - } - break; - case 3358: // Arathi Basin - if (bg && (bg.GetTypeID(true) == BattlegroundTypeId.AB || bg.GetTypeID(true) == BattlegroundTypeId.DomAb)) - bg.FillInitialWorldStates(packet); - else - { - packet.AddState(1767, 0); // stables alliance - packet.AddState(1768, 0); // stables horde - packet.AddState(1769, 0); // stables alliance controlled - packet.AddState(1770, 0); // stables horde controlled - packet.AddState(1772, 0); // farm alliance - packet.AddState(1773, 0); // farm horde - packet.AddState(1774, 0); // farm alliance controlled - packet.AddState(1775, 0); // farm horde controlled - packet.AddState(1776, 0); // alliance resources - packet.AddState(1777, 0); // horde resources - packet.AddState(1778, 0); // horde bases - packet.AddState(1779, 0); // alliance bases - packet.AddState(1780, 2000); // max resources (2000) - packet.AddState(1782, 0); // blacksmith alliance - packet.AddState(1783, 0); // blacksmith horde - packet.AddState(1784, 0); // blacksmith alliance controlled - packet.AddState(1785, 0); // blacksmith horde controlled - packet.AddState(1787, 0); // gold mine alliance - packet.AddState(1788, 0); // gold mine horde - packet.AddState(1789, 0); // gold mine alliance controlled - packet.AddState(1790, 0); // gold mine horde controlled - packet.AddState(1792, 0); // lumber mill alliance - packet.AddState(1793, 0); // lumber mill horde - packet.AddState(1794, 0); // lumber mill alliance controlled - packet.AddState(1795, 0); // lumber mill horde controlled - packet.AddState(1842, 1); // stables (1 - uncontrolled) - packet.AddState(1843, 1); // gold mine (1 - uncontrolled) - packet.AddState(1844, 1); // lumber mill (1 - uncontrolled) - packet.AddState(1845, 1); // farm (1 - uncontrolled) - packet.AddState(1846, 1); // blacksmith (1 - uncontrolled) - packet.AddState(1861, 2); // unk - packet.AddState(1955, 1800); // warning limit (1800) - } - break; - case 3820: // Eye of the Storm - if (bg && bg.GetTypeID(true) == BattlegroundTypeId.EY) - bg.FillInitialWorldStates(packet); - else - { - packet.AddState(2753, 0); // Horde Bases - packet.AddState(2752, 0); // Alliance Bases - packet.AddState(2742, 0); // Mage Tower - Horde conflict - packet.AddState(2741, 0); // Mage Tower - Alliance conflict - packet.AddState(2740, 0); // Fel Reaver - Horde conflict - packet.AddState(2739, 0); // Fel Reaver - Alliance conflict - packet.AddState(2738, 0); // Draenei - Alliance conflict - packet.AddState(2737, 0); // Draenei - Horde conflict - packet.AddState(2736, 0); // unk (0 at start) - packet.AddState(2735, 0); // unk (0 at start) - packet.AddState(2733, 0); // Draenei - Horde control - packet.AddState(2732, 0); // Draenei - Alliance control - packet.AddState(2731, 1); // Draenei uncontrolled (1 - yes, 0 - no) - packet.AddState(2730, 0); // Mage Tower - Alliance control - packet.AddState(2729, 0); // Mage Tower - Horde control - packet.AddState(2728, 1); // Mage Tower uncontrolled (1 - yes, 0 - no) - packet.AddState(2727, 0); // Fel Reaver - Horde control - packet.AddState(2726, 0); // Fel Reaver - Alliance control - packet.AddState(2725, 1); // Fel Reaver uncontrolled (1 - yes, 0 - no) - packet.AddState(2724, 0); // Boold Elf - Horde control - packet.AddState(2723, 0); // Boold Elf - Alliance control - packet.AddState(2722, 1); // Boold Elf uncontrolled (1 - yes, 0 - no) - packet.AddState(2757, 1); // Flag (1 - show, 0 - hide) - doesn't work exactly this way! - packet.AddState(2770, 1); // Horde top-stats (1 - show, 0 - hide) // 02 -> horde picked up the flag - packet.AddState(2769, 1); // Alliance top-stats (1 - show, 0 - hide) // 02 -> alliance picked up the flag - packet.AddState(2750, 0); // Horde resources - packet.AddState(2749, 0); // Alliance resources - packet.AddState(2565, 142); // unk, constant? - packet.AddState(2720, 0); // Capturing progress-bar (100 -> empty (only grey), 0 -> blue|red (no grey), default 0) - packet.AddState(2719, 0); // Capturing progress-bar (0 - left, 100 - right) - packet.AddState(2718, 0); // Capturing progress-bar (1 - show, 0 - hide) - packet.AddState(3085, 379); // unk, constant? - // missing unknowns - } - break; // any of these needs change! the client remembers the prev setting! // ON EVERY ZONE LEAVE, RESET THE OLD ZONE'S WORLD STATE, BUT AT LEAST THE UI STUFF! case 3483: // Hellfire Peninsula @@ -3273,137 +3096,6 @@ namespace Game.Entities packet.AddState(2655, 0); // ZM_MAP_ALLIANCE_FLAG_READY } break; - case 3698: // Nagrand Arena - if (bg && bg.GetTypeID(true) == BattlegroundTypeId.NA) - bg.FillInitialWorldStates(packet); - else - { - packet.AddState(2575, 0); // BATTLEGROUND_NAGRAND_ARENA_GOLD - packet.AddState(2576, 0); // BATTLEGROUND_NAGRAND_ARENA_GREEN - packet.AddState(2577, 0); // BATTLEGROUND_NAGRAND_ARENA_SHOW - } - break; - case 3702: // Blade's Edge Arena - if (bg && bg.GetTypeID(true) == BattlegroundTypeId.BE) - bg.FillInitialWorldStates(packet); - else - { - packet.AddState(2544, 0); // BATTLEGROUND_BLADES_EDGE_ARENA_GOLD - packet.AddState(2545, 0); // BATTLEGROUND_BLADES_EDGE_ARENA_GREEN - packet.AddState(2547, 0); // BATTLEGROUND_BLADES_EDGE_ARENA_SHOW - } - break; - case 3968: // Ruins of Lordaeron - if (bg && bg.GetTypeID(true) == BattlegroundTypeId.RL) - bg.FillInitialWorldStates(packet); - else - { - packet.AddState(3000, 0); // BATTELGROUND_RUINS_OF_LORDAERNON_GOLD - packet.AddState(3001, 0); // BATTELGROUND_RUINS_OF_LORDAERNON_GREEN - packet.AddState(3002, 0); // BATTELGROUND_RUINS_OF_LORDAERNON_SHOW - } - break; - case 4378: // Dalaran Sewers - if (bg && bg.GetTypeID(true) == BattlegroundTypeId.DS) - bg.FillInitialWorldStates(packet); - else - { - packet.AddState(3601, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD - packet.AddState(3600, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_GREEN - packet.AddState(3610, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_SHOW - } - break; - case 4384: // Strand of the Ancients - if (bg && bg.GetTypeID(true) == BattlegroundTypeId.SA) - bg.FillInitialWorldStates(packet); - else - { - packet.AddState(3849, 0); // Gate of Temple - packet.AddState(3638, 0); // Gate of Yellow Moon - packet.AddState(3623, 0); // Gate of Green Emerald - packet.AddState(3620, 0); // Gate of Blue Sapphire - packet.AddState(3617, 0); // Gate of Red Sun - packet.AddState(3614, 0); // Gate of Purple Ametyst - packet.AddState(3571, 0); // bonus timer (1 - on, 0 - off) - packet.AddState(3565, 0); // Horde Attacker - packet.AddState(3564, 0); // Alliance Attacker - - // End Round timer, example: 19:59 -> A:BC - packet.AddState(3561, 0); // C - packet.AddState(3560, 0); // B - packet.AddState(3559, 0); // A - - packet.AddState(3637, 0); // BG_SA_CENTER_GY_ALLIANCE - packet.AddState(3636, 0); // BG_SA_RIGHT_GY_ALLIANCE - packet.AddState(3635, 0); // BG_SA_LEFT_GY_ALLIANCE - packet.AddState(3634, 0); // BG_SA_CENTER_GY_HORDE - packet.AddState(3633, 0); // BG_SA_LEFT_GY_HORDE - packet.AddState(3632, 0); // BG_SA_RIGHT_GY_HORDE - packet.AddState(3631, 0); // BG_SA_HORDE_DEFENCE_TOKEN - packet.AddState(3630, 0); // BG_SA_ALLIANCE_DEFENCE_TOKEN - packet.AddState(3629, 0); // BG_SA_LEFT_ATT_TOKEN_HRD - packet.AddState(3628, 0); // BG_SA_RIGHT_ATT_TOKEN_HRD - packet.AddState(3627, 0); // BG_SA_RIGHT_ATT_TOKEN_ALL - packet.AddState(3626, 0); // BG_SA_LEFT_ATT_TOKEN_ALL - // missing unknowns - } - break; - case 4406: // Ring of Valor - if (bg && bg.GetTypeID(true) == BattlegroundTypeId.RV) - bg.FillInitialWorldStates(packet); - else - { - packet.AddState(3600, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_GREEN - packet.AddState(3601, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_GOLD - packet.AddState(3610, 0); // ARENA_WORLD_STATE_ALIVE_PLAYERS_SHOW - } - break; - case 4710: - if (bg && bg.GetTypeID(true) == BattlegroundTypeId.IC) - bg.FillInitialWorldStates(packet); - else - { - packet.AddState(4221, 1); // BG_IC_ALLIANCE_RENFORT_SET - packet.AddState(4222, 1); // BG_IC_HORDE_RENFORT_SET - packet.AddState(4226, 300); // BG_IC_ALLIANCE_RENFORT - packet.AddState(4227, 300); // BG_IC_HORDE_RENFORT - packet.AddState(4322, 1); // BG_IC_GATE_FRONT_H_WS_OPEN - packet.AddState(4321, 1); // BG_IC_GATE_WEST_H_WS_OPEN - packet.AddState(4320, 1); // BG_IC_GATE_EAST_H_WS_OPEN - packet.AddState(4323, 1); // BG_IC_GATE_FRONT_A_WS_OPEN - packet.AddState(4324, 1); // BG_IC_GATE_WEST_A_WS_OPEN - packet.AddState(4325, 1); // BG_IC_GATE_EAST_A_WS_OPEN - packet.AddState(4317, 1); // unk - packet.AddState(4301, 1); // BG_IC_DOCKS_UNCONTROLLED - packet.AddState(4296, 1); // BG_IC_HANGAR_UNCONTROLLED - packet.AddState(4306, 1); // BG_IC_QUARRY_UNCONTROLLED - packet.AddState(4311, 1); // BG_IC_REFINERY_UNCONTROLLED - packet.AddState(4294, 1); // BG_IC_WORKSHOP_UNCONTROLLED - packet.AddState(4243, 1); // unk - packet.AddState(4345, 1); // unk - } - break; - // Twin Peaks - case 5031: - if (bg && bg.GetTypeID(true) == BattlegroundTypeId.TP) - bg.FillInitialWorldStates(packet); - else - { - packet.AddState(1581, 0x0); // alliance flag captures - packet.AddState(1582, 0x0); // horde flag captures - packet.AddState(1545, 0x0); // unk - packet.AddState(1546, 0x0); // unk - packet.AddState(1547, 0x2); // unk - packet.AddState(1601, 0x3); // unk - packet.AddState(2338, 0x1); // horde (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) - packet.AddState(2339, 0x1); // alliance (0 - hide, 1 - flag ok, 2 - flag picked up (flashing), 3 - flag picked up (not flashing) - } - break; - // Battle for Gilneas - case 5449: - if (bg && bg.GetTypeID(true) == BattlegroundTypeId.BFG) - bg.FillInitialWorldStates(packet); - break; default: break; } @@ -3442,7 +3134,7 @@ namespace Game.Entities uint GetChampioningFaction() { return m_ChampioningFaction; } public void SetChampioningFaction(uint faction) { m_ChampioningFaction = faction; } - + public void SetFactionForRace(Race race) { m_team = TeamForRace(race); @@ -3900,7 +3592,7 @@ namespace Game.Entities return Global.ObjAccessor.GetUnit(this, selectionGUID); return null; } - + public Player GetSelectedPlayer() { ObjectGuid selectionGUID = GetTarget(); @@ -4271,19 +3963,19 @@ namespace Game.Entities case MirrorTimerType.Fatigue: return Time.Minute * Time.InMilliseconds; case MirrorTimerType.Breath: - { - if (!IsAlive() || HasAuraType(AuraType.WaterBreathing) || GetSession().GetSecurity() >= (AccountTypes)WorldConfig.GetIntValue(WorldCfg.DisableBreathing)) - return -1; - int UnderWaterTime = 3 * Time.Minute * Time.InMilliseconds; - UnderWaterTime *= (int)GetTotalAuraMultiplier(AuraType.ModWaterBreathing); - return UnderWaterTime; - } + { + if (!IsAlive() || HasAuraType(AuraType.WaterBreathing) || GetSession().GetSecurity() >= (AccountTypes)WorldConfig.GetIntValue(WorldCfg.DisableBreathing)) + return -1; + int UnderWaterTime = 3 * Time.Minute * Time.InMilliseconds; + UnderWaterTime *= (int)GetTotalAuraMultiplier(AuraType.ModWaterBreathing); + return UnderWaterTime; + } case MirrorTimerType.Fire: - { - if (!IsAlive()) - return -1; - return 1 * Time.InMilliseconds; - } + { + if (!IsAlive()) + return -1; + return 1 * Time.InMilliseconds; + } default: return 0; } @@ -5418,7 +5110,7 @@ namespace Game.Entities { return GetLevel() >= m_activePlayerData.MaxLevel; } - + public ChatFlags GetChatFlags() { ChatFlags tag = ChatFlags.None; @@ -6018,7 +5710,7 @@ namespace Game.Entities { return GetReputationMgr().GetReputation(CliDB.FactionStorage.LookupByKey(factionentry)); } - + #region Sends / Updates void BeforeVisibilityDestroy(WorldObject obj, Player p) { @@ -6574,7 +6266,7 @@ namespace Game.Entities return false; } #endregion - + public void ClearWhisperWhiteList() { WhisperList.Clear(); } public void AddWhisperWhiteList(ObjectGuid guid) { WhisperList.Add(guid); } public bool IsInWhisperWhiteList(ObjectGuid guid) { return WhisperList.Contains(guid); } @@ -6586,8 +6278,8 @@ namespace Game.Entities m_lastFallZ = z; } - public PlayerCreateMode GetCreateMode() { return m_createMode; } - + public PlayerCreateMode GetCreateMode() { return m_createMode; } + public byte GetCinematic() { return m_cinematic; } public void SetCinematic(byte cine) { m_cinematic = cine; } @@ -6627,7 +6319,7 @@ namespace Game.Entities public void SetBeenGrantedLevelsFromRaF() { m_ExtraFlags |= PlayerExtraFlags.GrantedLevelsFromRaf; } public bool HasLevelBoosted() { return m_ExtraFlags.HasFlag(PlayerExtraFlags.LevelBoosted); } public void SetHasLevelBoosted() { m_ExtraFlags |= PlayerExtraFlags.LevelBoosted; } - + public uint GetXP() { return m_activePlayerData.XP; } public uint GetXPForNextLevel() { return m_activePlayerData.NextLevelXP; } @@ -7522,8 +7214,8 @@ namespace Game.Entities return teleportDest; } - public uint? GetTeleportDestInstanceId() - { + public uint? GetTeleportDestInstanceId() + { return m_teleport_instanceId; } diff --git a/Source/Game/Entities/Transport.cs b/Source/Game/Entities/Transport.cs index 81843d527..88b62404d 100644 --- a/Source/Game/Entities/Transport.cs +++ b/Source/Game/Entities/Transport.cs @@ -87,6 +87,7 @@ namespace Game.Entities break; } + Unit unit = passenger.ToUnit(); if (unit != null) { Vehicle vehicle = unit.GetVehicleKit(); diff --git a/Source/Scripts/World/Achievements.cs b/Source/Scripts/World/Achievements.cs index 31009318c..279bf8b02 100644 --- a/Source/Scripts/World/Achievements.cs +++ b/Source/Scripts/World/Achievements.cs @@ -49,119 +49,6 @@ namespace Scripts.World.Achievements public const uint AntiPersonnalCannon = 27894; } - [Script] - class achievement_resilient_victory : AchievementCriteriaScript - { - public achievement_resilient_victory() : base("achievement_resilient_victory") { } - - public override bool OnCheck(Player source, Unit target) - { - Battleground bg = source.GetBattleground(); - if (bg) - return bg.CheckAchievementCriteriaMeet((uint)BattlegroundCriteriaId.ResilientVictory, source, target); - - return false; - } - } - - [Script] - class achievement_bg_control_all_nodes : AchievementCriteriaScript - { - public achievement_bg_control_all_nodes() : base("achievement_bg_control_all_nodes") { } - - public override bool OnCheck(Player source, Unit target) - { - Battleground bg = source.GetBattleground(); - if (bg) - return bg.IsAllNodesControlledByTeam(bg.GetPlayerTeam(source.GetGUID())); - - return false; - } - } - - [Script] - class achievement_save_the_day : AchievementCriteriaScript - { - public achievement_save_the_day() : base("achievement_save_the_day") { } - - public override bool OnCheck(Player source, Unit target) - { - Battleground bg = source.GetBattleground(); - if (bg) - return bg.CheckAchievementCriteriaMeet((uint)BattlegroundCriteriaId.SaveTheDay, source, target); - - return false; - } - } - - [Script] - class achievement_bg_ic_resource_glut : AchievementCriteriaScript - { - public achievement_bg_ic_resource_glut() : base("achievement_bg_ic_resource_glut") { } - - public override bool OnCheck(Player source, Unit target) - { - if (source.HasAura(ICSpells.OilRefinery) && source.HasAura(ICSpells.Quarry)) - return true; - - return false; - } - } - - [Script] - class achievement_bg_ic_glaive_grave : AchievementCriteriaScript - { - public achievement_bg_ic_glaive_grave() : base("achievement_bg_ic_glaive_grave") { } - - public override bool OnCheck(Player source, Unit target) - { - Creature vehicle = source.GetVehicleCreatureBase(); - if (vehicle) - { - if (vehicle.GetEntry() == ICCreatures.GlaiveThrowerH || vehicle.GetEntry() == ICCreatures.GlaiveThrowerA) - return true; - } - - return false; - } - } - - [Script] - class achievement_bg_ic_mowed_down : AchievementCriteriaScript - { - public achievement_bg_ic_mowed_down() : base("achievement_bg_ic_mowed_down") { } - - public override bool OnCheck(Player source, Unit target) - { - Creature vehicle = source.GetVehicleCreatureBase(); - if (vehicle) - { - if (vehicle.GetEntry() == ICCreatures.KeepCannon) - return true; - } - - return false; - } - } - - [Script] - class achievement_bg_sa_artillery : AchievementCriteriaScript - { - public achievement_bg_sa_artillery() : base("achievement_bg_sa_artillery") { } - - public override bool OnCheck(Player source, Unit target) - { - Creature vehicle = source.GetVehicleCreatureBase(); - if (vehicle) - { - if (vehicle.GetEntry() == VehicleIds.AntiPersonnalCannon) - return true; - } - - return false; - } - } - [Script("achievement_arena_2v2_kills", ArenaTypes.Team2v2)] [Script("achievement_arena_3v3_kills", ArenaTypes.Team3v3)] [Script("achievement_arena_5v5_kills", ArenaTypes.Team5v5)] @@ -184,70 +71,6 @@ namespace Scripts.World.Achievements } } - [Script] - class achievement_sickly_gazelle : AchievementCriteriaScript - { - public achievement_sickly_gazelle() : base("achievement_sickly_gazelle") { } - - public override bool OnCheck(Player source, Unit target) - { - if (!target) - return false; - - Player victim = target.ToPlayer(); - if (victim) - if (victim.IsMounted()) - return true; - - return false; - } - } - - [Script] - class achievement_everything_counts : AchievementCriteriaScript - { - public achievement_everything_counts() : base("achievement_everything_counts") { } - - public override bool OnCheck(Player source, Unit target) - { - Battleground bg = source.GetBattleground(); - if (bg) - return bg.CheckAchievementCriteriaMeet((uint)BattlegroundCriteriaId.EverythingCounts, source, target); - - return false; - } - } - - [Script] - class achievement_bg_av_perfection : AchievementCriteriaScript - { - public achievement_bg_av_perfection() : base("achievement_bg_av_perfection") { } - - public override bool OnCheck(Player source, Unit target) - { - Battleground bg = source.GetBattleground(); - if (bg) - return bg.CheckAchievementCriteriaMeet((uint)BattlegroundCriteriaId.AvPerfection, source, target); - - return false; - } - } - - [Script] - class achievement_bg_sa_defense_of_ancients : AchievementCriteriaScript - { - public achievement_bg_sa_defense_of_ancients() : base("achievement_bg_sa_defense_of_ancients") { } - - public override bool OnCheck(Player source, Unit target) - { - Battleground bg = source.GetBattleground(); - if (bg) - return bg.CheckAchievementCriteriaMeet((uint)BattlegroundCriteriaId.DefenseOfTheAncients, source, target); - - return false; - } - } - [Script] class achievement_tilted : AchievementCriteriaScript { @@ -269,21 +92,6 @@ namespace Scripts.World.Achievements } } - [Script] - class achievement_not_even_a_scratch : AchievementCriteriaScript - { - public achievement_not_even_a_scratch() : base("achievement_not_even_a_scratch") { } - - public override bool OnCheck(Player source, Unit target) - { - Battleground bg = source.GetBattleground(); - if (bg) - return bg.CheckAchievementCriteriaMeet((uint)BattlegroundCriteriaId.NotEvenAScratch, source, target); - - return false; - } - } - [Script] class achievement_flirt_with_disaster_perf_check : AchievementCriteriaScript { diff --git a/sql/updates/world/master/2022_07_10_00_world.sql b/sql/updates/world/master/2022_07_10_00_world.sql new file mode 100644 index 000000000..616bdc6aa --- /dev/null +++ b/sql/updates/world/master/2022_07_10_00_world.sql @@ -0,0 +1,298 @@ +ALTER TABLE `world_state` MODIFY `MapIDs` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL AFTER `DefaultValue`; + +DELETE FROM `world_state` WHERE `ID` IN (601,602,801,804,922,923,1043,1044,1181,1182,1183,1184,1185,1186,1187,1188,1301,1302,1303,1304,1325,1326,1327,1328,1329,1330,1331,1332,1333,1334,1335,1336,1337,1338,1339,1340,1341,1342,1343,1344,1346,1347,1348,1349,1351, +1352,1355,1356,1357,1358,1359,1360,1361,1362,1363,1364,1365,1366,1367,1368,1370,1371,1372,1373,1374,1375,1376,1377,1378,1379,1380,1381,1382,1383,1384,1385,1387,1388,1389,1390,1392,1393,1394,1395,1545,1546,1547,1581,1582,1601,1664,1767,1768,1769,1770,1772,1773, +1774,1775,1776,1777,1778,1779,1780,1782,1783,1784,1785,1787,1788,1789,1790,1792,1793,1794,1795,1842,1843,1844,1845,1846,1955,1966,2338,2339,2718,2719,2720,2722,2723,2724,2725,2726,2727,2728,2729,2730,2731,2732,2733,2752,2753,3127,3128,3133,3134,3136,3557,3564, +3565,3571,3600,3601,3610,3614,3617,3620,3623,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3644,3645,3690,3849,3955,3956,4221,4222,4226,4227,4228,4229,4230,4232,4234,4235,4247,4248,4287,4289,4293,4294,4296,4297,4298,4299,4300,4301,4302,4303, +4304,4305,4306,4307,4308,4309,4310,4311,4312,4313,4314,4315,4317,4318,4319,4320,4321,4322,4323,4324,4325,4326,4327,4328,4339,4340,4341,4342,4343,4344,4345,4346,4347,4348,4352,4353,5834,8524,8529,8799,8805,8808,8809,8863,9808,9809,13401,15480,15481,17303,17322, +17323,17324,17325,17326,17327,17328,17329,17330,17331,17361,17362,17363,17364,17365,17366,17367,17368,17377,17712,17713,21322,21427); +INSERT INTO `world_state` (`ID`,`DefaultValue`,`MapIDs`,`AreaIDs`,`ScriptName`,`Comment`) VALUES +(601,1,'30,2197',NULL,'','Alterac Valley - Drek\'Thar alive'), +(602,1,'30,2197',NULL,'','Alterac Valley - Vandaar alive'), +(801,0,'30,2197',NULL,'','Alterac Valley - Irondeep Mine - owner'), +(804,0,'30,2197',NULL,'','Alterac Valley - Coldtooth Mine - owner'), +(922,200,'30,2197',NULL,'','Alterac Valley - Stormpike Soldier\'s Blood max'), +(923,0,'30,2197',NULL,'','Alterac Valley - Stormpike Soldier\'s Blood count'), +(1043,0,'30,2197',NULL,'','Alterac Valley - Storm Crystals count'), +(1044,200,'30,2197',NULL,'','Alterac Valley - Storm Crystals max'), +(1181,1,'30,2197',NULL,'','Alterac Valley - Dun Baldar South Bunker - Owner'), +(1182,1,'30,2197',NULL,'','Alterac Valley - Dun Baldar North Bunker - Owner'), +(1183,1,'30,2197',NULL,'','Alterac Valley - Icewing Bunker - Owner'), +(1184,1,'30,2197',NULL,'','Alterac Valley - Stonehearth Bunker - Owner'), +(1185,2,'30,2197',NULL,'','Alterac Valley - West Frostwolf Tower - Owner'), +(1186,2,'30,2197',NULL,'','Alterac Valley - East Frostwolf Tower - Owner'), +(1187,2,'30,2197',NULL,'','Alterac Valley - Tower Point - Owner'), +(1188,2,'30,2197',NULL,'','Alterac Valley - Iceblood Tower - Owner'), +(1301,0,'30,2197',NULL,'','Alterac Valley - Stonehearth Graveyard - Horde Controlled'), +(1302,1,'30,2197',NULL,'','Alterac Valley - Stonehearth Graveyard - Alliance Controlled'), +(1303,0,'30,2197',NULL,'','Alterac Valley - Stonehearth Graveyard - In Conflict'), +(1304,0,'30,2197',NULL,'','Alterac Valley - Stonehearth Graveyard - In Conflict'), +(1325,1,'30,2197',NULL,'','Alterac Valley - Stormpike Aid Station - Alliance Controlled'), +(1326,0,'30,2197',NULL,'','Alterac Valley - Stormpike Aid Station - In Conflict'), +(1327,0,'30,2197',NULL,'','Alterac Valley - Stormpike Aid Station - Horde Controlled'), +(1328,0,'30,2197',NULL,'','Alterac Valley - Stormpike Aid Station - In Conflict'), +(1329,0,'30,2197',NULL,'','Alterac Valley - Frostwolf Relief Hut - Alliance Controlled'), +(1330,1,'30,2197',NULL,'','Alterac Valley - Frostwolf Relief Hut - Horde Controlled'), +(1331,0,'30,2197',NULL,'','Alterac Valley - Frostwolf Relief Hut - In Conflict'), +(1332,0,'30,2197',NULL,'','Alterac Valley - Frostwolf Relief Hut - In Conflict'), +(1333,1,'30,2197',NULL,'','Alterac Valley - Stormpike Graveyard - Alliance Controlled'), +(1334,0,'30,2197',NULL,'','Alterac Valley - Stormpike Graveyard - Horde Controlled'), +(1335,0,'30,2197',NULL,'','Alterac Valley - Stormpike Graveyard - In Conflict'), +(1336,0,'30,2197',NULL,'','Alterac Valley - Stormpike Graveyard - In Conflict'), +(1337,0,'30,2197',NULL,'','Alterac Valley - Frostwolf Graveyard - Alliance Controlled'), +(1338,1,'30,2197',NULL,'','Alterac Valley - Frostwolf Graveyard - Horde Controlled'), +(1339,0,'30,2197',NULL,'','Alterac Valley - Frostwolf Graveyard - In Conflict'), +(1340,0,'30,2197',NULL,'','Alterac Valley - Frostwolf Graveyard - In Conflict'), +(1341,0,'30,2197',NULL,'','Alterac Valley - Snowfall Graveyard - Alliance Controlled'), +(1342,0,'30,2197',NULL,'','Alterac Valley - Snowfall Graveyard - Horde Controlled'), +(1343,0,'30,2197',NULL,'','Alterac Valley - Snowfall Graveyard - In Conflict'), +(1344,0,'30,2197',NULL,'','Alterac Valley - Snowfall Graveyard - In Conflict'), +(1346,0,'30,2197',NULL,'','Alterac Valley - Iceblood Graveyard - Alliance Controlled'), +(1347,1,'30,2197',NULL,'','Alterac Valley - Iceblood Graveyard - Horde Controlled'), +(1348,0,'30,2197',NULL,'','Alterac Valley - Iceblood Graveyard - In Conflict'), +(1349,0,'30,2197',NULL,'','Alterac Valley - Iceblood Graveyard - In Conflict'), +(1351,1,'30,2197',NULL,'','Alterac Valley - Balinda alive'), +(1352,1,'30,2197',NULL,'','Alterac Valley - Galvagar alive'), +(1355,0,'30,2197',NULL,'','Alterac Valley - Coldtooth Mine - Alliance Controlled'), +(1356,0,'30,2197',NULL,'','Alterac Valley - Coldtooth Mine - Horde Controlled'), +(1357,1,'30,2197',NULL,'','Alterac Valley - Coldtooth Mine - Kobold Controlled'), +(1358,0,'30,2197',NULL,'','Alterac Valley - Irondeep Mine - Alliance Controlled'), +(1359,0,'30,2197',NULL,'','Alterac Valley - Irondeep Mine - Horde Controlled'), +(1360,1,'30,2197',NULL,'','Alterac Valley - Irondeep Mine - Trogg Controlled'), +(1361,1,'30,2197',NULL,'','Alterac Valley - Dun Baldar South Bunker - Alliance Controlled'), +(1362,1,'30,2197',NULL,'','Alterac Valley - Dun Baldar North Bunker - Alliance Controlled'), +(1363,1,'30,2197',NULL,'','Alterac Valley - Icewing Bunker - Alliance Controlled'), +(1364,1,'30,2197',NULL,'','Alterac Valley - Stonehearth Bunker - Alliance Controlled'), +(1365,0,'30,2197',NULL,'','Alterac Valley - West Frostwolf Tower - Destroyed'), +(1366,0,'30,2197',NULL,'','Alterac Valley - East Frostwolf Tower - Destroyed'), +(1367,0,'30,2197',NULL,'','Alterac Valley - Tower Point - Destroyed'), +(1368,0,'30,2197',NULL,'','Alterac Valley - Iceblood Tower - Destroyed'), +(1370,0,'30,2197',NULL,'','Alterac Valley - Dun Baldar South Bunker - Destroyed'), +(1371,0,'30,2197',NULL,'','Alterac Valley - Dun Baldar North Bunker - Destroyed'), +(1372,0,'30,2197',NULL,'','Alterac Valley - Icewing Bunker - Destroyed'), +(1373,0,'30,2197',NULL,'','Alterac Valley - Stonehearth Bunker - Destroyed'), +(1374,0,'30,2197',NULL,'','Alterac Valley - Dun Baldar South Bunker - In Conflict'), +(1375,0,'30,2197',NULL,'','Alterac Valley - Dun Baldar North Bunker - In Conflict'), +(1376,0,'30,2197',NULL,'','Alterac Valley - Icewing Bunker - In Conflict'), +(1377,0,'30,2197',NULL,'','Alterac Valley - Stonehearth Bunker - In Conflict'), +(1378,0,'30,2197',NULL,'','Alterac Valley - Dun Baldar South Bunker - In Conflict'), +(1379,0,'30,2197',NULL,'','Alterac Valley - Dun Baldar North Bunker - In Conflict'), +(1380,0,'30,2197',NULL,'','Alterac Valley - Icewing Bunker - In Conflict'), +(1381,0,'30,2197',NULL,'','Alterac Valley - Stonehearth Bunker - In Conflict'), +(1382,1,'30,2197',NULL,'','Alterac Valley - West Frostwolf Tower - Horde Controlled'), +(1383,1,'30,2197',NULL,'','Alterac Valley - East Frostwolf Tower - Horde Controlled'), +(1384,1,'30,2197',NULL,'','Alterac Valley - Tower Point - Horde Controlled'), +(1385,1,'30,2197',NULL,'','Alterac Valley - Iceblood Tower - Horde Controlled'), +(1387,0,'30,2197',NULL,'','Alterac Valley - West Frostwolf Tower - In Conflict'), +(1388,0,'30,2197',NULL,'','Alterac Valley - East Frostwolf Tower - In Conflict'), +(1389,0,'30,2197',NULL,'','Alterac Valley - Tower Point - In Conflict'), +(1390,0,'30,2197',NULL,'','Alterac Valley - Iceblood Tower - In Conflict'), +(1392,0,'30,2197',NULL,'','Alterac Valley - West Frostwolf Tower - In Conflict'), +(1393,0,'30,2197',NULL,'','Alterac Valley - East Frostwolf Tower - In Conflict'), +(1394,0,'30,2197',NULL,'','Alterac Valley - Tower Point - In Conflict'), +(1395,0,'30,2197',NULL,'','Alterac Valley - Iceblood Tower - In Conflict'), +(1545,1,'489,726,2106',NULL,'','Warsong Gulch/Twin Peaks - Alliance flag state'), +(1546,1,'489,726,2106',NULL,'','Warsong Gulch/Twin Peaks - Horde flag state'), +(1547,0,'489,726,2106',NULL,'','Warsong Gulch/Twin Peaks - Neutral flag state'), +(1581,0,'489,726,2106',NULL,'','Warsong Gulch/Twin Peaks - Alliance flag captures'), +(1582,0,'489,726,2106',NULL,'','Warsong Gulch/Twin Peaks - Horde flag captures'), +(1601,3,'489,726,2106',NULL,'','Warsong Gulch/Twin Peaks - Max flag captures'), +(1664,1,'489,2106',NULL,'','Warsong Gulch - unknown state, enables Save the Day achievement (not the only requirement)'), +(1767,0,'529',NULL,'','Arathi Basin - Stables Alliance controlled'), +(1768,0,'529',NULL,'','Arathi Basin - Stables Horde controlled'), +(1769,0,'529',NULL,'','Arathi Basin - Stables Alliance - contested'), +(1770,0,'529',NULL,'','Arathi Basin - Stables Horde - contested'), +(1772,0,'529',NULL,'','Arathi Basin - Farm Alliance controlled'), +(1773,0,'529',NULL,'','Arathi Basin - Farm Horde controlled'), +(1774,0,'529',NULL,'','Arathi Basin - Farm Alliance - contested'), +(1775,0,'529',NULL,'','Arathi Basin - Farm Horde - contested'), +(1776,0,'529,566,761,968,1105,1681,2107,2177',NULL,'','Battlegrounds - Alliance resources'), +(1777,0,'529,566,761,968,1105,1681,2107,2177',NULL,'','Battlegrounds - Horde resources'), +(1778,0,'529,761,1681,2107,2177',NULL,'','Battlegrounds - Alliance bases'), +(1779,0,'529,761,1681,2107,2177',NULL,'','Battlegrounds - Horde bases'), +(1780,1500,'529,566,761,968,1105,1681,2107,2177',NULL,'','Battlegrounds - Max resources'), +(1782,0,'529',NULL,'','Arathi Basin - Blacksmith Alliance controlled'), +(1783,0,'529',NULL,'','Arathi Basin - Blacksmith Horde controlled'), +(1784,0,'529',NULL,'','Arathi Basin - Blacksmith Alliance - contested'), +(1785,0,'529',NULL,'','Arathi Basin - Blacksmith Horde - contested'), +(1787,0,'529',NULL,'','Arathi Basin - Gold Mine Alliance controlled'), +(1788,0,'529',NULL,'','Arathi Basin - Gold Mine Horde controlled'), +(1789,0,'529',NULL,'','Arathi Basin - Gold Mine Alliance - contested'), +(1790,0,'529',NULL,'','Arathi Basin - Gold Mine Horde - contested'), +(1792,0,'529',NULL,'','Arathi Basin - Lumber Mill Alliance controlled'), +(1793,0,'529',NULL,'','Arathi Basin - Lumber Mill Horde controlled'), +(1794,0,'529',NULL,'','Arathi Basin - Lumber Mill Alliance - contested'), +(1795,0,'529',NULL,'','Arathi Basin - Lumber Mill Horde - contested'), +(1842,1,'529',NULL,'','Arathi Basin - Stables uncontrolled POI'), +(1843,1,'529',NULL,'','Arathi Basin - Gold Mine uncontrolled POI'), +(1844,1,'529',NULL,'','Arathi Basin - Lumber Mill uncontrolled POI'), +(1845,1,'529',NULL,'','Arathi Basin - Farm uncontrolled POI'), +(1846,1,'529',NULL,'','Arathi Basin - Blacksmith uncontrolled POI'), +(1955,1400,'529,1681,2107,2177',NULL,'','Arathi Basin - Near victory resource level warning'), +(1966,1,'30,2197',NULL,'','Alterac Valley - Snowfall Graveyard - Uncontrolled'), +(2338,1,'489,2106',NULL,'','Warsong Gulch - Horde flag control state'), +(2339,1,'489,2106',NULL,'','Warsong Gulch - Alliance flag control state'), +(2718,0,'566',NULL,'','Eye of the Storm - Show capturing progress bar'), +(2719,50,'566',NULL,'','Eye of the Storm - Capturing progress bar current value'), +(2720,40,'566',NULL,'','Eye of the Storm - Capturing progress bar neutral zone size'), +(2722,1,'566,968',NULL,'','Eye of the Storm - Blood Elf Tower uncontrolled POI'), +(2723,0,'566,968',NULL,'','Eye of the Storm - Blood Elf Tower Alliance control POI'), +(2724,0,'566,968',NULL,'','Eye of the Storm - Blood Elf Tower Horde control POI'), +(2725,1,'566,968',NULL,'','Eye of the Storm - Fel Reaver Ruins uncontrolled POI'), +(2726,0,'566,968',NULL,'','Eye of the Storm - Fel Reaver Ruins Alliance control POI'), +(2727,0,'566,968',NULL,'','Eye of the Storm - Fel Reaver Ruins Horde control POI'), +(2728,1,'566,968',NULL,'','Eye of the Storm - Mage Tower uncontrolled POI'), +(2729,0,'566,968',NULL,'','Eye of the Storm - Mage Tower Horde control POI'), +(2730,0,'566,968',NULL,'','Eye of the Storm - Mage Tower Alliance control POI'), +(2731,1,'566,968',NULL,'','Eye of the Storm - Draenei Ruins uncontrolled POI'), +(2732,0,'566,968',NULL,'','Eye of the Storm - Draenei Ruins Alliance control POI'), +(2733,0,'566,968',NULL,'','Eye of the Storm - Draenei Ruins Horde control POI'), +(2752,0,'566,968',NULL,'','Eye of the Storm - Alliance bases controlled'), +(2753,0,'566,968',NULL,'','Eye of the Storm - Horde bases controlled'), +(3127,700,'30',NULL,'','Alterac Valley - Alliance Reinforcements'), +(3128,700,'30',NULL,'','Alterac Valley - Horde Reinforcements'), +(3133,1,'30',NULL,'','Alterac Valley - Show Horde Reinforcements'), +(3134,1,'30',NULL,'','Alterac Valley - Show Alliance Reinforcements'), +(3136,700,'30',NULL,'','Alterac Valley - Max Reinforcements'), +(3557,0,'607',NULL,'','Strand of the Ancients - Timer'), +(3564,0,'607',NULL,'','Strand of the Ancients - Show timer'), +(3565,0,'607',NULL,'','Strand of the Ancients - Show timer'), +(3571,0,'607',NULL,'','Strand of the Ancients - Show bonus timer'), +(3600,0,'559,562,572,617,618,980,1134,1504,1505,1552,1672,1825,1911,2167,2373,2509,2511,2547',NULL,'','Arenas - Green Team Players remaining'), +(3601,0,'559,562,572,617,618,980,1134,1504,1505,1552,1672,1825,1911,2167,2373,2509,2511,2547',NULL,'','Arenas - Gold Team Players remaining'), +(3610,1,'559,562,572,617,618,980,1134,1504,1505,1552,1672,1825,1911,2167,2373,2509,2511,2547',NULL,'','Arenas - Show players remaining'), +(3614,1,'607',NULL,'','Strand of the Ancients - Gate of the Purple Amethyst'), +(3617,1,'607',NULL,'','Strand of the Ancients - Gate of the Red Sun'), +(3620,1,'607',NULL,'','Strand of the Ancients - Gate of the Blue Sapphire'), +(3623,1,'607',NULL,'','Strand of the Ancients - Gate of the Green Emerald'), +(3626,0,'607',NULL,'','Strand of the Ancients - The Frostbreaker - Alliance Offense'), +(3627,0,'607',NULL,'','Strand of the Ancients - The Graceful Maiden - Alliance Offense'), +(3628,0,'607',NULL,'','Strand of the Ancients - The Blightbringer - Horde Offense'), +(3629,0,'607',NULL,'','Strand of the Ancients - The Casket Carrier - Horde Offense'), +(3630,0,'607',NULL,'','Strand of the Ancients - Alliance Defense'), +(3631,0,'607',NULL,'','Strand of the Ancients - Horde Defense'), +(3632,0,'607',NULL,'','Strand of the Ancients - East Graveyard - Horde Controlled'), +(3633,0,'607',NULL,'','Strand of the Ancients - West Graveyard - Horde Controlled'), +(3634,0,'607',NULL,'','Strand of the Ancients - South Graveyard - Horde Controlled'), +(3635,0,'607',NULL,'','Strand of the Ancients - West Graveyard - Alliance Controlled'), +(3636,0,'607',NULL,'','Strand of the Ancients - East Graveyard - Alliance Controlled'), +(3637,0,'607',NULL,'','Strand of the Ancients - South Graveyard - Alliance Controlled'), +(3638,1,'607',NULL,'','Strand of the Ancients - Gate of the Yellow Moon'), +(3644,0,'529,761,1681,2107,2177',NULL,'','Battlegrounds - Alliance overcame resource disadvantage'), +(3645,0,'529,761,1681,2107,2177',NULL,'','Battlegrounds - Horde overcame resource disadvantage'), +(3690,0,'607',NULL,'','Strand of the Ancients - Attacker team'), +(3849,1,'607',NULL,'','Strand of the Ancients - Chamber of Ancient Relics'), +(3955,0,'607',NULL,'','Strand of the Ancients - Destroyed Alliance vehicles'), +(3956,0,'607',NULL,'','Strand of the Ancients - Destroyed Horde vehicles'), +(4221,1,'628',NULL,'','Isle of Conquest - Show Alliance reinforcements'), +(4222,1,'628',NULL,'','Isle of Conquest - Show Horde reinforcements'), +(4226,400,'628',NULL,'','Isle of Conquest - Alliance reinforcements'), +(4227,400,'628',NULL,'','Isle of Conquest - Horde reinforcements'), +(4228,0,'628',NULL,'','Isle of Conquest - Workshop - In Conflict Alliance'), +(4229,0,'628',NULL,'','Isle of Conquest - Workshop - Alliance Controlled'), +(4230,0,'628',NULL,'','Isle of Conquest - Workshop - Horde Controlled'), +(4232,0,'628',NULL,'','Isle of Conquest - Workshop - Owner'), +(4234,0,'628',NULL,'','Isle of Conquest - Hangar - Owner'), +(4235,0,'628',NULL,'','Isle of Conquest - Docks - Owner'), +(4247,0,'489,726,2106',NULL,'','Warsong Gulch/Twin Peaks - Show timer'), +(4248,0,'489,726,2106',NULL,'','Warsong Gulch/Twin Peaks - Timer'), +(4287,0,'628',NULL,'','Isle of Conquest - Refinery - Owner'), +(4289,0,'628',NULL,'','Isle of Conquest - Quarry - Owner'), +(4293,0,'628',NULL,'','Isle of Conquest - Workshop - In Conflict Horde'), +(4294,1,'628',NULL,'','Isle of Conquest - Workshop - Uncontrolled'), +(4296,1,'628',NULL,'','Isle of Conquest - Hangar - Uncontrolled'), +(4297,0,'628',NULL,'','Isle of Conquest - Hangar - In Conflict Horde'), +(4298,0,'628',NULL,'','Isle of Conquest - Hangar - Horde Controlled'), +(4299,0,'628',NULL,'','Isle of Conquest - Hangar - Alliance Controlled'), +(4300,0,'628',NULL,'','Isle of Conquest - Hangar - In Conflict Alliance'), +(4301,1,'628',NULL,'','Isle of Conquest - Docks - Uncontrolled'), +(4302,0,'628',NULL,'','Isle of Conquest - Docks - In Conflict Horde'), +(4303,0,'628',NULL,'','Isle of Conquest - Docks - Horde Controlled'), +(4304,0,'628',NULL,'','Isle of Conquest - Docks - Alliance Controlled'), +(4305,0,'628',NULL,'','Isle of Conquest - Docks - In Conflict Alliance'), +(4306,1,'628',NULL,'','Isle of Conquest - Quarry - Uncontrolled'), +(4307,0,'628',NULL,'','Isle of Conquest - Quarry - In Conflict Horde'), +(4308,0,'628',NULL,'','Isle of Conquest - Quarry - Horde Controlled'), +(4309,0,'628',NULL,'','Isle of Conquest - Quarry - Alliance Controlled'), +(4310,0,'628',NULL,'','Isle of Conquest - Quarry - In Conflict Alliance'), +(4311,1,'628',NULL,'','Isle of Conquest - Refinery - Uncontrolled'), +(4312,0,'628',NULL,'','Isle of Conquest - Refinery - In Conflict Horde'), +(4313,0,'628',NULL,'','Isle of Conquest - Refinery - Horde Controlled'), +(4314,0,'628',NULL,'','Isle of Conquest - Refinery - Alliance Controlled'), +(4315,0,'628',NULL,'','Isle of Conquest - Refinery - In Conflict Alliance'), +(4317,1,'628',NULL,'','Isle of Conquest - Horde Front Gate'), +(4318,1,'628',NULL,'','Isle of Conquest - Horde West Gate'), +(4319,1,'628',NULL,'','Isle of Conquest - Horde East Gate'), +(4320,0,'628',NULL,'','Isle of Conquest - Horde East Gate - Destroyed'), +(4321,0,'628',NULL,'','Isle of Conquest - Horde West Gate - Destroyed'), +(4322,0,'628',NULL,'','Isle of Conquest - Horde Front Gate - Destroyed'), +(4323,0,'628',NULL,'','Isle of Conquest - Alliance Front Gate - Destroyed'), +(4324,0,'628',NULL,'','Isle of Conquest - Alliance West Gate - Destroyed'), +(4325,0,'628',NULL,'','Isle of Conquest - Alliance East Gate - Destroyed'), +(4326,1,'628',NULL,'','Isle of Conquest - Alliance East Gate'), +(4327,1,'628',NULL,'','Isle of Conquest - Alliance West Gate'), +(4328,1,'628',NULL,'','Isle of Conquest - Alliance Front Gate'), +(4339,1,'628',NULL,'','Isle of Conquest - Alliance Keep - Alliance Controlled'), +(4340,0,'628',NULL,'','Isle of Conquest - Alliance Keep - Horde Controlled'), +(4341,0,'628',NULL,'','Isle of Conquest - Alliance Keep - Uncontrolled'), +(4342,0,'628',NULL,'','Isle of Conquest - Alliance Keep - In Conflict Alliance'), +(4343,0,'628',NULL,'','Isle of Conquest - Alliance Keep - In Conflict Horde'), +(4344,0,'628',NULL,'','Isle of Conquest - Horde Keep - Alliance Controlled'), +(4345,1,'628',NULL,'','Isle of Conquest - Horde Keep - Horde Controlled'), +(4346,0,'628',NULL,'','Isle of Conquest - Horde Keep - Uncontrolled'), +(4347,0,'628',NULL,'','Isle of Conquest - Horde Keep - In Conflict Alliance'), +(4348,0,'628',NULL,'','Isle of Conquest - Horde Keep - In Conflict Horde'), +(4352,0,'607',NULL,'','Strand of the Ancients - Alliance Attacker'), +(4353,0,'607',NULL,'','Strand of the Ancients - Horde Attacker'), +(5834,0,'529,1681,2107,2177',NULL,'','Arathi Basin - Stables control state POI'), +(8524,0,'559,562,572,617,618,980,1134,1504,1505,1552,1672,1825,1911,2167,2373,2509,2511,2547',NULL,'','Arenas - Show Time remaining'), +(8529,0,'559,562,572,617,618,980,1134,1504,1505,1552,1672,1825,1911,2167,2373,2509,2511,2547',NULL,'','Arenas - Time remaining'), +(8799,0,'529,1681,2107,2177',NULL,'','Arathi Basin - Blacksmith control state POI'), +(8805,0,'529,1681,2107,2177',NULL,'','Arathi Basin - Lumber Mill control state POI'), +(8808,0,'529,1681,2107,2177',NULL,'','Arathi Basin - Farm control state POI'), +(8809,0,'529,1681,2107,2177',NULL,'','Arathi Basin - Gold Minecontrol state POI'), +(8863,0,'566,968',NULL,'','Eye of the Storm - Flag POI'), +(9808,0,'566,968',NULL,'','Eye of the Storm - Alliance Flag UI'), +(9809,0,'566,968',NULL,'','Eye of the Storm - Horde Flag UI'), +(13401,0,'559,562,572,617,618,980,1134,1504,1505,1552,1672,1825,1911,2167,2373,2509,2511,2547',NULL,'','Arenas - Show Extra Lives'), +(15480,0,'559,562,572,617,618,980,1134,1504,1505,1552,1672,1825,1911,2167,2373,2509,2511,2547',NULL,'','Arenas - Green Team Extra Lives'), +(15481,0,'559,562,572,617,618,980,1134,1504,1505,1552,1672,1825,1911,2167,2373,2509,2511,2547',NULL,'','Arenas - Gold Team Extra Lives'), +(17303,3,'489,726,2106',NULL,'','Warsong Gulch/Twin Peaks - Max flag captures (new)'), +(17322,0,'529,1681,2107,2177',NULL,'','Arathi Basin - Stables Alliance control state widget'), +(17323,0,'529,1681,2107,2177',NULL,'','Arathi Basin - Gold Mine Alliance control state widget'), +(17324,0,'529,1681,2107,2177',NULL,'','Arathi Basin - Blacksmith Alliance control state widget'), +(17325,0,'529,1681,2107,2177',NULL,'','Arathi Basin - Farm Alliance control state widget'), +(17326,0,'529,1681,2107,2177',NULL,'','Arathi Basin - Lumber Mill Alliance control state widget'), +(17327,0,'529,1681,2107,2177',NULL,'','Arathi Basin - Blacksmith Horde control state widget'), +(17328,0,'529,1681,2107,2177',NULL,'','Arathi Basin - Farm Horde control state widget'), +(17329,0,'529,1681,2107,2177',NULL,'','Arathi Basin - Gold Mine Horde control state widget'), +(17330,0,'529,1681,2107,2177',NULL,'','Arathi Basin - Lumber Mill Horde control state widget'), +(17331,0,'529,1681,2107,2177',NULL,'','Arathi Basin - Stables Horde control state widget'), +(17361,0,'566,968',NULL,'','Eye of the Storm - Mage Tower Horde control state'), +(17362,0,'566,968',NULL,'','Eye of the Storm - Draenei Ruins Horde control state'), +(17363,0,'566,968',NULL,'','Eye of the Storm - Blood Elf Tower Horde control state'), +(17364,0,'566,968',NULL,'','Eye of the Storm - Fel Reaver Ruins Horde control state'), +(17365,0,'566,968',NULL,'','Eye of the Storm - Blood Elf Tower Alliance control state'), +(17366,0,'566,968',NULL,'','Eye of the Storm - Draenei Ruins Alliance control state'), +(17367,0,'566,968',NULL,'','Eye of the Storm - Fel Reaver Ruins Alliance control state'), +(17368,0,'566,968',NULL,'','Eye of the Storm - Mage Tower Alliance control state'), +(17377,400,'628',NULL,'','Isle of Conquest - Max reinforcements'), +(17712,0,'2106',NULL,'','Warsong Scramble - Horde flag picked up count'), +(17713,0,'2106',NULL,'','Warsong Scramble - Alliance flag picked up count'), +(21322,0,'559,562,572,617,618,980,1134,1504,1505,1552,1672,1825,1911,2167,2373,2509,2511,2547',NULL,'','Arenas - Show Solo Shuffle round'), +(21427,0,'559,562,572,617,618,980,1134,1504,1505,1552,1672,1825,1911,2167,2373,2509,2511,2547',NULL,'','Arenas - Solo Shuffle round'); + +DELETE FROM `criteria_data` WHERE `ScriptName` IN ( +'achievement_resilient_victory', +'achievement_bg_control_all_nodes', +'achievement_save_the_day', +'achievement_bg_ic_resource_glut', +'achievement_bg_ic_glaive_grave', +'achievement_bg_ic_mowed_down', +'achievement_bg_sa_artillery', +'achievement_sickly_gazelle', +'achievement_everything_counts', +'achievement_bg_av_perfection', +'achievement_bg_sa_defense_of_ancients', +'achievement_not_even_a_scratch' +);