Jump to content

[patch] Don't heal caster again and again when he's reached max health


Recommended Posts

Posted

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

When caster has aura SPELL_AURA_PERIODIC_HEAL or SPELL_AURA_OBS_MOD_HEALTH, he's healed again and again even he has reached max health.

mangos doesn't send overheal log to client for SPELL_AURA_OBS_MOD_HEALTH/SPELL_AURA_PERIODIC_HEAL.

For which repository revision was the patch created?

8713

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

No.

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

me

[color="Silver"]diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 75a166e..73a68d3 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -6512,6 +6584,9 @@ void Aura::PeriodicTick()
            // This method can modify pdamage
            bool isCrit = IsCritFromAbilityAura(pCaster, pdamage);

+            if (pdamage == 0 || (pdamage > 0 && (m_target->GetHealth() >= m_target->GetMaxHealth())))
+                return;
+
            sLog.outDetail("PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u",
                GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());[/color]

Updated patch:

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 2cf57a8..18179ea 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -6499,11 +6571,11 @@ void Aura::PeriodicTick()
            sLog.outDetail("PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u",
                GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());

-            SpellPeriodicAuraLogInfo pInfo(this, pdamage, 0, 0, 0, 0.0f, isCrit);
-            m_target->SendPeriodicAuraLog(&pInfo);
-
            int32 gain = m_target->ModifyHealth(pdamage);

+            SpellPeriodicAuraLogInfo pInfo(this, pdamage, pdamage-gain, 0, 0, 0.0f, isCrit);
+            m_target->SendPeriodicAuraLog(&pInfo);
+
            // add HoTs to amount healed in bgs
            if( pCaster->GetTypeId() == TYPEID_PLAYER )
                if( BattleGround *bg = ((Player*)pCaster)->GetBattleGround() )

Posted
On offy HOTs still do heal when you'r at max health.

and i wonder why is that ... since hots still heal at your max health, and your max heath isnt increasing, the condition (target->health>=target->maxhealth) must be checked somewhere to prevent adding excess health :confused:

Posted
and i wonder why is that ... since hots still heal at your max health, and your max heath isnt increasing, the condition (target->health>=target->maxhealth) must be checked somewhere to prevent adding excess health :confused:

this condition placed in Unit::ModifyHealth

Posted
The reason why HoTs and some spells are allowed to still tick is because of items with spells like 64415 and 67356, which do trigger with overheals.

~Seline~

This patch doesn't stop the tick, it just does nothing when triggered.

My goal is to fix the bug that client still receive aura log when player has max health.

How about this alt fix:

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 2cf57a8..a08d0ae 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -6499,11 +6571,14 @@ void Aura::PeriodicTick()
            sLog.outDetail("PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u",
                GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());

-            SpellPeriodicAuraLogInfo pInfo(this, pdamage, 0, 0, 0, 0.0f, isCrit);
-            m_target->SendPeriodicAuraLog(&pInfo);
-
            int32 gain = m_target->ModifyHealth(pdamage);

+            if (gain)
+            {
+                SpellPeriodicAuraLogInfo pInfo(this, gain, 0, 0, 0, 0.0f, isCrit);
+                m_target->SendPeriodicAuraLog(&pInfo);
+            }
+
            // add HoTs to amount healed in bgs
            if( pCaster->GetTypeId() == TYPEID_PLAYER )
                if( BattleGround *bg = ((Player*)pCaster)->GetBattleGround() )

Posted

Well, when I was writing my previous post on this topic I meant that overheal effect from HOTs is displayed in client on offy, but the health (actual or max) is not affected at all.

That was implemented in some of early WotLK builds, after being removed in TBC.

Posted
Well, when I was writing my previous post on this topic I meant that overheal effect from HOTs is displayed in client on offy, but the health (actual or max) is not affected at all.

That was implemented in some of early WotLK builds, after being removed in TBC.

Oh, which spell btw?

I'm trying fix the problem got too much noise from spell 28176

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

Posted
Exactly this one.

Here is a screenie: http://filebeam.com/b8865dfd0a33886b2f73e28a59ec27ae.jpg (a big one)

At the picture you can see Fel Armor buff, and multiple entries in combat log, with full heal, partial heal, and full overheal. All 3 of them are present.

Sorry for Russian :/

I see, the last 2 lines mean heal 0 point?

And which version? But I don't see these logs in a 3.1.3 offi server, I'll confirm that again.

Thank you:)

Posted
I see, the last 2 lines mean heal 0 point?

And which version? But I don't see these logs in a 3.1.3 offi server, I'll confirm that again.

Thank you:)

Yes, last 2 lines heal 0, overheal 698. The screenshot was taken ~30 minutes ago, 3.2.2a version.
Posted
Yes, last 2 lines heal 0, overheal 698. The screenshot was taken ~30 minutes ago, 3.2.2a version.

Didn't see "heal 0, overheal 698" in 3.1.3.

3.1.3 didn't send full overheal log to client, but 3.2.2a does.

Sending full overheal log every 5s is really noisily, consider as a new 3.2.x blizz bug.

So this problem is clear: mangos doesn't send overheal log to client for SPELL_AURA_OBS_MOD_HEALTH/SPELL_AURA_PERIODIC_HEAL.

Anyway, the updated blizzlike patch:

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 2cf57a8..18179ea 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -6499,11 +6571,11 @@ void Aura::PeriodicTick()
            sLog.outDetail("PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u",
                GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId());

-            SpellPeriodicAuraLogInfo pInfo(this, pdamage, 0, 0, 0, 0.0f, isCrit);
-            m_target->SendPeriodicAuraLog(&pInfo);
-
            int32 gain = m_target->ModifyHealth(pdamage);

+            SpellPeriodicAuraLogInfo pInfo(this, pdamage, pdamage-gain, 0, 0, 0.0f, isCrit);
+            m_target->SendPeriodicAuraLog(&pInfo);
+
            // add HoTs to amount healed in bgs
            if( pCaster->GetTypeId() == TYPEID_PLAYER )
                if( BattleGround *bg = ((Player*)pCaster)->GetBattleGround() )

×
×
  • 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