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 07-25-2007, 09:32 PM
EliteSting
Sarnak
 
Join Date: May 2005
Posts: 58
Default Armor quest script

Ok , I'm a newbie at Perl , but I'm slowly figuring it out. This quest script is for a PC to hand in an armor pattern , and get in return an armor piece based on what class they are. The quest text works , but when I hand a pattern in it doesn't give me anything in return. Would anyone please tell me what I'm doing wrong ? Thank you !

Code:
sub EVENT_SAY
{  if($text=~/Hail/i){quest::say("Hello hello, traveler. What brings you here, into this horrible place, the god's are kind to you ! Are you lost ? Perhaps you came by to [assist] me ?"); } if($text=~/assist/i){quest::say("Well, it would certainly help me. See I'm trying to become a worthwhile armor smith , but without the [cooperation from the god's] it's just not possible."); }
if($text=~/cooperation from the god's/i){quest::say("Long time ago, this place used to be peaceful, until the god's came and [vanquished] almost all of it.");} if($text=~/vanquished/i){quest::say("Havent you heard the story ? Well I'm not going to bother you with that [tale], perhaps some other time I will tell you.");}
if($text=~/tale/i){quest::say("Well ... no I shouldn't. What you could do for me is bring back to me [ornate armor patterns] so that I may practice my trade. .");}
if($text=~/ornate armor patterns/i){quest::say("That would be most helpful. However , these patterns are [not easy to come by].");}
if($text=~/not easy to come by/i){quest::say("Must you repeat everything I say? Are you daft of mind? Were you dropped as a child? No more questions! Now go forth , and bring me those patterns!");}
}

sub EVENT_ITEM
{
if ($itemcount{16290})
{
if ($class == 'Shaman'); quest::summonitem(9829); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Ranger'); quest::summonitem(9820); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Rogue'); quest::summonitem(9805); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
}
{
if ($itemcount{16291})
{
if ($class == 'Shaman'); quest::summonitem(15773); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Ranger'); quest::summonitem(15764); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Rogue'); quest::summonitem(15474); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
}
{
if ($itemcount{16292})
{
if ($class == 'Shaman'); quest::summonitem(11518); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Ranger'); quest::summonitem(11446); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Rogue'); quest::summonitem(11431); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
}
{
if ($itemcount{16293})
{
if ($class == 'Shaman'); quest::summonitem(11273); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Ranger'); quest::summonitem(11180); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Rogue'); quest::summonitem(11140); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
}
{
if ($itemcount{16294})
{
if ($class == 'Shaman'); quest::summonitem(13569); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Ranger'); quest::summonitem(12666); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Rogue'); quest::summonitem(12597); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
}
{
if ($itemcount{16295})
{
if ($class == 'Shaman'); quest::summonitem(16801); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Ranger'); quest::summonitem(16775); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Rogue'); quest::summonitem(16711); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
}
{
if ($itemcount{16296})
{
if ($class == 'Shaman'); quest::summonitem(20077); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Ranger'); quest::summonitem(19837); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Rogue'); quest::summonitem(19442); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
}
{
if ($itemcount{16347})
{
if ($class == 'Monk'); quest::summonitem(9808); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Beastlord'); quest::summonitem(9823); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Druid'); quest::summonitem(9832); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
{
if ($class == 'Berzerker'); quest::summonitem(55505); quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");}
}
}
__________________
Drizlaru
(Jest Server OP)
JestEmulator.net
Reply With Quote
  #2  
Old 07-26-2007, 02:45 AM
Blakine
Sarnak
 
Join Date: Jul 2007
Posts: 30
Default

Try enclosing the item to be summoned in double quotes, for example:

Code:
quest::summonitem("15773");
Reply With Quote
  #3  
Old 07-26-2007, 02:51 AM
sfisque
Hill Giant
 
Join Date: Oct 2006
Posts: 248
Default

if in doubt, always run your quest script against the PERL interpreter natively from command line. if it exits quietly, the quest at least is syntactically correct.

if you get output like, say:

sfisque@cthulhu:~/lab$ perl quest.pl
syntax error at quest.pl line 13, near ");"
syntax error at quest.pl line 15, near ");"
syntax error at quest.pl line 17, near ");"
syntax error at quest.pl line 22, near ");"
syntax error at quest.pl line 24, near ");"
syntax error at quest.pl line 26, near ");"
syntax error at quest.pl line 31, near ");"
syntax error at quest.pl line 33, near ");"
syntax error at quest.pl line 35, near ");"
syntax error at quest.pl line 40, near ");"
quest.pl has too many errors.

then you need to fix the script first.

== sfisque

ps: free hint, double check your IF syntax
Reply With Quote
  #4  
Old 07-26-2007, 03:04 AM
Blakine
Sarnak
 
Join Date: Jul 2007
Posts: 30
Default

Excellent tip sfisque, thanks!
Reply With Quote
  #5  
Old 07-26-2007, 07:44 AM
EliteSting
Sarnak
 
Join Date: May 2005
Posts: 58
Default

Awsome ! Thanks for the info !
__________________
Drizlaru
(Jest Server OP)
JestEmulator.net
Reply With Quote
  #6  
Old 07-26-2007, 09:09 AM
Striat
Sarnak
 
Join Date: Aug 2006
Posts: 60
Default

You could write it this way using your syntax to fix it:

*NOTE -- I've omitted sub EVENT_SAY for thread length reasons

Code:
sub EVENT_ITEM {
if ($itemcount{16290}) {
if ($class == 'Shaman') {
	quest::summonitem(9829); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Ranger') { 
	quest::summonitem(9820); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Rogue') {
	quest::summonitem(9805); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
}

if ($itemcount{16291}) {
if ($class == 'Shaman') {
	quest::summonitem(15773); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}

if ($class == 'Ranger') {
	quest::summonitem(15764); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Rogue') {
	quest::summonitem(15474); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
}
if ($itemcount{16292}) {
if ($class == 'Shaman') {
	quest::summonitem(11518); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Ranger') {
	quest::summonitem(11446);
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Rogue') {
	quest::summonitem(11431); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
}
if ($itemcount{16293})  {
if ($class == 'Shaman') {
	quest::summonitem(11273); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Ranger') {
	quest::summonitem(11180); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Rogue') {
	quest::summonitem(11140); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
}
if ($itemcount{16294})  {
if ($class == 'Shaman') {
	quest::summonitem(13569); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Ranger') { 
	quest::summonitem(12666); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Rogue') {
	quest::summonitem(12597); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
}
if ($itemcount{16295})  {
if ($class == 'Shaman') {
	quest::summonitem(16801); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Ranger') {
	quest::summonitem(16775); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Rogue') {
	quest::summonitem(16711); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
}
if ($itemcount{16296})  {
if ($class == 'Shaman') {
	quest::summonitem(20077); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Ranger') {
	quest::summonitem(19837); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Rogue') {
	quest::summonitem(19442); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
}
if ($itemcount{16347})  {
if ($class == 'Monk') {
	quest::summonitem(9808); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Beastlord') {
	quest::summonitem(9823); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Druid') {
	quest::summonitem(9832); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
if ($class == 'Berserker') {
	quest::summonitem(55505); 
	quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
	}
}
}
While that would work, I strongly recommend the following script:

Code:
sub EVENT_ITEM {
if ($class == 'Shaman' || $class == 'Ranger' || $class == 'Rogue') {
  if (plugin::check_handin(\%itemcount, 16290 => 1)) {
    my %rewards = (
      "Shaman" => 9829, "Ranger" => 9820, "Rogue" => 9805
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
    }
	else {
	plugin::return_items(\%itemcount); 
    	quest::say("I did not ask for this from you, $name.");
	}
	}
}
  if ($class == 'Shaman' || $class == 'Ranger' || $class == 'Rogue') {
  if (plugin::check_handin(\%itemcount, 16291 => 1)) {
    my %rewards = (
      "Shaman" => 15773, "Ranger" => 15764, "Rogue" => 15474
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
    }
	else {
	plugin::return_items(\%itemcount); 
    	quest::say("I did not ask for this from you, $name.");
	}
  	}
}

if ($class == 'Shaman' || $class == 'Ranger' || $class == 'Rogue') {
  if (plugin::check_handin(\%itemcount, 16292 => 1)) {
    my %rewards = (
      "Shaman" => 11518, "Ranger" => 11446, "Rogue" => 11431
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
    }
	else {
	plugin::return_items(\%itemcount); 
    	quest::say("I did not ask for this from you, $name.");
	}
	}
  }

if ($class == 'Shaman' || $class == 'Ranger' || $class == 'Rogue') {
  if (plugin::check_handin(\%itemcount, 16293 => 1)) {
    my %rewards = (
      "Shaman" => 11273, "Ranger" => 11180, "Rogue" => 11140
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
    }
	else {
	quest::summonitem(16293);
    	quest::say("I did not ask for this from you, $name.");
	}
	}
  }
if ($class == 'Shaman' || $class == 'Ranger' || $class == 'Rogue') {
  if (plugin::check_handin(\%itemcount, 16294 => 1)) {
    my %rewards = (
      "Shaman" => 13569, "Ranger" => 12666, "Rogue" => 12597
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
    }
	else {
	quest::summonitem(16294);
    	quest::say("I did not ask for this from you, $name.");
	}
	}
  }

if ($class == 'Shaman' || $class == 'Ranger' || $class == 'Rogue') {
  if (plugin::check_handin(\%itemcount, 16295 => 1)) {
    my %rewards = (
      "Shaman" => 16801, "Ranger" => 16775, "Rogue" => 16711
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
    }
	else {
	quest::summonitem(16295);
    	quest::say("I did not ask for this from you, $name.");
	}
	}
  }

if ($class == 'Shaman' || $class == 'Ranger' || $class == 'Rogue') {
  if (plugin::check_handin(\%itemcount, 16296 => 1)) {
    my %rewards = (
      "Shaman" => 20077, "Ranger" => 19837, "Rogue" => 19442
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
    }
	else {
	quest::summonitem(16296);
    	quest::say("I did not ask for this from you, $name.");
	}
	}
  }

if ($class == 'Monk' || $class == 'Beastlord' || $class == 'Druid' || $class == 'Berserker') {
  if (plugin::check_handin(\%itemcount, 16347 => 1)) {
    my %rewards = (
      "Monk" => 9808, "Beastlord" => 9823, "Druid" => 9832, "Berserker" => 55505
    );

    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
      quest::emote("summons a great armor from the pattern and hands it to you. 'Here you go $name.'");
    }
	else {
    	quest::say("I did not ask for this from you, $name.");
	quest::summonitem(16347);
	}
	}
  }
	plugin::return_items(\%itemcount); 
}
Now, you could still do some clean up with this script and make the return_items at the end a little prettier. However, it does its job: Accepts turn ins from the appropriate class only. Otherwise, items are returned. Furthermore, inappropriate items are returned everytime.
Reply With Quote
  #7  
Old 07-27-2007, 04:55 AM
EliteSting
Sarnak
 
Join Date: May 2005
Posts: 58
Default

wow yeah thats alot better then mine , thanks !~
__________________
Drizlaru
(Jest Server OP)
JestEmulator.net
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 12:10 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3