Jump to content

[fix] Spell:37327


Sarjuuk
 Share

Recommended Posts

What bug does the patch fix?

Druid Nuker Tier5 4pc: will now increase the total damage of Starfire, not only the base damage like before.

For which repository revision was the patch created?

mangos-0.12 @ bb035e6d9d3f7bf2c0a134dfa550434a37c1429c

Is there a thread in the bug report section or at lighthouse?

nope

Who has been writing this patch?

Sarjuuk

Description

Essentially, I just moved the calculation from Spell::EffectSchoolDMG() to Unit::SpellDamageBonus() under // .. taken pct: scripted. (:

Patch

diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 8b7e1ca..c1252b9 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -420,34 +420,10 @@ void Spell::EffectSchoolDMG(uint32 effect_idx)
                // Starfire
                else if ( m_spellInfo->SpellFamilyFlags & UI64LIT(0x0004))
                {
-                    Unit::AuraList const& m_OverrideClassScript = m_caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
-                    for(Unit::AuraList::const_iterator i = m_OverrideClassScript.begin(); i != m_OverrideClassScript.end(); ++i)
-                    {
-                        // Starfire Bonus (caster)
-                        switch((*i)->GetModifier()->m_miscvalue)
-                        {
-                            case 5481:                      // Nordrassil Regalia - bonus
-                            {
-                                Unit::AuraList const& m_periodicDamageAuras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
-                                for(Unit::AuraList::const_iterator itr = m_periodicDamageAuras.begin(); itr != m_periodicDamageAuras.end(); ++itr)
-                                {
-                                    // Moonfire or Insect Swarm (target debuff from any casters)
-                                    if ( (*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x00200002))
-                                    {
-                                        int32 mod = (*i)->GetModifier()->m_amount;
-                                        damage += damage*mod/100;
-                                        break;
-                                    }
-                                }
-                                break;
-                            }
-                            case 5148:                      //Improved Starfire - Ivory Idol of the Moongoddes Aura
-                            {
-                                damage += (*i)->GetModifier()->m_amount;
-                                break;
-                            }
-                        }
-                    }
+                    //Improved Starfire - Ivory Idol of the Moongoddes Aura
+                    Aura* aur = m_caster->GetAura(34292,0);
+                    if (aur)
+                        damage += aur->GetModifier()->m_amount;
                }
                //Mangle Bonus for the initial damage of Lacerate and Rake
                if ((m_spellInfo->SpellFamilyFlags==UI64LIT(0x0000000000001000) && m_spellInfo->SpellIconID==494) ||
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index e1badd4..76a6a1a 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -7507,10 +7507,30 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
    {
        switch((*i)->GetModifier()->m_miscvalue)
        {
-            //Molten Fury
-            case 4920: case 4919:
-                if(pVictim->HasAuraState(AURA_STATE_HEALTHLESS_20_PERCENT))
-                    TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount)/100.0f; break;
+            // Molten Fury
+            case 4920:
+            case 4919:
+                if (pVictim->HasAuraState(AURA_STATE_HEALTHLESS_20_PERCENT))
+                    TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount) / 100.0f;
+                break;
+            // Nordrassil Regalia - Bonus
+            case 5481:
+            {
+                if (!spellProto->SpellFamilyFlags & UI64LIT(0x0004) || spellProto->SpellFamilyName != SPELLFAMILY_DRUID)
+                    break;
+                
+                Unit::AuraList const& m_periodicDamageAuras = pVictim->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
+                for(Unit::AuraList::const_iterator itr = m_periodicDamageAuras.begin(); itr != m_periodicDamageAuras.end(); ++itr)
+                {
+                    // Moonfire or Insect Swarm (target debuff from any casters)
+                    if ((*itr)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x00200002))
+                    {
+                       TakenTotalMod *= (100.0f+(*i)->GetModifier()->m_amount)/100.0f;
+                        break;
+                    }
+                }
+                break;
+            }
        }
    }

Link to comment
Share on other sites

 Share

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