The reason GetCleanName() works on PCs and NPCs is because GetCleanName() is a Mob method that PCs and NPCs inherit through subclass inheritance. Try this:
Code:
sub EVENT_DEATH_COMPLETE {
quest::gmsay("$name the $class has just been killed in $zoneln by " . ($entity_list->GetMobByID($killer_id) ? $entity_list->GetMobByID($killer_id)->GetCleanName() : "an unknown hand") . ".", 335, 1, 0, 0);
}