Hmmm....it doesn't work.
Tested it on a friend's toon just now, running the "The Sleeper Has Awakened" (Kerlonian Evershade) quest. First event took place, no RaidWarning sound, no message on the screen, nothing.
Here's what I have:
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.listOfNames = {
{"Ringo", "Yo! The goblin has fainted, throw some water on him, quick!!"},
{"Kerlonian Evershade", "Darn it! That lazy druid has fallen asleep again, time to use the horn!!!"},
{"Shay", "That dippy night elf girl is chasing butterflies again, better ring the bell and call her back."},
{"A-Me 01", "The suicidal ape robot is charging off into the fray again, go defend her!"},
--etc
}
me.EventHandler(self, event, _, name)
for i = 1, #self.listOfNames do
if name:find(self.listOfNames[i][1]) then
PlaySound("RaidWarning")
local msg = self.listOfNames[i][2] or "Heads Up! Your quest NPC needs help!!!"
RaidWarningFrame:AddMessage(msg)
return
end
end
end
me:SetScript("OnEvent", me.EventHandler)
And my .toc is:
Code:
## Interface: 30100
## Title: Escort Event Alert
## Author: Code by Akryn, quest identification and customization by Ambrya
## Notes: Plays a sound and displays a warning message on screen when an event requiring attention occurs during certain escort quests.
escortalert.lua
The .toc appears to be okay...I can see the addon and its description in the list of addons on the character selection screen, it's up to date, everything seems to be in place...but nothing happens.