This is another very simple, yet very useful plugin to help with speed in developing. I am going through and consolidating my plugins to be more appropriately placed for public use so you will see more on the way. This plugin sub routine is called "SetProx", takes to simple arguments and sets your mob's proximity trigger for whatever your heart desires:
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);
}
return 1;
EXAMPLE:
Note: This example requires anim.pl plugins from the repository to function correctly
Code:
sub EVENT_SPAWN{
plugin::SetProx(20, 10);
quest::settimer("spawn", 5);
}
sub EVENT_ENTER{
plugin::SetAnim("stand");
}
sub EVENT_TIMER{
if ($timer eq "spawn"){
plugin::SetAnim("sit");
quest::stoptimer("spawn");
}
}
So in this case your mob spawns and then sits down. Whenever the proximity range is triggered (20 integers wide, and 10 integers up and down) the mob will stand up to your attention.
This would be the result of before and after of a script like this. Very simple. Just cuts down time of repeatedly doing the same functions instead of copy and pasting scripts pieces.
This is available in the latest repository, see sticky.