Fix pet/guardian and other types of minion pet attack on targets with Crowd Controls.
This commit is contained in:
@@ -516,6 +516,24 @@ bool Unit::HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Unit::HasBreakableByDamageAuraType(AuraType type) const
|
||||
{
|
||||
AuraEffectList const& auras = GetAuraEffectsByType(type);
|
||||
for (AuraEffectList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||
if ((*itr)->GetSpellInfo()->Attributes & SPELL_ATTR0_BREAKABLE_BY_DAMAGE || (*itr)->GetSpellInfo()->AuraInterruptFlags & AURA_INTERRUPT_FLAG_TAKE_DAMAGE)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Unit::HasBreakableByDamageCrowdControlAura() const
|
||||
{
|
||||
return ( HasBreakableByDamageAuraType(SPELL_AURA_MOD_CONFUSE)
|
||||
|| HasBreakableByDamageAuraType(SPELL_AURA_MOD_FEAR)
|
||||
|| HasBreakableByDamageAuraType(SPELL_AURA_MOD_STUN)
|
||||
|| HasBreakableByDamageAuraType(SPELL_AURA_MOD_ROOT)
|
||||
|| HasBreakableByDamageAuraType(SPELL_AURA_TRANSFORM));
|
||||
}
|
||||
|
||||
void Unit::DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb)
|
||||
{
|
||||
if (!victim || !victim->isAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsInEvadeMode()))
|
||||
|
||||
@@ -1536,6 +1536,8 @@ class Unit : public WorldObject
|
||||
|
||||
bool HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, uint32 familyFlags) const;
|
||||
bool virtual HasSpell(uint32 /*spellID*/) const { return false; }
|
||||
bool HasBreakableByDamageAuraType(AuraType type) const;
|
||||
bool HasBreakableByDamageCrowdControlAura() const;
|
||||
|
||||
bool HasStealthAura() const { return HasAuraType(SPELL_AURA_MOD_STEALTH); }
|
||||
bool HasInvisibilityAura() const { return HasAuraType(SPELL_AURA_MOD_INVISIBILITY); }
|
||||
|
||||
Reference in New Issue
Block a user