You could place a bunch of names into a text file. When you run the game, load them up into a list box. NPCs could have two variables: "name" and "pickname". Pickname should be set to 1 and name should be a string. When you talk to an NPC, if the NPC's "pickname" variable is equal to 1, pick a random line from the listbox, assign the text in said line to the "name" variable, and set "pickname" to 0 so it's name is permenant. Hope that made sense.