aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobinsch <robin.schriever.hude@web.de>2015-07-01 16:04:37 +0200
committerrobinsch <robin.schriever.hude@web.de>2015-07-01 16:04:37 +0200
commit067b4c3243843fcbfbac50b1ee0346cdf5e53ca8 (patch)
treed3525a34dfe1f3db6c20537da94fa191972dfaa6
parent7fbd035620bfc5813a3366b9cb2f91deb7a216aa (diff)
Core/Spells: Revert changes to Unit.cpp done in https://github.com/TrinityCore/TrinityCore/commit/198ffba5ee3b64852b3b090ebdeebd87494cc9f6. This will fix issues with direct damage spells dealing wrong damage that are based on percentage of existing HOT or DOT auras due to missing SPELLMOD_DOT apply.
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp28
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 b9d4650de47..671d3325431 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -9949,15 +9949,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));
}
@@ -10797,15 +10793,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));
}