Unicorn

A unicorn is a type of monster that appears in the dungeon starting at mid-game. In lore, the unicorn is an (almost) unattainable target - impossible to catch, the horn of which has magical properties. Similarly, unicorns in NetHack are extremely fast (even to a player with intrinsic speed), and stay always a knights move or more away, so as to be out of range of both melee and ranged attacks. If the unicorn is pinned down in a corner, it may very well teleport away before the player can approach.

Unicorns also do surprising amounts of damage, getting in multiple kicks and butts per turn. They won't attack on their own, however, due to their tendency to stay out of range, so only moving directly next to one will lead to an attack.

There are three types of unicorns: white, grey, and black, which correspond to lawful, neutral, and chaotic alignments respectively. The unicorn of your alignment will be peaceful; all others will be hostile. Unicorns in bones files or created by polymorph traps may be exceptions to this rule, but killing a unicorn of your own alignment always carries a -5 Luck penalty. (As is usual in NetHack, this penalty will not apply if you encourage your pet to kill it.)

When killed, a unicorn leaves a unicorn horn with its corpse. Eating a unicorn corpse has a chance of giving poison resistance.

Sacrificing a unicorn at an altar is a special case and is covered in the page on altars. Basically to receive alignment and luck benefits you should  sacrifice a unicorn of a different alignment than you at your own altar.

Throwing gems to a unicorn of your alignment can bring luck increases as well as assist in identification. If the unicorn "graciously" accepts your gift it is worthless glass. If he "gratefully" accepts your gift it is a valuable gem.

Throwing gems to a hostile unicorn will calm him down. If the gem is worthless glass, there will be no effect on your Luck, but if it is real and the unicorn is not of your alignment, your Luck may go up or down.

It is reccomended that a player try to throw gems at a unicorn in a no teleport zone, particularly sokoban as it is rumoured that unicorns are commonly seen there.

Encyclopedia entry
Men have always sought the elusive unicorn, for the single twisted horn which projected from its forehead was thought to be a powerful talisman. It was said that the unicorn had simply to dip the tip of its horn in a muddy pool for the water to become pure. Men also believed that to drink from this horn was a protection against all sickness, and that if the horn was ground to a powder it would act as an antidote to all poisons. Less than 200 years ago in France, the horn of a unicorn was used in a ceremony to test the royal food for poison. Although only the size of a small horse, the unicorn is a very fierce beast, capable of killing an elephant with a single thrust from its horn. Its fleetness of foot also makes this solitary creature difficult to capture. However, it can be tamed and captured by a maiden. Made gentle by the sight of a virgin, the unicorn can be lured to lay its head in her lap, and in this docile mood, the maiden may secure it with a golden rope. [ Mythical Beasts, by Deirdre Headon (The Leprechaun Library) ] Martin took a small sip of beer. "Almost ready," he said. "You hold your beer awfully well." Tlingel laughed. "A unicorn's horn is a detoxicant. Its possession is a universal remedy.  I wait until I reach the warm glow stage, then I use my horn to burn off any excess and keep me right there." [ Unicorn Variations, by Roger Zelazny ]