Don't use destGUID, use destFlags...
Lua Code:
local function GetIconIndex(flags)
local number, mask, mark
if bit.band(flags, COMBATLOG_OBJECT_SPECIAL_MASK) ~= 0 then
for i=1,8 do
mask = COMBATLOG_OBJECT_RAIDTARGET1 * (2 ^ (i - 1))
mark = bit.band(flags, mask) == mask
if mark then number = i break end
end
end
return number
end
This will return a number from 1 to 8 corresponding to each mark, or nil if the target doesn't have a mark, see
here for more information. However, if you are intent on using destGUID, I suppose you could do the following, assuming the unit you are checking is a player with a valid
unitId:
Lua Code:
local function GetRaidTargetIndexFromGUID(guid)
local name = select(6, GetPlayerInfoByGUID(guid)) -- Get the unit's name; works globally
local icon = GetRaidTargetIndex(name) -- Returns a number from 1 to 8, or nil
return icon
end