Thread Tools Display Modes
Prev Previous Post   Next Post Next
Unread 12-06-12, 10:18 AM   #1
Jarod24
A Cyclonian
AddOn Author - Click to view addons
Join Date: Jul 2012
Posts: 48
Upgraded items and GetItemInfo()

I'm having an issue when getting the itemlevel values of specific items for the player or whatever you are /inspecting and the item has been upgraded (the feature added in patch 5.1).

Using GetAverageItemLevel() is not an option here since that only returns the values for what the player is currently wearing and will not work with /inspected players.

If you call GetItemInfo() or GetItemStats() they will just return the base itemlevel and stats for the item even if you use a itemlink for your specfically upgraded/enchanted/gemmed item.

Example:
Code:
function foo()
	--lookup the players mainhand weapon (slotid==16)
	local slot		= 16;
	local _, itemBasic	= GetItemInfo( GetInventoryItemID("player", slot) ); --get the basic itemlink just using itemID
	local itemUpgraded	= GetInventoryItemLink("player", slot); --get the itemlink for the specific item that the player has equipped with enchants, gems, upgrades, everything.
	
	print("basic:"..itemBasic);
	print("upgraded:"..itemUpgraded);
	--if you just compare the two links you see that their info is different, and clicking on them they show different info.
	
	local infoBasic		= GetItemInfo(itemBasic);
	local infoUpgraded	= GetItemInfo(itemUpgraded);
	--these two will return the exact same results even tho the itemlink-data isnt the exact same
	
	local statBasic		= GetItemStats(itemBasic);
	local statUpgraded	= GetItemStats(itemUpgraded);
	--these two will also return the exact same results even tho the itemlink's are not the same
	
	local delta = GetItemStatDelta(itemBasic, itemUpgraded);
	--this will return an empty table; presumably it thinks the items are identical aswell.
	
	return itemBasic, itemUpgraded, infoBasic, infoUpgraded, statBasic, statUpgraded, delta;
end
I have been looking into the Blizzard_ItemUpgradeUI.lua and PaperDollFrame.lua for ideas on how to solve this but it seems that whomever coded that did not think of non-UI options, (functions like GetItemUpgradeItemInfo() do not accept input arguments but instead is hardcoded to only return stats for the item currently placed in the upgrade-UI).

In my head, the fact that GetItemStats() and GetItemInfo() returns the same data for 2 different links is a bug that Blizzard should fix (but how likely is that to happen). Yes; the link is refering to the same itemID, but it should consider enchants, gems, reforge, upgrades and so on.


So; Anyone got a suggestion for how to get the correct itemlevel for items, or is there no way to get this done?

(edit: parsing tooltips to get the itemlevel isnt an option)
__________________
Author of IfThen, Links in Chat, LinkTranslator, SetGuildRank, CompressMacro
Jarod24 is offline  
 

Go BackWoWInterface » WoD Beta » MoP archived threads » Upgraded items and GetItemInfo()

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off