Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Plugins & Mods

Quests::Plugins & Mods Completed plugins for public use as well as modifications.

Reply
 
Thread Tools Display Modes
  #1  
Old 10-06-2010, 07:36 PM
abooble24
Fire Beetle
 
Join Date: Sep 2010
Posts: 3
Default Plugin to obtain class ID

I couldn't believe there wasn't a global $classid, so I had to make a plugin to pull it. I am using it to assign a class specific start task to a character as they are created without having to compare class string names over and over. I am sure there will be other uses for it that someone out there can come up with.

The Plugin:
Code:
sub getClassId{
	my $class = $_[0];
	%classes = (	  'Warrior', 1,
				  'Cleric', 2,
				  'Paladin', 3,
     				  'Ranger', 4,
				  'Shadowknight', 5,
				  'Druid', 6,
				  'Monk', 7,
				  'Bard', 8,
				  'Rogue', 9,
				  'Shaman', 10,
				  'Necromancer', 11,
				  'Wizard', 12,
				  'Mage', 13,
				  'Enchanter', 14,
				  'Beastlord', 15,
				  'Berserker', 16
	);
	return $classes{$class};
}
Example Usage: (Player enters zone and is assigned task if not on/completed)
Code:
sub EVENT_ENTERZONE{
	my $ClassID = plugin::getClassId($class);
	
	if(!quest::istaskactive($ClassID) && !quest::istaskcompleted($ClassID)){
		quest::assigntask($ClassID);
	}
}
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 08:33 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