The following are not primitive Lua data types, but for the purposes of this Reference it is useful to recognize cases where API functions expect or return data in a standard format.
Type: 1nil
Many API functions return a value indicative of a binary state but do not use the boolean true and false values -- instead returning 1 for true and nil for false. Since Lua treats nil as false and any non-nil value as true in conditionals, these values can generally be used the same as boolean values (e.g. if IsInGuild() then ... end). However, one should avoid making direct comparisons: for example, the condition in if IsInGuild() == true then ... end will never be triggered.
Type: accessID
Internal index identifying a combination of chatMsgType and chat target. Used to filter chat frame messages for certain API calls. Returned by ChatHistory_GetAccessID(chatType,chatTarget).
Type: actionID
Index identifying one of the player's action bar slots.
In UI terms, action slots are a layer of abstraction between spells or items and the mechanisms available to the player for using them conveniently. For example, instead of the default UI internally using SetBindingSpell(), SetBindingMacro(), et al whenever the player changes the contents of the visible action bars, it instead manages a set of key bindings corresponding to the action bar slots.
Every player has at least NUM_ACTIONBAR_PAGES * NUM_ACTIONBAR_BUTTONS (in the current client, 6 * 12, or 72) action slots corresponding to the six default action bar pages. In addition, players of certain classes (or with certain talents) may have additional actionIDs available corresponding to the "bonus" action bars that automatically become available when changing stances, stealthing, shapeshifting, etc.
Type: ah-list-type
There are three different auction house listing types:
list- The items that are currently for sale in the auction house.bidder- The items for which the player has bid.owner- The items that the player has placed up for auction.
Type: anchorPoint
String identifying a point relative to the dimensions of a Region; used in frame layout. Possible values:
CENTERBOTTOMTOPLEFTRIGHTBOTTOMLEFTBOTTOMRIGHTTOPLEFTTOPRIGHT
Type: arenaTeamID
Identifies one of the (up to three) Arena teams to which a player can belong. These indices begin at 1 for the player's smallest team and increase with team size. For example, if the player belongs to a 2v2 team and a 5v5 team, 1 indicates the 2v2 team and 2 indicates the 5v5 team. But if the player belongs to a 3v3 team and a 5v5 team, 1 indicates 3v3 and 2 indicates 5v5. If the player is on teams of all three sizes, 1 indicates 2v2, 2 is 3v3, and 3 is 5v5.
The Blizzard UI's Lua function ArenaTeam_GetTeamSizeID can be used to translate a team size (2, 3, or 5) to the appropriate arenaTeamID for the player.
Type: auraFilter
This parameter can be any of "HELPFUL", "HARMFUL", "PLAYER", "RAID", "CANCELABLE", "NOT_CANCELABLE". You can also specify several filters separated by a | or space character to chain multiple filters together (e.g. "HELPFUL|RAID" or "HELPFUL RAID" == helpful buffs that you can cast on your raid). By default UnitAura has "HELPFUL" as an implicit filter - you cannot get back BOTH helpful and harmful at the same time. Neither "HELPFUL" or "HARMFUL" have meaning for UnitBuff/UnitDebuff, and will be ignored.
Type: backdrop
A backdrop definition is a Lua table with specific attributes, that match directly with the elements in the <Backdrop> definition in an XML definition. It has the following structure:
{
bgFile = "Interface\\DialogFrame\\UI-DialogBox-Gold-Background", -- path to the background texture
edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Gold-Border", -- path to the border texture
tile = true, -- true to repeat the background texture to fill the frame, false to scale it
tileSize = 32, -- size (width or height) of the square repeating background tiles (in pixels)
edgeSize = 32, -- thickness of edge segments and square size of edge corners (in pixels)
insets = { -- distance from the edges of the frame to those of the background texture (in pixels)
left = 11,
right = 12,
top = 12,
bottom = 11
}
}
Type: blizzid
A unique numeric identifier, used by Blizzard in the game files and commonly found on database websites such as the WoW Armory and wowhead.com. These identifiers are not globally unique, however within a given class of ids, such as quest ids, they are used to uniquely identify a quest.
Type: bitfield
A value combining several binary flags into one number; the flags can be inspected individually using bitlib functions. For example (using GetItemFamily and related constants):
GetItemFamily("Crystallized Air")
-- returns 1224
bit.bor(0x0008,0x0040,0x0080,0x0400)
-- returns 1224
-- these are the masks for Leatherworking, Enchanting, Engineering, and Mining bags
bit.band(GetItemFamily("Crystallized Air"), 0x0040)
-- returns 64, or 0x0040: the item fits in an Enchanting Bag
bit.band(GetItemFamily("Crystallized Air"), 0x0020)
-- returns 0, or 0x0040: the item does not fit in an Herb Bag
Type: binding
String identifying one or more keyboard keys or mouse buttons, used with key binding and modified click API functions and the OnKeyDown/OnKeyUp script handlers. Most letter, number, and symbol keys are identified by their (uppercase) letter, number, or symbol.
Other keys are identified by a series of global variables with names prefaced by "KEY_": e.g. the localized name for the binding NUMPAD0 can be found in _G["KEY_NUMPAD0"]. Some keys have platform-specific names: e.g. the localized name for the binding PRINTSCREEN can be found in _G["KEY_PRINTSCREEN_MAC"] (revealing that it refers to the F13 key found on Mac extended keyboards).
Modifier keys are identified as follows:
LSHIFT,RSHIFT,SHIFT- Left, right, or generic Shift keyLCTRL,RCTRL,CTRL- Left, right, or generic Control keyLALT,RALT,ALT- Left, right, or generic Alt (or Option) keySTRG- German equivalent to CTRL key
Mouse buttons are identified by the token "BUTTON" followed by the button number; e.g. BUTTON1 for the primary (left) button, BUTTON2 for the right button, BUTTON3 for middle, etc.
For use in key bindings, several key/button identifiers can be strung together with hyphens to indicate a key combination; e.g. CTRL-SHIFT-SPACE, RALT-F12, SHIFT-BUTTON1.
Type: chatMsgType
String identifying the common type of a set of chat window messages; used in chat window functions for determining which windows display which messages and the colors used for displaying each message type.
Each CHAT_MSG_X event has a corresponding chatMsgType, idendified by the part of the event name following the initial CHAT_MSG_; e.g. the chatMsgType for CHAT_MSG_COMBAT_FACTION_CHANGE is COMBAT_FACTION_CHANGE. A list of pre-configured chatMsgTypes can be found as keys in the global table ChatTypeInfo.
Type: colorString
Formatting used to colorize sections of text when displayed in a FontString. Color strings take the form |c(colorvalue)(text)|r:
(colorvalue)- A string of four hexadecimal-formatted bytes describing component values of the color. Each byte can be a value from00(representing zero intensity of the component) toff(representing full intensity of the component):- Nominally alpha value, but currently unused: always
ff. - Red component of the color
- Green component of the color
- Blue component of the color
- Nominally alpha value, but currently unused: always
(text)- The text to be colorized.
Examples: |cffffff00(bright yellow)|r, |cff0070dd(rare item blue)|r, |cff40c040(easy quest green)|r
Color strings can be used for display anywhere in the UI, can only be delivered in chat messages if used as part of a hyperlink.
Type: containerID
Identifies one of the player's bags or other containers. Possible values:
REAGENTBANK_CONTAINER: Reagent bank (-3)KEYRING_CONTAINER: Keyring and currency bag (-2)BANK_CONTAINERMain storage area in the bank (-1)BACKPACK_CONTAINER: Backpack (0)1throughNUM_BAG_SLOTS: Bag slots (as presented in the default UI, numbered right to left)NUM_BAG_SLOTS + 1throughNUM_BAG_SLOTS + NUM_BANKBAGSLOTS: Bank bag slots (as presented in the default UI, numbered left to right)
Type: containerSlotID
Index of an item slot within a container. Slots are numbered (as presented in the default UI) left-to-right, top-to-bottom, starting with the leftmost slot on the top row.
Type: expansionID
Numeric index of an expansion pack. Used as return value to GetExpansionLevel() and GetAccountExpansionLevel().
0- World of Warcraft (no expansions installed)1- World of Warcraft: The Burning Crusade2- World of Warcraft: Wrath of the Lich King3- World of Warcraft: Cataclysm4- World of Warcraft: Mists of Pandaria
Type: frameStrata
String identifying the general layering order of frames; where frame level provides fine control over the layering of frames, frame strata provides a coarser level of layering control. Frames in a higher strata always appear "in front of" frames in lower strata regardless of frame level. Available frame strata are listed below in order from lowest to highest:
BACKGROUND- Used by default for static UI elements such as the PlayerFrame and MinimapLOW- Used by default for lower-priority UI elements such as the party member and target framesMEDIUM- Default frame strata for general usageHIGH- Used by default for higher-priority UI elements such as the Calendar and Loot framesDIALOG- Used by default for alerts and other dialog boxes which should appear over nearly all other UI elementsFULLSCREEN- Used by default for full-screen windows such as the World MapFULLSCREEN_DIALOG- Used by default for alerts or dialog boxes which should appear even when a full-screen window is visibleTOOLTIP- Used for mouse cursor tooltips, ensuring they appear over all other UI elements
Type: glyphIndex
Glyph indices are ordered by the level at which they are discovered. Specifically:
- The major glyph at the top of the user interface (level 15)
- The minor glyph at the bottom of the user interface (level 15)
- The minor glyph at the top left of the user interface (level 30)
- The major glyph at the bottom right of the user interface (level 50)
- The minor glyph at the top right of the user interface (level 70)
- The major glyph at the bottom left of the user interface (level 80)
Type: GUID (Globally Unique IDentifier)
All entities in World of Warcraft are identified by a unique 64-bit number; generally presented as a string containing a hexadecimal representation of the number (e.g. "0xF530007EAC083004"). (Note that Lua in WoW does not support 64-bit integers, so this value cannot be converted with tonumber.)
The type of unit represented by a GUID can be determined by using bit.band() to mask the first three digits with 0x00F:
- 0x000 - A player
- 0x003 - An NPC
- 0x004 - A player's pet (i.e. hunter/warlock pets and similar; non-combat pets count as NPCs)
- 0x005 - A vehicle
Further content of the GUID varies by unit type:
Players - The remaining thirteen digits are unique to a player character at least within that character's battlegroup (that is, they remain unique and constant even in cross-server battlegrounds). This number is also semi-permanent -- it persists from character creation until deletion, renaming, or server transfer.
NPCs - Remaining digits can be broken down as follows:
- Digits 4-5 - Unused.
- Digits 6-10 - NPC creature ID: identifies the specific named NPC (e.g. Hogger, Loque'nahak) or type of NPC (e.g. Sunfury Nethermancer, Shattertusk Mammoth). Converting to decimal results in the ID found on database sites such as wowhead.com; can also be used with [[docs/widgets/PlayerModel/SetCreature|
PlayerModel:SetCreature]] to view the NPC's model. - Digits 11-16 - Spawn counter: identifies the individual NPC (i.e. differentiates between the Gamon you recently killed and the Gamon that respawned a few minutes later, or between one Ymirheim Defender and another).
Pets - Hunter pets immediately after taming retain the GUID they had as a wild creature; after resummoning or logout/login, their GUID changes to the pet format. Remaining digits can be broken down as follows:
- Digits 4-10 - A constant value unique to the individual pet: like a player's unique ID it is constant across multiple sessions.
- Digits 11-16 - Spawn counter: changes when the pet is dismissed and re-summoned.
Vehicles - Same format and content as NPCs.
For example, the GUID 0xF530007EAC083004 can be deconstructed as follows:
- digits 1-3 are "F53";
bit.band(0xF53, 0x00F) == 0x003, so this is an NPC - digits 7-10 are "7EAC";
0x7EAC == 32428, which we can look up to find the NPC is a Underbelly Rat. - digits 11-16 have no intrinsic meaning, but distinguish this Underbelly Rat from all others spawned since the last server reset.
Example Code: a function to decode GUIDs
function ParseGUID(guid)
local first3 = tonumber("0x"..strsub(guid, 3,5))
local unitType = bit.band(first3,0x00f)
if (unitType == 0x000) then
print("Player, ID #", strsub(guid,6))
elseif (unitType == 0x003) then
local creatureID = tonumber("0x"..strsub(guid,7,10))
local spawnCounter = tonumber("0x"..strsub(guid,11))
print("NPC, ID #",creatureID,"spawn #",spawnCounter)
elseif (unitType == 0x004) then
local petID = tonumber("0x"..strsub(guid,7,10))
local spawnCounter = tonumber("0x"..strsub(guid,11))
print("Pet, ID #",petID,"spawn #",spawnCounter)
elseif (unitType == 0x005) then
local creatureID = tonumber("0x"..strsub(guid,7,10))
local spawnCounter = tonumber("0x"..strsub(guid,11))
print("Vehicle, ID #",creatureID,"spawn #",spawnCounter)
end
end
Type: |K string
A |K string is a special type of escape sequence that is used on Battle.net names (RealID).
The string is rendered as the players name in the UI ("John"), but is in fact comprised of a special escape sequence using the presenceID of the player (|Kg30|k0000|k).
The third character of the |K string is g for given name, s for surname or f if the string is a combination of the two.
You can use BNTokenCombineGivenAndSurname() to combine two |K strings.
If you do strlower() on the escaped string then the escape sequence will be visible when using print().
Since the presenceID is only relevant for the local client, then sending these |K strings to other players will make no sense (they will then lookup names based on their own friendslist).
If passed to another client they will be related to that clients own friendslist:
presenceID 30 with me is for my friend 'Bob', but on the other client the same presenceID (30) happens to be for 'Mike' so then the client will see 'Mike'.
See also: http://www.wowwiki.com/UIescapesequences
Type: hyperlink
A string containing markup allowing the client to present it as a link, which the player can click to view more information about or take action regarding the data it represents.
Hyperlinks take the form |H(linktype):(linkdata)|h(text)|h, where (linktype) determines the type of link, (linkdata) is a code referencing the linked information, and (text) is the text visible to the player. Some API functions which operate on links do not require a full hyperlink, only its linktype:linkdata portion.
Links are often encapsulated in a colorString -- in such cases, the full colorString-wrapped link is the only form of the link allowed to be used in chat; attempting to transmit an invalid link may cause the player to be disconnected from the server.
The WoW client recognizes several kinds of hyperlinks, identified by their linktype. For linkdata elements noted as optional below, the client can still resolve the link if they are omitted:
player(example:|Hplayer:Aerdrig:1:WHISPER:AERDRIG|h[Aerdrig]|h) - Represents a player character. Left-clicking a player link in the default UI opens the ChatFrameEditBox to send a whispered message to the character. Right-clicking opens a menu with options for inviting the character to the player's party/raid, adding the character to the ignore list, or reporting the chat message in which the link appears as spam. Thelinkdatafor a player link consists of the following, separated by colons: the player's name (or in cross-realm battlegrounds, the player's name and home realm separated by a hyphen, e.g. "Gundark-Broxigar"), the lineID of the chat message the link appears in (used for reporting) and the chat type plus chat target of the message. Note that player hyperlinks are only accepted on the local client. Sending them to a chat channel will not work.playerGM(example:|HplayerGM:Eyonix|h[Eyonix]|h) - A variation on theplayertype used exclusively for Game Master chat.glyph(example:|cff66bbff|Hglyph:23:460|h[Glyph of Fortitude]|h|r) - Represents a glyph inscribed in a character's spellbook. Clicking a glyph link in the default UI shows a tooltip with its description. Thelinkdatafor a glyph link follows the formatsocket:glyphID:socket(optional) - The socket in which the glyph is placed; values 21 through 26 correspond to [[docs/api_types#glyphIndex|glyphIndex]] values 1 through 6.glyphID- A unique identifier for the glyph effect; not used elsewhere in the API.
spell(example:|cff71d5ff|Hspell:46584|h[Raise Dead]|h|r) - Represents a spell. Clicking a spell link in the default UI shows a tooltip with its description. Thelinkdatafor a spell link consists solely of thespellIDnumber uniquely identifying the spell, usable with APIs such asGetSpellInfo().enchant(example:|cffffd000|Henchant:59387|h[Certificate of Ownership]|h|r) - Represents a trade skill recipe (originally used only for Enchanting, but now applies to all trade skills). Clicking a spell link in the default UI shows a tooltip with its description (and that of the item it creates, if applicable). Thelinkdatafor a spell link consists solely of thespellIDnumber uniquely identifying the trade skill recipe, usable with APIs such asGetSpellInfo().quest(example:|cffffff00|Hquest:982:17|h[Deep Ocean, Vast Sea]|h|r) - Represents a quest from a character's quest log. Clicking a quest link in the default UI shows a tooltip with a brief description of the quest and its objectives. When the client displays a quest link sent by another character, it automatically alters the enclosingcolorStringto reflect the difficulty of the quest relative to the player's level. Thelinkdatafor a quest link follows the formatquestID:level:questID- A unique identifier for the quest; found on database sites (e.g. [[wowhead:quest=982|quest ID 982]]) but not used elsewhere in the API.level(optional) - Recommended character level for attempting the quest. (A level of-1means the quest is appropriate for any level; used for holiday quests.)
talent(example:|cff4e96f7|Htalent:1396:4|h[Unleashed Fury]|h|r) - Represents a talent. Clicking a talent link in the default UI shows a tooltip with its description. Thelinkdatafor a talent link follows the formattalentID:points:talentID- A unique identifier for the talent; not used elsewhere in the API.rank(optional) - Number of points spent in the talent, minus one: if this value is omitted or-1, the tooltip shows the talent as it appears in the Talents UI when zero points have been spent ; if this value is0, the tooltip shows the talent as it appears when one point has been spent on it. Values greater than the number of available ranks for a talent are interpreted as-1.
achievement(example:|cffffff00|Hachievement:2336:060000000279E425:1:10:14:8:4294967295:4294967295:4294967295:4294967295|h[Insane in the Membrane]|h|r) - Represents an achievement earned or in progress by a player. Clicking an achievement link in the default UI shows a tooltip with a summary of the achievement and (if applicable) its criteria. Thelinkdatafor an achievement link follows the formatachievementID:playerGUID:completed:month:day:year:bits1:bits2:bits3:bits4. If only the first elementacheivementIDis specified, the client resolving the link will show the player's progress or completion of the achievement; otherwise, all elements are required:achievementID- A unique identifier for the achievements; usable with various Achievement API functions.playerGUID(optional) - GUID of a player character whose progress or completion of the achievement is linked (return value of [[docs/api/UnitGUID|`UnitGUID']] without the "0x" prefix).completed(optional) -1if the character has completed the achievement; otherwise0.month(optional) - Index of the month (1 = January) in which the character completed the achievement, or0if the achievement is incomplete.day(optional) - Day of the month on which the character completed the achievement, or0if the achievement is incomplete.year(optional) - Year (two-digit year) in which the character completed the achievement, or-1if the achievement is incomplete.bits1,bits2,bits3,bits4(optional) - Encoded data fields interpreted by the client to show completion of achievement criteria.
trade(example:|cffffd000|Htrade:45361:339:375:60000000279E425:Q/nPf6nprU3/n/fA8/Bw/PA+/B+/Aw/HA+/Bw/HA+5nfg////////P////HAAAQAA+DAAAAAAA|h[Inscription]|h|r) - Represents the entire list of recipes for a character's trade skill or profession. Thelinkdatafor an achievement link follows the formatspellID:skill:maxSkill:playerGUID:data. If only the first elementacheivementIDis specified, the client resolving the link will show the player's progress or completion of the achievement; otherwise, all elements are required:spellID- The [[docs/api_types#spellID|spellID]] number uniquely identifying the trade skill and its rank (e.g. Apprentice Tailoring vs. Journeyman Tailoring), usable with APIs such as [[docs/api/GetSpellInfo|GetSpellInfo()]].skill- The character's current skill in the profession.maxSkill- The maximum skill for the character's current rank in the profession (e.g. 375 for Master rank).playerGUID- GUID of the character whose profession is linked (return value of [[docs/api/UnitGUID|`UnitGUID']] without the "0x" prefix).data(optional) - Encoded data field interpreted by the client to show the character's list of known trade skill recipes.
item(examples:|cffa335ee|Hitem:45457:3828:3395:3395:0:0:0:0:80:0:0:0|h[Staff of Endless Winter]|h|r,|cffa335ee|Hitem:113602:0:0:0:0:0:0:0:100:0:5:1:566|h[Throat-Ripper Gauntlets]|h|r) - Represents an item. Clicking an item link in the default UI shows a tooltip with information about the item. Control-clicking an equippable item opens the DressUpFrame to preview how the item would look on the player character if equipped. Thelinkdatafor an item link changed in 6.0.2 and now has the formatitemID:enchant:gem1:gem2:gem3:gem4:suffixID:uniqueID:level:upgradeId:instanceDifficultyID:numBonusIds:bonusId1:bonusid2:...:itemID- The item'sitemID.enchant(optional) - Unique identifier of the enchantment applied to the item; not used elsewhere in the API.gem1,gem2,gem3,gem4(optional) - Unique identifiers of the enchantments provided by gems socketed in the item (not theitemIDs of the gems themselves); not used elsewhere in the API.suffixID(optional) - Identifies the specific variation represented for random-property items (e.g. "... of the Monkey", "... of Frost Protection", etc.). A positive number indicates a variation with specific stat values (e.g.1200= "of the Bear", 8 stamina 8 strength;1220= "of the Bear", 14 stamina 15 strength); a negative number indicates a type of variation, with actual stat values to be determined by decoding theuniqueID.uniqueID(optional) - A number used internally by the WoW client/server architecture to track a specific occurrence of an item: used for crafted items which display "<Made by Name>" in their tooltips and for random-property items. For items with a negativesuffixID, usingbit.band(uniqueID, 0xFFFF)reveals the factor used to calculate the item's stats.level- Level of the character linking the item; used for "Heirloom" items whose stats change based on the level of the character equipping them.upgradeId- A number that identifies whether an item can be upgraded, and if so, how many upgrades it's had.instanceDifficultyID- the item'sinstanceDifficultyID(dungeon / raid difficulty at which the item can be obtained).numBonusIds- the number of additional bonus ID's associated with the item. Can be 0 for the base item or any number of additional attributes that modify the base item.bonusId1,bonusId2... -numBonusIdsextra bonus modifiers for the item.
levelup(examples:|cffFF4E00|Hlevelup:61:LEVEL_UP_TYPE_CHARACTER|h[Level 61]|h|r) - represents the level up information for a player unit. Thelinkdatafor a levelup link follows the formatlevel:typelevel- The numeric level the unit has reachedtype- This is one ofLEVEL_UP_TYPE_CHARACTER,LEVEL_UP_TYPE_PETandLEVEL_UP_TYPE_GUILDand specifies who gained the level- Note: A level up of type
LEVEL_UP_TYPE_PETon a non-pet class will display the level up information of the last level up link clicked (or a blank information if none has been clicked since UI load) on non-pet classes.
instancelock(example:|cffff8000|Hinstancelock:01000000003E8E2E7:531:0:15|h[Ahn'Qiraj Temple]|h|r) - represents a player's instance lockout Thelinkdatafor an instancelock link follows the formatguid:instanceID:difficulty:bossesDefeatedguid- The GUID of the player the lockout belongs toinstanceID- The ID of the instancedifficulty- Numeric value indicating the difficulty of the lockout0- Normal1- Heroic 5-man2- Heroic raid
bossesDefeated- Bitmask containing which of the encounters have been defeated
journal(example:|cff66bbff|Hjournal:1:192:8|h[Beth'tilac]|h|r) - represents a link to an encounter or instance in the Dungeon Journal Thelinkdatafor an journal link follows the formatcontentType:contentID:difficultycontentType-2if the link points to an entry on a boss page,1if the link points to the page for an encounter,0if the link points to the page for an instancecontentID- the unique ID of the encounter or instance - can be passed toEJ_GetSectionInfo(contentID),EJ_GetEncounterInfo(contentID)andEJ_GetInstanceInfo(contentID), respectively.difficulty- indicates the selected difficulty setting for the Dungeon Journal to display. SeeEJ_SetDifficultyByMaskfor values.
Type: instanceDifficultyID
Numeric index representing instance difficulty. Returned by GetInstanceInfo() and others. Also used when describing items in a hyperlink. More information can be acquired by using GetDifficultyInfo(difficultyID).
1- Normal2- Heroic3- 10 Player4- 25 Player5- 10 Player (Heroic)6- 25 Player (Heroic)7- Looking for Raid8- Mythic Keystone9- 40 Player10- nil11- Heroic Scenario12- Normal Scenario13- nil14- Normal15- Heroic16- Mythic17- Looking for Raid18- Event19- Event20- Event Scenario21- nil22- nil23- Mythic24- Timewalking25- World PvP Scenario26- nil27- nil28- nil29- PvEvP Scenario30- Event31- nil32- World PvP Scenario33- Timewalking
Type: inventoryID
This is a numeric identifier that is used by the the inventory system to identify a slot in the player's inventory. In World of Warcraft all items that the player 'owns' are part of the player's inventory, including the items they have equipped, the items in the player's bank, the bags that the player has equipped and equipped in the bank, and the keys stored in the player's key ring.
There is a system of API functions that allow you to map from one of these types of locations into an 'inventorySlot' which uniquely identifies that location. For example:
GetInventorySlotInfo("MainHandSlot") -- The player's mainhand weapon
BankButtonIDToInvSlotID(3, 1) -- The third bag in the player's bank
BankButtonIDToInvSlotID(5, nil) -- The fifth slot in the player's bank (not bags)
ContainerIDToInventoryID(1) -- The player's first bag slot
KeyRingButtonIDToInvSlotId(4) -- The fourth slot in the player's key-ring
In addition and for convenience there are a set of constants defined by the user interface that can be used for the items in the player's 'paper doll' frame. These are defined in FrameXML/Constants.lua and are currently as follows:
-- Inventory slots
INVSLOT_AMMO = 0;
INVSLOT_HEAD = 1; INVSLOT_FIRST_EQUIPPED = INVSLOT_HEAD;
INVSLOT_NECK = 2;
INVSLOT_SHOULDER = 3;
INVSLOT_BODY = 4;
INVSLOT_CHEST = 5;
INVSLOT_WAIST = 6;
INVSLOT_LEGS = 7;
INVSLOT_FEET = 8;
INVSLOT_WRIST = 9;
INVSLOT_HAND = 10;
INVSLOT_FINGER1 = 11;
INVSLOT_FINGER2 = 12;
INVSLOT_TRINKET1 = 13;
INVSLOT_TRINKET2 = 14;
INVSLOT_BACK = 15;
INVSLOT_MAINHAND = 16;
INVSLOT_OFFHAND = 17;
INVSLOT_RANGED = 18;
INVSLOT_TABARD = 19;
INVSLOT_LAST_EQUIPPED = INVSLOT_TABARD;
If you choose to use these instead of the appropriate API, you should use the constant name, not the number itself. This ensures that if Blizzard later updates their constants your code should continue to work.
The following are the convenience functions that can be used to obtain inventoryIds:
Type: itemID
Uniquely identifies an item; usable with APIs such as GetItemInfo(). Also useful with database sites; e.g. item ID 19019.
Type: itemLocation
A bitfield describing the location of an item owned by the player. The bitfield can be decoded using the EquipmentManager_UnpackLocation function, provided by the equipment manager system:
local player, bank, bags, slot, bag = EquipmentManager_UnpackLocation(mask)
Type: itemQuality
Indicates the quality (or rarity) of an item. Possible values and examples:
0. Poor (gray): Broken I.W.I.N. Button1. Common (white): Archmage Vargoth's Staff2. Uncommon (green): X-52 Rocket Helmet3. Rare / Superior (blue): Onyxia Scale Cloak4. Epic (purple): Talisman of Ephemeral Power5. Legendary (orange): Fragment of Val'anyr6. Artifact (golden yellow): The Twin Blades of Azzinoth7. Heirloom (light yellow): Bloodied Arcanite Reaper
Type: itemString
Refers to the linktype:linkdata portion of an item link (the part containing the itemID, e.g. item:19019); see hyperlink for details.
Type: justifyH
String describing the horizontal alignment of text within a widget. Possible values:
LEFTCENTERRIGHT
Type: justifyV
String describing the vertical alignment of text within a widget. Possible values:
TOPMIDDLEBOTTOM
Type: layer
String identifying the layer in which a region's graphics are drawn relative to those of other regions in the same frame; graphics in higher layers (as numbered below) are drawn "on top of" those in lower layers.
BACKGROUND- First (lowest) layerBORDER- Second layerARTWORK- Third layer; default for regions for which layer is not specifiedOVERLAY- Fourth layerHIGHLIGHT- Fifth (highest) layer; regions in this layer are automatically shown when the mouse is over the containing Frame (if the Frame's enableMouse property is true).
Type: macroID
Index of one of the player's saved macros. Macros shared by all characters on player's account are indexed from 1 to MAX_ACCOUNT_MACROS; macros specific to the current character are indexed from MAX_ACCOUNT_MACROS + 1 to MAX_ACCOUNT_MACROS + MAX_CHARACTER_MACROS.
Type: presenceID
PresenceID is a uniqe numerical value given to a player in your Battle.Net friends list. The value is persistent while you are logged in, zoning and entering/leaving instances but might change if you log out. This number is returned by the various CHAT_ MSG_ BN_ events and is used as an argument for the Battle.Net related functions.
Type: powerType
Index of different power types. The SPELLPOWER* global constants are deprecated and will be removed with the expansion after Legion. Use the contents of Enum.PowerType instead.
0- Mana (SPELL_POWER_MANAorEnum.PowerType.Mana)1- Rage (SPELL_POWER_RAGEorEnum.PowerType.Rage)2- Focus (SPELL_POWER_FOCUSorEnum.PowerType.Focus)3- Energy (SPELL_POWER_ENERGYorEnum.PowerType.Energy)4- Combo Points (SPELL_POWER_COMBO_POINTSorEnum.PowerType.ComboPoints)5- Runes (SPELL_POWER_RUNESorEnum.PowerType.Runes)6- Runic Power (SPELL_POWER_RUNIC_POWERorEnum.PowerType.RunicPower)7- Soul Shards (SPELL_POWER_SOUL_SHARDSorEnum.PowerType.SoulShards)8- Lunar Power (SPELL_POWER_LUNAR_POWERorEnum.PowerType.LunarPower)9- Holy Power (SPELL_POWER_HOLY_POWERorEnum.PowerType.HolyPower)10- Alternate Power (SPELL_POWER_ALTERNATE_POWERorEnum.PowerType.Alternate)11- Maelstrom (SPELL_POWER_MAELSTROMorEnum.PowerType.Maelstrom)12- Chi (SPELL_POWER_CHIorEnum.PowerType.Chi)13- Insanity (SPELL_POWER_INSANITYorEnum.PowerType.Insanity)14- unused (SPELL_POWER_OBSOLETEorEnum.PowerType.Obsolete)15- unused (SPELL_POWER_OBSOLETE2orEnum.PowerType.Obsolete2)16- Arcane Charges (SPELL_POWER_ARCANE_CHARGESorEnum.PowerType.ArcaneCharges)17- Fury (SPELL_POWER_FURYorEnum.PowerType.Fury)18- Pain (SPELL_POWER_PAINorEnum.PowerType.Pain)
Type: reportType
A string identifying a reportable offense. Passed to ReportPlayer(). Valid reportTypes as of 4.3.4 live:
- "spam" (
PLAYER_REPORT_TYPE_SPAM) - "language" (
PLAYER_REPORT_TYPE_LANGUAGE) - "badplayername" (
PLAYER_REPORT_TYPE_BAD_PLAYER_NAME) - "badguildname" (
PLAYER_REPORT_TYPE_BAD_GUILD_NAME) - "badarenaname" (
PLAYER_REPORT_TYPE_BAD_ARENA_TEAM_NAME) - "cheater" (
PLAYER_REPORT_TYPE_CHEATING)
These identifiers are stored as global strings - the associated global keys can be found in the frameXML Constants.lua by searching for PLAYER_REPORT_TYPE_.
Type: rollID
The default user interface assigns a unique numeric identifier for all items that are able to be rolled on by the party. This identifier can be obtained by checking the rollID member of the specific group loot frame. For example: /run print(GroupLootFrame1.rollID).
Type: specID
Global index of different specializations used by GetSpecializationInfoByID(), GetSpecializationRoleByID(), and returned by GetArenaOpponentSpec().
62- Mage: Arcane63- Mage: Fire64- Mage: Frost65- Paladin: Holy66- Paladin: Protection70- Paladin: Retribution71- Warrior: Arms72- Warrior: Fury73- Warrior: Protection102- Druid: Balance103- Druid: Feral104- Druid: Guardian105- Druid: Restoration250- Death Knight: Blood251- Death Knight: Frost252- Death Knight: Unholy253- Hunter: Beast Mastery254- Hunter: Marksmanship255- Hunter: Survival256- Priest: Discipline257- Priest: Holy258- Priest: Shadow259- Rogue: Assassination260- Rogue: Combat261- Rogue: Subtlety262- Shaman: Elemental263- Shaman: Enhancement264- Shaman: Restoration265- Warlock: Affliction266- Warlock: Demonology267- Warlock: Destruction268- Monk: Brewmaster269- Monk: Windwalker270- Monk: Mistweaver577- Demon Hunter: Havoc581- Demon Hunter: Vengeance
Type: spellbookID
Index of a spell in the player's (or pet's) spellbook; usable with APIs such as GetSpellInfo().
Type: spellID
Globally and uniquely identifies a spell (and its rank); usable with APIs such as GetSpellInfo(). Also useful with database sites; e.g. spell ID 47471.
Type: standingID
Identifies a level of reputation:
- Hated
- Hostile
- Unfriendly
- Neutral
- Friendly
- Honored
- Revered
- Exalted
The default UI provides constants which can be helpful in displaying standing information.
- The localized name for the standing N can be found in the global variable
FACTION_STANDING_LABELN orFACTION_STANDING_LABELN_FEMALE; e.g.FACTION_STANDING_LABEL4 == "Neutral". Note: though the male (unlabeled) and female forms are the same in theenUSclient, the same is not true for other languages -- be sure to use the appropriate form for the character's gender. - Color values for each standing (as seen in reputation status bars in the default UI) can be found in the table
FACTION_BAR_COLORS.
Type: unitID
Used throughout the API to identify units of interest. Possible values:
player- The player him/herselfpet- The player's petvehicle- The vehicle currently controlled by the playertarget- The player's current targetfocus- The player's focused unit (as can be set by typing/focus name)mouseover- The unit currently under the mouse cursor (applies to both unit frames and units in the 3D world)none- A valid unit token that always refers to no unit.UnitName()will return"Unknown, nil"for this UnitID. Use to force a macro to not auto self-cast (/cast [target=none] Healing Wave).npc- The unit the player is currently interacting with (via the Merchant, Trainer, Bank, or similar UI); not necessarily an NPC (e.g. also used in the Trade UI)party1toparty4- Another member of the player's party. Indices match the order party member frames are displayed in the default UI (party1is at the top,party4at the bottom), but not consistent among party members (i.e. if Thrall and Cairne are in the same party, the player Thrall sees asparty2may not be the same player Cairne sees asparty2).partypet1topartypet4- A pet belonging to another member of the player's partyraid1toraid40- A member of the player's raid group. Unlike with thepartytokens, one of theraidunit IDs will belong to the player. Indices have no relation to the arrangement of units in the default UI.raidpet1toraidpet40- A pet belonging to a member of the player's raid groupboss1toboss5- The active bosses of the current encounter if availablearena1toarena5- A member of the opposing team in an Arena matchnameplate1tonameplate40- A unit corresponding to a given nameplate. Cannot be used in macros
A unitID can also be formed by appending "target" to an existing unitID, referring to that unit's target. This can be done repeatedly. For example, consider a raid situation where the token raid13 refers to a priest: raid13target might be a rogue the priest is healing, raid13targettarget might be the boss monster the rogue is attacking, and raid13targettargettarget might be the warrior tanking the boss.
You can also append "pet" to a unitID to refer to that unit's pet, although it should only be appended once because pets cannot have pets. The unit pet is a shorter (and more efficient) way to write playerpet, but both refer to the same unit. raidpet1 is also the same as raid1pet. A very long unitID such as targettargetpettarget is valid, and will refer to the player's target if the player's target and the player's pet are targeting the player.
Many (but not all) API functions that accept a unitID also accept the name of a unit (assuming that unit is in the player's party or raid). For example, UnitHealth("Cladhaire") will return the same value as UnitHealth("party1") if the unit party1 is the player named Cladhaire. In such situations, a unit's target can still be accessed by appending "-target"; e.g. UnitHealth("Cladhaire-target").