Returns a summary of the difference in stat bonuses between two items. Keys in the table returned are the names of global variables containing the localized names of the stats (e.g. _G["ITEM_MOD_SPIRIT_SHORT"] = "Spirit", _G["ITEM_MOD_HIT_RATING_SHORT"] = "Hit Rating").

The optional argument returnTable allows for performance optimization in cases where this function is expected to be called repeatedly. Rather than creating new tables each time the function is called (eventually requiring garbage collection), an existing table can be recycled. (Note, however, that this function does not clear the table's contents; use wipe() first to guarantee consistent results.)


See also Item functions.

Signature:

statTable = GetItemStatDelta("item1Link", "item2Link" [, returnTable])

Arguments:

  • item1Link - An item's hyperlink, or any string containing the itemString portion of an item link (string, hyperlink)
  • item2Link - Another item's hyperlink, or any string containing the itemString portion of an item link (string, hyperlink)
  • returnTable - Reference to a table to be filled with return values (table)

Returns:

  • statTable - A table listing the difference in stat bonuses provided by the items (i.e. if item1Link is equipped, what changes to the player's stats would occur if it is replaced by item2Link) (table)

Examples:

-- links to some early death knight gear for illustrating the example...
local _, ring1Link = GetItemInfo("Valanar's Signet Ring")
local _, ring2Link = GetItemInfo("Keleseth's Signet Ring")

local statDelta = GetItemStatDelta(ring1Link, ring2Link)
for stat, value in pairs(statDelta) do print(value, _G[stat]) end
-- prints (approximately, on enUS client):
--   12 Critical Strike Rating
--   -6 Strength
--   -6 Hit Rating
--   3 Stamina