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:
Ovah
2020-02-28 19:22:25 +01:00
committed by Shauren
parent 862b0ad651
commit 8f4c6ebb49
3 changed files with 5 additions and 21 deletions

View File

@@ -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)
{

View File

@@ -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);
}

View File

@@ -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;