|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Development::Feature Requests Post suggestions/feature requests here. |
05-07-2009, 01:51 AM
|
Banned
|
|
Join Date: Sep 2006
Posts: 841
|
|
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....
|
05-07-2009, 05:12 AM
|
Hill Giant
|
|
Join Date: Feb 2006
Posts: 179
|
|
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.
|
05-07-2009, 05:21 AM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
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.
|
05-07-2009, 07:36 PM
|
Developer
|
|
Join Date: Mar 2009
Location: -
Posts: 228
|
|
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.
|
05-07-2009, 10:35 PM
|
Banned
|
|
Join Date: Sep 2006
Posts: 841
|
|
Give me an example
|
05-08-2009, 03:56 PM
|
Developer
|
|
Join Date: Mar 2009
Location: -
Posts: 228
|
|
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.
}
}
|
05-08-2009, 09:32 PM
|
|
The PEQ Dude
|
|
Join Date: Apr 2003
Location: -
Posts: 1,988
|
|
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.
|
05-11-2009, 11:56 PM
|
Hill Giant
|
|
Join Date: Feb 2006
Posts: 179
|
|
Quote:
Originally Posted by cavedude
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.
...
|
05-14-2009, 05:26 PM
|
Banned
|
|
Join Date: Sep 2006
Posts: 841
|
|
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
|
05-14-2009, 05:50 PM
|
Banned
|
|
Join Date: Sep 2006
Posts: 841
|
|
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?
|
05-15-2009, 12:51 AM
|
Developer
|
|
Join Date: Mar 2009
Location: -
Posts: 228
|
|
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);
}
}
}
|
05-15-2009, 01:00 AM
|
Developer
|
|
Join Date: Mar 2009
Location: -
Posts: 228
|
|
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.
|
05-15-2009, 03:10 PM
|
Banned
|
|
Join Date: Sep 2006
Posts: 841
|
|
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
|
05-15-2009, 05:18 PM
|
Developer
|
|
Join Date: Apr 2009
Location: USA
Posts: 478
|
|
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).
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 10:27 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|