Core/Aura: allow all dots to crit (#460)
This commit is contained in:
2 files changed
+4
-8
No files matched your search
@@ -490,22 +490,18 @@ void Aura::_InitEffects(uint8 effMask, Unit* caster, int32 const* baseAmount)
|
||||
}
|
||||
}
|
||||
|
||||
bool Aura::CanPeriodicTickCrit(Unit const* caster) const
|
||||
bool Aura::CanPeriodicTickCrit() const
|
||||
{
|
||||
if (m_spellInfo->HasAttribute(SPELL_ATTR8_PERIODIC_CAN_CRIT))
|
||||
return true;
|
||||
|
||||
if (m_spellInfo->HasAttribute(SPELL_ATTR2_CANT_CRIT))
|
||||
return false;
|
||||
|
||||
return caster->HasAuraTypeWithAffectMask(SPELL_AURA_ABILITY_PERIODIC_CRIT, GetSpellInfo());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
float Aura::CalcPeriodicCritChance(Unit const* caster) const
|
||||
{
|
||||
Player* modOwner = caster->GetSpellModOwner();
|
||||
if (!modOwner || !CanPeriodicTickCrit(modOwner))
|
||||
if (!modOwner || !CanPeriodicTickCrit())
|
||||
return 0.f;
|
||||
|
||||
float critChance = modOwner->SpellCritChanceDone(GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), GetSpellInfo()->GetAttackType(), true);
|
||||
|
||||
@@ -202,7 +202,7 @@ class TC_GAME_API Aura
|
||||
void SetLoadedState(int32 maxduration, int32 duration, int32 charges, uint8 stackamount, uint8 recalculateMask, float critChance, bool applyResilience, int32* amount);
|
||||
|
||||
// helpers for aura effects
|
||||
bool CanPeriodicTickCrit(Unit const* caster) const;
|
||||
bool CanPeriodicTickCrit() const;
|
||||
float CalcPeriodicCritChance(Unit const* caster) const;
|
||||
|
||||
bool HasEffect(uint8 effIndex) const { return GetEffect(effIndex) != nullptr; }
|
||||
|
||||
Reference in new issue
Block a user