A foreach to check a certain NPC type and use every entity ID from it? Not exactly what I meant.
This would pull all entity IDs for the one NPC and perform the action for all of them, not a singular Entity, I know this is possible, however I want to see how you can logistically work it out in the least problematic manner.
Code:
if($text=~/npc/i)
{
my @npclist = $entity_list->GetNPCList();
foreach $ent (@npclist)
{
$ent->Shout("I'm a npc!");
}
}