A better way of writing it would be this:
Code:
sub killthings {
my @nlist = $entity_list->GetMobList();
foreach my $npc (@nlist) {
if ($npc->GetEnt()->CastToNPC()->GetNPCTypeID() == FIRSTID) {
quest::SetRunning(1);
my $at = $entity_list->GetNPCByNPCTypeID(SECONDID);
quest::moveto($at->GetX(), $at->GetY(), $at->GetZ(), 1.2);
$npc->GetEnt()->CastToNPC()->Attack($at);
}
}
}