View Single Post
06-21-09, 10:04 PM   #5
Ambrya
Premium Member
Premium Member
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 49
So let me see if I have this right, since I don't have any characters of the proper level at this time to test this (or even a higher level character who hasn't done it yet.) Since I can't find the "alert" quotes for "The Sleeper Has Awakened" or "Wandering Shay" (which are the only other two timed escort quests with this sort of event that takes place that I can think of off the top of my head) I'm using the "A Little Help From My Friends" quest in Ungoro Crater as a test case. I am sure there are others, and I think if I ever release this addon, I will solicit people to send me suggestions of other quests I can add to it, especially Horde quests since it's been years since I played a Horde toon and I don't remember what escorts they have.

I'm a little confused about the quotes thing you commented on. I removed the / since I assumed that wasn't supposed to be in the final product, but I'm not sure that what I removed is actually what was supposed to be removed. If that makes sense?

I'm also not certain if I did the sound thing right. I chose the "RaidWarning" sound because that is what I see used in another addon I use, but I'm not sure if that's a sound that is actually already in game that the addon can find.

Anyway, here is 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.listOfText = {
    "Uuuuuuggggghhhhh....", --note \" for quotes, since a literal " would close the string
    "I'm not feeling so well...",
    "Maybe... you could carry me?",
    "The heat... I can't take it...",
}

me.EventHandler(self, event, msg)
      for i = 1, #self.ListOfText do
           if msg:find(self.listOfText[i]) then
                 PlaySound("RaidWarning")
                 RaidWarningFrame:AddMessage("Head's Up!  Your quest NPC needs help!!!")
                 return
           end
      end
end

me:SetScript("OnEvent", me.EventHandler)
And the .toc file looks like this:

Code:
## Interface: 30100
## Title: Escort Event Alert (Ringo)
## Author:  Ambrya, thanks to large amounts of help from Akryn
## Notes:  Plays a sound and displays a warning message on screen when an event requiring attention occurs during the escort quest "A Little Help From My Friends"

escortalert.lua
Does this look right, or am I completely off the mark?

Also, would it be better to include the entire quote, including the Ringo says: part? For example

Code:
me.listOfText = {
    "Ringo says: Uuuuuuggggghhhhh....", --note \" for quotes, since a literal " would close the string
    "Ringo says: I'm not feeling so well...",
    "Ringo says: Maybe... you could carry me?",
    "Ringo says: The heat... I can't take it...",
}

Last edited by Ambrya : 06-21-09 at 11:05 PM.
  Reply With Quote