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 04-23-2006, 01:19 PM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default Class Specific quest

I am attempting to make a quest in my noobie zone that gives class specific rewards. However when you hail him, he gives you the text, but then when you hand him a mold for your wep he does nothing :( Can anyone tell me what is wrong in the format for this? Thank you any that can reply and help me get this working.

Code:
sub EVENT_SAY {
    if ($text=~/hail/i) {
      quest::say("Hello $name , I am one of the finest weaponsmiths this land has ever seen. If you find me a mold I will craft you a weapon. However if it is armor you seek, my brother makes the best around.");}
    }
    
sub EVENT_ITEM {
  if ($class == Warrior)
    (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(62189);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    elsif ($class == Paladin)
      (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(62189);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    elsif ($class == Shadow Knight) {
      (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(62189);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    elsif ($class == Berserker) {
      (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(62189);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    elsif ($class == Monk) {
      (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(6611);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    elsif ($class == Beastlord) {
      (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(6611);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    elsif ($class == Druid) {
      (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    elsif ($class == Necromancer) {
      (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }    
    elsif ($class == Wizard) {
      (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    elsif ($class == Magician) {
      (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    elsif ($class == Enchanter) {
      (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    elsif ($class == Shaman) {
      (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    elsif ($class == Cleric) {
      (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29442);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    else {
      plugin::return_items(\%itemcount); 
      quest::say("These are not the pieces I need.");
  }
}
Also note that I have tried this with the class name typed out like in my posted code. and with the class ID#. Same result both ways.
elsif ($class == Paladin)

Last edited by paaco; 04-23-2006 at 09:33 PM..
Reply With Quote
  #2  
Old 04-24-2006, 02:06 AM
fathernitwit
Developer
 
Join Date: Jul 2004
Posts: 773
Default

if($class == "Warrior")

missing quotes
Reply With Quote
  #3  
Old 04-24-2006, 02:16 AM
Muuss
Dragon
 
Join Date: May 2003
Posts: 539
Default

Code:
sub EVENT_ITEM {
  if ($class == Warrior)
    (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(62189);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
missing && between $class=="Warrior" and the check_handin
or miswritten tests.

I would write it that way :

Code:
sub EVENT_ITEM {
  if (($class == "Warrior") && (plugin::check_handin(\%itemcount, 6164 => 1))) {
      quest::summonitem(62189);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }

  if (($class == "Paladin") && (plugin::check_handin(\%itemcount, 6164 => 1))) {
      quest::summonitem(62189);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }

   ...
   ...
  plugin::return_items(\%itemcount);
}
__________________
Muuss - [PEQGC] Dobl, the ogre that counts for 2 !
http://www.vilvert.fr/page.php?id=10
Reply With Quote
  #4  
Old 04-24-2006, 02:25 AM
Muuss
Dragon
 
Join Date: May 2003
Posts: 539
Default

Forgot to write this, after you wrote a quest, you can test its syntax with perl :

Code:
perl -cw 'questfile.pl'
This will help you to fix some of the errors you made.
__________________
Muuss - [PEQGC] Dobl, the ogre that counts for 2 !
http://www.vilvert.fr/page.php?id=10
Reply With Quote
  #5  
Old 04-24-2006, 04:25 AM
Muuss
Dragon
 
Join Date: May 2003
Posts: 539
Default

What i wrote previously has a correct syntax but won't work due to recent changes in the plugin::check_handin method.

You MUST write your quest like that :

Code:
sub EVENT_ITEM {
  if ($class =="Warrior") {
    if (plugin::check_handin(\%itemcount, 6164 => 1)) {
       ... do stuff here
    }
  }

  if ($class == "Paladin") {
    if (plugin::check_handin(\%itemcount, 6164 => 1)) {
       ... do stuff here
    }
  }

  ...
  ...

  plugin::return_items(\%itemcount);
}
In my previous code, the test for the paladin would never be valid because the item will disappear of the list during the warrior's test. I m still not used to that new check_handin, sorry for the error
__________________
Muuss - [PEQGC] Dobl, the ogre that counts for 2 !
http://www.vilvert.fr/page.php?id=10
Reply With Quote
  #6  
Old 04-24-2006, 05:20 AM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default

Thanks a lot guys, With the info you gave I'm sure I can get it working.
Reply With Quote
  #7  
Old 04-24-2006, 06:18 AM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default

After updating my quest to what you guys suggested It still doesn't want to work. Any more suggestions? Or maybe I overloocked something.

Code:
sub EVENT_SAY {
    if ($text=~/hail/i) {
      quest::say("Hello $name , I am one of the finest weaponsmiths this land has ever seen. If you find me a mold I will craft you a weapon. However if it is armor you seek, my brother makes the best around."); }
    }
    
sub EVENT_ITEM {
  if ($class =="Warrior") {
    if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(62189);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class == "Paladin")
    if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(62189);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class == "Shadow Knight") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(62189);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class == "Berserker") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(62189);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class == "Monk") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(6611);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class == "Beastlord") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(6611);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class == "Druid") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class == "Necromancer") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }    
  if ($class == "Wizard") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class == "Magician") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class == "Enchanter") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class == "Shaman") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class == "Cleric") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29442);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
    else {
      plugin::return_items(\%itemcount); 
      quest::say("These are not the pieces I need.");
  }
}
Reply With Quote
  #8  
Old 04-24-2006, 06:58 AM
jimbabwe
Hill Giant
 
Join Date: Aug 2005
Posts: 107
Default

you were missing a bracket in the paladin's code

Code:
sub EVENT_SAY 
{
    	if ($text=~/hail/i) 
	{
      		quest::say("Hello $name , I am one of the finest weaponsmiths this land has ever seen. If you find me a mold I will craft you a weapon. However if it is armor you seek, my brother makes the best around."); 
	}
}
    
sub EVENT_ITEM 
{
	if ($class =="Warrior") 
	{
    		if (plugin::check_handin(\%itemcount, 6164 => 1)) 
		{
		      quest::summonitem(62189);
		      quest::exp(750);
		      quest::emote("smiles warmly as he hands you your weapon.");
		      quest::ding(); 
    		}
    	}

  	if ($class == "Paladin")
    	{
		if (plugin::check_handin(\%itemcount, 6164 => 1)) 
		{
      			quest::summonitem(62189);
		        quest::exp(750);
		        quest::emote("smiles warmly as he hands you your weapon.");
			quest::ding(); 
    		}
    	}
	if ($class == "Shadow Knight") 
	{
     		if (plugin::check_handin(\%itemcount, 6164 => 1)) 
		{
      			quest::summonitem(62189);
      			quest::exp(750);
      			quest::emote("smiles warmly as he hands you your weapon.");
      			quest::ding(); 
    		}
    	}
  	if ($class == "Berserker") 
	{
    		if (plugin::check_handin(\%itemcount, 6164 => 1)) 
		{
      			quest::summonitem(62189);
      			quest::exp(750);
      			quest::emote("smiles warmly as he hands you your weapon.");
      			quest::ding(); 
    		}
    	}
  	if ($class == "Monk") 
	{
     		if (plugin::check_handin(\%itemcount, 6164 => 1)) 
		{
		      	quest::summonitem(6611);
      			quest::exp(750);
      			quest::emote("smiles warmly as he hands you your weapon.");
      			quest::ding(); 
    		}
    	}
  	if ($class == "Beastlord") 
	{
     		if (plugin::check_handin(\%itemcount, 6164 => 1)) 
		{
      			quest::summonitem(6611);
      			quest::exp(750);
      			quest::emote("smiles warmly as he hands you your weapon.");
      			quest::ding(); 
    		}
    	}
  	if ($class == "Druid") 
	{
     		if (plugin::check_handin(\%itemcount, 6164 => 1)) 
		{
      			quest::summonitem(29422);
      			quest::exp(750);
      			quest::emote("smiles warmly as he hands you your weapon.");
      			quest::ding(); 
    		}
    	}
  	if ($class == "Necromancer") 
	{
     		if (plugin::check_handin(\%itemcount, 6164 => 1)) 
		{
      			quest::summonitem(29422);
      			quest::exp(750);
      			quest::emote("smiles warmly as he hands you your weapon.");
      			quest::ding(); 
    		}
    	}    
  	if ($class == "Wizard") 
	{
     		if (plugin::check_handin(\%itemcount, 6164 => 1)) 
		{
      			quest::summonitem(29422);
		        quest::exp(750);
      			quest::emote("smiles warmly as he hands you your weapon.");
      			quest::ding(); 
    		}
    	}
  	if ($class == "Magician") 
	{
     		if (plugin::check_handin(\%itemcount, 6164 => 1)) 
		{
      			quest::summonitem(29422);
      			quest::exp(750);
      			quest::emote("smiles warmly as he hands you your weapon.");
      			quest::ding(); 
    		}
    	}
  	if ($class == "Enchanter") 
	{
     		if (plugin::check_handin(\%itemcount, 6164 => 1)) 
		{
      			quest::summonitem(29422);
      			quest::exp(750);
      			quest::emote("smiles warmly as he hands you your weapon.");
      			quest::ding(); 
    		}
    	}
  	if ($class == "Shaman") 
	{
     		if (plugin::check_handin(\%itemcount, 6164 => 1)) 
		{
      			quest::summonitem(29422);
      			quest::exp(750);
      			quest::emote("smiles warmly as he hands you your weapon.");
      			quest::ding(); 
    		}
    	}
  	if ($class == "Cleric") 
	{
     		if (plugin::check_handin(\%itemcount, 6164 => 1)) 
		{
      			quest::summonitem(29442);
      			quest::exp(750);
      			quest::emote("smiles warmly as he hands you your weapon.");
      			quest::ding(); 
    		}
    	}
    	else 
	{
      		plugin::return_items(\%itemcount); 
      		quest::say("These are not the pieces I need.");
  	}
}
You may try formatting your code like that as it can be a lot easier to keep track of brackets and code segments.
Reply With Quote
  #9  
Old 04-24-2006, 07:04 AM
Cisyouc
Demi-God
 
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
Default

Aren't you supposed to use the eq operator and not the == operator for strings?

if($class eq 'Warrior') { /* ... */ }
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
Reply With Quote
  #10  
Old 04-24-2006, 08:12 AM
Muuss
Dragon
 
Join Date: May 2003
Posts: 539
Default

Using eq instead of == is a good idea, yes

About the else at the end of your code. It has no sense.

just add plugin::return_items(\%itemcount); without test.

check_handin verifies that you gave the right amount of items and removes them of the list of given items.

At the end of the quest, you call return_items to give back to the player each item that remains in the list. Don't include it in a test, just do it or don't do it.
__________________
Muuss - [PEQGC] Dobl, the ogre that counts for 2 !
http://www.vilvert.fr/page.php?id=10
Reply With Quote
  #11  
Old 04-24-2006, 08:58 AM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default

The quest works now, thank all of you guys for your hard work and patience helping me get it going. Posting the working code, maybe it will help someone else looking to make a class specific quest.

Code:
sub EVENT_SAY {
    if ($text=~/hail/i) {
      quest::say("Hello $name , I am one of the finest weaponsmiths this land has ever seen. If you find me a mold I will craft you a weapon. However if it is armor you seek, my brother makes the best around.");}
    }
    
sub EVENT_ITEM {
  if ($class eq "Warrior") {
    if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(62189);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class eq "Paladin") {
    if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(62189);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class eq "Shadow Knight") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(62189);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class eq "Berserker") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(62189);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class eq "Monk") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(6611);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class eq "Beastlord") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(6611);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class eq "Druid") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class eq "Necromancer") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }    
  if ($class eq "Wizard") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class eq "Magician") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class eq "Enchanter") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class eq "Shaman") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29422);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
  if ($class eq "Cleric") {
     if (plugin::check_handin(\%itemcount, 6164 => 1)) {
      quest::summonitem(29442);
      quest::exp(750);
      quest::emote("smiles warmly as he hands you your weapon.");
      quest::ding(); 
    }
    }
      plugin::return_items(\%itemcount); 
      quest::say("These are not the pieces I need.");
  }
}
Reply With Quote
  #12  
Old 04-24-2006, 09:20 AM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default

ok actually it doesn't work lol. This quest is starting to get old :( When you hand in the item now this stuff happens:
quest::exp(750);
quest::emote("smiles warmly as he hands you your weapon.");
quest::ding();

But instead of summoning the correct item for you, he hands you back the mold and says:
These are not the pieces I need.

So basically you can stand there and hand the mold in over and over until you reach max lvl if you want to do 10k turnins =/
Reply With Quote
  #13  
Old 04-24-2006, 12:02 PM
jimbabwe
Hill Giant
 
Join Date: Aug 2005
Posts: 107
Default

i got it working, let me finish it and i'll post it
Reply With Quote
  #14  
Old 04-24-2006, 01:00 PM
jimbabwe
Hill Giant
 
Join Date: Aug 2005
Posts: 107
Default

I added a few comments into the file for you, so you can tweak usability.

Code:
#this quest will work for any class as is, however it just gives xp to rogues, rangers, and bards
#this can be fixed by moving the emote, exp and ding functions into the if statements individually.
sub EVENT_SAY 
{
    	if ($text=~/hail/i) 
	{
      	quest::say("Hello $name , I am one of the finest weaponsmiths this land has ever seen. If you find me a mold I will craft you a weapon. However if it is armor you seek, my brother makes the best around."); 
	}
}
    
sub EVENT_ITEM 
{
	if (plugin::check_handin(\%itemcount, 6164 => 1))
	{
		if(($class eq "Warrior") || ($class eq "Paladin") || ($class eq "Shadowknight") || ($class eq "Berserker"))
		{
			quest::summonitem('62189');
		} 
		if(($class eq "Monk") || ($class eq "Beastlord"))
		{
			quest::summonitem('6611');
		} 
		if(($class eq "Druid") || ($class eq "Necromancer") || ($class eq "Magician") || ($class eq "Wizard") || ($class eq "Enchanter") || ($class eq "Cleric"))
		{
			quest::summonitem('29442');
		}
	 	quest::emote("smiles warmly as he hands you your weapon.");
		quest::exp(750);
		quest::ding(); 
    	}
	elsif(plugin::return_items(\%itemcount))
	{
		#this command isn't working.  maybe quest::return_items returns a false value when it gives soemthing back.
		quest::say("These are not the pieces I need.");
	}
}

EDIT: oh, I only tested this on bards, warriors, and wizards... could be bugs.
Reply With Quote
  #15  
Old 04-24-2006, 01:06 PM
paaco
Discordant
 
Join Date: Jan 2005
Posts: 320
Default

Nice, thank you Jimbabwe, I'll try this out
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 10:01 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