View Single Post
08-02-15, 11:45 PM   #2
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
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.
__________________
Retired author of too many addons.
Message me if you're interested in taking over one of my addons.
Don’t message me about addon bugs or programming questions.
  Reply With Quote