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 12-02-2010, 08:49 PM
Kayen
Developer
 
Join Date: Mar 2009
Location: -
Posts: 228
Default plugin::CountNPCTYPE

Usage: plugin::CountNPCTYPE($NPC_TYPE_ID);

Counts the number of NPC's in a zone that have the same npc type id.

Code:
sub CountNPCTYPE {

	my $npc = plugin::val('npc');
	my $entity_list = plugin::val('$entity_list');
	my $NPC_TYPE_ID = $_[0];

	@npclist = $entity_list->GetNPCList();

		$Count_NPC_TYPE = 0;
     		foreach $cur (@npclist) {
		my $NPC_TYPEid = $cur->GetNPCTypeID(); 
				
			if ($NPC_TYPEid == $NPC_TYPE_ID) { 
			$Count_NPC_TYPE++;
			}
		}
	return $Count_NPC_TYPE;
}
Kayen
GM Storm Haven
Reply With Quote
  #2  
Old 12-02-2010, 10:35 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by Kayen View Post
Usage: plugin::CountNPCTYPE($NPC_TYPE_ID);

Counts the number of NPC's in a zone that have the same npc type id.

Code:
sub CountNPCTYPE {

	my $npc = plugin::val('npc');
	my $entity_list = plugin::val('$entity_list');
	my $NPC_TYPE_ID = $_[0];

	@npclist = $entity_list->GetNPCList();

		$Count_NPC_TYPE = 0;
     		foreach $cur (@npclist) {
		my $NPC_TYPEid = $cur->GetNPCTypeID(); 
				
			if ($NPC_TYPEid == $NPC_TYPE_ID) { 
			$Count_NPC_TYPE++;
			}
		}
	return $Count_NPC_TYPE;
}
Kayen
GM Storm Haven
Put this in npc_tools.pl - Revision 4
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 10:32 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3