Finalized Template to get npc to npc distance checks and add agro, to script agro linking for whatever reason you may want. I will be usen it for many reasons including bypassing faction linking on a wiped custom server.
GetHateRandom can be changed to whatever you like, GetHateTop works as well, depending what you want to happen.
Code:
sub EVENT_TIMER{
if($timer == 1) {
my @nlist = $entity_list->GetNPCList();
foreach my $n (@nlist){
if (plugin::CheckDistBetween2Ents($npc, $n, 20)) {
$n->AddToHateList($npc->GetHateRandom());
}
}
}
}