I will share what I learned, this worked perfect for me. The spell was only cast on me, client and only for level 45 and up and also only if I was in range.
Code:
my @moblist = $entity_list->GetMobList();
foreach $ent (@moblist)
{
my $dist = $ent->CalculateDistance($npc->GetSpawnPointX(),$npc->GetSpawnPointY(),$npc->GetSpawnPointZ());
my $level = $ent->GetLevel();
if(int($dist)<100 && $level>=45 && $ent->IsClient())
{
$ent->CastSpell(2570, $ent, 10, -1, -1)
}
}