WoW:API UnitGUID: Difference between revisions

m
Move page script moved page API UnitGUID to WoW:API UnitGUID without leaving a redirect
(Changed the number which stands for players to 8 instead of 0.)
m (Move page script moved page API UnitGUID to WoW:API UnitGUID without leaving a redirect)
 
(3 intermediate revisions by 3 users not shown)
Line 29: Line 29:


A GUID can be thought of as being composed of multiple pieces of data. Consider "'''0xAABCCCDDDDEEEEEE'''", where:
A GUID can be thought of as being composed of multiple pieces of data. Consider "'''0xAABCCCDDDDEEEEEE'''", where:
:; AA : unknown; Possible battlegroup identifier when used for players.
:; AA
:; B : unit type, mask with 0x7 to get: 0 for players, 1 for world objects, 3 for NPCs, 4 for permanent pets, 5 for vehicles. Temporary pets (Treants, Spirit Wolves, Water Elemental, Mirror Images, and Ghouls) are considered NPCs (3), even if talents or glyphs prevent them from expiring.
:: unknown; Possible battlegroup identifier when used for players.
NOTE: According to my personal analysis, I found that the number stands for players should be 8 instead of 0. I don't know if this is a newly update.
:; B
:; CCC : If the unit is a pet, CCCDDDD forms a unique ID for the pet based on creation order; if a world object, CCCDDDD is the object ID; otherwise unknown.
:: 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. Temporary pets (Treants, Spirit Wolves, Mirror Images, and Ghouls) are considered NPCs (3), even if talents or glyphs prevent them from expiring.
:; DDDD : If the unit is an NPC, this is the hexadecimal representation of the NPC id.
:NOTE: According to my personal analysis, I found that the number stands for players should be 8 instead of 0. I don't know if this is a newly update.
:; EEEEEE : If the unit is a player, this is a unique identifier based on creation order. Otherwise, this is a spawn counter based on spawn order.<br>(For players it can be 7 digits long, so that its DEEEEEE)
: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.
:CORRECTION: If you have masked with 0x7 then the result CANNOT be 8. Masking 8 with 0x7 gives 0. It seems reasonable to conclude that the original poster is correct.
:; CCC
:: If the unit is a pet, CCCDDDD forms a unique ID for the pet based on creation order; if a world object, CCCDDDD is the object ID; otherwise unknown.
:; DDDD
:: If the unit is an NPC, this is the hexadecimal representation of the NPC id.
:; EEEEEE
:: If the unit is a player, this is a unique identifier based on creation order. Otherwise, this is a spawn counter based on spawn order.<br />(For players it can be 7 digits long, so that its DEEEEEE)




Line 73: Line 80:


The NPC portion of this is 0x73AB in hex, and a NPC ID of 29611 in decimal.
The NPC portion of this is 0x73AB in hex, and a NPC ID of 29611 in decimal.
Water Elemental is now a permanent pet and as such has an id of 4 instead of 3.
Anonymous user