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);
}
}
}