From a557dbea68677bcd6b3e3a0e6a70b77e2cddefff Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 29 Nov 2021 14:45:04 -0500 Subject: [PATCH] Core/Disables: Implement SPELL_DISABLE_ARENAS Port From (https://github.com/TrinityCore/TrinityCore/commit/268e0bea184ef8dc8d56c9f4baccb876ed245db4) --- Source/Game/Conditions/DisableManager.cs | 19 +++++++++++++++++-- ...021_11_24_30_world_2019_03_09_01_world.sql | 2 ++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 sql/updates/world/master/2021_11_24_30_world_2019_03_09_01_world.sql diff --git a/Source/Game/Conditions/DisableManager.cs b/Source/Game/Conditions/DisableManager.cs index 8952e1d81..0aa889846 100644 --- a/Source/Game/Conditions/DisableManager.cs +++ b/Source/Game/Conditions/DisableManager.cs @@ -63,7 +63,7 @@ namespace Game } uint entry = result.Read(1); - DisableFlags flags = (DisableFlags)result.Read(2); + DisableFlags flags = (DisableFlags)result.Read(2); string params_0 = result.Read(3); string params_1 = result.Read(4); @@ -305,6 +305,19 @@ namespace Game (refe.IsCreature() && (spellFlags.HasFlag(DisableFlags.SpellCreature) || (refe.ToUnit().IsPet() && spellFlags.HasFlag(DisableFlags.SpellPet)))) || (refe.IsGameObject() && spellFlags.HasFlag(DisableFlags.SpellGameobject))) { + if (spellFlags.HasAnyFlag(DisableFlags.SpellArenas | DisableFlags.SpellBattleGrounds)) + { + var map = refe.GetMap(); + if (map != null) + { + if (spellFlags.HasFlag(DisableFlags.SpellArenas) && map.IsBattleArena()) + return true; // Current map is Arena and this spell is disabled here + + if (spellFlags.HasFlag(DisableFlags.SpellBattleGrounds) && map.IsBattleground()) + return true; // Current map is a Battleground and this spell is disabled here + } + } + if (spellFlags.HasFlag(DisableFlags.SpellMap)) { List mapIds = data.param0; @@ -416,7 +429,9 @@ namespace Game SpellArea = 0x20, SpellLOS = 0x40, SpellGameobject = 0x80, - MaxSpell = SpellPlayer | SpellCreature | SpellPet | SpellDeprecatedSpell | SpellMap | SpellArea | SpellLOS | SpellGameobject, + SpellArenas = 0x100, + SpellBattleGrounds = 0x200, + MaxSpell = SpellPlayer | SpellCreature | SpellPet | SpellDeprecatedSpell | SpellMap | SpellArea | SpellLOS | SpellGameobject | SpellArenas | SpellBattleGrounds, VmapAreaFlag = 0x01, VmapHeight = 0x02, diff --git a/sql/updates/world/master/2021_11_24_30_world_2019_03_09_01_world.sql b/sql/updates/world/master/2021_11_24_30_world_2019_03_09_01_world.sql new file mode 100644 index 000000000..9763c266e --- /dev/null +++ b/sql/updates/world/master/2021_11_24_30_world_2019_03_09_01_world.sql @@ -0,0 +1,2 @@ +-- +ALTER TABLE `disables` CHANGE `flags` `flags` SMALLINT(5) NOT NULL;