mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[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:
parent
4951f846dd
commit
e880e7d236
4 changed files with 33 additions and 79 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue