Raid flags contain the raid target marker information for a unit. They are returned from COMBAT_LOG_EVENT sourceRaidFlags
and destRaidFlags
params.
Constants[]
Source: FrameXML/Constants.lua
Example[]
local raidFlags = 0x4
if bit.band(raidFlags, COMBATLOG_OBJECT_RAIDTARGET3) > 0 then
print("has diamond {rt3} target marker")
end
- You can conveniently use logarithm base 2 to convert raid flags to the standard 1-8 target markers.
local raidFlags = 0x80
local index = math.log(raidFlags) / math.log(2) + 1
local icon = ICON_LIST[index]
print("Target marker:", icon.."0|t")
>> Target marker:
- Example that prints combat log events for dest units with a target marker.
local raid_targets = {}
for i = 1, 8 do
raid_targets[_G["COMBATLOG_OBJECT_RAIDTARGET"..i]] = ICON_LIST[i].."0|t"
end
local f = CreateFrame("Frame")
f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
f:SetScript("OnEvent", function(self, event)
self:COMBAT_LOG_EVENT_UNFILTERED(CombatLogGetCurrentEventInfo())
end)
function f:COMBAT_LOG_EVENT_UNFILTERED(...)
local timestamp, subevent, _, sourceGUID, sourceName, sourceFlags, sourceRaidFlags, destGUID, destName, destFlags, destRaidFlags = ...
if bit.band(destRaidFlags, COMBATLOG_OBJECT_RAIDTARGET_MASK) > 0 then -- dest unit has a target marker
print(subevent, destName, destRaidFlags, raid_targets[destRaidFlags])
end
end
-- the lookup table would look like this
local raid_targets = {
[1] = "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_1:0|t",
[2] = "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_2:0|t",
[4] = "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_3:0|t",
[8] = "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_4:0|t",
[16] = "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_5:0|t",
[32] = "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_6:0|t",
[64] = "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_7:0|t",
[128] = "|TInterface\\TargetingFrame\\UI-RaidTargetingIcon_8:0|t",
}
- Source: COMBATLOG_OBJECT_RAIDTARGET, ICON_LIST
Patch changes[]
- Patch 9.2.0 (2022-02-22): Removed invisible IDs 9 to 18.
- Patch 4.2.0 (2011-06-28): Split from UnitFlag to its own parameter.