Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 06-14-2007, 03:52 AM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

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.)
Reply With Quote
  #2  
Old 06-14-2007, 10:13 PM
Budaworm
Fire Beetle
 
Join Date: Oct 2003
Posts: 20
Default

The way you had it written first works fine. You need to declare your variables first though. So if you write it like this:
Code:
sub EVENT_AGGRO {
my $Phrase1 = "Your faithless devotion to a false god leaves me no choice.";
my $Phrase2 = "I shall rid the land of another infamous villain.";
my $Phrase3 = "Your foul deeds have earned my contempt.";
my $Phrase4 = "${race}s like you are better left dead than alive.";
my $Phrase5 = "It's ${class}s like you who have ruined your own lands, You'll not ruin mine!";
my $Phrase6 = "Heathen! Unbeliever! Norrath must be cleansed!";
my $Phrase = quest::ChooseRandom($Phrase1, $Phrase2, $Phrase3, $Phrase4, $Phrase5, $Phrase6);
quest::say("Frrroooaaakkk!");
quest::say("$Phrase");
}
The mob will say the first message then say the randomly picked message. Looks much nicer and cleaner in your quest script.

Last edited by Budaworm; 06-15-2007 at 06:15 AM.. Reason: typos
Reply With Quote
  #3  
Old 06-15-2007, 12:55 AM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

Haha, F. I didn't think about that =) No wonder all the /says were coming up as empty, it's because the variables were empty with the order it was executing. Doh =X

Okay, I think I'll go back to the way I was trying it originally, just because it's more compact. Thanks so much for all the help and ideas, all of you =)
Reply With Quote
  #4  
Old 06-15-2007, 04:58 AM
sfisque
Hill Giant
 
Join Date: Oct 2006
Posts: 248
Default

if you stuff them into a list, and just randomize the index, the code would be more modular and reusable across other mobs (you could even turn it into a plugin.pl type mod).

== sfisque
Reply With Quote
  #5  
Old 06-15-2007, 08:36 AM
EmanonCow
Sarnak
 
Join Date: Aug 2006
Posts: 35
Default

Quote:
Originally Posted by Budaworm
The way you had it written first works fine. You need to declare your variables first though. So if you write it like this:
Code:

The mob will say the first message then say the randomly picked message. Looks much nicer and cleaner in your quest script.
Cleaner solution:
Code:
sub EVENT_AGGRO {
	my @Phrases = (
		"Your faithless devotion to a false god leaves me no choice.",
		"I shall rid the land of another infamous villain.",
		"Your foul deeds have earned my contempt.",
		"${race}s like you are better left dead than alive.",
		"It's ${class}s like you who have ruined your own lands, You'll not ruin mine!",
		"Heathen! Unbeliever! Norrath must be cleansed!"
	);

	my $Phrase = quest::ChooseRandom(@Phrases);
	quest::say("Frrroooaaakkk!");
	quest::say("$Phrase");
}
I think that'll work, and you can add phrases to the list, and it automatically includes it in the random phrase pick.
Reply With Quote
  #6  
Old 06-15-2007, 11:22 PM
Budaworm
Fire Beetle
 
Join Date: Oct 2003
Posts: 20
Default

The method above looks even more compact but you gotta write it as
Code:
sub EVENT_AGGRO {
    my @Phrases = (
        "Your faithless devotion to a false god leaves me no choice.",
        "I shall rid the land of another infamous villain.",
        "Your foul deeds have earned my contempt.",
        "${race}s like you are better left dead than alive.",
        "It's ${class}s like you who have ruined your own lands, You'll not ruin mine!",
        "Heathen! Unbeliever! Norrath must be cleansed!"
    );
    quest::say("Frrroooaaakkk!");
    quest::say("$Phrases[int(rand($#Phrases+1))]");
}
to get it to work.
Reply With Quote
  #7  
Old 06-23-2007, 03:54 PM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

Dammit. I had all of Guk working fine until I upgraded to the 1002 build, now I'm getting errors and no response from the frogs. Here's what I'm seeing in the error log:

Quote:
---------------------------------------------
[06.23. - 22:25:01] Starting Log: logs/eqemu_quest_zone_5488.log
[06.23. - 22:25:01] Tying perl output to eqemu logs
[06.23. - 22:25:01] Creating EQEmuIO=HASH(0x39d603c)
[06.23. - 22:25:01] Creating EQEmuIO=HASH(0x39efe60)
[06.23. - 22:25:01] Loading perlemb plugins.
[06.23. - 22:25:01] Loading perl commands...
[06.23. - 23:41:22] Useless use of a constant in void context at quests/poknowledge/#Yeril_Imsin.pl line 24.
[06.23. - 23:47:41] Bareword found where operator expected at quests/gukbottom/a_ghoul_sentinel.pl line 8, near """Your"
[06.23. - 23:47:41] (Missing operator before Your?)
[06.23. - 23:47:41] Bareword found where operator expected at quests/gukbottom/a_ghoul_sentinel.pl line 9, near "my $Phrase8 = "Your"
[06.23. - 23:47:41] (Might be a runaway multi-line "" string starting on line
[06.23. - 23:47:41] (Do you need to predeclare my?)
[06.23. - 23:47:41] Unquoted string "stand" may clash with future reserved word at quests/gukbottom/a_ghoul_sentinel.pl line 9.
[06.23. - 23:47:41] Bareword found where operator expected at quests/gukbottom/a_ghoul_sentinel.pl line 10, near "my $Phrase9 = "Your"
[06.23. - 23:47:41] (Might be a runaway multi-line "" string starting on line 9)
[06.23. - 23:47:41] (Do you need to predeclare my?)
[06.23. - 23:47:41] Bareword found where operator expected at quests/gukbottom/a_ghoul_sentinel.pl line 11, near "my $Phrase10 = "It's"
[06.23. - 23:47:41] (Might be a runaway multi-line "" string starting on line 10)
[06.23. - 23:47:41] (Do you need to predeclare my?)
[06.23. - 23:47:41] Unquoted string "the" may clash with future reserved word at quests/gukbottom/a_ghoul_sentinel.pl line 11.
[06.23. - 23:47:41] Scalar found where operator expected at quests/gukbottom/a_ghoul_sentinel.pl line 12, near "my $Phrase11 = "${race}"
[06.23. - 23:47:41] (Might be a runaway multi-line "" string starting on line 11)
[06.23. - 23:47:41] (Do you need to predeclare my?)
[06.23. - 23:47:41] Bareword found where operator expected at quests/gukbottom/a_ghoul_sentinel.pl line 12, near "s like you are better left dead than alive"
[06.23. - 23:47:41] (Do you need to predeclare s?)
[06.23. - 23:47:41] Unquoted string "ve" may clash with future reserved word at quests/gukbottom/a_ghoul_sentinel.pl line 12.
[06.23. - 23:47:41] Bareword found where operator expected at quests/gukbottom/a_ghoul_sentinel.pl line 14, near "quest::say("Rrrrrrrrooooaaakkk"
[06.23. - 23:47:41] (Might be a runaway multi-line "" string starting on line 12)
[06.23. - 23:47:41] Scalar found where operator expected at quests/gukbottom/a_ghoul_sentinel.pl line 15, near "quest::say("$Phrase"
[06.23. - 23:47:41] (Might be a runaway multi-line "" string starting on line 14)
[06.23. - 23:47:41] String found where operator expected at quests/gukbottom/a_ghoul_sentinel.pl line 15, at end of line
[06.23. - 23:47:41] (Missing semicolon on previous line?)
[06.23. - 23:47:41] Bareword found where operator expected at quests/gukbottom/a_wan_ghoul_knight.pl line 8, near """Your"
[06.23. - 23:47:41] (Missing operator before Your?)
[06.23. - 23:47:41] Bareword found where operator expected at quests/gukbottom/a_wan_ghoul_knight.pl line 9, near "my $Phrase8 = "Your"
[06.23. - 23:47:41] (Might be a runaway multi-line "" string starting on line
[06.23. - 23:47:41] (Do you need to predeclare my?)
[06.23. - 23:47:41] Unquoted string "stand" may clash with future reserved word at quests/gukbottom/a_wan_ghoul_knight.pl line 9.
[06.23. - 23:47:41] Bareword found where operator expected at quests/gukbottom/a_wan_ghoul_knight.pl line 10, near "my $Phrase9 = "Your"
[06.23. - 23:47:41] (Might be a runaway multi-line "" string starting on line 9)
What'd we do wrong here?
Reply With Quote
  #8  
Old 06-23-2007, 06:03 PM
Bjerlk
Fire Beetle
 
Join Date: Apr 2007
Posts: 10
Default

Seems to be some differances in how you declare a parameter in te new version.
Check out how it has been changed in the changelog.

Maybe the string declaration (or what it now is) has ben changed to
$phrase8 := "yada yada";
Or similar. Check it out. There is the trouble it seems anyway since it errors on each of those code snipps...
Reply With Quote
  #9  
Old 06-24-2007, 07:55 AM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

I checked the changelog, and there wasn't anything listed that would indicate these ever being changed. This is especially annoying, as I recently uploaded the whole batch for Upper and Lower Guk to PEQ's quest repository. Grrr. I think that when I have time (work is picking up; probably won't get the chance until next week at the earliest), I'll sit down and see if one of the other methods here will do the job without throwing me errors.

EmanonCow's code with Budaworm's correction looks like what I'll probably go with, but hopefully their version of things won't meet with the same errors that what I settled on did.
Reply With Quote
  #10  
Old 06-26-2007, 05:22 PM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

Quote:
Originally Posted by Budaworm View Post
The method above looks even more compact but you gotta write it as
Code:
    quest::say("$Phrases[int(rand($#Phrases+1))]");
}
to get it to work.
Just to prevent confusion, this is exactly what ChooseRandom was written to avoid... its just too ugly, and shouldent be nescesary.

Also, nothing changed about quests recently that I am aware of... maybe you upgraded perl versions?
Reply With Quote
  #11  
Old 06-26-2007, 11:26 PM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

Hrm. Nope. Only moved from 992 to 1002.

I'm out of town and pretty busy until at least after the 4th, so I haven't had a chance to delve into this any further. My main goal is just to go back to a method that works so that I can at least edit all the files that I dropped into the PEQ quest submission area. I was running trains of screaming frogloks before, so I know it worked at that point.
Reply With Quote
  #12  
Old 01-15-2008, 05:59 AM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

I never did post back here, and figured I'd bump this in case anyone has any input to offer or issues they notice with it. The only issue that I'm concerned with is that it's quite a big block of text to be jamming every file with that I intend to do, but it's the best way I know of to get things working.

The final version that I've been working with looks like this below:

Code:
sub EVENT_AGGRO {
my $Phrase1 = "Your faithless devotion to a false god leaves me no choice.";
my $Phrase2 = "I shall rid the land of another infamous villain.";
my $Phrase3 = "Your foul deeds have earned my contempt.";
my $Phrase4 = "${class}s like you are better left dead than alive.";
my $Phrase5 = "It's ${races}s like you who have ruined your own lands, You'll not ruin mine!";
my $Phrase6 = "Heathen! Unbeliever! Norrath must be cleansed!";
my $Phrase7 = "Your beliefs are an insult to us all!";
my $Phrase8 = "Your actions and history are a personal affront to all I stand for.";
my $Phrase9 = "Your intolerable reputation insults all in this realm.";
my $Phrase10 = "It's time for you to take your blasphemy into the next realm.";
my $Phrase11 = "${race}s like you are better left dead than alive.";
my $Phrase = quest::ChooseRandom($Phrase1,$Phrase2,$Phrase3,$Phrase4,$Phrase5,$Phrase6,$Phrase7,$Phrase8,$Phrase9,$Phrase10,$Phrase11);
 quest::say("Areeeeewwwww");
my $Chance = quest::ChooseRandom(1,2,3,4);
 if ($Chance == '1') {
  quest::say("$Phrase");
 }
}

#Submitted by: Jim Mills
On aggro, a random phrase (from the 11 included) is chosen. The mob will say their default aggro /say, and 25% of the time will say one of the 11 random phrases. I know it wasn't every time on Live, and I put the chance at about what I figured it should be. If it were occurring every time, though it might bring back some nostalgia, I think it'd get a bit annoying :P

I have a whole list of old world says to go through. Just a sample:
Code:
Butcherblock:
Guard Haldin says 'For the glory of Kaladim, have at thee!!'
Guard Haldin says 'For the glory of Kaladim!!  You are no more.'

Greater Faydark:
Guard Highmoon says 'Time to die.'

Feerott:
a spectre says 'Areeeeewwwww'
a spectre says 'I really hate $classes like you.'
a spectre says '$classes like you always bring out the worst in me.'

Oggok:
Bouncer Wrok says 'Bouncer smash you!! 
Bouncer Wrok says 'Ha!! Bouncers best. I am victorioo.. Victer.. I win!! 

Guk:
a froglok shin knight says 'Frrroooaaakkk!'
a shin ghoul warrior says 'Rrrrrrrrooooaaakkk!'

Qeynos Guards:
Guard Weleth says 'Halt! Halt in the name of Antonius Bayle!'
Guard Gehnus says 'It's Shadowknights like you that insult all of Norrath.'
Guard Gehnus says 'Shadowknights like you always bring out the worst in me.'
Guard Hezlan says 'I really hate Shadowknights like you.'
Corporal Lancot says 'Halt!  You are an enemy of the people of Qeynos!  Stop in the name of Antonius Bayle and prepare for punishment!'

Qeynos Hills:
a gnoll pup says 'Half Elves like you are better left dead than alive.'
a gnoll pup says 'It's Half Elves like you who have ruined your own lands, You'll not ruin mine!'
a gnoll pup says 'Half Elves have no place in our realm!'
a gnoll pup says 'Filthy Half Elves like you must die!'
a gnoll pup says 'YAP!  YAP!  YAP!  In the way of my father, I claim your blood for the glory of Blackburrow!! WOOOOOOOF!!'

Fippy Darkpaw shouts 'BBBBBAAAARRRKKKK!!!!!  You humans will pay for ruining our homeland!!  GRRRRRRRR!!!!  Family Darkpaw of the Sabretooth Clan will slay you all!!  BARK! 

Oasis:
a dry bones skeleton says 'Areeeeewwwww 
a dry bones skeleton says 'It's Wizards like you that insult all of Norrath.'
a dry bones skeleton says 'Enchanters like you are an affront to my senses.'
a dry bones skeleton says 'I really hate Rogues like you.'
a Dervish Thug's corpse0 says 'My comrades will avenge my death'

Solusek B:
greater kobold says 'Grrrrr.  Bark.  Bark.  Grrrrr.'
greater kobold says 'Your foul deeds have earned my contempt.'
greater kobold shaman says 'Grrrrr.  Bark.  Bark.  Grrrrr.'
greater kobold shaman says 'Filthy Scumsuckers like you must die!'
lava guardian says 'I'll teach you to interfere with me $name'
lava guardian's corpse0 says 'My comrades will avenge my death'
Solusek kobold says 'Grrrrr.  Bark.  Bark.  Grrrrr.'
a fire goblin scout says 'Die by lava - Die by flame - Fire Peak goblins kill and maim.'

Qeynos:
Nixx Darkpaw shouts 'BBBBBAAAARRRKKKK!!!!!  You humans will pay for ruining our homeland!!  GRRRRRRRR!!!!  Family Darkpaw of the Sabretooth Clan will slay you all!!  BARK!'

Lashun Novashine shouts 'Cease this endless conflict and seek salvation in the Temple of Life!  The glory of Rodcet Nife awaits you!'

Sentinel Aegeo says 'Ogres have no place in our realm!'
Sentinel Aegeo says 'Prepare to die, infidel!!

Freeport:
Guard Jacsen says 'Let your death be a warning to all who dare oppose the Freeport Militia!
Sergeant J`Narus says 'Die, like the fool you are! 

Nektulos:
Corporal D`Abth says 'Die, like the fool you are!'
Sergeant C`Orm says 'Prepare to meet the skilled fury of a Neriak Dragoon.'
Guard D`Bious says 'Your guild must be destroyed!'
Sergeant C`Orm says 'Hardly a worthy adversary. A member of the Indigo Brotherhood deserves a much better opponent.'

Plane of Sky:
Sirran the Lunatic says 'These are the keys!  Use them well!  Hold them in your hand and touch them to the runed platforms!  Guide you they will!  Hah!  The last to go, must tell me so, or be in for a [hassle].  If there is a hassle I will go!!
Sirran the Lunatic says 'Ehem!  What? Oh, hello there! Sirran be my name.  Yes? So, come to the Plane of Sky, have you?  Killed all my fairies!  Hah!  So!  Do you wish to know how to traverse this plane? Or should I just go away?  I know much about this plane.  You would do well to listen!

Mistmoore:
a will pillager says 'Do not underestimate the might of Mistmoore!'
a shadowy sage says 'Do not underestimate the might of Mistmoore!'
a hemo enologist says 'Do not underestimate the might of Mistmoore!

a cyclops says 'Little man, little man, filled with red - I'll crunch your bones when you are dead.'
Poacher Willa says 'It's time for you to take your blasphemy into the next realm'
Poacher Willa says 'Time to die.'

orc centurion says 'Aaarrghh!! The Deathfist shall hunt you down. My death will not go unnoticed.'
Tabitha's corpse0 says 'My comrades will avenge my death'
Lorud's corpse0 says 'My comrades will avenge my death'
Tralinda's corpse0 says 'My comrades will avenge my death'
Tralinda says 'Dark Elves have no place in our realm!'
Tralinda says 'Time to die Dempi'

an orc warrior says 'Orc stomp, Orc kill - Orc weapons your blood will spill.'
orc pawn says 'You shall have all the Crushbone Orc Legions on your tail for my death. 
a lizard man warrior says 'Hssssssssssss.'
Just trying to liven up Norrath and make our critters a little more talkative
Reply With Quote
Reply

Thread Tools
Display Modes

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

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

Forum Jump

   

All times are GMT -4. The time now is 04:43 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3