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 02-02-2022, 03:42 PM
Jorin
Sarnak
 
Join Date: Aug 2018
Posts: 48
Default Class Specific Items

So am trying to write a basic little quest that gives an item based on the players class. Havent been able to find much info regarding it but this is what Im currently using. It doesnt summon anything it just says item 0 doesnt exist for some reason.

Code:
sub EVENT_SAY {
   	my %rewards = (
		"Warrior" => 135015,
		"Cleric" => 135015,
		"Paladin" => 135015,
		"Ranger" => 135008,
		"Shadowknight" => 135015,
		"Druid" => 135022,
		"Monk" => 135029,
		"Bard" => 135015,
		"Rogue" => 135008,
		"Shaman" => 135008,
		"Necromancer" => 135001,
		"Wizard" => 135001,
		"Magician" => 135001,
		"Enchanter" => 135001,
		"Beastlord" => 147496..147502,
		"Berserker" => 135008
	);
   my $help = quest::saylink("help", 1);

   
   if ($text=~/hail/i) {
         if (defined $qglobals{"New"} && $qglobals{"New"} == 4) {
            plugin::Whisper("Hello again $name. Come to browse my wares?");
		} else {
            plugin::Whisper("Hello $name! I see you are new here, allow me to $help you out!");
        }
    } elsif ($text=~/help/i) {
        if (defined $qglobals{"New"} && $qglobals{"New"} >= 4 && $qglobals{"New"} >= 4) {        
	plugin::Whisper("I already helped you $name!");
        } else {
            plugin::Whisper("Please take these items as a show of good faith!");
        quest::summonitem($Reward{$class});
		quest::summonitem(147495);
		quest::setglobal("New", 4, 5, "F");
		}
}
}

sub EVENT_SPAWN {
    plugin::SetMobColor(quest::ChooseRandom(0..255), quest::ChooseRandom(0..255), quest::ChooseRandom(0..255));
}
Reply With Quote
  #2  
Old 02-02-2022, 08:39 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

$rewards{$class}

if you want to find simple mistakes like this just open a command prompt in the folder that has the perl script and just type...

perl -cw scriptname.pl


This will show any errors as well as give warns like... how you are using a variable that is undefined because of a typo

Last edited by NatedogEZ; 02-03-2022 at 12:19 PM..
Reply With Quote
  #3  
Old 02-07-2022, 05:49 PM
Jorin
Sarnak
 
Join Date: Aug 2018
Posts: 48
Default

Thanks Nate. Couldnt remember how to do that so I appreciate the tip as well! Cant believe I completely missed that lol
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:49 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