Best way to determine who killed me
View Single Post
11-29-12, 02:36 PM
A Flamescale Wyrmkin
Join Date: Dec 2009
It doesn't work either.
I have read here and there and I found something:
All entities in World of Warcraft are identified by a unique 64-bit number; generally presented as a string containing a hexadecimal representation of the number (e.g. "0xF530007EAC083004"). (Note that Lua in WoW does not support 64-bit integers, so this value cannot be converted with tonumber.)
The type of unit represented by a GUID can be determined by using bit.band() to mask the first three digits with 0x00F: - 0x000 - A player - 0x003 - An NPC - 0x004 - A player's pet (i.e. hunter/warlock pets and similar; non-combat pets count as NPCs) - 0x005 - A vehicle
In this way it seems to work. But as Phanx said it is quite expensive. Is there a better way to do this ?
local bit_band = bit.band
if destGUID == playerGUID and bit_band(tonumber(sourceGUID:sub(1,5)),0x00F) == 0 then
instead the code:
always return me 256 with players or npcs.
Thanks very much for attention and patience.
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
Last edited by gmarco : 11-29-12 at
View Public Profile
Send a private message to gmarco
Find More Posts by gmarco