Returns an array of length 9 with the level of this PC in each class. The class order in the array is: magic user, cleric, thief, warrior, avatar, druid, necromancer, bard, monk. So, the command to find %c's avatar level is
levels(%c)[5]
(To get the level of a mob, use the level function, in the form with one argument.)