Jump to content

[fix]Obliterate&Annihilation


Guest laise

Recommended Posts

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

fixes disease consuming part of Obliterate + related Annihilation part

For which repository revision was the patch created?

9362

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

haven't seen any

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

me

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 9423c6d..5d0fbd5 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -2061,6 +2061,30 @@ void Spell::EffectDummy(uint32 i)
                m_caster->CastCustomSpell(m_caster, 45470, &bp, NULL, NULL, true);
                return;
            }
+            // Obliterate
+            else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0002000000000000))
+            {
+                // search for Annihilation
+                Unit::AuraList const& dummyList = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
+                for (Unit::AuraList::const_iterator itr = dummyList.begin(); itr != dummyList.end(); ++itr)
+                {
+                    if ((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && (*itr)->GetSpellProto()->SpellIconID == 2710)
+                        if (roll_chance_i((*itr)->GetModifier()->m_amount)) // don't consume if found
+                            return;
+                }
+    
+                // consume diseases
+                Unit::AuraMap& auras = unitTarget->GetAuras();
+                for(Unit::AuraMap::iterator i = auras.begin(); i != auras.end()
+                {
+                    if (i->second->GetSpellProto()->Dispel == DISPEL_DISEASE &&
+                        i->second->GetCasterGUID() == m_caster->GetGUID())
+                        unitTarget->RemoveAura(i);
+                    else
+                        ++i;
+                }
+                return;
+            }
            break;
    }

Link to comment
Share on other sites

  • 5 months later...
  • 3 weeks later...

Patch is working now!

// Obliterate
           else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0002000000000000))
           {
              // Search for Annihilation
              Unit::AuraList const& dummyList = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
              for (Unit::AuraList::const_iterator itr = dummyList.begin(); itr != dummyList.end(); ++itr)
              {
                 if ((*itr)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT &&
                    (*itr)->GetSpellProto()->SpellIconID == 2710)
                    if (roll_chance_i((*itr)->GetModifier()->m_amount)) // Don't consume if found
                       return;
              }
              // Consume diseases
              unitTarget->RemoveAurasWithDispelType(DISPEL_DISEASE);
           }

Using that useful Unit class method :)

Link to comment
Share on other sites

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