Jump to content

[fix] Hunger for Blood


Recommended Posts

Posted

2

1

2

1

2

1

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index fba21e7..cc03510 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -5168,6 +5168,26 @@ void Aura::HandleModDamagePercentDone(bool apply, bool Real)
            m_target->ApplyModSignedFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT,m_modifier.m_amount/100.0f,apply);
    }

+    // Hunger for Blood
+    // "If used while a Bleed effect is afflicting you, it will attempt to remove it and refund 15 energy."
+    if(apply)
+    {
+        if (m_spellProto->SpellFamilyName == SPELLFAMILY_GENERIC && m_spellProto->SpellIconID == 2961)
+        {
+            Unit::AuraList const& bleedAuras = m_target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
+            for(Unit::AuraList::const_iterator itr = bleedAuras.begin(); itr != bleedAuras.end(); ++itr)
+            {
+                SpellEntry const *i_spellInfo = (*itr)->GetSpellProto();
+                if(GetAllSpellMechanicMask(i_spellInfo) & (1<<MECHANIC_BLEED))
+                {
+                    m_target->RemoveAurasDueToSpell(i_spellInfo->Id);
+                    m_target->CastSpell(m_target, 58155, true);
+                    break;      // It should remove only one effect
+               }
+            }
+        }
+    }
+
    // Skip non magic case for speedup
    if((m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_MAGIC) == 0)
        return;

Patchfile

Posted

Well, it is kinda hard to solve taking in account this part of SpellAuras:

void Aura::SetStackAmount(uint8 stackAmount)
{
   if (stackAmount != m_stackAmount)
   {
       Unit *target = GetTarget();
       Unit *caster = GetCaster();
       if (!target || !caster)
           return;
       m_stackAmount = stackAmount;
       int32 amount = m_stackAmount * caster->CalculateSpellDamage(m_spellProto, m_effIndex, m_currentBasePoints, target);
       // Reapply if amount change
       if (amount!=m_modifier.m_amount)
       {
           ApplyModifier(false, true);
           m_modifier.m_amount = amount;
           ApplyModifier(true, true);
       }
   }
   RefreshAura();
}

If the already stacked amount = the new amount then it does not run the required function again so that the bleed effect removing part does not run again :/

Any ideas?

Solving it may be really hacky i think:/

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