WoW API: GetEquipmentSetLocations

Revision as of 22:07, 2 September 2009 by WoWWiki>Adron (Created page with '{{wowapi}} Populates a table with the location/status of each slot in the specified equipment set. infoArray = GetEquipmentSetLocations("name"); ==Arguments== ;"name" : String …')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

WoW API < GetEquipmentSetLocations

Populates a table with the location/status of each slot in the specified equipment set.

infoArray = GetEquipmentSetLocations("name");

Arguments

"name"
String - equipment set name to retrieve information about.

Returns

infoArray
Table - the array portion of this table contains information on each of the slots for the set.
0: Ammo
1: Head
2: Neck
3: Shoulder
4: Shirt
5: Chest
6: Belt
7: Legs
8: Feet
9: Wrist
10: Gloves
11: Finger 1
12: Finger 2
13: Trinket 1
14: Trinket 2
15: Back
16: Mmain hand
17: Off hand
18: Ranged
19: Tabard

Notes

A value of 0 for a slot means the slot should be emptied. A value of 1 means the slot is not part of the set (don't change it). A value of -1 means the slot should contain an item but it is not available.

Other values indicate that the slot should contain an item and identifies it as the following:

local locationtype = bit.rshift(value, 16);
if locationtype == 0x10 then
  // Equipped
  local slot = bit.band(value, 0xff);
elseif locationtype == 0x30 then
  // In bag
  local bag = bit.band(bit.rshift(value, 8), 0xff);
  local slot = bit.band(value, 0xff);
elseif locationtype == 0x40 then
  // In bank
  local slot = bit.band(value, 0xff);
elseif locationtype == 0x60 then
  // In bank bags (1 to 7, i.e. add NUM_BAG_SLOTS to use as a BagId)
  local bag = bit.band(bit.rshift(value, 8), 0xff);
  local slot = bit.band(value, 0xff);
end