Jump to content

[patch][8216] Warlock spell: Shadowflame


Guest rechapa79

Recommended Posts

Here is a patch for applying DOT effect of the warlock spell "shadowflame" and ranks.

Updated: 4/17/09:

changelog:

-modified code so ShadowFlame DOT triggers AURA_STATE_IMMOLATE (yes this is a hackfix)

-conflagrate will remove the shadowflame dot.

Updated 4/18/09

Changelog:

-Reimplemented incinerate so it looks for an actual Immolate aura instead of AURA_STATE_IMMOLATE

-AURA_STATE_IMMOLATE will stay on as long there is a Shadowflame DOT or an Immolate aura

-Use SpellFamilyFlags2 for Shadowflame DOT

TODO?:

-modify conflagate to search for the aura with the least duration instead the first one that pops up?

-rename AURA_STATE_IMMOLATE to AURA_STATE_CONFLAGRATE? (I think it is the proper name)

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index f3140cb..af14380 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -2388,7 +2388,7 @@ void Spell::cast(bool skipCheck)
        Unit::AuraList const &mPeriodic = m_targets.getUnitTarget()->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
        for(Unit::AuraList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
        {
-            if( (*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && ((*i)->GetSpellProto()->SpellFamilyFlags & 4) &&
+            if( (*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (((*i)->GetSpellProto()->SpellFamilyFlags & 4) || ((*i)->GetSpellProto()->SpellFamilyFlags2 & 2) ) &&
                (*i)->GetCasterGUID()==m_caster->GetGUID() )
            {
                m_targets.getUnitTarget()->RemoveAura((*i)->GetId(), (*i)->GetEffIndex());
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index a02ea15..59e2d90 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -978,9 +978,9 @@ void Aura::_AddAura()
            if (IsSealSpell(m_spellProto))
                m_target->ModifyAuraState(AURA_STATE_JUDGEMENT, true);

-            // Conflagrate aura state on Immolate
-            if (m_spellProto->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellProto->SpellFamilyFlags & 4)
-                m_target->ModifyAuraState(AURA_STATE_IMMOLATE, true);
+            // Conflagrate aura state on Immolate and Shadowflame
+            if (m_spellProto->SpellFamilyName == SPELLFAMILY_WARLOCK && ((m_spellProto->SpellFamilyFlags & 4) || (m_spellProto->SpellFamilyFlags2 & 2)))
+                    m_target->ModifyAuraState(AURA_STATE_IMMOLATE, true);

            // Faerie Fire (druid versions)
            if (m_spellProto->SpellFamilyName == SPELLFAMILY_DRUID && m_spellProto->SpellFamilyFlags & 0x0000000000000400LL)
@@ -1082,8 +1082,37 @@ void Aura::_RemoveAura()
                    removeState = AURA_STATE_JUDGEMENT;     // Update Seals information
                break;
            case SPELLFAMILY_WARLOCK:
-                if(m_spellProto->SpellFamilyFlags & 4)
-                    removeState = AURA_STATE_IMMOLATE;      // Conflagrate aura state
+                if(m_spellProto->SpellFamilyFlags & 4){
+                   //check if there is a shadowflame DOT present, if not, remove AURA_STATE_IMMOLATE
+                    Unit::AuraList const& SFDOT = m_target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
+                    bool removeAuraState=true;
+                    for(Unit::AuraList::const_iterator i = SFDOT.begin(); i != SFDOT.end(); ++i)
+            {
+                if((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && ((*i)->GetSpellProto()->SpellFamilyFlags2 & 2))
+                {
+                    removeAuraState=false;
+                    break;
+                }
+                    }
+                    if(removeAuraState)
+                        removeState = AURA_STATE_IMMOLATE;
+                }
+                else if(m_spellProto->SpellFamilyFlags2 & 2){
+                       //check if there is a Immolate DOT present, if not, remove AURA_STATE_IMMOLATE
+                    Unit::AuraList const& IMDOT = m_target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
+                    bool removeAuraState=true;
+                    for(Unit::AuraList::const_iterator i = IMDOT.begin(); i != IMDOT.end(); ++i)
+            {
+                if((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && ((*i)->GetSpellProto()->SpellFamilyFlags & 4))
+                {
+                    removeAuraState=false;
+                    break;
+                }
+                    }
+                    if(removeAuraState)
+                        removeState = AURA_STATE_IMMOLATE;
+                }
+
                break;
            case SPELLFAMILY_DRUID:
                if(m_spellProto->SpellFamilyFlags & 0x0000000000000400LL)
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 13d1f03..eeebd89 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -400,8 +400,29 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
                if((m_spellInfo->SpellFamilyFlags & 0x00004000000000LL) && m_spellInfo->SpellIconID==2128)
                {
                    // Incinerate does more dmg (dmg*0.25) if the target is Immolated.
-                    if(unitTarget->HasAuraState(AURA_STATE_IMMOLATE))
-                        damage += int32(damage*0.25f);
+                    Unit::AuraList const& RejorRegr = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
+           
+            for(Unit::AuraList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
+            {
+                if((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && ((*i)->GetSpellProto()->SpellFamilyFlags & 4))
+                {
+
+                            damage += int32(damage*0.25f);
+                            break;
+            }
+            }
+                }
+               // Shadowflame DOT
+               else if (m_spellInfo->SpellFamilyFlags & 0x0001000000000000LL)
+                {
+                    switch(m_spellInfo->Id)
+                    {
+                        case 47897: m_caster->CastSpell(unitTarget, 47960, true); break;
+                        case 61290: m_caster->CastSpell(unitTarget, 61291, true); break;
+                        default:
+                            sLog.outError("Spell::EffectDummy: Unhandeled Shadowflame spell rank %u",m_spellInfo->Id);
+                        break;
+                    }
                }
                break;
            }

Link to comment
Share on other sites

  • 2 weeks later...

looking into the DBCs Im getting the feeling AURA_STATE_IMMOLATE is a misnomer, because it indicates if it is possible to cast Conflagrate on the target so it should be something like AURA_STATE_CONFLAGRATE.

if its true(not saying that it is, just looking for confirmation here), that would mean:

- On the event of Shadowflame DOT removal, it should be checked the existence of a Immolate debuff and vice versa before the removal of the Aura State.

- The current implementation of Incinerate should be changed because it checks for AURA_STATE_IMMOLATE instead of searching for the actual Immolate debuff.

So: should i file bug for this?

Link to comment
Share on other sites

  • 2 months later...
  • 5 weeks later...
×
×
  • 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