This should probably work:
Code:
local ringSpells = { [187611] = true, [187614] = true, [187615] = true }
local f = CreateFrame("Frame")
f:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
f:SetScript("OnEvent", function(f, event, _, combatEvent, _, sourceGUID, sourceName, sourceFlags, _, _, _, _, _, spellID, spellName)
if combatEvent == "SPELL_CAST_SUCCESS" and ringSpells[spellID] and bit.band(sourceFlags, COMBATLOG_OBJECT_AFFILIATION_RAID) > 0 then
local message = sourceName .. " used a legendary ring!"
-- Post to own chat frame:
DEFAULT_CHAT_FRAME:AddMessage(message)
-- Post to own raid warning frame:
RaidNotice_AddMessage(RaidWarningFrame, message, ChatTypeInfo["SYSTEM"])
-- Send to instance/raid/party chat:
-- SendChatMessage(message, IsInGroup(LE_PARTY_CATEGORY_INSTANCE) and "INSTANCE_CHAT" or IsInRaid() and "RAID" or IsInGroup() and "PARTY")
end
end)
Comment or uncomment the lines for different message outputs as desired.