mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
Core/Spells: define and implement SPELL_ATTR5_DONT_ALLOW_PET_TARGET
This commit is contained in:
@@ -531,7 +531,7 @@ enum SpellAttr5
|
||||
SPELL_ATTR5_SINGLE_TARGET_SPELL = 0x00000020, // 5 Only one target can be apply at a time
|
||||
SPELL_ATTR5_UNK6 = 0x00000040, // 6
|
||||
SPELL_ATTR5_UNK7 = 0x00000080, // 7
|
||||
SPELL_ATTR5_UNK8 = 0x00000100, // 8
|
||||
SPELL_ATTR5_DONT_ALLOW_PET_TARGET = 0x00000100, // 8 do not allow the following spell to affect or target pets
|
||||
SPELL_ATTR5_START_PERIODIC_AT_APPLY = 0x00000200, // 9 begin periodic tick at aura apply
|
||||
SPELL_ATTR5_HIDE_DURATION = 0x00000400, // 10 do not send duration to client
|
||||
SPELL_ATTR5_ALLOW_TARGET_OF_TARGET_AS_TARGET = 0x00000800, // 11 (NYI) uses target's target as target if original target not valid (intervene for example)
|
||||
|
||||
@@ -1861,6 +1861,11 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta
|
||||
if (implicit && HasAttribute(SPELL_ATTR6_CANT_TARGET_CROWD_CONTROLLED) && !unitTarget->CanFreeMove())
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
// Do not allow pet or guardian targets if the spell is a raid buff or may not target pets at all
|
||||
if ((HasAttribute(SPELL_ATTR7_CONSOLIDATED_RAID_BUFF) || HasAttribute(SPELL_ATTR5_DONT_ALLOW_PET_TARGET)) && (!caster->IsPet() || !caster->IsGuardian()))
|
||||
if ((unitTarget->IsPet() || unitTarget->IsGuardian()))
|
||||
return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
// checked in Unit::IsValidAttack/AssistTarget, shouldn't be checked for ENTRY targets
|
||||
//if (!HasAttribute(SPELL_ATTR6_CAN_TARGET_UNTARGETABLE) && target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
|
||||
// return SPELL_FAILED_BAD_TARGETS;
|
||||
|
||||
Reference in New Issue
Block a user