Jump to content

[Fix][8953] Spell::EffectHealthLeech


Auntie Mangos
 Share

Recommended Posts

What bug does the patch fix? What features does the patch add?

The multiplier "EffectMultipleValue" of EffectHealthLeech should be evaluated after the damage is applied, as in EffectPowerDrain. This fixes warlock's Death Coil.

I couldn't test every other spell that uses this effect, but in spell.dbc I see that they mostly have 1.0 in that column. I hope this patch won't create other problems.

For which repository revision was the patch created?

8526

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

http://getmangos.eu/community/viewtopic.php?id=10013

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 9ec81c7..45e6327 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -2699,17 +2699,18 @@ void Spell::EffectHealthLeech(uint32 i)

    sLog.outDebug("HealthLeech :%i", damage);

-    float multiplier = m_spellInfo->EffectMultipleValue[i];
-
-    if (Player *modOwner = m_caster->GetSpellModOwner())
-        modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_MULTIPLE_VALUE, multiplier);
-
-    int32 new_damage = int32(damage*multiplier);
+    int32 new_damage = int32(damage);
    uint32 curHealth = unitTarget->GetHealth();
    new_damage = m_caster->SpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, new_damage );
    if (curHealth < new_damage)
        new_damage = curHealth;

+    float multiplier = m_spellInfo->EffectMultipleValue[i];
+
+    if (Player *modOwner = m_caster->GetSpellModOwner())
+        modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_MULTIPLE_VALUE, multiplier);
+
+    new_damage = int32(new_damage*multiplier);
    if (m_caster->isAlive())
    {
        new_damage = m_caster->SpellHealingBonus(m_caster, m_spellInfo, new_damage, HEAL); 

Link to comment
Share on other sites

  • 39 years later...
  • 4 weeks later...

The double application of SpellPower seems strange to me, too. I made a new patch, removing that line:

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 4bc5393..32b4260 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -2770,22 +2770,20 @@ void Spell::EffectHealthLeech(uint32 i)

    sLog.outDebug("HealthLeech :%i", damage);

-    float multiplier = m_spellInfo->EffectMultipleValue[i];
-
-    if (Player *modOwner = m_caster->GetSpellModOwner())
-        modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_MULTIPLE_VALUE, multiplier);
-
-    int32 new_damage = int32(damage*multiplier);
+    int32 new_damage = damage;
    uint32 curHealth = unitTarget->GetHealth();
    new_damage = m_caster->SpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, new_damage );
    if (curHealth < new_damage)
        new_damage = curHealth;

+    float multiplier = m_spellInfo->EffectMultipleValue[i];
+
+    if (Player *modOwner = m_caster->GetSpellModOwner())
+        modOwner->ApplySpellMod(m_spellInfo->Id, SPELLMOD_MULTIPLE_VALUE, multiplier);
+
+    new_damage = int32(new_damage*multiplier);
    if (m_caster->isAlive())
-    {
-        new_damage = m_caster->SpellHealingBonus(m_caster, m_spellInfo, new_damage, HEAL);
        m_caster->DealHeal(m_caster, uint32(new_damage), m_spellInfo);
-    }
}

void Spell::DoCreateItem(uint32 i, uint32 itemtype)

This patch is running on my server (500+ users) since I posted it on this forum, and no reports about the affected spells appeared on our bugtracker.

Link to comment
Share on other sites

spell healing and spel damage can be in different rate affected by spell power.

I don't think so - last time when I looked into spell_bonus_data table there was only "direct_bonus" column, not "direct_bonus_damage" and "direct_bonus_heal" and because healing and damage is done by the same spell, it gets same bonus for damage and than again for healing.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use