[8635] Rewrote bonus damage claculation

* calculation depends on the damageClass now
  ->SPELL_DAMAGE_CLASS_RANGED & SPELL_DAMAGE_CLASS_MELEE use MeleeDamageBonus()
  ->SPELL_DAMAGE_CLASS_MAGIC & SPELL_DAMAGE_CLASS_RANGED use SpellDamageBonus()
* changes/improvements in MeleeDamageBonus:
  -> improved criterions to apply bonuses
  -> implemented scaling of FLAT damage Bonus for non weapon damage based spells
  -> support of DOT's
  -> added pet's bonus damage for non weapon based spells
* general cleanup in CalculateSpellDamage() and MeleeDamageBonus()
* implemented global helper functions GetWeaponAttackType() and GetAuraTicks() in SpellMgr

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
pasdVn 2009-10-14 00:27:40 +02:00 committed by ApoC
parent 29fde5f671
commit c47cf7bd61
9 changed files with 414 additions and 290 deletions

View file

@ -4609,11 +4609,7 @@ void Spell::EffectWeaponDmg(uint32 i)
bonus = int32(bonus*totalDamagePercentMod);
// prevent negative damage
uint32 eff_damage = uint32(bonus > 0 ? bonus : 0);
// Add melee damage bonuses (also check for negative)
m_caster->MeleeDamageBonus(unitTarget, &eff_damage, m_attackType, m_spellInfo);
m_damage+= eff_damage;
m_damage+= uint32(bonus > 0 ? bonus : 0);
// Hemorrhage
if (m_spellInfo->SpellFamilyName==SPELLFAMILY_ROGUE && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x2000000)))