Thread Tools Display Modes
Prev Previous Post   Next Post Next
06-22-09, 09:37 PM   #21
Akryn
A Firelord
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 479
Also, apparently they changed RaidWarningFrame...this works for me.

Code:
local me = CreateFrame("Frame", "stupidframe")

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
}

function 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!!!"
                 RaidNotice_AddMessage(RaidWarningFrame, msg, ChatTypeInfo["RAID_WARNING"])
                 return
           end
      end
end

me:SetScript("OnEvent", me.EventHandler)
  Reply With Quote
 

WoWInterface » Developer Discussions » General Authoring Discussion » Perhaps a strange request...


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off