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 05-07-2009, 01:51 AM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default Leashing Mobs

Could we make it so that the NPCSPECIALATTK can have the ability to Leash ?? Perhaps set it to leash , and have it reset at 50 feet then lose agro....
Reply With Quote
  #2  
Old 05-07-2009, 05:12 AM
MNWatchdog
Hill Giant
 
Join Date: Feb 2006
Posts: 179
Default

I would think this could add a lot server overhead with the server constantly calculating mobs distance from spawn point.

Add to that tethering adding probable exploiting.
Reply With Quote
  #3  
Old 05-07-2009, 05:21 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Well, in this case, I think you would probably want to weigh the CPU overhead vs the bandwidth utilization. The only time this could possibly cause any CPU usage would be if there were a bunch of mobs all chasing someone at the same time. If that is the case, I would be more concerned about how many position updates need to go out to the client as those can add up quickly if mobs are in close range. As long as they aren't calculating distance too quickly (maybe every couple of seconds), it shouldn't be too bad.

One nice bonus is that this could possibly hinder hackers a bit. If the mob stops chasing players when they try to warp and pull to zone in or something, that would make 1 exploit a little harder to do easily.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 05-07-2009, 07:36 PM
Kayen
Developer
 
Join Date: Mar 2009
Location: -
Posts: 228
Default

Its really easy to code a leash there are very simple quest objects that can calculate distance from one npc to another. You can just run it on a timer loop/signal loop.
Reply With Quote
  #5  
Old 05-07-2009, 10:35 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

Give me an example
Reply With Quote
  #6  
Old 05-08-2009, 03:56 PM
Kayen
Developer
 
Join Date: Mar 2009
Location: -
Posts: 228
Default

I didn't test this but it should work theory, just put this on the primary mob. You don't need any code on the leashed mob.

#Place code this on the primary mob
#Lets pretend mob that is leashed to this mob is ID 1001.
#Put this on a say 30 sec timer? Even a minute would be ok. This should cause no huge increase in cpu use at all......

Code:
if ($timer eq "LeashCheck") {
 $LeashedID = $entity_list->GetMobByNpcTypeID(1001);
 $distanceCHK = $LeashedID->CalculateDistance($x, $y, $z);
#This will calculate the distance between this mob at current location
# and the mob that is leashed to it.
   if ($distanceCHK >= 500) { #Whatever distance you want
   $LeashedID->WipeHateList();
   $LeashedID0->GMMove($x, $y, $z, 1);
   #Clears hate list of leashed mob and warps it back to first mob.
   }
  }
Reply With Quote
  #7  
Old 05-08-2009, 09:32 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

Check out the gods in potimeb for an example of a leash by coords. Well it's more like a roambox that they cannot leave. You'd just need to add a line to clear their hatelist and you'd be set. Though, I am not opposed to a leash option in the code, perhaps a new table. That would enable us to easily keep fish in water.
Reply With Quote
  #8  
Old 05-11-2009, 11:56 PM
MNWatchdog
Hill Giant
 
Join Date: Feb 2006
Posts: 179
Default

Quote:
Originally Posted by cavedude View Post
Check out the gods in potimeb for an example of a leash by coords. Well it's more like a roambox that they cannot leave. You'd just need to add a line to clear their hatelist and you'd be set. Though, I am not opposed to a leash option in the code, perhaps a new table. That would enable us to easily keep fish in water.
...
Knock knock knock
Who is it?
Land Shark.
Oh, come in.
...
Reply With Quote
  #9  
Old 05-14-2009, 05:26 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

So Basically what I do there is make an invis mob where I want the mob to leash back too... called say T.pl With your code

Quote:
if ($timer eq "LeashCheck") {
$LeashedID = $entity_list->GetMobByNpcTypeID(1001);
$distanceCHK = $LeashedID->CalculateDistance($x, $y, $z);
#This will calculate the distance between this mob at current location
# and the mob that is leashed to it.
if ($distanceCHK >= 500) { #Whatever distance you want
$LeashedID->WipeHateList();
$LeashedID0->GMMove($x, $y, $z, 1);
#Clears hate list of leashed mob and warps it back to first mob.
}
}

Raid Mob ID 1001 lets say....

And the mob will Leash Back to that point right?

Just a bit confused as to how this works ..

King
Reply With Quote
  #10  
Old 05-14-2009, 05:50 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

Sorry I suck at perl some times... Does not seem to be working I put this script on an invis mob right where the named is..

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

sub EVENT_TIMER 
{

if ($timer eq "LeashCheck") {
 $LeashedID = $entity_list->GetMobByNpcTypeID(2701241);
 $distanceCHK = $LeashedID->CalculateDistance($x, $y, $z);
#This will calculate the distance between this mob at current location
# and the mob that is leashed to it.
   if ($distanceCHK >= 300) { #Whatever distance you want
   $LeashedID->WipeHateList();
   $LeashedID->GMMove($x, $y, $z, 1);
   #Clears hate list of leashed mob and warps it back to first mob.
   }
  }
The raid mob being 2701241 as you can see above...

well he won't leash back to where the invis mob is that has this script...

What am I doing wrong?
Reply With Quote
  #11  
Old 05-15-2009, 12:51 AM
Kayen
Developer
 
Join Date: Mar 2009
Location: -
Posts: 228
Default

I tested this it works.

However your implementing it wrong. There are two mobs in this leash situation. Lets set it up
NPC #1248 King_Gnoll
NPC #1247 Gnoll_Guard

You want the guard to always leash back to the king if its out of range. You put this code on the King_Gnoll.pl . The code then when runs it gets the ID of the gnoll guard, it then calcs the distance of the Gnoll_Guard from the gnoll king, if the distance is greater then 30 it leashes it back got it?

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);
       }
  }
}
Reply With Quote
  #12  
Old 05-15-2009, 01:00 AM
Kayen
Developer
 
Join Date: Mar 2009
Location: -
Posts: 228
Default

Also there is a syntax error in your code that will not make it work. You could use an invs mob instead of whatever that is up to you if you just want 1 mob leashing back to a point. Replace the king with the invs mob. Though you would need to aggro the invs mob. Better way would be to have two quest files and have the that actual mob send a signal to invs mob when aggroed to start timer.
Reply With Quote
  #13  
Old 05-15-2009, 03:10 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

How would I do this exactly ??

That's what I want to do yeah... I have the invis mob at the spawn point where the named is... I want the named to be able to leash back to that spot if he is pulled away too far..

Really appreciate your help sorry for being a n00b I'm more into the world building end of my server.

King
Reply With Quote
  #14  
Old 05-15-2009, 05:18 PM
gaeorn
Developer
 
Join Date: Apr 2009
Location: USA
Posts: 478
Default

The syntax error with the code you posted is simply a missing curly brace at the end (at least that's all I saw wrong with it).

With that fix, it should work (unless I'm missing something else) as long as the invis mob gets the timer going somehow (agro or signal as suggested earlier in this thread).
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 10:27 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