mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Units: UNIT_FLAG_PACIFIED will no longer block victim updates (#24190)
* Core/Units: UNIT_FLAG_PACIFIED will no longer block victim updates
* pacified units should only have their melee attacks blocked as counterpart to silence mechanics
* Core/Spells: removed unnecessary attack stop call from pacify aura effect handler
(cherry picked from commit 6cbfda2fce)
This commit is contained in:
@@ -1990,6 +1990,9 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr
|
||||
if (HasUnitState(UNIT_STATE_CANNOT_AUTOATTACK) || HasUnitFlag(UNIT_FLAG_PACIFIED))
|
||||
return;
|
||||
|
||||
if (HasAuraType(SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES))
|
||||
return;
|
||||
|
||||
if (!victim->IsAlive())
|
||||
return;
|
||||
|
||||
@@ -5419,12 +5422,6 @@ bool Unit::Attack(Unit* victim, bool meleeAttack)
|
||||
if (creature && creature->IsInEvadeMode())
|
||||
return false;
|
||||
|
||||
if (HasUnitFlag(UNIT_FLAG_PACIFIED))
|
||||
return false;
|
||||
|
||||
if (HasAuraType(SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES))
|
||||
return false;
|
||||
|
||||
// nobody can attack GM in GM-mode
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
|
||||
@@ -332,7 +332,7 @@ NonDefaultConstructible<pAuraEffectHandler> AuraEffectHandler[TOTAL_AURAS]=
|
||||
&AuraEffect::HandlePhase, //261 SPELL_AURA_PHASE
|
||||
&AuraEffect::HandleNoImmediateEffect, //262 SPELL_AURA_ABILITY_IGNORE_AURASTATE implemented in Spell::CheckCast
|
||||
&AuraEffect::HandleNoImmediateEffect, //263 SPELL_AURA_DISABLE_CASTING_EXCEPT_ABILITIES implemented in Spell::CheckCast
|
||||
&AuraEffect::HandleAuraDisableAttackingExceptAbilities, //264 SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES implemented in Spell::CheckCast, Unit::Attack
|
||||
&AuraEffect::HandleNoImmediateEffect, //264 SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES implemented in Spell::CheckCast, Unit::AttackerStateUpdate
|
||||
&AuraEffect::HandleUnused, //265 unused (4.3.4)
|
||||
&AuraEffect::HandleNULL, //266 SPELL_AURA_SET_VIGNETTE
|
||||
&AuraEffect::HandleNoImmediateEffect, //267 SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL implemented in Unit::IsImmunedToSpellEffect
|
||||
@@ -2295,10 +2295,7 @@ void AuraEffect::HandleAuraModPacify(AuraApplication const* aurApp, uint8 mode,
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
if (apply)
|
||||
{
|
||||
target->AddUnitFlag(UNIT_FLAG_PACIFIED);
|
||||
target->AttackStop();
|
||||
}
|
||||
else
|
||||
{
|
||||
// do not remove unit flag if there are more than this auraEffect of that kind on unit on unit
|
||||
@@ -2334,15 +2331,6 @@ void AuraEffect::HandleAuraModPacifyAndSilence(AuraApplication const* aurApp, ui
|
||||
HandleAuraModSilence(aurApp, mode, apply);
|
||||
}
|
||||
|
||||
void AuraEffect::HandleAuraDisableAttackingExceptAbilities(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
{
|
||||
if (!(mode & AURA_EFFECT_HANDLE_SEND_FOR_CLIENT_MASK))
|
||||
return;
|
||||
|
||||
if (apply)
|
||||
aurApp->GetTarget()->AttackStop();
|
||||
}
|
||||
|
||||
void AuraEffect::HandleAuraModNoActions(AuraApplication const* aurApp, uint8 mode, bool apply) const
|
||||
{
|
||||
if (!(mode & AURA_EFFECT_HANDLE_REAL))
|
||||
@@ -4061,7 +4049,7 @@ void AuraEffect::HandleModCastingSpeed(AuraApplication const* aurApp, uint8 mode
|
||||
|
||||
if (spellGroupVal)
|
||||
target->ApplyCastTimePercentMod(float(spellGroupVal), !apply);
|
||||
|
||||
|
||||
target->ApplyCastTimePercentMod((float)GetAmount(), apply);
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +164,6 @@ class TC_GAME_API AuraEffect
|
||||
void HandleAuraModSilence(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModPacify(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModPacifyAndSilence(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraDisableAttackingExceptAbilities(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
void HandleAuraModNoActions(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
// tracking
|
||||
void HandleAuraTrackCreatures(AuraApplication const* aurApp, uint8 mode, bool apply) const;
|
||||
|
||||
Reference in New Issue
Block a user