local function F()
local g = GameTooltip
if not g:IsShown() then return end
local d = UnitGUID("mouseover")
if not d then return end
local objectTypeHex = d:sub(5, 5)
local objectType = tonumber(objectTypeHex, 16) % 8
-- Игрок
if objectType == 0 then
-- Поддержка двух форматов: hex и "Player-...-GUID"
local idHex = d:match("-(%x+)$") or d:sub(-8)
local playerID = tonumber(idHex, 16)
if playerID then
g:AddLine("GUID: " .. playerID)
else
g:AddLine("GUID: (не удалось определить)")
end
end
-- Питомец
if objectType == 4 then
local petID = tonumber(d:sub(6, 12), 16)
g:AddLine("PET: " .. petID)
end
-- NPC
if objectType == 3 then
local npcID = tonumber(d:sub(9, 12), 16)
local spawnID = tonumber(d:sub(13, 18), 16)
g:AddLine("NPC ID: " .. npcID)
g:AddLine("Spawn ID: " .. spawnID)
end
g:AppendText(" ")
end
local f = CreateFrame("Frame")
f:RegisterEvent("UPDATE_MOUSEOVER_UNIT")
f:SetScript("OnEvent", F)
[свернуть]