Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 06-03-2009, 06:44 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

If you really had a reason to use numbers for classes, it would be easy to make a hash to do it. But, it would just be extra work that isn't really needed unless you needed numbers to do a random or something. Here is an example:

Code:
%ClassConvert = (	#Convert each Class Name into a Number
	"Warrior" => 1,
	"Rogue" => 2,
	"Monk" => 3,
	"Berserker" => 4,
	"Shadowknight" => 5,
	"Paladin" => 6,
	"Ranger" => 7,
	"Bard" => 8,
	"Beastlord" => 9,
	"Cleric" => 10,
	"Druid" => 11,
	"Shaman" => 12,
	"Wizard" => 13,
	"Magician" => 14,
	"Enchanter" => 15,
	"Necromancer" => 16
);
Note: These numbers are in no particular order and are definitely not the normal order EQ knows these classes as.

Then, to get that class number, you could just do this:

Code:
my $classnum = $ClassConvert{$class};
You would want to do that conversion inside the EVENT you are using it on, so it does the conversion each time that something triggers that event so it can be accurate for the current class doing it.

Then, you can do:

Code:
if ($classnum == 1)
  quest::say("You are a Warrior!");
I am sure there are other ways to do it, but if that is something you were needing, this way should work fine for you.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #2  
Old 06-03-2009, 08:36 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

There might be a $client->GetClass() type of command also. I know when I was working on $client->GetBaseRace(), it gives an integer rather than "Erudite".
Reply With Quote
  #3  
Old 06-16-2009, 02:10 PM
Zeice
Sarnak
 
Join Date: Oct 2008
Location: USA
Posts: 92
Default

I'm just curious but can this code be used to summon more than one item for a specific class? For example if I need to summon 2 weapons for a class who dual wields. I've tried a few things but I couldn't get anything to work.



Code:
sub EVENT_ITEM {

if (($class == 'Beastlord' || $class == 'Druid' || $class == 'Monk') && ($class ne 'Warrior' && $class ne 'Cleric' && $class ne 'Bard' && $class ne 'Paladin' && $class ne 'Shadowknight' && $class ne 'Berserker' && $class ne 'Rogue' && $class ne 'Ranger' && $class ne 'Shaman' && $class ne 'Enchanter' && $class ne 'Magician' && $class ne 'Necromancer' && $class ne 'Wizard')) {
  if (plugin::check_handin(\%itemcount, 16350 => 1)) {
    my %rewards = (
"Beastlord" => 1196, "Druid" => 11281, "Monk" => 11146
    );
    
    if(defined($rewards{$class})) {
      quest::summonitem($rewards{$class});
$client->Message(6, "Sheley Courilan works to make a piece of armor from the instructions you provided to her." );
      quest::exp(10);
      quest::say ("Here you go, $name.");
    }
}
else {
 	    plugin::return_items(\%itemcount);
	}
}
}
Reply With Quote
  #4  
Old 06-16-2009, 05:09 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

For classes that get more than 1 reward as their epic 1.0, I just had to make sections for each of them:
Code:
    if (($class == 'Warrior') && ($class ne 'Shadowknight' && $class ne 'Paladin' && $class ne 'Ranger' && $class ne 'Bard' && $class ne 'Beastlord' && $class ne 'Cleric' && $class ne 'Druid' && $class ne 'Shaman' && $class ne 'Wizard' && $class ne 'Magician' && $class ne 'Enchanter' && $class ne 'Necromancer' && $class ne 'Rogue' && $class ne 'Monk' && $class ne 'Berserker'))
    {
      if (plugin::check_handin(\%itemcount, 1384 => 1, 1385 => 1, 1387 => 1)) {
        quest::summonitem(10908);
        quest::summonitem(17859);      
        $client->Message(6, "Brendor Lan'ise diligently fashions the pieces together with great skill and precision." );
        quest::exp(45000);
        quest::say ("Take care of this, $name, and it will take care of you.  You will need it for future Epic Quests.");
      }
      else {
        plugin::return_items(\%itemcount);
        #quest::say("I have no use for this item, $name.  Take it back.");
      }
    }
Though, it probably wouldn't be all too hard to rewrite it to use hashes and some IFs to make a single block like this handle rewards and turn ins for all classes.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #5  
Old 06-16-2009, 06:26 PM
Zeice
Sarnak
 
Join Date: Oct 2008
Location: USA
Posts: 92
Default

Thanks, that got it. I was trying a few things to do it in one block but I'm not knowledgeable enough in perl to do so. Using if, elsif, statements worked flawlessly.
Reply With Quote
Reply

Thread Tools
Display Modes

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:06 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