View Single Post
  #7  
Old 05-29-2011, 12:20 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,072
Default

Quote:
Originally Posted by ChaosSlayerZ View Post
well true, I was just surprised, cause usually plugins used for some really complex shit that normally takes 5-20 lines of code to do something
Doesn't always have to be.

Could be as simple as

plugin::SetProx(20, 20);

All reducing redundant and simple code:

Code:
#Akkadius
#Usage plugin::SetProx(X/Y Axis Range, Z Axis Range);
sub SetProx{	
	my $Range = $_[0];
	my $Z = $_[1];
	my $x = plugin::val('$x');
	my $y = plugin::val('$y');
	my $npc = plugin::val('$npc');
	my $z = $npc->GetZ();
	quest::set_proximity($x - $Range, $x + $Range, $y - $Range, $y + $Range, $z - $Z, $z + $Z);
	}
Reply With Quote