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
  #6  
Old 11-11-2012, 11:06 AM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

You have syntax errors all over the place.

As a general rule of thumb, for every left bracket, there is a closing right bracket. If there's an if statement, a bracket follows that if statement to encapsulate the following commands.

For example,
sub EVENT_SAY { <-- Starting bracket for SUB_EVENT
if($name eq "Penny")
{ - If the name matches "Penny", do the below command.
quest::say("Hi Penny!");
} - Close the if statement
} - Close the subroutine.

I recommend taking a tutorial on perl. It will teach you elementary concepts about the scripting language.

http://www.tizag.com/perlT/

Furthermore, remember that you can set quest globals in order to save your variables past zoning, zone shutdown, or client desync. There are examples littered over this forum as well as on the EQEmulator wiki for a detailed description of how they work.

If you aren't ready to learn about that, using a simple variable would be good enough to track paid status. You would still have to kill the player's pet by depopping it by client ID, but this should get you started on checking a timer. Alternatively, use makepet to spawn a pet by NPC ID, assign a script to the pet in the templates folder.

The alternative would be something like what i listed below.

Code:
sub EVENT_ITEM {
if(($platinum == 5)) {
$client->MakePet(0, Trillion, "Trillion"); #change this to a static NPC types ID
}
else
{
quest::say("That's not 5 platinum, $name!");
}
}

sub EVENT_SAY {
if($text=~/Hail/i) {
quest::say("I am for hire, $name, and I'm currently charging 5pp per hour, Want me to fight for you $class?, just pass me 5pp");
}
}
You'll have to do the NPC script seperate, but basically hand your pet 5 plat every so often to make sure it doesn't despawn.

Hope that helps.
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 09:03 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