Jump to content

[FIX][8854] Haunt.


Auntie Mangos

Recommended Posts

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

Fix Haunt do heal at the end of the effect.

* For which repository revision was the patch created?

8472.

* 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=9341

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

Astellar.

http://www.wowhead.com/?spell=59164

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 4cd2aaf..e12b6c7 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1081,6 +1081,13 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
        if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
            caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, addhealth, m_attackType, m_spellInfo);

+        Unit::AuraList Aur = unitTarget->GetAurasByType(SPELL_AURA_DUMMY);
+        for (Unit::AuraList::iterator iter = Aur.begin(); iter != Aur.end(); ++iter)
+        {
+            if ((*iter)->GetId() == m_spellInfo->Id && (*iter)->GetCasterGUID() == caster->GetGUID())
+                (*iter)->SetHealingDoneBySpell(addhealth);
+        }
+
        int32 gain = caster->DealHeal(unitTarget, addhealth, m_spellInfo, crit);
        unitTarget->getHostilRefManager().threatAssist(caster, float(gain) * 0.5f, m_spellInfo);
    }
@@ -1103,6 +1110,13 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
        // Do triggers for unit (reflect triggers passed on hit phase for correct drop charge)
        if (m_canTrigger && missInfo != SPELL_MISS_REFLECT)
            caster->ProcDamageAndSpell(unitTarget, procAttacker, procVictim, procEx, damageInfo.damage, m_attackType, m_spellInfo);
+        
+        Unit::AuraList Aur = unitTarget->GetAurasByType(SPELL_AURA_DUMMY);
+        for (Unit::AuraList::iterator iter = Aur.begin(); iter != Aur.end(); ++iter)
+        {
+            if ((*iter)->GetId() == m_spellInfo->Id && (*iter)->GetCasterGUID() == caster->GetGUID())
+                (*iter)->SetDamageDoneBySpell(damageInfo.damage);
+        }

        caster->DealSpellDamage(&damageInfo, true);

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index df1cd54..a6b6f4e 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -2405,6 +2405,18 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
        }
        case SPELLFAMILY_HUNTER:
            break;
+        case SPELLFAMILY_WARLOCK:
+        {
+            if (GetSpellProto()->SpellIconID == 3172 && GetSpellProto()->SpellFamilyFlags & 0x4000000000000LL)
+            {
+                if (!apply)
+                {
+                    int32 bp0 = m_damageDoneBySpell * m_modifier.m_amount / 100;
+                    caster->CastCustomSpell(caster,48210,&bp0,NULL,NULL,true);
+                }
+            }
+            break;
+        }
        case SPELLFAMILY_SHAMAN:
        {
            // Improved Weapon Totems
diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
index f0767e2..3c39fcb 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -295,6 +295,9 @@ class MANGOS_DLL_SPEC Aura
        virtual void Update(uint32 diff);
        void ApplyModifier(bool apply, bool Real = false);

+        void SetDamageDoneBySpell(int32 damage) { m_damageDoneBySpell = damage; }
+        void SetHealingDoneBySpell(int32 healing) { m_healingDoneBySpell = healing; }
+
        void _AddAura();
        void _RemoveAura();

@@ -336,6 +339,9 @@ class MANGOS_DLL_SPEC Aura
        uint64 m_castItemGuid;                              // it is NOT safe to keep a pointer to the item because it may get deleted
        time_t m_applyTime;

+        int32 m_damageDoneBySpell;
+        int32 m_healingDoneBySpell;
+
        int32 m_currentBasePoints;                          // cache SpellEntry::EffectBasePoints and use for set custom base points
        int32 m_maxduration;                                // Max aura duration
        int32 m_duration;                                   // Current time

Thank you. :D

Link to comment
Share on other sites

  • 39 years later...
  • 2 months later...

Maybe it would be better to specify the aura removement like this:

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index eb75781..e00fdfe 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -2645,6 +2645,21 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
        }
        case SPELLFAMILY_HUNTER:
            break;
+        case SPELLFAMILY_WARLOCK:
+        {
+            if (GetSpellProto()->SpellIconID == 3172 && GetSpellProto()->SpellFamilyFlags & 0x4000000000000LL)
+            {
+                if (!apply)
+                {
+                    if ( !(GetAuraDuration() <= 0 || m_removeMode == AURA_REMOVE_BY_DISPEL || m_removeMode == AURA_REMOVE_BY_STACK) )
+                        return;
+
+                    int32 bp0 = m_damageDoneBySpell * m_modifier.m_amount / 100;
+                    caster->CastCustomSpell(caster,48210,&bp0,NULL,NULL,true);
+                }
+            }
+            break;
+        }
        case SPELLFAMILY_SHAMAN:
        {
            // Improved Weapon Totems}

As the comments on wowhead say,the heal occurs at "AURA_REMOVE_BY_STACK" too.

Also a little bump :)

Link to comment
Share on other sites

On offy if haunt is removed by dispel, the soul doesn't return to spell's caster, not healing him. (This also affects Shadow Embrace, it is not applied if Haunt was dispelled before aura update on offy)

Any time the debuff is removed you get the heal. It doesn't matter if it times out, you cast another Haunt (on the same or a different target), it's dispelled, or the target dies.

http://www.wowhead.com/?spell=48181#comments

Link to comment
Share on other sites

Yea the tooltip even says "When the Haunt spell ends or is dispelled, the soul returns to you, ..."

Though i assume, the sooner you dispel it, the less damage it did and the less it will heal. Couldn't test yet if that part is implemented correctly too. It's not clear to me by looking at the commit alone...

Link to comment
Share on other sites

Yea the tooltip even says "When the Haunt spell ends or is dispelled, the soul returns to you, ..."

Though i assume, the sooner you dispel it, the less damage it did and the less it will heal. Couldn't test yet if that part is implemented correctly too. It's not clear to me by looking at the commit alone...

haunt is not a DOT , it is a DD spell so if it hits for 4K it should heal for 4K no matter what.

Link to comment
Share on other sites

oh...indeed. Reading blizzard tooltips can be though, so the "for 12 sec." only refers to the debuff that increases DoT damage, DoT uses formulation "over x sec.".

Also the extra DoT damage from the debuff does not count as "damage it did on th target", so it heals always the same amount depending on the initial hit, did i get it right now?

Some comments on wowhead confused me quite a bit...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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