Core/Spells: rework part 1: Improved positive detection logic

This commit is contained in:
ariel-
2018-01-23 11:40:15 -03:00
committed by Ariel Silva
parent 022538e185
commit efeae33495
5 changed files with 398 additions and 237 deletions

View File

@@ -2628,7 +2628,20 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
continue;
}
// TODO: validate attributes
if ((attributes & SPELL_ATTR0_CU_NEGATIVE) != 0)
{
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (spellInfo->Effects[i].IsEffect())
continue;
if ((attributes & (SPELL_ATTR0_CU_NEGATIVE_EFF0 << i)) != 0)
{
TC_LOG_ERROR("sql.sql", "Table `spell_custom_attr` has attribute SPELL_ATTR0_CU_NEGATIVE_EFF%u for spell %u with no EFFECT_%u", uint32(i), spellId, uint32(i));
continue;
}
}
}
spellInfo->AttributesCu |= attributes;
++count;
@@ -2829,14 +2842,7 @@ void SpellMgr::LoadSpellInfoCustomAttributes()
spellInfo->AttributesCu |= SPELL_ATTR0_CU_SCHOOLMASK_NORMAL_WITH_MAGIC;
}
if (!spellInfo->_IsPositiveEffect(EFFECT_0, false))
spellInfo->AttributesCu |= SPELL_ATTR0_CU_NEGATIVE_EFF0;
if (!spellInfo->_IsPositiveEffect(EFFECT_1, false))
spellInfo->AttributesCu |= SPELL_ATTR0_CU_NEGATIVE_EFF1;
if (!spellInfo->_IsPositiveEffect(EFFECT_2, false))
spellInfo->AttributesCu |= SPELL_ATTR0_CU_NEGATIVE_EFF2;
spellInfo->_InitializeSpellPositivity();
if (spellInfo->SpellVisual[0] == 3879)
spellInfo->AttributesCu |= SPELL_ATTR0_CU_CONE_BACK;
@@ -3122,6 +3128,15 @@ void SpellMgr::LoadSpellInfoCorrections()
spellInfo->Effects[EFFECT_0].MiscValueB = 64;
});
// Battlegear of Eternal Justice
ApplySpellFix({
26135, // Battlegear of Eternal Justice
37557 // Mark of Light
}, [](SpellInfo* spellInfo)
{
spellInfo->SpellFamilyFlags = flag96();
});
ApplySpellFix({
40244, // Simon Game Visual
40245, // Simon Game Visual