WoW:API GetItemInfo: Difference between revisions

Adding reference to the new 11th return value for vendor price.
(Updated return value for itemRarity to include Heirlooms)
(Adding reference to the new 11th return value for vendor price.)
Line 2: Line 2:
Return information about a specific item.
Return information about a specific item.
  itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount,
  itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount,
  itemEquipLoc, itemTexture = GetItemInfo(itemID or "itemString" or "itemName" or "itemLink")  
  itemEquipLoc, itemTexture, itemSellPrice = GetItemInfo(itemID or "itemString" or "itemName" or "itemLink")  


== Parameters ==
== Parameters ==
Line 28: Line 28:
:;[[itemEquipLoc]] : String - Where the item may be equipped, if it can. If not equippable, this is an empty string, "". The string returned is also the name of a global string variable, i.e. for "INVTYPE_HEAD", _G["INVTYPE_HEAD"] is a localized, displayable name of the location.
:;[[itemEquipLoc]] : String - Where the item may be equipped, if it can. If not equippable, this is an empty string, "". The string returned is also the name of a global string variable, i.e. for "INVTYPE_HEAD", _G["INVTYPE_HEAD"] is a localized, displayable name of the location.
:;itemTexture : String - The name and path for the inventory icon texture for the item.
:;itemTexture : String - The name and path for the inventory icon texture for the item.
:;itemSellPrice : Integer - Items vendor value, in copper. Will need to be parsed into gold, silver, copper. Format ggggsscc.


== Example ==
== Example ==
  local sName, sLink, iRarity, iLevel, iMinLevel, sType, sSubType, iStackCount = GetItemInfo(16846);
  local sName, sLink, iRarity, iLevel, iMinLevel, sType, sSubType, iStackCount, iSellPrice = GetItemInfo(16846);
  message(sName..","..iRarity..","..sType..","..iStackCount);
  message(sName..","..iRarity..","..sType..","..iStackCount);


Line 40: Line 41:
: If you have never seen the item that belongs to the Item ID or Item Link it will return ''nil''.
: If you have never seen the item that belongs to the Item ID or Item Link it will return ''nil''.
: All string returns (itemName, itemType, itemSubType) are localized. Prior to 1.9, itemEquipLoc was localized also.
: All string returns (itemName, itemType, itemSubType) are localized. Prior to 1.9, itemEquipLoc was localized also.
: As of Patch 3.2 the 11th returned value is the Vendor Sell Price for that item.


== Common usage ==
== Common usage ==


local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemTexture = GetItemInfo(link)
local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemCount, itemEquipLoc, itemTexture, itemSellPrice = GetItemInfo(link)
Anonymous user