Wizard

The Wizard is an NPC, which must be saved from an underground part of the world after defeating the Wall of Flesh. His spawn location is completely random. Although he randomly spawns, there is a much higher chance of him spawning in the world's Dungeon. He will randomly spawn near you while you are exploring. Talking to him in this state will free him, and he will wander the area until he gets killed by any nearby enemy or hazard, or until you move far enough from him. After that, he will move into an available house like any normal NPC.

Once the Wizard has moved into a house, he will sell the following:

Note: As with all NPCs, right-clicking an item will allow multiple purchases rather than purchasing it one by one.

Quotes
During day During night When homeless When rescued "Thanks for saving me, friend! This bondage was starting to chafe."
 * "Well, hi there, [name of another NPC same gender as the player]! What can I do for you today?"
 * "Want me to pull a coin from behind your ear? No? Ok."
 * "I make a rather enchanting hot chocolate if you'd be inter... No? Ok."
 * "Do you want some magic candy? No? Ok."
 * "Ever wanted an enchanted ring that turns rocks into slimes? Well neither did I."
 * "Someone once told me friendship is magic. That's ridiculous. You can't turn people into frogs with friendship."
 * "I once tried to bring an Angel Statue to life. It didn't do anything." (this is a reference to the fact that before the 1.1 update the Angel Statue was utterly useless and the tooltip even said 'it doesn't do anything')"
 * "Are you here for a peek at my crystal ball?"
 * "I can see your future now... You will buy a lot of items from me!"
 * "Ohh, my hero!"
 * "Oh, how heroic! Thank you for saving me, young (man/lady)!"
 * "Now that we know each other, I can move in with you, right?"

Trivia

 * In one of his night quotes he mentions "friendship is magic", which may be a reference to "My Little Pony: Friendship is magic", which has become a hit in pop culture.
 * Judging by his stereotypical appearance, quotes, and facial features, the wizard NPC may be based on Merlin the magician.
 * It sometimes seems that the wizard is a homosexual, which might be a reference to Ian McKellan's(the actor who played Gandalf in the Lord of the Rings movies) homosexuality.