sort NPC data by id