How to assign random traits to the NPC?

Is this possible? Any way to set probability and possible trait selection?