I'm writing an item stat comparison addon and I'm having a bit of a problem with random suffix enchants ("of the Monkey", etc.). For example, let's take
[Hacking Cleaver of the Monkey]: +3 Agility, +3 Stamina
GetItemStats(<item link>) for that item returns not 3 Agility/Stamina, but 28839 Agility/Stamina. This particular item's suffix ID is -78, and its unique ID is -2081052416.
The suffix ID is negative, so it's one of the new scaling random enchants. -78 is Monkey, and the agility and stamina are bit.band(uniqueid,65535) * .6666. bit.band(-2081052416,65535) returns 43624, which, multiplied by .6666, returns 28839. Why?
Another broken item's unique id is 1964933888, which, after bit.band, is 33536.
Let's try it with a weapon that is actually correct: [Sockeye Dagger of the Elder]
Suffix ID: -44 (Elder, suffix factor * .7889 for stamina, .5259 for intellect/spirit)
Unique ID: -1664483297