Jump to content

[9961][fix] improved Drain Soul


pasdVn

Recommended Posts

The current implementation of this proc does not work (restore mana on unit kill, when Drain Soul is channeled). Maybe spells changed (I did not check that). Anyway, here is a fix, that makes it working:

http://github.com/pasdVn/mangos/commit/0c777d68865a0b9c6d82588db116c5b9c90bb4aa.patch

Improved Drain Soul: http://www.wowhead.com/?spell=18372

Drain Soul: http://www.wowhead.com/?spell=1120

Link to comment
Share on other sites

just changed code style

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 98c73b8..8a49127 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -7437,13 +7437,15 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
            // Drain Soul
            if (auraSpellInfo->SpellFamilyFlags & UI64LIT(0x0000000000004000))
            {
-                Unit::AuraList const& mAddFlatModifier = GetAurasByType(SPELL_AURA_ADD_FLAT_MODIFIER);
-                for(Unit::AuraList::const_iterator i = mAddFlatModifier.begin(); i != mAddFlatModifier.end(); ++i)
+                // search for "Improved Drain Soul" dummy aura
+                Unit::AuraList const& mDummyAura = GetAurasByType(SPELL_AURA_DUMMY);
+                for(Unit::AuraList::const_iterator i = mDummyAura.begin(); i != mDummyAura.end(); ++i)
                {
-                    if ((*i)->GetModifier()->m_miscvalue == SPELLMOD_CHANCE_OF_SUCCESS && (*i)->GetSpellProto()->SpellIconID == 113)
+                    if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (*i)->GetSpellProto()->SpellIconID == 113)
                    {
-                        // Drain Soul
-                        CastCustomSpell(this, 18371, &basepoints[0], NULL, NULL, true, castItem, triggeredByAura);
+                        // basepoints of trigger spell stored in dummyeffect of spellProto
+                        int32 basepoints = (GetMaxPower(POWER_MANA) * ((*i)->GetSpellProto()->EffectBasePoints[2]+1))/100.0f;
+                        CastCustomSpell(this, 18371, &basepoints, NULL, NULL, true, castItem, triggeredByAura);
                        break;
                    }
                }

Link to comment
Share on other sites

  • 2 months later...
×
×
  • 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