LibItemUpgradeInfo-1.0

LibItemUpgradeInfo-1.0 provides information about item upgrades applied to items.


Functions

:GetUpgradeID(itemString)

Arguments

itemString
String - An itemLink or itemString denoting the item

Returns

upgradeID
Number - The upgrade ID (possibly 0), or nil if the input is invalid or does not contain upgrade info

 

:GetCurrentUpgrade(id)

Returns the current upgrade level of the item, e.g. 1 for a 1/2 item.

Arguments

id
Number - The upgrade ID of the item (obtained via GetUpgradeID())

Returns

upgradeLevel
Number - The current upgrade level of the item, or nil if the item cannot be upgraded

 

:GetMaximumUpgrade(id)

Returns the maximum upgrade level of the item, e.g. 2 for a 1/2 item.

Arguments

id
Number - The upgrade ID of the item (obtained via GetUpgradeID())

Returns

upgradeLevel
Number - The maximum upgrade level of the item, or nil if the item cannot be upgraded

 

:GetItemLevelUpgrade(id)

Returns the item level increase that this upgrade is worth, e.g. 4 for a 1/2 item or 8 for a 2/2 item.

Arguments

id
Number - The upgrade ID of the item (obtained via GetUpgradeID())

Returns

ilvlDelta
Number - The item level increase of the item, or 0 if the item cannot be or has not been upgraded

 

:GetItemUpgradeInfo(itemString)

Returns the current upgrade level, maximum upgrade level, and item level increase for an item.

Arguments

itemString
String - An itemLink or itemString denoting the item

Returns

nil if the item is invalid or cannot be upgraded, otherwise:

curUpgradeLevel
Number - The current upgrade level of the item
maxUpgradeLevel
Number - The maximum upgrade level of the item
lvlDelta
Number - The item level increase of the item

 

:GetHeirloomTrueLevel(itemString)

Returns the true item level for an heirloom.

Arguments

itemString
String - An itemLink or itemString denoting the item

Returns

ilvl
Number - The true item level of the item, or nil if the input is invalid
isTrue
Boolean - true if the returned item level is the "true" item level of an heirloom, or false if the item was not an heirloom or some error occurred while scanning the tooltip.

 

:GetUpgradedItemLevel(itemString)

Returns the true item level of the item, including upgrades and heirlooms.

Arguments

itemString
String - An itemLink or itemString denoting the item

Returns

ilvl
Number - The true item level of the item, or nil if the input is invalid

 

:IsBop(itemString)

Checks if an item is Bind On Pikcup.

Arguments

itemString
String - An itemLink or itemString denoting the item

Returns

flag
Boolean - True if item is Bind on Pickup

 

:IsBoe(itemString)

Checks if an item is Bind On Equip.

Arguments

itemString
String - An itemLink or itemString denoting the item

Returns

flag
Boolean - True if item is Bind on Equip

Example

local ItemUpgradeInfo = LibStub("LibItemUpgradeInfo-1.0")
local item = GetInventoryItemLink("player", 1)
local upgrade, max, delta = ItemUpgradeInfo:GetItemUpgradeInfo(item)
if upgrade then
	local ilvl = ItemUpgradeInfo:GetUpgradedItemLevel(item)
	DEFAULT_CHAT_FRAME:AddMessage(("%s %d/%d (+%d -> %d)"):format(item, upgrade, max, delta, ilvl))
else
	DEFAULT_CHAT_FRAME:AddMessage(item .. " cannot be upgraded")
end

 

Same code using the GetItemUpgradeInfo() convenience function:

local ItemUpgradeInfo = LibStub("LibItemUpgradeInfo-1.0")
local item = GetInventoryItemLink("player", 1)
local upgrade, max, delta = ItemUpgradeInfo:GetItemUpgradeInfo(item)
if upgrade then
	local ilvl = ItemUpgradeInfo:GetUpgradedItemLevel(item)
	DEFAULT_CHAT_FRAME:AddMessage(("%s %d/%d (+%d -> %d)"):format(item, upgrade, max, delta, ilvl))
else
	DEFAULT_CHAT_FRAME:AddMessage(item .. " cannot be upgraded")
end

 


Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes

About This Project

  • Project ID
    52100
  • Created
    Feb 14, 2013
  • Last Released File
    Oct 17, 2020
  • Total Downloads
    63,231
  • License

Categories

Members

Recent Files