View Single Post
04-12-17, 04:02 PM   #7
Layback_
An Onyxian Warder
Join Date: Feb 2016
Posts: 358
Originally Posted by Tim View Post
Perhaps have the destination target checked to see if it's attackable/hostile with the initial spell cast?
Yeah, I've used that method as well.

Code:
if subEvent == "SPELL_CAST_SUCCESS" and (UnitCanAttack("player", "target") or UnitAffectingCombat("player")) then
But, this also had some issue.

1. Still tracks any spell casts as long as unit is attackable.

2. Only "target" is considered. Even if you have a target exists, but is not attackable and you cast a spell on "focus", "targettarget" then this won't work.

3. AOE is not considered as well.
  Reply With Quote