Thank you GeorgeS
I wound up looking through most of the quest files included with that, and came across one (#2
that gave me an idea. I realized that I was perhaps putting too much thought into this.
I used a ChooseRandom with numbers 1-10, and just wrote ifs for each number. I stored the chosen value in the $a variable (since I wanted to test it with one that I knew would be recognized).
Well, I went a little further than that, and found that it will in fact let me use variables that I create myself (and thus aren't in the list
here). I'm still new to writing in PERL, so I thought there were limitations from somewhere on what variables you could work with.
Anyway, here's what I wound up with, and it works pretty well. I'll be using this for every mob that I have aggro /say for, and it will have them give their standard aggro message along with a second one roughly 2/3 of the time. If they have a standard one that goes off each time (Frrroooaaakkk!), I'll just drop that at the top. Thank you so much for the help, both of you
Code:
sub EVENT_AGGRO{
my $Phrase = quest::ChooseRandom(1,2,3,4,5,6,7,8,9,10,0,0,0,0,0);
quest::say('Frrroooaaakkk!');
if ($Phrase =~/1/) {
quest::say("Your faithless devotion to a false god leaves me no choice.");
}
if ($Phrase =~/2/) {
quest::say("I shall rid the land of another infamous villain.");
}
if ($Phrase =~/3/) {
quest::say("Your foul deeds have earned my contempt.");
}
if ($Phrase =~/4/) {
quest::say("Your beliefs are an insult to us all!");
}
if ($Phrase =~/5/) {
quest::say("Your actions and history are a personal affront to all I stand for.");
}
if ($Phrase =~/6/) {
quest::say("${race}s like you are better left dead than alive.");
}
if ($Phrase =~/7/) {
quest::say("It's ${race}s like you who have ruined your own lands, You'll not ruin mine!");
}
if ($Phrase =~/8/) {
quest::say("It's time for you to take your blasphemy into the next realm.");
}
if ($Phrase =~/9/) {
quest::say("Your intolerable reputation insults all in this realm.");
}
if ($Phrase =~/10/) {
quest::say("${class}s like you are better left dead than alive.");
}
}
#Submitted by: Jim Mills
(Note: Again, the board seems to be adding an extra space where it doesn't really belong inside of my code block. There are no spaces after the string of zeroes in the ChooseRandom when I enter this in, but they appear each time I preview my post. Quirky.)