WoW:API SpellTargetUnit: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
No edit summary
m (Move page script moved page API SpellTargetUnit to API SpellTargetUnit without leaving a redirect)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{wowapi}}
{{protectedapi|2.0.1|For alternatives, try [[API_SecureTemplates|Secure Templates]].}}
This page is about the '''API SpellTargetUnit'''.
This specifies the target that the spell should use without needing you to click the target or make it your main target.
This specifies the target that the spell should use without needing you to click the target or make it your main target.
----
SpellTargetUnit(unitId)
{{template:WoW API}}
 
==Arguments==
:; unitId : [[UnitId|Unit ID]] : unit you wish to cast the spell on.
 
==Example==
local ue = UnitExists("target"); -- We'll need to know if we have a target at the moment.
ClearTarget(); -- Get rid of it, either way
CastSpellByName("Power Word: Fortitude"); -- This gets us into cursor casting mode.
SpellTargetUnit("raid1"); -- This casts PW:F on raid1 (if you are in a raid).
if (ue) then
  TargetLastTarget(); -- Return target if it existed before we clared it.
end

Latest revision as of 04:47, 15 August 2023

WoW API < SpellTargetUnit

This page is about the API SpellTargetUnit.

This specifies the target that the spell should use without needing you to click the target or make it your main target.

SpellTargetUnit(unitId)

Arguments[edit]

unitId
Unit ID : unit you wish to cast the spell on.

Example[edit]

local ue = UnitExists("target"); -- We'll need to know if we have a target at the moment. 
ClearTarget(); -- Get rid of it, either way
CastSpellByName("Power Word: Fortitude"); -- This gets us into cursor casting mode.
SpellTargetUnit("raid1"); -- This casts PW:F on raid1 (if you are in a raid).
if (ue) then
 TargetLastTarget(); -- Return target if it existed before we clared it.
end