[9895] Move DotFactor+GetSpellCastTimeForBonus call to CalculateDefaultCoefficient

* This coeff used if not spell_bonus_data provided for spell
* Continue prev. commit line expected that creature casts not affected by DotFactor

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
nos4r2zod 2010-05-15 06:03:16 +04:00 committed by VladimirMangos
parent 4951f846dd
commit e880e7d236
4 changed files with 33 additions and 79 deletions

View file

@ -222,6 +222,25 @@ uint16 GetSpellAuraMaxTicks(SpellEntry const* spellInfo)
return 6;
}
float CalculateDefaultCoefficient(SpellEntry const *spellProto, DamageEffectType const damagetype)
{
// Damage over Time spells bonus calculation
float DotFactor = 1.0f;
if (damagetype == DOT)
{
if (!IsChanneledSpell(spellProto))
DotFactor = GetSpellDuration(spellProto) / 15000.0f;
if (uint16 DotTicks = GetSpellAuraMaxTicks(spellProto))
DotFactor /= DotTicks;
}
// Distribute Damage over multiple effects, reduce by AoE
float coeff = GetSpellCastTimeForBonus(spellProto, damagetype) / 3500.0f;
return coeff * DotFactor;
}
WeaponAttackType GetWeaponAttackType(SpellEntry const *spellInfo)
{
if(!spellInfo)