Get the Desktop App for Battle.net Now
- All your games in 1 place
- Log in once
- Automatic game updates
How can you get the Item Level of an upgraded item? I upgraded my 463 shoulders to 471 but GetItemInfo() is still returning 463.
/dump GetInventoryItemLink('player', INVSLOT_SHOULDER);
="|cff0070dd|Hitem:81287:4805:4585:0:0:0:0:-2058788992:90:126:452|h[Spaulders of Immovable Stone]|h|r"
/dump GetItemInfo(GetInventoryItemLink('player', INVSLOT_SHOULDER))
="Spaulders of Immovable Stone",
="|cff0070dd|Hitem:81287:4805:4585:0:0:0:0:-2058788992:90:126:452|h[Spaulders of Immovable Stone]|h|r",
You item string example maps as follows:
So I assume it's either buried in the suffixId or in the "unknown".
BTW: We need both the ability to get the "upgraded" iLevel AND STATS of an item, but we also need the ability to query the currently used and max possible upgrades on an item. It's in the tooltips so the data's there, but official API functions instead of itemString parsing would be very, very helpful.
Its the unknown value but how it translates is still unknown. We figured this out last night in #wowuidev using a 509 Heroic Shoulder
Edited by Scotepi on 11/28/2012 8:16 PM PST
FYI: I don't think the unknown values map to an exact iLevel. For example, I upgraded my 463 Lightbreaker Greatsword from 0/1 and it got unknown 452 with 1/1 and iLevel 471.
Maybe it's more like 452 means 1/1 upgrade slots filled on Rare quality item by Justice Points causing +8 iLevel increase...
Here is some in-game testing and not using a for loop
Yeah this is a good thing for blues to get word back from the devs.
One possible idea of getting a larger sample size across levels is looping through a tailor/smith/LW's tradeskill links. For each link do another loop with incrementing 11th item ids and create a tooltip from each and scan for an upgrade on the tooltip. Write the results to a table/savedvars and you could get a big enough sample to see any trends in bitfield or whatever. Actually I'll see what I can do tonight this is pretty simple to do.
Inelegant, but I'm pretty confident this will return the adjusted item level of an item link (or nil if it has no level):
If you're curious about the testing method, you can read on.
The above showed that over 235 items on my tailor (and double checked with my LW), on every item level, from a Green Workman's Shirt (ilevel 1) to a Spelltwister's Grand Robe (ilevel 476), they all reacted the same when trying to use a value from 0 to 512 in the 11th item:id field:
001 Upgrade Level: 1/1
373 Upgrade Level: 1/2
374 Upgrade Level: 2/2
375 Upgrade Level: 1/3
376 Upgrade Level: 2/3
377 Upgrade Level: 3/3
379 Upgrade Level: 1/2
380 Upgrade Level: 2/2
445 Upgrade Level: 0/2
446 Upgrade Level: 1/2
447 Upgrade Level: 2/2
451 Upgrade Level: 0/1
452 Upgrade Level: 1/1
453 Upgrade Level: 0/2
454 Upgrade Level: 1/2
455 Upgrade Level: 2/2
456 Upgrade Level: 0/1
457 Upgrade Level: 1/1
458 Upgrade Level: 0/4
459 Upgrade Level: 1/4
460 Upgrade Level: 2/4
461 Upgrade Level: 3/4
462 Upgrade Level: 4/4
Once that was establish, a level comparison test was done limiting the 11th fields to the 23 valid values (the above test locked up client for a while as is):
And spot checking a bunch of items this looked to be consistent:
001 up:Upgrade Level: 1/1 +lvl:8
373 up:Upgrade Level: 1/2 +lvl:4
374 up:Upgrade Level: 2/2 +lvl:8
375 up:Upgrade Level: 1/3 +lvl:4
376 up:Upgrade Level: 2/3 +lvl:4
377 up:Upgrade Level: 3/3 +lvl:4
379 up:Upgrade Level: 1/2 +lvl:4
380 up:Upgrade Level: 2/2 +lvl:4
445 up:Upgrade Level: 0/2 +lvl:0
446 up:Upgrade Level: 1/2 +lvl:4
447 up:Upgrade Level: 2/2 +lvl:8
451 up:Upgrade Level: 0/1 +lvl:0
452 up:Upgrade Level: 1/1 +lvl:8
453 up:Upgrade Level: 0/2 +lvl:0
454 up:Upgrade Level: 1/2 +lvl:4
455 up:Upgrade Level: 2/2 +lvl:8
456 up:Upgrade Level: 0/1 +lvl:0
457 up:Upgrade Level: 1/1 +lvl:8
458 up:Upgrade Level: 0/4 +lvl:0
459 up:Upgrade Level: 1/4 +lvl:4
460 up:Upgrade Level: 2/4 +lvl:8
461 up:Upgrade Level: 3/4 +lvl:12
462 up:Upgrade Level: 4/4 +lvl:16
With the run of 4's in the 375-380 range, I don't think there's any mathematical pattern. These looks like arbitrary values (but I could be wrong)
So you can use those values in a table to know how much to adjust item level by. Doesn't help a whole lot with actual stats. I think we're still stuck scanning tooltips for that.
Doesn't help a whole lot with actual stats. I think we're still stuck scanning tooltips for that.
Fairly new to addon development, how would one go about scanning said tooltip for stats? As far as I can tell, GetItemStats() returns the stats of the base item only, regardless of upgrades.
To scan a tooltip you create a GameTooltip (the code above uses the default's GameTooltip) that inherits GameTooltipTemplate, use one of the :SetSomething widgets to the tooltip (like :SetInventoryItem) and then GetText the lines from the tooltip the client creates. Then parse the string text for info you're interested in.
This is a relatively computationally expensive process. It's fine for totaling up stats on an INSPECT_READY or something equally infrequent, but avoid using it in anything related to a BAG_UPDATE or UNIT_AURAS or anything frequent unless you're very careful/extensively caching.
For dealing with items you'll be using SetInventoryItem, SetBagItem and SetHyperlink mostly. Make sure you poke at the tooltips thoroughly and never blindly believe what you expect them to contain. There's a lot of subtle variations. For instance on the surface these seem to be identical:
But they're not. The SetHyperlink won't include the lines for transmog changes. SetInventoryItem will. Lines can appear from all sorts of things so be prepared to not make any assumptions.
That said, the 5.1 tooltip change has made it a little easier to lift stats. We no longer have to create regular expressions to lift out stats from "english" text. Almost every stat increase is in the format "+number Stat". But we still have to account for greyed out stats (GetTextColor), some stats aren't a single word ("PvP Power") and there will always be exceptions ("+80 All Stats") to account for. So some massaging of the text is still needed.
Here's example code that adds up all the stats on worn gear. Note it doesn't handle "All Stats" well and there may be other examples I'm missing. But it's a start:
Threats of violence. We take these seriously and will alert the proper authorities.
Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.
Harassing or discriminatory language. This will not be tolerated.