Jump to content

[s0906][Mangos One][Patch] Fix mage-talent Improved Scorch


Guest FH3095

Recommended Posts

Fix: Fixes the mage-talent Improved Scorch, which wasn't applied to Scorch because SpellMgr::GetSpellAffectMask didn't care about the EffectItemType (which was used as the lower part of spellAffectMask back in 2.4).

Repository: Created for commit 5035e0f86090069df1fa (Revision 0901).

Authors: Me, after some help and clarification by VladimirMangos.

From dd3d7ae2b210dd4f8c673da77f8292a78108e886 Mon Sep 17 00:00:00 2001
From: FH <[email protected]>
Date: Thu, 3 Mar 2011 16:50:56 +0100
Subject: [PATCH] Fixed Improved Scorch by using EffectItemType in GetSpellAffectMask

---
src/game/Player.cpp   |    4 ----
src/game/SpellMgr.cpp |    4 ++--
src/game/SpellMgr.h   |    5 +++++
3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 077511c..715df38 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -256,15 +256,11 @@ std::ostringstream& operator<< (std::ostringstream& ss, PlayerTaxi const& taxi)
SpellModifier::SpellModifier( SpellModOp _op, SpellModType _type, int32 _value, SpellEntry const* spellEntry, SpellEffectIndex eff, int16 _charges /*= 0*/ ) : op(_op), type(_type), charges(_charges), value(_value), spellId(spellEntry->Id), lastAffected(NULL)
{
    mask = sSpellMgr.GetSpellAffectMask(spellEntry->Id, eff);
-    if (!mask)
-        mask = spellEntry->EffectItemType[eff];
}

SpellModifier::SpellModifier( SpellModOp _op, SpellModType _type, int32 _value, Aura const* aura, int16 _charges /*= 0*/ ) : op(_op), type(_type), charges(_charges), value(_value), spellId(aura->GetId()), lastAffected(NULL)
{
    mask = sSpellMgr.GetSpellAffectMask(aura->GetId(), aura->GetEffIndex());
-    if (!mask)
-        mask = aura->GetSpellProto()->EffectItemType[aura->GetEffIndex()];
}

bool SpellModifier::isAffectedOnSpell( SpellEntry const *spell ) const
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index f65ac3c..da3f317 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -945,14 +945,14 @@ void SpellMgr::LoadSpellAffects()
        // Spell.dbc have own data for low part of SpellFamilyMask
        if (spellInfo->EffectItemType[effectId])
        {
-            if (spellInfo->EffectItemType[effectId] == spellAffectMask)
+            if (static_cast<uint64>(spellInfo->EffectItemType[effectId]) == spellAffectMask)
            {
                sLog.outErrorDb("Spell %u listed in `spell_affect` have redundant (same with EffectItemType%d) data for effect index (%u) and not needed, skipped.", entry,effectId+1,effectId);
                continue;
            }

            // 24429 have wrong data in EffectItemType and overwrites by DB, possible bug in client
-            if (spellInfo->Id!=24429 && spellInfo->EffectItemType[effectId] != spellAffectMask)
+            if (spellInfo->Id!=24429 && spellInfo->EffectItemType[effectId] != static_cast<uint32>(spellAffectMask))
            {
                sLog.outErrorDb("Spell %u listed in `spell_affect` have different low part from EffectItemType%d for effect index (%u) and not needed, skipped.", entry,effectId+1,effectId);
                continue;
diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
index 854cf69..f017bbe 100644
--- a/src/game/SpellMgr.h
+++ b/src/game/SpellMgr.h
@@ -757,6 +757,11 @@ class SpellMgr
            SpellAffectMap::const_iterator itr = mSpellAffectMap.find((spellId<<8) + effectId);
            if( itr != mSpellAffectMap.end( ) )
                return itr->second;
+            SpellEntry const* spellEntry=sSpellStore.LookupEntry(spellId);
+            if (spellEntry)
+            {
+                return spellEntry->EffectItemType[effectId];
+            }
            return 0;
        }

-- 
1.7.3.1.msysgit.0

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