Core/Spells: Implemented SPELL_ATTR5_NOT_ON_PLAYER and SPELL_ATTR5_NOT_ON_PLAYER_CONTROLLED_NPC

Port From (https://github.com/TrinityCore/TrinityCore/commit/acda6f9dcf411a1406b81e1a100125dbe34f942b)
This commit is contained in:
hondacrx
2022-06-01 15:37:28 -04:00
parent da9cd08caa
commit 68d8f664d7
5 changed files with 71 additions and 16 deletions
+13 -2
View File
@@ -2173,8 +2173,19 @@ namespace Game.Maps
if (u.IsTypeId(TypeId.Unit) && u.IsTotem())
return false;
if (_spellInfo != null && _spellInfo.HasAttribute(SpellAttr3.OnlyOnPlayer) && !u.IsPlayer())
return false;
if (_spellInfo != null)
{
if (!u.IsPlayer())
{
if (_spellInfo.HasAttribute(SpellAttr3.OnlyOnPlayer))
return false;
if (_spellInfo.HasAttribute(SpellAttr5.NotOnPlayerControlledNpc) && u.IsControlledByPlayer())
return false;
}
else if (_spellInfo.HasAttribute(SpellAttr5.NotOnPlayer))
return false;
}
if (!i_funit.IsValidAttackTarget(u, _spellInfo))
return false;