Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/server/game/Spells/Auras/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Spells/Auras/SpellAuras.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
Loading