Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Feature Requests

Development::Feature Requests Post suggestions/feature requests here.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #7  
Old 07-22-2009, 01:20 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

You could also Leash the mobs that you want to not be trained..

Here is the code for that ..

Forgot who originally wrote this for my server but it works great! Thank you to whoever that was (Striat I think).. And i apologize that I forgot who you were.

Alright so this would go at the TOP of the script

Code:
##This is npc's spawned x, y location and leash length
$leashlength = 100;


sub EVENT_COMBAT
{
	if($combat_state == 1)
	{
	quest::settimer("checkleash",5);
	}
}

NOTE: You can change that 5 to whatever number you like..

Then you can place this down near the bottom (actually doesn't matter but that is how I do it)

Code:
sub EVENT_TIMER
{
$currentx = $npc->GetX();
$currenty = $npc->GetY() ;
$currentz = $npc->GetZ();
 
	if($timer eq "checkleash") 
	{
		###This is just the equation for a sphere
		###(x - x_0 )^2 + (y - y_0 )^2 + ( z - z_0 )^2 = r^2. 
		###
 
		$leftside = ((($currentx - $startingx)*($currentx-$startingx)) + (($currenty - $startingy)*($currenty - $startingy)) + (($currentz - $startingz)*($currentz - $startingz)));
		$rightside = ($leashlength * $leashlength);
		if($leftside > $rightside)
		{
		$currentx = undef;
		$currenty = undef;
		$currentz = undef;
		$npc->WipeHateList();
		$npc->GMMove($startingx, $startingy, $startingz, $startingh);
		quest::stoptimer("checkleash");
		quest::settimer("checkleash",5);
		}
	}

Anyway hope it works for you

King
www.raidaddicts.org
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:34 AM.


 

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