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
  #1  
Old 08-04-2008, 04:56 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default Using Variables in Quest Objects

For some reason, I can't seem to get this working. It seems like variables don't work in quest objects. I have tried many different combinations to get this working, but none seem to do what I want. Basically, I want the NPC to gate to one of the 8 possible locations when they are attacked.

This first code doesn't work at all, even though it seems to me like it should:

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 $gate = quest::ChooseRandom($warp1,$warp2,$warp3,$warp4,$warp5,$warp6,$warp7,$warp8);

$npc->SendTo($gate);

}

This second version doesn't work right either, but at least it does something. Basically, it always teleports the NPC to the $warp8 location. I am guessing it is just executing all of the 8 locations and ends up on the last one. I don't know why it is executing these even though I am only trying to define them as a variable at that point. It definitely doesn't seem to want to use the random command properly to work for quest objects. I guess they don't mix well?
Code:
sub EVENT_ATTACK {

my $warp1 = $npc->SendTo(212.9, 2628.3, 67.2);
my $warp2 = $npc->SendTo(220.8, 2708.3, 67.1);
my $warp3 = $npc->SendTo(258.9, 2712.3, 67.1);
my $warp4 = $npc->SendTo(243.3, 2658.4, 67.1);
my $warp5 = $npc->SendTo(223.8, 2658.4, 67.1);
my $warp6 = $npc->SendTo(271.9, 2604.8, 67.1);
my $warp7 = $npc->SendTo(318.4, 2678.8, 67.1);
my $warp8 = $npc->SendTo(370.4, 2677.7, 76.1);

quest::ChooseRandom($warp1,$warp2,$warp3,$warp4,$warp5,$warp6,$warp7,$warp8);

}
I know the random part it working for locations, cause I have pulled out what it is selecting by adding this into the script:

Code:
quest::say("Trying to move to loc, $gate");
This isn't the full encounter I am planning to make, but until I can get this part working, I can't complete the rest of it.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 08-04-2008 at 12:58 PM..
Reply With Quote
 


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:19 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