First post... go easy on me. I was looking for way to find out if a GUID was a players or not... and I never found it on here. I found it on the wowwiki, and thought I should share it with the rest of the community.
A monster has a single GUID from spawn until death (or despawn). When it respawns it gets a new GUID.
Pets get a new GUID each time they are summoned.
Monster and pet GUIDs can be recycled after server (or instance) restart.
Players keep their GUID forever, and are unique even in cross-server battlegrounds.
- It's a player if the upper bits masked with 0x00f = 0x000
- It's a creature if the upper bits masked with 0x00f = 0x003
- It's a pet if the upper bits masked with 0x00f = 0x004
Format for players
The GUID is a simple number in the order characters are created. An older character has a lower number than a new.
The top three digits are reserved. It's unknown if any of the lower digits are also reserved.
Renaming and transfering to another server, or to another account gives your character a new GUID.
Format for non-pet NPCs
The first three characters masked with 0x00f will result in 0x003.
The next three digits are unknown. It's usually '000'.
The next four digits are the NPC id.
The last six digits are the spawn counter.
If you take the 'NPC id' and convert it to decimal you can check wowhead and see what NPC it is. See examples below.
Format for pets
The first three characters masked with 0x00f will result in 0x004.
The next seven digits are unknown.
The last six digits are the spawn counter.
It's possible that the seven digits that at this point are unknown are split into smaller pieces. I couldn't find any structure among them, but looking at non-pet NPCs, I can imagine that the NPC id is there somewhere but I couldn't find it. You must log out before the pet gets this GUID, if querried during the same session that you tamed it, your pet will have its pre-taming GUID.