aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellMgr.cpp
diff options
context:
space:
mode:
authorShauren <none@none>2010-12-21 11:40:20 +0100
committerShauren <none@none>2010-12-21 11:40:20 +0100
commit5809c1fa3b6b6d8ff1a46ccbaadd142d92bebe48 (patch)
treef3dea39c2be5df428e47f0611d93c75ae5c8a750 /src/server/game/Spells/SpellMgr.cpp
parent5180ed0383c1e5b19147adbe2e5f10bca50636e4 (diff)
Core/Auras: Fixed auras incorrectly stacking with different item casters introduced in r19f21916a940
Closes issue #5218. --HG-- branch : trunk
Diffstat (limited to 'src/server/game/Spells/SpellMgr.cpp')
-rwxr-xr-xsrc/server/game/Spells/SpellMgr.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 76175ada22a..d329ddffcf8 100755
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -18,6 +18,7 @@
#include "SpellMgr.h"
#include "ObjectMgr.h"
+#include "SpellAuras.h"
#include "SpellAuraDefines.h"
#include "ProgressBar.h"
#include "DBCStores.h"
@@ -3142,8 +3143,10 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
//-----------TRINITY-------------
-bool SpellMgr::CanAurasStack(SpellEntry const *spellInfo_1, SpellEntry const *spellInfo_2, bool sameCaster) const
+bool SpellMgr::CanAurasStack(Aura const *aura1, Aura const *aura2, bool sameCaster) const
{
+ SpellEntry const *spellInfo_1 = aura1->GetSpellProto();
+ SpellEntry const *spellInfo_2 = aura2->GetSpellProto();
SpellSpecific spellSpec_1 = GetSpellSpecific(spellInfo_1);
SpellSpecific spellSpec_2 = GetSpellSpecific(spellInfo_2);
if (spellSpec_1 && spellSpec_2)
@@ -3205,6 +3208,9 @@ bool SpellMgr::CanAurasStack(SpellEntry const *spellInfo_1, SpellEntry const *sp
// Hack for Incanter's Absorption
if (spellId_1 == 44413)
return true;
+ if (aura1->GetCastItemGUID() && aura2->GetCastItemGUID())
+ if (aura1->GetCastItemGUID() != aura2->GetCastItemGUID() && (sSpellMgr.GetSpellCustomAttr(spellId_1) & SPELL_ATTR0_CU_ENCHANT_PROC))
+ return true;
// same spell with same caster should not stack
return false;
}
@@ -4042,6 +4048,25 @@ void SpellMgr::LoadSpellCustomAttr()
}
}
+ for (uint32 i = 0; i < sSpellItemEnchantmentStore.GetNumRows(); ++i)
+ {
+ SpellItemEnchantmentEntry const *enchant = sSpellItemEnchantmentStore.LookupEntry(i);
+ if (!enchant)
+ continue;
+
+ for (uint8 s = 0; s < MAX_ITEM_ENCHANTMENT_EFFECTS; ++s)
+ {
+ if (enchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
+ continue;
+
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(enchant->spellid[s]);
+ if (!spellInfo)
+ continue;
+
+ mSpellCustomAttr[enchant->spellid[s]] |= SPELL_ATTR0_CU_ENCHANT_PROC;
+ }
+ }
+
SummonPropertiesEntry *properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(121));
properties->Type = SUMMON_TYPE_TOTEM;
properties = const_cast<SummonPropertiesEntry*>(sSummonPropertiesStore.LookupEntry(647)); // 52893