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

Quests::Custom Custom Quests here

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #29  
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
 


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:22 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3