Wowpedia

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

READ MORE

Wowpedia
Tag: WoW API docs
No edit summary
Tag: WoW API docs
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{wowapitype}}
 
{{wowapitype}}
Items can have an InventoryType / ItemEquipLoc that indicate in what [[InventorySlot]] they can be equipped.
+
Items can have an InventoryType / ItemEquipLoc that indicate in what [[InventorySlotId]] they can be equipped.
 
* InventoryType <small>(number)</small> is returned from {{api|C_Item.GetItemInventoryType}}()
 
* InventoryType <small>(number)</small> is returned from {{api|C_Item.GetItemInventoryType}}()
* ItemEquipLoc <small>(string)</small> is returned from {{api|GetItemInfo}}() and also doubles as a [https://www.townlong-yak.com/framexml/live/GlobalStrings.lua GlobalString]
+
* ItemEquipLoc <small>(string)</small> is returned from {{api|GetItemInfo}}() and also doubles as a [https://www.townlong-yak.com/framexml/9.0.2/GlobalStrings.lua#8852 GlobalString]
   
 
== Example ==
 
== Example ==
Prints item information for [[Red Winter Hat]]
+
Prints the inventory type for [[Red Winter Hat]], and the related ItemEquipLoc and globalstring.
 
<syntaxhighlight lang="lua">
 
<syntaxhighlight lang="lua">
 
local invType = C_Item.GetItemInventoryTypeByID(21524)
 
local invType = C_Item.GetItemInventoryTypeByID(21524)
Line 15: Line 15:
   
 
== Values ==
 
== Values ==
{{i-note|The range is [https://www.townlong-yak.com/framexml/8.2.0/Blizzard_APIDocumentation/ItemDocumentation.lua#438 documented] in Blizzard API Documentation as [0-28] but {{api|C_Transmog.GetSlotForInventoryType}}() and {{api|EJ_GetInvTypeSortOrder}}() use [1-29] instead.}}
+
{{i-note|The range is [https://www.townlong-yak.com/framexml/8.2.0/Blizzard_APIDocumentation/ItemDocumentation.lua#438 documented] in Blizzard API Documentation as [0-28] but {{api|C_Transmog.GetSlotForInventoryType}}() and {{api|EJ_GetInvTypeSortOrder}}() are off-by-one and use [1-29] instead.}}
<onlyinclude>{| class="sortable darktable zebra" style="margin-left: 2em"
+
<onlyinclude>{| class="sortable darktable zebra col1-center" style="margin-left: 2em"
 
|+ {{#if:{{{nocaption|}}}||[[Enum.InventoryType]]}}
 
|+ {{#if:{{{nocaption|}}}||[[Enum.InventoryType]]}}
! Value !! Key !! colspan="2" | ItemEquipLoc<br>GlobalString (enUS) !! colspan="2" | InventorySlot
+
! Value !! Key !! colspan="2" | ItemEquipLoc<br>GlobalString (enUS) !! colspan="2" | [[InvSlotId]]
 
|-
 
|-
| align="center" | 0 || IndexNonEquipType || INVTYPE_NON_EQUIP || Non-equippable ||
+
| 0 || IndexNonEquipType || INVTYPE_NON_EQUIP || Non-equippable ||
 
|-
 
|-
| align="center" | 1 || IndexHeadType || INVTYPE_HEAD || Head || 1
+
| 1 || IndexHeadType || INVTYPE_HEAD || Head || 1
 
|-
 
|-
| align="center" | 2 || IndexNeckType || INVTYPE_NECK || Neck || 2
+
| 2 || IndexNeckType || INVTYPE_NECK || Neck || 2
 
|-
 
|-
| align="center" | 3 || IndexShoulderType || INVTYPE_SHOULDER || Shoulder || 3
+
| 3 || IndexShoulderType || INVTYPE_SHOULDER || Shoulder || 3
 
|-
 
|-
| align="center" | 4 || IndexBodyType || INVTYPE_BODY || Shirt || 4
+
| 4 || IndexBodyType || INVTYPE_BODY || Shirt || 4
 
|-
 
|-
| align="center" | 5 || IndexChestType || INVTYPE_CHEST || Chest || 5
+
| 5 || IndexChestType || INVTYPE_CHEST || Chest || 5
 
|-
 
|-
| align="center" | 6 || IndexWaistType || INVTYPE_WAIST || Waist || 6
+
| 6 || IndexWaistType || INVTYPE_WAIST || Waist || 6
 
|-
 
|-
| align="center" | 7 || IndexLegsType || INVTYPE_LEGS || Legs || 7
+
| 7 || IndexLegsType || INVTYPE_LEGS || Legs || 7
 
|-
 
|-
| align="center" | 8 || IndexFeetType || INVTYPE_FEET || Feet || 8
+
| 8 || IndexFeetType || INVTYPE_FEET || Feet || 8
 
|-
 
|-
| align="center" | 9 || IndexWristType || INVTYPE_WRIST || Wrist || 9
+
| 9 || IndexWristType || INVTYPE_WRIST || Wrist || 9
 
|-
 
|-
| align="center" | 10 || IndexHandType || INVTYPE_HAND || Hands || 10
+
| 10 || IndexHandType || INVTYPE_HAND || Hands || 10
 
|-
 
|-
| align="center" | 11 || IndexFingerType || INVTYPE_FINGER || Finger || 11, 12
+
| 11 || IndexFingerType || INVTYPE_FINGER || Finger || 11, 12
 
|-
 
|-
| align="center" | 12 || IndexTrinketType || INVTYPE_TRINKET || Trinket || 13, 14
+
| 12 || IndexTrinketType || INVTYPE_TRINKET || Trinket || 13, 14
 
|-
 
|-
| align="center" | 13 || IndexWeaponType || INVTYPE_WEAPON || One-Hand || 16 (17, [[Dual wield]])
+
| 13 || IndexWeaponType || INVTYPE_WEAPON || One-Hand || 16, 17: [[Dual wield]]
 
|-
 
|-
| align="center" | 14 || IndexShieldType || INVTYPE_SHIELD || Off Hand || 17
+
| 14 || IndexShieldType || INVTYPE_SHIELD || Off Hand || 17
 
|-
 
|-
| align="center" | 15 || IndexRangedType || INVTYPE_RANGED || Ranged || 16
+
| 15 || IndexRangedType || INVTYPE_RANGED || Ranged || 16
 
|-
 
|-
| align="center" | 16 || IndexCloakType || INVTYPE_CLOAK || Back || 15
+
| 16 || IndexCloakType || INVTYPE_CLOAK || Back || 15
 
|-
 
|-
| align="center" | 17 || Index2HweaponType || INVTYPE_2HWEAPON || Two-Hand || 16
+
| 17 || Index2HweaponType || INVTYPE_2HWEAPON || Two-Hand || 16
 
|-
 
|-
| align="center" | 18 || IndexBagType || INVTYPE_BAG || Bag ||
+
| 18 || IndexBagType || INVTYPE_BAG || Bag ||
 
|-
 
|-
| align="center" | 19 || IndexTabardType || INVTYPE_TABARD || Tabard || 19
+
| 19 || IndexTabardType || INVTYPE_TABARD || Tabard || 19
 
|-
 
|-
| align="center" | 20 || IndexRobeType || INVTYPE_ROBE || Chest || 5
+
| 20 || IndexRobeType || INVTYPE_ROBE || Chest || 5
 
|-
 
|-
| align="center" | 21 || IndexWeaponmainhandType || INVTYPE_WEAPONMAINHAND || Main Hand || 16
+
| 21 || IndexWeaponmainhandType || INVTYPE_WEAPONMAINHAND || Main Hand || 16
 
|-
 
|-
| align="center" | 22 || IndexWeaponoffhandType || INVTYPE_WEAPONOFFHAND || Off Hand || 16
+
| 22 || IndexWeaponoffhandType || INVTYPE_WEAPONOFFHAND || Off Hand || 16
 
|-
 
|-
| align="center" | 23 || IndexHoldableType || INVTYPE_HOLDABLE || Held In Off-hand || 17
+
| 23 || IndexHoldableType || INVTYPE_HOLDABLE || Held In Off-hand || 17
 
|-
 
|-
| align="center" | 24 || IndexAmmoType || INVTYPE_AMMO || Ammo ||
+
| 24 || IndexAmmoType || INVTYPE_AMMO || Ammo ||
 
|-
 
|-
| align="center" | 25 || IndexThrownType || INVTYPE_THROWN || Thrown || 16
+
| 25 || IndexThrownType || INVTYPE_THROWN || Thrown || 16
 
|-
 
|-
| align="center" | 26 || IndexRangedrightType || INVTYPE_RANGEDRIGHT || Ranged || 16
+
| 26 || IndexRangedrightType || INVTYPE_RANGEDRIGHT || Ranged || 16
 
|-
 
|-
| align="center" | 27 || IndexQuiverType || INVTYPE_QUIVER || Quiver ||
+
| 27 || IndexQuiverType || INVTYPE_QUIVER || Quiver ||
 
|-
 
|-
| align="center" | 28 || IndexRelicType || INVTYPE_RELIC || Relic ||
+
| 28 || IndexRelicType || INVTYPE_RELIC || Relic ||
 
|}</onlyinclude>
 
|}</onlyinclude>
  +
  +
== Patch changes ==
  +
* {{Patch 8.0.1|note=Added <code>Enum.InventoryType</code>}}

Revision as of 16:49, 2 December 2021

Items can have an InventoryType / ItemEquipLoc that indicate in what InventorySlotId they can be equipped.

Example

Prints the inventory type for Inv helmet 67 [Red Winter Hat], and the related ItemEquipLoc and globalstring.

local invType = C_Item.GetItemInventoryTypeByID(21524)
print(invType) -- 1

local equipLoc = select(9, GetItemInfo(21524))
print(equipLoc, _G[equipLoc]) -- "INVTYPE_HEAD", "Head"

Values

Note
Note: The range is documented in Blizzard API Documentation as [0-28] but C_Transmog.GetSlotForInventoryType() and EJ_GetInvTypeSortOrder() are off-by-one and use [1-29] instead.
Enum.InventoryType
Value Key ItemEquipLoc
GlobalString (enUS)
InvSlotId
0 IndexNonEquipType INVTYPE_NON_EQUIP Non-equippable
1 IndexHeadType INVTYPE_HEAD Head 1
2 IndexNeckType INVTYPE_NECK Neck 2
3 IndexShoulderType INVTYPE_SHOULDER Shoulder 3
4 IndexBodyType INVTYPE_BODY Shirt 4
5 IndexChestType INVTYPE_CHEST Chest 5
6 IndexWaistType INVTYPE_WAIST Waist 6
7 IndexLegsType INVTYPE_LEGS Legs 7
8 IndexFeetType INVTYPE_FEET Feet 8
9 IndexWristType INVTYPE_WRIST Wrist 9
10 IndexHandType INVTYPE_HAND Hands 10
11 IndexFingerType INVTYPE_FINGER Finger 11, 12
12 IndexTrinketType INVTYPE_TRINKET Trinket 13, 14
13 IndexWeaponType INVTYPE_WEAPON One-Hand 16, 17: Dual wield
14 IndexShieldType INVTYPE_SHIELD Off Hand 17
15 IndexRangedType INVTYPE_RANGED Ranged 16
16 IndexCloakType INVTYPE_CLOAK Back 15
17 Index2HweaponType INVTYPE_2HWEAPON Two-Hand 16
18 IndexBagType INVTYPE_BAG Bag
19 IndexTabardType INVTYPE_TABARD Tabard 19
20 IndexRobeType INVTYPE_ROBE Chest 5
21 IndexWeaponmainhandType INVTYPE_WEAPONMAINHAND Main Hand 16
22 IndexWeaponoffhandType INVTYPE_WEAPONOFFHAND Off Hand 16
23 IndexHoldableType INVTYPE_HOLDABLE Held In Off-hand 17
24 IndexAmmoType INVTYPE_AMMO Ammo
25 IndexThrownType INVTYPE_THROWN Thrown 16
26 IndexRangedrightType INVTYPE_RANGEDRIGHT Ranged 16
27 IndexQuiverType INVTYPE_QUIVER Quiver
28 IndexRelicType INVTYPE_RELIC Relic

Patch changes