Code:
local color = "FF0000"
local names = {
UnitName("player"),
"customname1", -- add any custom filters this same way
}
local orig = {}
local function AddMessage(frame, text, ...)
for _, name in ipairs(names) do
local _, _, message = strfind(text, "|Hplayer.-|h.-|h.-%p?%s(.*)")
if message then
local first, last = strfind(strlower(message), strlower(name).."%w*%s*")
if first then
text = gsub(text, format("(.*)(%s)(.*)", strsub(message, first, last)), "%1|cff"..color.."%2|r%3")
RaidNotice_AddMessage(RaidWarningFrame, text, ChatTypeInfo["RAID_WARNING"])
PlaySoundFile("Sound\\Interface\\RaidWarning.wav") -- comment out for no sound
end
end
end
return orig[frame](frame, text, ...)
end
local f
for i = 1, NUM_CHAT_WINDOWS do
if ( i ~= 2 ) then
f = _G['ChatFrame'..i]
orig[f] = f.AddMessage
f.AddMessage = AddMessage
end
end
If you know how to throw together an addon then this is something quick and dirty that should do the trick. I'm no pro, so anyone else that knows their stuff can feel free to fix any mistakes.