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 08-17-2011, 03:59 AM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default Quest based on class

I am trying to make a custom quest that allows ONE NPC to give out the proper class reward with a single item turn in (For now).

Right now when I do the turn in, it ONLY works for the first line (Beastlord).


Here is what I have:

Code:
#####
#NPC: Epic Test
#Author: Warlore
#####

sub EVENT_SAY
{

my $Epic = quest::saylink("Epic");

  if($text=~/hail/i)
    {
      plugin::Whisper("Hello there $name. You have caught me at somewhat of a bad time. I am just finishing this item that I beleive will be [$Epic].");
    }
    elsif($text=~/Epic/i)
      {
        plugin::Whisper("Yes, Epic. All I need from you right now is a rusty dagger!");
      }
}

sub EVENT_ITEM
{
  if(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Beastlord")
    {
      plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
      quest::summonitem(57054);
    }
  elsif(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Bard")
    {  
      plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
      quest::summonitem(77640);
    }
  elsif(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Cleric")
    {  
      plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
      quest::summonitem(20076);
    }
  elsif(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Warrior")
    {
      plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
      quest::summonitem(60332);
    }
  elsif(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Shadowknight")
    {
      plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
      quest::summonitem(48136);
    }
  elsif(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Magician")
    {
      plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
      quest::summonitem(19839);
    }
  elsif(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Druid")
    {
      plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
      quest::summonitem(62880);
    }
  elsif(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Paladin")
    {
      plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
      quest::summonitem(48147);
    }
  elsif(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Enchanter")
    {
      plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
      quest::summonitem(52962);
    }
  elsif(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Monk")
    {
      plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
      quest::summonitem(67742);
    }
  elsif(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Berserker")
    {
      plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
      quest::summonitem(18609);
    }
  elsif(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Rogue")
    {
      plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
      quest::summonitem(52348);
    }
  elsif(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Necromancer")
    {
      plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
      quest::summonitem(64067);
    }
  elsif(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Ranger")
    {
      plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
      quest::summonitem(62649);
    }
  elsif(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Shaman")
    {
      plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
      quest::summonitem(57405);
    }
  else(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Wizard")
    {
      plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
      quest::summonitem(16576);
    }
}
When I first tested this, I composed ONLY the first line and when it worked, I simply copied and pasted the line just changing the class specified.

Code:
 if(plugin::check_handin(\%itemcount, 7007 => 1) && $class eq "Beastlord")
Any and all help with this would be great. Thank you in advance.
Reply With Quote
  #2  
Old 08-17-2011, 05:26 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

This should work for you and is a bit cleaner and easier to manage:

Code:
sub EVENT_ITEM {

	# Class => Reward,
	my %Reward = (
		"Warrior" => 60332,
		"Rogue" => 52348,
		"Monk" => 67742,
		"Berserker" => 18609,
		"Shadowknight" => 48136,
		"Paladin" => 48147,
		"Ranger" => 62649,
		"Bard" => 77640,
		"Beastlord" => 57054,
		"Cleric" => 20076,
		"Druid" => 62880,
		"Shaman" => 57405,
		"Wizard" => 16576,
		"Magician" => 19839,
		"Enchanter" => 52962,
		"Necromancer" => 64067
	);
	if($Reward{$class})
	{
		my $RewardID = $Reward{$class}; # Reward
		
		if (plugin::check_handin(\%itemcount, 7007 => 1))
		{
			quest::summonitem($RewardID);
			plugin::Whisper("Thank you for your hard work $name. Enjoy your new weapon!");
			quest::exp(1000);
			quest::ding();
		}
		else
		{
			quest::say("Sorry, $name, but I have no use for that.");
		}
	}

	plugin::return_items(\%itemcount);

}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 08-17-2011, 05:29 AM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default

Very nice. I will use this. (I am still trying to learn Perl, so all this helps me learn.)

Thank you
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 11:39 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