aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Spells/SpellMgr.cpp')
-rw-r--r--src/server/game/Spells/SpellMgr.cpp41
1 files changed, 4 insertions, 37 deletions
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index e3b2e9b00d4..5599e0cea39 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -634,7 +634,10 @@ SpellEnchantProcEntry const* SpellMgr::GetSpellEnchantProcEvent(uint32 enchId) c
bool SpellMgr::IsArenaAllowedEnchancment(uint32 ench_id) const
{
- return mEnchantCustomAttr[ench_id];
+ if (SpellItemEnchantmentEntry const* enchantment = sSpellItemEnchantmentStore.LookupEntry(ench_id))
+ return enchantment->GetFlags().HasFlag(SpellItemEnchantmentFlags::AllowEnteringArena);
+
+ return false;
}
std::vector<int32> const* SpellMgr::GetSpellLinked(int32 spell_id) const
@@ -1988,42 +1991,6 @@ void SpellMgr::LoadSpellPetAuras()
TC_LOG_INFO("server.loading", ">> Loaded %u spell pet auras in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
-// Fill custom data about enchancments
-void SpellMgr::LoadEnchantCustomAttr()
-{
- uint32 oldMSTime = getMSTime();
-
- uint32 size = sSpellItemEnchantmentStore.GetNumRows();
- mEnchantCustomAttr.resize(size);
-
- for (uint32 i = 0; i < size; ++i)
- mEnchantCustomAttr[i] = false;
-
- uint32 count = 0;
- for (SpellInfo const& spellInfo : mSpellInfoMap)
- {
- /// @todo find a better check
- if (!spellInfo.HasAttribute(SPELL_ATTR2_PRESERVE_ENCHANT_IN_ARENA) || !spellInfo.HasAttribute(SPELL_ATTR0_NOT_SHAPESHIFT))
- continue;
-
- for (SpellEffectInfo const& spellEffectInfo : spellInfo.GetEffects())
- {
- if (spellEffectInfo.Effect == SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY)
- {
- uint32 enchId = spellEffectInfo.MiscValue;
- SpellItemEnchantmentEntry const* ench = sSpellItemEnchantmentStore.LookupEntry(enchId);
- if (!ench)
- continue;
- mEnchantCustomAttr[enchId] = true;
- ++count;
- break;
- }
- }
- }
-
- TC_LOG_INFO("server.loading", ">> Loaded %u custom enchant attributes in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
-}
-
void SpellMgr::LoadSpellEnchantProcData()
{
uint32 oldMSTime = getMSTime();