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

Port From (https://github.com/TrinityCore/TrinityCore/commit/1e1415a49128d034c8d48aa8cbb5d157200371b0)
This commit is contained in:
hondacrx
2021-08-28 13:56:32 -04:00
parent e35094f0a3
commit 9123dec4b9
3 changed files with 404 additions and 217 deletions
+2 -4
View File
@@ -2615,7 +2615,6 @@ namespace Game.Entities
foreach (SpellInfo spellInfo in spells)
{
// TODO: validate attributes
if (attributes.HasAnyFlag((uint)SpellCustomAttributes.ShareDamage))
{
if (!spellInfo.HasEffect(SpellEffectName.SchoolDamage))
@@ -2763,9 +2762,6 @@ namespace Game.Entities
break;
}
}
if (!spellInfo._IsPositiveEffect(effect.EffectIndex, false))
spellInfo.NegativeEffects[(int)effect.EffectIndex] = true;
}
// spells ignoring hit result should not be binary
@@ -2854,6 +2850,8 @@ namespace Game.Entities
spellInfo.AttributesCu |= SpellCustomAttributes.SchoolmaskNormalWithMagic;
}
spellInfo.InitializeSpellPositivity();
if (talentSpells.Contains(spellInfo.Id))
spellInfo.AttributesCu |= SpellCustomAttributes.IsTalent;