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:
@@ -5811,7 +5811,7 @@ namespace Game.Entities
|
|||||||
AddUnitFlag2(UnitFlags2.RegeneratePower);// must be set
|
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.
|
// 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
|
RemoveVisFlags(UnitVisFlags.All); // one form stealth modified bytes
|
||||||
RemovePvpFlag(UnitPVPStateFlags.FFAPvp | UnitPVPStateFlags.Sanctuary);
|
RemovePvpFlag(UnitPVPStateFlags.FFAPvp | UnitPVPStateFlags.Sanctuary);
|
||||||
|
|||||||
@@ -1913,27 +1913,6 @@ namespace Game.Spells
|
|||||||
HandleAuraModSilence(aurApp, mode, apply);
|
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)]
|
[AuraEffectHandler(AuraType.ModNoActions)]
|
||||||
void HandleAuraModNoActions(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
void HandleAuraModNoActions(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user