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 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
  #2  
Old 06-09-2010, 12:44 PM
Zordana
Sarnak
 
Join Date: Jan 2010
Posts: 38
Default

wtf am i stupid? wrong forum?! -.-'
Reply With Quote
  #3  
Old 06-12-2010, 09:32 AM
Zordana
Sarnak
 
Join Date: Jan 2010
Posts: 38
Default

thanks for moving
Reply With Quote
  #4  
Old 06-12-2010, 09:36 AM
Zordana
Sarnak
 
Join Date: Jan 2010
Posts: 38
Default

moelib_spawn_block_center wont work like this, i forgot to change the RETURN line
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 07:01 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