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

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-09-2010, 12:40 PM
Zordana
Sarnak
 
Join Date: Jan 2010
Posts: 38
Default plugin::moelib_spawn_block, plugin::moelib_spawn_circle

hey guys,

i made a little snipet to spawn blocks and circles... the spawn block cant be rotated yet, but i wanna add that soon aswell..

Code:
#moelib_spawn_block(npctypeid, fromx, tox, fromy, toy, space, zposition=20, heading=0, grid=0)
sub moelib_spawn_block {
	my $npctypeid = $_[0];
	my $fromx = $_[1];
	my $tox = $_[2];
	my $fromy = $_[3];
	my $toy = $_[4];
	my $space = $_[5];
	my $z = $_[6] || 20;
	my $heading = $_[7] || 0;
	my $grid = $_[8] || 0;
	my $count = 0;
	for ($x = $fromx; $x <= $tox; $x += $space) {
		for ($y = $fromy; $y <= $toy; $y += $space) {
			$count++;
			quest::spawn2($npctypeid,$grid,0,($x), ($y), $z,$heading);
		}
	}
	return $count;
}

#moelib_spawn_block_center(npctypeid, centerx, centery, range, amount, zposition=20, heading=0, grid=0)
sub moelib_spawn_block_center {
	my $npctypeid = $_[0];
	my $centerx = $_[1];
	my $centery = $_[2];
	my $range = $_[3];
	my $amount = $_[4];
	my $z = $_[5] || 20;
	my $heading = $_[6] || 0;
	my $grid = $_[7] || 0;
	my $fromx = $centerx-$range;
	my $fromy = $centery-$range;
	my $tox = $centerx+$range;
	my $toy = $centery+$range;
	my $size = $range*2;
	my $space = $size / sqrt($amount);
	$fromx += ($space / 2);
	$fromy += ($space / 2);
	return spawn_block($npctypeid, $fromx, $tox, $fromy, $toy, $space, $z, $heading, $grid);
}


#moelib_spawn_circle(npctypeid, centerx, centery, radius, amount, zposition=20, heading=0, grid=0)
sub moelib_spawn_circle {
	my $npctypeid = $_[0];
	my $centerx = $_[1];
	my $centery = $_[2];
	my $radius = $_[3];
	my $amount = $_[4];
	my $z = $_[5] || 20;
	my $heading = $_[6] || 0;
	my $grid = $_[7] || 0;
	
	my $a = (2*3.14159)/$amount;
	for ($i = 0; $i < $amount; $i++) {
		$x = int(cos($a*$i)*$radius) + ($centerx - ($radius / 2));
		$y = int(sin($a*$i)*$radius) + ($centery - ($radius / 2));
		quest::spawn2($npctypeid, $grid, 0, ($x), ($y), $z, $heading);
	}
}


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