mirror of
https://github.com/mangosfour/server.git
synced 2025-12-27 19:37:04 +00:00
[11633] Implement function Unit::HasAffectedAura
This commit is contained in:
parent
54f623d2b8
commit
3443a97a28
5 changed files with 27 additions and 24 deletions
|
|
@ -8282,17 +8282,15 @@ void Aura::HandleAuraSafeFall( bool Apply, bool Real )
|
|||
|
||||
bool Aura::IsCritFromAbilityAura(Unit* caster, uint32& damage)
|
||||
{
|
||||
Unit::AuraList const& auras = caster->GetAurasByType(SPELL_AURA_ABILITY_PERIODIC_CRIT);
|
||||
for(Unit::AuraList::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||
{
|
||||
if (!(*itr)->isAffectedOnSpell(GetSpellProto()))
|
||||
continue;
|
||||
if (!caster->IsSpellCrit(GetTarget(), GetSpellProto(), GetSpellSchoolMask(GetSpellProto())))
|
||||
break;
|
||||
if (!caster->HasAffectedAura(SPELL_AURA_ABILITY_PERIODIC_CRIT, GetSpellProto()))
|
||||
return false;
|
||||
|
||||
if (caster->IsSpellCrit(GetTarget(), GetSpellProto(), GetSpellSchoolMask(GetSpellProto())))
|
||||
{
|
||||
damage = caster->SpellCriticalDamageBonus(GetSpellProto(), damage, GetTarget());
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue