diff options
| author | QAston <qaston@gmail.com> | 2012-05-09 15:10:33 -0700 |
|---|---|---|
| committer | QAston <qaston@gmail.com> | 2012-05-09 15:10:33 -0700 |
| commit | 58f63509cd4de9c8bb28a43e127dcf9afb2b0aaa (patch) | |
| tree | dfc2821f63cc9ffc224e746847334ffef381db41 /src/server/game/Spells/SpellInfo.cpp | |
| parent | 0f3db42ffc7e2d5a3c4985802dcafe0c5f075738 (diff) | |
| parent | d94a89c4652e5ffd488c3cdaebd56df8b268bb3e (diff) | |
Merge pull request #6314 from Chaplain/spells
Core/Spells: Separation of caster/target part damage/heal bonus calculation.
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; |
