Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 07-17-2017, 12:51 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Replied to your PM, but, posting here all to see:

Code:
sub EVENT_SPAWN {
	## both arrays below should have same number of elements, in pairs
	my @npcraces = (367,	420,	454,	458,	464,	466,	467,	469);
	my @npcsizes = (5,		3,		7,		4,		6,		5,		5,		4);
	my $elementselected = quest::ChooseRandom(0..((scalar @npcraces) - 1));
	quest::npcrace($npcraces[$elementselected]);
	quest::npcsize($npcsizes[$elementselected]);
	quest::npcgender(quest::ChooseRandom(0..1));
}

## or

sub EVENT_SPAWN {
	# keys start at 1, add as many key/value pairs as you'd like, first element in array is race, second is size
	%SpawnHash = (
		1		=>	[367, 5],
		2		=>	[420, 3],
		3		=>	[454, 7],
		4		=>	[458, 4],
	);
	my $selectedkey = quest::ChooseRandom(1..(scalar keys %SpawnHash));
	quest::npcrace($SpawnHash[$selectedkey][0]);
	quest::npcsize($npcsizes[$selectedkey][1]);
	quest::npcgender(quest::ChooseRandom(0..1)); # in case you wouldn't want to deal with it in the hash
}

## or

sub EVENT_SPAWN {
	# keys start at 1, add as many key/value pairs as you'd like, first element in array is race, second is size, third is gender
	%SpawnHash = (
		1		=>	[367, 5, 0],
		2		=>	[420, 3, 1],
		3		=>	[454, 7, 1],
		4		=>	[458, 4, 0],
	);
	my $selectedkey = quest::ChooseRandom(1..(scalar keys %SpawnHash));
	quest::npcrace($SpawnHash[$selectedkey][0]);
	quest::npcsize($SpawnHash[$selectedkey][1]);
	quest::npcgender($SpawnHash[$selectedkey][2]);
}
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 10:42 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