Core/Auras: Implemented SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES

Port From (https://github.com/TrinityCore/TrinityCore/commit/ac1ef5efbe0a8c4cf25f4bdf154d5b4e86827c06)
This commit is contained in:
hondacrx
2021-02-22 15:52:37 -05:00
parent 04f2703e70
commit cb1afc82b2
2 changed files with 13 additions and 0 deletions
+3
View File
@@ -382,6 +382,9 @@ namespace Game.Entities
if (HasUnitFlag(UnitFlags.Pacified))
return false;
if (HasAuraType(AuraType.DisableAttackingExceptAbilities))
return false;
// nobody can attack GM in GM-mode
if (victim.IsTypeId(TypeId.Player))
{
+10
View File
@@ -1913,6 +1913,16 @@ namespace Game.Spells
HandleAuraModSilence(aurApp, mode, apply);
}
[AuraEffectHandler(AuraType.DisableAttackingExceptAbilities)]
void HandleAuraDisableAttackingExceptAbilities(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{
if (!mode.HasAnyFlag(AuraEffectHandleModes.SendForClientMask))
return;
if (apply)
aurApp.GetTarget().AttackStop();
}
[AuraEffectHandler(AuraType.ModNoActions)]
void HandleAuraModNoActions(AuraApplication aurApp, AuraEffectHandleModes mode, bool apply)
{