NetHack 2.2a/invent.c