This is actually really easy:
Code:
local me = CreateFrame("frame")
me:RegisterEvent("CHAT_MSG_MONSTER_EMOTE")
me:RegisterEvent("CHAT_MSG_MONSTER_SAY")
me:RegisterEvent("CHAT_MSG_MONSTER_WHISPER")
--add any others...that's probably good enough
me.listOfText = {
"says \"Uggh\"", --note \" for quotes, since a literal " would close the string
"I don't feel so well",
"Ooh pretty shinies",
"etc",
"and so forth",
}
me.EventHandler(self, event, msg)
for i = 1, #self.ListOfText do
if msg:find(self.listOfText[i]) then
PlaySound("whateversoundyouwant")
RaidWarningFrame:AddMessage("msg")
return
end
end
end
me:SetScript("OnEvent", me.EventHandler)