The tophat was found in Tomb of Morgan.
Abilities
This dark red tophat has several gems embroidered along its top. It has 3 charges and regains 1 charge each dawn. While attuned, you are granted the following properties:
Cursed. The hat is cursed and attuning to it extends the curse to the wearer; it cannot be removed from your head unless you are targeted by a remove curse spell to end the attunement. While wearing it, you have a telepathic link with an entity of Thyr Morgan. Casting banishment on the hat will also remove the curse, destroy the telepathic link, and end any detrimental effects the hat grants.
Luxurious. You have a +2 to AC while not wearing armor, but you have a deep craving for the finer things of a luxurious lifestyle. This especially includes cheeses, soft beds, and wines.
Volatile. You can cast the prestidigitation cantrip at will, and you can touch one of the gems to expend 1–3 charges to cast magic missile at 1st, 2nd, or 3rd level. The spell fires the regular amount of missiles, plus one additional missile that always hits the caster.