From 04f2703e7040ddcf322b8dd511c70ac3efa6ddb3 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 22 Feb 2021 15:50:50 -0500 Subject: [PATCH] Core/Auras: Reimplement SPELL_AURA_DISABLE_CASTING_EXCEPT_ABILITIES to properly allow casting listed spells Port From (https://github.com/TrinityCore/TrinityCore/commit/1b8ef46808c44e68f213768c6a64ccc0048f3d65) --- Source/Game/Entities/Player/Player.cs | 2 +- Source/Game/Spells/Auras/AuraEffect.cs | 21 --------------------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/Source/Game/Entities/Player/Player.cs b/Source/Game/Entities/Player/Player.cs index 30c89da7e..13c5999bd 100644 --- a/Source/Game/Entities/Player/Player.cs +++ b/Source/Game/Entities/Player/Player.cs @@ -5811,7 +5811,7 @@ namespace Game.Entities AddUnitFlag2(UnitFlags2.RegeneratePower);// must be set // cleanup player flags (will be re-applied if need at aura load), to avoid have ghost flag without ghost aura, for example. - RemovePlayerFlag(PlayerFlags.AFK | PlayerFlags.DND | PlayerFlags.GM | PlayerFlags.Ghost | PlayerFlags.AllowOnlyAbility); + RemovePlayerFlag(PlayerFlags.AFK | PlayerFlags.DND | PlayerFlags.GM | PlayerFlags.Ghost); RemoveVisFlags(UnitVisFlags.All); // one form stealth modified bytes RemovePvpFlag(UnitPVPStateFlags.FFAPvp | UnitPVPStateFlags.Sanctuary); diff --git a/Source/Game/Spells/Auras/AuraEffect.cs b/Source/Game/Spells/Auras/AuraEffect.cs index 5bd3c7ec1..c1fb1d509 100644 --- a/Source/Game/Spells/Auras/AuraEffect.cs +++ b/Source/Game/Spells/Auras/AuraEffect.cs @@ -1913,27 +1913,6 @@ namespace Game.Spells HandleAuraModSilence(aurApp, mode, apply); } - [AuraEffectHandler(AuraType.DisableCastingExceptAbilities)] - void HandleAuraAllowOnlyAbility(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply) - { - if (!mode.HasAnyFlag(AuraEffectHandleModes.SendForClientMask)) - return; - - Player target = aurApp.GetTarget().ToPlayer(); - if (target != null) - { - if (apply) - target.AddPlayerFlag(PlayerFlags.AllowOnlyAbility); - else - { - // do not remove unit flag if there are more than this auraEffect of that kind on unit on unit - if (target.HasAuraType(AuraType.DisableCastingExceptAbilities)) - return; - target.RemovePlayerFlag(PlayerFlags.AllowOnlyAbility); - } - } - } - [AuraEffectHandler(AuraType.ModNoActions)] void HandleAuraModNoActions(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply) {