GetRaidTargetIndex

From Warcraft Wiki
Jump to navigation Jump to search
Flavors
Links
Info
Added in 1.11.0 / 1.13.2

Returns the raid target of a unit.

index = GetRaidTargetIndex(unit)

Arguments

unit
string : UnitId

Returns

index
number?
Value Icon
1 star Yellow 4-point Star
2 circle Orange Circle
3 diamond Purple Diamond
4 triangle Green Triangle
5 moon White Crescent Moon
6 square Blue Square
7 cross Red "X" Cross
8 skull White Skull

Details

  • Raid target icons are typically displayed by unit frames, as well as above the marked entities in the 3D world. The targets can be assigned by raid leaders and assistants, party members, and the player while soloing, and are only visible to other players within the same group.
  • This function can return arbitrary values if the queried unit does not exist. Use UnitExists() to check whether a unit is valid.
    For example: "raid2target" when "raid2" is offline and not targetting anything at all misbehaves.
Related API SetRaidTarget
Related Events RAID_TARGET_UPDATE

Example

Prints the raid target index for your target.

/dump GetRaidTargetIndex("target")

Patch changes

Shadowlands Patch 9.2.0 (2022-02-22): Removed invisible IDs 9 to 18.
WoW Icon update.png Patch 1.11.0 (2006-06-19): Added.

See also