Jump to content

[patch] Percent regen hp


Auntie Mangos

Recommended Posts

It's my first patch ;)

Rev. 7873

I removed applying spellbonus healing effects for regeneration hp. Spells like Fel Armor or warrior's Blood Craze will not be affected by spellbonus effects as they should (I don't have access to retail servers so correct me if i'm wrong). I don't know if it's the correct way to fix Demonic Aegis bonus for FA but i think it's the simplest.

Bug thread: http://getmangos.eu/community/viewtopic.php?id=7879

@@ -5890,20 +5890,36 @@ void Aura::PeriodicTick()
            // heal for caster damage (must be alive)
            if(m_target != pCaster && GetSpellProto()->SpellVisual[0]==163 && !pCaster->isAlive())
                return;

            // ignore non positive values (can be result apply spellmods to aura damage
-            uint32 amount = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;
+            float amount = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;

            uint32 pdamage;

            if(m_modifier.m_auraname==SPELL_AURA_OBS_MOD_HEALTH)
+            {
+                if (pCaster->getClass() == CLASS_WARLOCK)
+                {
+                    switch (GetId())
+                    {
+                    case 28176:
+                    case 28189:
+                    case 47892:
+                    case 47893:
+                        if (m_target->HasAura(30145)) amount = 2.6;
+                        else if (m_target->HasAura(30144)) amount = 2.4;
+                        else if (m_target->HasAura(30143)) amount = 2.2;
+                        break;
+                    default:
+                        break;
+                    }
+                }
                pdamage = uint32(m_target->GetMaxHealth() * amount/100);
+            }
            else
-                pdamage = amount;
-
-            pdamage = pCaster->SpellHealingBonus(m_target, GetSpellProto(), pdamage, DOT, GetStackAmount());
+                pdamage = pCaster->SpellHealingBonus(m_target, GetSpellProto(), uint32(amount), DOT, GetStackAmount());

            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());

            WorldPacket data(SMSG_PERIODICAURALOG, (21+16));// we guess size

Link to comment
Share on other sites

  • 39 years later...
Is this necessary when these can just have an entry in the spell_bonus_data with 0 set as direct_bonus?

I've been using an SQL fix for Fel Armor for months now, and Blood Craze could probably be solved the same way.

I think this only prevent adding player's spellpower to spell (how other effects like mortal strike or wound poison?) but if you fix SPELL_AURA_OBS_MOD_HEALTH all spells using that aura will be working as they should (not only players use spells with that aura, some npc's i found also)

Link to comment
Share on other sites

  • 1 month later...

Updated git diff for core 8082:

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 7ccc4eb..db423ba 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -5997,16 +5997,30 @@ void Aura::PeriodicTick()
                return;

            // ignore non positive values (can be result apply spellmods to aura damage
-            uint32 amount = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;
+            float amount = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;
+            if (pCaster->getClass() == CLASS_WARLOCK)
+            {
+                switch (GetId())
+                {
+                case 28176:
+                case 28189:
+                case 47892:
+                case 47893: //Fel Armor bonus from Demonic Aegis
+                    if (m_target->HasAura(30145)) amount = 2.6;
+                    else if (m_target->HasAura(30144)) amount = 2.4;
+                    else if (m_target->HasAura(30143)) amount = 2.2;
+                    break;
+                default:
+                    break;
+                }
+            }

            uint32 pdamage;

            if(m_modifier.m_auraname==SPELL_AURA_OBS_MOD_HEALTH)
                pdamage = uint32(m_target->GetMaxHealth() * amount / 100);
            else
-                pdamage = amount;
-
-            pdamage = pCaster->SpellHealingBonus(m_target, GetSpellProto(), pdamage, DOT, GetStackAmount());
+                pdamage = pCaster->SpellHealingBonus(m_target, GetSpellProto(), amount, DOT, GetStackAmount());

            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());

Link to comment
Share on other sites

  • 2 weeks later...

Got info from warlocks playing on retail. FA should heal for const 2.6, 2.4 or 2.2% with talent and spell healing bonus don't affect the amount.

Tested on rev. 8145

@@ -6020,20 +6020,34 @@ void Aura::PeriodicTick()
            // heal for caster damage (must be alive)
            if(m_target != pCaster && GetSpellProto()->SpellVisual[0] == 163 && !pCaster->isAlive())
                return;

            // ignore non positive values (can be result apply spellmods to aura damage
-            uint32 amount = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;
+            float amount = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;

            uint32 pdamage;

            if(m_modifier.m_auraname==SPELL_AURA_OBS_MOD_HEALTH)
+            {
+                //Fel Armor: Demonic Aegis
+                switch (GetId())
+                {
+                case 28176:
+                case 28189:
+                case 47892:
+                case 47893:
+                    if (m_target->HasAura(30145)) amount += amount * 0.3f;
+                    else if (m_target->HasAura(30144)) amount += amount * 0.2f;
+                    else if (m_target->HasAura(30143)) amount += amount * 0.1f;
+                    break;
+                default:
+                    break;
+                }
                pdamage = uint32(m_target->GetMaxHealth() * amount / 100);
+            }
            else
-                pdamage = amount;
-
-            pdamage = pCaster->SpellHealingBonus(m_target, GetSpellProto(), pdamage, DOT, GetStackAmount());
+                pdamage = pCaster->SpellHealingBonus(m_target, GetSpellProto(), uint32(amount), DOT, GetStackAmount());

            // This method can modify pdamage
            bool isCrit = IsCritFromAbilityAura(pCaster, pdamage);

            sLog.outDetail("PeriodicTick: %u (TypeId: %u) heal of %u (TypeId: %u) for %u health inflicted by %u",

I know it's hacky but works ;)

The basic fix for aura:

             else
-                pdamage = amount;
-
-            pdamage = pCaster->SpellHealingBonus(m_target, GetSpellProto(), pdamage, DOT, GetStackAmount());
+                pdamage = pCaster->SpellHealingBonus(m_target, GetSpellProto(), amount, DOT, GetStackAmount());

            // This method can modify pdamage
            bool isCrit = IsCritFromAbilityAura(pCaster, pdamage);

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