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

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

Reply
 
Thread Tools Display Modes
  #1  
Old 07-21-2009, 11:00 PM
eqwarrior
Sarnak
 
Join Date: Jul 2009
Location: United States
Posts: 40
Default

Thanks Trev!
Reply With Quote
  #2  
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
  #3  
Old 07-22-2009, 09:38 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Just a guess, but does there also happen to be an EVENT_SPAWN section that sets the $startingx, $startingy, $startingz, and $startingh variables that you didn't post? And if so, does leashing work effectively with multiple of the same NPCs running the same script and being aggroed at the same time? I might have to test that script out :P

I know Kayen posted this leashing script a while back in this thread, but I think it leashes NPCs to other NPCs, not to their spawn point:

http://www.eqemulator.net/forums/showthread.php?t=28131

Code:
sub EVENT_AGGRO
{
quest::settimer("LeashCheck",5);
}

sub EVENT_TIMER {

 if ($timer eq "LeashCheck") {
 $LeashedID = $entity_list->GetMobByNpcTypeID(1247);
 $distanceCHK = $LeashedID->CalculateDistance($x, $y, $z);
 #quest::shout("$distanceCHK x $LeashedID");
   	if ($distanceCHK >= 30) { 
   	$LeashedID->WipeHateList();
   	$LeashedID->GMMove($x, $y, $z, 1);
       }
  }
}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
Reply

Thread Tools
Display Modes

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:42 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 - 2026, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3