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 08-04-2008, 02:25 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

try this

Code:
sub EVENT_ATTACK {

my @warp1 = (212.9, 2628.3, 67.2);
my @warp2 = (220.8, 2708.3, 67.1);
my @warp3 = (258.9, 2712.3, 67.1);
my @warp4 = (243.3, 2658.4, 67.1);
my @warp5 = (223.8, 2658.4, 67.1);
my @warp6 = (271.9, 2604.8, 67.1);
my @warp7 = (318.4, 2678.8, 67.1);
my @warp8 = (370.4, 2677.7, 76.1);
my $x, $y, $z;
($x, $y, $z)=quest::ChooseRandom(@warp1,@warp2,@warp3,@warp4,@warp5,@warp6,@warp7,@warp8);

$npc->SendTo($x, $y, $z);

}
Reply With Quote
  #2  
Old 08-04-2008, 04:36 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Thanks guys! I will give those a try and see how they work out. I appreciate the details on what is happening, AndMetal! I think it is time for me to go through some perl tutorials or something lol. If I had a better understanding of the basics, I probably wouldn't need so much help when trying to use it, lol.

I guess my main problem is that I try not to learn too much at once and I just started studying C Coding a bit. I think understanding C and Perl will be 2 things that will help me get a better understanding of what is going on for the emu and should let me be much more helpful around here.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 08-05-2008, 11:01 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Finally got it working with AndMetals code. Thanks!

Code:
sub EVENT_ATTACK {

my $rand = quest::ChooseRandom(1, 2, 3, 4, 5, 6, 7, 8);

if ($rand == 1) {$npc->SendTo(212.9, 2628.3, 67.2)}
if ($rand == 2) {$npc->SendTo(220.8, 2708.3, 67.1)}
if ($rand == 3) {$npc->SendTo(258.9, 2712.3, 67.1)}
if ($rand == 4) {$npc->SendTo(243.3, 2658.4, 67.1)}
if ($rand == 5) {$npc->SendTo(223.8, 2658.4, 67.1)}
if ($rand == 6) {$npc->SendTo(271.9, 2604.8, 67.1)}
if ($rand == 7) {$npc->SendTo(318.4, 2678.8, 67.1)}
if ($rand == 8) {$npc->SendTo(370.4, 2677.7, 76.1)}

}

The other 2 suggestions in this thread didn't seem to work though. Maybe I was missing something.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 08-06-2008, 01:37 PM
Congdar
Developer
 
Join Date: Jul 2007
Location: my own little world
Posts: 751
Default

I didn't fully test this for you, it looks like I messed up the "my" part of declaring the variables $x, $y and $z. Here's the fix (i think, still didn't test it).

@ is perl for array and each /loc is an array that gets loaded into x,y,z from
the chooserandom function
Code:
sub EVENT_ATTACK {

my @warp1 = (212.9, 2628.3, 67.2);
my @warp2 = (220.8, 2708.3, 67.1);
my @warp3 = (258.9, 2712.3, 67.1);
my @warp4 = (243.3, 2658.4, 67.1);
my @warp5 = (223.8, 2658.4, 67.1);
my @warp6 = (271.9, 2604.8, 67.1);
my @warp7 = (318.4, 2678.8, 67.1);
my @warp8 = (370.4, 2677.7, 76.1);
my($x, $y, $z)=quest::ChooseRandom(@warp1,@warp2,@warp3,@warp4,@warp5,@warp6,@warp7,@warp8);

$npc->SendTo($x, $y, $z);

}
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 11:08 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