I think I follow now.
What I would do is create a bitmask using the four pet traits (race, gender, size, etc.), perhaps, depending on how many options you plan to give the PC.
Saving that with something like:
Code:
my $petowner = $entity_list->GetClientByID($npc->GetOwnerID());
my $racekey = "cp".$npc->GetNPCTypeID().$petowner->CharacterID()."";
Where the value for the key $racekey created stores the bitmask value. I wish I werent on my way out, I started my replies thinking all you wanted was to find the owner's CharID. There are some talented coders here, I'm thinking one will reply before I get back, if not, I'll give example of how I would go about it.
But for now, you atleast have an idea of how to find the pet owner's CharID.