Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Tag: WoW API docs
Tag: WoW API docs
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{wowapitype}}
 
{{wowapitype}}
Inventory slots refer to a unique [[equipment]] or [[bag]] slot.
+
Inventory slots refer to a unique [[equipment]] or [[BagID|bag]] slot.
   
 
* For equipment, slot names are resolved to a slot id [https://www.townlong-yak.com/framexml/9.0.2/Constants.lua#192 constant] with {{api|GetInventorySlotInfo}}(). This gives Blizzard more flexibility to possibly change slot ids.
 
* For equipment, slot names are resolved to a slot id [https://www.townlong-yak.com/framexml/9.0.2/Constants.lua#192 constant] with {{api|GetInventorySlotInfo}}(). This gives Blizzard more flexibility to possibly change slot ids.
 
* InventorySlotName also doubles as a [https://wow.tools/dbc/?dbc=globalstrings#search=SLOT GlobalString]
 
* InventorySlotName also doubles as a [https://wow.tools/dbc/?dbc=globalstrings#search=SLOT GlobalString]
   
== Equipment ==
+
==Equipment==
 
[[Image:InventorySlots.jpg|thumb|Graphical Explanation (Classic)]]
 
[[Image:InventorySlots.jpg|thumb|Graphical Explanation (Classic)]]
 
Example: prints the InventorySlotId for an InventorySlotName, and the related globalstring and constant.
 
Example: prints the InventorySlotId for an InventorySlotName, and the related globalstring and constant.
Line 58: Line 58:
 
|}
 
|}
   
== Bags ==
+
==Bags==
 
Slot ids for bags are returned from {{api|ContainerIDToInventoryID}}()
There are also InvSlotNames for each bag.
 
<syntaxhighlight lang="lua">
 
/dump GetInventorySlotInfo("BAG0SLOT") -- 20
 
</syntaxhighlight>
 
{| class="sortable darktable zebra"
 
|-
 
! InvSlotName !! InvSlotId
 
|-
 
| BAG0SLOT || align="center" | 20
 
|-
 
| BAG1SLOT || align="center" | 21
 
|-
 
| BAG2SLOT || align="center" | 22
 
|-
 
| BAG3SLOT || align="center" | 23
 
|}
 
Slot ids for bags and containers are returned from {{api|ContainerIDToInventoryID}}()
 
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
-- Constants
 
-- Constants
Line 87: Line 71:
 
ContainerIDToInventoryID(NUM_BAG_SLOTS + NUM_BANKBAGSLOTS) -- 86 (7th bank bag)
 
ContainerIDToInventoryID(NUM_BAG_SLOTS + NUM_BANKBAGSLOTS) -- 86 (7th bank bag)
 
</syntaxhighlight>
 
</syntaxhighlight>
  +
 
Slot ids for the stock containers in the bank are returned from {{api|BankButtonIDToInvSlotID}}()
 
<syntaxhighlight lang="lua">
 
-- Constants
 
NUM_BANKGENERIC_SLOTS = 28; -- 24 in classic
  +
 
-- Example (retail)
 
BankButtonIDToInvSlotID(1) -- 52 (first bank container slot)
 
BankButtonIDToInvSlotID(NUM_BANKGENERIC_SLOTS) -- 79 (last bank container slot)
 
</syntaxhighlight>
  +
 
<onlyinclude>{| class="sortable darktable zebra"
 
<onlyinclude>{| class="sortable darktable zebra"
 
|-
 
|-
! ID !! Vanilla<br>1.13.7 !! Vanilla<br>1.14.0 !! BCC<br>2.5.2 !! Retail !! Description
+
! ID !! Vanilla<br>1.13.7 !! Vanilla<br>1.14.0 !! TBC<br>2.5.2 !! Retail !! Description
 
|-
 
|-
 
| <center>1</center> || colspan="4" | <center>20</center> || 1st character bag
 
| <center>1</center> || colspan="4" | <center>20</center> || 1st character bag
Line 99: Line 94:
 
| <center>4</center> || colspan="4" | <center>23</center> || 4th character bag
 
| <center>4</center> || colspan="4" | <center>23</center> || 4th character bag
 
|-
 
|-
| || <center>48-71</center> || <center>48-71</center> || <center>48-75</center> || <center>52-79</center> || bank slots (classic: 24, bcc/retail: 28)
+
| || <center>48-71</center> || <center>48-71</center> || <center>48-75</center> || <center>52-79</center> || bank slots (vanilla: 24, bcc/retail: 28)
 
|-
 
|-
 
| <center>5</center> || <center>72</center> || <center>76</center> || <center>76</center> || <center>80</center> || 1st bank bag
 
| <center>5</center> || <center>72</center> || <center>76</center> || <center>76</center> || <center>80</center> || 1st bank bag
Line 116: Line 111:
 
|}</onlyinclude>
 
|}</onlyinclude>
   
  +
===Bag InvSlotNames===
== Generic bank containers ==
 
Slot ids for the stock containers in the bank are returned from {{api|BankButtonIDToInvSlotID}}()
 
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
/dump GetInventorySlotInfo("BAG0SLOT") -- 20
-- Constants
 
  +
</syntaxhighlight>
NUM_BANKGENERIC_SLOTS = 28; -- 24 in classic
 
 
{| class="sortable darktable zebra col2-center"
 
|-
 
! InvSlotName !! InvSlotId
 
|-
 
| BAG0SLOT || 20
 
|-
 
| BAG1SLOT || 21
 
|-
 
| BAG2SLOT || 22
 
|-
 
| BAG3SLOT || 23
 
|}
   
  +
<syntaxhighlight lang="lua">
-- Example (retail)
 
  +
/dump GetInventorySlotInfo("BAG1") -- 64
BankButtonIDToInvSlotID(1) -- 52 -- first bank container slot
 
BankButtonIDToInvSlotID(NUM_BANKGENERIC_SLOTS) -- 79 -- last bank container slot
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  +
{| class="sortable darktable zebra col2-center"
  +
|-
  +
! InvSlotName !! InvSlotId
  +
|-
  +
| BAG1 || 64
  +
|-
  +
| BAG2 || 65
  +
|-
  +
| BAG3 || 66
  +
|-
  +
| BAG4 || 67
  +
|-
  +
| BAG5 || 68
  +
|-
  +
| BAG6 || 69
  +
|-
  +
| BAG7 || 70
  +
|-
  +
| BAG8 || 71
  +
|-
  +
| BAG9 || 72
  +
|-
  +
| BAG10 || 73
  +
|-
  +
| BAG11 || 74
  +
|-
  +
| BAG12 || 75
  +
|}
   
 
== Patch changes ==
 
== Patch changes ==
Line 132: Line 165:
 
== See also ==
 
== See also ==
 
* [[Enum.InventoryType]]
 
* [[Enum.InventoryType]]
  +
* {{api|GetFirstBagBankSlotIndex}}()
   
 
[[Category:Macros]]
 
[[Category:Macros]]

Revision as of 00:18, 6 November 2021

Inventory slots refer to a unique equipment or bag slot.

  • For equipment, slot names are resolved to a slot id constant with GetInventorySlotInfo(). This gives Blizzard more flexibility to possibly change slot ids.
  • InventorySlotName also doubles as a GlobalString

Equipment

InventorySlots

Graphical Explanation (Classic)

Example: prints the InventorySlotId for an InventorySlotName, and the related globalstring and constant.

/dump GetInventorySlotInfo("SHOULDERSLOT") -- 3
/dump SHOULDERSLOT -- "Shoulders" (slot name doubles as a globalstring)
/dump INVSLOT_SHOULDER -- 3 (the related constant)
InvSlotName
GlobalString (enUS)
InvSlotId Constant
AMMOSLOT WoW Icon update Ammo 0 INVSLOT_AMMO
HEADSLOT Head 1 INVSLOT_HEAD
NECKSLOT Neck 2 INVSLOT_NECK
SHOULDERSLOT Shoulders 3 INVSLOT_SHOULDER
SHIRTSLOT Shirt 4 INVSLOT_BODY
CHESTSLOT Chest 5 INVSLOT_CHEST
WAISTSLOT Waist 6 INVSLOT_WAIST
LEGSSLOT Legs 7 INVSLOT_LEGS
FEETSLOT Feet 8 INVSLOT_FEET
WRISTSLOT Wrist 9 INVSLOT_WRIST
HANDSSLOT Hands 10 INVSLOT_HAND
FINGER0SLOT Finger 11 INVSLOT_FINGER1
FINGER1SLOT Finger 12 INVSLOT_FINGER2
TRINKET0SLOT Trinket 13 INVSLOT_TRINKET1
TRINKET1SLOT Trinket 14 INVSLOT_TRINKET2
BACKSLOT Back 15 INVSLOT_BACK
MAINHANDSLOT Main Hand 16 INVSLOT_MAINHAND
SECONDARYHANDSLOT Off Hand 17 INVSLOT_OFFHAND
RANGEDSLOT WoW Icon update Ranged 18 INVSLOT_RANGED
TABARDSLOT Tabard 19 INVSLOT_TABARD

Bags

Slot ids for bags are returned from ContainerIDToInventoryID()

-- Constants
NUM_BAG_SLOTS = 4;
NUM_BANKBAGSLOTS = 7; -- 6 in vanilla

-- Example (retail)
ContainerIDToInventoryID(1)                                -- 20 (1st character bag, the rightmost one)
ContainerIDToInventoryID(NUM_BAG_SLOTS)                    -- 23 (4th character bag, the leftmost one) 
ContainerIDToInventoryID(NUM_BAG_SLOTS + 1)                -- 80 (1st bank bag)
ContainerIDToInventoryID(NUM_BAG_SLOTS + NUM_BANKBAGSLOTS) -- 86 (7th bank bag)

Slot ids for the stock containers in the bank are returned from BankButtonIDToInvSlotID()

-- Constants
NUM_BANKGENERIC_SLOTS = 28; -- 24 in classic

-- Example (retail)
BankButtonIDToInvSlotID(1)                     -- 52 (first bank container slot)
BankButtonIDToInvSlotID(NUM_BANKGENERIC_SLOTS) -- 79 (last bank container slot)
ID Vanilla
1.13.7
Vanilla
1.14.0
TBC
2.5.2
Retail Description
1
20
1st character bag
2
21
2nd character bag
3
22
3rd character bag
4
23
4th character bag
48-71
48-71
48-75
52-79
bank slots (vanilla: 24, bcc/retail: 28)
5
72
76
76
80
1st bank bag
6
73
77
77
81
2nd bank bag
7
74
78
78
82
3rd bank bag
8
75
79
79
83
4th bank bag
9
76
80
80
84
5th bank bag
10
77
81
81
85
6th bank bag
11
82
86
7th bank bag

Bag InvSlotNames

/dump GetInventorySlotInfo("BAG0SLOT") -- 20
InvSlotName InvSlotId
BAG0SLOT 20
BAG1SLOT 21
BAG2SLOT 22
BAG3SLOT 23
/dump GetInventorySlotInfo("BAG1") -- 64
InvSlotName InvSlotId
BAG1 64
BAG2 65
BAG3 66
BAG4 67
BAG5 68
BAG6 69
BAG7 70
BAG8 71
BAG9 72
BAG10 73
BAG11 74
BAG12 75

Patch changes

  • Battle for Azeroth Patch 8.3.0 (2020-01-14): Slot ids for bank bags start from 80 instead of 76.

See also