Originally Posted by semlar
I'm not sure if you're suggesting this or asking how, but basically what you would do is on that event make a for loop from 1 to MAX_BOSS_FRAMES, check if UnitGUID('boss'..i) exists, and if it does extract the npc ID and compare it to the one in your list.
|
Code:
local BossesToCheck = {
[68476] = true, -- Horridon
[69017] = true, -- Primordius
}
local MyAddon = CreateFrame("Frame")
MyAddon:RegisterEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT")
MyAddon:SetScript("OnEvent", function(self, event, ...)
for i = 1, MAX_BOSS_FRAMES do
local guid = UnitGUID("boss"..i)
if guid then
local mobid = tonumber(strsub(guid, 6, 10), 16)
if BossesToCheck[mobid] then
-- You are engaged with one of the bosses on your list.
return
end
end
end
-- If you didn't return out by now, you're not engaged with any of the listed bosses.
end)