enemy

Returns the boolean if the UNIT can be attacked by the player, otherwise false.

enemy([UnitId]) : boolean
-- alts
IsEnemy([unitid]) : boolean
1. See Wowpedia for more information on WoW Unit IDs. Will default to 'target' if nothing is specified as an argument.

Example

if enemy('target') then
return cast(Frostbolt, 'target')
end

Note

This uses UnitCanAttack(unit1, unit2), returning boolean.