[Spells] IsInvisSpell() Method + InvisRequireGroup Rule (#1453)

* IsInvis() Method + InvisRequireGroup Rule

* Fixed issues with invis rule crashes

* Fixed issues with invis rule crashes

* Invis Require Group nullptr fix

* Invis Group Require Fix crash

* Fixes Self only Invis Crashes

* Formatting, reverse check order to prevent unnecessary processing

Co-authored-by: ProducerZekServer <go@away.com>
Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
authored and GitHub committed 2021-08-01 20:44:06 -05:00
1 parent 0e7cfe96ef
commit bb3c918eac
4 files changed
+37

No files matched your search

+12
View File
@@ -260,6 +260,18 @@ bool IsDetrimentalSpell(uint16 spell_id)
return !IsBeneficialSpell(spell_id);
}
bool IsInvisSpell(uint16 spell_id)
{
if (IsEffectInSpell(spell_id, SE_Invisibility) ||
IsEffectInSpell(spell_id, SE_Invisibility2) ||
IsEffectInSpell(spell_id, SE_InvisVsUndead) ||
IsEffectInSpell(spell_id, SE_InvisVsUndead2) ||
IsEffectInSpell(spell_id, SE_InvisVsAnimals)) {
return true;
}
return false;
}
bool IsInvulnerabilitySpell(uint16 spell_id)
{
return IsEffectInSpell(spell_id, SE_DivineAura);