WoW:API GetItemStats: Difference between revisions

(Creating the page.)
 
Line 16: Line 16:
== Example ==
== Example ==


The key for each entry in the hashtable is the name of a constant in Interface\FrameXML\GlobalStrings.lua, and the value of that constant is the localized name for the stat. For example, an item that has 10 Stamina and no other stats would return <code>{ "ITEM_MOD_STAMINA_SHORT" = 10 }</code>.
The key for each entry in the hashtable is the name of a constant in Interface\FrameXML\GlobalStrings.lua. For example, an item that has 10 Stamina and no other stats would return <code>{ "ITEM_MOD_STAMINA_SHORT" = 10 }</code>.


  stats = GetItemStats(GetInventoryItemLink("player", 16))
  stats = GetItemStats(GetInventoryItemLink("player", 16))
Line 26: Line 26:
  Your main hand item has 10 Stamina.
  Your main hand item has 10 Stamina.


The stat table contains the stats for the "base" version of an item, without any enchantments or gems. There is no way to get the stats for the gemmed and enchanted version of an item.
The stat table contains the stats for the "base" version of an item, without any enchantments or gems. There is no way to get the stats for the gemmed and enchanted version of an item.


== Details ==
== Details ==
Anonymous user