GetSpellTargetObject

The   NWScript command returns the object at which the caller's last spell was cast. This command is valid only when used in a spell's impact script.

Definition
If the last spell did not target an object,  is returned.