Originally Posted by semlar
Maybe this will help, I'm copying it here in case something happens to the original.
From Ro on http://us.battle.net/wow/en/forum/topic/7199032730#9:
Lua Code:
function GetActualItemLevel(link) local levelAdjust={ -- 11th item:id field and level adjustment ["0"]=0,["1"]=8,["373"]=4,["374"]=8,["375"]=4,["376"]=4, ["377"]=4,["379"]=4,["380"]=4,["445"]=0,["446"]=4,["447"]=8, ["451"]=0,["452"]=8,["453"]=0,["454"]=4,["455"]=8,["456"]=0, ["457"]=8,["458"]=0,["459"]=4,["460"]=8,["461"]=12,["462"]=16} local baseLevel = select(4,GetItemInfo(link)) local upgrade = link:match(":(%d+)\124h%[") if baseLevel and upgrade then return baseLevel + levelAdjust[upgrade] else return baseLevel end end
Probably less reliable than just pulling the item level straight out of the tooltip.
|
Ok... wow... Having to do this amount of testing & work just to return the itemlevel tells me that Blizzard really need to get GetItemInfo() and GetItemStats() fixed so that they work as you should expect when passing in itemlinks to them.
It would reduce the overhead of lua code in addons as well as the need for tooltip scanning that should only go to improve the general performance of the game too (doing less is really, really efficient).