Dungeons & Dragons (or D&D for short) was the first modern tabletop roleplaying game. The original edition was published in 1974, and NetHack draws from it a huge number of monsters, items and concepts, as well as the turn-based probabilistic gameplay style. NetHack draws from many, many sources, but the D&D games may well have been its biggest single influence.
Monsters and items Edit
A number of monsters that were created for the D&D games also made their way into NetHack, such as Gelatinous cubes and Mind flayers. Much of the taxonomy of magical items is familiar to D&D players as well: potions with (mostly) temporary effects, scrolls that disappear when read, rings that modify statistics or give intrinsic powers when worn (and only one can be worn on a hand), wands with charges, and so forth.
Like NetHack itself, D&D has always been wildly eclectic, drawing on ancient mythologies, contemporary fantasy literature, and the occasional bad pun from our modern world. So there are many things in NetHack that are also found in D&D, and may even have come to the attention of the developers of NetHack because of D&D, but come originally from a common, older source. One example of this is Vorpal Blade, which is a magical item in D&D (with the same 5% probability of decapitation), but is a reference to the Lewis Carroll poem, "Jabberwocky." (D&D once featured a pair of published game adventures set in a world based on Carroll's works, with Mad Hatters and Cheshire Cats as well as Jabberwocks.)
Some of the key differences between D&D and NetHack deserve to be mentioned as well. Spellcasting is completely different in NetHack, being based on a combination of magical energy points and occasional re-memorization of spells. In D&D, spellcasters are able to learn a fixed number of spells each day, based on experience level, and must specify the spells in advance. For instance, a magic user might specify magic missile, magic missile, wizard lock, knock, and lightning bolt, and that would be it for the day—no refunds, no exchanges. Class-based restrictions are much more of an issue in D&D. Magic users (wizards) and clerics (priests) are the primary spell-casters, and other classes have little to no ability to do any casting at all (and can't even read most scrolls). On the other hand, magic users are not even permitted to wear armor or use all but a few weapons (notably dagger and staff), and clerics are not allowed to use pointed or edged weapons. It is not a question of these items interfering with spellcasting, or weapons skills being restricted—those classes simply are not allowed to use forbidden objects at all.