Core/Auras: Reimplement SPELL_AURA_DISABLE_CASTING_EXCEPT_ABILITIES to properly allow casting listed spells

Port From (https://github.com/TrinityCore/TrinityCore/commit/1b8ef46808c44e68f213768c6a64ccc0048f3d65)
This commit is contained in:
hondacrx
2021-02-22 15:50:50 -05:00
parent da3e2f433b
commit 04f2703e70
2 changed files with 1 additions and 22 deletions
+1 -1
View File
@@ -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);
-21
View File
@@ -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)
{