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

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-13-2007, 04:34 AM
sfisque
Hill Giant
 
Join Date: Oct 2006
Posts: 248
Default

assuming rand/srand dont work, you can do something like create "global variables" in the perl script of the
quest, something like:

Code:
$SEED = int( $npc->GetX() );
$NUMBER_OF_PHRASES = 7;
and then have a method like:

Code:
sub
generateRandom
{
    $SEED += int( $npc->GetX() );
    $SEED %= $NUMBER_OF_PHRASES;
    return $SEED;
}
and then you can do:

Code:
sub
EVENT_AGGRO
{
    quest::say( $PHRASE[ &generateRandom ] );
}
its not a perfect random number generator, but it should offer you a bootstrap until you can wire up a better random generator. you can try using srand/rand, but i do not know if they are exposed to the quest engine. you will have to redefine the phrases as an array for this (in either case) to work:

Code:
@PHRASE = 
(
    "phrase 1",
    "phrase 2", 
   # etc.
);
== sfisque

Last edited by sfisque; 06-13-2007 at 12:39 PM..
Reply With Quote
 

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 07:28 AM.


 

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