diff options
Diffstat (limited to 'src/server/game/Spells/SpellInfo.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellInfo.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 07ab71207f1..7732908ac47 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1972,6 +1972,35 @@ uint32 SpellInfo::CalcCastTime(Unit* caster, Spell* spell) const return (castTime > 0) ? uint32(castTime) : 0; } +uint32 SpellInfo::GetMaxTicks() const +{ + int32 DotDuration = GetDuration(); + if (DotDuration == 0) + return 1; + + // 200% limit + if (DotDuration > 30000) + DotDuration = 30000; + + uint8 x = 0; + for (uint8 j = 0; j < MAX_SPELL_EFFECTS; ++j) + { + if (Effects[j].Effect == SPELL_EFFECT_APPLY_AURA && ( + Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE || + Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_HEAL || + Effects[j].ApplyAuraName == SPELL_AURA_PERIODIC_LEECH)) + { + x = j; + break; + } + } + + if (Effects[x].Amplitude != 0) + return DotDuration / Effects[x].Amplitude; + + return 6; +} + uint32 SpellInfo::GetRecoveryTime() const { return RecoveryTime > CategoryRecoveryTime ? RecoveryTime : CategoryRecoveryTime; |
