Thread: Random Race?
View Single Post
  #9  
Old 07-17-2017, 05:16 PM
Baelu
Sarnak
 
Join Date: Jun 2017
Posts: 30
Default

Using the following code, checked all races sizes and gender options via GM commands, but all i keep getting are tiny humans.

Code:
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		=>	[1, 6, 0],
	2		=>	[2, 7, 1],
	3		=>	[3, 6, 1],
	4		=>	[4, 5, 1],
	5		=>	[5, 6, 0],
	6		=>	[6, 5, 1],
	7		=>	[7, 5.5, 0],
	8		=>	[8, 4, 1],
	9		=>	[9, 8, 0],
	10		=>	[10, 9, 1],
	11		=>	[11, 3.5, 1],
	12		=>	[12, 3, 0],
	13		=>	[130, 7, 1],
	14		=>	[522, 6, 0],
	15		=>	[128, 6, 0],
	16		=>	[330, 5, 1],
	);
	my $selectedkey = quest::ChooseRandom(1..(scalar keys %SpawnHash));
	quest::npcrace($SpawnHash[$selectedkey][0]);
	quest::npcgender($SpawnHash[$selectedkey][2]);
	quest::npcsize($SpawnHash[$selectedkey][1]);
}
Reply With Quote