diff --git a/Source/Framework/Constants/SharedConst.cs b/Source/Framework/Constants/SharedConst.cs index f094896f0..9b9be49dc 100644 --- a/Source/Framework/Constants/SharedConst.cs +++ b/Source/Framework/Constants/SharedConst.cs @@ -2939,4 +2939,15 @@ namespace Framework.Constants EnabledWithoutAutoIgnore = 1, EnabledWithAutoIgnore = 2 } + + public enum AreaId + { + Wintergrasp = 4197, + TheSunkenRing = 4538, + TheBrokenTemplate = 4539, + WintergraspFortress = 4575, + TheChilledQuagmire = 4589, + WestparkWorkshop = 4611, + EastparkWorkshop = 4612, + } } diff --git a/Source/Game/BattleFields/Zones/WinterGrasp.cs b/Source/Game/BattleFields/Zones/WinterGrasp.cs index 4f5d63006..c11c836f1 100644 --- a/Source/Game/BattleFields/Zones/WinterGrasp.cs +++ b/Source/Game/BattleFields/Zones/WinterGrasp.cs @@ -30,7 +30,7 @@ namespace Game.BattleFields { m_TypeId = (uint)BattleFieldTypes.WinterGrasp; // See enum BattlefieldTypes m_BattleId = BattlefieldIds.WG; - m_ZoneId = WGConst.ZoneId; + m_ZoneId = (uint)AreaId.Wintergrasp; m_MapId = WGConst.MapId; m_Map = Global.MapMgr.CreateBaseMap(m_MapId); @@ -431,21 +431,21 @@ namespace Game.BattleFields uint GetSpiritGraveyardId(uint areaId) { - switch (areaId) + switch ((AreaId)areaId) { - case WintergraspAreaIds.WintergraspFortress: + case AreaId.WintergraspFortress: return WGGraveyardId.Keep; - case WintergraspAreaIds.TheSunkenRing: + case AreaId.TheSunkenRing: return WGGraveyardId.WorkshopNE; - case WintergraspAreaIds.TheBrokenTemplate: + case AreaId.TheBrokenTemplate: return WGGraveyardId.WorkshopNW; - case WintergraspAreaIds.WestparkWorkshop: + case AreaId.WestparkWorkshop: return WGGraveyardId.WorkshopSW; - case WintergraspAreaIds.EastparkWorkshop: + case AreaId.EastparkWorkshop: return WGGraveyardId.WorkshopSE; - case WintergraspAreaIds.Wintergrasp: + case AreaId.Wintergrasp: return WGGraveyardId.Alliance; - case WintergraspAreaIds.TheChilledQuagmire: + case AreaId.TheChilledQuagmire: return WGGraveyardId.Horde; default: Log.outError(LogFilter.Battlefield, "BattlefieldWG.GetSpiritGraveyardId: Unexpected Area Id {0}", areaId); @@ -741,14 +741,14 @@ namespace Game.BattleFields public override uint GetData(uint data) { - switch (data) + switch ((AreaId)data) { // Used to determine when the phasing spells must be cast // See: SpellArea.IsFitToRequirements - case WintergraspAreaIds.TheSunkenRing: - case WintergraspAreaIds.TheBrokenTemplate: - case WintergraspAreaIds.WestparkWorkshop: - case WintergraspAreaIds.EastparkWorkshop: + case AreaId.TheSunkenRing: + case AreaId.TheBrokenTemplate: + case AreaId.WestparkWorkshop: + case AreaId.EastparkWorkshop: // Graveyards and Workshops are controlled by the same team. BfGraveyard graveyard = GetGraveyardById((int)GetSpiritGraveyardId(data)); if (graveyard != null) diff --git a/Source/Game/BattleFields/Zones/WinterGraspConst.cs b/Source/Game/BattleFields/Zones/WinterGraspConst.cs index 07ba6e25b..58882855c 100644 --- a/Source/Game/BattleFields/Zones/WinterGraspConst.cs +++ b/Source/Game/BattleFields/Zones/WinterGraspConst.cs @@ -23,7 +23,6 @@ namespace Game.BattleFields { static class WGConst { - public const uint ZoneId = 4197; // Wintergrasp public const uint MapId = 571; // Northrend public const byte MaxOutsideNpcs = 14; @@ -548,17 +547,6 @@ namespace Game.BattleFields public const uint Max = 7; } - public struct WintergraspAreaIds - { - public const uint WintergraspFortress = 4575; - public const uint TheSunkenRing = 4538; - public const uint TheBrokenTemplate = 4539; - public const uint WestparkWorkshop = 4611; - public const uint EastparkWorkshop = 4612; - public const uint Wintergrasp = 4197; - public const uint TheChilledQuagmire = 4589; - } - struct WintergraspQuests { public const uint VictoryAlliance = 13181; diff --git a/Source/Game/Entities/Player/Player.Items.cs b/Source/Game/Entities/Player/Player.Items.cs index d41a50e91..a2af5ba78 100644 --- a/Source/Game/Entities/Player/Player.Items.cs +++ b/Source/Game/Entities/Player/Player.Items.cs @@ -6289,7 +6289,7 @@ namespace Game.Entities if (bg.GetTypeID(true) == BattlegroundTypeId.AV) loot.FillLoot(SharedConst.PlayerCorpseLootEntry, LootStorage.Creature, this, true); } - else if (GetZoneId() == WintergraspAreaIds.Wintergrasp) + else if (GetZoneId() == (uint)AreaId.Wintergrasp) loot.FillLoot(SharedConst.PlayerCorpseLootEntry, LootStorage.Creature, this, true); // It may need a better formula diff --git a/Source/Game/Entities/Player/Player.cs b/Source/Game/Entities/Player/Player.cs index 288d569e9..559439ff5 100644 --- a/Source/Game/Entities/Player/Player.cs +++ b/Source/Game/Entities/Player/Player.cs @@ -3432,7 +3432,7 @@ namespace Game.Entities bg.FillInitialWorldStates(packet); break; // Wintergrasp - case 4197: + case (uint)AreaId.Wintergrasp: if (bf != null && bf.GetTypeId() == (uint)BattleFieldTypes.WinterGrasp) bf.FillInitialWorldStates(packet); goto default; diff --git a/Source/Game/Spells/SpellInfo.cs b/Source/Game/Spells/SpellInfo.cs index f268a0833..81474a8ba 100644 --- a/Source/Game/Spells/SpellInfo.cs +++ b/Source/Game/Spells/SpellInfo.cs @@ -941,7 +941,7 @@ namespace Game.Spells if (mapEntry == null) return SpellCastResult.IncorrectArea; - return zone_id == 4197 || (mapEntry.IsBattleground() && player != null && player.InBattleground()) ? SpellCastResult.SpellCastOk : SpellCastResult.RequiresArea; + return zone_id == (uint)AreaId.Wintergrasp || (mapEntry.IsBattleground() && player != null && player.InBattleground()) ? SpellCastResult.SpellCastOk : SpellCastResult.RequiresArea; case 44521: // Preparation { if (player == null)