Here is a small example..
Code:
sub EVENT_ITEM_CLICK {
my $target = $client->GetTarget();
if ($target && $target->IsNPC() && !($target->GetOwnerID() && $entity_list->GetMobByID($target->GetOwnerID())->IsClient())) { #Only cast on NPCs and ignore player pets
$client->SpellFinished(982, $target); #Cast Cazic Touch
}
}