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 01-10-2009, 08:06 PM
merb
Sarnak
 
Join Date: Jul 2005
Location: Ohio
Posts: 72
Thumbs down Paying for pets

I read a post a while ago that was very useful in quest production. Basically, the quest allows a player to obtain a pet by hailing another NPC, but it isn't like a bot, more like a summoned or charmed pet. This is the original code:

Code:
sub EVENT_SAY {

if ($text=~/hail/i) {
quest::say ("I will be your pet"); 
$client->MakePet(null, TestPet, "Light Elemental");
}
}
The original code works fine (of course after I change it to match my pets database). However, this is what I am trying to achieve:

Code:
sub EVENT_SAY {

 if ($text=~/hail/i) {
   quest::say("Halt! It would not be wise to venture further alone. If you would like to hire one of my men to assist you, that could be arranged, for a [price].");
 }
 if ($text=~/price/i) {
   quest::say("A hefty sum of platinum will earn you my finest soldier; one thousand should do just fine."):
 }
 if ($platinum==1000) {
   $client->MakePet(null, elfsoldier, "an elven soldier");
 }
}
I have found that adding anything in between the hail and makepet command (such as the platinum command) doesn't work, even if its just responding to more text. I have of course edited the pet database to include the elven soldier's ID and name. Any help would be greatly appreciated!
__________________
Building Server
Legends of Time - Full Custom/Legit Roleplay, need devs
Reply With Quote
  #2  
Old 01-11-2009, 12:27 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,497
Default

Instead of the platinum part being in the EVENT_SAY block, you need it in an EVENT_ITEM one.
Reply With Quote
  #3  
Old 01-11-2009, 05:37 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

An example of how it should be is this:

Code:
sub EVENT_ITEM {
  if ($platinum==1000) {
    $client->MakePet(null, elfsoldier, "an elven soldier");
  }
}
Separate from your EVENT_SAY
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 01-11-2009, 01:51 PM
merb
Sarnak
 
Join Date: Jul 2005
Location: Ohio
Posts: 72
Default

Thanks guys, I never even gave that a thought :P

Switched it to look like this:

Code:
sub EVENT_SAY {

 if ($text=~/hail/i) {
   quest::say("Halt! It would not be wise to venture further alone. If you would like to hire one of my men to assist you, that could be arranged, for a [price].");
 }
 if ($text=~/price/i) {
   quest::say("A hefty sum of platinum will earn you my finest soldier; one thousand should do just fine.");
 }
}

sub EVENT_ITEM {

 if ($platinum==1000) {
   $client->MakePet(null, elfsoldier, "an elven soldier");
 }
}
Works like a charm!
__________________
Building Server
Legends of Time - Full Custom/Legit Roleplay, need devs

Last edited by Richardo; 01-23-2009 at 09:50 PM..
Reply With Quote
  #5  
Old 01-11-2009, 03:44 PM
Kobaz
Hill Giant
 
Join Date: Nov 2008
Location: Gold Coast, Oz
Posts: 119
Default

You also have a colon ':' instead of a semicolon ';' at the end of the 2nd quest::say line. This could easily confuse the parser if you extend that section.
Reply With Quote
Reply


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: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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3