WoW:API UnitGUID: Difference between revisions

(Changed the number which stands for players to 8 instead of 0.)
Line 32: Line 32:
:; 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.
:; 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.
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.
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.
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. 
:; 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.
:; 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.
:; DDDD : If the unit is an NPC, this is the hexadecimal representation of the NPC id.
Line 73: Line 74:


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