Yeah I was trying to use SpellTargetUnit("player") but it seems to always just be mouseover...maybe once possible but deactivated?
As I see it, SpellTargetUnit was originally anticipated to be used for spells that actually require a target. That it works for "placeable non-targetable" spells feels more like a later addition (since it's not really distiguishable from a Lua perspective which kind of spell is attached to your cursor). Also, "placeable non-targetable" spells just ignore any UnitID parameters - since they are targeted at the ground, and the ground is no unit. If you want to double check this, look at the following macro.
This macro works just as fine as if it was written with SpellTargetUnit("mouseover") - the "mouseover" part is superfluous. You might replace Thunderstorm with a placeable non-targetable spell of your own.
|
Source code
|
1
2
3
|
/cast Thunderstorm
/wait .1
/run SpellTargetUnit()
|
IMO it would have been cleaner to split this "double" functionality into 2 functions, SpellTargetUnit(UnitID) and SpellPlaceOnGround(), but then we would need a way to distiguish "placeable" from "targetable" spells (which should in theory allow for "placeable targetable" spells, which are missing in this game so far)