Core/Spells: fixed a logic mistake in calculating spell bonus values with multiple stacks which was causing the stack bonus getting applied twice

* corrected a damage bonus calculation for Mirror Image
This commit is contained in:
Ovahlord committed 2019-08-23 23:32:41 +02:00
1 parent 1cb0430ffc
commit bd43c1d4d1
2 files changed
+9 -5

No files matched your search

+8 -4
View File
@@ -6705,8 +6705,8 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
// Default calculation
if (DoneAdvertisedBenefit)
{
if (coeff < 0)
coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack);
if (coeff < 0.f)
coeff = CalculateDefaultCoefficient(spellProto, damagetype);
if (Player* modOwner = GetSpellModOwner())
{
@@ -6731,6 +6731,10 @@ float Unit::SpellDamagePctDone(Unit* victim, SpellInfo const* spellProto, Damage
if (!spellProto || !victim || damagetype == DIRECT_DAMAGE)
return 1.0f;
// Some spells don't benefit from done mods
if (spellProto->HasAttribute(SPELL_ATTR3_NO_DONE_BONUS))
return 1.0f;
// Some spells don't benefit from pct done mods
if (spellProto->HasAttribute(SPELL_ATTR6_LIMIT_PCT_DAMAGE_MODS))
return 1.0f;
@@ -7498,7 +7502,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
if (DoneAdvertisedBenefit)
{
if (coeff < 0.f)
coeff = CalculateDefaultCoefficient(spellProto, damagetype) * int32(stack) * 1.88f; // As wowwiki says: C = (Cast Time / 3.5) * 1.88 (for healing spells)
coeff = CalculateDefaultCoefficient(spellProto, damagetype) * 1.88f; // As wowwiki says: C = (Cast Time / 3.5) * 1.88 (for healing spells)
if (Player* modOwner = GetSpellModOwner())
{
@@ -7985,7 +7989,7 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType
// Check for table values
if (SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id))
{
if (bonus->ap_bonus > 0)
if (bonus->ap_bonus > 0.f)
{
float APbonus = GetTotalAttackPowerValue(attType);
DoneFlatBenefit += int32(bonus->ap_bonus * APbonus);