CORRECTION: If you have masked with 0x7 then the result CANNOT be 8. NOTE: On the server Alexstraza I have seen the 1st 3 numbers be 040, meaning you must mask with 0x7 and 0=player, not 8. NOTE: According to my personal analysis, I found that the number stands for players should be 8 instead of 0. Temporary pets (Treants, Spirit Wolves, Mirror Images, and Ghouls) are considered NPCs (3), even if talents or glyphs prevent them from expiring. B unit type, mask with 0x7 to get: 0 for players, 1 for world objects, 3 for NPCs, 4 for permanent pets (including Water Elemental), 5 for vehicles. Consider " 0xAABCCCDDDDEEEEEE", where:ĪA unknown Possible battlegroup identifier when used for players. However, units that "transform" into other units may not switch GUID immediately.Ī GUID can be thought of as being composed of multiple pieces of data.Players keep their GUID forever, and are unique even in cross-server battlegrounds.Monster and pet GUIDs can be recycled after server (or instance) restart.Pets get a new GUID each time they are summoned.A monster has a single GUID from spawn until death (or despawn).GUIDs are intended to provide a unique way to identify units the following general rules apply: GUIDs are represented in WoW as hexadecimal strings beginning with '0x' - this prefix is not part of the data, but merely signifies that what follows is a hexadecimal number. running tonumber(guid, 16) will produce erronous results. GUIDs are 64-bit numbers, and are far too long to convert to decimal numbers using lua's libraries as a whole. Example local name = UnitName("target") local guid = UnitGUID("target") ChatFrame1:AddMessage(name." has the GUID: ".guid) Returns guid String - a string containing the hexadecimal representation of the unit's GUID, or nil if the unit does not exist. Returns the GUID of the specified unit works on both players and NPC.Īrguments unit String - Unit ID of the unit to look up.