diff options
author | mik1893 <michele.roscelli@gmail.com> | 2015-07-14 16:46:55 +0200 |
---|---|---|
committer | mik1893 <michele.roscelli@gmail.com> | 2015-07-14 16:46:55 +0200 |
commit | ef4918d939184a3b8d672c400a1e4bcafee6524e (patch) | |
tree | 17fc5a4b44cb84b47a30158807fca78d7382f67e /src | |
parent | 60a18c7f6fecf8f8c1b9f9fa5220e880e00c01a6 (diff) | |
parent | 067b4c3243843fcbfbac50b1ee0346cdf5e53ca8 (diff) |
Merge pull request #14987 from robinsch/fixupSpellModDOT
Core/Spells: Revert changes to Unit.cpp done in 198ffba
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 17915e53cfb..2ed7558f8bb 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -9964,15 +9964,11 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod); } - float tmpDamage = float(int32(pdamage) + DoneTotal); - // SPELLMOD_DOT will be applied in AuraEffect::HandlePeriodicDamageAurasTick. - if (damagetype != DOT) - { - tmpDamage *= SpellDamagePctDone(victim, spellProto, damagetype); - // apply spellmod to Done damage (flat and pct) - if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_DAMAGE, tmpDamage); - } + // Done Percentage for DOT is already calculated, no need to do it again. The percentage mod is applied in Aura::HandleAuraSpecificMods. + float tmpDamage = (int32(pdamage) + DoneTotal) * (damagetype == DOT ? 1.0f : SpellDamagePctDone(victim, spellProto, damagetype)); + // apply spellmod to Done damage (flat and pct) + if (Player* modOwner = GetSpellModOwner()) + modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, tmpDamage); return uint32(std::max(tmpDamage, 0.0f)); } @@ -10812,15 +10808,11 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui DoneTotal = 0; } - float heal = float(int32(healamount) + DoneTotal); - // SPELLMOD_DOT will be applied in AuraEffect::HandlePeriodicHealAurasTick. - if (damagetype != DOT) - { - heal *= SpellHealingPctDone(victim, spellProto); - // apply spellmod to Done amount - if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_DAMAGE, heal); - } + // Done Percentage for DOT is already calculated, no need to do it again. The percentage mod is applied in Aura::HandleAuraSpecificMods. + float heal = float(int32(healamount) + DoneTotal) * (damagetype == DOT ? 1.0f : SpellHealingPctDone(victim, spellProto)); + // apply spellmod to Done amount + if (Player* modOwner = GetSpellModOwner()) + modOwner->ApplySpellMod(spellProto->Id, damagetype == DOT ? SPELLMOD_DOT : SPELLMOD_DAMAGE, heal); return uint32(std::max(heal, 0.0f)); } |