Alderon's Tower     
 Python Treasure Generator  Home  

Written by Chris Gonnerman


This product is not published or endorsed by Wizards of the Coast, Inc.

So far as I can figure, this software is a legal "fair use" of the 2nd Edition AD&D rules. However, if Wizards of the Coast tell me to "cease and desist" I most likely will, so get your copies while they are hot.

This software is supplied "AS IS" and is in the public domain. This software may contain copyrighted material of Wizards of the Coast, Inc., used without permission under "fair use" law.

The Author disclaims all warranties, expressed or implied, including, without limitation, the warranties of merchantability and of fitness for any purpose. The Author assumes no liability for direct, indirect, incidental, special, exemplary, or consequential damages, which may result from the use of the software, even if advised of the possibility of such damage.

This software generates treasures according to the 2nd Edition AD&D Dungeon Master's Guide. I have achieved about 99% compliance with the official tables; variances are noted by comments in the code.

You will need Python 1.5.2 or higher; 2.0 should also work fine. Visit for downloads for various operating systems. I designed this software using Linux (and Apache for the web-enabled part) but Windows 95/98/Me/etc. should be fine.

Try it NOW!

You may enter any treasure type from A to V, or you may generate single items by entering Art, Gem, Magic, Potion, Scroll, Wand, Rod, Staff, Misc, Armor, or Weapon.

Command-Line Version
Unpack the archive using zip (WinZip, etc.) Change to the Treasure directory. To generate a treasure, type:
python A

where the A represents the treasure type A-Z. Alternately, you may specify one of MAGIC, POTION, SCROLL, RING, WAND, ROD, STAFF, MISC, ARMOR, or WEAPON to generate one magic item at random. Lowercase is changed to uppercase automatically, so

python Magic

is OK. Output is written to stdout, so you can say:

python h >dragon-hoard.txt

to save the output in a text file.

Web-Enabled Version
Put the Treasure directory in your /usr/home/httpd/htdocs (or wherever your webserver home directory is) and use a URL like this:

to get the web-enabled version. You may have to change the shebang (#!) info at the top of the treasure.cgi file to correctly point to your Python interpreter, and you may need to configure your webserver to allow execution in that folder; webserver setup is up to you.

Download the Source

You can download the source now and run it under Windows 95/98/Me/NT/2000, Linux, or any other OS for which Python is available.

Click here to download the program.

Questions, Comments, or Complaints? Contact:
  Chris Gonnerman <>
Python Treasure Generator Last Updated 01/15/2019