Hello! So i am reaching out for some smart advice to register every raid member in a a raid on the unit_aura event.
Some quick info about the addon: I am gathering each raid members debuffs (UnitDebuff()) and checking if a debuff on the raid member exists in my pre defined list of debuffs that i am checking.
How would a smart way be to register all the raid members on the event "UNIT_AURA" for this?
What i currently have is something along this line
Lua Code:
local frame = CreateFrame("FRAME", nil); -- Frame that register various events in the world
function frame:UNIT_AURA()
-- check if every raid member inside my raid have any of the following debuffs in my debuff list
end
function frame:PLAYER_ENTERING_WORLD(event, ...)
if(IsInRaid("player")) then --
for i = 1, MAX_RAID_MEMBERS do --(40)
if(UnitName("raid"..i) ~= nil) then
frame:RegisterEvent("UNIT_AURA", "raid"..i)
end
end
end
end
frame:SetScript("OnEvent", function(self, event, ...)
self[event](self, event, ...)
end)
frame:RegisterEvent("PLAYER_ENTERING_WORLD");
Would this be a good and smart way to register all the raid members under the event "UNIT_AURA" in order to check the raid members for debuffs? It is important for me to have the frame:UNIT_AURA() function executed whenever anything in regards to debuffs happends on whatever player in my raid. Kinds regards!