Core/Spells: corrected more spell bonus calculations

This commit is contained in:
Ovahlord committed 2019-05-10 06:57:23 +02:00
1 parent 0f34b46b6e
commit cf1a3d2d64
1 file changed
+11 -8
+11 -8
View File
@@ -6667,6 +6667,12 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
DoneTotal += int32(bonus->ap_bonus * stack * ApCoeffMod * APbonus);
}
}
else
{
// No bonus damage for SPELL_DAMAGE_CLASS_NONE class spells by default
if (spellProto->DmgClass == SPELL_DAMAGE_CLASS_NONE)
return pdamage;
}
// Default calculation
if (DoneAdvertisedBenefit)
@@ -6963,14 +6969,13 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui
// Check for table values
float coeff = 0;
SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id);
if (bonus)
if (SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id))
coeff = (damagetype == DOT) ? bonus->dot_damage : bonus->direct_damage;
// Default calculation
if (TakenAdvertisedBenefit)
{
if (!bonus || coeff < 0)
if (coeff < 0)
coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack);
// level penalty still applied on Taken bonus - is it blizzlike?
@@ -7626,9 +7631,8 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u
}
// Check for table values
SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id);
float coeff = 0;
if (bonus)
if (SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id))
coeff = (damagetype == DOT) ? bonus->dot_damage : bonus->direct_damage;
else
{
@@ -7643,7 +7647,7 @@ uint32 Unit::SpellHealingBonusTaken(Unit* caster, SpellInfo const* spellProto, u
// Default calculation
if (TakenAdvertisedBenefit)
{
if (!bonus || coeff < 0)
if (coeff < 0)
coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack) * 1.88f; // As wowwiki says: C = (Cast Time / 3.5) * 1.88 (for healing spells)
if (Player* modOwner = GetSpellModOwner())
@@ -7970,8 +7974,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType
if (spellProto)
{
// Check for table values
SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id);
if (bonus)
if (SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id))
{
if (bonus->ap_bonus > 0)
{