Quantcast WoWInterface - View Single Post - GetLootSourceInfo() Partially Broken in 5.4.2?
View Single Post
01-10-14, 06:18 PM   #9
An Aku'mai Servant
Simca's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2012
Posts: 33
Originally Posted by semlar View Post
I'm pretty sure the item link contains a unique ID for the container.

You could try something like this..
Lua Code:
  1. local uniqueID = GetContainerItemLink(0,1):match('item:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:([^:]+)')

And then cache that in a table to keep track of what's been opened.

The ID seems to persist between sessions so it shouldn't change while you're playing, but of course you'll need to do some testing to make sure.

Also, after some brief testing with a Bag of Shiny Things, the GUID from GetLootSourceInfo is completely unrelated to the player's GUID (0x4480000418D9CC0B for the bag and 0x0480000002D6F631 for the player). It's also not the GUID of the unit that gave me the item as a quest reward, so I'm not sure what it represents.

It's possible the containers you were checking were created by the player and retained that information for a while before being discarded by the server.
Interesting. I never actually checked the GUID against my own character's GUID - I just made the assumption because the third hex digit of both GUID is '8', which when you apply the proper bit mask is the identifier for 'players'.

I assumed this meant that you were just 'looting yourself' since you owned the bag. It seemed like the kind of simple workaround that Blizzard would use for an edge case scenario like this.

Also, items have a unique identifier built into the item links?! Mind = blown. Hero!

Edit: Looking on WoWProgramming, they list the field for uniqueID as 'optional' and say that the WoW server uses it for 'some items'. Any idea how extensive this use is?
Assistant admin for MMO-Champion
WoW database file expert - ask me anything

Last edited by Simca : 01-10-14 at 06:35 PM.
  Reply With Quote