aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authorthenecromancer <none@none>2010-03-19 08:47:03 +0100
committerthenecromancer <none@none>2010-03-19 08:47:03 +0100
commit34d7e1fed941c03674147e8b84a0f30548f614b8 (patch)
tree6b1f2811396aad51c4381c91926cb9396758b1a6 /src/game/Unit.cpp
parentf1266ebec3cec67e8f6af569018dd428149b0063 (diff)
Missing part of previous commit (Periodic Leech is DoT as well)
Fix talents Improved Rend and Gag Order not increasing whole damage of affected spells (applying effect modifiers - spellmod_effectx should be however done for every static damage added to already calculated damage, we can't just apply all spellmods after effects are processed...) --HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp38
1 files changed, 22 insertions, 16 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 5a07c68efe4..8608daa55fc 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -12212,6 +12212,27 @@ Unit* Creature::SelectVictim()
//======================================================================
//======================================================================
+int32 Unit::ApplyEffectModifiers(SpellEntry const* spellProto, uint8 effect_index, int32 value)
+{
+ if (Player* modOwner = GetSpellModOwner())
+ {
+ modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_ALL_EFFECTS, value);
+ switch (effect_index)
+ {
+ case 0:
+ modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_EFFECT1, value);
+ break;
+ case 1:
+ modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_EFFECT2, value);
+ break;
+ case 2:
+ modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_EFFECT3, value);
+ break;
+ }
+ }
+ return value;
+}
+
int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_index, int32 effBasePoints, Unit const* /*target*/)
{
int32 level = int32(getLevel());
@@ -12239,22 +12260,7 @@ int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_inde
if (float comboDamage = spellProto->EffectPointsPerComboPoint[effect_index])
value += int32(comboDamage * comboPoints);
- if (Player* modOwner = GetSpellModOwner())
- {
- modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_ALL_EFFECTS, value);
- switch (effect_index)
- {
- case 0:
- modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_EFFECT1, value);
- break;
- case 1:
- modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_EFFECT2, value);
- break;
- case 2:
- modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_EFFECT3, value);
- break;
- }
- }
+ value = ApplyEffectModifiers(spellProto, effect_index, value);
if (!basePointsPerLevel && (spellProto->Attributes & SPELL_ATTR_LEVEL_DAMAGE_CALCULATION && spellProto->spellLevel) &&
spellProto->Effect[effect_index] != SPELL_EFFECT_WEAPON_PERCENT_DAMAGE &&