Jump to content

[FIX]Shadowfiend, Mana Tide Totem, SpellEffectEnergisePct()


Auntie Mangos
 Share

Recommended Posts

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

Shadowfiend mana restore for example, properly restore mana on targets.

For which repository revision was the patch created?

8512

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=10076 or

http://getmangos.eu/community/viewtopic.php?id=9918 or many others...

Who has been writing this patch? Please include either forum user names or email addresses.

My idea how to fix and I wrote it, but thx to my friend "Ring", he find that spells working if caster cast it to himself :)

I wanted to make Shadowfiend working (it do not restore mana properly, restored mana disappears), and I find that spell 34650 (Mana leech) works fine if I cast it on myself, but if I cast it on target, it do not works. So i just replace in SpellEffects.cpp on line 2984 (rev. 8512)....

m_caster->EnergizeBySpell(unitTarget, m_spellInfo->Id, gain, power);

...with...

unitTarget->EnergizeBySpell(unitTarget, m_spellInfo->Id, gain, power);

I dont know if its bad fix(well, it ist good), so tell please if its too bad....

PS: I havent .patch file, its just one line and I'm afraid .patch file from me would be wrong, sorry.

EDIT: ...but if you want there is my GIT commit: http://github.com/Tasssadar/Valhalla-Project/commit/b0fbae26822ebf1d5e7803fe24757453afd44a9d (commits are not in english, sorry)

Link to comment
Share on other sites

  • 39 years later...

This should be the diff so people can apply it :)

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 6650eb0..8cb9527 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -2981,7 +2981,7 @@ void Spell::EffectEnergisePct(uint32 i)
        return;

    uint32 gain = damage * maxPower / 100;
-    m_caster->EnergizeBySpell(unitTarget, m_spellInfo->Id, gain, power);
+    unitTarget->EnergizeBySpell(unitTarget, m_spellInfo->Id, gain, power);
}

void Spell::SendLoot(uint64 guid, LootType loottype)

Link to comment
Share on other sites

Already use

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 5ddca82..c7e1e5c 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -7687,7 +7687,7 @@ void Unit::EnergizeBySpell(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers
{
    SendEnergizeSpellLog(pVictim, SpellID, Damage, powertype);
    // needs to be called after sending spell log
-    ModifyPower(powertype, Damage);
+    pVictim->ModifyPower(powertype, Damage);
}

uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint32 pdamage, DamageEffectType damagetype, uint32 stack)

And it works fine for me.

Patch ported to MANGOS from Trinity Core but i forgot who's the author

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