Lore archive · Warcraft Wiki, 2023 dump
API GetInventoryItemCount
Last wiki revision 2022-07-29
Determine the quantity of an item in an inventory slot. count = GetInventoryItemCount(unit, invSlotId)
- unit: : UnitId - The unit whose inventory is to be queried.
- invSlotId: : InventorySlotId - to be queried, obtained via GetInventorySlotInfo.
- count: - Returns 1 on empty slots (Thus, on empty ammo slot, 1 is returned). For containers (Bags, etc.), this returns the number of items stored inside the container (Thus, empty containers return 0). Under all other conditions, this function returns the amount of items in the specified slot.
local ammoSlot = GetInventorySlotInfo("AmmoSlot"); local ammoCount = GetInventoryItemCount("player", ammoSlot); if ((ammoCount == 1) and (not GetInventoryItemTexture("player", ammoSlot))) then ammoCount = 0; end;
Source
https://warcraft.wiki.gg/wiki/API_GetInventoryItemCount · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.