I'm looking for a macro that will only cast if i'm selecting/targeting an enemy. So like if i'm targeting the tank or mousing over him it won't cast, but if i'm targeting the boss it will (not focus)
Author, Hekili, a priority helper addon.
Several possibilities. Soisoisoi's solution works. Other possibility is this:
/cast [harm,exists,nodead][@targettarget,harm,exists,nodead] Holy Prism
This one's will fire it on a selected enemy, or if you are selecting a friendly unit, it will cast Holy Prism in that unit's target, if it's an enemy (so, if you select the tank and casts it, it will fire it on the boss or enemy that is being tanked rather than the tank). It will fail to be cast (and not use CD) if there's no enemy target available.
- - - Updated - - -
No need to use @target, it's the default option. Hiding it performs the very same task.
- - - Updated - - -
Another option is to allow it to be cast on a friend by holding alt:
/cast [mod:alt,help,exists,nodead][mod:alt,@targettarget,help,exists,nodead][harm,exists,nodead][@targettarget,harm,exists,nodead] Holy Prism
That way you could control, if you so wish, if you will use it on a friend (hold alt and use it) or an enemy (do not hold alt)