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 12-04-2010, 07:57 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default plugin::SetProx(X/Y Axis Range, Z Axis Range);

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.
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:03 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