View Single Post
11-17-10, 08:15 PM   #20
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by TransformedBG View Post
So i got it all up and running fine.. now i want to expand on this function a little more. I want to have multiple saying that it could randomly select to say instead of one defined saying.

I was thinkign it would have to be something like this:

Code:
local me = UnitClass("player");
local number = UnitLevel("player");
number = number +1;
quote_this = {};

quote_this["level"] = {
"DING DING DING! Yeah thats right this guild needed "..me.."!",
"OH NOEZ! What just happened? Ohh that was me! I Just LEVELED! BOYAH!",
"Check this guys! Im now a level "..number.." "..me.."!",
"If you heard it once, you have now heard it "..number..." times!",
"DING DING DING Tell um what you just won "..me.."!",
"Go ahead and just say gratz already!",
}
But im not sure i would work the call into SendChatMessage(...)? any help would be appreciated.
It would end up something like this.
Code:
local list=qoute_this["level"];
SendChatMessage(list[math.random(#list)],"GUILD");
This allows you to change the list later on, adding or removing lines as you wish without needing to change the call.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 11-17-10 at 08:21 PM.
  Reply With Quote