WoW:API SetRaidTarget: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
m (Move page script moved page API SetRaidTarget to API SetRaidTarget without leaving a redirect)
 
(5 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{wowapi}} __NOTOC__
{{wowapi}}
Set which [[Raid Target Icon]] will be shown over a mob or raid member. In patch 1.11, Blizzard added the ability for a [[raid]]/[[party]] [[leader]] or assistant leader to assign up to 8 different target icons to [[mob]]s or [[player]]s.  These icons are visible only to other players within the raid or party.
Set which [[target markers]] will be shown over a mob or raid member.
 
  SetRaidTarget("unit", iconId);
  SetRaidTarget("unit",icon);
 
 
== Parameters ==
=== Arguments ===
 
:("unit")
 
:;unit : String - The [[API TYPE UnitId|UnitId]] representing the desired target for the icon.
 
:;icon :
 
:::A value from 0 to 8, as follows,
::::0 = no icon
::::1 = Yellow 4-point Star
::::2 = Orange Circle
::::3 = Purple Diamond
::::4 = Green Triangle
::::5 = White Crescent Moon
::::6 = Blue Square
::::7 = Red "X" Cross
::::8 = White Skull
 
 
=== Returns ===
 
:;nil


== Arguments ==
;unit
: String - The [[API TYPE UnitId|unit]] to change the target markers of.
;iconId
: Number - Raid icon index; 0 to remove any icons from the unit.
::1 = Yellow 4-point Star
::2 = Orange Circle
::3 = Purple Diamond
::4 = Green Triangle
::5 = White Crescent Moon
::6 = Blue Square
::7 = Red "X" Cross
::8 = White Skull


== Example ==
== Example ==
To set a skull over your current target:
  /script SetRaidTarget("target",8);
  /script SetRaidTarget("target",8);


 
== Notes ==
{{AlsoSee|[[API SetRaidTargetIcon]]}}
* This function was added in patch 1.11, which introduced the 8 different target icons that can be assigned to mobs or players. The icons are only visible to your party.
* In a 5-man party, all party members may assign raid icons. In a raid, only the raid leader and the assistants may do so.
* Units may only be assigned one icon at a time; an icon may only be assigned to one unit at a time.
* This function does not remove the icon if you're trying to assign the icon that is already assigned to the unit. {{api|SetRaidTargetIcon}} function, provided by FrameXML, provides this toggling behavior. (This note seems to be false. SetRaidTarget does currently toggle the icon off if it is already set. You can use [http://www.wowwiki.com/API_GetRaidTargetIndex GetRaidTargetIndex] to check if the icon already exists on the unit)

Latest revision as of 04:47, 15 August 2023

WoW API < SetRaidTarget

Set which target markers will be shown over a mob or raid member.

SetRaidTarget("unit", iconId);

Arguments[edit]

unit
String - The unit to change the target markers of.
iconId
Number - Raid icon index; 0 to remove any icons from the unit.
1 = Yellow 4-point Star
2 = Orange Circle
3 = Purple Diamond
4 = Green Triangle
5 = White Crescent Moon
6 = Blue Square
7 = Red "X" Cross
8 = White Skull

Example[edit]

To set a skull over your current target:

/script SetRaidTarget("target",8);

Notes[edit]

  • This function was added in patch 1.11, which introduced the 8 different target icons that can be assigned to mobs or players. The icons are only visible to your party.
  • In a 5-man party, all party members may assign raid icons. In a raid, only the raid leader and the assistants may do so.
  • Units may only be assigned one icon at a time; an icon may only be assigned to one unit at a time.
  • This function does not remove the icon if you're trying to assign the icon that is already assigned to the unit. SetRaidTargetIcon function, provided by FrameXML, provides this toggling behavior. (This note seems to be false. SetRaidTarget does currently toggle the icon off if it is already set. You can use GetRaidTargetIndex to check if the icon already exists on the unit)