diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/Arch.des nethack/dat/Arch.des
--- nh_orig/dat/Arch.des	2003-12-07 18:39:12.000000000 -0500
+++ nethack/dat/Arch.des	2010-04-29 10:53:24.165721489 -0400
@@ -9,6 +9,8 @@
 #	and receive your quest assignment.
 #
-MAZE: "Arc-strt",' '
-FLAGS: noteleport,hardfloor
+LEVEL: "Arc-strt"
+FLAGS: noteleport,hardfloor,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (80,'S'), (16,"human mummy"), (4,'M')
 GEOMETRY:center,center
 MAP
@@ -23,5 +25,5 @@
 ....................}|.|...............|.......+.|.......|}.................
 ....................}|.|...............---------.---------}.................
-....................}|.S.\.............+.................+..................
+....................}|.S...............+.................+..................
 ....................}|.|...............---------.---------}.................
 ....................}|.|...............|.......+.|.......|}.................
@@ -69,23 +71,46 @@
 DOOR:locked,(49,14)
 # Lord Carnarvon
-MONSTER:'@',"Lord Carnarvon",(25,10)
+OBJECT:('\',"throne"),(25,10)
+MONSTER:('@',"Lord Carnarvon"),(25,10) {
+  OBJECT:('[',"fedora"),+5
+  OBJECT:')',+4
+  OBJECT:random
+  OBJECT:random
+  OBJECT:random
+}
 # The treasure of Lord Carnarvon
-OBJECT:'(',"chest",(25,10)
+OBJECT:('(',"chest"),(25,10)
 # student guards for the audience chamber
-MONSTER:'@',"student",(26,09)
-MONSTER:'@',"student",(27,09)
-MONSTER:'@',"student",(28,09)
-MONSTER:'@',"student",(26,10)
-MONSTER:'@',"student",(28,10)
-MONSTER:'@',"student",(26,11)
-MONSTER:'@',"student",(27,11)
-MONSTER:'@',"student",(28,11)
+MONSTER:('@',"student"),(26,09) {
+  OBJECT:random
+}
+MONSTER:('@',"student"),(27,09) {
+  OBJECT:random
+}
+MONSTER:('@',"student"),(28,09) {
+  OBJECT:random
+}
+MONSTER:('@',"student"),(26,10) {
+  OBJECT:random
+}
+MONSTER:('@',"student"),(28,10) {
+  OBJECT:random
+}
+MONSTER:('@',"student"),(26,11) {
+  OBJECT:random
+}
+MONSTER:('@',"student"),(27,11) {
+  OBJECT:random
+}
+MONSTER:('@',"student"),(28,11) {
+  OBJECT:random
+}
 # city watch guards in the antechambers
-MONSTER:'@',"watchman",(50,06)
-MONSTER:'@',"watchman",(50,14)
+MONSTER:('@',"watchman"),(50,06)
+MONSTER:('@',"watchman"),(50,14)
 # Eels in the moat
-MONSTER:';',"giant eel",(20,10)
-MONSTER:';',"giant eel",(45,04)
-MONSTER:';',"giant eel",(33,16)
+MONSTER:(';',"giant eel"),(20,10)
+MONSTER:(';',"giant eel"),(45,04)
+MONSTER:(';',"giant eel"),(33,16)
 # Non diggable walls
 NON_DIGGABLE:(00,00,75,19)
@@ -98,16 +123,16 @@
 TRAP:random,random
 # Monsters on siege duty.
-MONSTER: 'S',random,(60,09)
-MONSTER: 'M',random,(60,10)
-MONSTER: 'S',random,(60,11)
-MONSTER: 'S',random,(60,12)
-MONSTER: 'M',random,(60,13)
-MONSTER: 'S',random,(61,10)
-MONSTER: 'S',random,(61,11)
-MONSTER: 'S',random,(61,12)
-MONSTER: 'S',random,(30,03)
-MONSTER: 'M',random,(20,17)
-MONSTER: 'S',random,(67,02)
-MONSTER: 'S',random,(10,19)
+MONSTER: 'S',(60,09)
+MONSTER: 'M',(60,10)
+MONSTER: 'S',(60,11)
+MONSTER: 'S',(60,12)
+MONSTER: 'M',(60,13)
+MONSTER: 'S',(61,10)
+MONSTER: 'S',(61,11)
+MONSTER: 'S',(61,12)
+MONSTER: 'S',(30,03)
+MONSTER: 'M',(20,17)
+MONSTER: 'S',(67,02)
+MONSTER: 'S',(10,19)
 
 #
@@ -118,6 +143,8 @@
 #
 
-MAZE: "Arc-loca",' '
-FLAGS: hardfloor
+LEVEL: "Arc-loca"
+FLAGS: hardfloor,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (80,'S'), (16,"human mummy"), (4,'M')
 GEOMETRY:center,center
 MAP
@@ -185,19 +212,19 @@
 NON_DIGGABLE:(00,00,75,19)
 # Objects
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
 # Treasure?
 ENGRAVING:random,engrave,"X marks the spot."
@@ -230,31 +257,31 @@
 TRAP:"rolling boulder",(40,16)
 # Random monsters.
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'M',random,random
-MONSTER:'M',"human mummy",random
-MONSTER:'M',"human mummy",random
-MONSTER:'M',"human mummy",random
-MONSTER:'M',"human mummy",random
-MONSTER:'M',"human mummy",random
-MONSTER:'M',"human mummy",random
-MONSTER:'M',"human mummy",random
-MONSTER:'M',random,random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'M',random
+MONSTER:('M',"human mummy"),random
+MONSTER:('M',"human mummy"),random
+MONSTER:('M',"human mummy"),random
+MONSTER:('M',"human mummy"),random
+MONSTER:('M',"human mummy"),random
+MONSTER:('M',"human mummy"),random
+MONSTER:('M',"human mummy"),random
+MONSTER:'M',random
 
 #
@@ -266,5 +293,8 @@
 #
 
-MAZE: "Arc-goal", ' '
+LEVEL: "Arc-goal"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (80,'S'), (16,"human mummy"), (4,'M')
 GEOMETRY:center,center
 MAP
@@ -322,19 +352,19 @@
 ALTAR:(50,14),chaos,altar
 # Objects
-OBJECT:'(',"crystal ball",(50,14),blessed,5,"The Orb of Detection"
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:('(',"crystal ball"),(50,14),blessed,5,NAME:"The Orb of Detection"
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
 # Random traps
 TRAP:random,random
@@ -346,32 +376,37 @@
 TRAP:"rolling boulder",(46,14)
 # Random monsters.
-MONSTER:'&',"Minion of Huhetotl",(50,14)
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'S',random,random
-MONSTER:'M',"human mummy",random
-MONSTER:'M',"human mummy",random
-MONSTER:'M',"human mummy",random
-MONSTER:'M',"human mummy",random
-MONSTER:'M',"human mummy",random
-MONSTER:'M',"human mummy",random
-MONSTER:'M',"human mummy",random
-MONSTER:'M',"human mummy",random
-MONSTER:'M',random,random
+MONSTER:('&',"Minion of Huhetotl"),(50,14) {
+  OBJECT:('(', "Bell of Opening"),uncursed
+  OBJECT:random,cursed
+  OBJECT:random,cursed
+  OBJECT:random,cursed
+}
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:('M',"human mummy"),random
+MONSTER:('M',"human mummy"),random
+MONSTER:('M',"human mummy"),random
+MONSTER:('M',"human mummy"),random
+MONSTER:('M',"human mummy"),random
+MONSTER:('M',"human mummy"),random
+MONSTER:('M',"human mummy"),random
+MONSTER:('M',"human mummy"),random
+MONSTER:'M',random
 
 #
@@ -385,76 +420,102 @@
 
 LEVEL: "Arc-fila"
+MON_GENERATION:86%, (80,'S'), (16,"human mummy"), (4,'M')
 #
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, up
-OBJECT: random,random,random
-MONSTER: 'S', random, random
+OBJECT: random,random
+MONSTER: 'S', random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random,random,random
-MONSTER: 'S', random, random
+{
+OBJECT: random, random
+OBJECT: random, random
+MONSTER: 'S', random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
-OBJECT: random,random,random
-MONSTER: 'S', random, random
+OBJECT: random, random
+MONSTER: 'S', random
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, down
-OBJECT: random, random, random
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'S', random, random
-MONSTER: 'M', "human mummy", random
+MONSTER: 'S', random
+MONSTER: ('M', "human mummy"), random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'S', random, random
+MONSTER: 'S', random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'S', random, random
+MONSTER: 'S', random
+}
 
 RANDOM_CORRIDORS
 
 LEVEL: "Arc-filb"
+MON_GENERATION:86%, (80,'S'), (16,"human mummy"), (4,'M')
 #
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, up
-OBJECT: random,random,random
-MONSTER: 'M', random, random
+OBJECT: random,random
+MONSTER: 'M', random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random,random,random
-MONSTER: 'M', random, random
+{
+OBJECT: random, random
+OBJECT: random, random
+MONSTER: 'M', random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
-OBJECT: random,random,random
-MONSTER: 'M', random, random
+OBJECT: random,random
+MONSTER: 'M', random
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, down
-OBJECT: random, random, random
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'S', random, random
-MONSTER: 'M', "human mummy", random
+MONSTER: 'S', random
+MONSTER: ('M', "human mummy"), random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'S', random, random
+MONSTER: 'S', random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'S', random, random
+MONSTER: 'S', random
+}
 
 RANDOM_CORRIDORS
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/Barb.des nethack/dat/Barb.des
--- nh_orig/dat/Barb.des	2003-12-07 18:39:12.000000000 -0500
+++ nethack/dat/Barb.des	2010-08-16 13:20:13.632708508 -0400
@@ -9,6 +9,8 @@
 #	and receive your quest assignment.
 #
-MAZE: "Bar-strt",' '
-FLAGS: noteleport,hardfloor
+LEVEL: "Bar-strt"
+FLAGS: noteleport,hardfloor,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"ogre"), (16,'O'), (16,"troll"), (4,'T')
 GEOMETRY:center,center
 MAP
@@ -19,7 +21,7 @@
 ........--------------......-----....PPP....................................
 ........|...S........|......+...|...PPP.....................................
-........|----........|......|...|....PP.....................................
-........|.\..........+......-----...........................................
-........|----........|...............PP.....................................
+........|----........|......|...|...PPP.....................................
+........|............+......-----....PP.....................................
+........|----........|..............PPP.....................................
 ........|...S........|...-----.......PPP....................................
 ........--------------...+...|......PPPPP...................................
@@ -34,4 +36,13 @@
 ....................................PP....PP................................
 ENDMAP
+
+# the forest beyond the river
+REPLACE_TERRAIN:(37,0,75,19),'.','T', 10%
+REPLACE_TERRAIN:(60,0,75,19),'.','T', 20%
+REPLACE_TERRAIN:(65,0,75,19),'.','T', 40%
+REPLACE_TERRAIN:(70,0,75,19),'.','T', 80%
+TERRAIN: (randline (37,7)-(62,02),7), '.'
+TERRAIN:(62,02),'.'
+
 # Dungeon Description
 REGION:(00,00,75,19),lit,"ordinary"
@@ -59,36 +70,61 @@
 DOOR:open,(28,05)
 # Elder
-MONSTER:'@',"Pelias",(10,07)
+OBJECT:('\',"throne"),(10,07)
+MONSTER:('@',"Pelias"),(10,07) {
+  OBJECT:(')',"runesword"),1d5
+  OBJECT:'[',1d5
+}
 # The treasure of Pelias
-OBJECT:'(',"chest",(09,05)
+OBJECT:('(',"chest"),(09,05)
 # chieftain guards for the audience chamber
-MONSTER:'@',"chieftain",(10,05)
-MONSTER:'@',"chieftain",(10,09)
-MONSTER:'@',"chieftain",(11,05)
-MONSTER:'@',"chieftain",(11,09)
-MONSTER:'@',"chieftain",(14,05)
-MONSTER:'@',"chieftain",(14,09)
-MONSTER:'@',"chieftain",(16,05)
-MONSTER:'@',"chieftain",(16,09)
+MONSTER:('@',"chieftain"),(10,05) {
+  OBJECT:')'
+  OBJECT:'['
+}
+MONSTER:('@',"chieftain"),(10,09) {
+  OBJECT:')'
+  OBJECT:'['
+}
+MONSTER:('@',"chieftain"),(11,05) {
+  OBJECT:')'
+  OBJECT:'['
+}
+MONSTER:('@',"chieftain"),(11,09) {
+  OBJECT:')'
+  OBJECT:'['
+}
+MONSTER:('@',"chieftain"),(14,05) {
+  OBJECT:')'
+  OBJECT:'['
+}
+MONSTER:('@',"chieftain"),(14,09) {
+  OBJECT:')'
+  OBJECT:'['
+}
+MONSTER:('@',"chieftain"),(16,05) {
+  OBJECT:')'
+  OBJECT:'['
+}
+MONSTER:('@',"chieftain"),(16,09) {
+  OBJECT:')'
+  OBJECT:'['
+}
 # Non diggable walls
-NON_DIGGABLE:(00,00,75,19)
+NON_DIGGABLE:(00,00,35,19)
 # One trap to keep the ogres at bay.
 TRAP:"spiked pit",(37,07)
 # Eels in the river
-MONSTER:';',"giant eel",(36,01)
-MONSTER:';',"giant eel",(37,09)
-MONSTER:';',"giant eel",(39,15)
+MONSTER:(';',"giant eel"),(36,01)
+MONSTER:(';',"giant eel"),(37,09)
+MONSTER:(';',"giant eel"),(39,15)
 # Monsters on siege duty.
-MONSTER:'O',"ogre",(40,08),hostile
-MONSTER:'O',"ogre",(41,06),hostile
-MONSTER:'O',"ogre",(41,07),hostile
-MONSTER:'O',"ogre",(41,08),hostile
-MONSTER:'O',"ogre",(41,09),hostile
-MONSTER:'O',"ogre",(41,10),hostile
-MONSTER:'O',"ogre",(42,06),hostile
-MONSTER:'O',"ogre",(42,07),hostile
-MONSTER:'O',"ogre",(42,08),hostile
-MONSTER:'O',"ogre",(42,09),hostile
-MONSTER:'O',"ogre",(42,10),hostile
+REGION:(40,0,50,19),lit,"ordinary",unfilled {
+  LOOP [10 + 1d15] {
+    MONSTER:('O',"ogre"),random,hostile
+  }
+}
+
+# to cut down the trees
+OBJECT:"axe",random,eroded:1d3
 
 #
@@ -99,6 +135,8 @@
 #
 
-MAZE: "Bar-loca",' '
-FLAGS: hardfloor
+LEVEL: "Bar-loca"
+FLAGS: hardfloor,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"ogre"), (16,'O'), (16,"troll"), (4,'T')
 GEOMETRY:center,center
 MAP
@@ -147,19 +185,19 @@
 STAIR:(70,13),down
 # Objects
-OBJECT:random,random,(42,03)
-OBJECT:random,random,(42,03)
-OBJECT:random,random,(42,03)
-OBJECT:random,random,(41,03)
-OBJECT:random,random,(41,03)
-OBJECT:random,random,(41,03)
-OBJECT:random,random,(41,03)
-OBJECT:random,random,(41,08)
-OBJECT:random,random,(41,08)
-OBJECT:random,random,(42,08)
-OBJECT:random,random,(42,08)
-OBJECT:random,random,(42,08)
-OBJECT:random,random,(71,13)
-OBJECT:random,random,(71,13)
-OBJECT:random,random,(71,13)
+OBJECT:random,(42,03)
+OBJECT:random,(42,03)
+OBJECT:random,(42,03)
+OBJECT:random,(41,03)
+OBJECT:random,(41,03)
+OBJECT:random,(41,03)
+OBJECT:random,(41,03)
+OBJECT:random,(41,08)
+OBJECT:random,(41,08)
+OBJECT:random,(42,08)
+OBJECT:random,(42,08)
+OBJECT:random,(42,08)
+OBJECT:random,(71,13)
+OBJECT:random,(71,13)
+OBJECT:random,(71,13)
 # Random traps
 TRAP:"spiked pit",(10,13)
@@ -172,31 +210,31 @@
 TRAP:random,random
 # Random monsters.
-MONSTER:'O',"ogre",(12,09),hostile
-MONSTER:'O',"ogre",(18,11),hostile
-MONSTER:'O',"ogre",(45,05),hostile
-MONSTER:'O',"ogre",(45,06),hostile
-MONSTER:'O',"ogre",(47,05),hostile
-MONSTER:'O',"ogre",(46,05),hostile
-MONSTER:'O',"ogre",(56,03),hostile
-MONSTER:'O',"ogre",(56,04),hostile
-MONSTER:'O',"ogre",(56,05),hostile
-MONSTER:'O',"ogre",(56,06),hostile
-MONSTER:'O',"ogre",(57,03),hostile
-MONSTER:'O',"ogre",(57,04),hostile
-MONSTER:'O',"ogre",(57,05),hostile
-MONSTER:'O',"ogre",(57,06),hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',random,random,hostile
-MONSTER:'T',random,random,hostile
-MONSTER:'T',"rock troll",(46,06),hostile
-MONSTER:'T',"rock troll",(47,06),hostile
-MONSTER:'T',"rock troll",(56,07),hostile
-MONSTER:'T',"rock troll",(57,07),hostile
-MONSTER:'T',"rock troll",(70,13),hostile
-MONSTER:'T',"rock troll",random,hostile
-MONSTER:'T',"rock troll",random,hostile
-MONSTER:'T',random,random,hostile
+MONSTER:('O',"ogre"),(12,09),hostile
+MONSTER:('O',"ogre"),(18,11),hostile
+MONSTER:('O',"ogre"),(45,05),hostile
+MONSTER:('O',"ogre"),(45,06),hostile
+MONSTER:('O',"ogre"),(47,05),hostile
+MONSTER:('O',"ogre"),(46,05),hostile
+REGION:(56,03,57,04),unlit,"ordinary",unfilled,true {
+  LOOP [5 + 2d6] {
+    MONSTER:('O',"ogre"),random,hostile
+  }
+}
+
+LOOP [1d8 + 2] {
+  MONSTER:('O',"ogre"),random,hostile
+}
+MONSTER:'O',random,hostile
+MONSTER:'T',random,hostile
+REGION:(46,06,47,07),unlit,"ordinary",unfilled,true {
+  LOOP [1d8 + 2] {
+    MONSTER:('T',"rock troll"),random,hostile
+  }
+}
+
+LOOP [2 + 1d6] {
+  MONSTER:('T',"rock troll"),random,hostile
+}
+MONSTER:'T',random,hostile
 
 #
@@ -208,5 +246,8 @@
 #
 
-MAZE: "Bar-goal", ' '
+LEVEL: "Bar-goal"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"ogre"), (16,'O'), (16,"troll"), (4,'T')
 GEOMETRY:center,center
 MAP
@@ -243,55 +284,33 @@
 NON_DIGGABLE:(00,00,75,19)
 # Objects
-OBJECT:'*',"luckstone",(63,04),blessed,0,"The Heart of Ahriman"
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-# Random traps
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+OBJECT:('*',"luckstone"),(63,04),blessed,0,NAME:"The Heart of Ahriman"
+#
+LOOP [5 + 2d6] {
+  OBJECT: random, random
+}
+#
+LOOP [5 + 1d6] {
 TRAP:random,random
+}
+#
 # Random monsters.
-MONSTER:'@',"Thoth Amon",(63,04),hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',"ogre",random,hostile
-MONSTER:'O',random,random,hostile
-MONSTER:'O',random,random,hostile
-MONSTER:'T',"rock troll",random,hostile
-MONSTER:'T',"rock troll",random,hostile
-MONSTER:'T',"rock troll",random,hostile
-MONSTER:'T',"rock troll",random,hostile
-MONSTER:'T',"rock troll",random,hostile
-MONSTER:'T',"rock troll",random,hostile
-MONSTER:'T',"rock troll",random,hostile
-MONSTER:'T',"rock troll",random,hostile
-MONSTER:'T',random,random,hostile
+MONSTER:('@',"Thoth Amon"),(63,04),hostile {
+  OBJECT:('(', "Bell of Opening"),uncursed
+  OBJECT:')',1d2
+  OBJECT:'['
+  OBJECT:random
+  OBJECT:random
+  OBJECT:random
+}
+
+LOOP [15 + 2d6] {
+  MONSTER:('O',"ogre"),random,hostile
+}
+MONSTER:'O',random,hostile
+MONSTER:'O',random,hostile
+LOOP [7 + 1d6] {
+  MONSTER:('T',"rock troll"),random,hostile
+}
+MONSTER:'T',random,hostile
 WALLIFY
 
@@ -305,6 +324,8 @@
 #
 
-MAZE: "Bar-fila" , ' '
-INIT_MAP: '.' , '.' , true , true , unlit , false
+LEVEL: "Bar-fila"
+FLAGS:mazelevel,noflip
+INIT_MAP: mines, '.' , '.' , true , true , unlit , false
+MON_GENERATION:86%, (64,"ogre"), (16,'O'), (16,"troll"), (4,'T')
 NOMAP
 #
@@ -312,25 +333,24 @@
 STAIR: random, down
 #
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+LOOP [5 + 2d6] {
+  OBJECT: random, random
+}
 #
+LOOP [2 + 1d6] {
 TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
+}
 #
-MONSTER: 'O', "ogre", random, hostile
-MONSTER: 'O', "ogre", random, hostile
-MONSTER: 'O', random, random, hostile
-MONSTER: 'T', "rock troll", random, hostile
+LOOP [1d6] {
+  MONSTER: ('O', "ogre"), random, hostile
+}
+MONSTER: 'O', random, hostile
+LOOP [1d3] {
+  MONSTER: ('T', "rock troll"), random, hostile
+}
 
-MAZE: "Bar-filb" , ' '
-INIT_MAP: '.' , ' ' , true , true , unlit , true
+LEVEL: "Bar-filb"
+FLAGS:mazelevel,noflip
+INIT_MAP: mines, '.' , ' ' , true , true , unlit , true
+MON_GENERATION:86%, (64,"ogre"), (16,'O'), (16,"troll"), (4,'T')
 NOMAP
 #
@@ -338,31 +358,18 @@
 STAIR: random, down
 #
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+LOOP [5 + 2d6] {
+  OBJECT: random, random
+}
 #
+LOOP [2 + 1d6] {
 TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
+}
 #
-MONSTER: 'O', "ogre", random, hostile
-MONSTER: 'O', "ogre", random, hostile
-MONSTER: 'O', "ogre", random, hostile
-MONSTER: 'O', "ogre", random, hostile
-MONSTER: 'O', "ogre", random, hostile
-MONSTER: 'O', "ogre", random, hostile
-MONSTER: 'O', "ogre", random, hostile
-MONSTER: 'O', random , random, hostile
-MONSTER: 'T', "rock troll", random, hostile
-MONSTER: 'T', "rock troll", random, hostile
-MONSTER: 'T', "rock troll", random, hostile
-MONSTER: 'T', random , random, hostile
+LOOP [5 + 1d6] {
+  MONSTER: ('O', "ogre"), random, hostile
+}
+MONSTER: 'O', random, hostile
+LOOP [2 + 1d3] {
+  MONSTER: ('T', "rock troll"), random, hostile
+}
+MONSTER: 'T', random, hostile
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/bigroom.des nethack/dat/bigroom.des
--- nh_orig/dat/bigroom.des	2003-12-07 18:39:12.000000000 -0500
+++ nethack/dat/bigroom.des	2010-05-13 09:22:22.244762620 -0400
@@ -7,5 +7,7 @@
 #
 
-MAZE:"bigrm-1",' '
+LEVEL:"bigrm-1"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 MAP
@@ -29,4 +31,21 @@
 ---------------------------------------------------------------------------
 ENDMAP
+
+$terrains = TERRAIN:{'-', 'F', 'L', 'T', 'C'}
+SHUFFLE:$terrains
+
+IF [75%] {
+   TERRAIN:line (10,8)-(38, 8), $terrains[0]
+   TERRAIN:line (37,8)-(65, 8), $terrains[0]
+   TERRAIN:line (37,3)-(37, 8), $terrains[0]
+   TERRAIN:line (37,8)-(37,14), $terrains[0]
+} ELSE {
+   IF [99%] {
+      TERRAIN:rect (4,4,70,13), $terrains[0]
+      TERRAIN:line (25, 4)-(50, 4), '.'
+      TERRAIN:line (25,13)-(50,13), '.'
+   }
+}
+
 # Dungeon Description
 REGION:(01,01,73,16),lit,"ordinary"
@@ -37,59 +56,21 @@
 NON_DIGGABLE:(00,00,74,17)
 # Objects
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+LOOP [15] {
+  OBJECT:random,random
+}
 # Random traps
+LOOP [6] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Random monsters.
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
+LOOP [28] {
+  MONSTER:random,random
+}
 
 #	Here, just play with the lighting...
 
-MAZE:"bigrm-2",' '
+LEVEL:"bigrm-2"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 MAP
@@ -114,13 +95,30 @@
 ENDMAP
 # Dungeon Description
-REGION:(01,01,23,06),lit,"ordinary"
-REGION:(01,07,23,10),unlit,"ordinary"
-REGION:(01,11,23,16),lit,"ordinary"
-REGION:(24,01,50,06),unlit,"ordinary"
-REGION:(24,07,50,10),lit,"ordinary"
-REGION:(24,11,50,16),unlit,"ordinary"
-REGION:(51,01,73,06),lit,"ordinary"
-REGION:(51,07,73,10),unlit,"ordinary"
-REGION:(51,11,73,16),lit,"ordinary"
+REGION:(01,01,73,16),lit,"ordinary"
+
+IF [50%] {
+  REGION:(00,07,23,10),unlit,"ordinary"
+  REGION:(24,00,50,06),unlit,"ordinary"
+  REGION:(24,11,50,17),unlit,"ordinary"
+  REGION:(51,07,74,10),unlit,"ordinary"
+} ELSE {
+  REGION:(24,00,50,17),unlit,"ordinary"
+}
+
+IF [40%] {
+   $terrain = TERRAIN:{ 'L', '}', 'I' }
+   SHUFFLE:$terrain
+   TERRAIN: (randline random-random,20), $terrain[0]
+   IF [50%] {
+      TERRAIN: (randline random-random,25), $terrain[0]
+   }
+   IF [50%] {
+      TERRAIN: grow(north|west, randline random-random,25), $terrain[0]
+   }
+   IF [25%] {
+      TERRAIN: grow(randline random-random,25), $terrain[0]
+   }
+}
+
 # Stairs
 STAIR:random,up
@@ -129,59 +127,21 @@
 NON_DIGGABLE:(00,00,74,17)
 # Objects
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+LOOP [15] {
+  OBJECT:random,random
+}
 # Random traps
+LOOP [6] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Random monsters.
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
+LOOP [28] {
+  MONSTER:random,random
+}
 
 #	Now, let's get fancy...
 
-MAZE:"bigrm-3",' '
+LEVEL:"bigrm-3"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 MAP
@@ -205,4 +165,18 @@
 ---------------------------------------------------------------------------
 ENDMAP
+
+IF [30%] {
+   $outside = TERRAIN:{ 'L', 'T', '}', 'C' }
+   SHUFFLE: $outside
+   REPLACE_TERRAIN:(6,5, 68,11),'-',$outside[0],100%
+   REPLACE_TERRAIN:(6,5, 68,11),'|',$outside[0],100%
+   REPLACE_TERRAIN:(6,5, 68,11),' ',$outside[0],100%
+}
+
+IF [50%] {
+   REPLACE_TERRAIN:(1, 1, 73, 1),'|','F',100%
+   REPLACE_TERRAIN:(1,16, 73,16),'|','F',100%
+}
+
 # Dungeon Description
 REGION:(01,01,73,16),lit,"ordinary"
@@ -213,56 +187,44 @@
 NON_DIGGABLE:(00,00,74,17)
 # Objects
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+LOOP [15] {
+  OBJECT:random,random
+}
 # Random traps
+LOOP [6] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Random monsters.
-MONSTER:random,random,(01,01)
-MONSTER:random,random,(13,01)
-MONSTER:random,random,(25,01)
-MONSTER:random,random,(37,01)
-MONSTER:random,random,(49,01)
-MONSTER:random,random,(61,01)
-MONSTER:random,random,(73,01)
-MONSTER:random,random,(07,07)
-MONSTER:random,random,(13,07)
-MONSTER:random,random,(25,07)
-MONSTER:random,random,(37,07)
-MONSTER:random,random,(49,07)
-MONSTER:random,random,(61,07)
-MONSTER:random,random,(67,07)
-MONSTER:random,random,(07,09)
-MONSTER:random,random,(13,09)
-MONSTER:random,random,(25,09)
-MONSTER:random,random,(37,09)
-MONSTER:random,random,(49,09)
-MONSTER:random,random,(61,09)
-MONSTER:random,random,(67,09)
-MONSTER:random,random,(01,16)
-MONSTER:random,random,(13,16)
-MONSTER:random,random,(25,16)
-MONSTER:random,random,(37,16)
-MONSTER:random,random,(49,16)
-MONSTER:random,random,(61,16)
-MONSTER:random,random,(73,16)
-MAZE:"bigrm-4",' '
+MONSTER:random,(01,01)
+MONSTER:random,(13,01)
+MONSTER:random,(25,01)
+MONSTER:random,(37,01)
+MONSTER:random,(49,01)
+MONSTER:random,(61,01)
+MONSTER:random,(73,01)
+MONSTER:random,(07,07)
+MONSTER:random,(13,07)
+MONSTER:random,(25,07)
+MONSTER:random,(37,07)
+MONSTER:random,(49,07)
+MONSTER:random,(61,07)
+MONSTER:random,(67,07)
+MONSTER:random,(07,09)
+MONSTER:random,(13,09)
+MONSTER:random,(25,09)
+MONSTER:random,(37,09)
+MONSTER:random,(49,09)
+MONSTER:random,(61,09)
+MONSTER:random,(67,09)
+MONSTER:random,(01,16)
+MONSTER:random,(13,16)
+MONSTER:random,(25,16)
+MONSTER:random,(37,16)
+MONSTER:random,(49,16)
+MONSTER:random,(61,16)
+MONSTER:random,(73,16)
+
+LEVEL:"bigrm-4"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 MAP
@@ -286,4 +248,18 @@
 -----------                                                     -----------
 ENDMAP
+
+$corners = selection: (05,02) & (05,15) & (69,02) & (69,15)
+$terrain = TERRAIN:{ 'L', 'T', '{', '.' }
+SHUFFLE:$terrain
+TERRAIN:$corners, $terrain[0]
+
+IF [30%] {
+   $outside = TERRAIN:{ 'L', 'T', '}' }
+   SHUFFLE: $outside
+   REPLACE_TERRAIN:(0,0, 74,17),'-',$outside[0],100%
+   REPLACE_TERRAIN:(0,0, 74,17),'|',$outside[0],100%
+   REPLACE_TERRAIN:(0,0, 74,17),' ',$outside[0],100%
+}
+
 # Dungeon Description
 REGION:(01,01,73,16),lit,"ordinary"
@@ -293,65 +269,22 @@
 # Non diggable walls
 NON_DIGGABLE:(00,00,74,17)
-# Fountains
-FOUNTAIN:(05,02)
-FOUNTAIN:(05,15)
-FOUNTAIN:(69,02)
-FOUNTAIN:(69,15)
 # Objects
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+LOOP [15] {
+  OBJECT:random,random
+}
 # Random traps
+LOOP [6] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Random monsters.
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
+LOOP [28] {
+  MONSTER:random,random
+}
 
 #	Try an oval room...
 
-MAZE:"bigrm-5",' '
+LEVEL:"bigrm-5"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 MAP
@@ -378,4 +311,16 @@
 # Dungeon Description
 REGION:(00,00,72,18),lit,"ordinary"
+
+IF [33%] {
+   $terrain = TERRAIN:{ 'L', '}' }
+   SHUFFLE:$terrain
+   IF [50%] {
+      TERRAIN: grow(north|west, randline (37,0)-(37,18),20), $terrain[0]
+   } ELSE {
+      TERRAIN: grow(north|west, randline (0,10)-(73,10),20), $terrain[0]
+   }
+}
+
+
 # Stairs
 STAIR:random,up
@@ -383,54 +328,346 @@
 # Non diggable walls
 NON_DIGGABLE:(00,00,72,18)
-# Objects
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-# Random traps
+
+LOOP [15] {
+  OBJECT:random,random
+}
+
+LOOP [6] {
 TRAP:random,random
+}
+
+LOOP [28] {
+  MONSTER:random,random
+}
+
+
+# The Four Circles
+
+LEVEL:"bigrm-6"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
+GEOMETRY:center,center
+MAP
+     ---------         ---------         ---------         ---------     
+   ---.......---     ---.......---     ---.......---     ---.......---   
+  --...........--   --...........--   --...........--   --...........--  
+ --.............-- --.............-- --.............-- --.............-- 
+ -...............- -...............- -...............- -...............- 
+|-...............---...............---...............---...............--
+|.................-.................-.................-.................|
+|........T.................T.................T.................T........|
+|.......................................................................|
+|......T.{.....................................................{.T......|
+|.......................................................................|
+|........T.................T.................T.................T........|
+|.................-.................-.................-.................|
+--...............---...............---...............---...............--
+ -...............- -...............- -...............- -...............- 
+ --.............-- --.............-- --.............-- --.............-- 
+  --...........--   --...........--   --...........--   --...........--  
+   ---.......---     ---.......---     ---.......---     ---.......---   
+     ---------         ---------         ---------         ---------     
+ENDMAP
+
+IF [20%] {
+  REPLACE_TERRAIN:(00,00,73,18),'T','{',100%
+}
+
+IF [20%] {
+  REPLACE_TERRAIN:(00,00,73,18),'-','T',100%
+  REPLACE_TERRAIN:(00,00,73,18),'|','T',100%
+}
+
+# Dungeon Description
+REGION:(01,01,72,17),lit,"ordinary"
+# Stairs
+STAIR:random,up
+STAIR:random,down
+# Non diggable walls
+NON_DIGGABLE:(00,00,72,18)
+
+LOOP [15] {
+  OBJECT:random,random
+}
+
+LOOP [6] {
 TRAP:random,random
+}
+
+LOOP [28] {
+  MONSTER:random,random
+}
+
+
+# Let's tilt it a bit
+
+LEVEL:"bigrm-7"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
+GEOMETRY:center,center
+MAP
+                                                        -----              
+                                                ---------...---            
+                                        ---------.........L...---          
+                                ---------.......................---        
+                        ---------.................................---      
+                ---------...........................................---    
+        ---------.....................................................---  
+|--------...............................................................--|
+|.........................................................................|
+|.L.....................................................................L.|
+|.........................................................................|
+|--...............................................................--------|
+  ---.....................................................---------        
+    ---...........................................---------                
+      ---.................................---------                        
+        ---.......................---------                                
+          ---...L.........---------                                        
+            ---...---------                                                
+              -----                                                        
+ENDMAP
+
+$terrain = TERRAIN:{ 'L', 'T', '{', '.' }
+SHUFFLE:$terrain
+REPLACE_TERRAIN:(00,00,74,18),'L',$terrain[0],100%
+
+# Dungeon Description
+REGION:(01,01,73,17),lit,"ordinary"
+# Stairs
+STAIR:random,up
+STAIR:random,down
+# Non diggable walls
+NON_DIGGABLE:(00,00,74,18)
+
+LOOP [15] {
+  OBJECT:random,random
+}
+
+LOOP [6] {
 TRAP:random,random
+}
+
+LOOP [28] {
+  MONSTER:random,random
+}
+
+
+# Two streams
+
+LEVEL:"bigrm-8"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
+GEOMETRY:center,center
+MAP
+        |------------------------       -------------------------        
+        |.......................|       |.......................|        
+        |.......................|       |................}}.....|        
+|-------|......}}}}.............|--------.....}}.}.....}}}}.....--------|
+|}}}......}}..}}}}}}..........}}}..........}}}..}.....}....}.}}..}}}}}}}|
+|}}}....}}.}}}.....}....}}...}...}}}....}.}...........}.....}}.}}....}}}|
+|}}}}}}}............}}}}..}}}.......}}}}}}}............}..............}}|
+|}}}}}...............}}...............}}...}............}...........}}}}|
+|-------|.......................|--------...}.........}}}.......--------|
+        |.......................|       |...}}......}}.}........|        
+|--------........LLLL....LL.....--------|....}}...}}............|-------|
+|LLL..........LLL.........LLL......LLL........}.}}}}.......LLL.........L|
+|LLLL........LLL.............L...LL..LLLLLL....}}.}.....LLL...LLL....LLL|
+|LLLLLLLL..LLL.LLLLLL.........LLL......LLLLL.........LLLL........LLLLLLL|
+|LLLLLL..LLL........LLL...LLLL............LLLLL..LLLL.LLLLL........LLLLL|
+|--------..............LLL......--------|.....LLL....LLLLLL.....|-------|
+        |.......................|       |...............LL......|        
+        |.......................|       |.......................|        
+        -------------------------       -------------------------        
+ENDMAP
+
+IF [40%] {
+   $terrain_from = TERRAIN:{ 'L', '}', 'I' }
+   $terrain_to   = TERRAIN:{ 'L', '}', 'I', '.' }
+   SHUFFLE:$terrain_from
+   SHUFFLE:$terrain_to
+   REPLACE_TERRAIN:(0,0,75,18),$terrain_from[0], $terrain_to[0], 100%
+   IF [50%] {
+      REPLACE_TERRAIN:(0,0,75,18),$terrain_from[1], $terrain_to[1], 100%
+   }
+}
+
+# Dungeon Description
+REGION:(01,01,72,17),lit,"ordinary"
+# Stairs
+STAIR:random,up
+STAIR:random,down
+#
+# Non diggable walls
+NON_DIGGABLE:(00,00,72,18)
+
+LOOP [15] {
+  OBJECT:random,random
+}
+
+LOOP [6] {
 TRAP:random,random
+}
+
+LOOP [28] {
+  MONSTER:random,random
+}
+
+
+# Slanted
+
+LEVEL:"bigrm-9"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
+GEOMETRY:center,center
+MAP
+----------------------------------------------                             
+|............................................---                           
+--.............................................---                         
+ ---......................................FF.....---                       
+   ---...................................FF........---                     
+     ---................................FF...........---                   
+       ---.............................FF..............---                 
+         ---..........................FF.................---               
+           ---.......................FF....................---             
+             ---....................FF.......................---           
+               ---.................FF..........................---         
+                 ---..............FF.............................---       
+                   ---...........FF................................----    
+                     ---........FF...................................---   
+                       ---.....FF......................................--- 
+                         ---.............................................--
+                           ---............................................|
+                             ----------------------------------------------
+ENDMAP
+
+IF [40%] {
+   $terrain = TERRAIN:{ 'L', '}', 'T', '.', '-', 'C' }
+   SHUFFLE:$terrain
+   REPLACE_TERRAIN:(0,0,74,17),'F', $terrain[0], 100%
+}
+
+# Dungeon Description
+REGION:(01,01,73,16),lit,"ordinary"
+# Stairs
+STAIR:random,up
+STAIR:random,down
+# Non diggable walls
+NON_DIGGABLE:(00,00,74,17)
+
+LOOP [15] {
+  OBJECT:random,random
+}
+
+LOOP [6] {
 TRAP:random,random
+}
+
+LOOP [28] {
+  MONSTER:random,random
+}
+
+# The Eye
+
+LEVEL:"bigrm-10"
+INIT_MAP:solidfill,'}'
+GEOMETRY:center,center
+MAP
+}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+}}}}}}}}}}}}}}}}}}}}}}}}}}}}}................}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+}}}}}}}}}}}}}}}}}}}}}................................}}}}}}}}}}}}}}}}}}}}}
+}}}}}}}}}}}}}}}............................................}}}}}}}}}}}}}}}
+}}}}}}}}}}......................................................}}}}}}}}}}
+}}}}}}}............................................................}}}}}}}
+}}}}}.......................LLLLLLLLLLLLLLLLLL.......................}}}}}
+}}}....................LLLLLLLLLLLLLLLLLLLLLLLLLLL.....................}}}
+}....................LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL....................}
+}....................LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL....................}
+}....................LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL....................}
+}}}....................LLLLLLLLLLLLLLLLLLLLLLLLLLL.....................}}}
+}}}}}.......................LLLLLLLLLLLLLLLLLL.......................}}}}}
+}}}}}}}............................................................}}}}}}}
+}}}}}}}}}}......................................................}}}}}}}}}}
+}}}}}}}}}}}}}}}............................................}}}}}}}}}}}}}}}
+}}}}}}}}}}}}}}}}}}}}}................................}}}}}}}}}}}}}}}}}}}}}
+}}}}}}}}}}}}}}}}}}}}}}}}}}}}}................}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+ENDMAP
+
+IF [33%] {
+    REPLACE_TERRAIN:(0,0,73,18), 'L', 'T', 100%
+    REPLACE_TERRAIN:(0,0,73,18), 'T', '.', 75%
+}
+
+# Unlit, except 3 mapgrids around the "pupil"
+REGION:(00,00,73,18),unlit,"ordinary"
+REGION:(26,04,47,14),lit,"ordinary"
+REGION:(21,05,51,13),lit,"ordinary"
+REGION:(19,06,54,12),lit,"ordinary"
+# Stairs
+STAIR:random,up
+STAIR:random,down
+
+LOOP [15] {
+  OBJECT:random,random
+}
+LOOP [6] {
 TRAP:random,random
-# Random monsters.
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
+}
+LOOP [28] {
+  MONSTER:random,random
+}
+
+
+# Fog Maze
+
+LEVEL:"bigrm-11"
+GEOMETRY:center,center
+MAP
+.......................................................................
+.......................................................................
+.......................................................................
+.......................................................................
+...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C...
+...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...
+...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C...
+...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...
+...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C...
+...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...
+...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C...
+...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...
+...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C...
+...CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC...
+...C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C...
+.......................................................................
+.......................................................................
+.......................................................................
+.......................................................................
+ENDMAP
+
+IF [33%] {
+   # occasionally it's not a fog maze
+   $terrain = TERRAIN:{ 'L', '}', 'T', '-', 'F' }
+   SHUFFLE:$terrain
+   REPLACE_TERRAIN:(0,0,70,18),'C', $terrain[0], 100%
+}
+
+REGION:(00,00,70,18),lit,"ordinary"
+
+# when falling down on this level, never end up in the fog maze
+TELEPORT_REGION:(00,00,70,18),(02,03,68,15),down
+
+# Stairs up, not in the fog maze
+STAIR:(00,00,70,18),(02,03,68,15),up
+STAIR:random,down
+
+LOOP [15] {
+  OBJECT:random,random
+}
+LOOP [6] {
+  TRAP:random,random
+}
+LOOP [28] {
+  MONSTER:random,random
+}
+
+MAZEWALK:(4, 2), south
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/castle.des nethack/dat/castle.des
--- nh_orig/dat/castle.des	2003-12-07 18:39:12.000000000 -0500
+++ nethack/dat/castle.des	2010-04-11 12:36:58.157750620 -0400
@@ -16,7 +16,11 @@
 # To motivate the player : there are 4 storerooms (armors, weapons, food and
 # gems) and a wand of wishing in one of the 4 towers...
+#
+# Castle level explicitly marked as graveyard to prevent getting
+# too many wraith corpses from VotD
 
-MAZE:"castle",random
-FLAGS: noteleport
+LEVEL:"castle"
+FLAGS: noteleport,mazelevel,graveyard
+INIT_MAP:mazegrid,'-'
 GEOMETRY:center,center
 MAP
@@ -25,13 +29,13 @@
 }|.....|-----------------------------------------------|.....|}
 }|.....+...............................................+.....|}
-}-------------------------------+-----------------------------}
-}}}}}}|........|..........+...........|.......S.S.......|}}}}}}
+}-FFF---------------------------+-------------------------FFF-}
+}}}}}}|........|..........+...........|.......|.|.......|}}}}}}
 .....}|........|..........|...........|.......|.|.......|}.....
 .....}|........------------...........---------S---------}.....
-.....}|...{....+..........+.........\.S.................+......
+.....}|...{....+..........+...........S.................+......
 .....}|........------------...........---------S---------}.....
 .....}|........|..........|...........|.......|.|.......|}.....
-}}}}}}|........|..........+...........|.......S.S.......|}}}}}}
-}-------------------------------+-----------------------------}
+}}}}}}|........|..........+...........|.......|.|.......|}}}}}}
+}-FFF---------------------------+-------------------------FFF-}
 }|.....+...............................................+.....|}
 }|.....|-----------------------------------------------|.....|}
@@ -40,20 +44,41 @@
 ENDMAP
 
+# Treasure room 1
+$place = { (46,05),(44,07),(38,06),(40,04) }
+SHUFFLE: $place
+TERRAIN:$place[0],'S'
+# Treasure room 2
+$place = { (48,05),(54,07),(51,04) }
+SHUFFLE: $place
+TERRAIN:$place[0],'S'
+# Treasure room 3
+$place = { (46,11),(44,12),(38,11),(40,09) }
+SHUFFLE: $place
+TERRAIN:$place[0],'S'
+# Treasure room 4
+$place = { (48,11),(54,09),(51,12) }
+SHUFFLE: $place
+TERRAIN:$place[0],'S'
+
 # Random registers initialisation
-RANDOM_OBJECTS:'[',')','*','%'
-RANDOM_PLACES:(04,02),(58,02),(04,14),(58,14)
-RANDOM_MONSTERS:'L','N','E','H','M','O','R','T','X','Z'
+$object = OBJECT: { '[',')','*','%' }
+$place = { (04,02),(58,02),(04,14),(58,14) }
+$monster = MONSTER:{ 'L','N','E','H','M','O','R','T','X','Z' }
+SHUFFLE: $place
+SHUFFLE: $object
+SHUFFLE: $monster
 
 TELEPORT_REGION:levregion(01,00,10,20),(1,1,61,15),down
-TELEPORT_REGION:levregion(69,00,79,20),(1,1,61,15),up
+TELEPORT_REGION:levregion(69,00,77,20),(1,1,61,15),up
 STAIR:levregion(01,00,10,20),(0,0,62,16),up
+BRANCH:levregion(69,00,77,20),(1,1,61,15)
 FOUNTAIN:(10,08)
 # Doors
-DOOR:closed,(07,03)
-DOOR:closed,(55,03)
+DOOR:locked,(07,03)
+DOOR:locked,(55,03)
 DOOR:locked,(32,04)
 DOOR:locked,(26,05)
-DOOR:locked,(46,05)
-DOOR:locked,(48,05)
+# DOOR:locked,(46,05)
+# DOOR:locked,(48,05)
 DOOR:locked,(47,07)
 DOOR:closed,(15,08)
@@ -63,78 +88,95 @@
 DOOR:locked,(47,09)
 DOOR:locked,(26,11)
-DOOR:locked,(46,11)
-DOOR:locked,(48,11)
+# DOOR:locked,(46,11)
+# DOOR:locked,(48,11)
 DOOR:locked,(32,12)
-DOOR:closed,(07,13)
-DOOR:closed,(55,13)
+DOOR:locked,(07,13)
+DOOR:locked,(55,13)
 # The drawbridge
 DRAWBRIDGE:(05,08),east,closed
 # Storeroom number 1
-OBJECT:object[0],random,(39,05)
-OBJECT:object[0],random,(40,05)
-OBJECT:object[0],random,(41,05)
-OBJECT:object[0],random,(42,05)
-OBJECT:object[0],random,(43,05)
-OBJECT:object[0],random,(44,05)
-OBJECT:object[0],random,(45,05)
-OBJECT:object[0],random,(39,06)
-OBJECT:object[0],random,(40,06)
-OBJECT:object[0],random,(41,06)
-OBJECT:object[0],random,(42,06)
-OBJECT:object[0],random,(43,06)
-OBJECT:object[0],random,(44,06)
-OBJECT:object[0],random,(45,06)
+OBJECT:$object[0],(39,05)
+OBJECT:$object[0],(40,05)
+OBJECT:$object[0],(41,05)
+OBJECT:$object[0],(42,05)
+OBJECT:$object[0],(43,05)
+OBJECT:$object[0],(44,05)
+OBJECT:$object[0],(45,05)
+OBJECT:$object[0],(39,06)
+OBJECT:$object[0],(40,06)
+OBJECT:$object[0],(41,06)
+OBJECT:$object[0],(42,06)
+OBJECT:$object[0],(43,06)
+OBJECT:$object[0],(44,06)
+OBJECT:$object[0],(45,06)
 # Storeroom number 2
-OBJECT:object[1],random,(49,05)
-OBJECT:object[1],random,(50,05)
-OBJECT:object[1],random,(51,05)
-OBJECT:object[1],random,(52,05)
-OBJECT:object[1],random,(53,05)
-OBJECT:object[1],random,(54,05)
-OBJECT:object[1],random,(55,05)
-OBJECT:object[1],random,(49,06)
-OBJECT:object[1],random,(50,06)
-OBJECT:object[1],random,(51,06)
-OBJECT:object[1],random,(52,06)
-OBJECT:object[1],random,(53,06)
-OBJECT:object[1],random,(54,06)
-OBJECT:object[1],random,(55,06)
+OBJECT:$object[1],(49,05)
+OBJECT:$object[1],(50,05)
+OBJECT:$object[1],(51,05)
+OBJECT:$object[1],(52,05)
+OBJECT:$object[1],(53,05)
+OBJECT:$object[1],(54,05)
+OBJECT:$object[1],(55,05)
+OBJECT:$object[1],(49,06)
+OBJECT:$object[1],(50,06)
+OBJECT:$object[1],(51,06)
+OBJECT:$object[1],(52,06)
+OBJECT:$object[1],(53,06)
+OBJECT:$object[1],(54,06)
+OBJECT:$object[1],(55,06)
 # Storeroom number 3
-OBJECT:object[2],random,(39,10)
-OBJECT:object[2],random,(40,10)
-OBJECT:object[2],random,(41,10)
-OBJECT:object[2],random,(42,10)
-OBJECT:object[2],random,(43,10)
-OBJECT:object[2],random,(44,10)
-OBJECT:object[2],random,(45,10)
-OBJECT:object[2],random,(39,11)
-OBJECT:object[2],random,(40,11)
-OBJECT:object[2],random,(41,11)
-OBJECT:object[2],random,(42,11)
-OBJECT:object[2],random,(43,11)
-OBJECT:object[2],random,(44,11)
-OBJECT:object[2],random,(45,11)
+OBJECT:$object[2],(39,10)
+OBJECT:$object[2],(40,10)
+OBJECT:$object[2],(41,10)
+OBJECT:$object[2],(42,10)
+OBJECT:$object[2],(43,10)
+OBJECT:$object[2],(44,10)
+OBJECT:$object[2],(45,10)
+OBJECT:$object[2],(39,11)
+OBJECT:$object[2],(40,11)
+OBJECT:$object[2],(41,11)
+OBJECT:$object[2],(42,11)
+OBJECT:$object[2],(43,11)
+OBJECT:$object[2],(44,11)
+OBJECT:$object[2],(45,11)
 # Storeroom number 4
-OBJECT:object[3],random,(49,10)
-OBJECT:object[3],random,(50,10)
-OBJECT:object[3],random,(51,10)
-OBJECT:object[3],random,(52,10)
-OBJECT:object[3],random,(53,10)
-OBJECT:object[3],random,(54,10)
-OBJECT:object[3],random,(55,10)
-OBJECT:object[3],random,(49,11)
-OBJECT:object[3],random,(50,11)
-OBJECT:object[3],random,(51,11)
-OBJECT:object[3],random,(52,11)
-OBJECT:object[3],random,(53,11)
-OBJECT:object[3],random,(54,11)
-OBJECT:object[3],random,(55,11)
+OBJECT:$object[3],(49,10)
+OBJECT:$object[3],(50,10)
+OBJECT:$object[3],(51,10)
+OBJECT:$object[3],(52,10)
+OBJECT:$object[3],(53,10)
+OBJECT:$object[3],(54,10)
+OBJECT:$object[3],(55,10)
+OBJECT:$object[3],(49,11)
+OBJECT:$object[3],(50,11)
+OBJECT:$object[3],(51,11)
+OBJECT:$object[3],(52,11)
+OBJECT:$object[3],(53,11)
+OBJECT:$object[3],(54,11)
+OBJECT:$object[3],(55,11)
 # THE WAND OF WISHING in 1 of the 4 towers
-CONTAINER:'(',"chest",place[0]
-OBJECT:'/',"wishing",contained
-# Prevent monsters from eating it.  (@'s never eat objects)
-ENGRAVING:place[0],burn,"Elbereth"
+CONTAINER:('(',"chest"),$place[0] {
+  OBJECT:('/',"wishing")
+}
+# THE NOT QUITE WANDS OF WISHING
+# ...since you can see the chest now through the bars,
+# we have to find a better way to disguise where the wand is
+CONTAINER:('(',"chest"),$place[1] {
+  OBJECT:('/',"secret door detection")
+}
+CONTAINER:('(',"chest"),$place[2] {
+  OBJECT:'/'
+}
+CONTAINER:('(',"chest"),$place[3] {
+  OBJECT:'/'
+}
+# Prevent monsters from eating them.  (@'s never eat objects)
+ENGRAVING:$place[0],burn,"Elbereth"
+ENGRAVING:$place[1],burn,"Elbereth"
+ENGRAVING:$place[2],burn,"Elbereth"
+ENGRAVING:$place[3],burn,"Elbereth"
 # The treasure of the lord
-OBJECT:'(',"chest",(37,08)
+OBJECT:('(',"chest"),(37,08)
+OBJECT:('\',"throne"),(36,08)
 # Traps
 TRAP:"trap door",(40,08)
@@ -144,64 +186,36 @@
 TRAP:"trap door",(55,08)
 # Soldiers guarding the entry hall
-MONSTER:'@',"soldier",(08,06)
-MONSTER:'@',"soldier",(09,05)
-MONSTER:'@',"soldier",(11,05)
-MONSTER:'@',"soldier",(12,06)
-MONSTER:'@',"soldier",(08,10)
-MONSTER:'@',"soldier",(09,11)
-MONSTER:'@',"soldier",(11,11)
-MONSTER:'@',"soldier",(12,10)
-MONSTER:'@',"lieutenant",(09,08)
+MONSTER:('@',"soldier"),(08,06)
+MONSTER:('@',"soldier"),(09,05)
+MONSTER:('@',"soldier"),(11,05)
+MONSTER:('@',"soldier"),(12,06)
+MONSTER:('@',"soldier"),(08,10)
+MONSTER:('@',"soldier"),(09,11)
+MONSTER:('@',"soldier"),(11,11)
+MONSTER:('@',"soldier"),(12,10)
+MONSTER:('@',"lieutenant"),(09,08)
 # Soldiers guarding the towers
-MONSTER:'@',"soldier",(03,02)
-MONSTER:'@',"soldier",(05,02)
-MONSTER:'@',"soldier",(57,02)
-MONSTER:'@',"soldier",(59,02)
-MONSTER:'@',"soldier",(03,14)
-MONSTER:'@',"soldier",(05,14)
-MONSTER:'@',"soldier",(57,14)
-MONSTER:'@',"soldier",(59,14)
+MONSTER:('@',"sergeant"),(03,02)
+MONSTER:('@',"sergeant"),(05,02)
+MONSTER:('@',"sergeant"),(57,02)
+MONSTER:('@',"sergeant"),(59,02)
+MONSTER:('@',"sergeant"),(03,14)
+MONSTER:('@',"sergeant"),(05,14)
+MONSTER:('@',"sergeant"),(57,14)
+MONSTER:('@',"sergeant"),(59,14)
 # The four dragons that are guarding the storerooms
-MONSTER:'D',random,(47,05)
-MONSTER:'D',random,(47,06)
-MONSTER:'D',random,(47,10)
-MONSTER:'D',random,(47,11)
+MONSTER:'D',(47,05)
+MONSTER:'D',(47,06)
+MONSTER:'D',(47,10)
+MONSTER:'D',(47,11)
 # Sea monsters in the moat
-MONSTER:';',"giant eel",(05,07)
-MONSTER:';',"giant eel",(05,09)
-MONSTER:';',"giant eel",(57,07)
-MONSTER:';',"giant eel",(57,09)
-MONSTER:';',"shark",(05,00)
-MONSTER:';',"shark",(05,16)
-MONSTER:';',"shark",(57,00)
-MONSTER:';',"shark",(57,16)
-# The throne room and the court monsters
-MONSTER:monster[0],random,(27,05)
-MONSTER:monster[1],random,(30,05)
-MONSTER:monster[2],random,(33,05)
-MONSTER:monster[3],random,(36,05)
-MONSTER:monster[4],random,(28,06)
-MONSTER:monster[5],random,(31,06)
-MONSTER:monster[6],random,(34,06)
-MONSTER:monster[7],random,(37,06)
-MONSTER:monster[8],random,(27,07)
-MONSTER:monster[9],random,(30,07)
-MONSTER:monster[0],random,(33,07)
-MONSTER:monster[1],random,(36,07)
-MONSTER:monster[2],random,(28,08)
-MONSTER:monster[3],random,(31,08)
-MONSTER:monster[4],random,(34,08)
-MONSTER:monster[5],random,(27,09)
-MONSTER:monster[6],random,(30,09)
-MONSTER:monster[7],random,(33,09)
-MONSTER:monster[8],random,(36,09)
-MONSTER:monster[9],random,(28,10)
-MONSTER:monster[0],random,(31,10)
-MONSTER:monster[1],random,(34,10)
-MONSTER:monster[2],random,(37,10)
-MONSTER:monster[3],random,(27,11)
-MONSTER:monster[4],random,(30,11)
-MONSTER:monster[5],random,(33,11)
-MONSTER:monster[6],random,(36,11)
+MONSTER:(';',"giant eel"),(05,07)
+MONSTER:(';',"giant eel"),(05,09)
+MONSTER:(';',"giant eel"),(57,07)
+MONSTER:(';',"giant eel"),(57,09)
+MONSTER:(';',"shark"),(05,00)
+MONSTER:(';',"shark"),(05,16)
+MONSTER:(';',"shark"),(57,00)
+MONSTER:(';',"shark"),(57,16)
 # MazeWalks
 MAZEWALK:(00,10),west
@@ -216,5 +230,34 @@
 REGION:(57,05,62,11),lit,"ordinary"
 #   Throne room
-REGION:(27,05,37,11),lit,"throne",unfilled
+REGION:(27,05,37,11),lit,"throne",unfilled {
+  # the court monsters
+  MONSTER:$monster[0],random
+  MONSTER:$monster[1],random
+  MONSTER:$monster[2],random
+  MONSTER:$monster[3],random
+  MONSTER:$monster[4],random
+  MONSTER:$monster[5],random
+  MONSTER:$monster[6],random
+  MONSTER:$monster[7],random
+  MONSTER:$monster[8],random
+  MONSTER:$monster[9],random
+  MONSTER:$monster[0],random
+  MONSTER:$monster[1],random
+  MONSTER:$monster[2],random
+  MONSTER:$monster[3],random
+  MONSTER:$monster[4],random
+  MONSTER:$monster[5],random
+  MONSTER:$monster[6],random
+  MONSTER:$monster[7],random
+  MONSTER:$monster[8],random
+  MONSTER:$monster[9],random
+  MONSTER:$monster[0],random
+  MONSTER:$monster[1],random
+  MONSTER:$monster[2],random
+  MONSTER:$monster[3],random
+  MONSTER:$monster[4],random
+  MONSTER:$monster[5],random
+  MONSTER:$monster[6],random
+}
 #   Antechamber
 REGION:(07,05,14,11),lit,"ordinary"
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/Caveman.des nethack/dat/Caveman.des
--- nh_orig/dat/Caveman.des	2003-12-07 18:39:12.000000000 -0500
+++ nethack/dat/Caveman.des	2010-08-16 13:20:13.634708200 -0400
@@ -9,29 +9,40 @@
 #	and receive your quest assignment.
 #
-MAZE: "Cav-strt",' '
-FLAGS: noteleport,hardfloor
+LEVEL: "Cav-strt"
+FLAGS: noteleport,hardfloor,arboreal,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"tiger"), (16,'S'), (16,"ape"), (4,'f')
 GEOMETRY:center,center
 MAP
                                                                             
-  ......     ..........................       ...        ....  ......       
- ......       ..........................     ........       ....    .....   
-  ..BB      .............................    .........            ....  ..  
-     ..    ......................              .......      ..     ....  .. 
-     ..     ....................                     ..  .......    ..  ... 
-   ..              S   BB                .....     .......   ....      .... 
-    ..        ...  .   ..               ........  ..     ..   ..       ...  
-     ..      ......     ..             ............       ..          ...   
-       .      ....       ..             ........           ..  ...........  
-  ...   ..     ..        .............                  ................... 
- .....   .....            ...............................      ...........  
-  .....B................            ...                               ...   
-  .....     .  ..........        .... .      ...  ..........           ...  
-   ...     ..          .............  ..    ...................        .... 
-          BB       ..   .........      BB    ...  ..........  ..   ...  ... 
-       ......    .....  B          ........         ..         .. ....  ... 
-     ..........  ..........         ..... ...      .....        ........    
-       ..  ...    .  .....         ....    ..       ...            ..       
+  ......     ..........................       ... PP   P ....  ...... P     
+ ......       ..........................     .......P    PP .... PP .....P  
+  ..BB      ............................    P...P P...P      .P  P....  ..  
+     ..    ......................             P.......P  PP .. P  P....P .. 
+     ..  P BB...................         PP          ..  .......P  P.. P... 
+   ...   ...B      B                     ..... P  P....... PP....   PP .... 
+    ..P P.    ...  .  ...               ...P....P ..  PP ..   .. P     P..  
+     ..  .P  .......  ....            P...PPP...... P    PPPP P    PP ...   
+  PPP .. .    ....   ... . PP  P      P ........  P   P  P ..  ...........  
+  ... P...     ..   .... .B...........P  PP  PP  PP P  P.........PP........ 
+ .....  P.....             ..............................  PP  ...........P 
+P .PP..B..........PPP...   P  PPP   ... P P PPP  P  P PP     P  PPP   ...   
+  .....  PP .  ..........PP  PPP ....P.PP    ...  .......... PP       P...  
+  P...P    ..    PPP   .............  ..   P.........PPPP......     P P.... 
+          BB            .........PP    BB    ...  .....P....P .. PP... P... 
+       ......    .....  B     PP    .......   P PP P.. PPP   PP.. .P..  ... 
+     ..........  ..........        ...... ..      P.....   P    .........P  
+       ..  ...    .  .....         ....    ..       ...P       P   ..  P    
                                                                             
 ENDMAP
+
+REPLACE_TERRAIN:(40,1, 74,18), 'P', ' ', 25%
+REPLACE_TERRAIN:(40,1, 74,18), 'P', '.', 5%
+
+IF [90%] {
+   TERRAIN:(43,11),' '
+   TERRAIN:(40,10),'.'
+}
+
 # Dungeon Description
 REGION:(00,00,75,19),unlit,"ordinary"
@@ -43,49 +54,74 @@
 REGION:(05,17,14,18),lit,"ordinary",unfilled,true
 REGION:(17,16,23,18),lit,"ordinary",unfilled,true
-REGION:(35,16,44,18),lit,"ordinary",unfilled,true
+REGION:(37,16,44,18),lit,"ordinary",unfilled,true
 # Stairs
-STAIR:(02,03),down
+LADDER:(02,03),down
 # Portal arrival point
 BRANCH:(71,09,71,09),(0,0,0,0)
-# Doors
-DOOR:locked,(19,06)
 # The temple altar (this will force a priest(ess) to be created)
 ALTAR:(36,02),coaligned,shrine
 # Shaman Karnov
-MONSTER:'@',"Shaman Karnov",(35,02)
+MONSTER:('@',"Shaman Karnov"),(35,02) {
+  OBJECT:'[',1d6
+  OBJECT:')',1d6
+}
 # The treasure of Shaman Karnov
-OBJECT:'(',"chest",(34,02)
+OBJECT:('(',"chest"),(34,02)
 # neanderthal guards for the audience chamber
-MONSTER:'@',"neanderthal",(20,03)
-MONSTER:'@',"neanderthal",(20,02)
-MONSTER:'@',"neanderthal",(20,01)
-MONSTER:'@',"neanderthal",(21,03)
-MONSTER:'@',"neanderthal",(21,02)
-MONSTER:'@',"neanderthal",(21,01)
-MONSTER:'@',"neanderthal",(22,01)
-MONSTER:'@',"neanderthal",(26,09)
+MONSTER:('@',"neanderthal"),(20,03) {
+  OBJECT:')'
+}
+MONSTER:('@',"neanderthal"),(20,02) {
+  OBJECT:')'
+}
+MONSTER:('@',"neanderthal"),(20,01) {
+  OBJECT:')'
+}
+MONSTER:('@',"neanderthal"),(21,03) {
+  OBJECT:')'
+}
+MONSTER:('@',"neanderthal"),(21,02) {
+  OBJECT:')'
+}
+MONSTER:('@',"neanderthal"),(21,01) {
+  OBJECT:')'
+}
+MONSTER:('@',"neanderthal"),(22,01) {
+  OBJECT:')'
+}
+MONSTER:('@',"neanderthal"),(24,08) {
+  OBJECT:')'
+}
 # Non diggable walls
 NON_DIGGABLE:(00,00,75,19)
 # Random traps
-TRAP:"pit",(47,11)
-TRAP:"pit",(57,10)
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-# Monsters on siege duty (in the outer caves).
-MONSTER: 'h',"bugbear",(47,02),hostile
-MONSTER: 'h',"bugbear",(48,03),hostile
-MONSTER: 'h',"bugbear",(49,04),hostile
-MONSTER: 'h',"bugbear",(67,03),hostile
-MONSTER: 'h',"bugbear",(69,04),hostile
-MONSTER: 'h',"bugbear",(51,13),hostile
-MONSTER: 'h',"bugbear",(53,14),hostile
-MONSTER: 'h',"bugbear",(55,15),hostile
-MONSTER: 'h',"bugbear",(63,10),hostile
-MONSTER: 'h',"bugbear",(65,09),hostile
-MONSTER: 'h',"bugbear",(67,10),hostile
-MONSTER: 'h',"bugbear",(69,11),hostile
-WALLIFY
+TRAP:"pit",random
+TRAP:"pit",random
+TRAP:"pit",random
+TRAP:"spiked pit",random
+TRAP:"spiked pit",random
+TRAP:"spiked pit",random
+TRAP:"bear",(19,13)
+TRAP:"bear",(46,11)
+TRAP:"bear",random
+TRAP:"bear",random
+TRAP:"bear",random
+TRAP:"bear",random
+# Random jungle stuff
+LOOP [5 + 1d10] {
+  MONSTER: (';',"giant eel"),random,hostile
+}
+LOOP [10 + 1d5] {
+  MONSTER: ('Y',"monkey"),random,hostile
+}
+LOOP [4 + 1d3] {
+  MONSTER: ('Y',"ape"),random,hostile
+}
+LOOP [3 + 1d3] {
+  MONSTER: ('S',"python"),random,hostile
+}
+LOOP [3 + 1d3] {
+  MONSTER: ('f',"panther"),random,hostile
+}
 
 #
@@ -96,91 +132,71 @@
 #
 
-MAZE: "Cav-loca",' '
-FLAGS: hardfloor
+LEVEL: "Cav-loca"
+FLAGS: noteleport,hardfloor,arboreal,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"tiger"), (16,'S'), (16,"ape"), (4,'f')
 GEOMETRY:center,center
 MAP
                                                                             
     .............                     ...........                           
-   ...............                   .............                          
-    .............                  ...............        ..........        
-     ...........                    .............      ...............      
-        ...                                    ...   ..................     
-         ...                ..........          ... ..................      
-          ...              ............          BBB...................     
+   ........PPP....                   .............                          
+    ......PPP....                  ...............        ..........        
            ...              ..........          ......................      
-            .....                 ..      .....B........................    
-  ....       ...............      .    ........B..........................  
- ......     .. .............S..............         ..................      
-  ....     ..                ...........             ...............        
-     ..  ...                                    ....................        
+        ....  PP                               ...   ..................     
+         ...                ..........          ... ..................      
+         P...              ....PPP.....          BBB...................     
+           ... P            ..........          ......................      
+   PP       ..... PP   P          ..      ....PB........................    
+  ....       ...............      .  P .......PB..........................  
+ ......     .. .............P..............         ..................      
+  ....     ..  P   PPP       ...........             ...............        
+     ..  ...                      PPP           ....................        
       ....                                      BB...................       
-         ..                 ..                 ..  ...............          
-          ..   .......     ....  .....  ....  ..     .......   S            
-           ............     ....... ..  .......       .....    ...  ....    
-               .......       .....   ......                      .......    
+      PP .. P               ..                 ..  ...............          
+          ..   .......     ....  .....  ....  ..     .......   P            
+         P ......PPP...     ....... ..  .......       .....    ...  ....    
+            P  .......       .....   ......                      .......    
                                                                             
 ENDMAP
+
+REPLACE_TERRAIN:(00,00,25,19), ' ', 'P', 10%
+
 # Dungeon Description
 REGION:(00,00,75,19),unlit,"ordinary"
 REGION:(52,06,73,15),lit,"ordinary",unfilled,true
-# Doors
-DOOR:locked,(28,11)
 # Stairs
-STAIR:(04,03),up
-STAIR:(73,10),down
+LADDER:(04,03),up
+LADDER:(73,10),down
 # Non diggable walls
 NON_DIGGABLE:(00,00,75,19)
 # Objects
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+LOOP [10 + 2d5] {
+  OBJECT:random,random
+}
 # Random traps
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-# Random monsters.
-MONSTER:'h',"bugbear",(02,10),hostile
-MONSTER:'h',"bugbear",(03,11),hostile
-MONSTER:'h',"bugbear",(04,12),hostile
-MONSTER:'h',"bugbear",(02,11),hostile
-MONSTER:'h',"bugbear",(16,16),hostile
-MONSTER:'h',"bugbear",(17,17),hostile
-MONSTER:'h',"bugbear",(18,18),hostile
-MONSTER:'h',"bugbear",(19,16),hostile
-MONSTER:'h',"bugbear",(30,06),hostile
-MONSTER:'h',"bugbear",(31,07),hostile
-MONSTER:'h',"bugbear",(32,08),hostile
-MONSTER:'h',"bugbear",(33,06),hostile
-MONSTER:'h',"bugbear",(34,07),hostile
-MONSTER:'h',"bugbear",random,hostile
-MONSTER:'h',"bugbear",random,hostile
-MONSTER:'h',"bugbear",random,hostile
-MONSTER:'h',"bugbear",random,hostile
-MONSTER:'h',random,random,hostile
-MONSTER:'H',random,random,hostile
-MONSTER:'H',"hill giant",(03,12),hostile
-MONSTER:'H',"hill giant",(20,17),hostile
-MONSTER:'H',"hill giant",(35,08),hostile
-MONSTER:'H',"hill giant",random,hostile
-MONSTER:'H',"hill giant",random,hostile
-MONSTER:'H',"hill giant",random,hostile
-MONSTER:'H',"hill giant",random,hostile
-MONSTER:'H',random,random,hostile
-WALLIFY
+LOOP [3 + 1d5] {
+  TRAP:"spiked pit",random
+}
+LOOP [4 + 1d5] {
+  TRAP:"bear",random
+}
+# Monsters...
+MONSTER:(';',"electric eel"),(28,11),hostile
+MONSTER:(';',"electric eel"),(46,09),hostile
+MONSTER:(';',"electric eel"),(46,10),hostile
+MONSTER:(';',"electric eel"),(63,16),hostile
+LOOP [3 + 1d6] {
+  MONSTER:(';',"giant eel"),random,hostile
+}
+LOOP [7 + 1d6] {
+  MONSTER:('Y',"carnivorous ape"),random,hostile
+}
+LOOP [3 + 1d5] {
+  MONSTER:('Y',"monkey"),random,hostile
+}
+LOOP [3 + 1d3] {
+  MONSTER:('S',"python"),random,hostile
+}
+# WALLIFY
 
 #
@@ -192,5 +208,8 @@
 #
 
-MAZE: "Cav-goal", ' '
+LEVEL: "Cav-goal"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"tiger"), (16,'S'), (16,"ape"), (4,'f')
 GEOMETRY:center,center
 MAP
@@ -219,31 +238,88 @@
 REGION:(00,00,75,19),lit,"ordinary"
 # Stairs
-STAIR:random,up
+LADDER:random,up
 # Non diggable walls
 NON_DIGGABLE:(00,00,75,19)
 # Objects
-OBJECT:')',"mace",(23,10),blessed,0,"The Sceptre of Might"
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:(')',"mace"),(23,10),blessed,0,NAME:"The Sceptre of Might"
+LOOP [10 + 2d8] {
+  OBJECT:random,random
+}
 # monsters.
-MONSTER:'D',"Chromatic Dragon",(23,10),asleep
-MONSTER:'F',"shrieker",(26,13)
-MONSTER:'F',"shrieker",(25,8)
-MONSTER:'F',"shrieker",(45,11)
+MONSTER:('D',"Chromatic Dragon"),(23,10),asleep {
+  OBJECT:('(', "Bell of Opening"),uncursed
+  OBJECT:random
+  OBJECT:random
+  OBJECT:random
+  OBJECT:random
+  OBJECT:random
+}
+MONSTER:('F',"shrieker"),(26,13)
+MONSTER:('F',"shrieker"),(25,8)
+MONSTER:('F',"shrieker"),(45,11)
+LOOP [2 + 1d4] {
+  MONSTER:('Y',"carnivorous ape"),random,hostile
+  MONSTER[90%]:('f',"tiger"),random,hostile
+}
 WALLIFY
 
 #
+#	The level inbetween the original starting jungle and the lower levels
+#	where the actual caves are.
+#
+
+LEVEL: "Cav-fila"
+FLAGS: noteleport,hardfloor,arboreal,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"tiger"), (16,'S'), (16,"ape"), (4,'f')
+GEOMETRY: center,center
+MAP
+                                                                            
+                                          P                                 
+                                         PP                                 
+    ...                ....             .PP...            P  ....           
+   .....              ..PP...       ....PP.......          ........         
+   .....             ...PP...      .....PPP.........   P ..........         
+   .......           ........      .....PP..........................        
+     .....           .........      ...PPP............ P    ....P...        
+     ..P..         .....  ....       ..PP...     PPP        ...PPP..        
+     ..PP.         ....    ....       PPP                  P...PPP..        
+      .....        ...      ...       PP                    ....P...        
+      .....        ..       ...       P                    .........P       
+       ..... P     ..        ...                         ...........        
+       ......      ..        ...                  ..................        
+       ......      ..         .. P   PPP   .........PPPP...........P        
+        P  ...  PP ..         ..............................   PP           
+            ........               PPP    P   ..........                    
+             PPP                                                            
+                                                                            
+                                                                            
+ENDMAP
+#
+LADDER: (05,04), up
+LADDER: (36,05), down
+#
+REGION:(00,00,75,19),unlit,"ordinary"
+#
+NON_DIGGABLE:(00,00,75,19)
+#
+LOOP [5 + 1d5] {
+  OBJECT: random, random
+}
+#
+LOOP [2 + 1d3] {
+  TRAP[90%]: "pit", random
+  TRAP[90%]: "spiked pit", random
+  TRAP[90%]: "bear", random
+}
+TRAP: "bear", (37,15)
+#
+LOOP [5 + 1d10] {
+  MONSTER[90%]: ('f',"tiger"),random,hostile
+  MONSTER[90%]: ('S',"python"),random,hostile
+  MONSTER[90%]: ('Y',"carnivorous ape"),random,hostile
+}
+
+#
 #	The "fill" levels for the quest.
 #
@@ -253,64 +329,29 @@
 #	and goal levels.
 #
-
-MAZE: "Cav-fila" , ' '
-INIT_MAP: '.' , ' ' , true , true , random , true
-NOMAP
-#
-STAIR: random, up
-STAIR: random, down
-#
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-#
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
+#	Obviously, "fila" has been hijacked and moved above.  :)
 #
-MONSTER: 'h', "bugbear", random, hostile
-MONSTER: 'h', "bugbear", random, hostile
-MONSTER: 'h', "bugbear", random, hostile
-MONSTER: 'h', "bugbear", random, hostile
-MONSTER: 'h', "bugbear", random, hostile
-MONSTER: 'h', random, random, hostile
-MONSTER: 'H', "hill giant", random, hostile
 
-MAZE: "Cav-filb" , ' '
-INIT_MAP: '.' , ' ' , true , true , random , true
+LEVEL: "Cav-filb"
+FLAGS:mazelevel,noflip
+INIT_MAP: mines, '.' , ' ' , true , true , random , true
+MON_GENERATION:86%, (64,"tiger"), (16,'S'), (16,"ape"), (4,'f')
 NOMAP
 #
-STAIR: random, up
-STAIR: random, down
+LADDER: random, up
+LADDER: random, down
 #
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+LOOP [5 + 1d5] {
+  OBJECT: random, random
+}
 #
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
+LOOP [2 + 1d3] {
+  TRAP[90%]: "pit", random
+  TRAP[90%]: "spiked pit", random
+  TRAP[90%]: "bear", random
+}
 #
-MONSTER: 'h', "bugbear", random, hostile
-MONSTER: 'h', "bugbear", random, hostile
-MONSTER: 'h', "bugbear", random, hostile
-MONSTER: 'h', "bugbear", random, hostile
-MONSTER: 'h', random, random, hostile
-MONSTER: 'h', random, random, hostile
-MONSTER: 'H', "hill giant", random, hostile
-MONSTER: 'H', "hill giant", random, hostile
+LOOP [5 + 1d10] {
+  MONSTER[90%]: ('f',"tiger"),random,hostile
+  MONSTER[90%]: ('S',"python"),random,hostile
+  MONSTER[90%]: ('Y',"carnivorous ape"),random,hostile
+}
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/dungeon.def nethack/dat/dungeon.def
--- nh_orig/dat/dungeon.def	2003-12-07 18:39:13.000000000 -0500
+++ nethack/dat/dungeon.def	2010-04-23 14:27:35.945715831 -0400
@@ -22,11 +22,11 @@
 LEVALIGN:	neutral
 CHAINBRANCH:	"Sokoban" "oracle" + (1, 0) up
-RNDLEVEL:	"bigrm" "B" @ (10, 3) 40 5
+RNDLEVEL:	"bigrm" "B" @ (10, 3) 40 11
 CHAINBRANCH:	"The Quest" "oracle" + (6, 2) portal
 BRANCH:		"Fort Ludios" @ (18, 4) portal
-RNDLEVEL:	"medusa" "none" @ (-5, 4) 2
+RNDLEVEL:	"medusa" "none" @ (-5, 4) 4
 LEVALIGN:	chaotic
 LEVEL:		"castle" "none" @ (-1, 0)
-CHAINBRANCH:	"Gehennom" "castle" + (0, 0) no_down
+CHAINBRANCH:	"Gehennom" "castle" + (0, 0) down
 BRANCH:		"The Elemental Planes" @ (1, 0) no_down up
 
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/endgame.des nethack/dat/endgame.des
--- nh_orig/dat/endgame.des	2003-12-07 18:39:13.000000000 -0500
+++ nethack/dat/endgame.des	2010-05-13 09:22:22.243714740 -0400
@@ -10,6 +10,7 @@
 # shrine.
 
-MAZE:"earth",' '
-FLAGS: noteleport,hardfloor,shortsighted
+LEVEL:"earth"
+FLAGS: noteleport,hardfloor,shortsighted,mazelevel
+INIT_MAP:solidfill,' '
 MESSAGE: "Well done, mortal!"
 MESSAGE: "But now thou must face the final Test..."
@@ -44,87 +45,93 @@
                                                                             
 ENDMAP
+
+REPLACE_TERRAIN:(0,0,75,19), ' ', ('.', unlit), 15%
+
+
 #  Since there are no stairs, this forces the hero's initial placement
 TELEPORT_REGION:(69,16,69,16),(0,0,0,0)
+TERRAIN:(69,16),'.'
 PORTAL:(0,0,75,19),(65,13,75,19),"air"
 #  Some helpful monsters.  Making sure a
 #  pick axe and at least one wand of digging
 #  are available.
-MONSTER:'@',"Elvenking",(67,16)
-MONSTER:'H',"minotaur",(67,14)
+MONSTER:('@',"Elvenking"),(67,16)
+MONSTER:('H',"minotaur"),(67,14)
 #  An assortment of earth-appropriate nasties
 #  in each cavern.
-MONSTER:'E',"earth elemental",(52,13),hostile
-MONSTER:'E',"earth elemental",(53,13),hostile
-MONSTER:'T',"rock troll",(53,12)
-MONSTER:'H',"stone giant",(54,12)
+MONSTER:('E',"earth elemental"),(52,13),hostile
+MONSTER:('E',"earth elemental"),(53,13),hostile
+MONSTER:('T',"rock troll"),(53,12)
+MONSTER:('H',"stone giant"),(54,12)
 #
-MONSTER:'S',"pit viper",(70,05)
-MONSTER:'&',"barbed devil",(69,06)
-MONSTER:'H',"stone giant",(69,08)
-MONSTER:''',"stone golem",(71,08)
-MONSTER:'&',"pit fiend",(70,09)
-MONSTER:'E',"earth elemental",(70,08),hostile
+MONSTER:('S',"pit viper"),(70,05)
+MONSTER:('&',"barbed devil"),(69,06)
+MONSTER:('H',"stone giant"),(69,08)
+MONSTER:(''',"stone golem"),(71,08)
+MONSTER:('&',"pit fiend"),(70,09)
+MONSTER:('E',"earth elemental"),(70,08),hostile
 #
-MONSTER:'E',"earth elemental",(60,03),hostile
-MONSTER:'H',"stone giant",(61,04)
-MONSTER:'E',"earth elemental",(62,04),hostile
-MONSTER:'E',"earth elemental",(61,05),hostile
-MONSTER:'s',"scorpion",(62,05)
-MONSTER:'p',"rock piercer",(63,05)
+MONSTER:('E',"earth elemental"),(60,03),hostile
+MONSTER:('H',"stone giant"),(61,04)
+MONSTER:('E',"earth elemental"),(62,04),hostile
+MONSTER:('E',"earth elemental"),(61,05),hostile
+MONSTER:('s',"scorpion"),(62,05)
+MONSTER:('p',"rock piercer"),(63,05)
 #
-MONSTER:'U',"umber hulk",(40,05)
-MONSTER:'v',"dust vortex",(42,05)
-MONSTER:'T',"rock troll",(38,06)
-MONSTER:'E',"earth elemental",(39,06),hostile
-MONSTER:'E',"earth elemental",(41,06),hostile
-MONSTER:'E',"earth elemental",(38,07),hostile
-MONSTER:'H',"stone giant",(39,07)
-MONSTER:'E',"earth elemental",(43,07),hostile
-MONSTER:''',"stone golem",(37,08)
-MONSTER:'S',"pit viper",(43,08)
-MONSTER:'S',"pit viper",(43,09)
-MONSTER:'T',"rock troll",(44,10)
+MONSTER:('U',"umber hulk"),(40,05)
+MONSTER:('v',"dust vortex"),(42,05)
+MONSTER:('T',"rock troll"),(38,06)
+MONSTER:('E',"earth elemental"),(39,06),hostile
+MONSTER:('E',"earth elemental"),(41,06),hostile
+MONSTER:('E',"earth elemental"),(38,07),hostile
+MONSTER:('H',"stone giant"),(39,07)
+MONSTER:('E',"earth elemental"),(43,07),hostile
+MONSTER:(''',"stone golem"),(37,08)
+MONSTER:('S',"pit viper"),(43,08)
+MONSTER:('S',"pit viper"),(43,09)
+MONSTER:('T',"rock troll"),(44,10)
 #
-MONSTER:'E',"earth elemental",(02,01),hostile
-MONSTER:'E',"earth elemental",(03,01),hostile
-MONSTER:''',"stone golem",(01,02)
-MONSTER:'E',"earth elemental",(02,02),hostile
-MONSTER:'T',"rock troll",(04,03)
-MONSTER:'T',"rock troll",(03,03)
-MONSTER:'&',"pit fiend",(03,04)
-MONSTER:'E',"earth elemental",(04,05),hostile
-MONSTER:'S',"pit viper",(05,06)
+MONSTER:('E',"earth elemental"),(02,01),hostile
+MONSTER:('E',"earth elemental"),(03,01),hostile
+MONSTER:(''',"stone golem"),(01,02)
+MONSTER:('E',"earth elemental"),(02,02),hostile
+MONSTER:('T',"rock troll"),(04,03)
+MONSTER:('T',"rock troll"),(03,03)
+MONSTER:('&',"pit fiend"),(03,04)
+MONSTER:('E',"earth elemental"),(04,05),hostile
+MONSTER:('S',"pit viper"),(05,06)
 #
-MONSTER:'E',"earth elemental",(21,02),hostile
-MONSTER:'E',"earth elemental",(21,03),hostile
-MONSTER:'H',"minotaur",(21,04)
-MONSTER:'E',"earth elemental",(21,05),hostile
-MONSTER:'T',"rock troll",(22,05)
-MONSTER:'E',"earth elemental",(22,06),hostile
-MONSTER:'E',"earth elemental",(23,06),hostile
+MONSTER:('E',"earth elemental"),(21,02),hostile
+MONSTER:('E',"earth elemental"),(21,03),hostile
+MONSTER:('H',"minotaur"),(21,04)
+MONSTER:('E',"earth elemental"),(21,05),hostile
+MONSTER:('T',"rock troll"),(22,05)
+MONSTER:('E',"earth elemental"),(22,06),hostile
+MONSTER:('E',"earth elemental"),(23,06),hostile
 #
-MONSTER:'S',"pit viper",(14,08)
-MONSTER:'&',"barbed devil",(14,09)
-MONSTER:'E',"earth elemental",(13,10),hostile
-MONSTER:'T',"rock troll",(12,11)
-MONSTER:'E',"earth elemental",(14,12),hostile
-MONSTER:'E',"earth elemental",(15,13),hostile
-MONSTER:'H',"stone giant",(17,13)
-MONSTER:''',"stone golem",(18,13)
-MONSTER:'&',"pit fiend",(18,12)
-MONSTER:'E',"earth elemental",(18,11),hostile
-MONSTER:'E',"earth elemental",(18,10),hostile
+MONSTER:('S',"pit viper"),(14,08)
+MONSTER:('&',"barbed devil"),(14,09)
+MONSTER:('E',"earth elemental"),(13,10),hostile
+MONSTER:('T',"rock troll"),(12,11)
+MONSTER:('E',"earth elemental"),(14,12),hostile
+MONSTER:('E',"earth elemental"),(15,13),hostile
+MONSTER:('H',"stone giant"),(17,13)
+MONSTER:(''',"stone golem"),(18,13)
+MONSTER:('&',"pit fiend"),(18,12)
+MONSTER:('E',"earth elemental"),(18,11),hostile
+MONSTER:('E',"earth elemental"),(18,10),hostile
 #
-MONSTER:'&',"barbed devil",(02,16)
-MONSTER:'E',"earth elemental",(03,16),hostile
-MONSTER:'T',"rock troll",(02,17)
-MONSTER:'E',"earth elemental",(04,17),hostile
-MONSTER:'E',"earth elemental",(04,18),hostile
+MONSTER:('&',"barbed devil"),(02,16)
+MONSTER:('E',"earth elemental"),(03,16),hostile
+MONSTER:('T',"rock troll"),(02,17)
+MONSTER:('E',"earth elemental"),(04,17),hostile
+MONSTER:('E',"earth elemental"),(04,18),hostile
 
-OBJECT:'`',"boulder",random
+OBJECT:('`',"boulder"),random
 
 
-MAZE:"air",' '
-FLAGS: noteleport,hardfloor,shortsighted
+LEVEL:"air"
+FLAGS: noteleport,hardfloor,shortsighted,mazelevel,stormy
+INIT_MAP:solidfill,' '
 # The following messages are somewhat obtuse, to make then
 # equally meaningful if the player can see or not.
@@ -138,25 +145,29 @@
 # is all "air".
 MAP
-AAAAAAAAAAAAAAAAAAAAAAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAACCCCCCAAAAAAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAACCAACCCCCAAAAAACCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAACCACCCCCCCAAAAACCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAACCCCCCCCCCAAAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAACCCCAAACCAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAACCCCAAAAAACCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAACCCCCCCAAAACCACCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAACCCCAAAAAAACCACAACCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCAACCCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAACCCCAAACCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAACACACCCCCAAACCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAACAACCCCCCCAAAACCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAACACCCCCCCCAAACCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCCCCCCCCAACCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAACACCCCCCCCCCACCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAACAACCCCCCCCCCCCCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAACCCCCCAAACCCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAACCAAAAAACCCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 ENDMAP
+
+REPLACE_TERRAIN:(0,0,75,19), 'A', 'C', 35%
+REPLACE_TERRAIN:(25,0,50,19), 'A', 'C', 50%
+
 # Use up and down regions to partition the level into three parts;
 # teleportation can't cross from one part into another.
@@ -167,65 +178,66 @@
 PORTAL:levregion(57,01,78,19),(0,0,0,0),"fire"
 REGION:(00,00,75,19),lit,"ordinary"
-MONSTER:'E',"air elemental",random,hostile
-MONSTER:'E',"air elemental",random,hostile
-MONSTER:'E',"air elemental",random,hostile
-MONSTER:'E',"air elemental",random,hostile
-MONSTER:'E',"air elemental",random,hostile
-MONSTER:'E',"air elemental",random,hostile
-MONSTER:'E',"air elemental",random,hostile
-MONSTER:'E',"air elemental",random,hostile
-MONSTER:'E',"air elemental",random,hostile
-MONSTER:'E',"air elemental",random,hostile
-MONSTER:'E',"air elemental",random,hostile
+MONSTER:('E',"air elemental"),random,hostile
+MONSTER:('E',"air elemental"),random,hostile
+MONSTER:('E',"air elemental"),random,hostile
+MONSTER:('E',"air elemental"),random,hostile
+MONSTER:('E',"air elemental"),random,hostile
+MONSTER:('E',"air elemental"),random,hostile
+MONSTER:('E',"air elemental"),random,hostile
+MONSTER:('E',"air elemental"),random,hostile
+MONSTER:('E',"air elemental"),random,hostile
+MONSTER:('E',"air elemental"),random,hostile
+MONSTER:('E',"air elemental"),random,hostile
 
-MONSTER:'e',"floating eye",random,hostile
-MONSTER:'e',"floating eye",random,hostile
-MONSTER:'e',"floating eye",random,hostile
+MONSTER:('e',"floating eye"),random,hostile
+MONSTER:('e',"floating eye"),random,hostile
+MONSTER:('e',"floating eye"),random,hostile
 
-MONSTER:'y',"yellow light",random,hostile
-MONSTER:'y',"yellow light",random,hostile
-MONSTER:'y',"yellow light",random,hostile
+MONSTER:('y',"yellow light"),random,hostile
+MONSTER:('y',"yellow light"),random,hostile
+MONSTER:('y',"yellow light"),random,hostile
 
-MONSTER:'A',"couatl",random
+MONSTER:('A',"couatl"),random
 
-MONSTER:'D',random,random
-MONSTER:'D',random,random
-MONSTER:'D',random,random
-MONSTER:'D',random,random
-MONSTER:'D',random,random
+MONSTER:'D',random
+MONSTER:'D',random
+MONSTER:'D',random
+MONSTER:'D',random
+MONSTER:'D',random
 
-MONSTER:'E',random,random
-MONSTER:'E',random,random
-MONSTER:'E',random,random
-MONSTER:'J',random,random
-MONSTER:'J',random,random
+MONSTER:'E',random
+MONSTER:'E',random
+MONSTER:'E',random
+MONSTER:'J',random
+MONSTER:'J',random
 
-MONSTER:'&',"djinni",random,hostile
-MONSTER:'&',"djinni",random,hostile
-MONSTER:'&',"djinni",random,hostile
+MONSTER:('&',"djinni"),random,hostile
+MONSTER:('&',"djinni"),random,hostile
+MONSTER:('&',"djinni"),random,hostile
 
-MONSTER:'v',"fog cloud",random,hostile
-MONSTER:'v',"fog cloud",random,hostile
-MONSTER:'v',"fog cloud",random,hostile
-MONSTER:'v',"fog cloud",random,hostile
-MONSTER:'v',"fog cloud",random,hostile
-MONSTER:'v',"fog cloud",random,hostile
-MONSTER:'v',"fog cloud",random,hostile
-MONSTER:'v',"fog cloud",random,hostile
-MONSTER:'v',"fog cloud",random,hostile
-MONSTER:'v',"energy vortex",random,hostile
-MONSTER:'v',"energy vortex",random,hostile
-MONSTER:'v',"energy vortex",random,hostile
-MONSTER:'v',"energy vortex",random,hostile
-MONSTER:'v',"energy vortex",random,hostile
-MONSTER:'v',"steam vortex",random,hostile
-MONSTER:'v',"steam vortex",random,hostile
-MONSTER:'v',"steam vortex",random,hostile
-MONSTER:'v',"steam vortex",random,hostile
-MONSTER:'v',"steam vortex",random,hostile
+MONSTER:('v',"fog cloud"),random,hostile
+MONSTER:('v',"fog cloud"),random,hostile
+MONSTER:('v',"fog cloud"),random,hostile
+MONSTER:('v',"fog cloud"),random,hostile
+MONSTER:('v',"fog cloud"),random,hostile
+MONSTER:('v',"fog cloud"),random,hostile
+MONSTER:('v',"fog cloud"),random,hostile
+MONSTER:('v',"fog cloud"),random,hostile
+MONSTER:('v',"fog cloud"),random,hostile
+MONSTER:('v',"energy vortex"),random,hostile
+MONSTER:('v',"energy vortex"),random,hostile
+MONSTER:('v',"energy vortex"),random,hostile
+MONSTER:('v',"energy vortex"),random,hostile
+MONSTER:('v',"energy vortex"),random,hostile
+MONSTER:('v',"steam vortex"),random,hostile
+MONSTER:('v',"steam vortex"),random,hostile
+MONSTER:('v',"steam vortex"),random,hostile
+MONSTER:('v',"steam vortex"),random,hostile
+MONSTER:('v',"steam vortex"),random,hostile
 
 
-MAZE:"fire",' '
-FLAGS: noteleport,hardfloor,shortsighted
+LEVEL:"fire"
+FLAGS: noteleport,hardfloor,shortsighted,mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 # The player lands, upon arrival, in the
@@ -256,5 +268,8 @@
 .................................LL....................LL...................
 ENDMAP
+
+REPLACE_TERRAIN:(0,0,75,19), '.', 'L', 30%
 TELEPORT_REGION:(69,16,69,16),(0,0,0,0)
+TERRAIN:(69,16),'.'
 PORTAL:(0,0,75,19),(65,13,75,19),"water"
 
@@ -300,83 +315,84 @@
 TRAP:"fire",random
 #  An assortment of fire-appropriate nasties
-MONSTER:'D',"red dragon",random
-MONSTER:'&',"balrog",random
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:'v',"fire vortex",random
-MONSTER:'d',"hell hound",random
+MONSTER:('D',"red dragon"),random
+MONSTER:('&',"balrog"),random
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:('v',"fire vortex"),random
+MONSTER:('d',"hell hound"),random
 #
-MONSTER:'H',"fire giant",random
-MONSTER:'&',"barbed devil",random
-MONSTER:'d',"hell hound",random
-MONSTER:''',"stone golem",random
-MONSTER:'&',"pit fiend",random
-MONSTER:'E',"fire elemental",random,hostile
+MONSTER:('H',"fire giant"),random
+MONSTER:('&',"barbed devil"),random
+MONSTER:('d',"hell hound"),random
+MONSTER:(''',"stone golem"),random
+MONSTER:('&',"pit fiend"),random
+MONSTER:('E',"fire elemental"),random,hostile
 #
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:'d',"hell hound",random
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:'s',"scorpion",random
-MONSTER:'H',"fire giant",random
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:('d',"hell hound"),random
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:('s',"scorpion"),random
+MONSTER:('H',"fire giant"),random
 #
-MONSTER:'d',"hell hound",random
-MONSTER:'v',"dust vortex",random
-MONSTER:'v',"fire vortex",random
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:'d',"hell hound",random
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:''',"stone golem",random
-MONSTER:'S',"pit viper",random
-MONSTER:'S',"pit viper",random
-MONSTER:'v',"fire vortex",random
+MONSTER:('d',"hell hound"),random
+MONSTER:('v',"dust vortex"),random
+MONSTER:('v',"fire vortex"),random
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:('d',"hell hound"),random
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:(''',"stone golem"),random
+MONSTER:('S',"pit viper"),random
+MONSTER:('S',"pit viper"),random
+MONSTER:('v',"fire vortex"),random
 #
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:'H',"fire giant",random
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:'v',"fire vortex",random
-MONSTER:'v',"fire vortex",random
-MONSTER:'&',"pit fiend",random
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:'S',"pit viper",random
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:('H',"fire giant"),random
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:('v',"fire vortex"),random
+MONSTER:('v',"fire vortex"),random
+MONSTER:('&',"pit fiend"),random
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:('S',"pit viper"),random
 #
-MONSTER:':',"salamander",random,hostile
-MONSTER:':',"salamander",random,hostile
-MONSTER:'H',"minotaur",random
-MONSTER:':',"salamander",random,hostile
-MONSTER:'v',"steam vortex",random
-MONSTER:':',"salamander",random,hostile
-MONSTER:':',"salamander",random,hostile
+MONSTER:(':',"salamander"),random,hostile
+MONSTER:(':',"salamander"),random,hostile
+MONSTER:('H',"minotaur"),random
+MONSTER:(':',"salamander"),random,hostile
+MONSTER:('v',"steam vortex"),random
+MONSTER:(':',"salamander"),random,hostile
+MONSTER:(':',"salamander"),random,hostile
 #
-MONSTER:'H',"fire giant",random
-MONSTER:'&',"barbed devil",random
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:'v',"fire vortex",random
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:'d',"hell hound",random
-MONSTER:'H',"fire giant",random
-MONSTER:'&',"pit fiend",random
-MONSTER:'E',"fire elemental",random,hostile
-MONSTER:'E',"fire elemental",random,hostile
+MONSTER:('H',"fire giant"),random
+MONSTER:('&',"barbed devil"),random
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:('v',"fire vortex"),random
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:('d',"hell hound"),random
+MONSTER:('H',"fire giant"),random
+MONSTER:('&',"pit fiend"),random
+MONSTER:('E',"fire elemental"),random,hostile
+MONSTER:('E',"fire elemental"),random,hostile
 #
-MONSTER:'&',"barbed devil",random
-MONSTER:':',"salamander",random,hostile
-MONSTER:'v',"steam vortex",random
-MONSTER:':',"salamander",random,hostile
-MONSTER:':',"salamander",random,hostile
+MONSTER:('&',"barbed devil"),random
+MONSTER:(':',"salamander"),random,hostile
+MONSTER:('v',"steam vortex"),random
+MONSTER:(':',"salamander"),random,hostile
+MONSTER:(':',"salamander"),random,hostile
 
-OBJECT:'`',"boulder",random
-OBJECT:'`',"boulder",random
-OBJECT:'`',"boulder",random
-OBJECT:'`',"boulder",random
-OBJECT:'`',"boulder",random
+OBJECT:('`',"boulder"),random
+OBJECT:('`',"boulder"),random
+OBJECT:('`',"boulder"),random
+OBJECT:('`',"boulder"),random
+OBJECT:('`',"boulder"),random
 
 
-MAZE:"water",' '
-FLAGS: noteleport,hardfloor,shortsighted
+LEVEL:"water"
+FLAGS: noteleport,hardfloor,shortsighted,mazelevel,shroud
+INIT_MAP:solidfill,' '
 MESSAGE: "You find yourself suspended in an air bubble surrounded by water."
 GEOMETRY:center,center
@@ -411,69 +427,70 @@
 PORTAL:(51,0,75,19),(0,0,0,0),"astral"
 # A fisherman's dream...
-MONSTER:';',"giant eel",random
-MONSTER:';',"giant eel",random
-MONSTER:';',"giant eel",random
-MONSTER:';',"giant eel",random
-MONSTER:';',"giant eel",random
-MONSTER:';',"giant eel",random
-MONSTER:';',"giant eel",random
-MONSTER:';',"giant eel",random
-MONSTER:';',"electric eel",random
-MONSTER:';',"electric eel",random
-MONSTER:';',"electric eel",random
-MONSTER:';',"electric eel",random
-MONSTER:';',"electric eel",random
-MONSTER:';',"electric eel",random
-MONSTER:';',"electric eel",random
-MONSTER:';',"electric eel",random
-MONSTER:';',"kraken",random
-MONSTER:';',"kraken",random
-MONSTER:';',"kraken",random
-MONSTER:';',"kraken",random
-MONSTER:';',"kraken",random
-MONSTER:';',"kraken",random
-MONSTER:';',"kraken",random
-MONSTER:';',"kraken",random
-MONSTER:';',"kraken",random
-MONSTER:';',"shark",random
-MONSTER:';',"shark",random
-MONSTER:';',"shark",random
-MONSTER:';',"shark",random
-MONSTER:';',"piranha",random
-MONSTER:';',"piranha",random
-MONSTER:';',"piranha",random
-MONSTER:';',"piranha",random
-MONSTER:';',"jellyfish",random
-MONSTER:';',"jellyfish",random
-MONSTER:';',"jellyfish",random
-MONSTER:';',"jellyfish",random
-MONSTER:';',random,random
-MONSTER:';',random,random
-MONSTER:';',random,random
-MONSTER:';',random,random
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"electric eel"),random
+MONSTER:(';',"electric eel"),random
+MONSTER:(';',"electric eel"),random
+MONSTER:(';',"electric eel"),random
+MONSTER:(';',"electric eel"),random
+MONSTER:(';',"electric eel"),random
+MONSTER:(';',"electric eel"),random
+MONSTER:(';',"electric eel"),random
+MONSTER:(';',"kraken"),random
+MONSTER:(';',"kraken"),random
+MONSTER:(';',"kraken"),random
+MONSTER:(';',"kraken"),random
+MONSTER:(';',"kraken"),random
+MONSTER:(';',"kraken"),random
+MONSTER:(';',"kraken"),random
+MONSTER:(';',"kraken"),random
+MONSTER:(';',"kraken"),random
+MONSTER:(';',"shark"),random
+MONSTER:(';',"shark"),random
+MONSTER:(';',"shark"),random
+MONSTER:(';',"shark"),random
+MONSTER:(';',"piranha"),random
+MONSTER:(';',"piranha"),random
+MONSTER:(';',"piranha"),random
+MONSTER:(';',"piranha"),random
+MONSTER:(';',"jellyfish"),random
+MONSTER:(';',"jellyfish"),random
+MONSTER:(';',"jellyfish"),random
+MONSTER:(';',"jellyfish"),random
+MONSTER:';',random
+MONSTER:';',random
+MONSTER:';',random
+MONSTER:';',random
 # These guys feel like home here
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
-MONSTER:'E',"water elemental",random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
+MONSTER:('E',"water elemental"),random,hostile
 
 
-MAZE:"astral",' '
-FLAGS: noteleport,hardfloor,nommap,shortsighted
+LEVEL:"astral"
+FLAGS: noteleport,hardfloor,nommap,shortsighted,mazelevel
+INIT_MAP:solidfill,' '
 MESSAGE: "You arrive on the Astral Plane!"
 MESSAGE: "Here the High Temples of the aligned gods are located."
@@ -502,6 +519,23 @@
                              -----------------                             
 ENDMAP
+
+IF [75%] {
+  TERRAIN:fillrect (17,14, 30,18),'.'
+  TERRAIN:fillrect (44,14, 57,18),'.'
+  WALLIFY
+
+  $hall = selection:floodfill(37,18)
+  LOOP [6 + 3d4] {
+    MONSTER:('A',"Angel"),rndcoord($hall),noalign,hostile
+    MONSTER[50%]:random,rndcoord($hall),hostile
+  }
+
+  OBJECT:"brazier",(23,16)
+  OBJECT:"brazier",(51,16)
+}
+
 # Rider locations
-RANDOM_PLACES:(23,9),(37,14),(51,9)
+$place = { (23,9),(37,14),(51,9) }
+SHUFFLE:$place
 # Where the player will land on arrival
 TELEPORT_REGION:(29,15,45,15),(30,15,44,15)
@@ -534,27 +568,29 @@
 # Moloch's horde
 # West round room
-MONSTER:'@',"aligned priest",(18,09),noalign,hostile
-MONSTER:'@',"aligned priest",(19,08),noalign,hostile
-MONSTER:'@',"aligned priest",(19,09),noalign,hostile
-MONSTER:'@',"aligned priest",(19,10),noalign,hostile
-MONSTER:'A',"Angel",(20,09),noalign,hostile
-MONSTER:'A',"Angel",(20,10),noalign,hostile
-MONSTER:'&',"Pestilence",place[0],hostile
+MONSTER:('@',"aligned priest"),(18,09),noalign,hostile
+MONSTER:('@',"aligned priest"),(19,08),noalign,hostile
+MONSTER:('@',"aligned priest"),(19,09),noalign,hostile
+MONSTER:('@',"aligned priest"),(19,10),noalign,hostile
+MONSTER:('A',"Angel"),(20,09),noalign,hostile
+MONSTER:('A',"Angel"),(20,10),noalign,hostile
+MONSTER:('&',"Pestilence"),$place[0],hostile {
+  OBJECT:('!',"sickness")
+}
 # South-central round room
-MONSTER:'@',"aligned priest",(36,12),noalign,hostile
-MONSTER:'@',"aligned priest",(37,12),noalign,hostile
-MONSTER:'@',"aligned priest",(38,12),noalign,hostile
-MONSTER:'@',"aligned priest",(36,13),noalign,hostile
-MONSTER:'A',"Angel",(38,13),noalign,hostile
-MONSTER:'A',"Angel",(37,13),noalign,hostile
-MONSTER:'&',"Death",place[1],hostile
+MONSTER:('@',"aligned priest"),(36,12),noalign,hostile
+MONSTER:('@',"aligned priest"),(37,12),noalign,hostile
+MONSTER:('@',"aligned priest"),(38,12),noalign,hostile
+MONSTER:('@',"aligned priest"),(36,13),noalign,hostile
+MONSTER:('A',"Angel"),(38,13),noalign,hostile
+MONSTER:('A',"Angel"),(37,13),noalign,hostile
+MONSTER:('&',"Death"),$place[1],hostile
 # East round room
-MONSTER:'@',"aligned priest",(56,09),noalign,hostile
-MONSTER:'@',"aligned priest",(55,08),noalign,hostile
-MONSTER:'@',"aligned priest",(55,09),noalign,hostile
-MONSTER:'@',"aligned priest",(55,10),noalign,hostile
-MONSTER:'A',"Angel",(54,09),noalign,hostile
-MONSTER:'A',"Angel",(54,10),noalign,hostile
-MONSTER:'&',"Famine",place[2],hostile
+MONSTER:('@',"aligned priest"),(56,09),noalign,hostile
+MONSTER:('@',"aligned priest"),(55,08),noalign,hostile
+MONSTER:('@',"aligned priest"),(55,09),noalign,hostile
+MONSTER:('@',"aligned priest"),(55,10),noalign,hostile
+MONSTER:('A',"Angel"),(54,09),noalign,hostile
+MONSTER:('A',"Angel"),(54,10),noalign,hostile
+MONSTER:('&',"Famine"),$place[2],hostile
 #
 # The aligned horde
@@ -566,51 +602,51 @@
 #
 # West court
-MONSTER:'@',"aligned priest",(12,07),chaos,hostile
-MONSTER:'@',"aligned priest",(13,07),chaos,peaceful
-MONSTER:'@',"aligned priest",(14,07),law,hostile
-MONSTER:'@',"aligned priest",(12,11),law,peaceful
-MONSTER:'@',"aligned priest",(13,11),neutral,hostile
-MONSTER:'@',"aligned priest",(14,11),neutral,peaceful
-MONSTER:'A',"Angel",(11,05),chaos,hostile
-MONSTER:'A',"Angel",(12,05),chaos,peaceful
-MONSTER:'A',"Angel",(13,05),law,hostile
-MONSTER:'A',"Angel",(11,13),law,peaceful
-MONSTER:'A',"Angel",(12,13),neutral,hostile
-MONSTER:'A',"Angel",(13,13),neutral,peaceful
+MONSTER:('@',"aligned priest"),(12,07),chaos,hostile
+MONSTER:('@',"aligned priest"),(13,07),chaos,peaceful
+MONSTER:('@',"aligned priest"),(14,07),law,hostile
+MONSTER:('@',"aligned priest"),(12,11),law,peaceful
+MONSTER:('@',"aligned priest"),(13,11),neutral,hostile
+MONSTER:('@',"aligned priest"),(14,11),neutral,peaceful
+MONSTER:('A',"Angel"),(11,05),chaos,hostile
+MONSTER:('A',"Angel"),(12,05),chaos,peaceful
+MONSTER:('A',"Angel"),(13,05),law,hostile
+MONSTER:('A',"Angel"),(11,13),law,peaceful
+MONSTER:('A',"Angel"),(12,13),neutral,hostile
+MONSTER:('A',"Angel"),(13,13),neutral,peaceful
 # Central court
-MONSTER:'@',"aligned priest",(32,09),chaos,hostile
-MONSTER:'@',"aligned priest",(33,09),chaos,peaceful
-MONSTER:'@',"aligned priest",(34,09),law,hostile
-MONSTER:'@',"aligned priest",(40,09),law,peaceful
-MONSTER:'@',"aligned priest",(41,09),neutral,hostile
-MONSTER:'@',"aligned priest",(42,09),neutral,peaceful
-MONSTER:'A',"Angel",(31,08),chaos,hostile
-MONSTER:'A',"Angel",(32,08),chaos,peaceful
-MONSTER:'A',"Angel",(31,09),law,hostile
-MONSTER:'A',"Angel",(42,08),law,peaceful
-MONSTER:'A',"Angel",(43,08),neutral,hostile
-MONSTER:'A',"Angel",(43,09),neutral,peaceful
+MONSTER:('@',"aligned priest"),(32,09),chaos,hostile
+MONSTER:('@',"aligned priest"),(33,09),chaos,peaceful
+MONSTER:('@',"aligned priest"),(34,09),law,hostile
+MONSTER:('@',"aligned priest"),(40,09),law,peaceful
+MONSTER:('@',"aligned priest"),(41,09),neutral,hostile
+MONSTER:('@',"aligned priest"),(42,09),neutral,peaceful
+MONSTER:('A',"Angel"),(31,08),chaos,hostile
+MONSTER:('A',"Angel"),(32,08),chaos,peaceful
+MONSTER:('A',"Angel"),(31,09),law,hostile
+MONSTER:('A',"Angel"),(42,08),law,peaceful
+MONSTER:('A',"Angel"),(43,08),neutral,hostile
+MONSTER:('A',"Angel"),(43,09),neutral,peaceful
 # East court
-MONSTER:'@',"aligned priest",(60,07),chaos,hostile
-MONSTER:'@',"aligned priest",(61,07),chaos,peaceful
-MONSTER:'@',"aligned priest",(62,07),law,hostile
-MONSTER:'@',"aligned priest",(60,11),law,peaceful
-MONSTER:'@',"aligned priest",(61,11),neutral,hostile
-MONSTER:'@',"aligned priest",(62,11),neutral,peaceful
-MONSTER:'A',"Angel",(61,05),chaos,hostile
-MONSTER:'A',"Angel",(62,05),chaos,peaceful
-MONSTER:'A',"Angel",(63,05),law,hostile
-MONSTER:'A',"Angel",(61,13),law,peaceful
-MONSTER:'A',"Angel",(62,13),neutral,hostile
-MONSTER:'A',"Angel",(63,13),neutral,peaceful
+MONSTER:('@',"aligned priest"),(60,07),chaos,hostile
+MONSTER:('@',"aligned priest"),(61,07),chaos,peaceful
+MONSTER:('@',"aligned priest"),(62,07),law,hostile
+MONSTER:('@',"aligned priest"),(60,11),law,peaceful
+MONSTER:('@',"aligned priest"),(61,11),neutral,hostile
+MONSTER:('@',"aligned priest"),(62,11),neutral,peaceful
+MONSTER:('A',"Angel"),(61,05),chaos,hostile
+MONSTER:('A',"Angel"),(62,05),chaos,peaceful
+MONSTER:('A',"Angel"),(63,05),law,hostile
+MONSTER:('A',"Angel"),(61,13),law,peaceful
+MONSTER:('A',"Angel"),(62,13),neutral,hostile
+MONSTER:('A',"Angel"),(63,13),neutral,peaceful
 #
 # Assorted nasties
-MONSTER:'L',random,random,hostile
-MONSTER:'L',random,random,hostile
-MONSTER:'L',random,random,hostile
-MONSTER:'V',random,random,hostile
-MONSTER:'V',random,random,hostile
-MONSTER:'V',random,random,hostile
-MONSTER:'D',random,random,hostile
-MONSTER:'D',random,random,hostile
-MONSTER:'D',random,random,hostile
+MONSTER:'L',random,hostile
+MONSTER:'L',random,hostile
+MONSTER:'L',random,hostile
+MONSTER:'V',random,hostile
+MONSTER:'V',random,hostile
+MONSTER:'V',random,hostile
+MONSTER:'D',random,hostile
+MONSTER:'D',random,hostile
+MONSTER:'D',random,hostile
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/functions.des nethack/dat/functions.des
--- nh_orig/dat/functions.des	1969-12-31 19:00:00.000000000 -0500
+++ nethack/dat/functions.des	2009-10-17 10:45:04.637430539 -0400
@@ -0,0 +1,21 @@
+
+FUNCTION soko_loot()
+{
+  # Random objects
+  OBJECT:'%',random,random
+  OBJECT:'%',random,random
+  OBJECT:'%',random,random
+  OBJECT:'%',random,random
+  OBJECT:'=',random,random
+  OBJECT:'/',random,random
+}
+
+FUNCTION soko_prize()
+{
+  IF [50%] {
+    OBJECT:'"',"amulet of reflection",place[0]
+  } ELSE {
+    OBJECT:'(',"bag of holding",place[0]
+  }
+  ENGRAVING:place[0],burn,"Elbereth"
+}
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/gehennom.des nethack/dat/gehennom.des
--- nh_orig/dat/gehennom.des	2003-12-07 18:39:13.000000000 -0500
+++ nethack/dat/gehennom.des	2010-08-16 13:20:13.634708200 -0400
@@ -5,7 +5,10 @@
 #
 
-MAZE: "valley", ' '
-FLAGS: noteleport,hardfloor,nommap
+LEVEL: "valley"
+FLAGS: noteleport,hardfloor,nommap,mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
+#         1         2         3         4         5         6         7
+#123456789012345678901234567890123456789012345678901234567890123456789012345
 MAP
 ----------------------------------------------------------------------------
@@ -13,28 +16,53 @@
 |---|.|.--.---.|  |......--- ----..........-----.-----....---........---.-.|
 |   |.|.|..| |.| --........| |.............|   |.......---| |-...........--|
-|   |...S..| |.| |.......-----.......------|   |--------..---......------- |
-|----------- |.| |-......| |....|...-- |...-----................----       |
-|.....S....---.| |.......| |....|...|  |..............-----------          |
-|.....|.|......| |.....--- |......---  |....---.......|                    |
-|.....|.|------| |....--   --....-- |-------- ----....---------------      |
-|.....|--......---BBB-|     |...--  |.......|    |..................|      |
-|..........||........-|    --...|   |.......|    |...||.............|      |
-|.....|...-||-........------....|   |.......---- |...||.............--     |
+|   |...S..| |.| |.......-----.......------|   |--------..--|......--...-- |
+|----------- |.| |-......| |....|...-- |...-----................----|...|  |
+|.....S....---.| |.......| |....|...|  |..............-----------   |...|  |
+|.....|.|......| |.....--- |......---  |....---.......|            -|...|  |
+|.....|.|------| |....--   --....-- |-------- ----BBBB--------------...--  |
+|.....|--......---BBB-|     |...--  |.......|    |...............B.....|   |
+|..........||........-|    --...|   |.......|    |...||..........B..----   |
+|.....|....||.........------....|   |.......---- |...||..........B..--     |
 |.....|--......---...........--------..........| |.......---------...--    |
 |.....| |------| |--.......--|   |..B......----- -----....| |.|  |....---  |
 |.....| |......--| ------..| |----..B......|       |.--------.-- |-.....---|
-|------ |........|  |.|....| |.....----BBBB---------...........---.........|
-|       |........|  |...|..| |.....|  |-.............--------...........---|
-|       --.....-----------.| |....-----.....----------     |.........----  |
-|        |..|..B...........| |.|..........|.|              |.|........|    |
+|-------|........|  |.|....| |.....----BBBB---------...........---.........|
+||....B.S........|  |...|..| |.....|  |-.............--------...........---|
+||....--|-.....-----------.| |....-----.....----------     |......... ---  |
+||....-  |..|..B...........| |.|..........|.|              |.|........|    |
 ----------------------------------------------------------------------------
 ENDMAP
+
+IF [50%] {
+   TERRAIN:line (50,8)-(53,8), '-'
+   TERRAIN:line (40,8)-(43,8), 'B'
+}
+
+IF [50%] {
+   TERRAIN:(27,12),'|'
+   TERRAIN:line (27,3)-(29,3), 'B'
+   TERRAIN:(28,2), '-'
+}
+
+IF [50%] {
+	TERRAIN:(60,5),'|'
+} ELSE {
+	TERRAIN:line (68,8)-(68,9),'|'
+}
+
+IF [50%] {
+   TERRAIN:line (16,10)-(16,11),'|'
+   TERRAIN:line (9,13)-(14,13), 'B'
+}
+
 # Dungeon Description
 # The shrine to Moloch.
-REGION:(01,06,05,14),lit,"temple"
+REGION:(01,06,05,14),unlit,"temple"
 # The Morgues
 REGION:(19,01,24,08),unlit,"morgue",filled,true
 REGION:(09,14,16,18),unlit,"morgue",filled,true
 REGION:(37,09,43,14),unlit,"morgue",filled,true
+REGION:(50,09,64,11),unlit,"morgue",filled,true
+REGION:(02,16,05,18),unlit,"morgue",filled,true
 # Stairs
 STAIR:(01,01),down
@@ -47,8 +75,13 @@
 DOOR:locked,(08,04)
 DOOR:locked,(06,06)
+DOOR:locked,(08,16)
 
 # The altar of Moloch.
 ALTAR:(03,10),noalign,shrine
 
+# Two sort-of light sources
+OBJECT:('\\',"brazier"),(03,06)
+OBJECT:('\\',"brazier"),(03,14)
+
 # Non diggable walls - everywhere!
 NON_DIGGABLE:(00,00,75,19)
@@ -59,58 +92,73 @@
 #       fate reserved for members of *those* classes.
 #
-OBJECT:'%',"corpse",random,"archeologist",0
-OBJECT:'%',"corpse",random,"archeologist",0
-OBJECT:'%',"corpse",random,"barbarian",0
-OBJECT:'%',"corpse",random,"barbarian",0
-OBJECT:'%',"corpse",random,"caveman",0
-OBJECT:'%',"corpse",random,"cavewoman",0
-OBJECT:'%',"corpse",random,"healer",0
-OBJECT:'%',"corpse",random,"healer",0
-OBJECT:'%',"corpse",random,"knight",0
-OBJECT:'%',"corpse",random,"knight",0
-OBJECT:'%',"corpse",random,"ranger",0
-OBJECT:'%',"corpse",random,"ranger",0
-OBJECT:'%',"corpse",random,"rogue",0
-OBJECT:'%',"corpse",random,"rogue",0
-OBJECT:'%',"corpse",random,"samurai",0
-OBJECT:'%',"corpse",random,"samurai",0
-OBJECT:'%',"corpse",random,"tourist",0
-OBJECT:'%',"corpse",random,"tourist",0
-OBJECT:'%',"corpse",random,"valkyrie",0
-OBJECT:'%',"corpse",random,"valkyrie",0
-OBJECT:'%',"corpse",random,"wizard",0
-OBJECT:'%',"corpse",random,"wizard",0
+OBJECT:('%',"corpse"),random,montype:"archeologist"
+OBJECT:('%',"corpse"),random,montype:"archeologist"
+OBJECT:('%',"corpse"),random,montype:"barbarian"
+OBJECT:('%',"corpse"),random,montype:"barbarian"
+OBJECT:('%',"corpse"),random,montype:"caveman"
+OBJECT:('%',"corpse"),random,montype:"cavewoman"
+OBJECT:('%',"corpse"),random,montype:"healer"
+OBJECT:('%',"corpse"),random,montype:"healer"
+OBJECT:('%',"corpse"),random,montype:"knight"
+OBJECT:('%',"corpse"),random,montype:"knight"
+OBJECT:('%',"corpse"),random,montype:"ranger"
+OBJECT:('%',"corpse"),random,montype:"ranger"
+OBJECT:('%',"corpse"),random,montype:"rogue"
+OBJECT:('%',"corpse"),random,montype:"rogue"
+OBJECT:('%',"corpse"),random,montype:"samurai"
+OBJECT:('%',"corpse"),random,montype:"samurai"
+OBJECT:('%',"corpse"),random,montype:"tourist"
+OBJECT:('%',"corpse"),random,montype:"tourist"
+OBJECT:('%',"corpse"),random,montype:"valkyrie"
+OBJECT:('%',"corpse"),random,montype:"valkyrie"
+OBJECT:('%',"corpse"),random,montype:"wizard"
+OBJECT:('%',"corpse"),random,montype:"wizard"
 #
 # Some random weapons and armor.
 #
-OBJECT:'[',random,random
-OBJECT:'[',random,random
-OBJECT:'[',random,random
-OBJECT:'[',random,random
-OBJECT:')',random,random
-OBJECT:')',random,random
-OBJECT:')',random,random
-OBJECT:')',random,random
+OBJECT:'[',random
+OBJECT:'[',random
+OBJECT:'[',random
+OBJECT:'[',random
+OBJECT:')',random
+OBJECT:')',random
+OBJECT:')',random
+OBJECT:')',random
 #
 # Some random loot.
 #
-OBJECT:'*',"ruby",random
-OBJECT:'*',random,random
-OBJECT:'*',random,random
-OBJECT:'!',random,random
-OBJECT:'!',random,random
-OBJECT:'!',random,random
-OBJECT:'?',random,random
-OBJECT:'?',random,random
-OBJECT:'?',random,random
-OBJECT:'/',random,random
-OBJECT:'/',random,random
-OBJECT:'=',random,random
-OBJECT:'=',random,random
-OBJECT:'+',random,random
-OBJECT:'+',random,random
-OBJECT:'(',random,random
-OBJECT:'(',random,random
-OBJECT:'(',random,random
+OBJECT:('*',"ruby"),random
+OBJECT:'*',random
+OBJECT:'*',random
+OBJECT:'!',random
+OBJECT:'!',random
+OBJECT:'!',random
+OBJECT:'?',random
+OBJECT:'?',random
+OBJECT:'?',random
+OBJECT:'/',random
+OBJECT:'/',random
+OBJECT:'=',random
+OBJECT:'=',random
+OBJECT:'+',random
+OBJECT:'+',random
+OBJECT:'(',random
+OBJECT:'(',random
+OBJECT:'(',random
+#
+# Some less random loot.
+#
+CONTAINER:('(',"iron safe"),(02,18) {
+	OBJECT:('*',"diamond")
+	OBJECT:('*',"diamond")
+	OBJECT:'*'
+	OBJECT:'*'
+	OBJECT:'='
+	OBJECT:'='
+	OBJECT:'+'
+	OBJECT:'+'
+}
+OBJECT:('(',"chest"),(02,17)
+OBJECT:('(',"chest"),(03,18)
 
 # (Not so) Random traps.
@@ -120,6 +168,6 @@
 TRAP:"board", (21,12)
 TRAP:"board", random
-TRAP:"dart", (60,01)
-TRAP:"dart", (26,17)
+TRAP:"magic", (60,01)
+TRAP:"board", (26,17)
 TRAP:"anti magic", random
 TRAP:"anti magic", random
@@ -129,34 +177,34 @@
 # Random monsters.
 # The ghosts.
-MONSTER:' ',"ghost",random
-MONSTER:' ',"ghost",random
-MONSTER:' ',"ghost",random
-MONSTER:' ',"ghost",random
-MONSTER:' ',"ghost",random
-MONSTER:' ',"ghost",random
+MONSTER:(' ',"ghost"),random
+MONSTER:(' ',"ghost"),random
+MONSTER:(' ',"ghost"),random
+MONSTER:(' ',"ghost"),random
+MONSTER:(' ',"ghost"),random
+MONSTER:(' ',"ghost"),random
 # Add a few bats for atmosphere.
-MONSTER:'B',"vampire bat",random
-MONSTER:'B',"vampire bat",random
-MONSTER:'B',"vampire bat",random
+MONSTER:('B',"vampire bat"),random
+MONSTER:('B',"vampire bat"),random
+MONSTER:('B',"vampire bat"),random
 # And a lich for good measure.
-MONSTER:'L',random,random
+MONSTER:'L',random
 # Some undead nasties for good measure
-MONSTER:'V',random,random
-MONSTER:'V',random,random
-MONSTER:'V',random,random
-MONSTER:'Z',random,random
-MONSTER:'Z',random,random
-MONSTER:'Z',random,random
-MONSTER:'Z',random,random
-MONSTER:'M',random,random
-MONSTER:'M',random,random
-MONSTER:'M',random,random
-MONSTER:'M',random,random
+MONSTER:'V',random
+MONSTER:'V',random
+MONSTER:'V',random
+MONSTER:'Z',random
+MONSTER:'Z',random
+MONSTER:'Z',random
+MONSTER:'Z',random
+MONSTER:'M',random
+MONSTER:'M',random
+MONSTER:'M',random
+MONSTER:'M',random
 #
 # The Juiblex level
 #
-MAZE:"juiblex",' '
-FLAGS:noteleport,shortsighted
-INIT_MAP:'.','}',true,true,unlit,false
+LEVEL:"juiblex"
+FLAGS:noteleport,shortsighted,mazelevel
+INIT_MAP:mines,'.','}',true,true,unlit,false
 # guarantee at least one open spot to ensure successful stair placement
 GEOMETRY:left,bottom
@@ -168,5 +216,5 @@
 }}}}}}}}
 ENDMAP
-OBJECT:'`',"boulder",random
+OBJECT:('`',"boulder"),random
 GEOMETRY:right,top
 MAP
@@ -177,5 +225,5 @@
 }}}}}}}}
 ENDMAP
-OBJECT:'`',"boulder",random
+OBJECT:('`',"boulder"),random
 # lair
 GEOMETRY:center,center
@@ -201,6 +249,7 @@
 ENDMAP
 # Random registers
-RANDOM_MONSTERS:'j','b','P','F'
-RANDOM_PLACES:(04,02),(46,02),(04,15),(46,15)
+$monster = MONSTER:{'j','b','P','F'}
+$place = { (04,02),(46,02),(04,15),(46,15) }
+SHUFFLE:$place
 # Dungeon description
 REGION:(00,00,50,17),unlit,"swamp"
@@ -212,55 +261,55 @@
 TELEPORT_REGION:levregion(01,00,11,20),(0,0,50,17),up
 TELEPORT_REGION:levregion(69,00,79,20),(0,0,50,17),down
-FOUNTAIN:place[0]
-MONSTER:'m',"giant mimic",place[1],m_feature "fountain"
-MONSTER:'m',"giant mimic",place[2],m_feature "fountain"
-MONSTER:'m',"giant mimic",place[3],m_feature "fountain"
+FOUNTAIN:$place[0]
+MONSTER:('m',"giant mimic"),$place[1],m_feature "fountain"
+MONSTER:('m',"giant mimic"),$place[2],m_feature "fountain"
+MONSTER:('m',"giant mimic"),$place[3],m_feature "fountain"
 # The demon of the swamp
-MONSTER:'&',"Juiblex",(25,08)
+MONSTER:('&',"Juiblex"),(25,08)
 # And a couple demons
-MONSTER:'i',"lemure",(43,08)
-MONSTER:'i',"lemure",(44,08)
-MONSTER:'i',"lemure",(45,08)
+MONSTER:('i',"lemure"),(43,08)
+MONSTER:('i',"lemure"),(44,08)
+MONSTER:('i',"lemure"),(45,08)
 # Some liquids and gems
-OBJECT:'*',random,(43,06)
-OBJECT:'*',random,(45,06)
-OBJECT:'!',random,(43,09)
-OBJECT:'!',random,(44,09)
-OBJECT:'!',random,(45,09)
+OBJECT:'*',(43,06)
+OBJECT:'*',(45,06)
+OBJECT:'!',(43,09)
+OBJECT:'!',(44,09)
+OBJECT:'!',(45,09)
 # And lots of blobby monsters
-MONSTER:monster[0],random,(25,06)
-MONSTER:monster[1],random,(24,07)
-MONSTER:monster[2],random,(26,07)
-MONSTER:monster[3],random,(23,08)
-MONSTER:monster[3],random,(27,08)
-MONSTER:monster[2],random,(24,09)
-MONSTER:monster[1],random,(26,09)
-MONSTER:monster[0],random,(25,10)
-MONSTER:'j',random,random
-MONSTER:'j',random,random
-MONSTER:'j',random,random
-MONSTER:'j',random,random
-MONSTER:'P',random,random
-MONSTER:'P',random,random
-MONSTER:'P',random,random
-MONSTER:'P',random,random
-MONSTER:'b',random,random
-MONSTER:'b',random,random
-MONSTER:'b',random,random
-MONSTER:'F',random,random
-MONSTER:'F',random,random
-MONSTER:'F',random,random
-MONSTER:'m',random,random
-MONSTER:'m',random,random
-MONSTER:';',"jellyfish",random
-MONSTER:';',"jellyfish",random
+MONSTER:$monster[0],(25,06)
+MONSTER:$monster[1],(24,07)
+MONSTER:$monster[2],(26,07)
+MONSTER:$monster[3],(23,08)
+MONSTER:$monster[3],(27,08)
+MONSTER:$monster[2],(24,09)
+MONSTER:$monster[1],(26,09)
+MONSTER:$monster[0],(25,10)
+MONSTER:'j',random
+MONSTER:'j',random
+MONSTER:'j',random
+MONSTER:'j',random
+MONSTER:'P',random
+MONSTER:'P',random
+MONSTER:'P',random
+MONSTER:'P',random
+MONSTER:'b',random
+MONSTER:'b',random
+MONSTER:'b',random
+MONSTER:'F',random
+MONSTER:'F',random
+MONSTER:'F',random
+MONSTER:'m',random
+MONSTER:'m',random
+MONSTER:(';',"jellyfish"),random
+MONSTER:(';',"jellyfish"),random
 # Some random objects
-OBJECT:'!',random,random
-OBJECT:'!',random,random
-OBJECT:'!',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'`',"boulder",random
+OBJECT:'!',random
+OBJECT:'!',random
+OBJECT:'!',random
+OBJECT:'%',random
+OBJECT:'%',random
+OBJECT:'%',random
+OBJECT:('`',"boulder"),random
 # Some traps
 TRAP:"sleep gas",random
@@ -273,6 +322,7 @@
 # The Orcus Level
 #
-MAZE:"orcus",random
-FLAGS: noteleport,shortsighted
+LEVEL:"orcus"
+FLAGS: noteleport,shortsighted,mazelevel
+INIT_MAP:mazegrid,'-'
 GEOMETRY:right,center
 # A ghost town
@@ -304,28 +354,33 @@
 TELEPORT_REGION:levregion(01,00,12,20),levregion(20,01,70,20)
 # Wall "ruins"
-OBJECT:'`',"boulder",(19,02)
-OBJECT:'`',"boulder",(20,02)
-OBJECT:'`',"boulder",(21,02)
-OBJECT:'`',"boulder",(36,02)
-OBJECT:'`',"boulder",(36,03)
-OBJECT:'`',"boulder",(06,04)
-OBJECT:'`',"boulder",(05,05)
-OBJECT:'`',"boulder",(06,05)
-OBJECT:'`',"boulder",(07,05)
-OBJECT:'`',"boulder",(39,05)
-OBJECT:'`',"boulder",(08,08)
-OBJECT:'`',"boulder",(09,08)
-OBJECT:'`',"boulder",(10,08)
-OBJECT:'`',"boulder",(11,08)
-OBJECT:'`',"boulder",(06,10)
-OBJECT:'`',"boulder",(05,11)
-OBJECT:'`',"boulder",(06,11)
-OBJECT:'`',"boulder",(07,11)
-OBJECT:'`',"boulder",(21,11)
-OBJECT:'`',"boulder",(21,12)
-OBJECT:'`',"boulder",(13,13)
-OBJECT:'`',"boulder",(14,13)
-OBJECT:'`',"boulder",(15,13)
-OBJECT:'`',"boulder",(14,14)
+OBJECT:('`',"boulder"),(19,02)
+OBJECT:('`',"boulder"),(20,02)
+OBJECT:('`',"boulder"),(21,02)
+OBJECT:('`',"boulder"),(36,02)
+OBJECT:('`',"boulder"),(36,03)
+OBJECT:('`',"boulder"),(06,04)
+OBJECT:('`',"boulder"),(05,05)
+OBJECT:('`',"boulder"),(06,05)
+OBJECT:('`',"boulder"),(07,05)
+OBJECT:('`',"boulder"),(39,05)
+OBJECT:('`',"boulder"),(08,08)
+OBJECT:('`',"boulder"),(09,08)
+OBJECT:('`',"boulder"),(10,08)
+OBJECT:('`',"boulder"),(11,08)
+OBJECT:('`',"boulder"),(06,10)
+OBJECT:('`',"boulder"),(05,11)
+OBJECT:('`',"boulder"),(06,11)
+OBJECT:('`',"boulder"),(07,11)
+OBJECT:('`',"boulder"),(21,11)
+OBJECT:('`',"boulder"),(21,12)
+OBJECT:('`',"boulder"),(13,13)
+OBJECT:('`',"boulder"),(14,13)
+OBJECT:('`',"boulder"),(15,13)
+OBJECT:('`',"boulder"),(14,14)
+# Special rooms
+ALTAR:(24,07),noalign,sanctum
+REGION:(22,12,25,16),unlit,"morgue"
+REGION:(32,09,37,12),lit,"shop"
+REGION:(12,00,15,04),lit,"shop"
 # Doors
 DOOR:closed,(23,02)
@@ -345,9 +400,4 @@
 DOOR:open,(26,14)
 DOOR:closed,(06,15)
-# Special rooms
-ALTAR:(24,07),noalign,sanctum
-REGION:(22,12,25,16),unlit,"morgue"
-REGION:(32,09,37,12),lit,"shop"
-REGION:(12,00,15,04),lit,"shop"
 # Some traps.
 TRAP:"spiked pit", random
@@ -360,59 +410,62 @@
 TRAP:"magic", random
 # Some random objects
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
 # The resident nasty
-MONSTER:'&',"Orcus",(33,15)
+MONSTER:('&',"Orcus"),(33,15) {
+  OBJECT:('/',"death")
+}
 # And its preferred companions
-MONSTER:'Z',"human zombie",(32,15)
-MONSTER:' ',"shade",(32,14)
-MONSTER:' ',"shade",(32,16)
-MONSTER:'V',"vampire",(35,16)
-MONSTER:'V',"vampire",(35,14)
-MONSTER:'V',"vampire lord",(36,14)
-MONSTER:'V',"vampire lord",(36,15)
+MONSTER:('Z',"human zombie"),(32,15)
+MONSTER:(' ',"shade"),(32,14)
+MONSTER:(' ',"shade"),(32,16)
+MONSTER:('V',"vampire"),(35,16)
+MONSTER:('V',"vampire"),(35,14)
+MONSTER:('V',"vampire lord"),(36,14)
+MONSTER:('V',"vampire lord"),(36,15)
 # Randomly placed companions
-MONSTER:'Z',"skeleton",random
-MONSTER:'Z',"skeleton",random
-MONSTER:'Z',"skeleton",random
-MONSTER:'Z',"skeleton",random
-MONSTER:'Z',"skeleton",random
-MONSTER:' ',"shade",random
-MONSTER:' ',"shade",random
-MONSTER:' ',"shade",random
-MONSTER:' ',"shade",random
-MONSTER:'Z',"giant zombie",random
-MONSTER:'Z',"giant zombie",random
-MONSTER:'Z',"giant zombie",random
-MONSTER:'Z',"ettin zombie",random
-MONSTER:'Z',"ettin zombie",random
-MONSTER:'Z',"ettin zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'V',"vampire",random
-MONSTER:'V',"vampire",random
-MONSTER:'V',"vampire",random
-MONSTER:'V',"vampire lord",random
-MONSTER:'V',"vampire lord",random
+MONSTER:('Z',"skeleton"),random
+MONSTER:('Z',"skeleton"),random
+MONSTER:('Z',"skeleton"),random
+MONSTER:('Z',"skeleton"),random
+MONSTER:('Z',"skeleton"),random
+MONSTER:(' ',"shade"),random
+MONSTER:(' ',"shade"),random
+MONSTER:(' ',"shade"),random
+MONSTER:(' ',"shade"),random
+MONSTER:('Z',"giant zombie"),random
+MONSTER:('Z',"giant zombie"),random
+MONSTER:('Z',"giant zombie"),random
+MONSTER:('Z',"ettin zombie"),random
+MONSTER:('Z',"ettin zombie"),random
+MONSTER:('Z',"ettin zombie"),random
+MONSTER:('Z',"human zombie"),random
+MONSTER:('Z',"human zombie"),random
+MONSTER:('Z',"human zombie"),random
+MONSTER:('V',"vampire"),random
+MONSTER:('V',"vampire"),random
+MONSTER:('V',"vampire"),random
+MONSTER:('V',"vampire lord"),random
+MONSTER:('V',"vampire lord"),random
 # A few more for the party
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
+MONSTER:random,random
+MONSTER:random,random
+MONSTER:random,random
+MONSTER:random,random
+MONSTER:random,random
 #
 # The Asmodeus Level
 #
-MAZE:"asmodeus",random
-FLAGS: noteleport
+LEVEL:"asmodeus"
+FLAGS: noteleport,mazelevel
+INIT_MAP:mazegrid,'-'
 # First part
 GEOMETRY:half-left,center
@@ -446,16 +499,19 @@
 REGION:(01,01,20,10),unlit,"ordinary"
 # The fellow in residence
-MONSTER:'&',"Asmodeus",(12,07)
+MONSTER:('&',"Asmodeus"),(12,07) {
+  OBJECT:('/',"cold")
+  OBJECT:('/',"fire")
+}
 # Some random weapons and armor.
-OBJECT:'[',random,random
-OBJECT:'[',random,random
-OBJECT:')',random,random
-OBJECT:')',random,random
-OBJECT:'*',random,random
-OBJECT:'!',random,random
-OBJECT:'!',random,random
-OBJECT:'?',random,random
-OBJECT:'?',random,random
-OBJECT:'?',random,random
+OBJECT:'[',random
+OBJECT:'[',random
+OBJECT:')',random
+OBJECT:')',random
+OBJECT:'*',random
+OBJECT:'!',random
+OBJECT:'!',random
+OBJECT:'?',random
+OBJECT:'?',random
+OBJECT:'?',random
 # Some traps.
 TRAP:"spiked pit", (05,02)
@@ -467,11 +523,11 @@
 TRAP:"magic", random
 # Random monsters.
-MONSTER:' ',"ghost",(11,07)
-MONSTER:'&',"horned devil",(10,05)
-MONSTER:'L',random,random
+MONSTER:(' ',"ghost"),(11,07)
+MONSTER:('&',"horned devil"),(10,05)
+MONSTER:'L',random
 # Some Vampires for good measure
-MONSTER:'V',random,random
-MONSTER:'V',random,random
-MONSTER:'V',random,random
+MONSTER:'V',random
+MONSTER:'V',random
+MONSTER:'V',random
 # Second part
 GEOMETRY:half-right,center
@@ -487,7 +543,7 @@
 NON_DIGGABLE:(00,00,32,04)
 DOOR:closed,(32,02)
-MONSTER:'&',random,random
-MONSTER:'&',random,random
-MONSTER:'&',random,random
+MONSTER:'&',random
+MONSTER:'&',random
+MONSTER:'&',random
 TRAP:"anti magic", random
 TRAP:"fire", random
@@ -497,21 +553,31 @@
 # The Baalzebub level
 #
-MAZE:"baalz",random
-FLAGS: noteleport
-GEOMETRY:right,center
+LEVEL:"baalz"
+FLAGS: noteleport,mazelevel
+
+MON_GENERATION:80%, (5, 'a'), (1, 'P')
+
+$lvl = selection: fillrect(0,0,78,20)
+$sel = selection: filter(33%, $lvl)
+
+TERRAIN:$lvl, ('.',unlit)
+TERRAIN:$sel, ('}',unlit)
+
+
+GEOMETRY:center,center
 MAP
--------------------------------------------------
-|                    ---               ----      
-|          ----      |   ------------  |         
-| ------      |  --------|..........|---         
-| |....|  -------|...........--------------      
----....|--|..................S............|----  
-....--....S..----------------|............S...|  
----....|--|..................|............|----  
-| |....|  -------|...........-----S--------      
-| ------      |  --------|..........|---         
-|          ----     |    ------------  |         
-|                   ---                ----      
--------------------------------------------------
+xxxxxxxxxxxxxxxxxxxxxxxFxxxxxxxxxxxxxxxxxxFxxxxxx
+xxxxxxxxxxxFxxxxxxxxxFFFxxxxxxxxxxxxxxxFFFFxxxxxx
+xxxxxxxxxxxFFFFxxxxxxFxxx------------xxFxxxxxxxxx
+xxFFFFFFxxxxxxFxx--------|..........|FFFxxxxxxxxx
+xxF....Fxx-------|...........--------------xxxxxx
+---....|--|..................S............|----xx
+....--....S..----------------|............S...|xx
+---....|--|..................|............|----xx
+xxF....Fxx-------|...........-----S--------xxxxxx
+xxFFFFFFxxxxxxFxx--------|..........|FFFxxxxxxxxx
+xxxxxxxxxxxFFFFxxxxxFxxxx------------xxFxxxxxxxxx
+xxxxxxxxxxxFxxxxxxxxFFFxxxxxxxxxxxxxxxxFFFFxxxxxx
+xxxxxxxxxxxxxxxxxxxxxxxFxxxxxxxxxxxxxxxxxxFxxxxxx
 ENDMAP
 STAIR:levregion(01,00,15,20),levregion(15,1,70,16),up
@@ -519,19 +585,18 @@
 TELEPORT_REGION:levregion(01,00,15,20),levregion(15,1,70,16)
 NON_DIGGABLE:(00,00,46,12)
-MAZEWALK:(00,06),west
 STAIR:(44,06),down
 # The fellow in residence
-MONSTER:'&',"Baalzebub",(35,06)
+MONSTER:('&',"Baalzebub"),(35,06)
 # Some random weapons and armor.
-OBJECT:'[',random,random
-OBJECT:'[',random,random
-OBJECT:')',random,random
-OBJECT:')',random,random
-OBJECT:'*',random,random
-OBJECT:'!',random,random
-OBJECT:'!',random,random
-OBJECT:'?',random,random
-OBJECT:'?',random,random
-OBJECT:'?',random,random
+OBJECT:'[',random
+OBJECT:'[',random
+OBJECT:')',random
+OBJECT:')',random
+OBJECT:'*',random
+OBJECT:'!',random
+OBJECT:'!',random
+OBJECT:'?',random
+OBJECT:'?',random
+OBJECT:'?',random
 # Some traps.
 TRAP:"spiked pit", random
@@ -539,22 +604,31 @@
 TRAP:"sleep gas", random
 TRAP:"anti magic", random
-TRAP:"fire", random
+TRAP:"rust", random
 TRAP:"magic", random
 TRAP:"magic", random
 # Random monsters.
-MONSTER:' ',"ghost",(37,07)
-MONSTER:'&',"horned devil",(32,05)
-MONSTER:'&',"barbed devil",(38,07)
-MONSTER:'L',random,random
+MONSTER:(' ',"ghost"),(37,07)
+MONSTER:('&',"horned devil"),(32,05)
+MONSTER:('&',"barbed devil"),(38,07)
+MONSTER:'L',random
 # Some Vampires for good measure
-MONSTER:'V',random,random
-MONSTER:'V',random,random
-MONSTER:'V',random,random
+MONSTER:'V',random
+MONSTER:'V',random
+MONSTER:'V',random
+
+LOOP [ 10 + 4d7 ] {
+  MONSTER:'a',random
+  MONSTER[25%]:'P',random
+}
+
 #
 # The Sanctum Level
 #
-MAZE:"sanctum", ' '
-FLAGS: noteleport,hardfloor,nommap
+LEVEL:"sanctum"
+FLAGS: noteleport,hardfloor,nommap,mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
+#         1         2         3         4         5         6         7
+#123456789012345678901234567890123456789012345678901234567890123456789012345
 MAP
 ----------------------------------------------------------------------------
@@ -579,5 +653,7 @@
 ----------------------------------------------------------------------------
 ENDMAP
-REGION:(15,07,21,10),lit,"temple"
+REGION:(15,07,21,10),lit,"temple" {
+  ROOMDOOR:true, locked, north|south|east|west, random
+}
 ALTAR:(18,08),noalign,sanctum
 REGION:(41,06,48,11),unlit,"morgue",filled,true
@@ -591,4 +667,9 @@
 DOOR:closed,(46,12)
 DOOR:closed,(53,10)
+# Some mood lighting
+OBJECT:('\\',"brazier"),(08,09)
+OBJECT:('\\',"brazier"),(18,15)
+OBJECT:('\\',"brazier"),(28,05)
+OBJECT:('\\',"brazier"),(28,13)
 # Surround the temple with fire
 TRAP:"fire",(13,05)
@@ -634,41 +715,144 @@
 TRAP:"magic", random
 # Some random objects
-OBJECT:'[',random,random
-OBJECT:'[',random,random
-OBJECT:'[',random,random
-OBJECT:'[',random,random
-OBJECT:')',random,random
-OBJECT:')',random,random
-OBJECT:'*',random,random
-OBJECT:'!',random,random
-OBJECT:'!',random,random
-OBJECT:'!',random,random
-OBJECT:'!',random,random
-OBJECT:'?',random,random
-OBJECT:'?',random,random
-OBJECT:'?',random,random
-OBJECT:'?',random,random
-OBJECT:'?',random,random
+OBJECT:'[',random
+OBJECT:'[',random
+OBJECT:'[',random
+OBJECT:'[',random
+OBJECT:')',random
+OBJECT:')',random
+OBJECT:'*',random
+OBJECT:'!',random
+OBJECT:'!',random
+OBJECT:'!',random
+OBJECT:'!',random
+OBJECT:'?',random
+OBJECT:'?',random
+OBJECT:'?',random
+OBJECT:'?',random
+OBJECT:'?',random
 # Some monsters.
-MONSTER:'&',"horned devil",(14,12),hostile
-MONSTER:'&',"barbed devil",(18,08),hostile
-MONSTER:'&',"erinys",(10,04),hostile
-MONSTER:'&',"marilith",(07,09),hostile
-MONSTER:'&',"nalfeshnee",(27,08),hostile
+MONSTER:('&',"horned devil"),(14,12),hostile
+MONSTER:('&',"barbed devil"),(18,08),hostile
+MONSTER:('&',"erinys"),(10,04),hostile
+MONSTER:('&',"marilith"),(07,09),hostile
+MONSTER:('&',"nalfeshnee"),(27,08),hostile
 # Moloch's horde
-MONSTER:'@',"aligned priest",(20,03),noalign,hostile
-MONSTER:'@',"aligned priest",(15,04),noalign,hostile
-MONSTER:'@',"aligned priest",(11,05),noalign,hostile
-MONSTER:'@',"aligned priest",(11,07),noalign,hostile
-MONSTER:'@',"aligned priest",(11,09),noalign,hostile
-MONSTER:'@',"aligned priest",(11,12),noalign,hostile
-MONSTER:'@',"aligned priest",(15,13),noalign,hostile
-MONSTER:'@',"aligned priest",(17,13),noalign,hostile
-MONSTER:'@',"aligned priest",(21,13),noalign,hostile
+MONSTER:('@',"aligned priest"),(20,03),noalign,hostile
+MONSTER:('@',"aligned priest"),(15,04),noalign,hostile
+MONSTER:('@',"aligned priest"),(11,05),noalign,hostile
+MONSTER:('@',"aligned priest"),(11,07),noalign,hostile
+MONSTER:('@',"aligned priest"),(11,09),noalign,hostile
+MONSTER:('@',"aligned priest"),(11,12),noalign,hostile
+MONSTER:('@',"aligned priest"),(15,13),noalign,hostile
+MONSTER:('@',"aligned priest"),(17,13),noalign,hostile
+MONSTER:('@',"aligned priest"),(21,13),noalign,hostile
 # A few nasties
-MONSTER:'L',random,random
-MONSTER:'L',random,random
-MONSTER:'V',random,random
-MONSTER:'V',random,random
-MONSTER:'V',random,random
+MONSTER:'L',random
+MONSTER:'L',random
+MONSTER:'V',random
+MONSTER:'V',random
+MONSTER:'V',random
 STAIR:(63,15),up
+
+
+#	The "fill" level for Gehennom
+#
+#	This level is used to fill out any levels not occupied by
+#	specific levels as defined above.
+#
+LEVEL: "hellfill"
+FLAGS:mazelevel,noflip
+INIT_MAP: mines,'.',' ',true,true,unlit,true,'L'
+TELEPORT_REGION:levregion(11,01,59,19),levregion(01,01,02,02)
+NOMAP
+#
+#  always put stairs relatively far apart
+#
+IF [50%] {
+  IF [50%] {
+    # Option 1: Up Left, Down Right
+    STAIR:levregion(01,01,20,20),levregion(40,10,44,12),up
+    STAIR:levregion(50,01,70,20),levregion(45,10,49,12),down
+  } ELSE {
+    # Option 2: Up Right, Down Left
+    STAIR:levregion(50,01,70,20),levregion(45,10,49,12),up
+    STAIR:levregion(01,01,20,20),levregion(40,10,44,12),down
+  }
+} ELSE {
+  IF [50%] {
+  # Option 3: Up Center, Down Elsewhere
+    STAIR:levregion(30,01,50,20),levregion(38,01,42,20),up
+    STAIR:levregion(01,01,70,20),levregion(30,01,50,20),down
+  } ELSE {
+  # Option 4: Down Center, Up Elsewhere
+    STAIR:levregion(01,01,70,20),levregion(30,01,50,20),up
+    STAIR:levregion(30,01,50,20),levregion(38,01,42,20),down
+  }
+}
+#
+$object = OBJECT:{ '(','/','=','+',')','[','?','*','%'}
+OBJECT: $object[0], random
+OBJECT: $object[0], random
+OBJECT: $object[1], random
+OBJECT: $object[2], random
+OBJECT: $object[3], random
+OBJECT: $object[4], random
+OBJECT: random, random
+OBJECT: random, random
+#
+$monster = MONSTER:{ 'V','D',' ','&','Z' }
+MONSTER:$monster[0],random,hostile
+MONSTER:$monster[0],random,hostile
+MONSTER:$monster[1],random,hostile
+MONSTER:$monster[1],random,hostile
+MONSTER:$monster[2],random,hostile
+MONSTER:$monster[3],random,hostile
+MONSTER:random,random,hostile
+MONSTER:'H',random,hostile
+# chance of evil critters
+IF [50%] {
+  MONSTER:'L',random,hostile
+} ELSE {
+  MONSTER:random,random,hostile
+}
+IF [66%] {
+# could be a snark now, so up the percentage a bit
+  MONSTER:'J',random,hostile
+} ELSE {
+  MONSTER:random,random,hostile
+}
+# chance of lava spillage, or maybe lava river?
+IF [50%] {
+	IF [60%] {
+	SPILL: random, 'L', north, 20
+	}
+	IF [60%] {
+	SPILL: random, 'L', south, 20
+	}
+	IF [60%] {
+	SPILL: random, 'L', east, 20
+	}
+	IF [60%] {
+	SPILL: random, 'L', west, 20
+	}
+} ELSE {
+	IF [50%] {
+		TERRAIN: grow(north|west, randline (30,00)-(50,19),10), 'L'
+	} ELSE {
+		TERRAIN: grow(north|west, randline (50,00)-(30,19),10), 'L'
+	}
+}
+
+TRAP: random, random
+TRAP: random, random
+TRAP: random, random
+TRAP: random, random
+TRAP: random, random
+TRAP: random, random
+TRAP: random, random
+TRAP: random, random
+TRAP: random, random
+TRAP: random, random
+TRAP: random, random
+TRAP: random, random
+#
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/Healer.des nethack/dat/Healer.des
--- nh_orig/dat/Healer.des	2003-12-07 18:39:12.000000000 -0500
+++ nethack/dat/Healer.des	2010-08-16 13:20:13.634708200 -0400
@@ -9,6 +9,8 @@
 #	and receive your quest assignment.
 #
-MAZE: "Hea-strt",' '
-FLAGS: noteleport,hardfloor
+LEVEL: "Hea-strt"
+FLAGS: noteleport,hardfloor,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"giant rat"), (16,'r'), (16,"snake"), (4,'Y')
 GEOMETRY:center,center
 MAP
@@ -23,5 +25,5 @@
 PPPP..........PPPPP.....|.S.|......-----------|S|.|......PPPPPP.PPP.......PP
 PPPPPP......PPPPPP......|.|.|......|...|......|.|.|.....PPPPPP...PP.......PP
-PPPPPPPPPPPPPPPPPPP.....+.|.|......S.\.S......|.|.+......PPPPPP.PPPP.......P
+PPPPPPPPPPPPPPPPPPP.....+.|.|......S...S......|.|.+......PPPPPP.PPPP.......P
 PPP...PPPPP...PPPP......|.|.|......|...|......|.|.|.......PPPPPPPPPPP.....PP
 PP.....PPP.....PPP......|.|S|-----------......|.S.|......PPPPPPPPPPPPPPPPPPP
@@ -34,4 +36,7 @@
 PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
 ENDMAP
+
+REPLACE_TERRAIN:(01,01,74,18), 'P', '.', 15%
+
 # Dungeon Description
 REGION:(00,00,75,19),lit,"ordinary"
@@ -56,49 +61,60 @@
 DOOR:locked,(50,10)
 # Hippocrates
-MONSTER:'@',"Hippocrates",(37,10)
+OBJECT:('\',"throne"),(37,10)
+MONSTER:('@',"Hippocrates"),(37,10) {
+  OBJECT:'/'
+  OBJECT:'/'
+  OBJECT:'/'
+  OBJECT:'/'
+  OBJECT:'?'
+  OBJECT:'?'
+  OBJECT:(')',"silver dagger"),1d4
+}
 # The treasure of Hippocrates
-OBJECT:'(',"chest",(37,10)
+OBJECT:('(',"chest"),(37,10)
 # intern guards for the audience chamber
-MONSTER:'@',"attendant",(29,08)
-MONSTER:'@',"attendant",(29,09)
-MONSTER:'@',"attendant",(29,10)
-MONSTER:'@',"attendant",(29,11)
-MONSTER:'@',"attendant",(40,09)
-MONSTER:'@',"attendant",(40,10)
-MONSTER:'@',"attendant",(40,11)
-MONSTER:'@',"attendant",(40,13)
+MONSTER:('@',"attendant"),(29,08) {
+  OBJECT[50%]:random
+}
+MONSTER:('@',"attendant"),(29,09) {
+  OBJECT[50%]:random
+}
+MONSTER:('@',"attendant"),(29,10) {
+  OBJECT[50%]:random
+}
+MONSTER:('@',"attendant"),(29,11) {
+  OBJECT[50%]:random
+}
+MONSTER:('@',"attendant"),(40,09) {
+  OBJECT[50%]:random
+}
+MONSTER:('@',"attendant"),(40,10) {
+  OBJECT[50%]:random
+}
+MONSTER:('@',"attendant"),(40,11) {
+  OBJECT[50%]:random
+}
+MONSTER:('@',"attendant"),(40,13) {
+  OBJECT[50%]:random
+}
 # Non diggable walls
 NON_DIGGABLE:(00,00,75,19)
 # Random traps
+LOOP [5 + 1d3] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Monsters on siege duty.
-MONSTER: 'r',"rabid rat",random
-MONSTER: 'r',"rabid rat",random
-MONSTER: 'r',"rabid rat",random
-MONSTER: 'r',"rabid rat",random
-MONSTER: 'r',"rabid rat",random
-MONSTER: 'r',"rabid rat",random
-MONSTER: 'r',"rabid rat",random
-MONSTER: 'r',"rabid rat",random
-MONSTER: 'r',"rabid rat",random
-MONSTER: 'r',"rabid rat",random
-MONSTER: ';',"giant eel",random
-MONSTER: ';',"shark",random
-MONSTER: ';', random, random
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
+LOOP [8 + 1d6] {
+  MONSTER: ('r',"rabid rat"),random
+}
+MONSTER: (';',"giant eel"),random
+MONSTER: (';',"shark"),random
+MONSTER: ';', random
+LOOP [3 + 1d5] {
+  MONSTER: 'D',random,hostile
+}
+LOOP [3 + 1d5] {
+  MONSTER: 'S',random,hostile
+}
 #
 #	The "locate" level for the quest.
@@ -108,8 +124,9 @@
 #
 
-MAZE: "Hea-loca",' '
-FLAGS: hardfloor
+LEVEL: "Hea-loca"
+FLAGS: hardfloor,mazelevel
 #
-INIT_MAP: '.' , 'P', true , true , lit , false
+INIT_MAP: mines, '.' , 'P', true , true , lit , false
+MON_GENERATION:86%, (64,"giant rat"), (16,'r'), (16,"snake"), (4,'Y')
 GEOMETRY:center,center
 MAP
@@ -141,62 +158,29 @@
 ALTAR:(13,05), chaos, shrine
 # Objects
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+LOOP [10 + 2d5] {
+  OBJECT:random,random
+}
 # Random traps
+LOOP [4 + 2d3] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Random monsters.
-MONSTER:'r',"rabid rat",random
-MONSTER:'r',"rabid rat",random
-MONSTER:'r',"rabid rat",random
-MONSTER:'r',"rabid rat",random
-MONSTER:'r',"rabid rat",random
-MONSTER:'r',"rabid rat",random
-MONSTER:'r',"rabid rat",random
-MONSTER:'r',"rabid rat",random
-MONSTER:'r',random,random,hostile
-MONSTER:';',"giant eel",random
-MONSTER:';',"giant eel",random
-MONSTER:';',"giant eel",random
-MONSTER:';',"giant eel",random
-MONSTER:';',"giant eel",random
-MONSTER:';',"electric eel",random
-MONSTER:';',"electric eel",random
-MONSTER:';',"kraken",random
-MONSTER:';',"shark",random
-MONSTER:';',"shark",random
-MONSTER:';',random, random,hostile
-MONSTER:';',random, random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
+LOOP [8 + 2d4] {
+  MONSTER:('r',"rabid rat"),random
+  MONSTER[50%]:(';',"giant eel"),random
+  MONSTER[30%]:(';',"electric eel"),random
+}
+MONSTER:'r',random,hostile
+MONSTER:(';',"kraken"),random
+MONSTER:(';',"shark"),random
+MONSTER:(';',"shark"),random
+MONSTER:';',random, hostile
+MONSTER:';',random, hostile
+LOOP [3 + 1d6] {
+  MONSTER: 'D',random,hostile
+}
+LOOP [8 + 2d3] {
+  MONSTER: 'S',random,hostile
+}
 
 #
@@ -208,7 +192,9 @@
 #
 
-MAZE: "Hea-goal", 'P'
+LEVEL: "Hea-goal"
+FLAGS:mazelevel
 #
-INIT_MAP: '.' , 'P' , false , true , lit , false
+INIT_MAP: mines, '.' , 'P' , false , true , lit , false
+MON_GENERATION:86%, (64,"giant rat"), (16,'r'), (16,"snake"), (4,'Y')
 GEOMETRY:center,center
 MAP
@@ -233,60 +219,38 @@
 NON_DIGGABLE:(00,00,40,11)
 # Objects
-OBJECT:')',"quarterstaff",(20,06),blessed,0,"The Staff of Aesculapius"
-OBJECT:'/',"lightning",(20,06)
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:(')',"quarterstaff"),(20,06),blessed,0,NAME:"The Staff of Aesculapius"
+OBJECT:('/',"lightning"),(20,06)
+LOOP [10 + 1d5] {
+  OBJECT:random,random
+}
 # Random traps
+LOOP [3 + 2d3] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Random monsters.
-MONSTER:'H',"Cyclops",(20,06),hostile
-MONSTER:'r',"rabid rat",random
-MONSTER:'r',"rabid rat",random
-MONSTER:'r',"rabid rat",random
-MONSTER:'r',random,random,hostile
-MONSTER:'r',random,random,hostile
-MONSTER:';',"giant eel",random
-MONSTER:';',"giant eel",random
-MONSTER:';',"giant eel",random
-MONSTER:';',"giant eel",random
-MONSTER:';',"giant eel",random
-MONSTER:';',"giant eel",random
-MONSTER:';',"electric eel",random
-MONSTER:';',"electric eel",random
-MONSTER:';',"shark",random
-MONSTER:';',"shark",random
-MONSTER:';',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
+MONSTER:('H',"Cyclops"),(20,06),hostile {
+  OBJECT:('(', "Bell of Opening"),uncursed
+  OBJECT:'[',1d3
+}
+MONSTER:('r',"rabid rat"),random
+MONSTER:('r',"rabid rat"),random
+MONSTER:('r',"rabid rat"),random
+MONSTER:'r',random,hostile
+MONSTER:'r',random,hostile
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"electric eel"),random
+MONSTER:(';',"electric eel"),random
+MONSTER:(';',"shark"),random
+MONSTER:(';',"shark"),random
+MONSTER:';',random, hostile
+LOOP [5 + 2d5] {
+  MONSTER[90%]: 'D',random,hostile
+  MONSTER: 'S',random,hostile
+}
 
 #
@@ -299,6 +263,8 @@
 #
 
-MAZE: "Hea-fila" , 'P'
-INIT_MAP: '.' , 'P' , false , true , lit , false
+LEVEL: "Hea-fila"
+FLAGS:mazelevel,noflip
+INIT_MAP: mines, '.' , 'P' , false , true , lit , false
+MON_GENERATION:86%, (64,"giant rat"), (16,'r'), (16,"snake"), (4,'Y')
 NOMAP
 #
@@ -306,34 +272,27 @@
 STAIR: random, down
 #
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+LOOP [5 + 1d10] {
+  OBJECT: random, random
+}
 #
-MONSTER: 'r', "rabid rat", random
-MONSTER: 'r', random, random,hostile
-MONSTER: 'r', random, random,hostile
-MONSTER: ';', "giant eel", random
-MONSTER: ';', "giant eel", random
-MONSTER: ';', "electric eel", random
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
+MONSTER: ('r', "rabid rat"), random
+MONSTER: 'r', random, hostile
+MONSTER: 'r', random, hostile
+MONSTER: (';', "giant eel"), random
+MONSTER: (';', "giant eel"), random
+MONSTER: (';', "electric eel"), random
+LOOP [3 + 1d4] {
+  MONSTER: 'D',random,hostile
+  MONSTER[90%]: 'S',random,hostile
+}
 #
+LOOP [3 + 1d3] {
 TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
+}
 
-MAZE: "Hea-filb" , 'P'
-INIT_MAP: '.' , 'P' , false , true , lit , false
+LEVEL: "Hea-filb"
+FLAGS:mazelevel,noflip
+INIT_MAP: mines, '.' , 'P' , false , true , lit , false
+MON_GENERATION:86%, (64,"giant rat"), (16,'r'), (16,"snake"), (4,'Y')
 NOMAP
 #
@@ -341,37 +300,25 @@
 STAIR: random, down
 #
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+LOOP [5 + 1d10] {
+  OBJECT: random, random
+}
 #
-MONSTER: 'r', "rabid rat", random
-MONSTER: 'r', "rabid rat", random
-MONSTER: 'r', random, random,hostile
-MONSTER: 'r', random, random,hostile
-MONSTER: ';', "giant eel", random
-MONSTER: ';', "giant eel", random
-MONSTER: ';', "giant eel", random
-MONSTER: ';', "giant eel", random
-MONSTER: ';', "giant eel", random
-MONSTER: ';', "electric eel", random
-MONSTER: ';', "electric eel", random
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'D',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
-MONSTER: 'S',random,random,hostile
+MONSTER: ('r', "rabid rat"), random
+MONSTER: ('r', "rabid rat"), random
+MONSTER: 'r', random, hostile
+MONSTER: 'r', random, hostile
+MONSTER: (';', "giant eel"), random
+MONSTER: (';', "giant eel"), random
+MONSTER: (';', "giant eel"), random
+MONSTER: (';', "giant eel"), random
+MONSTER: (';', "giant eel"), random
+MONSTER: (';', "electric eel"), random
+MONSTER: (';', "electric eel"), random
+LOOP [3 + 1d5] {
+  MONSTER: 'D',random,hostile
+  MONSTER[90%]: 'S',random,hostile
+}
 #
+LOOP [3 + 1d3] {
 TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
+}
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/help nethack/dat/help
--- nh_orig/dat/help	2003-12-07 18:39:13.000000000 -0500
+++ nethack/dat/help	2009-09-08 10:31:12.303292627 -0400
@@ -159,4 +159,6 @@
         *       Tell what equipment you are using; combines the preceding five.
         $       Count your gold pieces.
+        %       Set your chosen ranged weapon; this weapon will be auto-wielded
+                when you attempt to 'f'ire a missile.
         +       List the spells you know; also rearrange them if desired.
         \       Show what types of objects have been discovered.
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/hh nethack/dat/hh
--- nh_orig/dat/hh	2003-12-07 18:39:13.000000000 -0500
+++ nethack/dat/hh	2009-09-08 10:30:53.085295913 -0400
@@ -73,4 +73,5 @@
 *               ask for combination of ),[,=,",( all at once
 $       gold    count your gold
+%       rwield  assign chosen ranged weapon
 +       spells  list the spells you know; also rearrange them if desired
 _       travel  move via a shortest-path algorithm to a point on the map 
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/Knight.des nethack/dat/Knight.des
--- nh_orig/dat/Knight.des	2003-12-07 18:39:12.000000000 -0500
+++ nethack/dat/Knight.des	2010-08-16 13:20:13.635707386 -0400
@@ -9,8 +9,8 @@
 #	and receive your quest assignment.
 #
-MAZE: "Kni-strt",'.'
-FLAGS: noteleport,hardfloor
-# This is a kludge to init the level as a lit field.
-INIT_MAP: '.' , '.' , false , false , lit , false
+LEVEL: "Kni-strt"
+FLAGS: noteleport,hardfloor,mazelevel
+INIT_MAP: solidfill, ('.', lit)
+MON_GENERATION:86%, (64,"quasit"), (16,'i'), (16,"ochre jelly"), (4,'j')
 GEOMETRY:center,center
 MAP
@@ -22,5 +22,5 @@
 ...|.|-----------------|++|-----------------|.|...
 ...|.|.................|..|.........|.......|.|...
-...|.|...\.............+..+.........|.......|.|...
+...|.|.................+..+.........|.......|.|...
 ...|.|.................+..+.........+.......|.|...
 ...|.|.................|..|.........|.......|.|...
@@ -61,19 +61,53 @@
 DOOR:closed,(45,12)
 # King Arthur
-MONSTER:'@',"King Arthur",(09,07)
+OBJECT:('\',"throne"),(09,07)
+MONSTER:('@',"King Arthur"),(09,07) {
+  OBJECT:(')',"silver long sword"),1d4
+  OBJECT:'[',1d3
+}
 # The treasure of King Arthur
-OBJECT:'(',"chest",(09,07)
+OBJECT:('(',"chest"),(09,07)
 # knight guards for the watchrooms
-MONSTER:'@',"knight",(04,02),peaceful
-MONSTER:'@',"knight",(04,13),peaceful
-MONSTER:'@',"knight",(45,02),peaceful
-MONSTER:'@',"knight",(45,13),peaceful
+MONSTER:('@',"knight"),(04,02),peaceful {
+  OBJECT:')'
+  OBJECT:'['
+}
+MONSTER:('@',"knight"),(04,13),peaceful {
+  OBJECT:')'
+  OBJECT:'['
+}
+MONSTER:('@',"knight"),(45,02),peaceful {
+  OBJECT:')'
+  OBJECT:'['
+}
+MONSTER:('@',"knight"),(45,13),peaceful {
+  OBJECT:')'
+  OBJECT:'['
+}
 # page guards for the audience chamber
-MONSTER:'@',"page",(16,06)
-MONSTER:'@',"page",(18,06)
-MONSTER:'@',"page",(20,06)
-MONSTER:'@',"page",(16,09)
-MONSTER:'@',"page",(18,09)
-MONSTER:'@',"page",(20,09)
+MONSTER:('@',"page"),(16,06) {
+  OBJECT:')'
+  OBJECT:'?'
+}
+MONSTER:('@',"page"),(18,06) {
+  OBJECT:'?'
+  OBJECT:'['
+}
+MONSTER:('@',"page"),(20,06) {
+  OBJECT:'?'
+  OBJECT:'['
+}
+MONSTER:('@',"page"),(16,09) {
+  OBJECT:'?'
+  OBJECT:'?'
+}
+MONSTER:('@',"page"),(18,09) {
+  OBJECT:'?'
+  OBJECT:'?'
+}
+MONSTER:('@',"page"),(20,09) {
+  OBJECT:'?'
+  OBJECT:'['
+}
 # Non diggable walls
 NON_DIGGABLE:(00,00,49,15)
@@ -86,16 +120,16 @@
 TRAP:random,random
 # Monsters on siege duty.
-MONSTER: 'i',"quasit",(14,00),hostile
-MONSTER: 'i',"quasit",(16,00),hostile
-MONSTER: 'i',"quasit",(18,00),hostile
-MONSTER: 'i',"quasit",(20,00),hostile
-MONSTER: 'i',"quasit",(22,00),hostile
-MONSTER: 'i',"quasit",(24,00),hostile
-MONSTER: 'i',"quasit",(26,00),hostile
-MONSTER: 'i',"quasit",(28,00),hostile
-MONSTER: 'i',"quasit",(30,00),hostile
-MONSTER: 'i',"quasit",(32,00),hostile
-MONSTER: 'i',"quasit",(34,00),hostile
-MONSTER: 'i',"quasit",(36,00),hostile
+MONSTER: ('i',"quasit"),(14,00),hostile
+MONSTER: ('i',"quasit"),(16,00),hostile
+MONSTER: ('i',"quasit"),(18,00),hostile
+MONSTER: ('i',"quasit"),(20,00),hostile
+MONSTER: ('i',"quasit"),(22,00),hostile
+MONSTER: ('i',"quasit"),(24,00),hostile
+MONSTER: ('i',"quasit"),(26,00),hostile
+MONSTER: ('i',"quasit"),(28,00),hostile
+MONSTER: ('i',"quasit"),(30,00),hostile
+MONSTER: ('i',"quasit"),(32,00),hostile
+MONSTER: ('i',"quasit"),(34,00),hostile
+MONSTER: ('i',"quasit"),(36,00),hostile
 
 #
@@ -106,7 +140,8 @@
 #
 
-MAZE: "Kni-loca",' '
-FLAGS: hardfloor
-INIT_MAP: '.' , 'P' , false , true , lit , false
+LEVEL: "Kni-loca"
+FLAGS: hardfloor,mazelevel
+INIT_MAP: mines, '.' , 'P' , false , true , lit , false
+MON_GENERATION:86%, (64,"quasit"), (16,'i'), (16,"ochre jelly"), (4,'j')
 GEOMETRY:center,center
 MAP
@@ -135,19 +170,7 @@
 ALTAR:(17,05),neutral,shrine
 # Objects
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+LOOP [10 + 2d5] {
+  OBJECT:random,random
+}
 # Random traps
 # All of the avenues are guarded by magic except for the East.
@@ -201,39 +224,17 @@
 TRAP:"magic",(32,00)
 # Even so, there are magic "sinkholes" around.
+LOOP [5 + 2d6] {
 TRAP:"anti magic",random
-TRAP:"anti magic",random
-TRAP:"anti magic",random
-TRAP:"anti magic",random
-TRAP:"anti magic",random
-TRAP:"anti magic",random
-TRAP:"anti magic",random
+}
 # Random monsters.
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'j',random,random,hostile
-MONSTER:'j',"ochre jelly",random,hostile
-MONSTER:'j',"ochre jelly",random,hostile
-MONSTER:'j',"ochre jelly",random,hostile
-MONSTER:'j',"ochre jelly",random,hostile
-MONSTER:'j',"ochre jelly",random,hostile
-MONSTER:'j',"ochre jelly",random,hostile
-MONSTER:'j',"ochre jelly",random,hostile
-MONSTER:'j',random,random,hostile
+LOOP [10 + 3d8] {
+  MONSTER:('i',"quasit"),random,hostile
+}
+MONSTER:'i',random,hostile
+MONSTER:'j',random,hostile
+LOOP [5 + 2d5] {
+  MONSTER:('j',"ochre jelly"),random,hostile
+}
+MONSTER:'j',random,hostile
 
 #
@@ -245,5 +246,8 @@
 #
 
-MAZE: "Kni-goal", ' '
+LEVEL: "Kni-goal"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"quasit"), (16,'i'), (16,"ochre jelly"), (4,'j')
 GEOMETRY:center,center
 MAP
@@ -269,4 +273,7 @@
 .......PPPP...                                                              
 ENDMAP
+
+REPLACE_TERRAIN:(00,00,15,19), '.', 'P', 15%
+
 # Dungeon Description
 REGION:(00,00,14,19),lit,"ordinary"
@@ -277,64 +284,45 @@
 NON_DIGGABLE:(00,00,75,19)
 # Objects
-OBJECT:'(',"mirror",(50,06),blessed,0,"The Magic Mirror of Merlin"
-OBJECT:random,random,(33,01)
-OBJECT:random,random,(33,02)
-OBJECT:random,random,(33,03)
-OBJECT:random,random,(33,04)
-OBJECT:random,random,(33,05)
-OBJECT:random,random,(34,01)
-OBJECT:random,random,(34,02)
-OBJECT:random,random,(34,03)
-OBJECT:random,random,(34,04)
-OBJECT:random,random,(34,05)
-OBJECT:random,random,(35,01)
-OBJECT:random,random,(35,02)
-OBJECT:random,random,(35,03)
-OBJECT:random,random,(35,04)
-OBJECT:random,random,(35,05)
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:('(',"mirror"),(50,06),blessed,0,NAME:"The Magic Mirror of Merlin"
+OBJECT:random,(33,01)
+OBJECT:random,(33,02)
+OBJECT:random,(33,03)
+OBJECT:random,(33,04)
+OBJECT:random,(33,05)
+OBJECT:random,(34,01)
+OBJECT:random,(34,02)
+OBJECT:random,(34,03)
+OBJECT:random,(34,04)
+OBJECT:random,(34,05)
+OBJECT:random,(35,01)
+OBJECT:random,(35,02)
+OBJECT:random,(35,03)
+OBJECT:random,(35,04)
+OBJECT:random,(35,05)
+LOOP [3 + 1d3] {
+  OBJECT:random,random
+}
 # Random traps
 TRAP:"spiked pit",(13,07)
 TRAP:"spiked pit",(12,08)
 TRAP:"spiked pit",(12,09)
+LOOP [2 + 2d2] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Random monsters.
-MONSTER:'D',"Ixoth",(50,06),hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',"quasit",random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'j',"ochre jelly",random,hostile
-MONSTER:'j',"ochre jelly",random,hostile
-MONSTER:'j',"ochre jelly",random,hostile
-MONSTER:'j',"ochre jelly",random,hostile
-MONSTER:'j',"ochre jelly",random,hostile
-MONSTER:'j',"ochre jelly",random,hostile
-MONSTER:'j',"ochre jelly",random,hostile
-MONSTER:'j',"ochre jelly",random,hostile
-MONSTER:'j',random,random,hostile
+MONSTER:('D',"Ixoth"),(50,06),hostile {
+  OBJECT:('(', "Bell of Opening"),uncursed
+  OBJECT:'?'
+  OBJECT:'?'
+}
+LOOP [10 + 3d8] {
+  MONSTER:('i',"quasit"),random,hostile
+}
+MONSTER:'i',random,hostile
+MONSTER:'i',random,hostile
+LOOP [5 + 2d5] {
+  MONSTER:('j',"ochre jelly"),random,hostile
+}
+MONSTER:'j',random,hostile
 
 #
@@ -347,6 +335,8 @@
 #
 
-MAZE: "Kni-fila" , '.'
-INIT_MAP: '.' , 'P' , false , true , lit , false
+LEVEL: "Kni-fila"
+FLAGS:mazelevel,noflip
+INIT_MAP: mines, '.' , 'P' , false , true , lit , false
+MON_GENERATION:86%, (64,"quasit"), (16,'i'), (16,"ochre jelly"), (4,'j')
 NOMAP
 #
@@ -354,27 +344,22 @@
 STAIR: random, down
 #
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+LOOP [6 + 2d4] {
+  OBJECT: random, random
+}
 #
-MONSTER: 'i', "quasit", random, hostile
-MONSTER: 'i', "quasit", random, hostile
-MONSTER: 'i', "quasit", random, hostile
-MONSTER: 'i', "quasit", random, hostile
-MONSTER: 'i', random, random, hostile
-MONSTER: 'j', "ochre jelly", random, hostile
+LOOP [3 + 1d4] {
+  MONSTER: ('i', "quasit"), random, hostile
+}
+MONSTER: 'i', random, hostile
+MONSTER: ('j', "ochre jelly"), random, hostile
 #
+LOOP [3 + 1d5] {
 TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
+}
 
-MAZE: "Kni-filb" , '.'
-INIT_MAP: '.' , 'P' , false , true , lit , false
+LEVEL: "Kni-filb"
+FLAGS:mazelevel,noflip
+INIT_MAP: mines, '.' , 'P' , false , true , lit , false
+MON_GENERATION:86%, (64,"quasit"), (16,'i'), (16,"ochre jelly"), (4,'j')
 NOMAP
 #
@@ -382,27 +367,17 @@
 STAIR: random, down
 #
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+LOOP [6 + 2d4] {
+  OBJECT: random, random
+}
 #
-MONSTER: 'i', "quasit", random, hostile
-MONSTER: 'i', "quasit", random, hostile
-MONSTER: 'i', "quasit", random, hostile
-MONSTER: 'i', "quasit", random, hostile
-MONSTER: 'i', random, random, hostile
-MONSTER: 'j', "ochre jelly", random, hostile
-MONSTER: 'j', "ochre jelly", random, hostile
-MONSTER: 'j', "ochre jelly", random, hostile
+LOOP [3 + 1d4] {
+  MONSTER: ('i', "quasit"), random, hostile
+}
+MONSTER: 'i', random, hostile
+LOOP [3 + 1d4] {
+  MONSTER: ('j', "ochre jelly"), random, hostile
+}
 #
+LOOP [3 + 1d5] {
 TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
+}
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/knox.des nethack/dat/knox.des
--- nh_orig/dat/knox.des	2003-12-07 18:39:13.000000000 -0500
+++ nethack/dat/knox.des	2010-04-11 12:36:58.219625888 -0400
@@ -1,9 +1,10 @@
-#	SCCS Id: @(#)knox.des	3.4	1994/08/20
+#	SCCS37 Id: @(#)knox.des	3.4	1994/08/20
 #	Copyright (c) 1989 by Jean-Christophe Collet
 #	Copyright (c) 1992 by Izchak Miller
 # NetHack may be freely redistributed.  See license for details.
 #
-MAZE:"knox",' '
-FLAGS: noteleport
+LEVEL:"knox"
+FLAGS: noteleport,mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 MAP
@@ -18,5 +19,5 @@
 |     |..........}}}|...............|..........|}}}.................+...|..|
 | -------..........}|...............S..........|}...................|...|..|
-| |.....|..........}|...............|......\...S}...................|...|..|
+| |.....|..........}|...............|..........S}...................|...|..|
 | |.....+........}}}|...............|..........|}}}.................+...|..|
 | |.....|........}---S------------------------S---}.................|...|..|
@@ -34,6 +35,10 @@
 BRANCH:(08,16,08,16),(0,0,0,0)
 #   Throne room, with Croesus on the throne
+OBJECT:('\',"throne"),(43,10)
 REGION:(37,08,46,11),lit,"throne"
-MONSTER:'@',"Croesus",(43,10),hostile
+MONSTER:('@',"Croesus"),(43,10),hostile {
+  OBJECT:(')',"two-handed sword")
+  OBJECT:'['
+}
 #   The Vault
 #   Using unfilled morgue for
@@ -63,42 +68,42 @@
 DOOR:closed,(66,14)
 # Soldiers guarding the fort
-MONSTER:'@',"soldier",(12,14)
-MONSTER:'@',"soldier",(12,13)
-MONSTER:'@',"soldier",(11,10)
-MONSTER:'@',"soldier",(13,02)
-MONSTER:'@',"soldier",(14,03)
-MONSTER:'@',"soldier",(20,02)
-MONSTER:'@',"soldier",(30,02)
-MONSTER:'@',"soldier",(40,02)
-MONSTER:'@',"soldier",(30,16)
-MONSTER:'@',"soldier",(32,16)
-MONSTER:'@',"soldier",(40,16)
-MONSTER:'@',"soldier",(54,16)
-MONSTER:'@',"soldier",(54,14)
-MONSTER:'@',"soldier",(54,13)
-MONSTER:'@',"soldier",(57,10)
-MONSTER:'@',"soldier",(57,09)
-MONSTER:'@',"lieutenant",(15,08)
+MONSTER:('@',"soldier"),(12,14)
+MONSTER:('@',"soldier"),(12,13)
+MONSTER:('@',"soldier"),(11,10)
+MONSTER:('@',"soldier"),(13,02)
+MONSTER:('@',"soldier"),(14,03)
+MONSTER:('@',"soldier"),(20,02)
+MONSTER:('@',"soldier"),(30,02)
+MONSTER:('@',"soldier"),(40,02)
+MONSTER:('@',"soldier"),(30,16)
+MONSTER:('@',"soldier"),(32,16)
+MONSTER:('@',"soldier"),(40,16)
+MONSTER:('@',"soldier"),(54,16)
+MONSTER:('@',"soldier"),(54,14)
+MONSTER:('@',"soldier"),(54,13)
+MONSTER:('@',"soldier"),(57,10)
+MONSTER:('@',"soldier"),(57,09)
+MONSTER:('@',"lieutenant"),(15,08)
 # Four dragons guarding each side
-MONSTER:'D',random,(18,09)
-MONSTER:'D',random,(49,10)
-MONSTER:'D',random,(33,05)
-MONSTER:'D',random,(33,14)
+MONSTER:'D',(18,09)
+MONSTER:'D',(49,10)
+MONSTER:'D',(33,05)
+MONSTER:'D',(33,14)
 # Eels in the moat
-MONSTER:';',"giant eel",(17,08)
-MONSTER:';',"giant eel",(17,11)
-MONSTER:';',"giant eel",(48,08)
-MONSTER:';',"giant eel",(48,11)
+MONSTER:(';',"giant eel"),(17,08)
+MONSTER:(';',"giant eel"),(17,11)
+MONSTER:(';',"giant eel"),(48,08)
+MONSTER:(';',"giant eel"),(48,11)
 # The corner rooms treasures
-OBJECT:'*',"diamond",(19,06)
-OBJECT:'*',"diamond",(20,06)
-OBJECT:'*',"diamond",(21,06)
-OBJECT:'*',"emerald",(19,13)
-OBJECT:'*',"emerald",(20,13)
-OBJECT:'*',"emerald",(21,13)
-OBJECT:'*',"ruby",(46,06)
-OBJECT:'*',"ruby",(47,06)
-OBJECT:'*',"ruby",(48,06)
-OBJECT:'*',"amethyst",(46,13)
-OBJECT:'*',"amethyst",(47,13)
-OBJECT:'*',"amethyst",(48,13)
+OBJECT:('*',"diamond"),(19,06)
+OBJECT:('*',"diamond"),(20,06)
+OBJECT:('*',"diamond"),(21,06)
+OBJECT:('*',"emerald"),(19,13)
+OBJECT:('*',"emerald"),(20,13)
+OBJECT:('*',"emerald"),(21,13)
+OBJECT:('*',"ruby"),(46,06)
+OBJECT:('*',"ruby"),(47,06)
+OBJECT:('*',"ruby"),(48,06)
+OBJECT:('*',"amethyst"),(46,13)
+OBJECT:('*',"amethyst"),(47,13)
+OBJECT:('*',"amethyst"),(48,13)
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/medusa.des nethack/dat/medusa.des
--- nh_orig/dat/medusa.des	2003-12-07 18:39:13.000000000 -0500
+++ nethack/dat/medusa.des	2010-04-11 12:36:58.163626289 -0400
@@ -7,6 +7,7 @@
 #
 
-MAZE:"medusa-1",' '
-FLAGS: noteleport
+LEVEL:"medusa-1"
+FLAGS: noteleport,mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 MAP
@@ -32,4 +33,7 @@
 }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
 ENDMAP
+
+REPLACE_TERRAIN:(01,01,73,18), '}', '.', 5%
+
 # Dungeon Description
 # (must maintain one room definition; `unfilled' forces its room to be kept)
@@ -54,26 +58,27 @@
 NON_DIGGABLE:(30,06,46,13)
 # Objects
-CONTAINER:'`',"statue",(36,10),uncursed,"knight",3,"Perseus"
-OBJECT[75%]:'[',"shield of reflection",contained,cursed,+0
-OBJECT[25%]:'[',"levitation boots",contained,random,+0
-OBJECT[50%]:')',"scimitar",contained,blessed,+2
-OBJECT[50%]:'(',"sack",contained
+CONTAINER:('`',"statue"),(36,10),uncursed,montype:"knight",3,NAME:"Perseus" {
+  OBJECT[25%]:('[',"shield of reflection"),cursed,+0
+  OBJECT[75%]:('[',"levitation boots"),+0
+  OBJECT[50%]:(')',"scimitar"),blessed,+2
+  OBJECT[50%]:('(',"sack")
+}
 # These aren't really containers, but specifying CONTAINER forces them to be
 # empty, since CONTAINERs contain only what is explicitly specified.
-CONTAINER:'`',"statue",random
-CONTAINER:'`',"statue",random
-CONTAINER:'`',"statue",random
-CONTAINER:'`',"statue",random
-CONTAINER:'`',"statue",random
-CONTAINER:'`',"statue",random
-CONTAINER:'`',"statue",random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
 # Random traps
 TRAP:random,random
@@ -85,28 +90,29 @@
 TRAP:"board",(38,12)
 # Random monsters
-MONSTER:'@',"Medusa",(36,10),asleep
-MONSTER:';',"giant eel",(11,06)
-MONSTER:';',"giant eel",(23,13)
-MONSTER:';',"giant eel",(29,02)
-MONSTER:';',"jellyfish",(02,02)
-MONSTER:';',"jellyfish",(00,08)
-MONSTER:';',"jellyfish",(04,18)
-MONSTER:'T',"water troll",(51,03)
-MONSTER:'T',"water troll",(64,11)
-MONSTER:'S',random,(38,07)
-MONSTER:'S',random,(38,12)
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
+MONSTER:('@',"Medusa"),(36,10),asleep
+MONSTER:(';',"giant eel"),(11,06)
+MONSTER:(';',"giant eel"),(23,13)
+MONSTER:(';',"giant eel"),(29,02)
+MONSTER:(';',"jellyfish"),(02,02)
+MONSTER:(';',"jellyfish"),(00,08)
+MONSTER:(';',"jellyfish"),(04,18)
+MONSTER:('T',"water troll"),(51,03)
+MONSTER:('T',"water troll"),(64,11)
+MONSTER:'S',(38,07)
+MONSTER:'S',(38,12)
+MONSTER:random,random
+MONSTER:random,random
+MONSTER:random,random
+MONSTER:random,random
+MONSTER:random,random
+MONSTER:random,random
+MONSTER:random,random
+MONSTER:random,random
+MONSTER:random,random
+MONSTER:random,random
 
-MAZE:"medusa-2",' '
-FLAGS: noteleport
+LEVEL:"medusa-2"
+FLAGS: noteleport,mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 MAP
@@ -132,4 +138,7 @@
 }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
 ENDMAP
+
+REPLACE_TERRAIN:(01,01,73,18), '}', '.', 5%
+
 # Dungeon Description
 REGION:(00,00,74,19),lit,"ordinary"
@@ -152,26 +161,27 @@
 NON_DIGGABLE:(60,02,73,17)
 # Objects
-CONTAINER:'`',"statue",(68,10),uncursed,"knight",3,"Perseus"
-OBJECT[25%]:'[',"shield of reflection",contained,cursed,+0
-OBJECT[75%]:'[',"levitation boots",contained,random,+0
-OBJECT[50%]:')',"scimitar",contained,blessed,+2
-OBJECT[50%]:'(',"sack",contained
-CONTAINER:'`',"statue",(64,08)
-CONTAINER:'`',"statue",(65,08)
-CONTAINER:'`',"statue",(64,09)
-CONTAINER:'`',"statue",(65,09)
-CONTAINER:'`',"statue",(64,10)
-CONTAINER:'`',"statue",(65,10)
-CONTAINER:'`',"statue",(64,11)
-CONTAINER:'`',"statue",(65,11)
-OBJECT:'`',"boulder",(04,04)
-OBJECT:'/',random,(52,09)
-OBJECT:'`',"boulder",(52,09)
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+CONTAINER:('`',"statue"),(68,10),uncursed,montype:"knight",3,NAME:"Perseus" {
+  OBJECT[25%]:('[',"shield of reflection"),cursed,+0
+  OBJECT[75%]:('[',"levitation boots"),+0
+  OBJECT[50%]:(')',"scimitar"),blessed,+2
+  OBJECT[50%]:('(',"sack")
+}
+CONTAINER:('`',"statue"),(64,08) { }
+CONTAINER:('`',"statue"),(65,08) { }
+CONTAINER:('`',"statue"),(64,09) { }
+CONTAINER:('`',"statue"),(65,09) { }
+CONTAINER:('`',"statue"),(64,10) { }
+CONTAINER:('`',"statue"),(65,10) { }
+CONTAINER:('`',"statue"),(64,11) { }
+CONTAINER:('`',"statue"),(65,11) { }
+OBJECT:('`',"boulder"),(04,04)
+OBJECT:'/',(52,09)
+OBJECT:('`',"boulder"),(52,09)
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
 # Traps
 TRAP:"magic",(03,12)
@@ -181,35 +191,288 @@
 TRAP:random,random
 # Monsters.
-MONSTER:'@',"Medusa",(68,10),asleep
-MONSTER:'g',"gremlin",(02,14)
-MONSTER:'H',"titan",(02,05)
-MONSTER:';',"electric eel",(10,13)
-MONSTER:';',"electric eel",(11,13)
-MONSTER:';',"electric eel",(10,14)
-MONSTER:';',"electric eel",(11,14)
-MONSTER:';',"electric eel",(10,15)
-MONSTER:';',"electric eel",(11,15)
-MONSTER:';',"jellyfish",(01,01)
-MONSTER:';',"jellyfish",(00,08)
-MONSTER:';',"jellyfish",(04,19)
-MONSTER:''',"stone golem",(64,08),asleep
-MONSTER:''',"stone golem",(65,08),asleep
-MONSTER:''',"stone golem",(64,09),asleep
-MONSTER:''',"stone golem",(65,09),asleep
-MONSTER:'S',"cobra",(64,10),asleep
-MONSTER:'S',"cobra",(65,10),asleep
-MONSTER:'A',random,(72,08)
-MONSTER:'y',"yellow light",(72,11),asleep
-MONSTER:random,random,(17,07)
-MONSTER:random,random,(28,11)
-MONSTER:random,random,(32,13)
-MONSTER:random,random,(49,09)
-MONSTER:random,random,(48,07)
-MONSTER:random,random,(65,03)
-MONSTER:random,random,(70,04)
-MONSTER:random,random,(70,15)
-MONSTER:random,random,(65,16)
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
+MONSTER:('@',"Medusa"),(68,10),asleep
+MONSTER:('g',"gremlin"),(02,14)
+MONSTER:('H',"titan"),(02,05)
+MONSTER:(';',"electric eel"),(10,13)
+MONSTER:(';',"electric eel"),(11,13)
+MONSTER:(';',"electric eel"),(10,14)
+MONSTER:(';',"electric eel"),(11,14)
+MONSTER:(';',"electric eel"),(10,15)
+MONSTER:(';',"electric eel"),(11,15)
+MONSTER:(';',"jellyfish"),(01,01)
+MONSTER:(';',"jellyfish"),(00,08)
+MONSTER:(';',"jellyfish"),(04,19)
+MONSTER:(''',"stone golem"),(64,08),asleep
+MONSTER:(''',"stone golem"),(65,08),asleep
+MONSTER:(''',"stone golem"),(64,09),asleep
+MONSTER:(''',"stone golem"),(65,09),asleep
+MONSTER:('S',"cobra"),(64,10),asleep
+MONSTER:('S',"cobra"),(65,10),asleep
+MONSTER:'A',(72,08)
+MONSTER:('y',"yellow light"),(72,11),asleep
+MONSTER:random,(17,07)
+MONSTER:random,(28,11)
+MONSTER:random,(32,13)
+MONSTER:random,(49,09)
+MONSTER:random,(48,07)
+MONSTER:random,(65,03)
+MONSTER:random,(70,04)
+MONSTER:random,(70,15)
+MONSTER:random,(65,16)
+MONSTER:random,random
+MONSTER:random,random
+MONSTER:random,random
+MONSTER:random,random
+
+LEVEL:"medusa-3"
+FLAGS: noteleport,mazelevel
+INIT_MAP:solidfill,' '
+GEOMETRY:center,center
+#
+# Here you disturb ravens nesting in the trees.
+#
+MAP
+}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+}}}}}}}}}}.}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+}}}}}}}}T..T.}}}}}}}}}}}}}}}}}}}}..}}}}}}}}.}}}...}}}}}}}.}}}}}......}}}}}}}
+}}}}}}.......T.}}}}}}}}}}}..}}}}..T.}}}}}}...T...T..}}...T..}}..-----..}}}}}
+}}}...-----....}}}}}}}}}}.T..}}}}}...}}}}}.....T..}}}}}......T..|...|.T..}}}
+}}}.T.|...|...T.}}}}}}}.T......}}}}..T..}}.}}}.}}...}}}}}.T.....+...|...}}}}
+}}}}..|...|.}}.}}}}}.....}}}T.}}}}.....}}}}}}.T}}}}}}}}}}}}}..T.|...|.}}}}}}
+}}}}}.|...|.}}}}}}..T..}}}}}}}}}}}}}T.}}}}}}}}..}}}}}}}}}}}.....-----.}}}}}}
+}}}}}.--+--..}}}}}}...}}}}}}}}}}}}}}}}}}}T.}}}}}}}}}}}}}}}}.T.}........}}}}}
+}}}}}.......}}}}}}..}}}}}}}}}.}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.}}}.}}.T.}}}}}}
+}}.T...T...}}}}T}}}}}}}}}}}....}}}}}}}}}}T}}}}}.T}}...}}}}}}}}}}}}}}...}}}}}
+}}}...T}}}}}}}..}}}}}}}}}}}.T...}}}}}}}}.T.}.T.....T....}}}}}}}}}}}}}.}}}}}}
+}}}}}}}}}}}}}}}....}}}}}}}...}}.}}}}}}}}}}............T..}}}}}.T.}}}}}}}}}}}
+}}}}}}}}}}}}}}}}..T..}}}}}}}}}}}}}}..}}}}}..------+--...T.}}}....}}}}}}}}}}}
+}}}}.}..}}}}}}}.T.....}}}}}}}}}}}..T.}}}}.T.|...|...|....}}}}}.}}}}}...}}}}}
+}}}.T.}...}..}}}}T.T.}}}}}}.}}}}}}}....}}...|...+...|.}}}}}}}}}}}}}..T...}}}
+}}}}..}}}.....}}...}}}}}}}...}}}}}}}}}}}}}T.|...|...|}}}}}}}}}}}....T..}}}}}
+}}}}}..}}}.T..}}}.}}}}}}}}.T..}}}}}}}}}}}}}}---S-----}}}}}}}}}}}}}....}}}}}}
+}}}}}}}}}}}..}}}}}}}}}}}}}}}.}}}}}}}}}}}}}}}}}T..T}}}}}}}}}}}}}}}}}}}}}}}}}}
+}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+ENDMAP
+
+REPLACE_TERRAIN:(01,01,73,18), '}', '.', 5%
+
+$place = { (08,06),(66,05),(46,15) }
+SHUFFLE: $place
+REGION:(00,00,74,19),lit,"ordinary"
+REGION:(49,14,51,16),random,"ordinary",unfilled
+REGION:(07,05,09,07),unlit,"ordinary"
+REGION:(65,04,67,06),unlit,"ordinary"
+REGION:(45,14,47,16),unlit,"ordinary"
+# All places are accessible also with jumping, so don't bother
+# restricting the placement when teleporting from levels below this.
+TELEPORT_REGION:(33,02,38,07),(0,0,0,0),down
+STAIR:(32,01,39,07),(0,0,0,0),up
+STAIR:$place[0],down
+DOOR:locked,(08,08)
+DOOR:locked,(64,05)
+DOOR:random,(50,13)
+DOOR:locked,(48,15)
+# 
+FOUNTAIN:$place[1]
+#
+CONTAINER:('`',"statue"),$place[2],uncursed,montype:"knight",3,NAME:"Perseus" {
+  OBJECT[75%]:('[',"shield of reflection"),cursed,+0
+  OBJECT[25%]:('[',"levitation boots"),+0
+  OBJECT[50%]:(')',"scimitar"),blessed,+2
+  OBJECT[50%]:('(',"sack")
+}
+#
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:('?',"blank paper"),(48,18)
+OBJECT:('?',"blank paper"),(48,18)
+#
+TRAP:"rust",random
+TRAP:"rust",random
+TRAP:"board",random
+TRAP:"board",random
+TRAP:random,random
+#
+MONSTER:('@',"Medusa"),$place[0]
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"jellyfish"),random
+MONSTER:(';',"jellyfish"),random
+MONSTER:('n',"wood nymph"),random
+MONSTER:('n',"wood nymph"),random
+MONSTER:('n',"water nymph"),random
+MONSTER:('n',"water nymph"),random
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+MONSTER:('B',"raven"),random,hostile
+
+
+LEVEL:"medusa-4"
+FLAGS: noteleport,mazelevel
+INIT_MAP:solidfill,' '
+GEOMETRY:center,center
+#
+# Here the Medusa rules some slithery monsters from her 'palace', with
+# a yellow dragon nesting in the backyard.
+#
+MAP
+}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+}}}}}}}}}}}}}}........}}}}}}}}}}}}}}}}}}}}}}}..}}}.....}}}}}}}}}}}----|}}}}}
+}}}}}}..----------F-.....}}}}}}}}}}}}}}}}..---...}}}}....T.}}}}}}}....|}}}}}
+}}}.....|...F......S}}}}....}}}}}}}...}}.....|}}.}}}}}}}......}}}}|......}}}
+}}}.....+...|..{...|}}}}}}}}}}}}.....}}}}|...|}}}}}}}}}}}.}}}}}}}}----.}}}}}
+}}......|...|......|}}}}}}}}}......}}}}}}|.......}}}}}}}}}}}}}..}}}}}...}}}}
+}}|-+--F|-+--....|F|-|}}}}}....}}}....}}}-----}}.....}}}}}}}......}}}}.}}}}}
+}}|...}}|...|....|}}}|}}}}}}}..}}}}}}}}}}}}}}}}}}}}....}}}}}}}}....T.}}}}}}}
+}}|...}}F...+....F}}}}}}}..}}}}}}}}}}}}}}...}}}}}}}}}}}}}}}}}}}}}}....}}..}}
+}}|...}}|...|....|}}}|}....}}}}}}....}}}...}}}}}...}}}}}}}}}}}}}}}}}.....}}}
+}}--+--F|-+--....-F|-|....}}}}}}}}}}.T...}}}}....---}}}}}}}}}}}}}}}}}}}}}}}}
+}}......|...|......|}}}}}.}}}}}}}}}....}}}}}}}.....|}}}}}}}}}.}}}}}}}}}}}}}}
+}}}}....+...|..{...|.}}}}}}}}}}}}}}}}}}}}}}}}}}.|..|}}}}}}}......}}}}...}}}}
+}}}}}}..|...F......|...}}}}}}}}}}..---}}}}}}}}}}--.-}}}}}....}}}}}}....}}}}}
+}}}}}}}}-----S----F|....}}}}}}}}}|...|}}}}}}}}}}}}...}}}}}}...}}}}}}..}}}}}}
+}}}}}}}}}..............T...}}}}}.|.......}}}}}}}}}}}}}}..}...}.}}}}....}}}}}
+}}}}}}}}}}....}}}}...}...}}}}}.......|.}}}}}}}}}}}}}}.......}}}}}}}}}...}}}}
+}}}}}}}}}}..}}}}}}}}}}.}}}}}}}}}}-..--.}}}}}}}}..}}}}}}..T...}}}..}}}}}}}}}}
+}}}}}}}}}...}}}}}}}}}}}}}}}}}}}}}}}...}}}}}}}....}}}}}}}.}}}..}}}...}}}}}}}}
+}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.}}}}}}....}}}}}}}}}}}}}}}}}}}...}}}}}}
+}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+ENDMAP
+
+REPLACE_TERRAIN:(01,01,73,18), '}', '.', 5%
+
+#
+$place = { (04,08),(10,04),(10,08),(10,12) }
+SHUFFLE: $place
+#
+REGION:(00,00,74,19),lit,"ordinary"
+REGION:(13,03,18,13),lit,"ordinary",unfilled
+#
+TELEPORT_REGION:(64,01,74,17),(0,0,0,0),down
+TELEPORT_REGION:(02,02,18,13),(0,0,0,0),up
+#
+STAIR:(67,01,74,20),(0,0,0,0),up
+STAIR:$place[0],down
+# 
+DOOR:locked,(04,06)
+DOOR:locked,(04,10)
+DOOR:locked,(08,04)
+DOOR:locked,(08,12)
+DOOR:locked,(10,06)
+DOOR:locked,(10,10)
+DOOR:locked,(12,08)
+#
+BRANCH:levregion(27,00,79,20),(0,0,0,0)
+#
+NON_DIGGABLE:(01,01,22,14)
+#
+OBJECT:('(',"crystal ball"),(07,08)
+#
+CONTAINER:('`',"statue"),$place[1],uncursed,montype:"knight",3,NAME:"Perseus" {
+  OBJECT[75%]:('[',"shield of reflection"),cursed,+0
+  OBJECT[25%]:('[',"levitation boots"),+0
+  OBJECT[50%]:(')',"scimitar"),blessed,+2
+  OBJECT[50%]:('(',"sack")
+}
+#
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+CONTAINER:('`',"statue"),random { }
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+# 
+TRAP:random,random
+TRAP:random,random
+TRAP:random,random
+TRAP:random,random
+TRAP:random,random
+TRAP:random,random
+TRAP:random,random
+#
+MONSTER:('@',"Medusa"),$place[0]
+MONSTER:(';',"kraken"),(07,07)
+#
+# the nesting dragon
+MONSTER:('D',"yellow dragon"), (05,04), asleep
+MONSTER[50%]:('D',"baby yellow dragon"), (04,04), asleep
+MONSTER[25%]:('D',"baby yellow dragon"), (04,05), asleep
+OBJECT:('%',"egg"), (05,04), montype:"yellow dragon"
+OBJECT[50%]:('%',"egg"), (05,04), montype:"yellow dragon"
+OBJECT[25%]:('%',"egg"), (05,04), montype:"yellow dragon"
+#
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"giant eel"),random
+MONSTER:(';',"jellyfish"),random
+MONSTER:(';',"jellyfish"),random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:'S',random
+MONSTER:('N',"black naga hatchling"), random
+MONSTER:('N',"black naga hatchling"), random
+MONSTER:('N',"black naga hatchling"), random
+MONSTER:('N',"black naga hatchling"), random
+MONSTER:('N',"black naga"), random
+MONSTER:('N',"black naga"), random
+MONSTER:('N',"black naga"), random
+MONSTER:('N',"black naga"), random
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/mines.des nethack/dat/mines.des
--- nh_orig/dat/mines.des	2003-12-07 18:39:13.000000000 -0500
+++ nethack/dat/mines.des	2010-04-29 10:53:24.172715470 -0400
@@ -10,6 +10,7 @@
 #	specific levels as defined below.
 #
-MAZE: "minefill" , ' '
-INIT_MAP: '.' , ' ' , true , true , random , true
+LEVEL: "minefill"
+FLAGS:mazelevel,noflip
+INIT_MAP: mines, '.' , ' ' , true , true , random , true
 NOMAP
 #
@@ -17,114 +18,154 @@
 STAIR: random, down
 #
-OBJECT: '*', random, random
-OBJECT: '*', random, random
-OBJECT: '*', random, random
-OBJECT: '(', random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+OBJECT: '*', random
+OBJECT: '*', random
+OBJECT: '*', random
+OBJECT: '(', random
+LOOP [2d2] {
+  OBJECT: random, random
+}
 #
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome lord", random
-MONSTER: 'h', "dwarf", random
-MONSTER: 'h', "dwarf", random
-MONSTER: 'G', random, random
-MONSTER: 'G', random, random
-MONSTER: 'h', random, random
+LOOP [4 + 2d5] {
+  MONSTER: ('G', "gnome"), random
+}
+MONSTER: ('G', "gnome lord"), random
+MONSTER: ('h', "dwarf"), random
+MONSTER: ('h', "dwarf"), random
+MONSTER: 'G', random
+MONSTER: 'G', random
+MONSTER: 'h', random
 #
+LOOP [4 + 1d5] {
 TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-
+}
 
 # Minetown variant 1
 # "Frontier Town"
 #
+# A tragic accident has occurred to Frontier Town....
+# 
+# Orcish Town - a variant of Frontier Town that has been
+# overrun by orcs.  Note the barricades (iron bars).
+#
 LEVEL: "minetn-1"
+FLAGS:mazelevel
+INIT_MAP:mines,'.',' ',true,true,random,true
+GEOMETRY:center,center
+MAP
+.....................................
+.----------------F------------------.
+.|.................................|.
+.|.-------------......------------.|.
+.|.|...|...|...|......|..|...|...|.|.
+.F.|...|...|...|......|..|...|...|.|.
+.|.|...|...|...|......|..|...|...|.F.
+.|.|...|...|----......------------.|.
+.|.---------.......................|.
+.|.................................|.
+.|.---------.....--...--...........|.
+.|.|...|...|----.|.....|.---------.|.
+.|.|...|...|...|.|.....|.|..|....|.|.
+.|.|...|...|...|.|.....|.|..|....|.|.
+.|.|...|...|...|.|.....|.|..|....|.|.
+.|.-------------.-------.---------.|.
+.|.................................F.
+.-----------F------------F----------.
+.....................................
+ENDMAP
 
-ROOM: "ordinary" , lit, (3,3), (center,center), (31,15)
-NAME: "town"
-FOUNTAIN: (13, 7)
-FOUNTAIN: (20, 7)
-
-# The Town Watch
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watch captain", random, peaceful
-
-SUBROOM: "shop" , lit, (2,2), (3,4), "town"
-CHANCE: 90
-DOOR: false, closed, south, random
-
-SUBROOM: "tool shop", lit, (2,9), (3,4), "town"
-CHANCE: 90
-DOOR: false, closed, north, random
-
-SUBROOM: "ordinary", unlit, (6,2), (3,4), "town"
-DOOR: false, closed, south, random
-
-SUBROOM: "ordinary", lit, (6,9), (3,4), "town"
-DOOR: false, closed, north, random
-
-SUBROOM: "food shop", lit, (10,2), (2,3), "town"
-CHANCE: 90
-DOOR: false, closed, south, random
+# Don't let the player fall into his likely death
+TELEPORT_REGION:levregion(01,01,20,19),levregion(20,00,70,19)
+REGION:(00,00,36,16),lit,"ordinary"
+STAIR:levregion(01,03,20,19),(00,00,36,15),up
+STAIR:levregion(61,03,75,19),(00,00,36,15),down
 
-SUBROOM: "candle shop", lit, (22,2), (3,3), "town"
-DOOR: false, closed, south, random
+# shame we can't make polluted fountains
+FOUNTAIN:(16,09)
+FOUNTAIN:(25,09)
 
-SUBROOM: "ordinary", unlit, (10,10), (2,3), "town"
-DOOR: false, locked, east, random
-MONSTER: 'G', "gnome", random
+# the altar's defiled; useful for BUC but never coaligned
+ALTAR:(20,13),noalign,shrine
 
-SUBROOM: "ordinary", lit, (19,2),  (2,3), "town"
-DOOR: false, locked, west, random
-MONSTER: 'G', "gnome", random
+# set up the shop doors; could be broken down
+DOOR:random,(5,8)
+DOOR:random,(9,8)
+DOOR:random,(13,7)
+DOOR:random,(22,5)
+DOOR:random,(27,7)
+DOOR:random,(31,7)
+DOOR:random,(5,10)
+DOOR:random,(9,10)
+DOOR:random,(15,13)
+DOOR:random,(25,13)
+DOOR:random,(31,11)
 
-SUBROOM: "temple", lit, (15,9), (4,4), "town"
-DOOR: false, closed, north, random
-ALTAR:(02,02),align[0],shrine
-MONSTER: 'G', "gnomish wizard", random
-MONSTER: 'G', "gnomish wizard", random
+# knock a few holes in the shop interior walls
+REPLACE_TERRAIN:(07,04,11,06),'|','.',18%
+REPLACE_TERRAIN:(25,04,29,06),'|','.',18%
+REPLACE_TERRAIN:(07,12,11,14),'|','.',18%
+REPLACE_TERRAIN:(28,12,28,14),'|','.',33%
 
-SUBROOM: "ordinary", lit, (22,10), (2,3), "town"
-DOOR: false, locked, west, random
+# One spot each in most shops...
+$place = { (05,04),(09,05),(13,04),(26,04),(31,05),(30,14),(05,14),(10,13),(26,14),(27,13) }
+SHUFFLE:$place
 
-SUBROOM: "ordinary", lit, (26,2), (3,3), "town"
-DOOR: false, closed, south, random
-MONSTER: 'G', "gnome lord", random
+# scatter some bodies
+OBJECT:('%',"corpse"),(20,12),montype:"aligned priest"
+OBJECT:('%',"corpse"),$place[0],montype:"shopkeeper"
+OBJECT:('%',"corpse"),$place[1],montype:"shopkeeper"
+OBJECT:('%',"corpse"),$place[2],montype:"shopkeeper"
+OBJECT:('%',"corpse"),$place[3],montype:"shopkeeper"
+OBJECT:('%',"corpse"),$place[4],montype:"shopkeeper"
+OBJECT:('%',"corpse"),random,montype:"watchman"
+OBJECT:('%',"corpse"),random,montype:"watchman"
+OBJECT:('%',"corpse"),random,montype:"watchman"
+OBJECT:('%',"corpse"),random,montype:"watchman"
+OBJECT:('%',"corpse"),random,montype:"watch captain"
 
-SUBROOM: "ordinary", unlit, (25,10), (4,3), "town"
-DOOR: false, closed, north, random
+# Rubble!
+LOOP [9 + 2d5] {
+  OBJECT[90%]:('`',"boulder"),random
+  OBJECT:('*',"rock"),random
+}
 
-ROOM: "ordinary" , random, random, random, random
-STAIR: random, up
+# Guarantee 7 candles since we won't have Izchak available
+OBJECT:('(',"wax candle"),$place[0],quantity:1d2
+OBJECT:('(',"wax candle"),$place[1],quantity:2d2
+OBJECT:('(',"wax candle"),$place[2],quantity:1d2
+OBJECT:('(',"tallow candle"),$place[3],quantity:1d3
+OBJECT:('(',"tallow candle"),$place[2],quantity:1d2
+OBJECT:('(',"tallow candle"),$place[0],quantity:1d2
 
-ROOM: "ordinary" , random, random, random, random
-STAIR: random, down
-TRAP: random, random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
+# go ahead and leave a lamp next to one corpse to be suggestive
+# and some empty wands...
+OBJECT:('(',"oil lamp"),$place[2]
+OBJECT:('/',"striking"),$place[1],uncursed,0
+OBJECT:('/',"striking"),$place[3],uncursed,0
+OBJECT:('/',"striking"),$place[4],uncursed,0
+OBJECT:('/',"magic missile"),$place[4],uncursed,0
+OBJECT:('/',"magic missile"),$place[0],uncursed,0
 
-ROOM: "ordinary" , random, random, random, random
-MONSTER: 'h', "dwarf", random
+# the Orcish Army
 
-ROOM: "ordinary" , random, random, random, random
-TRAP: random, random
-MONSTER: 'G', "gnome", random
+$inside = selection: floodfill(18,8)
+$near_temple = selection: filter(fillrect(17,8, 23,14), $inside)
 
-RANDOM_CORRIDORS
+LOOP [5 + 1d10] {
+  MONSTER[50%]: ('o', "orc-captain"), rndcoord($inside), hostile
+  MONSTER[80%]: ('o', "Uruk-hai"), rndcoord($inside), hostile
+  MONSTER: ('o', "Mordor orc"), rndcoord($inside), hostile
+}
+# shamans can be hanging out in/near the temple
+LOOP [2d3] {
+  MONSTER: ('o', "orc shaman"), rndcoord($near_temple), hostile
+}
+# these are not such a big deal
+# to run into outside the bars
+LOOP [9 + 2d5] {
+  MONSTER[90%]: ('o', "hill orc"), random, hostile
+  MONSTER: ('o', "goblin"), random, hostile
+}
 
+WALLIFY:(1,0, 70,20)
 
 # Minetown variant 2
@@ -133,91 +174,156 @@
 LEVEL: "minetn-2"
 ROOM: "ordinary" , lit, (3,3), (center,center), (31,15)
-NAME: "town"
-FOUNTAIN: (17, 5)
-FOUNTAIN: (13, 8)
-
-# The Town Watch
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watch captain", random, peaceful
+{
 
-SUBROOM: "ordinary", random, (2,0), (2,2), "town"
-DOOR: false, closed, west, random
+IF [75%] {
+  SUBROOM: "ordinary", random, (2,0), (2,2)
+  {
+    ROOMDOOR: false, closed, west|south, random
+  }
+}
 
-SUBROOM: "ordinary", unlit, (5,0), (2,2), "town"
-DOOR: false, closed, south, random
+IF [75%] {
+  SUBROOM: "ordinary", unlit, (5,0), (2,2)
+  {
+    ROOMDOOR: false, closed, west|south, random
+  }
+}
 
-SUBROOM: "ordinary", random, (8,0), (2,2), "town"
-DOOR: false, closed, east, random
+IF [75%] {
+  SUBROOM: "ordinary", random, (8,0), (2,2)
+  {
+    ROOMDOOR: false, closed, east|south, random
+  }
+}
 
-SUBROOM: "ordinary", lit, (16,0), (2,2), "town"
-DOOR: false, closed, west, random
+IF [75%] {
+  SUBROOM: "ordinary", lit, (16,0), (2,2)
+  {
+    ROOMDOOR: false, closed, west|south, random
+  }
+}
 
-SUBROOM: "ordinary", unlit, (19,0), (2,2), "town"
-DOOR: false, closed, south, random
+IF [75%] {
+  SUBROOM: "ordinary", unlit, (19,0), (2,2)
+  {
+    ROOMDOOR: false, closed, west|south, random
+  }
+}
 
-SUBROOM: "ordinary", random, (22,0), (2,2), "town"
-DOOR: false, locked, south, random
-MONSTER: 'G', "gnome", random
+IF [75%] {
+  SUBROOM: "ordinary", random, (22,0), (2,2)
+  {
+    ROOMDOOR: false, locked, west|south, random
+    MONSTER: ('G', "gnome"), random
+  }
+}
 
-SUBROOM: "ordinary", unlit, (25,0), (2,2), "town"
-DOOR: false, closed, east, random
+IF [75%] {
+  SUBROOM: "ordinary", unlit, (25,0), (2,2)
+  {
+    ROOMDOOR: false, closed, east|south|west, random
+  }
+}
 
-SUBROOM: "ordinary", lit, (2,5), (2,2), "town"
-DOOR: false, closed, north, random
+IF [75%] {
+  SUBROOM: "ordinary", lit, (2,5), (2,2)
+  {
+    ROOMDOOR: false, closed, north|south|west, random
+  }
+}
 
-SUBROOM: "ordinary", lit, (5,5), (2,2), "town"
-DOOR: false, closed, south, random
+IF [75%] {
+  SUBROOM: "ordinary", random, (8,5), (2,2)
+  {
+    ROOMDOOR: false, locked, north|south|east, random
+    MONSTER: ('G', "gnome"), random
+  }
+}
 
-SUBROOM: "ordinary", random, (8,5), (2,2), "town"
-DOOR: false, locked, north, random
-MONSTER: 'G', "gnome", random
+IF [75%] {
+  SUBROOM: "ordinary", lit, (5,5), (2,2)
+  {
+    ROOMDOOR: false, closed, north|south|east|west, random
+  }
+}
 
-SUBROOM: "shop" , lit, (2,10), (4,3), "town"
-CHANCE: 90
-DOOR: false, closed, west, random
+SUBROOM: "shop" [90%] , lit, (2,10), (4,3)
+{
+ROOMDOOR: false, closed, north|south|west, random
+}
 
-SUBROOM: "tool shop", lit, (23,10), (4,3), "town"
-CHANCE: 90
-DOOR: false, closed, east, random
+SUBROOM: "tool shop" [90%], lit, (23,10), (4,3)
+{
+ROOMDOOR: false, closed, south|east, random
+}
 
-SUBROOM: "food shop", lit, (24,5), (3,4), "town"
-CHANCE: 90
-DOOR: false, closed, north, random
+SUBROOM: "food shop" [90%], lit, (24,5), (3,4)
+{
+ROOMDOOR: false, closed, north|east, random
+}
 
-SUBROOM: "candle shop", lit, (11,10), (4,3), "town"
-DOOR: false, closed, east, random
+SUBROOM: "candle shop", lit, (11,10), (4,3)
+{
+ROOMDOOR: false, closed, north|south|east, random
+}
 
-SUBROOM: "ordinary", unlit, (7,10), (3,3), "town"
-DOOR: false, locked, north, random
-MONSTER: 'G', "gnome", random
+IF [75%] {
+  SUBROOM: "ordinary", unlit, (7,10), (3,3)
+  {
+    ROOMDOOR: false, locked, north|south, random
+    MONSTER: ('G', "gnome"), random
+  }
+}
 
-SUBROOM: "temple", lit, (19,5), (4,4), "town"
-DOOR: false, closed, north, random
+SUBROOM: "temple", lit, (19,5), (4,4)
+{
+ROOMDOOR: false, closed, north|west, random
 ALTAR:(02,02),align[0],shrine
-MONSTER: 'G', "gnomish wizard", random
-MONSTER: 'G', "gnomish wizard", random
+MONSTER: ('G', "gnomish wizard"), random
+MONSTER: ('G', "gnomish wizard"), random
+}
 
-SUBROOM: "ordinary", lit, (18,10), (4,3), "town"
-DOOR: false, locked, west, random
-MONSTER: 'G', "gnome lord", random
+IF [75%] {
+  SUBROOM: "ordinary", lit, (18,10), (4,3)
+  {
+    ROOMDOOR: false, locked, south|west, random
+    MONSTER: ('G', "gnome lord"), random
+  }
+}
+
+FOUNTAIN: (17, 5)
+FOUNTAIN: (13, 8)
+
+# The Town Watch
+LOOP [2 + 1d7] {
+  MONSTER: ('@', "watchman"), random, peaceful
+}
+MONSTER: ('@', "watch captain"), random, peaceful
+
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, up
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, down
 TRAP: random, random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
+MONSTER: ('G', "gnome"), random
+MONSTER: ('G', "gnome"), random
+}
 
 ROOM: "ordinary" , random, random, random, random
-MONSTER: 'h', "dwarf", random
+{
+MONSTER: ('h', "dwarf"), random
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 TRAP: random, random
-MONSTER: 'G', "gnome", random
+MONSTER: ('G', "gnome"), random
+}
 
 RANDOM_CORRIDORS
@@ -229,86 +335,142 @@
 LEVEL: "minetn-3"
 ROOM: "ordinary",lit,(3,3),(center,center),(31,15)
-NAME: "town"
-FOUNTAIN:(01,06)
-FOUNTAIN:(29,13)
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watch captain", random, peaceful
+{
 
-SUBROOM:"ordinary",random,(2,2),(2,2),"town"
-DOOR: false,closed,south,random
+IF [75%] {
+  SUBROOM:"ordinary",random,(2,2),(2,2)
+  {
+    ROOMDOOR: false,closed,north|south|west,random
+  }
+}
 
-SUBROOM:"tool shop",lit,(5,3),(2,3),"town"
-CHANCE: 30
-DOOR: false,closed,south,random
+SUBROOM:"tool shop" [30%],lit,(5,3),(2,3)
+{
+ROOMDOOR: false,closed,north|south|east,random
+}
 
-SUBROOM:"ordinary",random,(2,10),(2,3),"town"
-DOOR: false, locked, north, random
-MONSTER: 'G',random,random
+IF [75%] {
+  SUBROOM:"ordinary",random,(2,10),(2,3)
+  {
+    ROOMDOOR: false, locked, north|south|west, random
+    MONSTER: 'G',random
+  }
+}
 
-SUBROOM:"ordinary",random,(5,9),(2,2),"town"
-DOOR: false,closed,north,random
+IF [75%] {
+  SUBROOM:"ordinary",random,(5,9),(2,2)
+  {
+    ROOMDOOR: false,closed,north|south|east,random
+  }
+}
 
-SUBROOM:"temple",lit,(10,2),(3,4),"town"
-DOOR: false,closed,east,random
+SUBROOM:"temple",lit,(10,2),(3,4)
+{
+ROOMDOOR: false,closed,north|west|east,random
 ALTAR:(1,1),align[0],shrine
-MONSTER: 'G', "gnomish wizard", random
-MONSTER: 'G', "gnomish wizard", random
+MONSTER: ('G', "gnomish wizard"), random
+MONSTER: ('G', "gnomish wizard"), random
+}
 
-SUBROOM:"ordinary",random,(11,7),(2,2),"town"
-DOOR: false,closed,west,random
+IF [75%] {
+  SUBROOM:"ordinary",random,(11,7),(2,2)
+  {
+    ROOMDOOR: false,closed,west,random
+  }
+}
 
-SUBROOM:"shop",lit,(10,10),(3,3),"town"
-DOOR:false,closed,west,random
+SUBROOM:"shop",lit,(10,10),(3,3)
+{
+ROOMDOOR:false,closed,west|south,random
+}
 
-SUBROOM:"ordinary",random,(14,8),(2,2),"town"
-DOOR:false,locked,north,random
-MONSTER: 'G',random,random
+IF [75%] {
+  SUBROOM:"ordinary",random,(14,8),(2,2)
+  {
+    ROOMDOOR:false,locked,north,random
+    MONSTER: 'G',random
+  }
+}
 
-SUBROOM:"ordinary",random,(14,11),(2,2),"town"
-DOOR:false,closed,south,random
+IF [75%] {
+  SUBROOM:"ordinary",random,(14,11),(2,2)
+  {
+    ROOMDOOR:false,closed,north|south,random
+  }
+}
 
-SUBROOM:"tool shop",lit,(17,10),(3,3),"town"
-CHANCE:40
-DOOR:false,closed,north,random
+SUBROOM:"tool shop" [40%],lit,(17,10),(3,3)
+{
+ROOMDOOR:false,closed,north|south,random
+}
 
-SUBROOM:"ordinary",random,(21,11),(2,2),"town"
-DOOR:false,locked,east,random
-MONSTER:'G',random,random
+IF [75%] {
+  SUBROOM:"ordinary",random,(21,11),(2,2)
+  {
+    ROOMDOOR:false,locked,north|south|east,random
+    MONSTER:'G',random
+  }
+}
 
-SUBROOM:"food shop",lit,(26,8),(3,2),"town"
-CHANCE:90
-DOOR:false,closed,west,random
+SUBROOM:"food shop" [90%],lit,(26,8),(3,2)
+{
+ROOMDOOR:false,closed,north|south|east|west,random
+}
 
-SUBROOM:"ordinary",random,(16,2),(2,2),"town"
-DOOR:false,closed,west,random
+IF [75%] {
+  SUBROOM:"ordinary",random,(16,2),(2,2)
+  {
+    ROOMDOOR:false,closed,north|south|west,random
+  }
+}
 
-SUBROOM:"ordinary",random,(19,2),(2,2),"town"
-DOOR:false,closed,north,random
+IF [75%] {
+  SUBROOM:"ordinary",random,(19,2),(2,2)
+  {
+    ROOMDOOR:false,closed,north|east|west,random
+  }
+}
 
-SUBROOM:"wand shop",lit,(19,5),(3,2),"town"
-CHANCE:30
-DOOR:false,closed,west,random
+SUBROOM:"wand shop" [30%],lit,(19,5),(3,2)
+{
+ROOMDOOR:false,closed,south|east|west,random
+}
 
-SUBROOM: "candle shop",lit,(25,2),(3,3),"town"
-DOOR:false,closed,south,random
+SUBROOM: "candle shop",lit,(25,2),(3,3)
+{
+ROOMDOOR:false,closed,north|south|east|west,random
+}
+
+FOUNTAIN:(01,06)
+FOUNTAIN:(29,13)
+LOOP [2 + 1d7] {
+  MONSTER: ('@', "watchman"), random, peaceful
+}
+MONSTER: ('@', "watch captain"), random, peaceful
+
+}
 
 ROOM: "ordinary", random, random, random, random
+{
 STAIR: random, up
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, down
 TRAP: random, random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
+MONSTER: ('G', "gnome"), random
+MONSTER: ('G', "gnome"), random
+}
 
 ROOM: "ordinary" , random, random, random, random
-MONSTER: 'h', "dwarf", random
+{
+MONSTER: ('h', "dwarf"), random
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 TRAP: random, random
-MONSTER: 'G', "gnome", random
+MONSTER: ('G', "gnome"), random
+}
 
 RANDOM_CORRIDORS
@@ -320,77 +482,120 @@
 LEVEL: "minetn-4"
 ROOM: "ordinary",lit,(3,3),(center,center),(30,15)
-NAME: "town"
-FOUNTAIN:(08,07)
-FOUNTAIN:(18,07)
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watch captain", random, peaceful
+{
 
-SUBROOM:"book shop",lit,(4,2),(3,3),"town"
-DOOR: false,closed,south,random
+SUBROOM:"book shop",lit,(4,2),(3,3)
+{
+ROOMDOOR: false,closed,north|south|west,random
+}
 
-SUBROOM:"ordinary",random,(8,2),(2,2),"town"
-DOOR: false,closed,south,random
+IF [75%] {
+  SUBROOM:"ordinary",random,(8,2),(2,2)
+  {
+    ROOMDOOR: false,closed,north|south,random
+  }
+}
 
-SUBROOM:"temple",lit,(11,3),(5,4),"town"
-DOOR: false,closed,south,random
+SUBROOM:"temple",lit,(11,3),(5,4)
+{
+ROOMDOOR: false,closed,north|south|east,random
 ALTAR:(2,1),align[0],shrine
-MONSTER: 'G', "gnomish wizard", random
-MONSTER: 'G', "gnomish wizard", random
+MONSTER: ('G', "gnomish wizard"), random
+MONSTER: ('G', "gnomish wizard"), random
+}
 
-SUBROOM:"ordinary",random,(19,2),(2,2),"town"
-DOOR: false,closed,south,random
-MONSTER: 'G', random, random
+IF [75%] {
+  SUBROOM:"ordinary",random,(19,2),(2,2)
+  {
+    ROOMDOOR: false,closed,north|south|west,random
+    MONSTER: 'G', random
+  }
+}
 
-SUBROOM:"candle shop",lit,(22,2),(3,3),"town"
-DOOR:false,closed,south,random
+SUBROOM:"candle shop",lit,(22,2),(3,3)
+{
+ROOMDOOR:false,closed,north|south,random
+}
 
-SUBROOM:"ordinary",random,(26,2),(2,2),"town"
-DOOR:false,locked,east,random
-MONSTER: 'G',random,random
+IF [75%] {
+  SUBROOM:"ordinary",random,(26,2),(2,2)
+  {
+    ROOMDOOR:false,locked,north|south|east,random
+    MONSTER: 'G',random
+  }
+}
 
-SUBROOM:"tool shop",lit,(4,10),(3,3),"town"
-CHANCE:90
-DOOR:false,closed,north,random
+SUBROOM:"tool shop" [90%],lit,(4,10),(3,3)
+{
+ROOMDOOR:false,closed,north|south|west,random
+}
 
-SUBROOM:"ordinary",random,(8,11),(2,2),"town"
-DOOR:false,locked,south,random
-MONSTER: 'k',"kobold shaman",random
-MONSTER: 'k',"kobold shaman",random
-MONSTER: 'f',"kitten",random
-MONSTER: 'f',random,random
+IF [75%] {
+  SUBROOM:"ordinary",random,(8,11),(2,2)
+  {
+    ROOMDOOR:false,locked,north|south,random
+    MONSTER: ('k',"kobold shaman"),random
+    MONSTER: ('k',"kobold shaman"),random
+    MONSTER: ('f',"kitten"),random
+    MONSTER: 'f',random
+  }
+}
 
-SUBROOM:"food shop",lit,(11,11),(3,2),"town"
-CHANCE:90
-DOOR:false,closed,east,random
+SUBROOM:"food shop" [90%],lit,(11,11),(3,2)
+{
+ROOMDOOR:false,closed,north|south|east,random
+}
 
-SUBROOM:"ordinary",random,(17,11),(2,2),"town"
-DOOR:false,closed,west,random
+IF [75%] {
+  SUBROOM:"ordinary",random,(17,11),(2,2)
+  {
+    ROOMDOOR:false,closed,north|south|west,random
+  }
+}
 
-SUBROOM:"ordinary",random,(20,10),(2,2),"town"
-DOOR:false,locked,north,random
-MONSTER:'G',random,random
+IF [75%] {
+  SUBROOM:"ordinary",random,(20,10),(2,2)
+  {
+    ROOMDOOR:false,locked,north|south,random
+    MONSTER:'G',random
+  }
+}
 
-SUBROOM:"shop",lit,(23,10),(3,3),"town"
-CHANCE:90
-DOOR:false,closed,north,random
+SUBROOM:"shop" [90%],lit,(23,10),(3,3)
+{
+ROOMDOOR:false,closed,north|south|east,random
+}
+
+FOUNTAIN:(08,07)
+FOUNTAIN:(18,07)
+LOOP [2 + 1d7] {
+  MONSTER: ('@', "watchman"), random, peaceful
+}
+MONSTER: ('@', "watch captain"), random, peaceful
+
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, up
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, down
 TRAP: random, random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
+MONSTER: ('G', "gnome"), random
+MONSTER: ('G', "gnome"), random
+}
 
 ROOM: "ordinary" , random, random, random, random
-MONSTER: 'h', "dwarf", random
+{
+MONSTER: ('h', "dwarf"), random
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 TRAP: random, random
-MONSTER: 'G', "gnome", random
+MONSTER: ('G', "gnome"), random
+}
 
 RANDOM_CORRIDORS
@@ -399,5 +604,7 @@
 # "Grotto Town" by Kelly Bailey
 #
-MAZE: "minetn-5",' '
+LEVEL: "minetn-5"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 MAP
@@ -425,4 +632,34 @@
 ENDMAP
 
+IF [75%] {
+   IF [50%] {
+      TERRAIN:line (25,8)-(25,9), '|'
+   } ELSE {
+      TERRAIN:line (16,13)-(17,13), '-'
+   }
+}
+
+IF [75%] {
+   IF [50%] {
+      TERRAIN:line (36,10)-(36,11), '|'
+   } ELSE {
+      TERRAIN:line (32,15)-(33,15), '-'
+   }
+}
+
+IF [50%] {
+   TERRAIN:fillrect (21,4,22,5), '.'
+   TERRAIN:line (14,9)-(14,10), '|'
+}
+
+IF [50%] {
+   TERRAIN:(46,13), '|'
+   TERRAIN:line (43,5)-(47,5), '-'
+   TERRAIN:line (42,6)-(46,6), '.'
+   TERRAIN:(47,7), '.'
+}
+
+TERRAIN[50%]:fillrect (69,11,71,11), '-'
+
 STAIR:(01,01),up
 STAIR:(46,03),down
@@ -431,30 +668,26 @@
 FOUNTAIN:(66,18)
 
+OBJECT:('\\',"brazier"),(08,15)
+OBJECT:('\\',"brazier"),(12,15)
+OBJECT:('\\',"brazier"),(51,09)
+OBJECT:('\\',"brazier"),(65,18)
+OBJECT:('\\',"brazier"),(36,15)
+OBJECT:('\\',"brazier"),(40,15)
+
 REGION:(00,00,74,20),unlit,"ordinary"
-REGION:(09,13,11,17),lit,"ordinary"
-REGION:(08,14,12,16),lit,"ordinary"
-REGION:(49,07,51,11),lit,"ordinary"
-REGION:(48,08,52,10),lit,"ordinary"
-REGION:(64,17,68,19),lit,"ordinary"
-REGION:(37,13,39,17),lit,"ordinary"
-REGION:(36,14,40,17),lit,"ordinary"
 REGION:(59,02,72,10),lit,"ordinary"
 
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watch captain", random, peaceful
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome lord", random
-MONSTER: 'G', "gnome lord", random
-MONSTER: 'h', "dwarf", random
-MONSTER: 'h', "dwarf", random
-MONSTER: 'h', "dwarf", random
+LOOP [2 + 1d7] {
+  MONSTER: ('@', "watchman"), random, peaceful
+}
+MONSTER: ('@', "watch captain"), random, peaceful
+LOOP [4 + 1d8] {
+  MONSTER: ('G', "gnome"), random
+}
+MONSTER: ('G', "gnome lord"), random
+MONSTER: ('G', "gnome lord"), random
+MONSTER: ('h', "dwarf"), random
+MONSTER: ('h', "dwarf"), random
+MONSTER: ('h', "dwarf"), random
 
 # The shops
@@ -470,12 +703,12 @@
 DOOR:closed,(04,14)
 DOOR:locked,(01,17)
-MONSTER: 'G', "gnomish wizard", (02,19)
+MONSTER: ('G', "gnomish wizard"), (02,19)
 DOOR:locked,(20,16)
-MONSTER: 'G', random, (20,18)
+MONSTER: 'G', (20,18)
 DOOR:random,(21,14)
 DOOR:random,(25,14)
 DOOR:random,(42,08)
 DOOR:locked,(40,05)
-MONSTER: 'G', random, (38,07)
+MONSTER: 'G', (38,07)
 DOOR:random,(59,03)
 DOOR:random,(58,06)
@@ -486,13 +719,13 @@
 DOOR:closed,(69,04)
 DOOR:closed,(67,16)
-MONSTER: 'G', "gnomish wizard", (67,14)
-OBJECT: '=', random, (70,14)
+MONSTER: ('G', "gnomish wizard"), (67,14)
+OBJECT: '=', (70,14)
 DOOR:locked,(69,18)
-MONSTER: 'G', "gnome lord", (71,19)
+MONSTER: ('G', "gnome lord"), (71,19)
 DOOR:locked,(73,18)
-OBJECT: '(', "chest", (73,19)
+OBJECT: ('(', "chest"), (73,19)
 DOOR:locked,(50,06)
-OBJECT: '(', random, (50,03)
-OBJECT: '`', "statue", (38,15), "gnome king", 1
+OBJECT: '(', (50,03)
+OBJECT: ('`', "statue"), (38,15), montype:"gnome king", 1
 # Temple
 REGION:(29,02,33,04),lit,"temple"
@@ -501,24 +734,27 @@
 
 
-# "Bustling Town" by Kelly Bailey
+# Screw Bustling Town.  Let's make a zoo.  --DSR
 #
-MAZE: "minetn-6",' '
-INIT_MAP:'.','-',true,true,lit,true
+LEVEL: "minetn-6"
+FLAGS:mazelevel
+INIT_MAP:mines,'.','-',true,true,lit,true
 GEOMETRY:center,top
+#         1         2         3         4         5         6         7
+#1234567890123456789012345678901234567890123456789012345678901234567890
 MAP
-.-----................----------------.-
-.|...|................|...|..|...|...|..
-.|...+..--+--.........|...|..|...|...|..
-.|...|..|...|..-----..|...|..|-+---+--..
-.-----..|...|--|...|..--+---+-.........|
-........|...|..|...+.............-----..
-........-----..|...|......--+-...|...|..
-.----...|...|+------..{...|..|...+...|..
+.-----...................-------------.-
+.|...|...................|...|...|...|..
+.|...+..--+--...-FFF+F...|...|...|...|..
+.|...|..|...|...|....F...|...|-+---+--..
+.-----..|...|...|....F...---+-.........|
+........|...|...|....F...........-----..
+........-----...------....--+-...|...|..
+.----...|...|.{........{..|..|...+...|..
 .|..+...|...|.............|..|...|...|..
-.|..|...|...|-+-.....---+-------------.|
-.----...--+--..|..-+-|..................
+.|..|...|...|---.....---+-------------.|
+.----...--+--..|..---|..................
 ...|........|..|..|..|----....---------.
-...|..T.....----..|..|...+....|......|-.
-...|-....{........|..|...|....+......|-.
+...|..T.....-+--..+..|...+....|......|-.
+...|-....T........|..|...|....+......|-.
 ...--..-....T.....--------....|......|-.
 .......--.....................----------
@@ -528,10 +764,11 @@
 STAIR:levregion(01,03,20,19),(0,0,39,15),up
 STAIR:levregion(61,03,75,19),(0,0,39,15),down
-FOUNTAIN:(22,07)
-FOUNTAIN:(09,13)
-REGION:(13,5,14,6),unlit,"ordinary"
+FOUNTAIN:(23,07)
+FOUNTAIN:(14,07)
+# protect the zoo against dwarves and inquisitive players
+NON_DIGGABLE:(13,0,24,8)
 REGION:(9,7,11,9),lit,"candle shop"
-REGION:(16,4,18,6),lit,"tool shop"
-REGION:(23,1,25,3),lit,"shop"
+REGION:(9,3,11,5),lit,"tool shop"
+REGION:(26,1,28,3),lit,"shop"
 REGION:(22,12,24,13),lit,"food shop"
 REGION:(31,12,36,14),lit,"temple"
@@ -542,8 +779,6 @@
 DOOR:closed,(10,2)
 DOOR:closed,(10,10)
-DOOR:locked,(13,7)
-DOOR:locked,(14,9)
-DOOR:closed,(19,5)
-DOOR:closed,(19,10)
+DOOR:locked,(13,12)
+DOOR:locked,(20,2)
 DOOR:closed,(24,4)
 DOOR:closed,(24,9)
@@ -556,24 +791,40 @@
 DOOR:closed,(33,7)
 
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", (14,6)
-MONSTER: 'G', "gnome lord", (14,5)
-MONSTER: 'G', "gnome", (27,8)
-MONSTER: 'G', "gnome lord", random
-MONSTER: 'G', "gnome lord", random
-MONSTER: 'h', "dwarf", random
-MONSTER: 'h', "dwarf", random
-MONSTER: 'h', "dwarf", random
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watch captain", random, peaceful
-MONSTER: '@', "watch captain", random, peaceful
+$in_zoo = selection: floodfill(18,4)
+$outside = selection: filter(floodfill(18,8), fillrect (1,0,37,15))
+
+LOOP [4 + 1d8] {
+  MONSTER: ('G', "gnome"), rndcoord($outside)
+}
+MONSTER: ('G', "gnome"), rndcoord($outside)
+MONSTER: ('G', "gnome lord"), rndcoord($outside)
+MONSTER: ('G', "gnome"), rndcoord($outside)
+MONSTER: ('G', "gnome lord"), rndcoord($outside)
+MONSTER: ('G', "gnome lord"), rndcoord($outside)
+MONSTER: ('G', "gnomish wizard"), rndcoord($outside)
+MONSTER: ('G', "gnomish wizard"), rndcoord($outside)
+MONSTER: ('h', "dwarf"), rndcoord($outside)
 
+MONSTER: ('@', "watchman"), rndcoord($outside), peaceful
+MONSTER: ('@', "watchman"), rndcoord($outside), peaceful
+MONSTER: ('@', "watchman"), rndcoord($outside), peaceful
+MONSTER: ('@', "watch captain"), rndcoord($outside), peaceful
+MONSTER: ('@', "watch captain"), rndcoord($outside), peaceful
+# The zoo needs some stuff...
+MONSTER: ('f', "tiger"), rndcoord($in_zoo), hostile
+MONSTER: ('f', "panther"), rndcoord($in_zoo), hostile
+MONSTER: ('f', "jaguar"), rndcoord($in_zoo), hostile
+MONSTER: ('q', "mastodon"), rndcoord($in_zoo), hostile
+# and a couple token handlers
+MONSTER: ('o', "Mordor orc"), rndcoord($in_zoo), hostile {
+  OBJECT:(')', "bullwhip")
+}
+MONSTER: ('o', "Mordor orc"), rndcoord($in_zoo), hostile {
+  OBJECT:(')', "bullwhip")
+}
+# and a couple shiny prizes as temptation (for the handlers to use, possibly?)
+OBJECT: '/', rndcoord($in_zoo)
+OBJECT: '/', rndcoord($in_zoo)
+OBJECT: '=', rndcoord($in_zoo)
 
 # "Bazaar Town" by Kelly Bailey
@@ -581,113 +832,179 @@
 LEVEL: "minetn-7"
 ROOM: "ordinary" , lit, (3,3), (center,center), (30,15)
-NAME: "town"
-FOUNTAIN: (12, 07)
-FOUNTAIN: (11, 13)
-
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watchman", random, peaceful
-MONSTER: '@', "watch captain", random, peaceful
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome lord",random
-MONSTER:'Y',"monkey",random
-MONSTER:'Y',"monkey",random
+{
 
-SUBROOM: "ordinary", random, (2,2), (4,2), "town"
-DOOR: false, closed, south, random
+IF [75%] {
+  SUBROOM: "ordinary", random, (2,2), (4,2)
+  {
+    ROOMDOOR: false, closed, north|south|west, random
+  }
+}
 
-SUBROOM: "ordinary", random, (7,2), (2,2), "town"
-DOOR: false, closed, north, random
+IF [75%] {
+  SUBROOM: "ordinary", random, (7,2), (2,2)
+  {
+    ROOMDOOR: false, closed, north|west, random
+  }
+}
 
-SUBROOM: "ordinary", random, (7,5), (2,2), "town"
-DOOR: false, closed, south, random
+IF [75%] {
+  SUBROOM: "ordinary", random, (7,5), (2,2)
+  {
+    ROOMDOOR: false, closed, south|west, random
+  }
+}
 
-SUBROOM: "ordinary", lit, (10,2), (3,4), "town"
-MONSTER:'G',"gnome",random
-MONSTER:'Y',"monkey",random
-MONSTER:'Y',"monkey",random
-MONSTER:'Y',"monkey",random
-DOOR: false, closed, south, random
+IF [75%] {
+  SUBROOM: "ordinary", lit, (10,2), (3,4)
+  {
+    MONSTER:('G',"gnome"),random
+    MONSTER:('Y',"monkey"),random
+    MONSTER:('Y',"monkey"),random
+    MONSTER:('Y',"monkey"),random
+    ROOMDOOR: false, closed, north|south, random
+  }
+}
 
-SUBROOM: "ordinary", random, (14,2), (4,2), "town"
-DOOR: false, closed, south, 0
-MONSTER: 'n', random, random
+IF [75%] {
+  SUBROOM: "ordinary", random, (14,2), (4,2)
+  {
+    ROOMDOOR: false, closed, south, 0
+    MONSTER: 'n', random
+  }
+}
 
-SUBROOM: "ordinary", random, (16,5), (2,2), "town"
-DOOR: false, closed, south, random
+IF [75%] {
+  SUBROOM: "ordinary", random, (16,5), (2,2)
+  {
+    ROOMDOOR: false, closed, south|west, random
+  }
+}
 
-SUBROOM: "ordinary", unlit, (19,2), (2,2), "town"
-DOOR: false, locked, east, random
-MONSTER: 'G',"gnome king",random
+IF [75%] {
+  SUBROOM: "ordinary", unlit, (19,2), (2,2)
+  {
+    ROOMDOOR: false, locked, north|west|east, random
+    MONSTER: ('G',"gnome king"),random
+  }
+}
 
-SUBROOM: "food shop", lit, (19,5), (2,3), "town"
-CHANCE: 50
-DOOR: false, closed, south, random
+SUBROOM: "food shop" [50%], lit, (19,5), (2,3)
+{
+ROOMDOOR: false, closed, south|east, random
+}
 
-SUBROOM: "ordinary", random, (2,7), (2,2), "town"
-DOOR: false, closed, east, random
+IF [75%] {
+  SUBROOM: "ordinary", random, (2,7), (2,2)
+  {
+    ROOMDOOR: false, closed, north|west|east, random
+  }
+}
 
-SUBROOM: "tool shop", lit, (2,10), (2,3), "town"
-CHANCE: 50
-DOOR: false, closed, south, random
+SUBROOM: "tool shop" [50%], lit, (2,10), (2,3)
+{
+ROOMDOOR: false, closed, south|west, random
+}
 
-SUBROOM: "candle shop", lit, (5,10),(3,3), "town"
-DOOR: false, closed, north, random
+SUBROOM: "candle shop", lit, (5,10),(3,3)
+{
+ROOMDOOR: false, closed, north|south|east, random
+}
 
-SUBROOM: "ordinary", random, (11,10), (2,2), "town"
-DOOR: false, locked, west, random
-MONSTER: 'G',random,random
+IF [75%] {
+  SUBROOM: "ordinary", random, (11,10), (2,2)
+  {
+    ROOMDOOR: false, locked, north|south|west, random
+    MONSTER: 'G',random
+  }
+}
 
-SUBROOM: "shop", lit, (14,10), (2,3), "town"
-CHANCE: 60
-DOOR: false, closed, north, random
+SUBROOM: "shop" [60%], lit, (14,10), (2,3)
+{
+ROOMDOOR: false, closed, north|south, random
+}
 
-SUBROOM: "ordinary", random, (17,11), (4,2), "town"
-DOOR: false, closed, north, random
+IF [75%] {
+  SUBROOM: "ordinary", random, (17,11), (4,2)
+  {
+    ROOMDOOR: false, closed, north|south, random
+  }
+}
 
-SUBROOM: "ordinary", random, (22,11), (2,2), "town"
-DOOR: false, closed, south, random
+IF [75%] {
+  SUBROOM: "ordinary", random, (22,11), (2,2)
+  {
+    ROOMDOOR: false, closed, north|south|west, random
 SINK: (00,00)
+  }
+}
 
-SUBROOM: "food shop", lit, (25,11), (3,2), "town"
-CHANCE: 50
-DOOR: false, closed, east, random
+SUBROOM: "food shop" [50%], lit, (25,11), (3,2)
+{
+ROOMDOOR: false, closed, south|east, random
+}
 
-SUBROOM: "tool shop", lit, (25,2), (3,3), "town"
-CHANCE: 30
-DOOR: false, closed, west, random
+SUBROOM: "tool shop" [30%], lit, (25,2), (3,3)
+{
+ROOMDOOR: false, closed, north|west|east, random
+}
 
-SUBROOM: "temple", lit, (24,6), (4,4), "town"
-DOOR: false, closed, west, random
+SUBROOM: "temple", lit, (24,6), (4,4)
+{
+ROOMDOOR: false, closed, west, random
 ALTAR:(02,01),align[0],shrine
-MONSTER: 'G', "gnomish wizard", random
-MONSTER: 'G', "gnomish wizard", random
+MONSTER: ('G', "gnomish wizard"), random
+MONSTER: ('G', "gnomish wizard"), random
+}
+
+FOUNTAIN: (12, 07)
+FOUNTAIN: (11, 13)
+
+LOOP [2 + 1d7] {
+  MONSTER: ('@', "watchman"), random, peaceful
+}
+MONSTER: ('@', "watch captain"), random, peaceful
+LOOP [2 + 1d3] {
+  MONSTER:('G',"gnome"),random
+}
+MONSTER:('G',"gnome lord"),random
+MONSTER:('Y',"monkey"),random
+MONSTER:('Y',"monkey"),random
+
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, up
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, down
 TRAP: random, random
-MONSTER: 'G', "gnome", random
-MONSTER: 'G', "gnome", random
+MONSTER: ('G', "gnome"), random
+MONSTER: ('G', "gnome"), random
+}
 
 ROOM: "ordinary" , random, random, random, random
-MONSTER: 'h', "dwarf", random
+{
+MONSTER: ('h', "dwarf"), random
+}
   
 ROOM: "ordinary" , random, random, random, random
+{
 TRAP: random, random
-MONSTER: 'G', "gnome", random
+MONSTER: ('G', "gnome"), random
+}
 
 RANDOM_CORRIDORS
   
 
+
 # Mine end level variant 1
 # "Mimic of the Mines"
 #
-MAZE: "minend-1", ' '
+LEVEL: "minend-1"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 #1234567890123456789012345678901234567890123456789012345678901234567890
@@ -714,5 +1031,6 @@
 
 # Dungeon Description
-RANDOM_PLACES:(08,16),(13,07),(21,08),(41,14),(50,04),(50,16),(66,01)
+$place = { (08,16),(13,07),(21,08),(41,14),(50,04),(50,16),(66,01) }
+SHUFFLE:$place
 REGION:(26,01,32,01),unlit,"ordinary",filled,true
 REGION:(20,08,21,08),unlit,"ordinary"
@@ -732,39 +1050,39 @@
 # Niches
 # Note: place[6] empty
-OBJECT:'*',"diamond",place[0]
-OBJECT:'*',"emerald",place[0]
-OBJECT:'*',"worthless piece of violet glass",place[0]
-MONSTER:'m',random,place[0], m_object "luckstone"
-OBJECT:'*',"worthless piece of white glass",place[1]
-OBJECT:'*',"emerald",place[1]
-OBJECT:'*',"amethyst",place[1]
-MONSTER:'m',random,place[1], m_object "loadstone"
-OBJECT:'*',"diamond",place[2]
-OBJECT:'*',"worthless piece of green glass",place[2]
-OBJECT:'*',"amethyst",place[2]
-MONSTER:'m',random,place[2], m_object "flint"
-OBJECT:'*',"worthless piece of white glass",place[3]
-OBJECT:'*',"emerald",place[3]
-OBJECT:'*',"worthless piece of violet glass",place[3]
-MONSTER:'m',random,place[3], m_object "touchstone"
-OBJECT:'*',"worthless piece of red glass",place[4]
-OBJECT:'*',"ruby",place[4]
-OBJECT:'*',"loadstone",place[4]
-OBJECT:'*',"ruby",place[5]
-OBJECT:'*',"worthless piece of red glass",place[5]
-OBJECT:'*',"luckstone",place[5]
+OBJECT:('*',"diamond"),$place[0]
+OBJECT:('*',"emerald"),$place[0]
+OBJECT:('*',"worthless piece of violet glass"),$place[0]
+MONSTER:'m', $place[0], m_object "luckstone"
+OBJECT:('*',"worthless piece of white glass"),$place[1]
+OBJECT:('*',"emerald"),$place[1]
+OBJECT:('*',"amethyst"),$place[1]
+MONSTER:'m', $place[1], m_object "loadstone"
+OBJECT:('*',"diamond"),$place[2]
+OBJECT:('*',"worthless piece of green glass"),$place[2]
+OBJECT:('*',"amethyst"),$place[2]
+MONSTER:'m', $place[2], m_object "flint"
+OBJECT:('*',"worthless piece of white glass"),$place[3]
+OBJECT:('*',"emerald"),$place[3]
+OBJECT:('*',"worthless piece of violet glass"),$place[3]
+MONSTER:'m', $place[3], m_object "touchstone"
+OBJECT:('*',"worthless piece of red glass"),$place[4]
+OBJECT:('*',"ruby"),$place[4]
+OBJECT:('*',"loadstone"),$place[4]
+OBJECT:('*',"ruby"),$place[5]
+OBJECT:('*',"worthless piece of red glass"),$place[5]
+OBJECT:('*',"luckstone"),$place[5]
 # Random objects
-OBJECT:'*',random,random
-OBJECT:'*',random,random
-OBJECT:'*',random,random
-OBJECT:'*',random,random
-OBJECT:'*',random,random
-OBJECT:'*',random,random
-OBJECT:'*',random,random
-OBJECT:'(',random,random
-OBJECT:'(',random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:'*',random
+OBJECT:'*',random
+OBJECT:'*',random
+OBJECT:'*',random
+OBJECT:'*',random
+OBJECT:'*',random
+OBJECT:'*',random
+OBJECT:'(',random
+OBJECT:'(',random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
 # Random traps
 TRAP:random,random
@@ -775,25 +1093,20 @@
 TRAP:random,random
 # Random monsters
-MONSTER:'G',"gnome king",random
-MONSTER:'G',"gnome lord",random
-MONSTER:'G',"gnome lord",random
-MONSTER:'G',"gnome lord",random
-MONSTER:'G',"gnomish wizard",random
-MONSTER:'G',"gnomish wizard",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'h',"hobbit",random
-MONSTER:'h',"hobbit",random
-MONSTER:'h',"dwarf",random
-MONSTER:'h',"dwarf",random
-MONSTER:'h',"dwarf",random
-MONSTER:'h',random,random
+MONSTER:('G',"gnome king"),random
+LOOP [2 + 1d4] {
+  MONSTER:('G',"gnome lord"),random
+}
+LOOP [1d4] {
+  MONSTER:('G',"gnomish wizard"),random
+}
+LOOP [5 + 1d8] {
+  MONSTER:('G',"gnome"),random
+}
+MONSTER:('h',"hobbit"),random
+MONSTER:('h',"hobbit"),random
+MONSTER:('h',"dwarf"),random
+MONSTER:('h',"dwarf"),random
+MONSTER:('h',"dwarf"),random
+MONSTER:'h',random
 
 
@@ -801,6 +1114,10 @@
 # "Gnome King's Wine Cellar"
 #
-MAZE: "minend-2", ' '
+LEVEL: "minend-2"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
+#         1         2         3         4         5         6         7
+#1234567890123456789012345678901234567890123456789012345678901234567890
 MAP
 ---------------------------------------------------------------------------
@@ -824,4 +1141,31 @@
 ENDMAP
 
+IF [50%] {
+   TERRAIN:(55,14),'-'
+   TERRAIN:(56,14),'-'
+   TERRAIN:(61,15),'|'
+   TERRAIN:(52,5), 'S'
+   DOOR:locked, (52,5)
+}
+
+IF [50%] {
+   TERRAIN:(18,1), '|'
+   TERRAIN:rect (7,12, 8,13), '.'
+}
+
+IF [50%] {
+   TERRAIN:(49,4), '|'
+   TERRAIN:(21,5), '.'
+}
+
+IF [50%] {
+   IF [50%] {
+      TERRAIN:(22,1), '|'
+   } ELSE {
+      TERRAIN:(50,7), '-'
+      TERRAIN:(51,7), '-'
+   }
+}
+
 # Dungeon Description
 FOUNTAIN:(14,13)
@@ -847,74 +1191,64 @@
 ENGRAVING:(12,03),engrave,"You are now entering the Gnome King's wine cellar."
 ENGRAVING:(12,04),engrave,"Trespassers will be persecuted!"
-OBJECT:'!',"booze",(10,07)
-OBJECT:'!',"booze",(10,07)
-OBJECT:'!',random,(10,07)
-OBJECT:'!',"booze",(10,08)
-OBJECT:'!',"booze",(10,08)
-OBJECT:'!',random,(10,08)
-OBJECT:'!',"booze",(10,09)
-OBJECT:'!',"booze",(10,09)
-OBJECT:'!',"object detection",(10,09)
+OBJECT:('!',"booze"),(10,07)
+OBJECT:('!',"booze"),(10,07)
+OBJECT:'!',(10,07)
+OBJECT:('!',"booze"),(10,08)
+OBJECT:('!',"booze"),(10,08)
+OBJECT:'!',(10,08)
+OBJECT:('!',"booze"),(10,09)
+OBJECT:('!',"booze"),(10,09)
+OBJECT:('!',"object detection"),(10,09)
 # Objects
 # The Treasure chamber...
-OBJECT:'*',"diamond",(69,04)
-OBJECT:'*',random,(69,04)
-OBJECT:'*',"diamond",(69,04)
-OBJECT:'*',random,(69,04)
-OBJECT:'*',"emerald",(70,04)
-OBJECT:'*',random,(70,04)
-OBJECT:'*',"emerald",(70,04)
-OBJECT:'*',random,(70,04)
-OBJECT:'*',"emerald",(69,05)
-OBJECT:'*',random,(69,05)
-OBJECT:'*',"ruby",(69,05)
-OBJECT:'*',random,(69,05)
-OBJECT:'*',"ruby",(70,05)
-OBJECT:'*',"amethyst",(70,05)
-OBJECT:'*',random,(70,05)
-OBJECT:'*',"amethyst",(70,05)
-OBJECT:'*',"luckstone",(70,05)
+OBJECT:('*',"diamond"),(69,04)
+OBJECT:'*',(69,04)
+OBJECT:('*',"diamond"),(69,04)
+OBJECT:'*',(69,04)
+OBJECT:('*',"emerald"),(70,04)
+OBJECT:'*',(70,04)
+OBJECT:('*',"emerald"),(70,04)
+OBJECT:'*',(70,04)
+OBJECT:('*',"emerald"),(69,05)
+OBJECT:'*',(69,05)
+OBJECT:('*',"ruby"),(69,05)
+OBJECT:'*',(69,05)
+OBJECT:('*',"ruby"),(70,05)
+OBJECT:('*',"amethyst"),(70,05)
+OBJECT:'*',(70,05)
+OBJECT:('*',"amethyst"),(70,05)
+OBJECT:('*',"luckstone"),(70,05)
 # Scattered gems...
-OBJECT:'*',random,random
-OBJECT:'*',random,random
-OBJECT:'*',random,random
-OBJECT:'*',random,random
-OBJECT:'*',random,random
-OBJECT:'*',random,random
-OBJECT:'*',random,random
-OBJECT:'(',random,random
-OBJECT:'(',random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+LOOP [2 + 1d8] {
+  OBJECT:'*',random
+}
+OBJECT:'(',random
+OBJECT:'(',random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
 # Random traps
+LOOP [4 + 1d8] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Random monsters.
-MONSTER:'G',"gnome king",random
-MONSTER:'G',"gnome lord",random
-MONSTER:'G',"gnome lord",random
-MONSTER:'G',"gnome lord",random
-MONSTER:'G',"gnomish wizard",random
-MONSTER:'G',"gnomish wizard",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'G',"gnome",random
-MONSTER:'h',"hobbit",random
-MONSTER:'h',"hobbit",random
-MONSTER:'h',"dwarf",random
-MONSTER:'h',"dwarf",random
-MONSTER:'h',"dwarf",random
-MONSTER:'h',random,random
+MONSTER:('G',"gnome king"),(10,09),hostile
+MONSTER:('G',"gnomish wizard"),(11,09),hostile
+MONSTER:('G',"gnome king"),random
+LOOP [1 + 1d3] {
+  MONSTER:('G',"gnome lord"),random
+}
+LOOP [1d4] {
+  MONSTER:('G',"gnomish wizard"),random
+}
+LOOP [5 + 3d4] {
+  MONSTER:('G',"gnome"),random
+}
+MONSTER:('h',"hobbit"),random
+MONSTER:('h',"hobbit"),random
+MONSTER:('h',"dwarf"),random
+MONSTER:('h',"dwarf"),random
+MONSTER:('h',"dwarf"),random
+MONSTER:'h',random
 
 
@@ -922,6 +1256,7 @@
 # Relies on some very specific behavior of MAZEWALK.
 #
-MAZE:"minend-3",'-'
-FLAGS:nommap
+LEVEL:"minend-3"
+FLAGS:nommap,mazelevel
+INIT_MAP:solidfill,'-'
 GEOMETRY:center,bottom
 MAP
@@ -945,5 +1280,6 @@
 ENDMAP
 
-RANDOM_PLACES:(1,15),(68,6),(1,13)
+$place = { (1,15),(68,6),(1,13) }
+SHUFFLE:$place
 NON_DIGGABLE:(67,3,73,7)
 NON_DIGGABLE:(0,12,2,16)
@@ -960,61 +1296,50 @@
 
 # Objects
-OBJECT:'*',"diamond",random
-OBJECT:'*',random,random
-OBJECT:'*',"diamond",random
-OBJECT:'*',random,random
-OBJECT:'*',"emerald",random
-OBJECT:'*',random,random
-OBJECT:'*',"emerald",random
-OBJECT:'*',random,random
-OBJECT:'*',"emerald",random
-OBJECT:'*',random,random
-OBJECT:'*',"ruby",random
-OBJECT:'*',random,random
-OBJECT:'*',"ruby",random
-OBJECT:'*',"amethyst",random
-OBJECT:'*',random,random
-OBJECT:'*',"amethyst",random
-OBJECT:'*',"luckstone",place[0]
-OBJECT:'*',"flint",place[1]
-OBJECT:'?',random,random
-OBJECT:'?',random,random
-OBJECT:'?',random,random
-OBJECT:'?',random,random
-OBJECT:'?',random,random
-OBJECT:'+',random,random
-OBJECT:'+',random,random
-OBJECT:'+',random,random
-OBJECT:'+',random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+OBJECT:('*',"diamond"),random
+OBJECT:'*',random
+OBJECT:('*',"diamond"),random
+OBJECT:'*',random
+OBJECT:('*',"emerald"),random
+OBJECT:'*',random
+OBJECT:('*',"emerald"),random
+OBJECT:'*',random
+OBJECT:('*',"emerald"),random
+OBJECT:'*',random
+OBJECT:('*',"ruby"),random
+OBJECT:'*',random
+OBJECT:('*',"ruby"),random
+OBJECT:('*',"amethyst"),random
+OBJECT:'*',random
+OBJECT:('*',"amethyst"),random
+OBJECT:('*',"luckstone"),$place[0]
+OBJECT:('*',"flint"),$place[1]
+LOOP [3d3] {
+  OBJECT:'?',random
+}
+LOOP [3d2] {
+  OBJECT:'+',random
+}
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+LOOP [2 + 3d3] {
 TRAP:random,random
+}
 # One-time annoyance factor
-TRAP:"level teleport",place[0]
-TRAP:"level teleport",place[1]
-MONSTER:'M',random,random
-MONSTER:'M',random,random
-MONSTER:'M',random,random
-MONSTER:'M',random,random
-MONSTER:'M',random,random
-MONSTER:'M',"ettin mummy",random
-MONSTER:'V',random,random
-MONSTER:'Z',random,random
-MONSTER:'Z',random,random
-MONSTER:'Z',random,random
-MONSTER:'Z',random,random
-MONSTER:'Z',random,random
-MONSTER:'V',random,random
-MONSTER:'e',random,random
-MONSTER:'e',random,random
-MONSTER:'e',random,random
-MONSTER:'e',random,random
+TRAP:"level teleport",$place[0]
+TRAP:"level teleport",$place[1]
+LOOP [2 + 3d3] {
+  MONSTER:'M',random
+}
+MONSTER:('M',"ettin mummy"),random
+MONSTER:'V',random
+MONSTER:'V',random
+LOOP [3 + 3d3] {
+  MONSTER:'Z',random
+}
+MONSTER:'e',random
+MONSTER:'e',random
+MONSTER:'e',random
+MONSTER:'e',random
 
 
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/Monk.des nethack/dat/Monk.des
--- nh_orig/dat/Monk.des	2003-12-07 18:39:12.000000000 -0500
+++ nethack/dat/Monk.des	2010-05-02 09:11:33.866715019 -0400
@@ -9,6 +9,8 @@
 #	and receive your quest assignment.
 #
-MAZE: "Mon-strt",' '
-FLAGS: noteleport,hardfloor
+LEVEL: "Mon-strt"
+FLAGS: noteleport,hardfloor,mazelevel
+INIT_MAP:solidfill,(' ', lit)
+MON_GENERATION:86%, (64,"earth elemental"), (16,'E'), (16,"xorn"), (4,'X')
 GEOMETRY:center,center
 MAP
@@ -20,10 +22,10 @@
 ....................|..------------..|--+-----+-----+--|....................
 ....................|..|..........|..|.................|....................
-....................|..|..........|..|+---+---+-----+--|....................
+....................|..|..........|..|+----------------|....................
 ..................---..|..........|......|...|...|.....|....................
 ..................+....|..........+......|...|...|.....|....................
 ..................+....|..........+......|...|...|.....|....................
 ..................---..|..........|......|...|...|.....|....................
-....................|..|..........|..|+-----+---+---+--|....................
+....................|..|..........|..|+----------------|....................
 ....................|..|..........|..|.................|....................
 ....................|..------------..|--+-----+-----+--|....................
@@ -37,5 +39,22 @@
 REGION:(00,00,75,19),lit,"ordinary"
 REGION:(24,06,33,13),lit,"temple"
+REGION:(42,08,44,11),lit,"ordinary",unfilled,true {
+  ROOMDOOR:false, closed, north|south|west|east, random
+  ROOMDOOR:false, locked, north|south|west|east, random
+}
+REGION:(46,08,48,11),lit,"ordinary",unfilled,true {
+  ROOMDOOR:false, closed, north|south|west|east, random
+  ROOMDOOR:false, locked, north|south|west|east, random
+}
+REGION:(50,08,54,11),lit,"ordinary",unfilled,true {
+  ROOMDOOR:false, closed, north|south|west, random
+  ROOMDOOR:false, locked, north|south|west, random
+}
+
+REPLACE_TERRAIN:(0,0,10,19),'.','T',10%
+REPLACE_TERRAIN:(65,0,75,19),'.','T',10%
+
 # Portal arrival point
+TERRAIN:(05,04),'.'
 BRANCH:(05,04,05,04),(0,0,0,0)
 # Stairs
@@ -50,11 +69,5 @@
 DOOR:closed,(52,05)
 DOOR:locked,(38,07)
-DOOR:closed,(42,07)
-DOOR:closed,(46,07)
-DOOR:closed,(52,07)
 DOOR:locked,(38,12)
-DOOR:closed,(44,12)
-DOOR:closed,(48,12)
-DOOR:closed,(52,12)
 DOOR:closed,(40,14)
 DOOR:closed,(46,14)
@@ -63,15 +76,38 @@
 ALTAR:(28,09),noalign,altar
 # The Grand Master
-MONSTER:'@',"Grand Master",(28,10)
+MONSTER:('@',"Grand Master"),(28,10) {
+  OBJECT:'?'
+  OBJECT:'?'
+  OBJECT:'?'
+  OBJECT:'?'
+  OBJECT:'?'
+  OBJECT:'?'
+}
 # No treasure chest!
 # guards for the audience chamber
-MONSTER:'@',"abbot",(32,07)
-MONSTER:'@',"abbot",(32,08)
-MONSTER:'@',"abbot",(32,11)
-MONSTER:'@',"abbot",(32,12)
-MONSTER:'@',"abbot",(33,07)
-MONSTER:'@',"abbot",(33,08)
-MONSTER:'@',"abbot",(33,11)
-MONSTER:'@',"abbot",(33,12)
+MONSTER:('@',"abbot"),(32,07) {
+  OBJECT[50%]:'?'
+}
+MONSTER:('@',"abbot"),(32,08) {
+  OBJECT[50%]:'?'
+}
+MONSTER:('@',"abbot"),(32,11) {
+  OBJECT[50%]:'?'
+}
+MONSTER:('@',"abbot"),(32,12) {
+  OBJECT[50%]:'?'
+}
+MONSTER:('@',"abbot"),(33,07) {
+  OBJECT[50%]:'?'
+}
+MONSTER:('@',"abbot"),(33,08) {
+  OBJECT[50%]:'?'
+}
+MONSTER:('@',"abbot"),(33,11) {
+  OBJECT[50%]:'?'
+}
+MONSTER:('@',"abbot"),(33,12) {
+  OBJECT[50%]:'?'
+}
 # Non diggable walls
 NON_DIGGABLE:(00,00,75,19)
@@ -84,16 +120,16 @@
 TRAP:random,random
 # Monsters on siege duty.
-MONSTER: 'E',"earth elemental",(37,01)
-MONSTER: 'E',"earth elemental",(37,18)
-MONSTER: 'E',"earth elemental",(03,03)
-MONSTER: 'E',"earth elemental",(65,04)
-MONSTER: 'E',"earth elemental",(12,11)
-MONSTER: 'E',"earth elemental",(60,12)
-MONSTER: 'E',"earth elemental",(14,08)
-MONSTER: 'E',"earth elemental",(55,00)
-MONSTER: 'X',"xorn",(18,18)
-MONSTER: 'X',"xorn",(59,10)
-MONSTER: 'X',"xorn",(13,09)
-MONSTER: 'X',"xorn",(01,17)
+MONSTER: ('E',"earth elemental"),(37,01)
+MONSTER: ('E',"earth elemental"),(37,18)
+MONSTER: ('E',"earth elemental"),(03,03)
+MONSTER: ('E',"earth elemental"),(65,04)
+MONSTER: ('E',"earth elemental"),(12,11)
+MONSTER: ('E',"earth elemental"),(60,12)
+MONSTER: ('E',"earth elemental"),(14,08)
+MONSTER: ('E',"earth elemental"),(55,00)
+MONSTER: ('X',"xorn"),(18,18)
+MONSTER: ('X',"xorn"),(59,10)
+MONSTER: ('X',"xorn"),(13,09)
+MONSTER: ('X',"xorn"),(01,17)
 
 #
@@ -104,5 +140,8 @@
 #
 
-MAZE: "Mon-loca",' '
+LEVEL: "Mon-loca"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"earth elemental"), (16,'E'), (16,"xorn"), (4,'X')
 GEOMETRY:center,center
 #         1         2         3         4         5         6         7 
@@ -132,5 +171,4 @@
 ENDMAP
 # Random Monsters
-RANDOM_MONSTERS: 'E', 'X'
 # Dungeon Description
 REGION:(00,00,75,20),lit,"ordinary"
@@ -141,50 +179,18 @@
 NON_DIGGABLE:(00,00,75,20)
 # Objects
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+LOOP [10 + 1d10] {
+OBJECT:random,random
+}
 # Random traps
+LOOP [3 + 2d3] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Random monsters.
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'X',"xorn",random
-MONSTER: 'X',"xorn",random
-MONSTER: 'X',"xorn",random
-MONSTER: 'X',"xorn",random
-MONSTER: 'X',"xorn",random
-MONSTER: 'X',"xorn",random
-MONSTER: 'X',"xorn",random
-MONSTER: 'X',"xorn",random
-MONSTER: 'X',"xorn",random
+LOOP [13 + 2d5] {
+  MONSTER: ('E',"earth elemental"),random
+}
+LOOP [8 + 1d6] {
+  MONSTER: ('X',"xorn"),random
+}
 
 #
@@ -196,6 +202,8 @@
 #
 
-MAZE: "Mon-goal", ' '
-INIT_MAP: 'L' , '.' , false , false , unlit , false
+LEVEL: "Mon-goal"
+FLAGS:mazelevel
+INIT_MAP: mines, 'L' , '.' , false , false , unlit , false
+MON_GENERATION:86%, (64,"earth elemental"), (16,'E'), (16,"xorn"), (4,'X')
 GEOMETRY:center,center
 MAP
@@ -213,52 +221,35 @@
 ENDMAP
 # Dungeon Description
-RANDOM_PLACES:(14,04),(13,07)
+$place = { (14,04),(13,07) }
+SHUFFLE:$place
 REGION:(00,00,25,10),unlit,"ordinary"
 # Stairs
 STAIR:(20,05),up
 # Objects
-OBJECT:'(',"lenses",place[0],blessed,0,"The Eyes of the Overworld"
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:('(',"lenses"),$place[0],blessed,0,NAME:"The Eyes of the Overworld"
+LOOP [10 + 1d10] {
+  OBJECT:random,random
+}
 # Random traps
+LOOP [3 + 1d3] {
 TRAP:"fire",random
-TRAP:"fire",random
-TRAP:"fire",random
-TRAP:"fire",random
+}
 TRAP:random,random
 TRAP:random,random
 # Random monsters.
-MONSTER:'@',"Master Kaen",place[0]
-ALTAR:place[0],noalign,altar
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'E',"earth elemental",random
-MONSTER: 'X',"xorn",random
-MONSTER: 'X',"xorn",random
-MONSTER: 'X',"xorn",random
-MONSTER: 'X',"xorn",random
-MONSTER: 'X',"xorn",random
-MONSTER: 'X',"xorn",random
-MONSTER: 'X',"xorn",random
-MONSTER: 'X',"xorn",random
-MONSTER: 'X',"xorn",random
+MONSTER:('@',"Master Kaen"),$place[0] {
+  OBJECT:('(', "Bell of Opening"),uncursed
+  OBJECT:')',1d4
+  OBJECT:'?'
+  OBJECT:'?'
+  OBJECT:'?'
+}
+ALTAR:$place[0],noalign,altar
+LOOP [10 + 1d6] {
+  MONSTER: ('E',"earth elemental"),random
+}
+LOOP [10 + 1d6] {
+  MONSTER: ('X',"xorn"),random
+}
 
 #
@@ -272,81 +263,105 @@
 
 LEVEL: "Mon-fila"
+MON_GENERATION:86%, (64,"earth elemental"), (16,'E'), (16,"xorn"), (4,'X')
 # Random Monsters
-RANDOM_MONSTERS: 'E', 'X'
 #
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, up
-OBJECT: random,random,random
-MONSTER: 'E', random, random, hostile
+OBJECT: random,random
+MONSTER: 'E', random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random,random,random
-MONSTER: 'E', random, random, hostile
+{
+OBJECT: random, random
+OBJECT: random, random
+MONSTER: 'E', random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
-OBJECT: random,random,random
-MONSTER: 'X', "xorn", random
-MONSTER: 'E', "earth elemental", random
+OBJECT: random, random
+MONSTER: ('X', "xorn"), random
+MONSTER: ('E', "earth elemental"), random
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, down
-OBJECT: random, random, random
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'E', random, random, hostile
-MONSTER: 'E', "earth elemental", random
+MONSTER: 'E', random, hostile
+MONSTER: ('E', "earth elemental"), random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'X', random, random, hostile
+MONSTER: 'X', random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'E', "earth elemental", random
+MONSTER: ('E', "earth elemental"), random
+}
 
 RANDOM_CORRIDORS
 
 LEVEL: "Mon-filb"
+MON_GENERATION:86%, (64,"earth elemental"), (16,'E'), (16,"xorn"), (4,'X')
 # Random Monsters
-RANDOM_MONSTERS: 'E', 'X'
 #
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, up
-OBJECT: random,random,random
-MONSTER: 'X', random, random, hostile
+OBJECT: random,random
+MONSTER: 'X', random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random,random,random
-MONSTER: 'X', random, random, hostile
+{
+OBJECT: random, random
+OBJECT: random, random
+MONSTER: 'X', random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
-OBJECT: random,random,random
-MONSTER: 'E', random, random, hostile
+OBJECT: random, random
+MONSTER: 'E', random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, down
-OBJECT: random, random, random
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'E', random, random, hostile
-MONSTER: 'E', "earth elemental", random
+MONSTER: 'E', random, hostile
+MONSTER: ('E', "earth elemental"), random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'X', random, random, hostile
+MONSTER: 'X', random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'E', "earth elemental", random
+MONSTER: ('E', "earth elemental"), random
+}
 
 RANDOM_CORRIDORS
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/opthelp nethack/dat/opthelp
--- nh_orig/dat/opthelp	2003-12-07 18:39:13.000000000 -0500
+++ nethack/dat/opthelp	2009-08-02 13:49:39.554408799 -0400
@@ -93,4 +93,7 @@
 disclose      the types of information you want offered at the end of the
               game  [ni na nv ng nc]
+dumpfile      the name of the file where to dump the disclosure information
+              when the game ends (only if the patch has been compiled in)
+              [none]
 fruit         the name of a fruit you enjoy eating  [slime mold]
               (basically a whimsy which NetHack uses from time to time).
@@ -121,4 +124,9 @@
               You choose a combination of top scores, scores around the top
               scores, and all of your own scores.  [!own/3 top/2 around]
+sortloot      controls the sortloot patch [none]:
+              full -- All pickup lists of items are sorted by item description
+              loot -- When inventory letters are shown, has no effect.
+                      Otherwise sorts by description
+              none -- Works the traditional way, like without the patch
 suppress_alert disable various version-specific warnings about changes
               in game play or the user interface, such as notification given
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/oracle.des nethack/dat/oracle.des
--- nh_orig/dat/oracle.des	2003-12-07 18:39:13.000000000 -0500
+++ nethack/dat/oracle.des	2010-04-11 12:36:58.149750771 -0400
@@ -8,49 +8,67 @@
 
 ROOM: "ordinary" , lit, (3,3), (center,center), (11,9)
-NAME: "central"
-OBJECT:'`',"statue",(0,0),"forest centaur",1
-OBJECT:'`',"statue",(0,8),"mountain centaur",1
-OBJECT:'`',"statue",(10,0),"mountain centaur",1
-OBJECT:'`',"statue",(10,8),"forest centaur",1
-OBJECT:'`',"statue",(5,1),"plains centaur",1
-OBJECT:'`',"statue",(5,7),"plains centaur",1
-OBJECT:'`',"statue",(2,4),"plains centaur",1
-OBJECT:'`',"statue",(8,4),"plains centaur",1
-MONSTER: random, random, random
-MONSTER: random, random, random
+{
 
-SUBROOM: "delphi" , lit , (4,3) , (3,3), "central"
+SUBROOM: "delphi" , lit , (4,3) , (3,3)
+{
 FOUNTAIN: (0, 1)
 FOUNTAIN: (1, 0)
 FOUNTAIN: (1, 2)
 FOUNTAIN: (2, 1)
-MONSTER: '@', "Oracle", (1,1)
-DOOR: false , nodoor , random, random
+MONSTER: ('@', "Oracle"), (1,1) {
+  OBJECT:'!'
+  OBJECT:'?'
+}
+ROOMDOOR: false , nodoor , random, random
+}
+
+OBJECT:('`',"statue"),(0,0),montype:'C',1
+OBJECT:('`',"statue"),(0,8),montype:'C',1
+OBJECT:('`',"statue"),(10,0),montype:'C',1
+OBJECT:('`',"statue"),(10,8),montype:'C',1
+OBJECT:('`',"statue"),(5,1),montype:'C',1
+OBJECT:('`',"statue"),(5,7),montype:'C',1
+OBJECT:('`',"statue"),(2,4),montype:'C',1
+OBJECT:('`',"statue"),(8,4),montype:'C',1
+MONSTER: random, random
+MONSTER: random, random
+
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, up
-OBJECT: random,random,random
+OBJECT: random,random
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, down
-OBJECT: random, random, random
+OBJECT: random, random
 TRAP: random, random
-MONSTER: random, random, random
-MONSTER: random, random, random
+MONSTER: random, random
+MONSTER: random, random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-MONSTER: random, random, random
+{
+OBJECT: random, random
+OBJECT: random, random
+MONSTER: random, random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
-MONSTER: random, random, random
+MONSTER: random, random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
-MONSTER: random, random, random
+MONSTER: random, random
+}
 
 RANDOM_CORRIDORS
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/Priest.des nethack/dat/Priest.des
--- nh_orig/dat/Priest.des	2003-12-07 18:39:12.000000000 -0500
+++ nethack/dat/Priest.des	2010-05-02 09:11:33.865714749 -0400
@@ -9,6 +9,11 @@
 #	and receive your quest assignment.
 #
-MAZE: "Pri-strt",' '
-FLAGS: noteleport,hardfloor
+# All Priest quest levels are explicitly marked as graveyards
+# so there's less chance for undead corpses.
+#
+LEVEL: "Pri-strt"
+FLAGS: noteleport,hardfloor,mazelevel,graveyard
+INIT_MAP:solidfill,('.',lit)
+MON_GENERATION:86%, (64,"human zombie"), (16,'Z'), (16,"wraith"), (4,'W')
 GEOMETRY:center,center
 MAP
@@ -20,10 +25,10 @@
 ....................|..------------..|--+-----+-----+--|....................
 ....................|..|..........|..|.................|....................
-....................|..|..........|..|+---+---+-----+--|....................
+....................|..|..........|..|+----------------|....................
 ..................---..|..........|......|...|...|.....|....................
 ..................+....|..........+......|...|...|.....|....................
 ..................+....|..........+......|...|...|.....|....................
 ..................---..|..........|......|...|...|.....|....................
-....................|..|..........|..|+-----+---+---+--|....................
+....................|..|..........|..|+----------------|....................
 ....................|..|..........|..|.................|....................
 ....................|..------------..|--+-----+-----+--|....................
@@ -37,5 +42,22 @@
 REGION:(00,00,75,19),lit,"ordinary"
 REGION:(24,06,33,13),lit,"temple"
+REGION:(42,08,44,11),lit,"ordinary",unfilled,true {
+  ROOMDOOR:false, closed, north|south|west|east, random
+  ROOMDOOR:false, locked, north|south|west|east, random
+}
+REGION:(46,08,48,11),lit,"ordinary",unfilled,true {
+  ROOMDOOR:false, closed, north|south|west|east, random
+  ROOMDOOR:false, locked, north|south|west|east, random
+}
+REGION:(50,08,54,11),lit,"ordinary",unfilled,true {
+  ROOMDOOR:false, closed, north|south|west, random
+  ROOMDOOR:false, locked, north|south|west, random
+}
+
+REPLACE_TERRAIN:(0,0,10,19),'.','T',10%
+REPLACE_TERRAIN:(65,0,75,19),'.','T',10%
+
 # Portal arrival point
+TERRAIN:(05,04),'.'
 BRANCH:(05,04,05,04),(0,0,0,0)
 # Stairs
@@ -50,11 +72,5 @@
 DOOR:closed,(52,05)
 DOOR:locked,(38,07)
-DOOR:closed,(42,07)
-DOOR:closed,(46,07)
-DOOR:closed,(52,07)
 DOOR:locked,(38,12)
-DOOR:closed,(44,12)
-DOOR:closed,(48,12)
-DOOR:closed,(52,12)
 DOOR:closed,(40,14)
 DOOR:closed,(46,14)
@@ -63,16 +79,40 @@
 ALTAR:(28,09),noalign,altar
 # High Priest
-MONSTER:'@',"Arch Priest",(28,10)
+MONSTER:('@',"Arch Priest"),(28,10) {
+  OBJECT:('[',"robe"),1d4
+  OBJECT:'?'
+  OBJECT:'?'
+  OBJECT:'?'
+  OBJECT:'?'
+  OBJECT:'+'
+  OBJECT:'+'
+}
 # The treasure of High Priest
-OBJECT:'(',"chest",(27,10)
+OBJECT:('(',"chest"),(27,10)
 # knight guards for the audience chamber
-MONSTER:'@',"acolyte",(32,07)
-MONSTER:'@',"acolyte",(32,08)
-MONSTER:'@',"acolyte",(32,11)
-MONSTER:'@',"acolyte",(32,12)
-MONSTER:'@',"acolyte",(33,07)
-MONSTER:'@',"acolyte",(33,08)
-MONSTER:'@',"acolyte",(33,11)
-MONSTER:'@',"acolyte",(33,12)
+MONSTER:('@',"acolyte"),(32,07) {
+  OBJECT:'?'
+}
+MONSTER:('@',"acolyte"),(32,08) {
+  OBJECT:'?'
+}
+MONSTER:('@',"acolyte"),(32,11) {
+  OBJECT:'?'
+}
+MONSTER:('@',"acolyte"),(32,12) {
+  OBJECT:'?'
+}
+MONSTER:('@',"acolyte"),(33,07) {
+  OBJECT:'?'
+}
+MONSTER:('@',"acolyte"),(33,08) {
+  OBJECT:'?'
+}
+MONSTER:('@',"acolyte"),(33,11) {
+  OBJECT:'?'
+}
+MONSTER:('@',"acolyte"),(33,12) {
+  OBJECT:'?'
+}
 # Non diggable walls
 NON_DIGGABLE:(00,00,75,19)
@@ -85,16 +125,16 @@
 TRAP:random,random
 # Monsters on siege duty.
-MONSTER: 'Z',"human zombie",(37,01)
-MONSTER: 'Z',"human zombie",(37,18)
-MONSTER: 'Z',"human zombie",(03,03)
-MONSTER: 'Z',"human zombie",(65,04)
-MONSTER: 'Z',"human zombie",(12,11)
-MONSTER: 'Z',"human zombie",(60,12)
-MONSTER: 'Z',"human zombie",(14,08)
-MONSTER: 'Z',"human zombie",(55,00)
-MONSTER: 'Z',"human zombie",(18,18)
-MONSTER: 'Z',"human zombie",(59,10)
-MONSTER: 'Z',"human zombie",(13,09)
-MONSTER: 'Z',"human zombie",(01,17)
+MONSTER: ('Z',"human zombie"),(37,01)
+MONSTER: ('Z',"human zombie"),(37,18)
+MONSTER: ('Z',"human zombie"),(03,03)
+MONSTER: ('Z',"human zombie"),(65,04)
+MONSTER: ('Z',"human zombie"),(12,11)
+MONSTER: ('Z',"human zombie"),(60,12)
+MONSTER: ('Z',"human zombie"),(14,08)
+MONSTER: ('Z',"human zombie"),(55,00)
+MONSTER: ('Z',"human zombie"),(18,18)
+MONSTER: ('Z',"human zombie"),(59,10)
+MONSTER: ('Z',"human zombie"),(13,09)
+MONSTER: ('Z',"human zombie"),(01,17)
 
 #
@@ -105,8 +145,8 @@
 #
 
-MAZE: "Pri-loca",' '
-FLAGS: hardfloor
-# This is a kludge to init the level as a lit field.
-INIT_MAP: '.' , '.' , false , false , lit , false
+LEVEL: "Pri-loca"
+FLAGS: hardfloor,mazelevel,graveyard
+INIT_MAP: solidfill, ('.', lit)
+MON_GENERATION:86%, (64,"human zombie"), (16,'Z'), (16,"wraith"), (4,'W')
 GEOMETRY:center,center
 MAP
@@ -134,5 +174,5 @@
 # The altar inside the temple
 ALTAR:(20,07),noalign,shrine
-MONSTER:'@',"aligned priest",(20,07),noalign,hostile
+MONSTER:('@',"aligned priest"),(20,07),noalign,hostile
 # Doors
 DOOR:locked,(10,06)
@@ -149,19 +189,19 @@
 NON_DIGGABLE:(10,02,30,13)
 # Objects (inside the antechambers).
-OBJECT:random,random,(14,03)
-OBJECT:random,random,(15,03)
-OBJECT:random,random,(16,03)
-OBJECT:random,random,(14,10)
-OBJECT:random,random,(15,10)
-OBJECT:random,random,(16,10)
-OBJECT:random,random,(17,10)
-OBJECT:random,random,(24,03)
-OBJECT:random,random,(25,03)
-OBJECT:random,random,(26,03)
-OBJECT:random,random,(27,03)
-OBJECT:random,random,(24,10)
-OBJECT:random,random,(25,10)
-OBJECT:random,random,(26,10)
-OBJECT:random,random,(27,10)
+OBJECT:random,(14,03)
+OBJECT:random,(15,03)
+OBJECT:random,(16,03)
+OBJECT:random,(14,10)
+OBJECT:random,(15,10)
+OBJECT:random,(16,10)
+OBJECT:random,(17,10)
+OBJECT:random,(24,03)
+OBJECT:random,(25,03)
+OBJECT:random,(26,03)
+OBJECT:random,(27,03)
+OBJECT:random,(24,10)
+OBJECT:random,(25,10)
+OBJECT:random,(26,10)
+OBJECT:random,(27,10)
 # Random traps
 TRAP:random,(15,04)
@@ -181,6 +221,8 @@
 #
 
-MAZE: "Pri-goal", ' '
-INIT_MAP: 'L' , '.' , false , false , unlit , false
+LEVEL: "Pri-goal"
+FLAGS:mazelevel,graveyard
+INIT_MAP: mines, 'L' , '.' , false , false , unlit , false
+MON_GENERATION:86%, (64,"human zombie"), (16,'Z'), (16,"wraith"), (4,'W')
 GEOMETRY:center,center
 MAP
@@ -198,24 +240,14 @@
 ENDMAP
 # Dungeon Description
-RANDOM_PLACES:(14,04),(13,07)
+$place = { (14,04),(13,07) }
+SHUFFLE: $place
 REGION:(00,00,25,10),unlit,"ordinary"
 # Stairs
 STAIR:(20,05),up
 # Objects
-OBJECT:'[',"helm of brilliance",place[0],blessed,0,"The Mitre of Holiness"
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:('[',"helm of brilliance"),$place[0],blessed,0,NAME:"The Mitre of Holiness"
+LOOP [10 + 1d6] {
+  OBJECT:random,random
+}
 # Random traps
 TRAP:"fire",random
@@ -226,32 +258,18 @@
 TRAP:random,random
 # Random monsters.
-MONSTER:'&',"Nalzok",place[0]
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',"human zombie",random
-MONSTER:'Z',random,random
-MONSTER:'Z',random,random
-MONSTER:'W',"wraith",random
-MONSTER:'W',"wraith",random
-MONSTER:'W',"wraith",random
-MONSTER:'W',"wraith",random
-MONSTER:'W',"wraith",random
-MONSTER:'W',"wraith",random
-MONSTER:'W',"wraith",random
-MONSTER:'W',"wraith",random
-MONSTER:'W',random,random
+MONSTER:('&',"Nalzok"),$place[0] {
+  OBJECT:('(', "Bell of Opening"),uncursed
+  OBJECT:')',1d6
+  OBJECT:'[',1d3
+}
+LOOP [15 + 2d5] {
+  MONSTER:('Z',"human zombie"),random
+}
+MONSTER:'Z',random
+MONSTER:'Z',random
+LOOP [4 + 2d4] {
+  MONSTER:('W',"wraith"),random
+}
+MONSTER:'W',random
 
 #
@@ -265,73 +283,101 @@
 
 LEVEL: "Pri-fila"
+FLAGS:graveyard
+MON_GENERATION:86%, (64,"human zombie"), (16,'Z'), (16,"wraith"), (4,'W')
 #
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, up
-OBJECT: random,random,random
-MONSTER: 'Z', "human zombie", random
+OBJECT: random,random
+MONSTER: ('Z', "human zombie"), random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random,random,random
+{
+OBJECT: random, random
+OBJECT: random,random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
-OBJECT: random,random,random
-MONSTER: 'Z', "human zombie", random
+OBJECT: random,random
+MONSTER: ('Z', "human zombie"), random
+}
 
 ROOM: "morgue" , random, random, random, random
+{
 STAIR: random, down
-OBJECT: random, random, random
+OBJECT: random, random
 TRAP: random, random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'W', "wraith", random
+MONSTER: ('W', "wraith"), random
+}
 
 ROOM: "morgue" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
+}
 
 RANDOM_CORRIDORS
 
 LEVEL: "Pri-filb"
+FLAGS:graveyard
+MON_GENERATION:86%, (64,"human zombie"), (16,'Z'), (16,"wraith"), (4,'W')
 #
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, up
-OBJECT: random,random,random
-MONSTER: 'Z', "human zombie", random
-MONSTER: 'W', "wraith", random
+OBJECT: random,random
+MONSTER: ('Z', "human zombie"), random
+MONSTER: ('W', "wraith"), random
+}
 
 ROOM: "morgue" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random,random,random
+{
+OBJECT: random, random
+OBJECT: random, random
+OBJECT: random,random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
-OBJECT: random,random,random
-MONSTER: 'Z', "human zombie", random
-MONSTER: 'W', "wraith", random
+OBJECT: random,random
+MONSTER: ('Z', "human zombie"), random
+MONSTER: ('W', "wraith"), random
+}
 
 ROOM: "morgue" , random, random, random, random
+{
 STAIR: random, down
-OBJECT: random, random, random
-OBJECT: random, random, random
+OBJECT: random, random
+OBJECT: random, random
 TRAP: random, random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'Z', "human zombie", random
-MONSTER: 'W', "wraith", random
+MONSTER: ('Z', "human zombie"), random
+MONSTER: ('W', "wraith"), random
+}
 
 ROOM: "morgue" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
+}
 
 RANDOM_CORRIDORS
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/quest.txt nethack/dat/quest.txt
--- nh_orig/dat/quest.txt	2003-12-07 18:39:13.000000000 -0500
+++ nethack/dat/quest.txt	2009-08-02 13:49:39.540409141 -0400
@@ -360,5 +360,5 @@
 "Pah!  You have betrayed the gods, %p.  You will never attain
 the glory which you aspire to.  Your failure to follow the true path has
-closed this future to you.
+closed that future to you.
 
 "I will protect these people as best I can, but soon %n will overcome
@@ -560,10 +560,10 @@
 #
 %Cc Cav 00001
-You descend through a barely familiar stairwell that you remember
+You walk through a barely familiar overgrown path that you remember
 %l showing you when you embarked upon your vision quest.
 
-You arrive back at %H, but something seems
-wrong here.  The usual smoke and glowing light of the fires of the
-outer caves are absent, and an uneasy quiet fills the damp air.
+You arrive back at %H, ... but something seems
+wrong here.  The jungle has a tense aura about it, and the beasts
+are snarling and hostile.  An uneasy quiet fills the damp air.
 %E
 %Cp Cav 00002
@@ -620,6 +620,5 @@
 %E
 %Cc Cav 00018
-"%pC!  You have sealed our fate.  You seem unable to reform yourself,
-so I must select another to take your place.
+"%pC!  You have sealed our fate by being unable to reform yourself.
 
 "Begone from %H!  You have betrayed us by choosing
@@ -640,5 +639,5 @@
 %Cc Cav 00020
 "%pC!  You have deviated from my teachings.  You no longer follow
-the path of the %a as you should.  I banish you from these caves, to
+the path of the %a as you should.  I banish you from this temple, to
 go forth and purify yourself.  Then, you might be able to accomplish this
 quest."
@@ -648,5 +647,5 @@
 great suffering among your people:
 
-"Shortly after you left on your vision quest, the caves were invaded by
+"Shortly after you left on your vision quest, the jungle was invaded by
 the creatures sent against us by %n.
 
@@ -655,10 +654,13 @@
 minions of %n managed to steal %o.
 They took it to %i and there, none of our
-%g warriors have been able to go.
+%g warriors have been able to go.  Worse, she has invoked its power
+against us, and now conflict ravages our once-peaceful jungle.
 
 "You must find %i, and within it wrest
 %o from %n.  She guards it as
 jealously as she guards all treasures she attains.  But with it,
-we can make our caves safe once more.
+we can make our jungle safe once more.  Without it, the spirit of the
+jungle cries out in pain, and the animals are crazed and attack all
+who pass near.
 
 "Please, %p, recover %o for us, and return it here."
@@ -699,10 +701,10 @@
 %E
 %Cc Cav 00035
-You %x many large claw marks on the ground.  The tunnels ahead
-of you are larger than most of those in any cave complex you have
-ever been in before.
+You %x many large claw marks on the ground.  Your brief respite 
+from the narrow jungle confines appears to be over... many paths lead
+into the trees in all directions, and stagnant pools cover the ground.
 
-Your nose detects the smell of carrion from within, and bones litter
-the sides of the tunnels.
+Your nose detects the smell of carrion from somewhere deep within, and
+unidentifiable, gnawed bones litter the nearby underbrush.
 %E
 %Cp Cav 00036
@@ -713,5 +715,5 @@
 nevertheless show signs of being scorched by fire.
 
-Bones litter the floor, and there are objects scattered everywhere.
+Bones cover the floor, and there are objects scattered everywhere.
 The air is close with the stench of sulphurous fumes.
 
@@ -784,4 +786,10 @@
     own.
 
+He takes it from your hands and does something you cannot see. You 
+feel the very trees relax as the magic-induced hatred melts away from
+the land.
+
+He returns it to you and says:
+
     To prevent further trouble, I would like you, %p,
     to take %o away with you.  It will help you as you
@@ -1149,13 +1157,13 @@
 far is a credit to thy valor, but thou art yet unprepared for
 the demands required as Our Champion.  %rA, no matter how
-pure, could never hope to defeat the foul %n.
+brave, could never hope to defeat the foul %n.
 
 "Journey forth from this place, and hone thy skills.  Return to
-Our presence when thou hast attained the noble title of %R."
+Our presence when thou hast attained the title of %R."
 %E
 %Cc Kni 00020
-"Thou dishonourest Us, %p!  Thou hast strayed from the path of
-chivalry! Go from Our presence and do penance.  Only when thou art again
-pure mayst thou return hence."
+"Thou dishonourest Us, %p!  Thou hast strayed from thine chosen 
+path!  Go from Our presence and do penance.  Only when thou 
+hast regained thy soul's direction mayst thou return hence."
 %E
 %Cc Kni 00021
@@ -2139,8 +2147,6 @@
 "Well %gp, it looks like our friend has forgotten who is the boss
 around here.  Our friend seems to think that %rp have been put in
-charge.  Wrong.  DEAD WRONG!"
+charge.  Wrong.  DEAD wrong, in fact..."
 
-Your sudden shift in surroundings prevents you from hearing the end
-of %ls curse.
 %E
 %Cc Rog 00019
@@ -2885,6 +2891,6 @@
 %Cc Val 00018
 "No, %p.  Your fate is sealed.  I must cast about for another
-champion.  Begone from my presence, and never return.  Know this, that
-you shall never succeed in this life, and Valhalla is denied to you."
+champion.  Begone from my presence, and never return.  Know that
+Valhalla shall be denied to you."
 %E
 %Cc Val 00019
@@ -3463,10 +3469,9 @@
 have done.
 
-Leave this place.  You shall never set foot at %H again.
-That which you seek is now lost forever, for without the Bell of Opening, 
-you will never be able to enter the place where he who has the Amulet 
-resides.
+Leave this place. You shall never set foot beyond %H again as long as I
+draw breath... and without the Bell of Opening, you will never be able to 
+enter the place where he who has the Amulet resides.
 
-Go now!  You are banished from this place.
+Begone from my sight!"
 %E
 #
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/Ranger.des nethack/dat/Ranger.des
--- nh_orig/dat/Ranger.des	2003-12-07 18:39:12.000000000 -0500
+++ nethack/dat/Ranger.des	2010-08-16 13:20:13.633706782 -0400
@@ -9,12 +9,14 @@
 #	and receive your quest assignment.
 #
-MAZE: "Ran-strt",'.'
-FLAGS: noteleport,hardfloor,arboreal
-INIT_MAP:'.','.',true,true,lit,false
-GEOMETRY:left,center
+LEVEL: "Ran-strt"
+FLAGS: noteleport,hardfloor,arboreal,mazelevel
+INIT_MAP:mines,'.','.',true,true,lit,false
+REPLACE_TERRAIN:(0,0,76,19),'.', 'T', 5%
+MON_GENERATION:86%, (64,"forest centaur"), (16,'C'), (16,"scorpion"), (4,'s')
+GEOMETRY:(0,1)
 #1234567890123456789012345678901234567890123456789012345678901234567890
 MAP
-                                       ..
-   ...................................  .
+                                       xx
+   ...................................  x
   ..                                 ..  
  ..  ...............F...............  .. 
@@ -34,6 +36,6 @@
  ..  ...............F...............  .. 
   ..                                 ..  
-   ...................................  .
-                                       ..
+   ...................................  x
+                                       xx
 ENDMAP
 # Dungeon Description
@@ -44,16 +46,56 @@
 BRANCH:levregion(51,2,77,18),(0,0,40,20)
 # Orion
-MONSTER:'@',"Orion",(20,10)
+MONSTER:('@',"Orion"),(20,10) {
+  OBJECT:('[',"leather armor"),1d4
+  OBJECT:(')',"yumi"),1d4
+  OBJECT:(')',"arrow"),1d4,quantity:10d5
+}
 # The treasure of Orion
-OBJECT:'(',"chest",(20,10)
+OBJECT:('(',"chest"),(20,10)
 # Guards for the audience chamber
-MONSTER:'@',"hunter",(19,09)
-MONSTER:'@',"hunter",(20,09)
-MONSTER:'@',"hunter",(21,09)
-MONSTER:'@',"hunter",(19,10)
-MONSTER:'@',"hunter",(21,10)
-MONSTER:'@',"hunter",(19,11)
-MONSTER:'@',"hunter",(20,11)
-MONSTER:'@',"hunter",(21,11)
+MONSTER:('@',"hunter"),(19,09) {
+  OBJECT[25%]:('[',"leather armor")
+  IF [50%] {
+    OBJECT:(')',"bow")
+    OBJECT:(')',"arrow")
+  }
+  OBJECT[15%]:')'
+}
+MONSTER:('@',"hunter"),(20,09) {
+  OBJECT[25%]:('[',"leather armor")
+  IF [50%] {
+    OBJECT:(')',"bow")
+    OBJECT:(')',"arrow")
+  }
+  OBJECT[15%]:')'
+}
+MONSTER:('@',"hunter"),(21,09) {
+  OBJECT[25%]:('[',"leather armor")
+  IF [50%] {
+    OBJECT:(')',"bow")
+    OBJECT:(')',"arrow")
+  }
+  OBJECT[15%]:')'
+}
+MONSTER:('@',"hunter"),(19,10) {
+  OBJECT[25%]:('[',"leather armor")
+  OBJECT[15%]:')'
+}
+MONSTER:('@',"hunter"),(21,10) {
+  OBJECT[25%]:('[',"leather armor")
+  OBJECT[15%]:')'
+}
+MONSTER:('@',"hunter"),(19,11) {
+  OBJECT[25%]:('[',"leather armor")
+  OBJECT[15%]:')'
+}
+MONSTER:('@',"hunter"),(20,11) {
+  OBJECT[25%]:('[',"leather armor")
+  OBJECT[15%]:')'
+}
+MONSTER:('@',"hunter"),(21,11) {
+  OBJECT[25%]:('[',"leather armor")
+  OBJECT[15%]:')'
+}
 # Non diggable walls
 NON_DIGGABLE:(00,00,40,20)
@@ -66,31 +108,28 @@
 TRAP:"bear",random
 # Monsters on siege duty.
-MONSTER: 'H',"minotaur",(33,09),hostile,asleep
-MONSTER: 'C',"forest centaur",(19,03),hostile
-MONSTER: 'C',"forest centaur",(19,04),hostile
-MONSTER: 'C',"forest centaur",(19,05),hostile
-MONSTER: 'C',"forest centaur",(21,03),hostile
-MONSTER: 'C',"forest centaur",(21,04),hostile
-MONSTER: 'C',"forest centaur",(21,05),hostile
-MONSTER: 'C',"forest centaur",(01,09),hostile
-MONSTER: 'C',"forest centaur",(02,09),hostile
-MONSTER: 'C',"forest centaur",(03,09),hostile
-MONSTER: 'C',"forest centaur",(01,11),hostile
-MONSTER: 'C',"forest centaur",(02,11),hostile
-MONSTER: 'C',"forest centaur",(03,11),hostile
-MONSTER: 'C',"forest centaur",(19,15),hostile
-MONSTER: 'C',"forest centaur",(19,16),hostile
-MONSTER: 'C',"forest centaur",(19,17),hostile
-MONSTER: 'C',"forest centaur",(21,15),hostile
-MONSTER: 'C',"forest centaur",(21,16),hostile
-MONSTER: 'C',"forest centaur",(21,17),hostile
-MONSTER: 'C',"plains centaur",random,hostile
-MONSTER: 'C',"plains centaur",random,hostile
-MONSTER: 'C',"plains centaur",random,hostile
-MONSTER: 'C',"plains centaur",random,hostile
-MONSTER: 'C',"plains centaur",random,hostile
-MONSTER: 'C',"plains centaur",random,hostile
-MONSTER: 's',"scorpion",random,hostile
-MONSTER: 's',"scorpion",random,hostile
+MONSTER: ('H',"minotaur"),(33,09),hostile,asleep
+MONSTER: ('C',"forest centaur"),(19,03),hostile
+MONSTER: ('C',"forest centaur"),(19,04),hostile
+MONSTER: ('C',"forest centaur"),(19,05),hostile
+MONSTER: ('C',"forest centaur"),(21,03),hostile
+MONSTER: ('C',"forest centaur"),(21,04),hostile
+MONSTER: ('C',"forest centaur"),(21,05),hostile
+MONSTER: ('C',"forest centaur"),(01,09),hostile
+MONSTER: ('C',"forest centaur"),(02,09),hostile
+MONSTER: ('C',"forest centaur"),(03,09),hostile
+MONSTER: ('C',"forest centaur"),(01,11),hostile
+MONSTER: ('C',"forest centaur"),(02,11),hostile
+MONSTER: ('C',"forest centaur"),(03,11),hostile
+MONSTER: ('C',"forest centaur"),(19,15),hostile
+MONSTER: ('C',"forest centaur"),(19,16),hostile
+MONSTER: ('C',"forest centaur"),(19,17),hostile
+MONSTER: ('C',"forest centaur"),(21,15),hostile
+MONSTER: ('C',"forest centaur"),(21,16),hostile
+MONSTER: ('C',"forest centaur"),(21,17),hostile
+LOOP [4 + 2d5] {
+  MONSTER: ('C',"plains centaur"),random,hostile
+}
+MONSTER: ('s',"scorpion"),random,hostile
+MONSTER: ('s',"scorpion"),random,hostile
 
 
@@ -102,6 +141,8 @@
 #
 
-MAZE: "Ran-loca",' '
-FLAGS: hardfloor
+LEVEL: "Ran-loca"
+FLAGS: hardfloor,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"forest centaur"), (16,'C'), (16,"scorpion"), (4,'s')
 GEOMETRY:center,center
 #1234567890123456789012345678901234567890123456789012345678901234567890
@@ -136,12 +177,12 @@
 NON_DIGGABLE:(00,00,54,19)
 # Objects
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
+OBJECT:random,random
 # Random traps
 TRAP:"spiked pit",random
@@ -152,27 +193,14 @@
 TRAP:"arrow",random
 # Random monsters.
-MONSTER:'q',"wumpus",(27,18),hostile,asleep
-MONSTER:'B',"giant bat",random,hostile
-MONSTER:'B',"giant bat",random,hostile
-MONSTER:'B',"giant bat",random,hostile
-MONSTER:'B',"giant bat",random,hostile
-MONSTER:'C',"forest centaur",random,hostile
-MONSTER:'C',"forest centaur",random,hostile
-MONSTER:'C',"forest centaur",random,hostile
-MONSTER:'C',"forest centaur",random,hostile
-MONSTER:'C',"mountain centaur",random,hostile
-MONSTER:'C',"mountain centaur",random,hostile
-MONSTER:'C',"mountain centaur",random,hostile
-MONSTER:'C',"mountain centaur",random,hostile
-MONSTER:'C',"mountain centaur",random,hostile
-MONSTER:'C',"mountain centaur",random,hostile
-MONSTER:'C',"mountain centaur",random,hostile
-MONSTER:'C',"mountain centaur",random,hostile
-MONSTER:'s',"scorpion",random,hostile
-MONSTER:'s',"scorpion",random,hostile
-MONSTER:'s',"scorpion",random,hostile
-MONSTER:'s',"scorpion",random,hostile
-MONSTER:'s',random,random,hostile
-MONSTER:'s',random,random,hostile
+MONSTER:('q',"wumpus"),(27,18),hostile,asleep
+LOOP [2 + 1d6] {
+  MONSTER:('B',"giant bat"),random,hostile
+  MONSTER:('C',"forest centaur"),random,hostile
+  MONSTER:('s',"scorpion"),random,hostile
+  MONSTER:('C',"mountain centaur"),random,hostile
+  MONSTER:('C',"mountain centaur"),random,hostile
+}
+MONSTER:'s',random,hostile
+MONSTER:'s',random,hostile
 
 
@@ -185,5 +213,8 @@
 #
 
-MAZE: "Ran-goal", ' '
+LEVEL: "Ran-goal"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"forest centaur"), (16,'C'), (16,"scorpion"), (4,'s')
 GEOMETRY:center,center
 MAP
@@ -198,5 +229,5 @@
    .        S          .         .........   .S.    .S...............   .   
    .  ...   .     ...  .         .........          .                   .   
-   . ........    .....S.+.......+....\....+........+.                   .   
+   . ........    .....S.+.......+.........+........+.                   .   
    .  ...         ...    S       .........           ..      .....      .   
    .                    ..       .........            ..      ......    .   
@@ -216,26 +247,22 @@
 NON_DIGGABLE:(00,00,75,19)
 # Objects
-OBJECT:')',"bow",(37,10),blessed,0,"The Longbow of Diana"
-OBJECT:'(',"chest",(37,10)
-OBJECT:random,random,(36,09)
-OBJECT:random,random,(36,10)
-OBJECT:random,random,(36,11)
-OBJECT:random,random,(37,09)
-OBJECT:random,random,(37,11)
-OBJECT:random,random,(38,09)
-OBJECT:random,random,(38,10)
-OBJECT:random,random,(38,11)
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:('\',"throne"),(37,10)
+OBJECT:(')',"bow"),(37,10),blessed,0,NAME:"The Longbow of Diana"
+OBJECT:('(',"chest"),(37,10)
+OBJECT:random,(36,09)
+OBJECT:random,(36,10)
+OBJECT:random,(36,11)
+OBJECT:random,(37,09)
+OBJECT:random,(37,11)
+OBJECT:random,(38,09)
+OBJECT:random,(38,10)
+OBJECT:random,(38,11)
+LOOP [3 + 1d3] {
+  OBJECT:random,random
+}
 # Random traps
+LOOP [4 + 1d5] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # doors
 DOOR:locked,(12,08)
@@ -254,32 +281,38 @@
 DOOR:closed,(65,05)
 # Random monsters.
-MONSTER:'s',"Scorpius",(37,10),hostile
-MONSTER:'C',"forest centaur",(36,09),hostile
-MONSTER:'C',"forest centaur",(36,10),hostile
-MONSTER:'C',"forest centaur",(36,11),hostile
-MONSTER:'C',"forest centaur",(37,09),hostile
-MONSTER:'C',"forest centaur",(37,11),hostile
-MONSTER:'C',"forest centaur",(38,09),hostile
-MONSTER:'C',"mountain centaur",(38,10),hostile
-MONSTER:'C',"mountain centaur",(38,11),hostile
-MONSTER:'C',"mountain centaur",(02,02),hostile
-MONSTER:'C',"mountain centaur",(71,02),hostile
-MONSTER:'C',"mountain centaur",(02,16),hostile
-MONSTER:'C',"mountain centaur",(71,16),hostile
-MONSTER:'C',"forest centaur",random,hostile
-MONSTER:'C',"forest centaur",random,hostile
-MONSTER:'C',"mountain centaur",random,hostile
-MONSTER:'C',"mountain centaur",random,hostile
-MONSTER:'C',random,random,hostile
-MONSTER:'C',random,random,hostile
-MONSTER:'s',"scorpion",(03,02),hostile
-MONSTER:'s',"scorpion",(72,02),hostile
-MONSTER:'s',"scorpion",(03,17),hostile
-MONSTER:'s',"scorpion",(72,17),hostile
-MONSTER:'s',"scorpion",(41,10),hostile
-MONSTER:'s',"scorpion",(33,09),hostile
-MONSTER:'s',"scorpion",random,hostile
-MONSTER:'s',"scorpion",random,hostile
-MONSTER:'s',random,random,hostile
+MONSTER:('s',"Scorpius"),(37,10),hostile {
+  OBJECT:('(', "Bell of Opening"),uncursed
+  OBJECT:random
+  OBJECT:random
+  OBJECT:random
+  OBJECT:random
+  OBJECT:random
+  OBJECT:random
+}
+MONSTER:('C',"forest centaur"),(36,09),hostile
+MONSTER:('C',"forest centaur"),(36,10),hostile
+MONSTER:('C',"forest centaur"),(36,11),hostile
+MONSTER:('C',"forest centaur"),(37,09),hostile
+MONSTER:('C',"forest centaur"),(37,11),hostile
+MONSTER:('C',"forest centaur"),(38,09),hostile
+MONSTER:('C',"mountain centaur"),(38,10),hostile
+MONSTER:('C',"mountain centaur"),(38,11),hostile
+MONSTER:('C',"mountain centaur"),(02,02),hostile
+MONSTER:('C',"mountain centaur"),(71,02),hostile
+MONSTER:('C',"mountain centaur"),(02,16),hostile
+MONSTER:('C',"mountain centaur"),(71,16),hostile
+MONSTER:('s',"scorpion"),(03,02),hostile
+MONSTER:('s',"scorpion"),(72,02),hostile
+MONSTER:('s',"scorpion"),(03,17),hostile
+MONSTER:('s',"scorpion"),(72,17),hostile
+MONSTER:('s',"scorpion"),(41,10),hostile
+MONSTER:('s',"scorpion"),(33,09),hostile
+LOOP [2 + 1d5] {
+  MONSTER:('C',"forest centaur"),random,hostile
+  MONSTER:('C',"mountain centaur"),random,hostile
+  MONSTER:'C',random,hostile
+  MONSTER:('s',"scorpion"),random,hostile
+  MONSTER:'s',random,hostile
+}
 
 WALLIFY
@@ -294,6 +327,8 @@
 #
 
-MAZE: "Ran-fila" , ' '
-INIT_MAP: '.' , 'T', true, true, random, true
+LEVEL: "Ran-fila"
+FLAGS:mazelevel,noflip
+INIT_MAP: mines, '.' , 'T', true, true, random, true
+MON_GENERATION:86%, (64,"forest centaur"), (16,'C'), (16,"scorpion"), (4,'s')
 NOMAP
 #
@@ -301,27 +336,23 @@
 STAIR: random, down
 #
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+LOOP [5 + 1d5] {
+  OBJECT: random, random
+}
 #
+LOOP [3 + 1d4] {
 TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
+}
 #
-MONSTER: 'C', "mountain centaur", random, hostile
-MONSTER: 'C', "mountain centaur", random, hostile
-MONSTER: 'C', "forest centaur", random, hostile
-MONSTER: 'C', "forest centaur", random, hostile
-MONSTER: 'C', "forest centaur", random, hostile
-MONSTER: 'C', random, random, hostile
-MONSTER: 's', "scorpion", random, hostile
+LOOP [2 + 1d4] {
+  MONSTER: ('C', "mountain centaur"), random, hostile
+  MONSTER: ('C', "forest centaur"), random, hostile
+}
+MONSTER: 'C', random, hostile
+MONSTER: ('s', "scorpion"), random, hostile
 
-MAZE: "Ran-filb" , ' '
-INIT_MAP: '.' , ' ', true, true, random, true
+LEVEL: "Ran-filb"
+FLAGS:mazelevel,noflip
+INIT_MAP: mines, '.' , ' ', true, true, random, true
+MON_GENERATION:86%, (64,"forest centaur"), (16,'C'), (16,"scorpion"), (4,'s')
 NOMAP
 #
@@ -329,27 +360,16 @@
 STAIR: random, down
 #
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+LOOP [9 + 1d5] {
+  OBJECT: random, random
+}
 #
+LOOP [2 + 1d5] {
 TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
+}
 #
-MONSTER: 'C', "mountain centaur", random, hostile
-MONSTER: 'C', "mountain centaur", random, hostile
-MONSTER: 'C', "mountain centaur", random, hostile
-MONSTER: 'C', "mountain centaur", random, hostile
-MONSTER: 'C', random, random, hostile
-MONSTER: 's', "scorpion", random, hostile
-MONSTER: 's', "scorpion", random, hostile
+LOOP [3 + 1d5] {
+  MONSTER: ('C', "mountain centaur"), random, hostile
+  MONSTER: 'C', random, hostile
+  MONSTER: ('s', "scorpion"), random, hostile
+}
 
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/Rogue.des nethack/dat/Rogue.des
--- nh_orig/dat/Rogue.des	2003-12-07 18:39:12.000000000 -0500
+++ nethack/dat/Rogue.des	2010-04-29 10:53:24.166715096 -0400
@@ -8,6 +8,8 @@
 #	and receive your quest assignment.
 #
-MAZE: "Rog-strt",' '
-FLAGS: noteleport, hardfloor, nommap
+LEVEL: "Rog-strt"
+FLAGS: noteleport, hardfloor, nommap, mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"leprechaun"), (16,'n'), (16,"guardian naga"), (4,'N')
 GEOMETRY:center,center
 #         1         2         3         4         5         6         7
@@ -40,9 +42,13 @@
 # The down stairs is at one of the 4 "exits".  The others are mimics,
 # mimicing stairwells.
-RANDOM_PLACES: (33,0), (0,12), (25,20), (75,05)
-STAIR:place[0],down
-MONSTER:'m',"giant mimic", place[1], m_feature "staircase down"
-MONSTER:'m',"large mimic", place[2], m_feature "staircase down"
-MONSTER:'m',"small mimic", place[3], m_feature "staircase down"
+
+$streets = selection: floodfill(0,12)
+
+$place = { (33,0), (0,12), (25,20), (75,05) }
+SHUFFLE: $place
+STAIR:$place[0],down
+MONSTER:('m',"giant mimic"), $place[1], m_feature "staircase down"
+MONSTER:('m',"large mimic"), $place[2], m_feature "staircase down"
+MONSTER:('m',"small mimic"), $place[3], m_feature "staircase down"
 # Portal arrival point
 BRANCH:(19,09,19,09),(0,0,0,0)
@@ -97,73 +103,87 @@
 DOOR: closed, (68,18)
 # Master of Thieves
-MONSTER:'@',"Master of Thieves",(36,11)
+MONSTER:('@',"Master of Thieves"),(36,11) {
+  OBJECT:'['
+  OBJECT:')'
+  OBJECT:'!'
+  OBJECT:'!'
+  OBJECT:'!'
+  OBJECT:'!'
+}
 # The treasure of Master of Thieves
-OBJECT:'(',"chest",(36,11)
+OBJECT:('(',"chest"),(36,11)
 # thug guards, room #1
-MONSTER:'@',"thug",(28,10)
-MONSTER:'@',"thug",(29,11)
-MONSTER:'@',"thug",(30,09)
-MONSTER:'@',"thug",(31,07)
+MONSTER:('@',"thug"),(28,10) {
+  OBJECT[15%]:'['
+  OBJECT[15%]:')'
+}
+MONSTER:('@',"thug"),(29,11) {
+  OBJECT[15%]:'['
+  OBJECT[15%]:')'
+}
+MONSTER:('@',"thug"),(30,09) {
+  OBJECT[15%]:'['
+  OBJECT[15%]:')'
+}
+MONSTER:('@',"thug"),(31,07) {
+  OBJECT[15%]:'['
+  OBJECT[15%]:')'
+}
 # thug guards, room #2
-MONSTER:'@',"thug",(31,13)
-MONSTER:'@',"thug",(33,14)
-MONSTER:'@',"thug",(30,15)
+MONSTER:('@',"thug"),(31,13) {
+  OBJECT[15%]:'['
+  OBJECT[15%]:')'
+}
+MONSTER:('@',"thug"),(33,14) {
+  OBJECT[15%]:'['
+  OBJECT[15%]:')'
+}
+MONSTER:('@',"thug"),(30,15) {
+  OBJECT[15%]:'['
+  OBJECT[15%]:')'
+}
 #thug guards, room #3
-MONSTER:'@',"thug",(35,09)
-MONSTER:'@',"thug",(36,13)
+MONSTER:('@',"thug"),(35,09) {
+  OBJECT[15%]:'['
+  OBJECT[15%]:')'
+}
+MONSTER:('@',"thug"),(36,13) {
+  OBJECT[15%]:'['
+  OBJECT[15%]:')'
+}
 # Non diggable walls
 NON_DIGGABLE:(00,00,75,20)
 # Random traps
+LOOP [15 + 1d10] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 #
 # Monsters to get in the way.
 #
 # West exit
-MONSTER: 'l',"leprechaun",(01,12),hostile
-MONSTER: 'n',"water nymph",(02,12),hostile
+MONSTER: ('l',"leprechaun"),(01,12),hostile
+MONSTER: ('n',"water nymph"),(02,12),hostile
 # North exit
-MONSTER: 'n',"water nymph",(33,01),hostile
-MONSTER: 'l',"leprechaun",(33,02),hostile
+MONSTER: ('n',"water nymph"),(33,01),hostile
+MONSTER: ('l',"leprechaun"),(33,02),hostile
 # East exit
-MONSTER: 'n',"water nymph",(74,05),hostile
-MONSTER: 'l',"leprechaun",(74,04),hostile
+MONSTER: ('n',"water nymph"),(74,05),hostile
+MONSTER: ('l',"leprechaun"),(74,04),hostile
 # South exit
-MONSTER: 'l',"leprechaun",(25,19),hostile
-MONSTER: 'n',"water nymph",(25,18),hostile
-# Wandering the streets.  What I'd really like for this is a random
-# location, but make sure we're on a given type, e.g. street (if they
-# existed, of course).
-MONSTER: 'n',"water nymph",(07,05),hostile
-MONSTER: 'l',"leprechaun",(28,06),hostile
-MONSTER: 'n',"water nymph",(38,07),hostile
-MONSTER: 'l',"leprechaun",(45,01),hostile
-MONSTER: 'n',"water nymph",(59,07),hostile
-MONSTER: 'l',"leprechaun",(62,14),hostile
-MONSTER: 'n',"water nymph",(71,14),hostile
-MONSTER: 'l',"leprechaun",(39,13),hostile
-MONSTER: 'n',"water nymph",(18,14),hostile
-MONSTER: ':',"chameleon",(19,08),hostile
-MONSTER: ':',"chameleon",(22,08),hostile
-MONSTER: ':',"chameleon",(16,08),hostile
-MONSTER: ':',"chameleon",random,hostile
-MONSTER: ':',"chameleon",random,hostile
-MONSTER: ':',"chameleon",random,hostile
-MONSTER: ':',"chameleon",random,hostile
-MONSTER: ':',"chameleon",random,hostile
+MONSTER: ('l',"leprechaun"),(25,19),hostile
+MONSTER: ('n',"water nymph"),(25,18),hostile
+# Wandering the streets.
+LOOP [3 + 2d2] {
+  MONSTER: ('n',"water nymph"),rndcoord($streets),hostile
+}
+LOOP [1 + 2d2] {
+  MONSTER: ('l',"leprechaun"),rndcoord($streets),hostile
+}
+LOOP [2d2] {
+  MONSTER: (':',"chameleon"),rndcoord($streets),hostile
+}
+LOOP [3 + 1d7] {
+  MONSTER: (':',"chameleon"),rndcoord($streets),hostile
+}
 
 #
@@ -174,5 +194,8 @@
 #
 
-MAZE: "Rog-loca",' '
+LEVEL: "Rog-loca"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"leprechaun"), (16,'n'), (16,"guardian naga"), (4,'N')
 GEOMETRY:center,center
 #         1         2         3         4         5         6         7
@@ -211,60 +234,26 @@
 NON_DIGGABLE:(00,00,75,20)
 # Objects
-OBJECT:'?',"teleportation",(11,18),cursed,0
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:('?',"teleportation"),(11,18),cursed,0
+LOOP [10 + 1d6] {
+  OBJECT:random,random
+}
 # Random traps
+LOOP [ 5 + 1d6] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Random monsters.
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',random,random,hostile
-MONSTER:'N',"guardian naga",random,hostile
-MONSTER:'N',"guardian naga",random,hostile
-MONSTER:'N',"guardian naga",random,hostile
-MONSTER:'N',"guardian naga",random,hostile
-MONSTER:'N',"guardian naga",random,hostile
-MONSTER:'N',"guardian naga",random,hostile
-MONSTER:'N',"guardian naga",random,hostile
-MONSTER:'N',random,random,hostile
-MONSTER:'N',random,random,hostile
-MONSTER:'N',random,random,hostile
-MONSTER: ':',"chameleon",random,hostile
-MONSTER: ':',"chameleon",random,hostile
-MONSTER: ':',"chameleon",random,hostile
-MONSTER: ':',"chameleon",random,hostile
-MONSTER: ':',"chameleon",random,hostile
+LOOP [15 + 2d6] {
+  MONSTER:('l',"leprechaun"),random,hostile
+}
+MONSTER:'l',random,hostile
+LOOP [5 + 1d6] {
+  MONSTER:('N',"guardian naga"),random,hostile
+}
+MONSTER:'N',random,hostile
+MONSTER:'N',random,hostile
+MONSTER:'N',random,hostile
+LOOP [4 + 1d3] {
+  MONSTER: (':',"chameleon"),random,hostile
+}
 
 #
@@ -276,6 +265,8 @@
 #	arrival point and his location.
 #
-MAZE: "Rog-goal", ' '
-FLAGS: noteleport
+LEVEL: "Rog-goal"
+FLAGS: noteleport,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"leprechaun"), (16,'n'), (16,"guardian naga"), (4,'N')
 GEOMETRY:center,center
 #         1         2         3         4         5         6         7
@@ -314,71 +305,39 @@
 TRAP:"spiked pit",(37,07)
 # Objects
-OBJECT:'(',"skeleton key",(38,10),blessed,0,"The Master Key of Thievery"
-OBJECT:'%',"tin",(26,12),"chameleon",0
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:('(',"skeleton key"),(38,10),blessed,0,NAME:"The Master Key of Thievery"
+OBJECT:('%',"tin"),(26,12),montype:"chameleon",0
+LOOP [10 + 1d8] {
+  OBJECT:random,random
+}
 # Random traps
+LOOP [7 + 1d6] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Random monsters.
-MONSTER:'@',"Master Assassin",(38,10),hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',"leprechaun",random,hostile
-MONSTER:'l',random,random,hostile
-MONSTER:'l',random,random,hostile
-MONSTER:'N',"guardian naga",random,hostile
-MONSTER:'N',"guardian naga",random,hostile
-MONSTER:'N',"guardian naga",random,hostile
-MONSTER:'N',"guardian naga",random,hostile
-MONSTER:'N',"guardian naga",random,hostile
-MONSTER:'N',"guardian naga",random,hostile
-MONSTER:'N',"guardian naga",random,hostile
-MONSTER:'N',"guardian naga",random,hostile
-MONSTER:'N',random,random,hostile
-MONSTER:'N',random,random,hostile
-MONSTER:'N',random,random,hostile
-MONSTER: ':',"chameleon",random,hostile
-MONSTER: ':',"chameleon",random,hostile
-MONSTER: ':',"chameleon",random,hostile
-MONSTER: ':',"chameleon",random,hostile
-MONSTER: ':',"chameleon",random,hostile
-MONSTER:';',"shark",(51,14),hostile
-MONSTER:';',"shark",(53,09),hostile
-MONSTER:';',"shark",(55,15),hostile
-MONSTER:';',"shark",(58,10),hostile
+MONSTER:('@',"Master Assassin"),(38,10),hostile {
+  OBJECT:('(', "Bell of Opening"),uncursed
+  OBJECT:'['
+  OBJECT:')'
+  OBJECT:'?'
+  OBJECT:'!'
+}
+LOOP [13 + 2d6] {
+  MONSTER:('l',"leprechaun"),random,hostile
+}
+MONSTER:'l',random,hostile
+MONSTER:'l',random,hostile
+LOOP [5 + 2d3] {
+  MONSTER:('N',"guardian naga"),random,hostile
+}
+MONSTER:'N',random,hostile
+MONSTER:'N',random,hostile
+MONSTER:'N',random,hostile
+LOOP [4 + 1d3] {
+  MONSTER: (':',"chameleon"),random,hostile
+}
+MONSTER:(';',"shark"),(51,14),hostile
+MONSTER:(';',"shark"),(53,09),hostile
+MONSTER:(';',"shark"),(55,15),hostile
+MONSTER:(';',"shark"),(58,10),hostile
 
 #
@@ -389,44 +348,57 @@
 #
 LEVEL: "Rog-fila"
+MON_GENERATION:86%, (64,"leprechaun"), (16,'n'), (16,"guardian naga"), (4,'N')
 #
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, up
-OBJECT: random,random,random
-MONSTER: 'l', "leprechaun", random, hostile
+OBJECT: random,random
+MONSTER: ('l', "leprechaun"), random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random,random,random
-MONSTER: 'l', "leprechaun", random, hostile
-MONSTER: 'N', "guardian naga", random, hostile
+{
+OBJECT: random, random
+OBJECT: random,random
+MONSTER: ('l', "leprechaun"), random, hostile
+MONSTER: ('N', "guardian naga"), random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
 TRAP: random, random
-OBJECT: random,random,random
-MONSTER: 'n', "water nymph", random, hostile
+OBJECT: random,random
+MONSTER: ('n', "water nymph"), random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, down
-OBJECT: random, random, random
+OBJECT: random, random
 TRAP: random, random
 TRAP: random, random
-MONSTER: 'l', random, random, hostile
-MONSTER: 'N', "guardian naga", random, hostile
+MONSTER: 'l', random, hostile
+MONSTER: ('N', "guardian naga"), random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
+OBJECT: random, random
 TRAP: random, random
 TRAP: random, random
-MONSTER: 'l', "leprechaun", random, hostile
+MONSTER: ('l', "leprechaun"), random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
 TRAP: random, random
-MONSTER: 'l', "leprechaun", random, hostile
-MONSTER: 'n', "water nymph", random, hostile
+MONSTER: ('l', "leprechaun"), random, hostile
+MONSTER: ('n', "water nymph"), random, hostile
+}
 
 RANDOM_CORRIDORS
@@ -436,44 +408,57 @@
 #
 LEVEL: "Rog-filb"
+MON_GENERATION:86%, (64,"leprechaun"), (16,'n'), (16,"guardian naga"), (4,'N')
 #
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, up
-OBJECT: random,random,random
-MONSTER: 'l', "leprechaun", random, hostile
+OBJECT: random,random
+MONSTER: ('l', "leprechaun"), random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random,random,random
-MONSTER: 'l', "leprechaun", random, hostile
-MONSTER: 'N', "guardian naga", random, hostile
+{
+OBJECT: random, random
+OBJECT: random,random
+MONSTER: ('l', "leprechaun"), random, hostile
+MONSTER: ('N', "guardian naga"), random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
 TRAP: random, random
-OBJECT: random,random,random
-MONSTER: 'n', "water nymph", random, hostile
+OBJECT: random,random
+MONSTER: ('n', "water nymph"), random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, down
-OBJECT: random, random, random
+OBJECT: random, random
 TRAP: random, random
 TRAP: random, random
-MONSTER: 'l', random, random, hostile
-MONSTER: 'N', "guardian naga", random, hostile
+MONSTER: 'l', random, hostile
+MONSTER: ('N', "guardian naga"), random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
+OBJECT: random, random
 TRAP: random, random
 TRAP: random, random
-MONSTER: 'l', "leprechaun", random, hostile
+MONSTER: ('l', "leprechaun"), random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
 TRAP: random, random
-MONSTER: 'l', "leprechaun", random, hostile
-MONSTER: 'n', "water nymph", random, hostile
+MONSTER: ('l', "leprechaun"), random, hostile
+MONSTER: ('n', "water nymph"), random, hostile
+}
 
 RANDOM_CORRIDORS
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/Samurai.des nethack/dat/Samurai.des
--- nh_orig/dat/Samurai.des	2003-12-07 18:39:12.000000000 -0500
+++ nethack/dat/Samurai.des	2010-08-16 13:20:13.635707386 -0400
@@ -9,6 +9,8 @@
 #	and receive your quest assignment.
 #
-MAZE: "Sam-strt",' '
-FLAGS: noteleport,hardfloor
+LEVEL: "Sam-strt"
+FLAGS: noteleport,hardfloor,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"wolf"), (16,'d'), (16,"stalker"), (4,'E')
 GEOMETRY:center,center
 MAP
@@ -53,39 +55,64 @@
 DOOR:closed,(50,06)
 # Lord Sato
-MONSTER:'@',"Lord Sato",(20,04)
+MONSTER:('@',"Lord Sato"),(20,04) {
+  OBJECT:('[',"splint mail"),1d4
+  OBJECT:(')',"katana"),1d4
+  OBJECT:'?'
+}
 # The treasure of Lord Sato
-OBJECT:'(',"chest",(20,04)
+OBJECT:('(',"chest"),(20,04)
 # roshi guards for the audience chamber
-MONSTER:'@',"roshi",(18,04)
-MONSTER:'@',"roshi",(18,05)
-MONSTER:'@',"roshi",(18,06)
-MONSTER:'@',"roshi",(18,07)
-MONSTER:'@',"roshi",(26,04)
-MONSTER:'@',"roshi",(26,05)
-MONSTER:'@',"roshi",(26,06)
-MONSTER:'@',"roshi",(26,07)
+MONSTER:('@',"roshi"),(18,04) {
+  OBJECT[25%]:('[',"splint mail")
+  OBJECT[25%]:(')',"katana")
+}
+MONSTER:('@',"roshi"),(18,05) {
+  OBJECT[25%]:('[',"splint mail")
+  OBJECT[25%]:(')',"katana")
+}
+MONSTER:('@',"roshi"),(18,06) {
+  OBJECT[25%]:('[',"splint mail")
+  OBJECT[25%]:(')',"katana")
+}
+MONSTER:('@',"roshi"),(18,07) {
+  OBJECT[25%]:('[',"splint mail")
+  OBJECT[25%]:(')',"katana")
+}
+MONSTER:('@',"roshi"),(26,04) {
+  OBJECT[25%]:('[',"splint mail")
+  OBJECT[25%]:(')',"katana")
+}
+MONSTER:('@',"roshi"),(26,05) {
+  OBJECT[25%]:('[',"splint mail")
+  OBJECT[25%]:(')',"katana")
+}
+MONSTER:('@',"roshi"),(26,06) {
+  OBJECT[25%]:('[',"splint mail")
+  OBJECT[25%]:(')',"katana")
+}
+MONSTER:('@',"roshi"),(26,07) {
+  OBJECT[25%]:('[',"splint mail")
+  OBJECT[25%]:(')',"katana")
+}
 # Non diggable walls
 NON_DIGGABLE:(00,00,75,19)
 # Random traps
+LOOP [4 + 1d6] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Monsters on siege duty.
-MONSTER: '@',"ninja",(64,00),hostile
-MONSTER: 'd',"wolf",(65,01)
-MONSTER: '@',"ninja",(67,02),hostile
-MONSTER: '@',"ninja",(69,05),hostile
-MONSTER: '@',"ninja",(69,06),hostile
-MONSTER: 'd',"wolf",(69,07)
-MONSTER: '@',"ninja",(70,06),hostile
-MONSTER: '@',"ninja",(70,07),hostile
-MONSTER: '@',"ninja",(72,01),hostile
-MONSTER: 'd',"wolf",(75,09)
-MONSTER: '@',"ninja",(73,05),hostile
-MONSTER: '@',"ninja",(68,02),hostile
-MONSTER:'E',"stalker",random
+MONSTER: ('@',"ninja"),(64,00),hostile
+MONSTER: ('d',"wolf"),(65,01)
+MONSTER: ('@',"ninja"),(67,02),hostile
+MONSTER: ('@',"ninja"),(69,05),hostile
+MONSTER: ('@',"ninja"),(69,06),hostile
+MONSTER: ('d',"wolf"),(69,07)
+MONSTER: ('@',"ninja"),(70,06),hostile
+MONSTER: ('@',"ninja"),(70,07),hostile
+MONSTER: ('@',"ninja"),(72,01),hostile
+MONSTER: ('d',"wolf"),(75,09)
+MONSTER: ('@',"ninja"),(73,05),hostile
+MONSTER: ('@',"ninja"),(68,02),hostile
+MONSTER:('E',"stalker"),random
 
 #
@@ -96,6 +123,8 @@
 #
 
-MAZE: "Sam-loca",' '
-FLAGS: hardfloor
+LEVEL: "Sam-loca"
+FLAGS: hardfloor,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"wolf"), (16,'d'), (16,"stalker"), (4,'E')
 GEOMETRY:center,center
 MAP
@@ -154,81 +183,72 @@
 NON_DIGGABLE:(00,00,75,19)
 # Objects
-OBJECT:'*',random,(25,05)
-OBJECT:'*',random,(26,05)
-OBJECT:'*',random,(27,05)
-OBJECT:'*',random,(28,05)
-OBJECT:'*',random,(25,06)
-OBJECT:'*',random,(26,06)
-OBJECT:'*',random,(27,06)
-OBJECT:'*',random,(28,06)
+OBJECT:'*',(25,05)
+OBJECT:'*',(26,05)
+OBJECT:'*',(27,05)
+OBJECT:'*',(28,05)
+OBJECT:'*',(25,06)
+OBJECT:'*',(26,06)
+OBJECT:'*',(27,06)
+OBJECT:'*',(28,06)
 #
-OBJECT:'[',random,(40,05)
-OBJECT:'[',random,(41,05)
-OBJECT:'[',random,(42,05)
-OBJECT:'[',random,(43,05)
-OBJECT:'[',random,(40,06)
-OBJECT:'[',random,(41,06)
-OBJECT:'[',random,(42,06)
-OBJECT:'[',random,(43,06)
+OBJECT:'[',(40,05)
+OBJECT:'[',(41,05)
+OBJECT:'[',(42,05)
+OBJECT:'[',(43,05)
+OBJECT:'[',(40,06)
+OBJECT:'[',(41,06)
+OBJECT:'[',(42,06)
+OBJECT:'[',(43,06)
 #
-OBJECT:')',random,(27,13)
-OBJECT:')',random,(28,13)
-OBJECT:')',random,(29,13)
-OBJECT:')',random,(30,13)
-OBJECT:')',random,(27,14)
-OBJECT:')',random,(28,14)
-OBJECT:')',random,(29,14)
-OBJECT:')',random,(30,14)
+OBJECT:')',(27,13)
+OBJECT:')',(28,13)
+OBJECT:')',(29,13)
+OBJECT:')',(30,13)
+OBJECT:')',(27,14)
+OBJECT:')',(28,14)
+OBJECT:')',(29,14)
+OBJECT:')',(30,14)
 #
-OBJECT:'(',random,(37,13)
-OBJECT:'(',random,(38,13)
-OBJECT:'(',random,(39,13)
-OBJECT:'(',random,(40,13)
-OBJECT:'(',random,(37,14)
-OBJECT:'(',random,(38,14)
-OBJECT:'(',random,(39,14)
-OBJECT:'(',random,(40,14)
+OBJECT:'(',(37,13)
+OBJECT:'(',(38,13)
+OBJECT:'(',(39,13)
+OBJECT:'(',(40,13)
+OBJECT:'(',(37,14)
+OBJECT:'(',(38,14)
+OBJECT:'(',(39,14)
+OBJECT:'(',(40,14)
 # Random traps
+LOOP [4 + 1d6] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Random monsters.
-MONSTER:'@',"ninja",(15,05),hostile
-MONSTER:'@',"ninja",(16,05),hostile
-MONSTER:'d',"wolf",(17,05)
-MONSTER:'d',"wolf",(18,05)
-MONSTER:'@',"ninja",(19,05),hostile
-MONSTER:'d',"wolf",(15,14)
-MONSTER:'d',"wolf",(16,14)
-MONSTER:'@',"ninja",(17,14),hostile
-MONSTER:'@',"ninja",(18,14),hostile
-MONSTER:'d',"wolf",(56,05)
-MONSTER:'@',"ninja",(57,05),hostile
-MONSTER:'d',"wolf",(58,05)
-MONSTER:'d',"wolf",(59,05)
-MONSTER:'@',"ninja",(56,14),hostile
-MONSTER:'d',"wolf",(57,14)
-MONSTER:'@',"ninja",(58,14),hostile
-MONSTER:'d',random,(59,14)
-MONSTER:'d',"wolf",(60,14)
-MONSTER:'E',"stalker",random
-MONSTER:'E',"stalker",random
-MONSTER:'E',"stalker",random
-MONSTER:'E',"stalker",random
-MONSTER:'E',"stalker",random
-MONSTER:'E',"stalker",random
-MONSTER:'E',"stalker",random
-MONSTER:'E',"stalker",random
-MONSTER:'E',"stalker",random
+MONSTER:('@',"ninja"),(15,05),hostile
+MONSTER:('@',"ninja"),(16,05),hostile
+MONSTER:('d',"wolf"),(17,05)
+MONSTER:('d',"wolf"),(18,05)
+MONSTER:('@',"ninja"),(19,05),hostile
+MONSTER:('d',"wolf"),(15,14)
+MONSTER:('d',"wolf"),(16,14)
+MONSTER:('@',"ninja"),(17,14),hostile
+MONSTER:('@',"ninja"),(18,14),hostile
+MONSTER:('d',"wolf"),(56,05)
+MONSTER:('@',"ninja"),(57,05),hostile
+MONSTER:('d',"wolf"),(58,05)
+MONSTER:('d',"wolf"),(59,05)
+MONSTER:('@',"ninja"),(56,14),hostile
+MONSTER:('d',"wolf"),(57,14)
+MONSTER:('@',"ninja"),(58,14),hostile
+MONSTER:'d',(59,14)
+MONSTER:('d',"wolf"),(60,14)
+LOOP [7 + 1d10] {
+  MONSTER:('E',"stalker"),random
+}
 #	"guards" for the central courtyard.
-MONSTER:'@',"samurai",(30,05),hostile
-MONSTER:'@',"samurai",(31,05),hostile
-MONSTER:'@',"samurai",(32,05),hostile
-MONSTER:'@',"samurai",(32,14),hostile
-MONSTER:'@',"samurai",(33,14),hostile
-MONSTER:'@',"samurai",(34,14),hostile
+MONSTER:('@',"samurai"),(30,05),hostile
+MONSTER:('@',"samurai"),(31,05),hostile
+MONSTER:('@',"samurai"),(32,05),hostile
+MONSTER:('@',"samurai"),(32,14),hostile
+MONSTER:('@',"samurai"),(33,14),hostile
+MONSTER:('@',"samurai"),(34,14),hostile
 
 #
@@ -240,11 +260,13 @@
 #
 
-MAZE: "Sam-goal", ' '
-FLAGS: noteleport
+LEVEL: "Sam-goal"
+FLAGS: noteleport,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"wolf"), (16,'d'), (16,"stalker"), (4,'E')
 GEOMETRY:center,center
 MAP
                                              
            .......................           
-       ......---------.---------......       
+       ......-------------------......       
     ......----.................----......    
    ....----.....-------------.....----....   
@@ -254,9 +276,9 @@
  ....|...||...---...--+--...---...||...|.... 
  ....|...|....|....|-...-|....|....|...|.... 
- ....|...|....|....+.....+....|........|.... 
+ ....|...|....|....+.....+....|....|...|.... 
  ....|...|....|....|-...-|....|....|...|.... 
  ....|...||...---...--+--...---...||...|.... 
   ...|....--....---.......---....--....|...  
-  ...||....---....----.----....---....||...  
+  ...||....---....---------....---....||...  
   ....--.....----...........----.....--....  
    ....----.....-------------.....----....   
@@ -266,5 +288,4 @@
 ENDMAP
 # Dungeon Description
-RANDOM_PLACES:(02,11),(42,09)
 REGION:(00,00,44,19),unlit,"ordinary"
 # Doors
@@ -274,23 +295,27 @@
 DOOR:closed,(25,10)
 # Stairs
-STAIR:place[0],up
+$place = { (02,11),(42,09) }
+SHUFFLE:$place
+STAIR:$place[0],up
+
+$place = { (22,14),(30,10),(22, 6),(14,10) }
+SHUFFLE:$place
+TERRAIN:$place[0],'.'
+
+$place = { (22, 4),(35,10),(22,16),( 9,10) }
+SHUFFLE:$place
+TERRAIN:$place[0],'.'
+
+$place = { (22, 2),(22,18) }
+SHUFFLE:$place
+TERRAIN:$place[0],'.'
+
 # Non diggable walls
 NON_DIGGABLE:(00,00,44,19)
 # Objects
-OBJECT:')',"tsurugi",(22,10),blessed,0,"The Tsurugi of Muramasa"
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:(')',"tsurugi"),(22,10),blessed,0,NAME:"The Tsurugi of Muramasa"
+LOOP [9 + 1d6] {
+  OBJECT:random,random
+}
 #
 TRAP:"board",(22,09)
@@ -298,37 +323,20 @@
 TRAP:"board",(22,11)
 # Random traps
+LOOP [3 + 1d6] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Random monsters.
-MONSTER:'@',"Ashikaga Takauji",(22,10)
-MONSTER:'@',"samurai",random,hostile
-MONSTER:'@',"samurai",random,hostile
-MONSTER:'@',"samurai",random,hostile
-MONSTER:'@',"samurai",random,hostile
-MONSTER:'@',"samurai",random,hostile
-MONSTER:'@',"ninja",random,hostile
-MONSTER:'@',"ninja",random,hostile
-MONSTER:'@',"ninja",random,hostile
-MONSTER:'@',"ninja",random,hostile
-MONSTER:'@',"ninja",random,hostile
-MONSTER:'d',"wolf",random
-MONSTER:'d',"wolf",random
-MONSTER:'d',"wolf",random
-MONSTER:'d',"wolf",random
-MONSTER:'d',random,random
-MONSTER:'d',random,random
-MONSTER:'E',"stalker",random
-MONSTER:'E',"stalker",random
-MONSTER:'E',"stalker",random
-MONSTER:'E',"stalker",random
-MONSTER:'E',"stalker",random
-MONSTER:'E',"stalker",random
-MONSTER:'E',"stalker",random
-MONSTER:'E',"stalker",random
-MONSTER:'E',"stalker",random
+MONSTER:('@',"Ashikaga Takauji"),(22,10) {
+  OBJECT:('(', "Bell of Opening"),uncursed
+  OBJECT:('[',"splint mail")
+}
+LOOP [3 + 1d6] {
+  MONSTER:('@',"samurai"),random,hostile
+  MONSTER[90%]:('@',"ninja"),random,hostile
+  MONSTER:('d',"wolf"),random
+  MONSTER[50%]:'d',random
+  MONSTER:('E',"stalker"),random
+  MONSTER[90%]:('E',"stalker"),random
+}
 
 
@@ -342,6 +350,8 @@
 #
 
-MAZE: "Sam-fila", ' '
-INIT_MAP: '.' , 'P', true, true, random, true
+LEVEL: "Sam-fila"
+FLAGS:mazelevel,noflip
+INIT_MAP: mines, '.' , 'P', true, true, random, true
+MON_GENERATION:86%, (64,"wolf"), (16,'d'), (16,"stalker"), (4,'E')
 NOMAP
 #
@@ -349,28 +359,22 @@
 STAIR: random, down
 #
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+LOOP [5 + 1d6] {
+  OBJECT: random, random
+}
 #
-MONSTER: 'd', random, random
-MONSTER: 'd', "wolf", random
-MONSTER: 'd', "wolf", random
-MONSTER: 'd', "wolf", random
-MONSTER: 'd', "wolf", random
-MONSTER: 'd', "wolf", random
-MONSTER: 'E', "stalker", random
+MONSTER: 'd', random
+LOOP [3 + 2d4] {
+  MONSTER: ('d', "wolf"), random
+}
+MONSTER: ('E', "stalker"), random
 #
+LOOP [3 + 1d6] {
 TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
+}
 
-MAZE: "Sam-filb", ' '
+LEVEL: "Sam-filb"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"wolf"), (16,'d'), (16,"stalker"), (4,'E')
 GEOMETRY:center,center
 MAP
@@ -402,25 +406,15 @@
 STAIR: random, down
 #
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+LOOP [6 + 2d3] {
+  OBJECT: random, random
+}
 #
-MONSTER: 'd', random, random
-MONSTER: 'd', "wolf", random
-MONSTER: 'd', "wolf", random
-MONSTER: 'd', "wolf", random
-MONSTER: 'd', "wolf", random
-MONSTER: 'E', "stalker", random
-MONSTER: 'E', "stalker", random
-MONSTER: 'E', "stalker", random
+MONSTER: 'd', random
+LOOP [3 + 2d3] {
+  MONSTER: ('d', "wolf"), random
+  MONSTER: ('E', "stalker"), random
+}
 #
+LOOP [1 + 2d3] {
 TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
+}
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/sokoban.des nethack/dat/sokoban.des
--- nh_orig/dat/sokoban.des	2003-12-07 18:39:13.000000000 -0500
+++ nethack/dat/sokoban.des	2010-04-11 12:36:58.221625824 -0400
@@ -31,8 +31,34 @@
 #   Bones files are not permitted.
 
+# Temporarily commented out 'til bugfix
+# INCLUDE "functions.des"
+
+FUNCTION soko_loot()
+{
+  # Random objects
+  OBJECT:'%',random
+  OBJECT:'%',random
+  OBJECT:'%',random
+  OBJECT:'%',random
+  OBJECT:'=',random
+  OBJECT:'/',random
+}
+
+# Unused temporarily.
+#FUNCTION soko_prize()
+#{
+#  IF [50%] {
+#    OBJECT:'"',"amulet of reflection",$place[0]
+#  } ELSE {
+#    OBJECT:'(',"bag of holding",$place[0]
+#  }
+#  ENGRAVING:$place[0],burn,"Elbereth"
+#}
+
 
 ### Bottom (first) level of Sokoban ###
-MAZE:"soko4-1",' '
-FLAGS:noteleport,hardfloor
+LEVEL:"soko4-1"
+FLAGS:noteleport,hardfloor,mazelevel,premapped
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 #12345678901234567890123456789012345678901234567890
@@ -59,16 +85,16 @@
 
 # Boulders
-OBJECT:'`',"boulder",(02,02)
-OBJECT:'`',"boulder",(02,03)
+OBJECT:('`',"boulder"),(02,02)
+OBJECT:('`',"boulder"),(02,03)
 #
-OBJECT:'`',"boulder",(10,02)
-OBJECT:'`',"boulder",(09,03)
-OBJECT:'`',"boulder",(10,04)
+OBJECT:('`',"boulder"),(10,02)
+OBJECT:('`',"boulder"),(09,03)
+OBJECT:('`',"boulder"),(10,04)
 #
-OBJECT:'`',"boulder",(08,07)
-OBJECT:'`',"boulder",(09,08)
-OBJECT:'`',"boulder",(09,09)
-OBJECT:'`',"boulder",(08,10)
-OBJECT:'`',"boulder",(10,10)
+OBJECT:('`',"boulder"),(08,07)
+OBJECT:('`',"boulder"),(09,08)
+OBJECT:('`',"boulder"),(09,09)
+OBJECT:('`',"boulder"),(08,10)
+OBJECT:('`',"boulder"),(10,10)
 
 # Traps
@@ -84,18 +110,13 @@
 
 # A little help
-OBJECT:'?',"earth",(02,11)
-OBJECT:'?',"earth",(03,11)
+OBJECT:('?',"earth"),(02,11)
+OBJECT:('?',"earth"),(03,11)
 
-# Random objects
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'=',random,random
-OBJECT:'/',random,random
+soko_loot()
 
 
-MAZE:"soko4-2",' '
-FLAGS:noteleport,hardfloor
+LEVEL:"soko4-2"
+FLAGS:noteleport,hardfloor,mazelevel,premapped
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 #12345678901234567890123456789012345678901234567890
@@ -120,18 +141,18 @@
 
 # Boulders
-OBJECT:'`',"boulder",(05,02)
-OBJECT:'`',"boulder",(06,02)
-OBJECT:'`',"boulder",(06,03)
-OBJECT:'`',"boulder",(07,03)
+OBJECT:('`',"boulder"),(05,02)
+OBJECT:('`',"boulder"),(06,02)
+OBJECT:('`',"boulder"),(06,03)
+OBJECT:('`',"boulder"),(07,03)
 #
-OBJECT:'`',"boulder",(09,05)
-OBJECT:'`',"boulder",(10,03)
-OBJECT:'`',"boulder",(11,02)
-OBJECT:'`',"boulder",(12,03)
+OBJECT:('`',"boulder"),(09,05)
+OBJECT:('`',"boulder"),(10,03)
+OBJECT:('`',"boulder"),(11,02)
+OBJECT:('`',"boulder"),(12,03)
 #
-OBJECT:'`',"boulder",(07,08)
-OBJECT:'`',"boulder",(08,08)
-OBJECT:'`',"boulder",(09,08)
-OBJECT:'`',"boulder",(10,08)
+OBJECT:('`',"boulder"),(07,08)
+OBJECT:('`',"boulder"),(08,08)
+OBJECT:('`',"boulder"),(09,08)
+OBJECT:('`',"boulder"),(10,08)
 
 # Traps
@@ -148,19 +169,14 @@
 
 # A little help
-OBJECT:'?',"earth",(01,09)
-OBJECT:'?',"earth",(02,09)
+OBJECT:('?',"earth"),(01,09)
+OBJECT:('?',"earth"),(02,09)
 
-# Random objects
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'=',random,random
-OBJECT:'/',random,random
+soko_loot()
 
 
 ### Second level ###
-MAZE:"soko3-1",' '
-FLAGS:noteleport
+LEVEL:"soko3-1"
+FLAGS:noteleport,mazelevel,premapped
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 #12345678901234567890123456789012345678901234567890
@@ -187,27 +203,27 @@
 
 # Boulders
-OBJECT:'`',"boulder",(03,02)
-OBJECT:'`',"boulder",(04,02)
+OBJECT:('`',"boulder"),(03,02)
+OBJECT:('`',"boulder"),(04,02)
 #
-OBJECT:'`',"boulder",(06,02)
-OBJECT:'`',"boulder",(06,03)
-OBJECT:'`',"boulder",(07,02)
+OBJECT:('`',"boulder"),(06,02)
+OBJECT:('`',"boulder"),(06,03)
+OBJECT:('`',"boulder"),(07,02)
 #
-OBJECT:'`',"boulder",(03,06)
-OBJECT:'`',"boulder",(02,07)
-OBJECT:'`',"boulder",(03,07)
-OBJECT:'`',"boulder",(03,08)
-OBJECT:'`',"boulder",(02,09)
-OBJECT:'`',"boulder",(03,09)
-OBJECT:'`',"boulder",(04,09)
+OBJECT:('`',"boulder"),(03,06)
+OBJECT:('`',"boulder"),(02,07)
+OBJECT:('`',"boulder"),(03,07)
+OBJECT:('`',"boulder"),(03,08)
+OBJECT:('`',"boulder"),(02,09)
+OBJECT:('`',"boulder"),(03,09)
+OBJECT:('`',"boulder"),(04,09)
 #
-OBJECT:'`',"boulder",(06,07)
-OBJECT:'`',"boulder",(06,09)
-OBJECT:'`',"boulder",(08,07)
-OBJECT:'`',"boulder",(08,10)
-OBJECT:'`',"boulder",(09,08)
-OBJECT:'`',"boulder",(09,09)
-OBJECT:'`',"boulder",(10,07)
-OBJECT:'`',"boulder",(10,10)
+OBJECT:('`',"boulder"),(06,07)
+OBJECT:('`',"boulder"),(06,09)
+OBJECT:('`',"boulder"),(08,07)
+OBJECT:('`',"boulder"),(08,10)
+OBJECT:('`',"boulder"),(09,08)
+OBJECT:('`',"boulder"),(09,09)
+OBJECT:('`',"boulder"),(10,07)
+OBJECT:('`',"boulder"),(10,10)
 
 # Traps
@@ -228,15 +244,10 @@
 TRAP:"hole",(26,10)
 
-# Random objects
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'=',random,random
-OBJECT:'/',random,random
+soko_loot()
 
 
-MAZE:"soko3-2",' '
-FLAGS:noteleport
+LEVEL:"soko3-2"
+FLAGS:noteleport,mazelevel,premapped
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 #12345678901234567890123456789012345678901234567890
@@ -265,20 +276,20 @@
 
 # Boulders
-OBJECT:'`',"boulder",(02,03)
-OBJECT:'`',"boulder",(08,03)
-OBJECT:'`',"boulder",(09,04)
-OBJECT:'`',"boulder",(02,05)
-OBJECT:'`',"boulder",(04,05)
-OBJECT:'`',"boulder",(09,05)
-OBJECT:'`',"boulder",(02,06)
-OBJECT:'`',"boulder",(05,06)
-OBJECT:'`',"boulder",(06,07)
-OBJECT:'`',"boulder",(03,08)
-OBJECT:'`',"boulder",(07,08)
-OBJECT:'`',"boulder",(05,09)
-OBJECT:'`',"boulder",(10,09)
-OBJECT:'`',"boulder",(07,10)
-OBJECT:'`',"boulder",(10,10)
-OBJECT:'`',"boulder",(03,11)
+OBJECT:('`',"boulder"),(02,03)
+OBJECT:('`',"boulder"),(08,03)
+OBJECT:('`',"boulder"),(09,04)
+OBJECT:('`',"boulder"),(02,05)
+OBJECT:('`',"boulder"),(04,05)
+OBJECT:('`',"boulder"),(09,05)
+OBJECT:('`',"boulder"),(02,06)
+OBJECT:('`',"boulder"),(05,06)
+OBJECT:('`',"boulder"),(06,07)
+OBJECT:('`',"boulder"),(03,08)
+OBJECT:('`',"boulder"),(07,08)
+OBJECT:('`',"boulder"),(05,09)
+OBJECT:('`',"boulder"),(10,09)
+OBJECT:('`',"boulder"),(07,10)
+OBJECT:('`',"boulder"),(10,10)
+OBJECT:('`',"boulder"),(03,11)
 
 # Traps
@@ -296,16 +307,11 @@
 TRAP:"hole",(23,10)
 
-# Random objects
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'=',random,random
-OBJECT:'/',random,random
+soko_loot()
 
 
 ### Third level ###
-MAZE:"soko2-1",' '
-FLAGS:noteleport
+LEVEL:"soko2-1"
+FLAGS:noteleport,mazelevel,premapped
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 #12345678901234567890123456789012345678901234567890
@@ -332,21 +338,21 @@
 
 # Boulders
-OBJECT:'`',"boulder",(02,02)
-OBJECT:'`',"boulder",(03,02)
+OBJECT:('`',"boulder"),(02,02)
+OBJECT:('`',"boulder"),(03,02)
 #
-OBJECT:'`',"boulder",(05,03)
-OBJECT:'`',"boulder",(07,03)
-OBJECT:'`',"boulder",(07,02)
-OBJECT:'`',"boulder",(08,02)
+OBJECT:('`',"boulder"),(05,03)
+OBJECT:('`',"boulder"),(07,03)
+OBJECT:('`',"boulder"),(07,02)
+OBJECT:('`',"boulder"),(08,02)
 #
-OBJECT:'`',"boulder",(10,03)
-OBJECT:'`',"boulder",(11,03)
+OBJECT:('`',"boulder"),(10,03)
+OBJECT:('`',"boulder"),(11,03)
 #
-OBJECT:'`',"boulder",(02,07)
-OBJECT:'`',"boulder",(02,08)
-OBJECT:'`',"boulder",(03,09)
+OBJECT:('`',"boulder"),(02,07)
+OBJECT:('`',"boulder"),(02,08)
+OBJECT:('`',"boulder"),(03,09)
 #
-OBJECT:'`',"boulder",(05,07)
-OBJECT:'`',"boulder",(06,06)
+OBJECT:('`',"boulder"),(05,07)
+OBJECT:('`',"boulder"),(06,06)
 
 # Traps
@@ -362,15 +368,10 @@
 TRAP:"hole",(17,09)
 
-# Random objects
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'=',random,random
-OBJECT:'/',random,random
+soko_loot()
 
 
-MAZE:"soko2-2",' '
-FLAGS:noteleport
+LEVEL:"soko2-2"
+FLAGS:noteleport,mazelevel,premapped
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 #12345678901234567890123456789012345678901234567890
@@ -398,20 +399,20 @@
 
 # Boulders
-OBJECT:'`',"boulder",(04,02)
-OBJECT:'`',"boulder",(04,03)
-OBJECT:'`',"boulder",(05,03)
-OBJECT:'`',"boulder",(07,03)
-OBJECT:'`',"boulder",(08,03)
-OBJECT:'`',"boulder",(02,04)
-OBJECT:'`',"boulder",(03,04)
-OBJECT:'`',"boulder",(05,05)
-OBJECT:'`',"boulder",(06,06)
-OBJECT:'`',"boulder",(09,06)
-OBJECT:'`',"boulder",(03,07)
-OBJECT:'`',"boulder",(04,07)
-OBJECT:'`',"boulder",(07,07)
-OBJECT:'`',"boulder",(06,09)
-OBJECT:'`',"boulder",(05,10)
-OBJECT:'`',"boulder",(05,11)
+OBJECT:('`',"boulder"),(04,02)
+OBJECT:('`',"boulder"),(04,03)
+OBJECT:('`',"boulder"),(05,03)
+OBJECT:('`',"boulder"),(07,03)
+OBJECT:('`',"boulder"),(08,03)
+OBJECT:('`',"boulder"),(02,04)
+OBJECT:('`',"boulder"),(03,04)
+OBJECT:('`',"boulder"),(05,05)
+OBJECT:('`',"boulder"),(06,06)
+OBJECT:('`',"boulder"),(09,06)
+OBJECT:('`',"boulder"),(03,07)
+OBJECT:('`',"boulder"),(04,07)
+OBJECT:('`',"boulder"),(07,07)
+OBJECT:('`',"boulder"),(06,09)
+OBJECT:('`',"boulder"),(05,10)
+OBJECT:('`',"boulder"),(05,11)
 
 # Traps
@@ -428,16 +429,11 @@
 TRAP:"hole",(17,11)
 
-# Random objects
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'=',random,random
-OBJECT:'/',random,random
+soko_loot()
 
 
 ### Top (last) level of Sokoban ###
-MAZE:"soko1-1",' '
-FLAGS:noteleport
+LEVEL:"soko1-1"
+FLAGS:noteleport,mazelevel,premapped
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 #12345678901234567890123456789012345678901234567890
@@ -462,5 +458,6 @@
 -----            -------  
 ENDMAP
-RANDOM_PLACES:(16,11),(16,13),(16,15)
+$place = { (16,11),(16,13),(16,15) }
+SHUFFLE: $place
 STAIR:(01,01),down
 REGION:(00,00,25,17),lit,"ordinary"
@@ -469,25 +466,25 @@
 
 # Boulders
-OBJECT:'`',"boulder",(03,05)
-OBJECT:'`',"boulder",(05,05)
-OBJECT:'`',"boulder",(07,05)
-OBJECT:'`',"boulder",(09,05)
-OBJECT:'`',"boulder",(11,05)
+OBJECT:('`',"boulder"),(03,05)
+OBJECT:('`',"boulder"),(05,05)
+OBJECT:('`',"boulder"),(07,05)
+OBJECT:('`',"boulder"),(09,05)
+OBJECT:('`',"boulder"),(11,05)
 #
-OBJECT:'`',"boulder",(04,07)
-OBJECT:'`',"boulder",(04,08)
-OBJECT:'`',"boulder",(06,07)
-OBJECT:'`',"boulder",(09,07)
-OBJECT:'`',"boulder",(11,07)
+OBJECT:('`',"boulder"),(04,07)
+OBJECT:('`',"boulder"),(04,08)
+OBJECT:('`',"boulder"),(06,07)
+OBJECT:('`',"boulder"),(09,07)
+OBJECT:('`',"boulder"),(11,07)
 #
-OBJECT:'`',"boulder",(03,12)
-OBJECT:'`',"boulder",(04,10)
-OBJECT:'`',"boulder",(05,12)
-OBJECT:'`',"boulder",(06,10)
-OBJECT:'`',"boulder",(07,11)
-OBJECT:'`',"boulder",(08,10)
-OBJECT:'`',"boulder",(09,12)
+OBJECT:('`',"boulder"),(03,12)
+OBJECT:('`',"boulder"),(04,10)
+OBJECT:('`',"boulder"),(05,12)
+OBJECT:('`',"boulder"),(06,10)
+OBJECT:('`',"boulder"),(07,11)
+OBJECT:('`',"boulder"),(08,10)
+OBJECT:('`',"boulder"),(09,12)
 #
-OBJECT:'`',"boulder",(03,14)
+OBJECT:('`',"boulder"),(03,14)
 
 # Traps
@@ -509,14 +506,8 @@
 TRAP:"hole",(23,01)
 
-MONSTER:'m',"giant mimic", random, m_object "boulder"
-MONSTER:'m',"giant mimic", random, m_object "boulder"
+MONSTER:('m',"giant mimic"), random, m_object "boulder"
+MONSTER:('m',"giant mimic"), random, m_object "boulder"
 
-# Random objects
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'=',random,random
-OBJECT:'/',random,random
+soko_loot()
 
 # Rewards
@@ -526,10 +517,17 @@
 DOOR:closed,(17,15)
 REGION:(18,10,22,16),lit,"zoo",filled,true
-OBJECT:'(',"bag of holding",place[0]
-ENGRAVING:place[0],burn,"Elbereth"
 
+#soko_prize()
+  IF [50%] {
+    OBJECT:('"',"amulet of reflection"),$place[0]
+  } ELSE {
+    OBJECT:('(',"bag of holding"),$place[0]
+  }
+  ENGRAVING:$place[0],burn,"Elbereth"
 
-MAZE:"soko1-2",' '
-FLAGS:noteleport
+
+LEVEL:"soko1-2"
+FLAGS:noteleport,mazelevel,premapped
+INIT_MAP:solidfill,' '
 GEOMETRY:center,center
 #12345678901234567890123456789012345678901234567890
@@ -553,5 +551,6 @@
      -------     -------  
 ENDMAP
-RANDOM_PLACES:(16,10),(16,12),(16,14)
+$place = { (16,10),(16,12),(16,14) }
+SHUFFLE:$place
 STAIR:(06,15),down
 REGION:(00,00,25,16),lit,"ordinary"
@@ -560,26 +559,26 @@
 
 # Boulders
-OBJECT:'`',"boulder",(04,04)
-OBJECT:'`',"boulder",(02,06)
-OBJECT:'`',"boulder",(03,06)
-OBJECT:'`',"boulder",(04,07)
-OBJECT:'`',"boulder",(05,07)
-OBJECT:'`',"boulder",(02,08)
-OBJECT:'`',"boulder",(05,08)
-OBJECT:'`',"boulder",(03,09)
-OBJECT:'`',"boulder",(04,09)
-OBJECT:'`',"boulder",(03,10)
-OBJECT:'`',"boulder",(05,10)
-OBJECT:'`',"boulder",(06,12)
+OBJECT:('`',"boulder"),(04,04)
+OBJECT:('`',"boulder"),(02,06)
+OBJECT:('`',"boulder"),(03,06)
+OBJECT:('`',"boulder"),(04,07)
+OBJECT:('`',"boulder"),(05,07)
+OBJECT:('`',"boulder"),(02,08)
+OBJECT:('`',"boulder"),(05,08)
+OBJECT:('`',"boulder"),(03,09)
+OBJECT:('`',"boulder"),(04,09)
+OBJECT:('`',"boulder"),(03,10)
+OBJECT:('`',"boulder"),(05,10)
+OBJECT:('`',"boulder"),(06,12)
 #
-OBJECT:'`',"boulder",(07,14)
+OBJECT:('`',"boulder"),(07,14)
 #
-OBJECT:'`',"boulder",(11,05)
-OBJECT:'`',"boulder",(12,06)
-OBJECT:'`',"boulder",(10,07)
-OBJECT:'`',"boulder",(11,07)
-OBJECT:'`',"boulder",(10,08)
-OBJECT:'`',"boulder",(12,09)
-OBJECT:'`',"boulder",(11,10)
+OBJECT:('`',"boulder"),(11,05)
+OBJECT:('`',"boulder"),(12,06)
+OBJECT:('`',"boulder"),(10,07)
+OBJECT:('`',"boulder"),(11,07)
+OBJECT:('`',"boulder"),(10,08)
+OBJECT:('`',"boulder"),(12,09)
+OBJECT:('`',"boulder"),(11,10)
 
 # Traps
@@ -603,14 +602,8 @@
 TRAP:"hole",(22,01)
 
-MONSTER:'m',"giant mimic", random, m_object "boulder"
-MONSTER:'m',"giant mimic", random, m_object "boulder"
+MONSTER:('m',"giant mimic"), random, m_object "boulder"
+MONSTER:('m',"giant mimic"), random, m_object "boulder"
 
-# Random objects
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'%',random,random
-OBJECT:'=',random,random
-OBJECT:'/',random,random
+soko_loot()
 
 # Rewards
@@ -620,4 +613,9 @@
 DOOR:closed,(17,14)
 REGION:(18,09,22,15),lit,"zoo",filled,true
-OBJECT:'"',"amulet of reflection",place[0]
-ENGRAVING:place[0],burn,"Elbereth"
+#soko_prize()
+  IF [50%] {
+    OBJECT:('"',"amulet of reflection"),$place[0]
+  } ELSE {
+    OBJECT:('(',"bag of holding"),$place[0]
+  }
+  ENGRAVING:$place[0],burn,"Elbereth"
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/Tourist.des nethack/dat/Tourist.des
--- nh_orig/dat/Tourist.des	2003-12-07 18:39:12.000000000 -0500
+++ nethack/dat/Tourist.des	2010-08-16 13:20:13.633706782 -0400
@@ -9,6 +9,8 @@
 #	and receive your quest assignment.
 #
-MAZE: "Tou-strt",' '
-FLAGS: noteleport,hardfloor
+LEVEL: "Tou-strt"
+FLAGS: noteleport,hardfloor,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"giant spider"), (16,'S'), (16,"forest centaur"), (4,'C')
 GEOMETRY:center,center
 MAP
@@ -16,5 +18,5 @@
 ........}}...|.......|..|.-------------------------------------------...|...
 .........}}..|.......|..|.|......|......|.............|......|......|...|...
-..........}}.|.......|..|.|......+......+.............+......+..\...|...|...
+..........}}.|.......|..|.|......+......+.............+......+......|...|...
 ...........}}}..........|.|......|......|.............|......|......|...|...
 .............}}.........|.|----S-|--S---|S----------S-|---S--|------|...|...
@@ -71,62 +73,89 @@
 DOOR:locked,(36,07)
 # Monsters on siege duty.
-MONSTER: 's',"giant spider",random
-MONSTER: 's',"giant spider",random
-MONSTER: 's',"giant spider",random
-MONSTER: 's',"giant spider",random
-MONSTER: 's',"giant spider",random
-MONSTER: 's',"giant spider",random
-MONSTER: 's',"giant spider",random
-MONSTER: 's',"giant spider",random
-MONSTER: 's',"giant spider",random
-MONSTER: 's',"giant spider",random
-MONSTER: 's',"giant spider",random
-MONSTER: 's',"giant spider",random
-MONSTER: 's',random,random
-MONSTER: 's',random,random
-MONSTER: 'C',"forest centaur",random
-MONSTER: 'C',"forest centaur",random
-MONSTER: 'C',"forest centaur",random
-MONSTER: 'C',"forest centaur",random
-MONSTER: 'C',"forest centaur",random
-MONSTER: 'C',"forest centaur",random
-MONSTER: 'C',"forest centaur",random
-MONSTER: 'C',"forest centaur",random
-MONSTER: 'C',random,random
+LOOP [10 + 1d10] {
+  MONSTER: ('s',"giant spider"),random
+}
+MONSTER: 's',random
+MONSTER: 's',random
+LOOP [6 + 1d10] {
+  MONSTER: ('C',"forest centaur"),random
+}
+MONSTER: 'C',random
 # Twoflower
-MONSTER:'@',"Twoflower",(64,03)
+OBJECT:('\',"throne"),(64,03)
+MONSTER:('@',"Twoflower"),(64,03) {
+  OBJECT:random
+  OBJECT:random
+  OBJECT:random
+  OBJECT:random
+  OBJECT:random
+  OBJECT:random
+}
 # The treasure of Twoflower
-OBJECT:'(',"chest",(64,03)
+OBJECT:('(',"chest"),(64,03)
 # guides for the audience chamber
-MONSTER:'@',"guide",(29,03)
-MONSTER:'@',"guide",(32,04)
-MONSTER:'@',"guide",(35,02)
-MONSTER:'@',"guide",(38,03)
-MONSTER:'@',"guide",(45,03)
-MONSTER:'@',"guide",(48,02)
-MONSTER:'@',"guide",(49,04)
-MONSTER:'@',"guide",(51,03)
-MONSTER:'@',"guide",(57,03)
-MONSTER:'@',"guide",(62,04)
-MONSTER:'@',"guide",(66,04)
+MONSTER:('@',"guide"),(29,03) {
+  OBJECT:random
+  OBJECT[25%]:random
+}
+MONSTER:('@',"guide"),(32,04) {
+  OBJECT:random
+  OBJECT[25%]:random
+}
+MONSTER:('@',"guide"),(35,02) {
+  OBJECT:random
+  OBJECT[25%]:random
+}
+MONSTER:('@',"guide"),(38,03) {
+  OBJECT:random
+  OBJECT[25%]:random
+}
+MONSTER:('@',"guide"),(45,03) {
+  OBJECT:random
+  OBJECT[25%]:random
+}
+MONSTER:('@',"guide"),(48,02) {
+  OBJECT:random
+  OBJECT[25%]:random
+}
+MONSTER:('@',"guide"),(49,04) {
+  OBJECT:random
+  OBJECT[25%]:random
+}
+MONSTER:('@',"guide"),(51,03) {
+  OBJECT:random
+  OBJECT[25%]:random
+}
+MONSTER:('@',"guide"),(57,03) {
+  OBJECT:random
+  OBJECT[25%]:random
+}
+MONSTER:('@',"guide"),(62,04) {
+  OBJECT:random
+  OBJECT[25%]:random
+}
+MONSTER:('@',"guide"),(66,04) {
+  OBJECT:random
+  OBJECT[25%]:random
+}
 # path guards
-MONSTER:'@',"watchman",(35,08)
-MONSTER:'@',"watchman",(36,08)
+MONSTER:('@',"watchman"),(35,08) {
+  OBJECT:'['
+  OBJECT:')'
+}
+MONSTER:('@',"watchman"),(36,08) {
+  OBJECT:'['
+  OBJECT:')'
+}
 # river monsters
-MONSTER:';',"giant eel",(62,12)
-MONSTER:';',"piranha",(47,10)
-MONSTER:';',"piranha",(29,11)
-MONSTER:';',"kraken",(34,09)
-MONSTER:';',"kraken",(37,09)
+MONSTER:(';',"giant eel"),(62,12)
+MONSTER:(';',"piranha"),(47,10)
+MONSTER:(';',"piranha"),(29,11)
+MONSTER:(';',"kraken"),(34,09)
+MONSTER:(';',"kraken"),(37,09)
 # Random traps
+LOOP [7 + 1d10] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 
 #
@@ -137,6 +166,8 @@
 #
 
-MAZE: "Tou-loca",' '
-FLAGS: hardfloor
+LEVEL: "Tou-loca"
+FLAGS: hardfloor,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"giant spider"), (16,'S'), (16,"forest centaur"), (4,'C')
 GEOMETRY:center,center
 MAP
@@ -152,5 +183,5 @@
 |....+.....+.........S...|...........|....|-------|........................|
 |....|.....|.........|...|.|---------|....|.........|-------|.|----------|.|
-|....|.....|---------|---|.|......|..+....|-------|.|.......|.+......S.\.|.|
+|....|.....|---------|---|.|......|..+....|-------|.|.......|.+......S...|.|
 |....|.....+.........S...|.|......|..|....|.......|.|.......|.|......|...|.|
 |-------|..|.........|---|.|+-------------------+-|.|.......+.|----------|.|
@@ -243,50 +274,21 @@
 
 # Objects
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+LOOP [10 + 1d10] {
+  OBJECT:random,random
+}
 # Toilet paper
-OBJECT:'?',"blank paper",(71,12)
-OBJECT:'?',"blank paper",(71,12)
+OBJECT:('\',"throne"),(71,11)
+OBJECT:('?',"blank paper"),(71,12)
+OBJECT:('?',"blank paper"),(71,12)
 # Random traps
+LOOP [5 + 1d10] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Random monsters.
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',random,random
-MONSTER:'s',random,random
+LOOP [10 + 2d10] {
+  MONSTER:('s',"giant spider"),random
+}
+MONSTER:'s',random
+MONSTER:'s',random
 
 #
@@ -298,5 +300,8 @@
 #
 
-MAZE: "Tou-goal", ' '
+LEVEL: "Tou-goal"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"giant spider"), (16,'S'), (16,"forest centaur"), (4,'C')
 GEOMETRY:center,center
 MAP
@@ -385,68 +390,49 @@
 DOOR:open,(59,17)
 # Objects
-OBJECT:'(',"credit card",(04,01),blessed,0,"The Platinum Yendorian Express Card"
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:('(',"credit card"),(04,01),blessed,0,NAME:"The Platinum Yendorian Express Card"
+LOOP [8 + 1d5] {
+  OBJECT:random,random
+}
 # Random traps
+LOOP [3 + 1d5] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Random monsters.
-MONSTER:'@',"Master of Thieves",(04,01),hostile
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',"giant spider",random
-MONSTER:'s',random,random
-MONSTER:'s',random,random
+MONSTER:('@',"Master of Thieves"),(04,01),hostile {
+  OBJECT:('(', "Bell of Opening"),uncursed
+  OBJECT:'['
+  OBJECT:')'
+  OBJECT:'!'
+  OBJECT:'!'
+  OBJECT:'!'
+  OBJECT:'!'
+}
+LOOP [10 + 2d5] {
+  MONSTER:('s',"giant spider"),random
+}
+MONSTER:'s',random
+MONSTER:'s',random
 # ladies of the evening
-MONSTER:'&',"succubus",(02,08)
-MONSTER:'&',"succubus",(08,08)
-MONSTER:'&',"incubus",(02,14)
-MONSTER:'&',"incubus",(08,14)
-MONSTER:'&',"incubus",(02,17)
-MONSTER:'&',"incubus",(08,17)
+MONSTER:('&',"succubus"),(02,08)
+MONSTER:('&',"succubus"),(08,08)
+MONSTER:('&',"incubus"),(02,14)
+MONSTER:('&',"incubus"),(08,14)
+MONSTER:('&',"incubus"),(02,17)
+MONSTER:('&',"incubus"),(08,17)
 # Police station (with drunken prisoners)
-MONSTER:'K',"Kop Kaptain",(24,09),hostile
-MONSTER:'K',"Kop Lieutenant",(20,09),hostile
-MONSTER:'K',"Kop Lieutenant",(22,11),hostile
-MONSTER:'K',"Kop Lieutenant",(22,07),hostile
-MONSTER:'K',"Keystone Kop",(19,07),hostile
-MONSTER:'K',"Keystone Kop",(19,08),hostile
-MONSTER:'K',"Keystone Kop",(22,09),hostile
-MONSTER:'K',"Keystone Kop",(24,11),hostile
-MONSTER:'K',"Keystone Kop",(19,11),hostile
-MONSTER:'@',"prisoner",(19,13)
-MONSTER:'@',"prisoner",(21,13)
-MONSTER:'@',"prisoner",(24,13)
+MONSTER:('K',"Kop Kaptain"),(24,09),hostile
+MONSTER:('K',"Kop Lieutenant"),(20,09),hostile
+MONSTER:('K',"Kop Lieutenant"),(22,11),hostile
+MONSTER:('K',"Kop Lieutenant"),(22,07),hostile
+MONSTER:('K',"Keystone Kop"),(19,07),hostile
+MONSTER:('K',"Keystone Kop"),(19,08),hostile
+MONSTER:('K',"Keystone Kop"),(22,09),hostile
+MONSTER:('K',"Keystone Kop"),(24,11),hostile
+MONSTER:('K',"Keystone Kop"),(19,11),hostile
+MONSTER:('@',"prisoner"),(19,13)
+MONSTER:('@',"prisoner"),(21,13)
+MONSTER:('@',"prisoner"),(24,13)
 #
-MONSTER:'@',"watchman",(33,10),hostile
+MONSTER:('@',"watchman"),(33,10),hostile
 
 WALLIFY
@@ -459,6 +445,8 @@
 #
 
-MAZE: "Tou-fila" , ' '
-INIT_MAP: '.' , ' ', true, true, random, true
+LEVEL: "Tou-fila"
+FLAGS:mazelevel,noflip
+INIT_MAP: mines, '.' , ' ', true, true, random, true
+MON_GENERATION:86%, (64,"giant spider"), (16,'S'), (16,"forest centaur"), (4,'C')
 NOMAP
 #
@@ -466,27 +454,22 @@
 STAIR: random, down
 #
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+LOOP [2 + 2d4] {
+  OBJECT: random, random
+}
 #
+LOOP [2 + 2d4] {
 TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
+}
 #
-MONSTER: '@', "soldier", random, hostile
-MONSTER: '@', "soldier", random, hostile
-MONSTER: '@', "soldier", random, hostile
-MONSTER: '@', "soldier", random, hostile
-MONSTER: '@', "soldier", random, hostile
-MONSTER: 'H', random, random, hostile
-MONSTER: 'C', random, random, hostile
+LOOP [2 + 2d4] {
+  MONSTER: ('@', "soldier"), random, hostile
+}
+MONSTER: 'H', random, hostile
+MONSTER: 'C', random, hostile
 
-MAZE: "Tou-filb" , ' '
-INIT_MAP: '.' , ' ', true, true, random, true
+LEVEL: "Tou-filb"
+FLAGS:mazelevel,noflip
+INIT_MAP: mines, '.' , ' ', true, true, random, true
+MON_GENERATION:86%, (64,"giant spider"), (16,'S'), (16,"forest centaur"), (4,'C')
 NOMAP
 #
@@ -494,26 +477,19 @@
 STAIR: random, down
 #
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+LOOP [7 + 2d4] {
+  OBJECT: random, random
+}
 #
+LOOP [4 + 2d4] {
 TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
+}
 #
-MONSTER: '@', "soldier", random, hostile
-MONSTER: '@', "captain", random, hostile
-MONSTER: '@', "captain", random, hostile
-MONSTER: 'H', random, random, hostile
-MONSTER: 'H', random, random, hostile
-MONSTER: 'C', random, random, hostile
-MONSTER: 's', random, random
+LOOP [2d4] {
+  MONSTER: ('@', "soldier"), random, hostile
+  MONSTER: 'C', random, hostile
+  MONSTER: 's', random
+}
+MONSTER: ('@', "captain"), random, hostile
+MONSTER: ('@', "captain"), random, hostile
+MONSTER: 'H', random, hostile
+MONSTER: 'H', random, hostile
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/tower.des nethack/dat/tower.des
--- nh_orig/dat/tower.des	2003-12-07 18:39:13.000000000 -0500
+++ nethack/dat/tower.des	2010-04-11 12:36:58.306750100 -0400
@@ -4,6 +4,7 @@
 #
 # Upper stage of Vlad's tower
-MAZE:"tower1",' '
-FLAGS: noteleport,hardfloor
+LEVEL:"tower1"
+FLAGS: noteleport,hardfloor,mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:half-left,center
 MAP
@@ -13,5 +14,5 @@
 |.......+.+...|
 ---+-----.-----
-  |...\.|.+.|  
+  |.....|.+.|  
 ---+-----.-----
 |.......+.+...|
@@ -22,11 +23,15 @@
 LADDER:(11,05),down
 # The lord and his court
-MONSTER:'V',"Vlad the Impaler",(06,05)
-MONSTER:'V',random,(03,09)
-MONSTER:'V',random,(07,09)
-MONSTER:'V',random,(11,09)
-MONSTER:'V',random,(03,01)
-MONSTER:'V',random,(07,01)
-MONSTER:'V',random,(11,01)
+OBJECT:('\',"throne"),(06,05)
+MONSTER:('V',"Vlad the Impaler"),(06,05) {
+  OBJECT:(')',"two-handed sword"),1d3,NAME:"Lifestealer",cursed,erodeproof
+  OBJECT:('(',"Candelabrum of Invocation")
+}
+MONSTER:'V',(03,09)
+MONSTER:'V',(07,09)
+MONSTER:'V',(11,09)
+MONSTER:'V',(03,01)
+MONSTER:'V',(07,01)
+MONSTER:'V',(11,01)
 # The doors
 DOOR:closed,(08,03)
@@ -38,11 +43,11 @@
 DOOR:closed,(03,06)
 # treasures
-OBJECT:'(',"chest",(07,05)
-OBJECT:'(',"chest",(03,09)
-OBJECT:'(',"chest",(07,09)
-OBJECT:'(',"chest",(11,09)
-OBJECT:'(',"chest",(03,01)
-OBJECT:'(',"chest",(07,01)
-OBJECT:'(',"chest",(11,01)
+OBJECT:('(',"chest"),(07,05)
+OBJECT:('(',"chest"),(03,09)
+OBJECT:('(',"chest"),(07,09)
+OBJECT:('(',"chest"),(11,09)
+OBJECT:('(',"chest"),(03,01)
+OBJECT:('(',"chest"),(07,01)
+OBJECT:('(',"chest"),(11,01)
 # We have to protect the tower against outside attacks
 NON_DIGGABLE:(00,00,14,10)
@@ -50,6 +55,7 @@
 
 # Intermediate stage of Vlad's tower
-MAZE:"tower2",' '
-FLAGS: noteleport,hardfloor
+LEVEL:"tower2"
+FLAGS: noteleport,hardfloor,mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:half-left,center
 MAP
@@ -67,22 +73,25 @@
 ENDMAP
 # Random places are the 10 niches
-RANDOM_PLACES:(03,01),(07,01),(11,01),(01,03),(13,03),
-	      (01,07),(13,07),(03,09),(07,09),(11,09)
+$place = { (03,01),(07,01),(11,01),(01,03),(13,03),
+	      (01,07),(13,07),(03,09),(07,09),(11,09) }
+SHUFFLE:$place
 LADDER:(11,05),up
 LADDER:(03,07),down
 DOOR:locked,(10,04)
 DOOR:locked,(09,07)
-MONSTER:'&',random,place[0]
-MONSTER:'&',random,place[1]
-MONSTER:'d',"hell hound pup",place[2]
-MONSTER:'d',"hell hound pup",place[3]
-MONSTER:'d',"winter wolf",place[4]
-CONTAINER:'(',"chest",place[5]
-OBJECT:'"',"amulet of life saving",contained
-CONTAINER:'(',"chest",place[6]
-OBJECT:'"',"amulet of strangulation",contained
-OBJECT:'[',"water walking boots",place[7]
-OBJECT:'[',"crystal plate mail",place[8]
-OBJECT:'+',"invisibility",place[9]
+MONSTER:'&',$place[0]
+MONSTER:'&',$place[1]
+MONSTER:('d',"hell hound pup"),$place[2]
+MONSTER:('d',"hell hound pup"),$place[3]
+MONSTER:('d',"winter wolf"),$place[4]
+CONTAINER:('(',"chest"),$place[5] {
+  OBJECT:('"',"amulet of life saving")
+}
+CONTAINER:('(',"chest"),$place[6] {
+  OBJECT:('"',"amulet of strangulation")
+}
+OBJECT:('[',"water walking boots"),$place[7]
+OBJECT:('[',"crystal plate mail"),$place[8]
+OBJECT:('+',"invisibility"),$place[9]
 # Walls in the tower are non diggable
 NON_DIGGABLE:(00,00,14,10)
@@ -90,6 +99,7 @@
 
 # Bottom most stage of Vlad's tower
-MAZE:"tower3",' '
-FLAGS: noteleport,hardfloor
+LEVEL:"tower3"
+FLAGS: noteleport,hardfloor,mazelevel
+INIT_MAP:solidfill,' '
 GEOMETRY:half-left,center
 MAP
@@ -109,6 +119,7 @@
 ENDMAP
 # Random places are the 10 niches
-RANDOM_PLACES:(05,01),(09,01),(13,01),(03,03),(15,03),
-	      (03,07),(15,07),(05,09),(09,09),(13,09)
+$place = { (05,01),(09,01),(13,01),(03,03),(15,03),
+	      (03,07),(15,07),(05,09),(09,09),(13,09) }
+SHUFFLE:$place
 BRANCH:(02,05,02,05),(00,00,00,00)
 LADDER:(05,07),up
@@ -116,21 +127,18 @@
 DOOR:locked,(14,05)
 # Let's put a dragon behind the door, just for the fun...
-MONSTER:'D',random,(13,05)
-MONSTER:random,random,(12,04)
-MONSTER:random,random,(12,06)
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-MONSTER:random,random,random
-OBJECT:')',"long sword",place[0]
-TRAP:random,place[0]
-OBJECT:'(',"lock pick",place[1]
-TRAP:random,place[1]
-OBJECT:'[',"elven cloak",place[2]
-TRAP:random,place[2]
-OBJECT:'(',"blindfold",place[3]
-TRAP:random,place[3]
+MONSTER:'D',(13,05)
+MONSTER:random,(12,04)
+MONSTER:random,(12,06)
+LOOP [4 + 3d4] {
+  MONSTER:random,random
+}
+OBJECT:(')',"long sword"),$place[0]
+TRAP:random,$place[0]
+OBJECT:('(',"lock pick"),$place[1]
+TRAP:random,$place[1]
+OBJECT:('[',"elven cloak"),$place[2]
+TRAP:random,$place[2]
+OBJECT:('(',"blindfold"),$place[3]
+TRAP:random,$place[3]
 # Walls in the tower are non diggable
 NON_DIGGABLE:(00,00,18,12)
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/Valkyrie.des nethack/dat/Valkyrie.des
--- nh_orig/dat/Valkyrie.des	2003-12-07 18:39:12.000000000 -0500
+++ nethack/dat/Valkyrie.des	2010-08-16 13:20:13.633706782 -0400
@@ -9,29 +9,46 @@
 #	and receive your quest assignment.
 #
-MAZE: "Val-strt",' '
-FLAGS: noteleport,hardfloor
+LEVEL: "Val-strt"
+FLAGS: noteleport,hardfloor,mazelevel
+INIT_MAP:solidfill,'I'
+
+# This works because the random coordinates in $pools are evaluated once,
+# when the variable is initialized.
+$pools = selection: random & random & random & random & random &
+	   random & random & random & random & random & random &
+	   random & random &
+	   grow(west, random) &
+	   grow(north, random) &
+	   grow(random & random)
+TERRAIN:grow($pools), 'P'
+TERRAIN:$pools, 'L'
+
+MON_GENERATION:86%, (64,"fire ant"), (16,'a'), (16,"fire giant"), (4,'H')
 GEOMETRY:center,center
 MAP
-IIIIIIPPPIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
-IIIIPPPPPIIIIIIII..IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII...IIIIIIIIIIIIIIIIIIIII
-IIIIPLLPPIIIIIII..IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII..{..IIIIIIIIIIIIIIIIIIII
-IIIIPLPPIIIIIII..IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII.....IIIIIIPPPIIIIIIIIII
-IIIPPPPPIIIIII..IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII.IIIIIPPLPIIIIIIIIII
-IIIIPIIIIIIII..IIIIPPPIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII.IIIIIPLPPIIIIIIIIII
-IIIIIIIIIIII..IIIIIPLPPIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII..IIIIIPPPIIIIIIIIIII
-IIIIIIII.....IIIIIIPPPIIII|----------------|IIIIIPPPIII.IIIIIIIIIIIIIIIIIIII
-IIIIIII..III...IIIIIIIIIII|................|IIIIIPLPII..IIIIIIIIIIIIIIIIIIII
-IIIIII..IIIIII......IIIII.|................|.IIIIPPPII.IIIIIIIIIIIIIIIIIIIII
-IIIII..IIIIIIIIIIII.......+................+...IIIIIII.IIIIIIIIIIIIIIIIIIIII
-IIII..IIIIIIIII.....IIIII.|................|.I...IIIII.IIIIIIIIIIIIIIIIIIIII
-III..IIIIIIIII..IIIIIIIIII|................|IIII.......IIIIIIIIIIIIIIIIIIIII
-IIII..IIIIIII..IIIIIIIIIII|----------------|IIIIIIIIII...IIIIIIIIIIIIIIIIIII
-IIIIII..IIII..IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIPPPPIIII...IIIIIIIIIIIIIIIII
-IIIIIII......IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIPLLPPIIIII...IIIIIIIIIIIIIII
-IIIIPPPIP...IIIIIIIIIIIPIIIIIIIIIIIIIIIIIIIIIIIIPPPPIIIIIIII...I......IIIIII
-IIIPPLPPIIIIIIIIIIIIIIPPPIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII.........IIIII
-IIIIPPPIIIIIIIIIIIIIIPPLPIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII.......IIIIII
-IIIIIIIIIIIIIIIIIIIIIIPPPIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+xxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxxxxxx
+xxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..{..xxxxxxxxxxxxxxxxxxxx
+xxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.....xxxxxxxxxxxxxxxxxxx
+xxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxx
+xxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxx
+xxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx..xxxxxxxxxxxxxxxxxxx
+xxxxxxxx.....xxxxxxxxxxxxx|----------------|xxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxx
+xxxxxxx..xxx...xxxxxxxxxxx|................|xxxxxxxxxx..xxxxxxxxxxxxxxxxxxxx
+xxxxxx..xxxxxx......xxxxx.|................|.xxxxxxxxx.xxxxxxxxxxxxxxxxxxxxx
+xxxxx..xxxxxxxxxxxx.......+................+...xxxxxxx.xxxxxxxxxxxxxxxxxxxxx
+xxxx..xxxxxxxxx.....xxxxx.|................|.x...xxxxx.xxxxxxxxxxxxxxxxxxxxx
+xxx..xxxxxxxxx..xxxxxxxxxx|................|xxxx.......xxxxxxxxxxxxxxxxxxxxx
+xxxx..xxxxxxx..xxxxxxxxxxx|----------------|xxxxxxxxxx...xxxxxxxxxxxxxxxxxxx
+xxxxxx..xxxx..xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxxxx
+xxxxxxx......xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...xxxxxxxxxxxxxxx
+xxxxxxxxx...xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...x......xxxxxx
+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.........xxxxx
+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.......xxxxxx
+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 ENDMAP
+
+REPLACE_TERRAIN:(00,00,75,19), 'I', 'P', 2%
+
 # Dungeon Description
 REGION:(00,00,75,19),lit,"ordinary"
@@ -46,38 +63,64 @@
 DOOR:locked,(43,10)
 # Norn
-MONSTER:'@',"Norn",(35,10)
+MONSTER:('@',"Norn"),(35,10) {
+  OBJECT:'['
+  OBJECT:')'
+  OBJECT:'?'
+  OBJECT:'?'
+}
 # The treasure of the Norn
-OBJECT:'(',"chest",(36,10)
+OBJECT:('(',"chest"),(36,10)
 # valkyrie guards for the audience chamber
-MONSTER:'@',"warrior",(27,08)
-MONSTER:'@',"warrior",(27,09)
-MONSTER:'@',"warrior",(27,11)
-MONSTER:'@',"warrior",(27,12)
-MONSTER:'@',"warrior",(42,08)
-MONSTER:'@',"warrior",(42,09)
-MONSTER:'@',"warrior",(42,11)
-MONSTER:'@',"warrior",(42,12)
+MONSTER:('@',"warrior"),(27,08) {
+  OBJECT[75%]:'['
+  OBJECT[75%]:')'
+}
+MONSTER:('@',"warrior"),(27,09) {
+  OBJECT[75%]:'['
+  OBJECT[75%]:')'
+}
+MONSTER:('@',"warrior"),(27,11) {
+  OBJECT[75%]:'['
+  OBJECT[75%]:')'
+}
+MONSTER:('@',"warrior"),(27,12) {
+  OBJECT[75%]:'['
+  OBJECT[75%]:')'
+}
+MONSTER:('@',"warrior"),(42,08) {
+  OBJECT[75%]:'['
+  OBJECT[75%]:')'
+}
+MONSTER:('@',"warrior"),(42,09) {
+  OBJECT[75%]:'['
+  OBJECT[75%]:')'
+}
+MONSTER:('@',"warrior"),(42,11) {
+  OBJECT[75%]:'['
+  OBJECT[75%]:')'
+}
+MONSTER:('@',"warrior"),(42,12) {
+  OBJECT[75%]:'['
+  OBJECT[75%]:')'
+}
 # Non diggable walls
 NON_DIGGABLE:(26,07,43,13)
 # Random traps
+LOOP [3 + 3d5] {
 TRAP:"fire",random
-TRAP:"fire",random
-TRAP:"fire",random
-TRAP:"fire",random
-TRAP:"fire",random
-TRAP:"fire",random
+}
 # Monsters on siege duty.
-MONSTER: 'a',"fire ant",(04,12)
-MONSTER: 'a',"fire ant",(08,08)
-MONSTER: 'a',"fire ant",(14,04)
-MONSTER: 'a',"fire ant",(17,11)
-MONSTER: 'a',"fire ant",(24,10)
-MONSTER: 'a',"fire ant",(45,10)
-MONSTER: 'a',"fire ant",(54,02)
-MONSTER: 'a',"fire ant",(55,07)
-MONSTER: 'a',"fire ant",(58,14)
-MONSTER: 'a',"fire ant",(63,17)
-MONSTER: 'H',"fire giant",(18,01),hostile
-MONSTER: 'H',"fire giant",(10,16),hostile
+MONSTER: ('a',"fire ant"),(04,12)
+MONSTER: ('a',"fire ant"),(08,08)
+MONSTER: ('a',"fire ant"),(14,04)
+MONSTER: ('a',"fire ant"),(17,11)
+MONSTER: ('a',"fire ant"),(24,10)
+MONSTER: ('a',"fire ant"),(45,10)
+MONSTER: ('a',"fire ant"),(54,02)
+MONSTER: ('a',"fire ant"),(55,07)
+MONSTER: ('a',"fire ant"),(58,14)
+MONSTER: ('a',"fire ant"),(63,17)
+MONSTER: ('H',"fire giant"),(18,01),hostile
+MONSTER: ('H',"fire giant"),(10,16),hostile
 
 #
@@ -88,7 +131,8 @@
 #
 
-MAZE: "Val-loca",' '
-FLAGS: hardfloor
-INIT_MAP: '.' , 'I' , true , true , lit , false
+LEVEL: "Val-loca"
+FLAGS: hardfloor,mazelevel
+INIT_MAP: mines, '.' , 'I' , true , true , lit , false
+MON_GENERATION:86%, (64,"fire ant"), (16,'a'), (16,"fire giant"), (4,'H')
 GEOMETRY:center,center
 MAP
@@ -115,54 +159,23 @@
 NON_DIGGABLE:(00,00,39,12)
 # Objects
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+LOOP [6 + 3d5] {
+  OBJECT:random,random
+}
 # Random traps
+LOOP [2 + 3d5] {
 TRAP:"fire",random
-TRAP:"fire",random
-TRAP:"fire",random
-TRAP:"fire",random
+}
 TRAP:random,random
 TRAP:random,random
 # Random monsters.
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',random,random
-MONSTER:'H',random,random,hostile
-MONSTER:'H',"fire giant",random,hostile
-MONSTER:'H',"fire giant",random,hostile
-MONSTER:'H',"fire giant",random,hostile
-MONSTER:'H',"fire giant",random,hostile
-MONSTER:'H',"fire giant",random,hostile
-MONSTER:'H',"fire giant",random,hostile
-MONSTER:'H',"fire giant",random,hostile
-MONSTER:'H',random,random,hostile
+LOOP [10 + 3d5] {
+  MONSTER:('a',"fire ant"),random
+}
+MONSTER:'a',random
+MONSTER:'H',random,hostile
+LOOP [2 + 3d5] {
+  MONSTER:('H',"fire giant"),random,hostile
+}
+MONSTER:'H',random,hostile
 
 #
@@ -174,14 +187,16 @@
 #
 
-MAZE: "Val-goal", 'L'
-INIT_MAP: '.' , 'L' , true , true , lit , false
+LEVEL: "Val-goal"
+FLAGS:mazelevel
+INIT_MAP: mines, '.' , 'L' , true , true , lit , false
+MON_GENERATION:86%, (64,"fire ant"), (16,'a'), (16,"fire giant"), (4,'H')
 GEOMETRY:center,center
 MAP
-.L............................LLLLL
-LLL.........LLLLL.LLLLL.........LLL
-.LLL......LLLLLLLLLLLLLLL.......LL.
-.LLL.....LLL|---------|LLL.....L...
-..LL....LL|--.........--|LL.....LLL
-.......LL|-...LLLLLLL...-|LL.....L.
+xLxxxx......................xxLLLLL
+LLLx........LLLLL.LLLLL.......xxLLL
+xLLL......LLLLLLLLLLLLLLL......xLLx
+xLLL.....LLL|---------|LLL.....Lxxx
+xxLL....LL|--.........--|LL.....LLL
+x......LL|-...LLLLLLL...-|LL.....Lx
 .......LL|...LL.....LL...|LL.......
 ......LL|-..LL.......LL..-|LL......
@@ -189,10 +204,10 @@
 ......LL|-..LL.......LL..-|LL......
 .......LL|...LL.....LL...|LL.......
-.......LL|-...LLLLLLL...-|LL.......
-..L.....LL|--.........--|LL.....LL.
-..LL.....LLL|---------|LLL....LLLL.
-..LLL.....LLLLLLLLLLLLLLL...LLLLL..
-.LLLL.......LLLLL.LLLLL.....LLLL...
-..LL...............................
+.......LL|-...LLLLLLL...-|LL......x
+x.L.....LL|--.........--|LL.....LLx
+xxLL.....LLL|---------|LLL....LLLLx
+xxLLL.....LLLLLLLLLLLLLLL...LLLLLxx
+xLLLL.......LLLLL.LLLLL.....LLLLxxx
+xxLLxxx....................xxxxxxxx
 ENDMAP
 # Dungeon Description
@@ -207,51 +222,39 @@
 DRAWBRIDGE:(17,14),north,open
 # Objects
-OBJECT:'(',"crystal ball",(17,08),blessed,5,"The Orb of Fate"
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:('(',"crystal ball"),(17,08),blessed,5,NAME:"The Orb of Fate"
+LOOP [4 + 3d5] {
+  OBJECT:random,random
+}
 # Traps
 TRAP:"board",(13,08)
 TRAP:"board",(21,08)
 # Random traps
+LOOP [2 + 2d3] {
 TRAP:"fire",random
-TRAP:"fire",random
-TRAP:"fire",random
-TRAP:"fire",random
+}
 TRAP:"board",random
 TRAP:random,random
 TRAP:random,random
 # Random monsters.
-MONSTER:'H',"Lord Surtur",(17,08)
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',"fire ant",random
-MONSTER:'a',random,random
-MONSTER:'a',random,random
-MONSTER:'H',"fire giant",(10,06),hostile
-MONSTER:'H',"fire giant",(10,07),hostile
-MONSTER:'H',"fire giant",(10,08),hostile
-MONSTER:'H',"fire giant",(10,09),hostile
-MONSTER:'H',"fire giant",(10,10),hostile
-MONSTER:'H',"fire giant",(24,06),hostile
-MONSTER:'H',"fire giant",(24,07),hostile
-MONSTER:'H',"fire giant",(24,08),hostile
-MONSTER:'H',"fire giant",(24,09),hostile
-MONSTER:'H',"fire giant",(24,10),hostile
-MONSTER:'H',"fire giant",random,hostile
-MONSTER:'H',"fire giant",random,hostile
-MONSTER:'H',random,random,hostile
+MONSTER:('H',"Lord Surtur"),(17,08) {
+  OBJECT:('(', "Bell of Opening"),uncursed
+  OBJECT:'['
+  OBJECT:')'
+  OBJECT:random
+  OBJECT:random
+}
+LOOP [2 + 2d3] {
+  MONSTER:('a',"fire ant"),random
+}
+MONSTER:'a',random
+MONSTER:'a',random
+REGION:(10,6,10,6),lit,"ordinary",filled, true {
+  LOOP [5 + 4d3] {
+    MONSTER:('H',"fire giant"),random,hostile
+  }
+}
+MONSTER:('H',"fire giant"),random,hostile
+MONSTER:('H',"fire giant"),random,hostile
+MONSTER:'H',random,hostile
 
 #
@@ -264,6 +267,8 @@
 #
 
-MAZE: "Val-fila" , 'I'
-INIT_MAP: '.' , 'I' , true , true , lit, false
+LEVEL: "Val-fila"
+FLAGS:mazelevel,noflip
+INIT_MAP: mines, '.' , 'I' , true , true , lit, false
+MON_GENERATION:86%, (64,"fire ant"), (16,'a'), (16,"fire giant"), (4,'H')
 NOMAP
 #
@@ -271,32 +276,22 @@
 STAIR: random, down
 #
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+LOOP [5 + 2d3] {
+  OBJECT: random, random
+}
 #
-MONSTER: 'a', "fire ant", random
-MONSTER: 'a', "fire ant", random
-MONSTER: 'a', "fire ant", random
-MONSTER: 'a', "fire ant", random
-MONSTER: 'a', "fire ant", random
-MONSTER: 'a', random, random
-MONSTER: 'H', "fire giant", random, hostile
+LOOP [2 + 2d2] {
+  MONSTER: ('a', "fire ant"), random
+}
+MONSTER: 'a', random
+MONSTER: ('H', "fire giant"), random, hostile
 #
+LOOP [6 + 2d2] {
 TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
-TRAP: random, random
+}
 
-MAZE: "Val-filb" , 'L'
-INIT_MAP: '.' , 'L' , true , true , lit, false
+LEVEL: "Val-filb"
+FLAGS:mazelevel,noflip
+INIT_MAP: mines, '.' , 'L' , true , true , lit, false
+MON_GENERATION:86%, (64,"fire ant"), (16,'a'), (16,"fire giant"), (4,'H')
 NOMAP
 #
@@ -304,29 +299,17 @@
 STAIR: random, down
 #
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+LOOP [8 + 2d2] {
+  OBJECT: random, random
+}
 #
-MONSTER: 'a', "fire ant", random
-MONSTER: 'a', "fire ant", random
-MONSTER: 'a', "fire ant", random
-MONSTER: 'a', random, random
-MONSTER: 'H', "fire giant", random, hostile
-MONSTER: 'H', "fire giant", random, hostile
-MONSTER: 'H', "fire giant", random, hostile
+LOOP [3 + 2d2] {
+  MONSTER: ('a', "fire ant"), random
+  MONSTER[80%]: ('H', "fire giant"), random, hostile
+}
+MONSTER: 'a', random
 #
+LOOP [3 + 3d2] {
 TRAP: "fire", random
-TRAP: "fire", random
-TRAP: "fire", random
-TRAP: "fire", random
-TRAP: "fire", random
+}
 TRAP: random, random
 TRAP: random, random
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/Wizard.des nethack/dat/Wizard.des
--- nh_orig/dat/Wizard.des	2003-12-07 18:39:12.000000000 -0500
+++ nethack/dat/Wizard.des	2010-04-29 10:53:24.170716015 -0400
@@ -8,6 +8,8 @@
 #	and receive your quest assignment.
 #
-MAZE: "Wiz-strt",' '
-FLAGS: noteleport,hardfloor
+LEVEL: "Wiz-strt"
+FLAGS: noteleport,hardfloor,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"vampire bat"), (16,'B'), (16,"xorn"), (4,'W')
 GEOMETRY:center,center
 MAP
@@ -17,10 +19,10 @@
 ........CC........-----------.......C.C...C...C....C........................
 .......C.....---------------------...C..C..C..C.............................
-......C..C...------....\....------....C.....C...............................
+......C..C...------.........------....C.....C...............................
 ........C...||....|.........|....||.........................................
 .......C....||....|.........+....||.........................................
 .......C...||---+--.........|....|||........................................
 ......C....||...............|--S--||........................................
-...........||--+--|++----|---|..|.SS..........C......C......................
+...........||--+--|++----|---|..|.||..........C......C......................
 ........C..||.....|..|...|...|--|.||..CC..C.....C..........C................
 .......C...||.....|..|.--|.|.|....||.................C..C...................
@@ -33,4 +35,13 @@
 ......................CCC.C.................................................
 ENDMAP
+
+SPILL:(60,15), '}', west, 20
+SPILL:(69,15), '}', north, 20
+
+# first do cloud everywhere
+REPLACE_TERRAIN:(0,0, 75,19), '.', 'C', 10%
+# then replace clouds inside the tower back to floor
+REPLACE_TERRAIN:(13,5, 33,15), 'C', '.', 100%
+
 # Dungeon Description
 REGION:(00,00,75,19),lit,"ordinary"
@@ -42,4 +53,6 @@
 STAIR:(30,10),down
 # Portal arrival point
+# need to make sure it's clear
+TERRAIN:(63,06),'.'
 BRANCH:(63,06,63,06),(0,0,0,0)
 # Doors
@@ -47,51 +60,98 @@
 DOOR:closed,(16,08)
 DOOR:closed,(28,07)
-DOOR:locked,(34,10)
-DOOR:locked,(35,10)
 DOOR:closed,(15,10)
 DOOR:locked,(19,10)
 DOOR:locked,(20,10)
+
+# Entrance into the tower
+SWITCH [3] {
+  CASE 0:
+    TERRAIN:(20,16),'S'
+    TERRAIN:(20,17),'S'
+    DOOR:locked,(20,16)
+    DOOR:locked,(20,17)
+    BREAK
+  CASE 1:
+    TERRAIN:(32,15),'S'
+    TERRAIN:(32,16),'S'
+    DOOR:locked,(32,15)
+    DOOR:locked,(32,16)
+    BREAK
+  CASE 2:
+  DEFAULT:
+    TERRAIN:(34,10),'S'
+    TERRAIN:(35,10),'S'
+    DOOR:locked,(34,10)
+    DOOR:locked,(35,10)
+    BREAK
+}
+
 # Neferet the Green, the quest leader
-MONSTER:'@',"Neferet the Green",(23,05)
+OBJECT:('\',"throne"),(23,05)
+MONSTER:('@',"Neferet the Green"),(23,05) {
+  OBJECT:'/'
+  OBJECT:'/'
+  OBJECT:'?'
+  OBJECT:'?'
+  OBJECT:'['
+}
 # The treasure of the quest leader
-OBJECT:'(',"chest",(24,05)
+OBJECT:('(',"chest"),(24,05)
 # apprentice guards for the audience chamber
-MONSTER:'@',"apprentice",(30,07)
-MONSTER:'@',"apprentice",(24,06)
-MONSTER:'@',"apprentice",(15,06)
-MONSTER:'@',"apprentice",(15,12)
-MONSTER:'@',"apprentice",(26,11)
-MONSTER:'@',"apprentice",(27,11)
-MONSTER:'@',"apprentice",(19,09)
-MONSTER:'@',"apprentice",(20,09)
+MONSTER:('@',"apprentice"),(30,07) {
+  OBJECT:random
+}
+MONSTER:('@',"apprentice"),(24,06) {
+  OBJECT:random
+  OBJECT:random
+}
+MONSTER:('@',"apprentice"),(15,06) {
+  OBJECT:random
+}
+MONSTER:('@',"apprentice"),(15,12) {
+  OBJECT:random
+}
+MONSTER:('@',"apprentice"),(26,11) {
+  OBJECT:random
+}
+MONSTER:('@',"apprentice"),(27,11) {
+  OBJECT:random
+}
+MONSTER:('@',"apprentice"),(19,09) {
+  OBJECT:random
+  OBJECT[50%]:random
+  OBJECT[25%]:random
+}
+MONSTER:('@',"apprentice"),(20,09) {
+  OBJECT:random
+  OBJECT[50%]:random
+  OBJECT[25%]:random
+}
 # Eels in the pond
-MONSTER:';',"giant eel",(62,14)
-MONSTER:';',"giant eel",(69,15)
-MONSTER:';',"giant eel",(67,17)
+MONSTER:(';',"giant eel"),(62,14)
+MONSTER:(';',"giant eel"),(69,15)
+MONSTER:(';',"giant eel"),(67,17)
 # Non diggable walls
 NON_DIGGABLE:(00,00,75,19)
 # Random traps
+LOOP [3 + 3d3] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
 # Monsters on siege duty.
-MONSTER: 'B',random,(60,09),hostile
-MONSTER: 'W',random,(60,10),hostile
-MONSTER: 'B',random,(60,11),hostile
-MONSTER: 'B',random,(60,12),hostile
-MONSTER: 'i',random,(60,13),hostile
-MONSTER: 'B',random,(61,10),hostile
-MONSTER: 'B',random,(61,11),hostile
-MONSTER: 'B',random,(61,12),hostile
-MONSTER: 'B',random,(35,03),hostile
-MONSTER: 'i',random,(35,17),hostile
-MONSTER: 'B',random,(36,17),hostile
-MONSTER: 'B',random,(34,16),hostile
-MONSTER: 'i',random,(34,17),hostile
-MONSTER: 'W',random,(67,02),hostile
-MONSTER: 'B',random,(10,19),hostile
+MONSTER: 'B',(60,09),hostile
+MONSTER: 'W',(60,10),hostile
+MONSTER: 'B',(60,11),hostile
+MONSTER: 'B',(60,12),hostile
+MONSTER: 'i',(60,13),hostile
+MONSTER: 'B',(61,10),hostile
+MONSTER: 'B',(61,11),hostile
+MONSTER: 'B',(61,12),hostile
+MONSTER: 'B',(35,03),hostile
+MONSTER: 'i',(35,17),hostile
+MONSTER: 'B',(36,17),hostile
+MONSTER: 'B',(34,16),hostile
+MONSTER: 'i',(34,17),hostile
+MONSTER: 'W',(67,02),hostile
+MONSTER: 'B',(10,19),hostile
 
 #
@@ -102,44 +162,63 @@
 #
 
-MAZE: "Wiz-loca",' '
-FLAGS: hardfloor
+LEVEL: "Wiz-loca"
+FLAGS: hardfloor,mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"vampire bat"), (16,'B'), (16,"xorn"), (4,'W')
 GEOMETRY:center,center
 MAP
-.............        .......................................................
-..............       .............}}}}}}}.}}}}}}}}}}}}}}}}}}}.}}}}}}}.......
-..............      ..............}.................................}.......
-..............      ..............}.---------S---------------------.}.......
-...............     .........C....}.|.............................|.}.......
-...............    ..........C....}.|.---------------------------.|.}.......
-...............    .........CCC.....|.|.........................|.|.........
-................   ....C....CCC...}.|.|.---S-------------------.|.|.}.......
-.......C..C.....  .....C....CCC...}.|.|.|......+.......+......|.|.|.}.......
-.............C..CC.....C....CCC...}.|.|.|......|-------|......|.|.|.}.......
-................   ....C....CCC...}.|.|.|......|.......S......|.|.|.}.......
-......C..C.....    ....C....CCC...}.|.|.|......|-------|......|.|.|.}.......
-............C..     ...C....CCC...}.|.|.|......+.......+......|.|.|.}.......
-........C......    ....C....CCC...}.|.|.-----------------------.|.|.}.......
-....C......C...     ........CCC.....|.|.........................|.|.........
-......C..C....      .........C....}.|.--------------------S------.|.}.......
-..............      .........C....}.|.............................|.}.......
-.............       ..............}.-------------------------------.}.......
-.............        .............}.................................}.......
-.............        .............}}}}}}}.}}}}}}}}}}}}}}}}}}}.}}}}}}}.......
-.............        .......................................................
+.............         ......................................................
+.............         ............}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.......
+.............         ............}.................................}.......
+.............         ............}.-------------------------------.}.......
+.............         .......C....}.|.............................|.}.......
+.............         .......C....}.|.---------------------------.|.}.......
+.............         ......CCC...}.|.|.........................|.|.}.......
+.............         .C....CCC...}.|.|.-----------------------.|.|.}.......
+.......C..C..         .C....CCC...}.|.|.|......+.......+......|.|.|.}.......
+.............         .C....CCC...}.|.|.|......|-------|......|.|.|.}.......
+.............        C.C....CCC...}.|.|.|......|.......|......|.|.|.}.......
+......C..C...         .C....CCC...}.|.|.|......|-------|......|.|.|.}.......
+............C         .C....CCC...}.|.|.|......+.......+......|.|.|.}.......
+........C....         .C....CCC...}.|.|.-----------------------.|.|.}.......
+....C......C.         ......CCC...}.|.|.........................|.|.}.......
+......C..C...         .......C....}.|.---------------------------.|.}.......
+.............         .......C....}.|.............................|.}.......
+.............         ............}.-------------------------------.}.......
+.............         ............}.................................}.......
+.............         ............}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}.......
+.............         ......................................................
 ENDMAP
+
+REPLACE_TERRAIN:(0,0,30,20), '.', 'C', 15%
+REPLACE_TERRAIN:(68,0,75,20), '.', '}', 25%
+
+REPLACE_TERRAIN:(34,1,68,19), '}', '.', 2%
+
+# Fog Maze, with occasional broken walls.
+MAZEWALK:(12,10),east,false,'C'
+REPLACE_TERRAIN:(13,0,21,20), ' ', 'C', 4%
+
 # Dungeon Description
 REGION:(00,00,75,20),lit,"ordinary"
-REGION:(37,04,65,16),unlit,"ordinary"
-REGION:(41,08,46,12),lit,"ordinary"
-REGION:(56,08,61,12),lit,"ordinary"
+REGION:(37,04,65,16),unlit,"ordinary",filled,true {
+  ROOMDOOR:true,closed,north|south|west|east,random
+}
+REGION:(39,06,63,14),unlit,"ordinary",filled,true {
+  ROOMDOOR:true,closed,north|south|west|east,random
+}
+REGION:(41,08,46,12),lit,"ordinary",filled,true {
+  ROOMDOOR:true,closed,north|south|west,random
+}
+REGION:(56,08,61,12),lit,"ordinary",filled,true {
+  ROOMDOOR:true,closed,north|south|east,random
+}
 REGION:(48,08,54,08),unlit,"ordinary"
 REGION:(48,12,54,12),unlit,"ordinary"
-REGION:(48,10,54,10),unlit,"ordinary"
+REGION:(48,10,54,10),unlit,"ordinary",filled,true {
+  ROOMDOOR:true,closed,north|south|west|east,random
+}
 
 # Doors
-DOOR:locked,(45,03)
-DOOR:locked,(43,07)
-DOOR:locked,(58,15)
-DOOR:locked,(55,10)
 DOOR:locked,(55,08)
 DOOR:locked,(55,12)
@@ -148,23 +227,11 @@
 # Stairs
 STAIR:(03,17),up
-STAIR:(48,10),down
+STAIR:(51,10),down
 # Non diggable walls
 NON_DIGGABLE:(00,00,75,20)
 # Objects
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+LOOP [10 + 1d6] {
+  OBJECT:random,random
+}
 # Random traps
 TRAP:"spiked pit",(24,02)
@@ -190,31 +257,9 @@
 TRAP:"dart",random
 # Random monsters.
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'B',"vampire bat",random
-MONSTER:'B',"vampire bat",random
-MONSTER:'B',"vampire bat",random
-MONSTER:'B',"vampire bat",random
-MONSTER:'B',"vampire bat",random
-MONSTER:'B',"vampire bat",random
-MONSTER:'B',"vampire bat",random
-MONSTER:'i',random,random,hostile
+LOOP [10 + 1d10] {
+  MONSTER:'B',random,hostile
+  MONSTER[80%]:'i',random,hostile
+  MONSTER[90%]:('B',"vampire bat"),random
+}
 
 #
@@ -226,5 +271,8 @@
 #
 
-MAZE: "Wiz-goal", ' '
+LEVEL: "Wiz-goal"
+FLAGS:mazelevel
+INIT_MAP:solidfill,' '
+MON_GENERATION:86%, (64,"vampire bat"), (16,'B'), (16,"xorn"), (4,'W')
 GEOMETRY:center,center
 MAP
@@ -232,7 +280,7 @@
                                                                             
                                                                             
-                   -------------                 -------------              
-                   |...........|                 |...........|              
-            -------|...........-------------------...........|              
+            --------------------                 -------------              
+            |......|...........|                 |...........|              
+            ---S---|...........-------------------...........|              
             |......S...........|..|..|..|..|..|..|...........|              
             |......|...........|..|..|..|..|..|..|...........|              
@@ -242,7 +290,7 @@
             |......|...........|..|..|..|..|..|..|...........|              
             |......|...........|..|..|..|..|..|..|...........|              
-            -------|...........-------------------...........|              
-                   |...........|                 |...........|              
-                   -------------                 -------------              
+            ----S--|...........-------------------...........|              
+            |......|...........|                 |...........|              
+            --------------------                 -------------              
                                                                             
                                                                             
@@ -268,4 +316,6 @@
 REGION:(47,11,48,12),unlit,"ordinary"
 REGION:(50,04,60,14),lit,"ordinary"
+REGION:(13,04,18,04),lit,"ordinary"
+REGION:(13,14,18,14),lit,"ordinary"
 # Doors
 DOOR:locked,(19,06)
@@ -285,4 +335,6 @@
 DOOR:locked,(48,10)
 DOOR:locked,(49,09)
+DOOR:locked,(16,13)
+DOOR:locked,(15,05)
 # Stairs
 STAIR:(55,05),up
@@ -292,64 +344,40 @@
 ALTAR:(16,11),noncoaligned,altar
 # Objects
-OBJECT:'"',"amulet of ESP",(16,11),blessed,0,"The Eye of the Aethiopica"
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
-OBJECT:random,random,random
+OBJECT:('"',"amulet of power"),(16,11),blessed,0,NAME:"The Eye of the Aethiopica"
+LOOP [9 + 2d5] {
+  OBJECT:random,random
+}
+OBJECT:('+',"knock"),(13,14)
+OBJECT:'+',(18,14)
+OBJECT:'+',(13,04)
+OBJECT:('+',"wizard lock"),(18,04)
 # Random traps
+LOOP [2 + 2d8] {
 TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
-TRAP:random,random
+}
+TRAP:random,(16,14)
+TRAP:random,(15,04)
 # Random monsters.
-MONSTER:'@',"Dark One",(16,11)
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'B',random,random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'i',random,random,hostile
-MONSTER:'B',"vampire bat",random
-MONSTER:'B',"vampire bat",random
-MONSTER:'B',"vampire bat",random
-MONSTER:'B',"vampire bat",random
-MONSTER:'B',"vampire bat",random
-MONSTER:'B',"vampire bat",random
-MONSTER:'B',"vampire bat",random
-MONSTER:'B',"vampire bat",random
-MONSTER:'i',random,random,hostile
+MONSTER:('@',"Dark One"),(16,11) {
+  OBJECT:('(', "Bell of Opening"),uncursed
+  OBJECT:'/'
+  OBJECT:'?'
+  OBJECT:'+'
+  OBJECT:'['
+}
+LOOP [8 + 3d8] {
+  MONSTER:'B',random,hostile
+  MONSTER:'i',random,hostile
+  MONSTER:('B',"vampire bat"),random
+}
 # Captive Monsters in the dungeon
-MONSTER:'@',"rogue",(35,06),peaceful,"Pug"
-MONSTER:'Y',"owlbear",(47,06),peaceful,asleep
-MONSTER:'@',"wizard",(32,11),peaceful,asleep,"Newt"
-MONSTER:'@',"Grey-elf",(44,11),peaceful
-MONSTER:'H',"hill giant",(47,11),peaceful,asleep
-MONSTER:'G',"gnomish wizard",(38,06),peaceful
-MONSTER:'@',"prisoner",(35,11),peaceful
-MONSTER:'@',"prisoner",(41,11),peaceful,asleep
+MONSTER:('@',"rogue"),(35,06),peaceful,"Pug"
+MONSTER:('Y',"owlbear"),(47,06),peaceful,asleep
+MONSTER:('@',"wizard"),(32,11),peaceful,asleep,"Newt"
+MONSTER:('@',"Grey-elf"),(44,11),peaceful
+MONSTER:('H',"hill giant"),(47,11),peaceful,asleep
+MONSTER:('G',"gnomish wizard"),(38,06),peaceful
+MONSTER:('@',"prisoner"),(35,11),peaceful
+MONSTER:('@',"prisoner"),(41,11),peaceful,asleep
 
 #
@@ -363,77 +391,103 @@
 
 LEVEL: "Wiz-fila"
+MON_GENERATION:86%, (64,"vampire bat"), (16,'B'), (16,"xorn"), (4,'W')
 #
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, up
-OBJECT: random,random,random
-MONSTER: 'i', random, random, hostile
+OBJECT: random,random
+MONSTER: 'i', random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random,random,random
-MONSTER: 'i', random, random, hostile
+{
+OBJECT: random, random
+OBJECT: random,random
+MONSTER: 'i', random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
-OBJECT: random,random,random
-MONSTER: 'B', "vampire bat", random
-MONSTER: 'B', "vampire bat", random
+OBJECT: random,random
+MONSTER: ('B', "vampire bat"), random
+MONSTER: ('B', "vampire bat"), random
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, down
-OBJECT: random, random, random
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'i', random, random, hostile
-MONSTER: 'B', "vampire bat", random
+MONSTER: 'i', random, hostile
+MONSTER: ('B', "vampire bat"), random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'i', random, random, hostile
+MONSTER: 'i', random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'B', "vampire bat", random
+MONSTER: ('B', "vampire bat"), random
+}
 
 RANDOM_CORRIDORS
 
 LEVEL: "Wiz-filb"
+MON_GENERATION:86%, (64,"vampire bat"), (16,'B'), (16,"xorn"), (4,'W')
 #
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, up
-OBJECT: random,random,random
-MONSTER: 'X', random, random, hostile
+OBJECT: random,random
+MONSTER: 'X', random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random,random,random
-MONSTER: 'i', random, random, hostile
+{
+OBJECT: random, random
+OBJECT: random,random
+MONSTER: 'i', random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
-OBJECT: random,random,random
-MONSTER: 'X', random, random, hostile
+OBJECT: random,random
+MONSTER: 'X', random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
+{
 STAIR: random, down
-OBJECT: random, random, random
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'i', random, random, hostile
-MONSTER: 'B', "vampire bat", random
+MONSTER: 'i', random, hostile
+MONSTER: ('B', "vampire bat"), random
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'i', random, random, hostile
+MONSTER: 'i', random, hostile
+}
 
 ROOM: "ordinary" , random, random, random, random
-OBJECT: random, random, random
+{
+OBJECT: random, random
 TRAP: random, random
-MONSTER: 'B', "vampire bat", random
+MONSTER: ('B', "vampire bat"), random
+}
 
 RANDOM_CORRIDORS
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/dat/yendor.des nethack/dat/yendor.des
--- nh_orig/dat/yendor.des	2003-12-07 18:39:13.000000000 -0500
+++ nethack/dat/yendor.des	2010-04-11 12:36:58.301624882 -0400
@@ -6,6 +6,7 @@
 # The top (real) wizard level.
 # Keeping the Moat for old-time's sake
-MAZE:"wizard1",random
-FLAGS:noteleport,hardfloor
+LEVEL:"wizard1"
+FLAGS:noteleport,hardfloor,mazelevel
+INIT_MAP:mazegrid,'-'
 GEOMETRY:center,center
 MAP
@@ -28,7 +29,8 @@
 BRANCH:levregion(01,00,79,20),(0,0,28,12)
 TELEPORT_REGION:levregion(01,00,79,20),(0,0,27,12)
-# Make it a morgue for rm id in mkmaze.c
-# for the purpose of random sdoor placement
-REGION:(12,01,20,09),unlit,"morgue",unfilled
+
+REGION:(12,01,20,09),unlit,"morgue",unfilled {
+  ROOMDOOR:true, locked, south|east|west, random
+}
 MAZEWALK:(28,05),east
 LADDER:(06,05),down
@@ -45,27 +47,27 @@
 NON_PASSWALL:(21,00,27,10)
 # The wizard and his guards
-MONSTER:'@',"Wizard of Yendor",(16,05),asleep
-MONSTER:'d',"hell hound",(15,05)
-MONSTER:'V',"vampire lord",(17,05)
+MONSTER:('@',"Wizard of Yendor"),(16,05),asleep
+MONSTER:('d',"hell hound"),(15,05)
+MONSTER:('V',"vampire lord"),(17,05)
 # The local treasure
-OBJECT:'+',"Book of the Dead",(16,05)
+OBJECT:('+',"Book of the Dead"),(16,05)
 # Surrounding terror
-MONSTER:';',"kraken",(14,02)
-MONSTER:';',"giant eel",(17,02)
-MONSTER:';',"kraken",(13,04)
-MONSTER:';',"giant eel",(13,06)
-MONSTER:';',"kraken",(19,04)
-MONSTER:';',"giant eel",(19,06)
-MONSTER:';',"kraken",(15,08)
-MONSTER:';',"giant eel",(17,08)
-MONSTER:';',"piranha",(15,02)
-MONSTER:';',"piranha",(19,08)
+MONSTER:(';',"kraken"),(14,02)
+MONSTER:(';',"giant eel"),(17,02)
+MONSTER:(';',"kraken"),(13,04)
+MONSTER:(';',"giant eel"),(13,06)
+MONSTER:(';',"kraken"),(19,04)
+MONSTER:(';',"giant eel"),(19,06)
+MONSTER:(';',"kraken"),(15,08)
+MONSTER:(';',"giant eel"),(17,08)
+MONSTER:(';',"piranha"),(15,02)
+MONSTER:(';',"piranha"),(19,08)
 # Random monsters
-MONSTER:'D',random,random
-MONSTER:'H',random,random
-MONSTER:'&',random,random
-MONSTER:'&',random,random
-MONSTER:'&',random,random
-MONSTER:'&',random,random
+MONSTER:'D',random
+MONSTER:'H',random
+MONSTER:'&',random
+MONSTER:'&',random
+MONSTER:'&',random
+MONSTER:'&',random
 # And to make things a little harder.
 TRAP:"board",(16,04)
@@ -79,17 +81,18 @@
 TRAP:"magic",random
 # Some random loot.
-OBJECT:'*',"ruby",random
-OBJECT:'!',random,random
-OBJECT:'!',random,random
-OBJECT:'?',random,random
-OBJECT:'?',random,random
-OBJECT:'+',random,random
-OBJECT:'+',random,random
-OBJECT:'+',random,random
+OBJECT:('*',"ruby"),random
+OBJECT:'!',random
+OBJECT:'!',random
+OBJECT:'?',random
+OBJECT:'?',random
+OBJECT:'+',random
+OBJECT:'+',random
+OBJECT:'+',random
 
 
 # The middle wizard level.
-MAZE:"wizard2",random
-FLAGS:noteleport,hardfloor
+LEVEL:"wizard2"
+FLAGS:noteleport,hardfloor,mazelevel
+INIT_MAP:mazegrid,'-'
 GEOMETRY:center,center
 MAP
@@ -131,17 +134,18 @@
 TRAP:"magic",random
 # Some random loot.
-OBJECT:'!',random,random
-OBJECT:'!',random,random
-OBJECT:'?',random,random
-OBJECT:'?',random,random
-OBJECT:'+',random,random
+OBJECT:'!',random
+OBJECT:'!',random
+OBJECT:'?',random
+OBJECT:'?',random
+OBJECT:'+',random
 # treasures
-OBJECT:'"',random,(04,06)
+OBJECT:'"',(04,06)
 
 
 # The bottom wizard level.
 # Memorialize the fakewiz setup.
-MAZE:"wizard3",random
-FLAGS:noteleport,hardfloor
+LEVEL:"wizard3"
+FLAGS:noteleport,hardfloor,mazelevel
+INIT_MAP:mazegrid,'-'
 GEOMETRY:center,center
 MAP
@@ -157,5 +161,5 @@
 |.....|.}}---}}.|..|.......|.
 |.....S.}}}}}}}.|..|.......|.
-|.....|.........|..S.......|.
+|.....|.........|..|.......|.
 ----------------------------.
 ENDMAP
@@ -170,7 +174,8 @@
 # make the entry chamber a real room; it affects monster arrival;
 # `unfilled' is a kludge to force an ordinary room to remain a room
-REGION:(20,06,26,11),unlit,"ordinary",unfilled
+REGION:(20,06,26,11),unlit,"ordinary",unfilled {
+  ROOMDOOR:true, locked, north|west, random
+}
 DOOR:closed,(18,05)
-DOOR:closed,(19,11)
 LADDER:(11,07),up
 # Non diggable walls
@@ -186,18 +191,18 @@
 NON_PASSWALL:(06,12,16,12)
 #
-MONSTER:'L',random,(10,07)
-MONSTER:'V',"vampire lord",(12,07)
+MONSTER:'L',(10,07)
+MONSTER:('V',"vampire lord"),(12,07)
 # Some surrounding horrors
-MONSTER:';',"kraken",(08,05)
-MONSTER:';',"giant eel",(08,08)
-MONSTER:';',"kraken",(14,05)
-MONSTER:';',"giant eel",(14,08)
+MONSTER:(';',"kraken"),(08,05)
+MONSTER:(';',"giant eel"),(08,08)
+MONSTER:(';',"kraken"),(14,05)
+MONSTER:(';',"giant eel"),(14,08)
 # Other monsters
-MONSTER:'L',random,random
-MONSTER:'D',random,random
-MONSTER:'D',random,(26,09)
-MONSTER:'&',random,random
-MONSTER:'&',random,random
-MONSTER:'&',random,random
+MONSTER:'L',random
+MONSTER:'D',random
+MONSTER:'D',(26,09)
+MONSTER:'&',random
+MONSTER:'&',random
+MONSTER:'&',random
 # And to make things a little harder.
 TRAP:"board",(10,07)
@@ -206,11 +211,11 @@
 TRAP:"board",(11,08)
 # Some loot
-OBJECT:')',random,random
-OBJECT:'!',random,random
-OBJECT:'?',random,random
-OBJECT:'?',random,random
-OBJECT:'(',random,random
+OBJECT:')',random
+OBJECT:'!',random
+OBJECT:'?',random
+OBJECT:'?',random
+OBJECT:'(',random
 # treasures
-OBJECT:'"',random,(11,07)
+OBJECT:'"',(11,07)
 
 
@@ -218,5 +223,7 @@
 # There are two of these, and we need to
 # distinguish between them for the portal.
-MAZE:"fakewiz1",random
+LEVEL:"fakewiz1"
+FLAGS:mazelevel
+INIT_MAP:mazegrid,'-'
 GEOMETRY:center,center
 MAP
@@ -237,7 +244,7 @@
 MAZEWALK:(08,05),east
 REGION:(04,03,06,06),unlit,"ordinary",unfilled,true
-MONSTER:'L',random,(04,04)
-MONSTER:'V',"vampire lord",(03,04)
-MONSTER:';',"kraken",(06,06)
+MONSTER:'L',(04,04)
+MONSTER:('V',"vampire lord"),(03,04)
+MONSTER:(';',"kraken"),(06,06)
 # And to make things a little harder.
 TRAP:"board",(04,03)
@@ -247,5 +254,7 @@
 
 
-MAZE:"fakewiz2",random
+LEVEL:"fakewiz2"
+FLAGS:mazelevel
+INIT_MAP:mazegrid,'-'
 GEOMETRY:center,center
 MAP
@@ -265,7 +274,7 @@
 MAZEWALK:(08,05),east
 REGION:(04,03,06,06),unlit,"ordinary",unfilled,true
-MONSTER:'L',random,(04,04)
-MONSTER:'V',"vampire lord",(03,04)
-MONSTER:';',"kraken",(06,06)
+MONSTER:'L',(04,04)
+MONSTER:('V',"vampire lord"),(03,04)
+MONSTER:(';',"kraken"),(06,06)
 # And to make things a little harder.
 TRAP:"board",(04,03)
@@ -274,3 +283,3 @@
 TRAP:"board",(05,04)
 # treasures
-OBJECT:'"',random,(04,04)
+OBJECT:'"',(04,04)
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/doc/Guidebook.mn nethack/doc/Guidebook.mn
--- nh_orig/doc/Guidebook.mn	2003-12-07 18:39:13.000000000 -0500
+++ nethack/doc/Guidebook.mn	2009-08-02 13:49:34.150409063 -0400
@@ -1771,4 +1771,10 @@
 Name your starting dog (ex. ``dogname:Fang'').
 Cannot be set with the `O' command.
+.lp dumpfile
+The name of a file where the disclosure information is written when the
+game ends. You may use the macro %n that will be replaced with the name
+of your player character. The game must have write permissions to the
+directory where the file is written. Normally /tmp may be used for unix
+systems.
 .lp dungeon
 Set the graphics symbols for displaying the dungeon
@@ -2099,4 +2105,16 @@
 .lp "silent  "
 Suppress terminal beeps (default on).
+.lp sortloot
+Controls the behavior of the sortloot patch that sorts pickup lists for
+inventory and #loot commands and some others.
+The possible values are:
+.sd
+.si
+full - always sort the lists;
+loot - only sort the lists that don't use inventory
+       letters, like with the #loot and pickup commands;
+none - show lists the traditional way without sorting.
+.ei
+.ed
 .lp sortpack
 Sort the pack contents by type when displaying inventory (default on).
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/doc/Guidebook.tex nethack/doc/Guidebook.tex
--- nh_orig/doc/Guidebook.tex	2003-12-07 18:39:13.000000000 -0500
+++ nethack/doc/Guidebook.tex	2009-08-02 13:49:34.160408550 -0400
@@ -2210,4 +2210,11 @@
 Cannot be set with the `{\tt O}' command.
 %.lp
+\item[\ib{dumpfile}]
+The name of a file where the disclosure information is written when the
+game ends. You may use the macro %n that will be replaced with the name
+of your player character. The game must have write permissions to the
+directory where the file is written. Normally /tmp may be used for unix
+systems.
+%.lp
 \item[\ib{dungeon}]
 Set the graphics symbols for displaying the dungeon (default
@@ -2574,4 +2581,19 @@
 Suppress terminal beeps (default on).
 %.lp
+\item[\ib{sortloot}]
+Controls the behavior of the sortloot patch that sorts pickup lists for
+inventory and \#loot commands and some others.
+
+The possible values are:
+%.sd
+%.si
+{\tt full} --- always sort the lists;\\
+{\tt loot} --- only sort the lists that don't use inventory
+       letters, like with the \#loot and pickup commands;\\
+{\tt none} --- show lists the traditional way without sorting.
+%.ei
+%.ed
+%.lp
+The default is 'none', the way an unpatched game works.
 \item[\ib{sortpack}]
 Sort the pack contents by type when displaying inventory (default on).
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/doc/Guidebook.txt nethack/doc/Guidebook.txt
--- nh_orig/doc/Guidebook.txt	2003-12-07 18:39:13.000000000 -0500
+++ nethack/doc/Guidebook.txt	2009-08-02 13:49:34.157408524 -0400
@@ -2275,4 +2275,11 @@
             with the `O' command.
 
+          dumpfile
+            The name of a file where the disclosure information is
+            written when the game ends. You may use the macro %n that
+            will be replaced with the name of your player character.
+            The game must have write permissions to the directory where
+            the file is written. Normally /tmp may be used for unixes.
+
           dungeon
             Set the graphics symbols for displaying  the  dungeon  (default
@@ -2724,4 +2731,16 @@
             Suppress terminal beeps (default on).
 
+          sortloot
+               Controls the behavior of the sortloot patch that sorts
+               pickup lists for inventory and #loot commands and some
+               others.
+               The possible values are:
+
+                    full - always sort the lists
+                    loot - only sort the lists that don't use inventory
+                           letters, like with the #loot and pickup commands
+                    none - show lists the traditional way without sorting
+               The default is 'none', the way an unpatched game works.
+
           sortpack
             Sort the pack contents by type when displaying  inventory  (de-
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/align.h nethack/include/align.h
--- nh_orig/include/align.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/align.h	2009-08-02 13:49:33.026408602 -0400
@@ -13,6 +13,8 @@
 } align;
 
-/* bounds for "record" -- respect initial alignments of 10 */
-#define ALIGNLIM	(10L + (moves/200L))
+/* bounds for "record" -- respect initial alignments of 10.
+ * note that the maximum alignment is now 50, so that mortal
+ * sins always put you out of favor with your god. */
+#define ALIGNLIM	(min(50,10L + (moves/300L)))
 
 #define A_NONE	      (-128)	/* the value range of type */
@@ -40,3 +42,13 @@
 			 : ((x) == A_LAWFUL) ? AM_LAWFUL : (x) + 2)
 
+/*
+ * These will make it a bit easier to adjust alignment swings
+ * while trying to get it balanced out to where it matters...
+ */
+
+#define venial_sin() (adjalign(-5))
+#define minor_sin() (adjalign(-10))
+#define major_sin() (adjalign(-20))
+#define mortal_sin() (adjalign(-50))
+
 #endif /* ALIGN_H */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/artifact.h nethack/include/artifact.h
--- nh_orig/include/artifact.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/artifact.h	2009-08-02 13:49:33.036408503 -0400
@@ -35,5 +35,23 @@
 #define SPFX_XRAY   0x2000000L	/* gives X-RAY vision to player */
 #define SPFX_REFLECT 0x4000000L /* Reflection */
+#define SPFX_STR	  0x8000000L   /* item bestows STR 18(**) */
+#define SPFX_CON	  0x10000000L   /* item bestows CON 25 */
+#define SPFX_POLYC  0x20000000L	 /* items grants polymorph control */
 
+#define SPDF_NONE		  0x00000000L /* No special effects */
+#define SPDF_MAGIC	  0x00000001L /* Magic resistance */
+#define SPDF_FIRE		  0x00000002L /* Fire defense */
+#define SPDF_COLD		  0x00000004L /* Cold defense */
+#define SPDF_SLEEP	  0x00000008L /* Sleep defense */
+#define SPDF_DISINT	  0x00000010L /* Disintegration defense */
+#define SPDF_ELEC		  0x00000020L /* Shock defense */
+#define SPDF_POISON	  0x00000040L /* Poison defense */
+#define SPDF_ACID		  0x00000080L /* Acid defense */
+#define SPDF_BLIND	  0x00000100L /* Blinding resistance */
+#define SPDF_WERE		  0x00000200L /* Lycanthropy resistance */
+#define SPDF_DRAIN	  0x00000400L /* Drain level defense */
+#define SPDF_CONFUSE	  0x00000800L /* Confusion */
+#define SPDF_STUN		  0x00001000L /* Stunning */
+#define SPDF_ELEMENTAL 0x000000FEL	/* All elemental resistances (Dragonbane) */
 
 struct artifact {
@@ -43,5 +61,7 @@
 	unsigned long cspfx;	/* special effect just from carrying obj */
 	unsigned long mtype;	/* monster type, symbol, or flag */
-	struct attack attk, defn, cary;
+	struct attack attk;
+	unsigned long defn;	/* special defensive properties from wielding/wearing */
+	struct attack cary;
 	uchar	    inv_prop;	/* property obtained by invoking artifact */
 	aligntyp    alignment;	/* alignment of bequeathing gods */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/artilist.h nethack/include/artilist.h
--- nh_orig/include/artilist.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/artilist.h	2009-10-31 10:32:37.579669351 -0400
@@ -16,5 +16,4 @@
 
 #define     NO_ATTK	{0,0,0,0}		/* no attack */
-#define     NO_DFNS	{0,0,0,0}		/* no defense */
 #define     NO_CARY	{0,0,0,0}		/* no carry effects */
 #define     DFNS(c)	{0,c,0,0}
@@ -26,4 +25,5 @@
 #define     ELEC(a,b)	{0,AD_ELEC,a,b}		/* electrical shock */
 #define     STUN(a,b)	{0,AD_STUN,a,b}		/* magical attack */
+#define		DRST(a,b)	{0,AD_DRST,a,b}		/* poison attack */
 
 STATIC_OVL NEARDATA struct artifact artilist[] = {
@@ -39,9 +39,16 @@
 /*  dummy element #0, so that all interesting indices are non-zero */
 A("",				STRANGE_OBJECT,
-	0, 0, 0, NO_ATTK, NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 0L ),
+	0, 0, 0, NO_ATTK, SPDF_NONE, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 0L ),
 
 A("Excalibur",			LONG_SWORD,
 	(SPFX_NOGEN|SPFX_RESTR|SPFX_SEEK|SPFX_DEFN|SPFX_INTEL|SPFX_SEARCH),0,0,
-	PHYS(5,10),	DRLI(0,0),	NO_CARY,	0, A_LAWFUL, PM_KNIGHT, NON_PM, 4000L ),
+	PHYS(5,10),	SPDF_DRAIN,	NO_CARY,	0, A_LAWFUL, PM_KNIGHT, NON_PM, 4000L ),
+/* 
+ * The Knight needed a chaotic longsword to obtain, since Excalibur
+ * will be restricted from him... 
+*/
+A("Dirge",			LONG_SWORD,
+	(SPFX_ATTK|SPFX_NOGEN|SPFX_RESTR|SPFX_DEFN|SPFX_INTEL),0,0,
+	DRST(5,0),	SPDF_DRAIN,	NO_CARY,	0, A_CHAOTIC, NON_PM, NON_PM, 3000L ),
 /*
  *	Stormbringer only has a 2 because it can drain a level,
@@ -50,5 +57,13 @@
 A("Stormbringer",		RUNESWORD,
 	(SPFX_RESTR|SPFX_ATTK|SPFX_DEFN|SPFX_INTEL|SPFX_DRLI), 0, 0,
-	DRLI(5,2),	DRLI(0,0),	NO_CARY,	0, A_CHAOTIC, NON_PM, NON_PM, 8000L ),
+	DRLI(5,2),	SPDF_DRAIN,	NO_CARY,	0, A_CHAOTIC, NON_PM, NON_PM, 8000L ),
+/*
+ * Lifestealer gets the same restrictions as Stormy, but it's designed
+ * to be generated in Vlad's hands anyway, so this isn't such a big deal.
+ * It's two-handed so players (hopefully) won't really want to use it...
+ */
+A("Lifestealer",		TWO_HANDED_SWORD,
+	(SPFX_NOGEN|SPFX_RESTR|SPFX_ATTK|SPFX_DEFN|SPFX_INTEL|SPFX_DRLI), 0, 0,
+	DRLI(5,2),	SPDF_DRAIN,	NO_CARY,	0, A_CHAOTIC, NON_PM, NON_PM, 8000L ),
 /*
  *	Mjollnir will return to the hand of the wielder when thrown
@@ -57,29 +72,27 @@
 A("Mjollnir",			WAR_HAMMER,		/* Mjo:llnir */
 	(SPFX_RESTR|SPFX_ATTK),  0, 0,
-	ELEC(5,24),	NO_DFNS,	NO_CARY,	0, A_NEUTRAL, PM_VALKYRIE, NON_PM, 4000L ),
+	ELEC(5,24),	SPDF_NONE,	NO_CARY,	0, A_NEUTRAL, PM_VALKYRIE, NON_PM, 4000L ),
 
 A("Cleaver",			BATTLE_AXE,
 	SPFX_RESTR, 0, 0,
-	PHYS(3,6),	NO_DFNS,	NO_CARY,	0, A_NEUTRAL, PM_BARBARIAN, NON_PM, 1500L ),
+	PHYS(3,6),	SPDF_NONE,	NO_CARY,	0, A_NEUTRAL, PM_BARBARIAN, NON_PM, 1500L ),
 
 A("Grimtooth",			ORCISH_DAGGER,
 	SPFX_RESTR, 0, 0,
-	PHYS(2,6),	NO_DFNS,	NO_CARY,	0, A_CHAOTIC, NON_PM, PM_ORC, 300L ),
+	PHYS(5,6),	SPDF_NONE,	NO_CARY,	0, A_CHAOTIC, NON_PM, PM_ORC, 600L ),
 /*
  *	Orcrist and Sting have same alignment as elves.
- */
-A("Orcrist",			ELVEN_BROADSWORD,
-	SPFX_DFLAG2, 0, M2_ORC,
-	PHYS(5,0),	NO_DFNS,	NO_CARY,	0, A_CHAOTIC, NON_PM, PM_ELF, 2000L ),
-
-/*
  *	The combination of SPFX_WARN and M2_something on an artifact
  *	will trigger EWarn_of_mon for all monsters that have the appropriate
  *	M2_something flags.  In Sting's case it will trigger EWarn_of_mon
- *	for M2_ORC monsters.
+ *	for M2_SPIDER monsters; in Orcrist, for M2_ORC.
  */
+A("Orcrist",			ELVEN_BROADSWORD,
+	(SPFX_WARN|SPFX_DCLAS), 0, S_ORC,
+	PHYS(5,4),	SPDF_NONE,	NO_CARY,	0, A_CHAOTIC, NON_PM, PM_ELF, 2000L ),
+
 A("Sting",			ELVEN_DAGGER,
-	(SPFX_WARN|SPFX_DFLAG2), 0, M2_ORC,
-	PHYS(5,0),	NO_DFNS,	NO_CARY,	0, A_CHAOTIC, NON_PM, PM_ELF, 800L ),
+	(SPFX_WARN|SPFX_DCLAS), 0, S_SPIDER,
+	PHYS(5,3),	SPDF_NONE,	NO_CARY,	0, A_CHAOTIC, NON_PM, PM_ELF, 800L ),
 /*
  *	Magicbane is a bit different!  Its magic fanfare
@@ -88,41 +101,41 @@
 A("Magicbane",			ATHAME,
 	(SPFX_RESTR|SPFX_ATTK|SPFX_DEFN), 0, 0,
-	STUN(3,4),	DFNS(AD_MAGM),	NO_CARY,	0, A_NEUTRAL, PM_WIZARD, NON_PM, 3500L ),
+	STUN(3,4),	SPDF_MAGIC,	NO_CARY,	0, A_NEUTRAL, PM_WIZARD, NON_PM, 3500L ),
 
 A("Frost Brand",		LONG_SWORD,
 	(SPFX_RESTR|SPFX_ATTK|SPFX_DEFN), 0, 0,
-	COLD(5,0),	COLD(0,0),	NO_CARY,	0, A_NONE, NON_PM, NON_PM, 3000L ),
+	COLD(5,0),	SPDF_COLD,	NO_CARY,	0, A_NONE, NON_PM, NON_PM, 3000L ),
 
 A("Fire Brand",			LONG_SWORD,
 	(SPFX_RESTR|SPFX_ATTK|SPFX_DEFN), 0, 0,
-	FIRE(5,0),	FIRE(0,0),	NO_CARY,	0, A_NONE, NON_PM, NON_PM, 3000L ),
+	FIRE(5,0),	SPDF_FIRE,	NO_CARY,	0, A_NONE, NON_PM, NON_PM, 3000L ),
 
-A("Dragonbane",			BROADSWORD,
-	(SPFX_RESTR|SPFX_DCLAS), 0, S_DRAGON,
-	PHYS(5,0),	NO_DFNS,	NO_CARY,	0, A_NONE, NON_PM, NON_PM, 500L ),
+A("Dragonbane",			DWARVISH_SPEAR,
+	(SPFX_WARN|SPFX_RESTR|SPFX_DCLAS), 0, S_DRAGON,
+	PHYS(5,4),	SPDF_ELEMENTAL,	NO_CARY,	0, A_NONE, NON_PM, NON_PM, 1500L ),
 
-A("Demonbane",			LONG_SWORD,
-	(SPFX_RESTR|SPFX_DFLAG2), 0, M2_DEMON,
-	PHYS(5,0),	NO_DFNS,	NO_CARY,	0, A_LAWFUL, NON_PM, NON_PM, 2500L ),
+A("Demonbane",			SILVER_MACE,
+	(SPFX_WARN|SPFX_RESTR|SPFX_DCLAS), 0, S_DEMON,
+	PHYS(5,4),	SPDF_NONE,	NO_CARY,	0, A_LAWFUL, NON_PM, NON_PM, 2500L ),
 
 A("Werebane",			SILVER_SABER,
-	(SPFX_RESTR|SPFX_DFLAG2), 0, M2_WERE,
-	PHYS(5,0),	DFNS(AD_WERE),	NO_CARY,	0, A_NONE, NON_PM, NON_PM, 1500L ),
+	(SPFX_WARN|SPFX_RESTR|SPFX_DCLAS|SPFX_POLYC), 0, S_WERE,
+	PHYS(5,4),	SPDF_WERE,	NO_CARY,	0, A_NONE, NON_PM, NON_PM, 1500L ),
 
 A("Grayswandir",		SILVER_SABER,
 	(SPFX_RESTR|SPFX_HALRES), 0, 0,
-	PHYS(5,0),	NO_DFNS,	NO_CARY,	0, A_LAWFUL, NON_PM, NON_PM, 8000L ),
+	PHYS(5,0),	SPDF_NONE,	NO_CARY,	0, A_LAWFUL, NON_PM, NON_PM, 8000L ),
 
-A("Giantslayer",		LONG_SWORD,
-	(SPFX_RESTR|SPFX_DFLAG2), 0, M2_GIANT,
-	PHYS(5,0),	NO_DFNS,	NO_CARY,	0, A_NEUTRAL, NON_PM, NON_PM, 200L ),
+A("Giantslayer",		SLING,
+	(SPFX_WARN|SPFX_RESTR|SPFX_DCLAS|SPFX_STR), 0, S_GIANT,
+	PHYS(5,8),	SPDF_NONE,	NO_CARY,	0, A_NEUTRAL, NON_PM, NON_PM, 1200L ),
 
 A("Ogresmasher",		WAR_HAMMER,
-	(SPFX_RESTR|SPFX_DCLAS), 0, S_OGRE,
-	PHYS(5,0),	NO_DFNS,	NO_CARY,	0, A_NONE, NON_PM, NON_PM, 200L ),
+	(SPFX_WARN|SPFX_RESTR|SPFX_DCLAS|SPFX_CON), 0, S_OGRE,
+	PHYS(5,4),	SPDF_NONE,	NO_CARY,	0, A_NONE, NON_PM, NON_PM, 1200L ),
 
 A("Trollsbane",			MORNING_STAR,
-	(SPFX_RESTR|SPFX_DCLAS), 0, S_TROLL,
-	PHYS(5,0),	NO_DFNS,	NO_CARY,	0, A_NONE, NON_PM, NON_PM, 200L ),
+	(SPFX_WARN|SPFX_RESTR|SPFX_DCLAS|SPFX_REGEN), 0, S_TROLL,
+	PHYS(5,4),	SPDF_NONE,	NO_CARY,	0, A_NONE, NON_PM, NON_PM, 1200L ),
 /*
  *	Two problems:  1) doesn't let trolls regenerate heads,
@@ -132,5 +145,5 @@
 A("Vorpal Blade",		LONG_SWORD,
 	(SPFX_RESTR|SPFX_BEHEAD), 0, 0,
-	PHYS(5,1),	NO_DFNS,	NO_CARY,	0, A_NEUTRAL, NON_PM, NON_PM, 4000L ),
+	PHYS(5,1),	SPDF_NONE,	NO_CARY,	0, A_NEUTRAL, NON_PM, NON_PM, 4000L ),
 /*
  *	Ah, never shall I forget the cry,
@@ -143,9 +156,13 @@
 A("Snickersnee",		KATANA,
 	SPFX_RESTR, 0, 0,
-	PHYS(0,8),	NO_DFNS,	NO_CARY,	0, A_LAWFUL, PM_SAMURAI, NON_PM, 1200L ),
+	PHYS(5,8),	SPDF_NONE,	NO_CARY,	0, A_LAWFUL, PM_SAMURAI, NON_PM, 1200L ),
 
-A("Sunsword",			LONG_SWORD,
-	(SPFX_RESTR|SPFX_DFLAG2), 0, M2_UNDEAD,
-	PHYS(5,0),	DFNS(AD_BLND),	NO_CARY,	0, A_LAWFUL, NON_PM, NON_PM, 1500L ),
+A("Sunsword",			SILVER_LONG_SWORD,
+	(SPFX_WARN|SPFX_RESTR|SPFX_DCLAS), 0, S_UNDEAD,
+	PHYS(5,4),	SPDF_BLIND,	NO_CARY,	0, A_LAWFUL, NON_PM, NON_PM, 1500L ),
+
+A("Keolewa",CLUB,
+	SPFX_RESTR, 0, 0,
+	PHYS(5,6), SPDF_NONE, NO_CARY, 0, A_NEUTRAL, PM_CAVEMAN, NON_PM, 1000L ),
 
 /*
@@ -155,5 +172,5 @@
 A("The Orb of Detection",	CRYSTAL_BALL,
 	(SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL), (SPFX_ESP|SPFX_HSPDAM), 0,
-	NO_ATTK,	NO_DFNS,	CARY(AD_MAGM),
+	NO_ATTK,	SPDF_NONE,	CARY(AD_MAGM),
 	INVIS,		A_LAWFUL, PM_ARCHEOLOGIST, NON_PM, 2500L ),
 
@@ -161,10 +178,10 @@
 	(SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL), SPFX_STLTH, 0,
 	/* this stone does double damage if used as a projectile weapon */
-	PHYS(5,0),	NO_DFNS,	NO_CARY,
+	PHYS(5,0),	SPDF_NONE,	NO_CARY,
 	LEVITATION,	A_NEUTRAL, PM_BARBARIAN, NON_PM, 2500L ),
 
 A("The Sceptre of Might",	MACE,
 	(SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL|SPFX_DALIGN), 0, 0,
-	PHYS(5,0),	NO_DFNS,	CARY(AD_MAGM),
+	PHYS(5,0),	SPDF_NONE,	CARY(AD_MAGM),
 	CONFLICT,	A_LAWFUL, PM_CAVEMAN, NON_PM, 2500L ),
 
@@ -179,25 +196,26 @@
 A("The Staff of Aesculapius",	QUARTERSTAFF,
 	(SPFX_NOGEN|SPFX_RESTR|SPFX_ATTK|SPFX_INTEL|SPFX_DRLI|SPFX_REGEN), 0,0,
-	DRLI(0,0),	DRLI(0,0),	NO_CARY,
+	DRLI(0,0),	SPDF_DRAIN,	NO_CARY,
 	HEALING,	A_NEUTRAL, PM_HEALER, NON_PM, 5000L ),
 
 A("The Magic Mirror of Merlin", MIRROR,
-	(SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL|SPFX_SPEAK), SPFX_ESP, 0,
-	NO_ATTK,	NO_DFNS,	CARY(AD_MAGM),
+	(SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL|SPFX_SPEAK|SPFX_REFLECT), 
+	(SPFX_REFLECT|SPFX_ESP|SPFX_HSPDAM), 0,
+	NO_ATTK,	SPDF_NONE,	NO_CARY,
 	0,		A_LAWFUL, PM_KNIGHT, NON_PM, 1500L ),
 
 A("The Eyes of the Overworld",	LENSES,
 	(SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL|SPFX_XRAY), 0, 0,
-	NO_ATTK,	NO_DFNS,	CARY(AD_MAGM),
+	NO_ATTK,	SPDF_NONE,	CARY(AD_MAGM),
 	ENLIGHTENING,	A_NEUTRAL,	 PM_MONK, NON_PM, 2500L ),
 
 A("The Mitre of Holiness",	HELM_OF_BRILLIANCE,
 	(SPFX_NOGEN|SPFX_RESTR|SPFX_DFLAG2|SPFX_INTEL), 0, M2_UNDEAD,
-	NO_ATTK,	NO_DFNS,	CARY(AD_FIRE),
+	NO_ATTK,	SPDF_NONE,	CARY(AD_FIRE),
 	ENERGY_BOOST,	A_LAWFUL, PM_PRIEST, NON_PM, 2000L ),
 
 A("The Longbow of Diana", BOW,
 	(SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL|SPFX_REFLECT), SPFX_ESP, 0,
-	PHYS(5,0),	NO_DFNS,	NO_CARY,
+	PHYS(5,0),	SPDF_NONE,	NO_CARY,
 	CREATE_AMMO, A_CHAOTIC, PM_RANGER, NON_PM, 4000L ),
 
@@ -205,10 +223,10 @@
 	(SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL|SPFX_SPEAK),
 		(SPFX_WARN|SPFX_TCTRL|SPFX_HPHDAM), 0,
-	NO_ATTK,	NO_DFNS,	NO_CARY,
+	NO_ATTK,	SPDF_NONE,	NO_CARY,
 	UNTRAP,		A_CHAOTIC, PM_ROGUE, NON_PM, 3500L ),
 
 A("The Tsurugi of Muramasa",	TSURUGI,
 	(SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL|SPFX_BEHEAD|SPFX_LUCK), 0, 0,
-	PHYS(0,8),	NO_DFNS,	NO_CARY,
+	PHYS(0,8),	SPDF_NONE,	NO_CARY,
 	0,		A_LAWFUL, PM_SAMURAI, NON_PM, 4500L ),
 
@@ -217,5 +235,5 @@
 	(SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL|SPFX_DEFN),
 		(SPFX_ESP|SPFX_HSPDAM), 0,
-	NO_ATTK,	NO_DFNS,	CARY(AD_MAGM),
+	NO_ATTK,	SPDF_NONE,	CARY(AD_MAGM),
 	CHARGE_OBJ,	A_NEUTRAL, PM_TOURIST, NON_PM, 7000L ),
 #endif
@@ -223,11 +241,11 @@
 A("The Orb of Fate",		CRYSTAL_BALL,
 	(SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL|SPFX_LUCK),
-		(SPFX_WARN|SPFX_HSPDAM|SPFX_HPHDAM), 0,
-	NO_ATTK,	NO_DFNS,	NO_CARY,
+		(SPFX_WARN|SPFX_HPHDAM), 0,
+	NO_ATTK,	SPDF_NONE,	NO_CARY,
 	LEV_TELE,	A_NEUTRAL, PM_VALKYRIE, NON_PM, 3500L ),
 
-A("The Eye of the Aethiopica",	AMULET_OF_ESP,
-	(SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL), (SPFX_EREGEN|SPFX_HSPDAM), 0,
-	NO_ATTK,	NO_DFNS,	CARY(AD_MAGM),
+A("The Eye of the Aethiopica",	AMULET_OF_POWER,
+	(SPFX_NOGEN|SPFX_RESTR|SPFX_INTEL), (SPFX_ESP|SPFX_HSPDAM), 0,
+	NO_ATTK,	SPDF_NONE,	CARY(AD_MAGM),
 	CREATE_PORTAL,	A_NEUTRAL, PM_WIZARD, NON_PM, 4000L ),
 
@@ -235,5 +253,5 @@
  *  terminator; otyp must be zero
  */
-A(0, 0, 0, 0, 0, NO_ATTK, NO_DFNS, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 0L )
+A(0, 0, 0, 0, 0, NO_ATTK, SPDF_NONE, NO_CARY, 0, A_NONE, NON_PM, NON_PM, 0L )
 
 };	/* artilist[] (or artifact_names[]) */
@@ -243,5 +261,4 @@
 #ifndef MAKEDEFS_C
 #undef	NO_ATTK
-#undef	NO_DFNS
 #undef	DFNS
 #undef	PHYS
@@ -251,4 +268,5 @@
 #undef	ELEC
 #undef	STUN
+#undef	DRST
 #endif
 
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/color.h nethack/include/color.h
--- nh_orig/include/color.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/color.h	2009-09-07 11:17:28.044650941 -0400
@@ -6,4 +6,10 @@
 #define COLOR_H
 
+#ifdef MENU_COLOR
+# ifdef MENU_COLOR_REGEX
+#  include <regex.h>
+# endif
+#endif
+
 /*
  * The color scheme used is tailored for an IBM PC.  It consists of the
@@ -50,3 +56,38 @@
 #define HI_ZAP		CLR_BRIGHT_BLUE
 
+#ifdef MENU_COLOR
+struct menucoloring {
+# ifdef MENU_COLOR_REGEX
+#  ifdef MENU_COLOR_REGEX_POSIX
+    regex_t match;
+#  else
+    struct re_pattern_buffer match;
+#  endif
+# else
+    char *match;
+# endif
+    int color, attr;
+    struct menucoloring *next;
+};
+#endif /* MENU_COLOR */
+
+#ifdef STATUS_COLORS
+struct color_option {
+    int color;
+    int attr_bits;
+};
+
+struct percent_color_option {
+	int percentage;
+	struct color_option color_option;
+	const struct percent_color_option *next;
+};
+
+struct text_color_option {
+	const char *text;
+	struct color_option color_option;
+	const struct text_color_option *next;
+};
+#endif
+
 #endif /* COLOR_H */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/config.h nethack/include/config.h
--- nh_orig/include/config.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/config.h	2010-05-14 11:22:24.446714491 -0400
@@ -144,14 +144,19 @@
 #ifndef WIZARD		/* allow for compile-time or Makefile changes */
 # ifndef KR1ED
-#  define WIZARD  "wizard" /* the person allowed to use the -D option */
+#  define WIZARD  "derek" /* the person allowed to use the -D option */
 # else
 #  define WIZARD
-#  define WIZARD_NAME "wizard"
+#  define WIZARD_NAME "derek"
 # endif
 #endif
 
 #define LOGFILE "logfile"	/* larger file for debugging purposes */
+#define XLOGFILE "xlogfile" /* even larger logfile */
 #define NEWS "news"		/* the file containing the latest hack news */
 #define PANICLOG "paniclog"	/* log of panic and impossible events */
+#define DUMP_LOG				 /* turn on dumping */
+#define DUMP_FN "dumps/%n.lastlog"	 /* dump goes here */
+
+#define SERVER_ADMIN_MSG "admin_msg"
 
 /*
@@ -170,9 +175,9 @@
 #ifdef UNIX
 /* path and file name extension for compression program */
-#define COMPRESS "/usr/bin/compress"	/* Lempel-Ziv compression */
-#define COMPRESS_EXTENSION ".Z"		/* compress's extension */
+/* #define COMPRESS "/usr/bin/compress"	 Lempel-Ziv compression */
+/* #define COMPRESS_EXTENSION ".Z"	 compress's extension */
 /* An example of one alternative you might want to use: */
-/* #define COMPRESS "/usr/local/bin/gzip" */	/* FSF gzip compression */
-/* #define COMPRESS_EXTENSION ".gz" */		/* normal gzip extension */
+#define COMPRESS "/usr/bin/gzip" /* FSF gzip compression */
+#define COMPRESS_EXTENSION ".gz" 	/* normal gzip extension */
 #endif
 
@@ -186,5 +191,5 @@
  *	for detailed configuration.
  */
-/* #define DLB */	/* not supported on all platforms */
+#define DLB /* not supported on all platforms */
 
 /*
@@ -215,5 +220,5 @@
  * Of course SECURE is meaningful only if HACKDIR is defined.
  */
-/* #define SECURE */	/* do setuid(getuid()) after chdir() */
+#define SECURE 	/* do setuid(getuid()) after chdir() */
 
 /*
@@ -301,5 +306,5 @@
  */
 
-/* #define VISION_TABLES */ /* use vision tables generated at compile time */
+#define VISION_TABLES /* use vision tables generated at compile time */
 #ifndef VISION_TABLES
 # ifndef NO_MACRO_CPATH
@@ -328,4 +333,5 @@
 /* difficulty */
 #define ELBERETH	/* Engraving the E-word repels monsters */
+#define SORTLOOT
 /* I/O */
 #define REDO		/* support for redoing last command - DGK */
@@ -339,5 +345,25 @@
 
 #define EXP_ON_BOTL	/* Show experience on bottom line */
-/* #define SCORE_ON_BOTL */	/* added by Gary Erickson (erickson@ucivax) */
+#define SCORE_ON_BOTL /* added by Gary Erickson (erickson@ucivax) */
+
+/* #define REALTIME_ON_BOTL */  /* Show elapsed time on bottom line.  Note:
+                                 * this breaks savefile compatibility. */
+
+/* The options in this section require the extended logfile support */
+#ifdef XLOGFILE
+#define RECORD_CONDUCT  /* Record conducts kept in logfile */
+#define RECORD_TURNS    /* Record turns elapsed in logfile */
+#define RECORD_ACHIEVE  /* Record certain notable achievements in the
+                         * logfile.  Note: this breaks savefile compatibility
+                         * due to the addition of the u_achieve struct. */
+#define RECORD_REALTIME /* Record the amount of actual playing time (in
+                         * seconds) in the record file.  Note: this breaks
+                         * savefile compatibility. */
+#define RECORD_START_END_TIME /* Record to-the-second starting and ending
+                               * times; stored as 32-bit values obtained
+                               * from time(2) (seconds since the Epoch.) */
+#define RECORD_GENDER0   /* Record initial gender in logfile */
+#define RECORD_ALIGN0   /* Record initial alignment in logfile */
+#endif
 
 /*
@@ -349,6 +375,23 @@
  */
 
-/*#define GOLDOBJ */	/* Gold is kept on obj chains - Helge Hafting */
-/*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */
+#if defined(TTY_GRAPHICS) || defined(MSWIN_GRAPHICS)
+# define MENU_COLOR
+# define MENU_COLOR_REGEX
+/* if MENU_COLOR_REGEX is defined, use regular expressions (regex.h,
+ * GNU specific functions by default, POSIX functions with
+ * MENU_COLOR_REGEX_POSIX).
+ *
+ * POSIX is required for OSX and possibly others.
+ *
+ * otherwise use pmatch() to match menu color lines.
+ * pmatch() provides basic globbing: '*' and '?' wildcards.
+ */
+#endif
+
+#define STATUS_COLORS
+#define GOLDOBJ /* Gold is kept on obj chains - Helge Hafting */
+#define AUTOPICKUP_EXCEPTIONS /* exceptions to autopickup */
+#define WHEREIS_FILE /* Write out player's current location to player.whereis */
+#define WISH_TRACKER /* Write all wishes to a tracking file */
 
 /* End of Section 5 */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/decl.h nethack/include/decl.h
--- nh_orig/include/decl.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/decl.h	2010-04-26 14:16:44.738840681 -0400
@@ -28,4 +28,5 @@
 
 E NEARDATA int multi;
+E char multi_txt[BUFSZ];
 #if 0
 E NEARDATA int warnlevel;
@@ -73,4 +74,8 @@
     d_level	d_qstart_level, d_qlocate_level, d_nemesis_level;
     d_level	d_knox_level;
+#ifdef RECORD_ACHIEVE
+    d_level     d_mineend_level;
+    d_level     d_sokoend_level;
+#endif
 } dungeon_topology;
 /* macros for accesing the dungeon levels by their old names */
@@ -105,4 +110,8 @@
 #define nemesis_level		(dungeon_topology.d_nemesis_level)
 #define knox_level		(dungeon_topology.d_knox_level)
+#ifdef RECORD_ACHIEVE
+#define mineend_level           (dungeon_topology.d_mineend_level)
+#define sokoend_level           (dungeon_topology.d_sokoend_level)
+#endif
 
 E NEARDATA stairway dnstair, upstair;		/* stairs up and down */
@@ -185,4 +194,7 @@
 #endif
 E char killer_buf[BUFSZ];
+#ifdef DUMP_LOG
+E char dump_fn[];		/* dumpfile name (dump patch) */
+#endif
 E const char *configfile;
 E NEARDATA char plname[PL_NSIZ];
@@ -244,5 +256,5 @@
 #endif
 	*uskin, *uamul, *uleft, *uright, *ublindf,
-	*uwep, *uswapwep, *uquiver;
+	*uwep, *uswapwep, *uquiver, *ulauncher;
 
 E NEARDATA struct obj *uchain;		/* defined only when punished */
@@ -252,4 +264,7 @@
 E NEARDATA struct obj zeroobj;		/* init'd and defined in decl.c */
 
+#include "engrave.h"
+E struct engr *head_engr;
+
 #include "you.h"
 E NEARDATA struct you u;
@@ -262,4 +277,6 @@
 E NEARDATA struct monst youmonst;	/* init'd and defined in decl.c */
 E NEARDATA struct monst *mydogs, *migrating_mons;
+E NEARDATA struct monst* polemonst;
+E NEARDATA struct monst* ukiller;
 
 E NEARDATA struct mvitals {
@@ -386,4 +403,38 @@
 #endif /* AUTOPICKUP_EXCEPTIONS */
 
+#ifdef RECORD_ACHIEVE
+struct u_achieve {
+        Bitfield(get_bell,1);        /* You have obtained the bell of 
+                                      * opening */
+        Bitfield(get_candelabrum,1); /* You have obtained the candelabrum */
+        Bitfield(get_book,1);        /* You have obtained the book of 
+                                      * the dead */
+        Bitfield(enter_gehennom,1);  /* Entered Gehennom (including the 
+                                      * Valley) by any means */
+        Bitfield(perform_invocation,1); /* You have performed the invocation
+                                         * ritual */
+        Bitfield(get_amulet,1);      /* You have obtained the amulet
+                                      * of Yendor */
+        Bitfield(ascended,1);        /* You ascended to demigod[dess]hood.
+                                      * Not quite the same as 
+                                      * u.uevent.ascended. */
+        Bitfield(get_luckstone,1);   /* You obtained the luckstone at the
+                                      * end of the mines. */
+        Bitfield(finish_sokoban,1);  /* You obtained the sokoban prize. */
+        Bitfield(killed_medusa,1);   /* You defeated Medusa. */
+};
+
+E struct u_achieve achieve;
+#endif
+
+#if defined(RECORD_REALTIME) || defined(REALTIME_ON_BOTL)
+E struct realtime_data {
+  time_t realtime;    /* Amount of actual playing time up until the last time
+                       * the game was restored. */
+  time_t restoretime; /* The time that the game was started or restored. */
+  time_t last_displayed_time; /* Last time displayed on the status line */
+} realtime_data;
+#endif /* RECORD_REALTIME || REALTIME_ON_BOTL */
+
 #undef E
 
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/decl.h.~1~ nethack/include/decl.h.~1~
--- nh_orig/include/decl.h.~1~	1969-12-31 19:00:00.000000000 -0500
+++ nethack/include/decl.h.~1~	2009-11-22 07:19:36.043482113 -0500
@@ -0,0 +1,441 @@
+/*	SCCS Id: @(#)decl.h	3.4	2001/12/10	*/
+/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
+/* NetHack may be freely redistributed.  See license for details. */
+
+#ifndef DECL_H
+#define DECL_H
+
+#define E extern
+
+E int NDECL((*occupation));
+E int NDECL((*afternmv));
+
+E const char *hname;
+E int hackpid;
+#if defined(UNIX) || defined(VMS)
+E int locknum;
+#endif
+#ifdef DEF_PAGER
+E char *catmore;
+#endif	/* DEF_PAGER */
+
+E char SAVEF[];
+#ifdef MICRO
+E char SAVEP[];
+#endif
+
+E NEARDATA int bases[MAXOCLASSES];
+
+E NEARDATA int multi;
+E char multi_txt[BUFSZ];
+#if 0
+E NEARDATA int warnlevel;
+#endif
+E NEARDATA int nroom;
+E NEARDATA int nsubroom;
+E NEARDATA int occtime;
+
+#define WARNCOUNT 6			/* number of different warning levels */
+E uchar warnsyms[WARNCOUNT];
+
+E int x_maze_max, y_maze_max;
+E int otg_temp;
+
+#ifdef REDO
+E NEARDATA int in_doagain;
+#endif
+
+E struct dgn_topology {		/* special dungeon levels for speed */
+    d_level	d_oracle_level;
+    d_level	d_bigroom_level;	/* unused */
+#ifdef REINCARNATION
+    d_level	d_rogue_level;
+#endif
+    d_level	d_medusa_level;
+    d_level	d_stronghold_level;
+    d_level	d_valley_level;
+    d_level	d_wiz1_level;
+    d_level	d_wiz2_level;
+    d_level	d_wiz3_level;
+    d_level	d_juiblex_level;
+    d_level	d_orcus_level;
+    d_level	d_baalzebub_level;	/* unused */
+    d_level	d_asmodeus_level;	/* unused */
+    d_level	d_portal_level;		/* only in goto_level() [do.c] */
+    d_level	d_sanctum_level;
+    d_level	d_earth_level;
+    d_level	d_water_level;
+    d_level	d_fire_level;
+    d_level	d_air_level;
+    d_level	d_astral_level;
+    xchar	d_tower_dnum;
+    xchar	d_sokoban_dnum;
+    xchar	d_mines_dnum, d_quest_dnum;
+    d_level	d_qstart_level, d_qlocate_level, d_nemesis_level;
+    d_level	d_knox_level;
+#ifdef RECORD_ACHIEVE
+    d_level     d_mineend_level;
+    d_level     d_sokoend_level;
+#endif
+} dungeon_topology;
+/* macros for accesing the dungeon levels by their old names */
+#define oracle_level		(dungeon_topology.d_oracle_level)
+#define bigroom_level		(dungeon_topology.d_bigroom_level)
+#ifdef REINCARNATION
+#define rogue_level		(dungeon_topology.d_rogue_level)
+#endif
+#define medusa_level		(dungeon_topology.d_medusa_level)
+#define stronghold_level	(dungeon_topology.d_stronghold_level)
+#define valley_level		(dungeon_topology.d_valley_level)
+#define wiz1_level		(dungeon_topology.d_wiz1_level)
+#define wiz2_level		(dungeon_topology.d_wiz2_level)
+#define wiz3_level		(dungeon_topology.d_wiz3_level)
+#define juiblex_level		(dungeon_topology.d_juiblex_level)
+#define orcus_level		(dungeon_topology.d_orcus_level)
+#define baalzebub_level		(dungeon_topology.d_baalzebub_level)
+#define asmodeus_level		(dungeon_topology.d_asmodeus_level)
+#define portal_level		(dungeon_topology.d_portal_level)
+#define sanctum_level		(dungeon_topology.d_sanctum_level)
+#define earth_level		(dungeon_topology.d_earth_level)
+#define water_level		(dungeon_topology.d_water_level)
+#define fire_level		(dungeon_topology.d_fire_level)
+#define air_level		(dungeon_topology.d_air_level)
+#define astral_level		(dungeon_topology.d_astral_level)
+#define tower_dnum		(dungeon_topology.d_tower_dnum)
+#define sokoban_dnum		(dungeon_topology.d_sokoban_dnum)
+#define mines_dnum		(dungeon_topology.d_mines_dnum)
+#define quest_dnum		(dungeon_topology.d_quest_dnum)
+#define qstart_level		(dungeon_topology.d_qstart_level)
+#define qlocate_level		(dungeon_topology.d_qlocate_level)
+#define nemesis_level		(dungeon_topology.d_nemesis_level)
+#define knox_level		(dungeon_topology.d_knox_level)
+#ifdef RECORD_ACHIEVE
+#define mineend_level           (dungeon_topology.d_mineend_level)
+#define sokoend_level           (dungeon_topology.d_sokoend_level)
+#endif
+
+E NEARDATA stairway dnstair, upstair;		/* stairs up and down */
+#define xdnstair	(dnstair.sx)
+#define ydnstair	(dnstair.sy)
+#define xupstair	(upstair.sx)
+#define yupstair	(upstair.sy)
+
+E NEARDATA stairway dnladder, upladder;		/* ladders up and down */
+#define xdnladder	(dnladder.sx)
+#define ydnladder	(dnladder.sy)
+#define xupladder	(upladder.sx)
+#define yupladder	(upladder.sy)
+
+E NEARDATA stairway sstairs;
+
+E NEARDATA dest_area updest, dndest;	/* level-change destination areas */
+
+E NEARDATA coord inv_pos;
+E NEARDATA dungeon dungeons[];
+E NEARDATA s_level *sp_levchn;
+#define dunlev_reached(x)	(dungeons[(x)->dnum].dunlev_ureached)
+
+#include "quest.h"
+E struct q_score quest_status;
+
+E NEARDATA char pl_character[PL_CSIZ];
+E NEARDATA char pl_race;		/* character's race */
+
+E NEARDATA char pl_fruit[PL_FSIZ];
+E NEARDATA int current_fruit;
+E NEARDATA struct fruit *ffruit;
+
+E NEARDATA char tune[6];
+
+#define MAXLINFO (MAXDUNGEON * MAXLEVEL)
+E struct linfo level_info[MAXLINFO];
+
+E NEARDATA struct sinfo {
+	int gameover;		/* self explanatory? */
+	int stopprint;		/* inhibit further end of game disclosure */
+#if defined(UNIX) || defined(VMS) || defined (__EMX__) || defined(WIN32)
+	int done_hup;		/* SIGHUP or moral equivalent received
+				 * -- no more screen output */
+#endif
+	int something_worth_saving;	/* in case of panic */
+	int panicking;		/* `panic' is in progress */
+#if defined(VMS) || defined(WIN32)
+	int exiting;		/* an exit handler is executing */
+#endif
+	int in_impossible;
+#ifdef PANICLOG
+	int in_paniclog;
+#endif
+} program_state;
+
+E boolean restoring;
+
+E const char quitchars[];
+E const char vowels[];
+E const char ynchars[];
+E const char ynqchars[];
+E const char ynaqchars[];
+E const char ynNaqchars[];
+E NEARDATA long yn_number;
+
+E const char disclosure_options[];
+
+E NEARDATA int smeq[];
+E NEARDATA int doorindex;
+E NEARDATA char *save_cm;
+#define KILLED_BY_AN	 0
+#define KILLED_BY	 1
+#define NO_KILLER_PREFIX 2
+E NEARDATA int killer_format;
+E const char *killer;
+E const char *delayed_killer;
+#ifdef GOLDOBJ
+E long done_money;
+#endif
+E char killer_buf[BUFSZ];
+#ifdef DUMP_LOG
+E char dump_fn[];		/* dumpfile name (dump patch) */
+#endif
+E const char *configfile;
+E NEARDATA char plname[PL_NSIZ];
+E NEARDATA char dogname[];
+E NEARDATA char catname[];
+E NEARDATA char horsename[];
+E char preferred_pet;
+E const char *occtxt;			/* defined when occupation != NULL */
+E const char *nomovemsg;
+E const char nul[];
+E char lock[];
+
+E const char sdir[], ndir[];
+E const schar xdir[], ydir[], zdir[];
+
+E NEARDATA schar tbx, tby;		/* set in mthrowu.c */
+
+E NEARDATA struct multishot { int n, i; short o; boolean s; } m_shot;
+
+E NEARDATA struct dig_info {		/* apply.c, hack.c */
+	int	effort;
+	d_level level;
+	coord	pos;
+	long lastdigtime;
+	boolean down, chew, warned, quiet;
+} digging;
+
+E NEARDATA long moves, monstermoves;
+E NEARDATA long wailmsg;
+
+E NEARDATA boolean in_mklev;
+E NEARDATA boolean stoned;
+E NEARDATA boolean unweapon;
+E NEARDATA boolean mrg_to_wielded;
+E NEARDATA struct obj *current_wand;
+
+E NEARDATA boolean in_steed_dismounting;
+
+E const int shield_static[];
+
+#include "spell.h"
+E NEARDATA struct spell spl_book[];	/* sized in decl.c */
+
+#include "color.h"
+#ifdef TEXTCOLOR
+E const int zapcolors[];
+#endif
+
+E const char def_oc_syms[MAXOCLASSES];	/* default class symbols */
+E uchar oc_syms[MAXOCLASSES];		/* current class symbols */
+E const char def_monsyms[MAXMCLASSES];	/* default class symbols */
+E uchar monsyms[MAXMCLASSES];		/* current class symbols */
+
+#include "obj.h"
+E NEARDATA struct obj *invent,
+	*uarm, *uarmc, *uarmh, *uarms, *uarmg, *uarmf,
+#ifdef TOURIST
+	*uarmu,				/* under-wear, so to speak */
+#endif
+	*uskin, *uamul, *uleft, *uright, *ublindf,
+	*uwep, *uswapwep, *uquiver, *ulauncher;
+
+E NEARDATA struct obj *uchain;		/* defined only when punished */
+E NEARDATA struct obj *uball;
+E NEARDATA struct obj *migrating_objs;
+E NEARDATA struct obj *billobjs;
+E NEARDATA struct obj zeroobj;		/* init'd and defined in decl.c */
+
+#include "engrave.h"
+E struct engr *head_engr;
+
+#include "you.h"
+E NEARDATA struct you u;
+
+#include "onames.h"
+#ifndef PM_H		/* (pm.h has already been included via youprop.h) */
+#include "pm.h"
+#endif
+
+E NEARDATA struct monst youmonst;	/* init'd and defined in decl.c */
+E NEARDATA struct monst *mydogs, *migrating_mons;
+E NEARDATA struct monst* polemonst;
+E NEARDATA struct monst* ukiller;
+
+E NEARDATA struct mvitals {
+	uchar	born;
+	uchar	died;
+	uchar	mvflags;
+} mvitals[NUMMONS];
+
+E NEARDATA struct c_color_names {
+    const char	*const c_black, *const c_amber, *const c_golden,
+		*const c_light_blue,*const c_red, *const c_green,
+		*const c_silver, *const c_blue, *const c_purple,
+		*const c_white;
+} c_color_names;
+#define NH_BLACK		c_color_names.c_black
+#define NH_AMBER		c_color_names.c_amber
+#define NH_GOLDEN		c_color_names.c_golden
+#define NH_LIGHT_BLUE		c_color_names.c_light_blue
+#define NH_RED			c_color_names.c_red
+#define NH_GREEN		c_color_names.c_green
+#define NH_SILVER		c_color_names.c_silver
+#define NH_BLUE			c_color_names.c_blue
+#define NH_PURPLE		c_color_names.c_purple
+#define NH_WHITE		c_color_names.c_white
+
+/* The names of the colors used for gems, etc. */
+E const char *c_obj_colors[];
+
+E struct c_common_strings {
+    const char	*const c_nothing_happens, *const c_thats_enough_tries,
+		*const c_silly_thing_to, *const c_shudder_for_moment,
+		*const c_something, *const c_Something,
+		*const c_You_can_move_again,
+		*const c_Never_mind, *c_vision_clears,
+		*const c_the_your[2];
+} c_common_strings;
+#define nothing_happens    c_common_strings.c_nothing_happens
+#define thats_enough_tries c_common_strings.c_thats_enough_tries
+#define silly_thing_to	   c_common_strings.c_silly_thing_to
+#define shudder_for_moment c_common_strings.c_shudder_for_moment
+#define something	   c_common_strings.c_something
+#define Something	   c_common_strings.c_Something
+#define You_can_move_again c_common_strings.c_You_can_move_again
+#define Never_mind	   c_common_strings.c_Never_mind
+#define vision_clears	   c_common_strings.c_vision_clears
+#define the_your	   c_common_strings.c_the_your
+
+/* material strings */
+E const char *materialnm[];
+
+/* Monster name articles */
+#define ARTICLE_NONE	0
+#define ARTICLE_THE	1
+#define ARTICLE_A	2
+#define ARTICLE_YOUR	3
+
+/* Monster name suppress masks */
+#define SUPPRESS_IT		0x01
+#define SUPPRESS_INVISIBLE	0x02
+#define SUPPRESS_HALLUCINATION  0x04
+#define SUPPRESS_SADDLE		0x08
+#define EXACT_NAME		0x0F
+
+/* Vision */
+E NEARDATA boolean vision_full_recalc;	/* TRUE if need vision recalc */
+E NEARDATA char **viz_array;		/* could see/in sight row pointers */
+
+/* Window system stuff */
+E NEARDATA winid WIN_MESSAGE, WIN_STATUS;
+E NEARDATA winid WIN_MAP, WIN_INVEN;
+E char toplines[];
+#ifndef TCAP_H
+E struct tc_gbl_data {	/* also declared in tcap.h */
+    char *tc_AS, *tc_AE;	/* graphics start and end (tty font swapping) */
+    int   tc_LI,  tc_CO;	/* lines and columns */
+} tc_gbl_data;
+#define AS tc_gbl_data.tc_AS
+#define AE tc_gbl_data.tc_AE
+#define LI tc_gbl_data.tc_LI
+#define CO tc_gbl_data.tc_CO
+#endif
+
+/* xxxexplain[] is in drawing.c */
+E const char * const monexplain[], invisexplain[], * const objexplain[], * const oclass_names[];
+
+/* Some systems want to use full pathnames for some subsets of file names,
+ * rather than assuming that they're all in the current directory.  This
+ * provides all the subclasses that seem reasonable, and sets up for all
+ * prefixes being null.  Port code can set those that it wants.
+ */
+#define HACKPREFIX	0
+#define LEVELPREFIX	1
+#define SAVEPREFIX	2
+#define BONESPREFIX	3
+#define DATAPREFIX	4	/* this one must match hardcoded value in dlb.c */
+#define SCOREPREFIX	5
+#define LOCKPREFIX	6
+#define CONFIGPREFIX	7
+#define TROUBLEPREFIX	8
+#define PREFIX_COUNT	9
+/* used in files.c; xxconf.h can override if needed */
+# ifndef FQN_MAX_FILENAME
+#define FQN_MAX_FILENAME 512
+# endif
+
+#if defined(NOCWD_ASSUMPTIONS) || defined(VAR_PLAYGROUND)
+/* the bare-bones stuff is unconditional above to simplify coding; for
+ * ports that actually use prefixes, add some more localized things
+ */
+#define PREFIXES_IN_USE
+#endif
+
+E char *fqn_prefix[PREFIX_COUNT];
+#ifdef PREFIXES_IN_USE
+E char *fqn_prefix_names[PREFIX_COUNT];
+#endif
+
+#ifdef AUTOPICKUP_EXCEPTIONS
+struct autopickup_exception {
+	char *pattern;
+	boolean grab;
+	struct autopickup_exception *next;
+};
+#endif /* AUTOPICKUP_EXCEPTIONS */
+
+#ifdef RECORD_ACHIEVE
+struct u_achieve {
+        Bitfield(get_bell,1);        /* You have obtained the bell of 
+                                      * opening */
+        Bitfield(get_candelabrum,1); /* You have obtained the candelabrum */
+        Bitfield(get_book,1);        /* You have obtained the book of 
+                                      * the dead */
+        Bitfield(enter_gehennom,1);  /* Entered Gehennom (including the 
+                                      * Valley) by any means */
+        Bitfield(perform_invocation,1); /* You have performed the invocation
+                                         * ritual */
+        Bitfield(get_amulet,1);      /* You have obtained the amulet
+                                      * of Yendor */
+        Bitfield(ascended,1);        /* You ascended to demigod[dess]hood.
+                                      * Not quite the same as 
+                                      * u.uevent.ascended. */
+        Bitfield(get_luckstone,1);   /* You obtained the luckstone at the
+                                      * end of the mines. */
+        Bitfield(finish_sokoban,1);  /* You obtained the sokoban prize. */
+        Bitfield(killed_medusa,1);   /* You defeated Medusa. */
+};
+
+E struct u_achieve achieve;
+#endif
+
+#if defined(RECORD_REALTIME) || defined(REALTIME_ON_BOTL)
+E struct realtime_data {
+  time_t realtime;    /* Amount of actual playing time up until the last time
+                       * the game was restored. */
+  time_t restoretime; /* The time that the game was started or restored. */
+  time_t last_displayed_time; /* Last time displayed on the status line */
+} realtime_data;
+#endif /* RECORD_REALTIME || REALTIME_ON_BOTL */
+
+#undef E
+
+#endif /* DECL_H */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/display.h nethack/include/display.h
--- nh_orig/include/display.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/display.h	2010-03-24 12:55:58.944626078 -0400
@@ -27,5 +27,5 @@
 #define tp_sensemon(mon) (	/* The hero can always sense a monster IF:  */\
     (!mindless(mon->data)) &&	/* 1. the monster has a brain to sense AND  */\
-      ((Blind && Blind_telepat) ||	/* 2a. hero is blind and telepathic OR	    */\
+    ((Blind && Blind_telepat && (distu(mon->mx, mon->my) <= u.u_telepathy_dist)) ||	/* 2a. hero is blind and telepathic OR	    */ \
 				/* 2b. hero is using a telepathy inducing   */\
 				/*	 object and in range		    */\
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/dungeon.h nethack/include/dungeon.h
--- nh_orig/include/dungeon.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/dungeon.h	2009-09-07 11:23:57.339293253 -0400
@@ -122,4 +122,8 @@
 #define Is_nemesis(x)		(on_level(x, &nemesis_level))
 #define Is_knox(x)		(on_level(x, &knox_level))
+#ifdef RECORD_ACHIEVE
+#define Is_mineend_level(x)     (on_level(x, &mineend_level))
+#define Is_sokoend_level(x)     (on_level(x, &sokoend_level))
+#endif
 
 #define In_sokoban(x)		((x)->dnum == sokoban_dnum)
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/eshk.h nethack/include/eshk.h
--- nh_orig/include/eshk.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/eshk.h	2009-11-23 13:59:51.796398963 -0500
@@ -43,3 +43,6 @@
 #define ANGRY(mon)	(!NOTANGRY(mon))
 
+#define match_shkrace(mon) ((urace.malenum == (mon)->mnum) || \
+				(urace.malenum == PM_ELF && (mon)->mnum == PM_GREEN_ELF))
+
 #endif /* ESHK_H */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/extern.h nethack/include/extern.h
--- nh_orig/include/extern.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/extern.h	2010-08-16 13:20:13.101707800 -0400
@@ -26,4 +26,7 @@
 E void NDECL(newgame);
 E void FDECL(welcome, (BOOLEAN_P));
+#if defined(RECORD_REALTIME) || defined(REALTIME_ON_BOTL)
+E time_t NDECL(get_realtime);
+#endif
 
 /* ### apply.c ### */
@@ -132,4 +135,8 @@
 E const char *FDECL(rank_of, (int,SHORT_P,BOOLEAN_P));
 E void NDECL(bot);
+#ifdef DUMP_LOG
+E void FDECL(bot1str, (char *));
+E void FDECL(bot2str, (char *));
+#endif
 
 /* ### cmd.c ### */
@@ -167,4 +174,8 @@
 E void FDECL(enlightenment, (int));
 E void FDECL(show_conduct, (int));
+#ifdef DUMP_LOG
+E void FDECL(dump_enlightenment, (int));
+E void FDECL(dump_conduct, (int));
+#endif
 E int FDECL(xytod, (SCHAR_P,SCHAR_P));
 E void FDECL(dtoxy, (coord *,int));
@@ -243,4 +254,5 @@
 E void FDECL(rot_organic, (genericptr_t, long));
 E void FDECL(rot_corpse, (genericptr_t, long));
+E void NDECL(get_coal);
 #if 0
 E void FDECL(bury_monst, (struct monst *));
@@ -282,4 +294,7 @@
 E void NDECL(cls);
 E void FDECL(flush_screen, (int));
+#ifdef DUMP_LOG
+E void NDECL(dump_screen);
+#endif
 E int FDECL(back_to_glyph, (XCHAR_P,XCHAR_P));
 E int FDECL(zapdir_to_glyph, (int,int,int));
@@ -434,4 +449,6 @@
 /* ### dothrow.c ### */
 
+E int NDECL(boom_flightpath_menu);
+E struct monst * FDECL(camera_demon, (struct obj *,SCHAR_P, SCHAR_P));
 E int NDECL(dothrow);
 E int NDECL(dofire);
@@ -517,4 +534,5 @@
 E int NDECL(unfaint);
 #endif
+E char * FDECL(tin_content_text, (struct obj *));
 E boolean FDECL(is_edible, (struct obj *));
 E void NDECL(init_uhunger);
@@ -554,4 +572,8 @@
 E void FDECL(done, (int));
 E void FDECL(container_contents, (struct obj *,BOOLEAN_P,BOOLEAN_P));
+#ifdef DUMP_LOG
+E void FDECL(dump, (char *, char *));
+E void FDECL(do_containerconts, (struct obj *,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P));
+#endif
 E void FDECL(terminate, (int));
 E int NDECL(num_genocides);
@@ -661,4 +683,12 @@
 E void NDECL(really_close);
 #endif
+#ifdef WHEREIS_FILE
+E void NDECL(touch_whereis);
+E void NDECL(delete_whereis);
+#endif
+#ifdef WISH_TRACKER
+E void FDECL(trackwish,(char *));
+E void FDECL(makeannounce,(char *));
+#endif
 
 /* ### fountain.c ### */
@@ -695,7 +725,8 @@
 E void NDECL(lookaround);
 E int NDECL(monster_nearby);
-E void FDECL(nomul, (int));
+E void FDECL(nomul, (int, const char *));
 E void FDECL(unmul, (const char *));
 E void FDECL(losehp, (int,const char *,BOOLEAN_P));
+E int FDECL(gainmaxhp, (int));
 E int NDECL(weight_cap);
 E int NDECL(inv_weight);
@@ -718,4 +749,6 @@
 E char *FDECL(upstart, (char *));
 E char *FDECL(mungspaces, (char *));
+E char *FDECL(stripctrl, (char *));
+E char *FDECL(trim, (char *));
 E char *FDECL(eos, (char *));
 E char *FDECL(strkitten, (char *,CHAR_P));
@@ -748,4 +781,5 @@
 E int NDECL(phase_of_the_moon);
 E boolean NDECL(friday_13th);
+E boolean NDECL(christmas);
 E int NDECL(night);
 E int NDECL(midnight);
@@ -791,4 +825,7 @@
 E int NDECL(ddoinv);
 E char FDECL(display_inventory, (const char *,BOOLEAN_P));
+#ifdef DUMP_LOG
+E char FDECL(dump_inventory, (const char *,BOOLEAN_P,BOOLEAN_P));
+#endif
 E int FDECL(display_binventory, (int,int,BOOLEAN_P));
 E struct obj *FDECL(display_cinventory,(struct obj *));
@@ -809,5 +846,5 @@
 E int NDECL(doprinuse);
 E void FDECL(useupf, (struct obj *,long));
-E char *FDECL(let_to_name, (CHAR_P,BOOLEAN_P));
+E char *FDECL(let_to_name, (CHAR_P,BOOLEAN_P,BOOLEAN_P));
 E void NDECL(free_invbuf);
 E void NDECL(reassign);
@@ -860,5 +897,5 @@
 E boolean FDECL(picking_at, (int,int));
 E void NDECL(reset_pick);
-E int FDECL(pick_lock, (struct obj *));
+E int FDECL(pick_lock, (struct obj *,int,int));
 E int NDECL(doforce);
 E boolean FDECL(boxlock, (struct obj *,struct obj *));
@@ -909,4 +946,5 @@
 /* ### mail.c ### */
 
+E void NDECL(ck_server_admin_msg);
 #ifdef MAIL
 # ifdef UNIX
@@ -953,4 +991,5 @@
 
 E int FDECL(fightm, (struct monst *));
+E boolean FDECL(resist_conflict, (struct monst *));
 E int FDECL(mattackm, (struct monst *,struct monst *));
 E int FDECL(noattacks, (struct permonst *));
@@ -996,6 +1035,7 @@
 E void FDECL(add_subroom, (struct mkroom *,int,int,int,int,
 			   BOOLEAN_P,SCHAR_P,BOOLEAN_P));
-E void NDECL(makecorridors);
+E void FDECL(makecorridors, (int));
 E void FDECL(add_door, (int,int,struct mkroom *));
+E void NDECL(mkpoolroom);
 E void NDECL(mklev);
 #ifdef SPECIALIZATION
@@ -1011,4 +1051,5 @@
 E void FDECL(mkstairs, (XCHAR_P,XCHAR_P,CHAR_P,struct mkroom *));
 E void NDECL(mkinvokearea);
+E void FDECL(wallwalk_right, (XCHAR_P,XCHAR_P,SCHAR_P,SCHAR_P,SCHAR_P,int));
 
 /* ### mkmap.c ### */
@@ -1020,5 +1061,6 @@
 
 E void FDECL(wallification, (int,int,int,int));
-E void FDECL(walkfrom, (int,int));
+E void FDECL(wall_extends, (int,int,int,int));
+E void FDECL(walkfrom, (int,int, SCHAR_P));
 E void FDECL(makemaz, (const char *));
 E void FDECL(mazexy, (coord *));
@@ -1072,4 +1114,5 @@
 E int FDECL(add_to_minv, (struct monst *, struct obj *));
 E struct obj *FDECL(add_to_container, (struct obj *, struct obj *));
+E long FDECL(get_container_weight, (struct obj *));
 E void FDECL(add_to_migration, (struct obj *));
 E void FDECL(add_to_buried, (struct obj *));
@@ -1083,4 +1126,5 @@
 /* ### mkroom.c ### */
 
+E struct mkroom * FDECL(pick_room,(BOOLEAN_P));
 E void FDECL(mkroom, (int));
 E void FDECL(fill_zoo, (struct mkroom *));
@@ -1100,4 +1144,5 @@
 /* ### mon.c ### */
 
+E void FDECL(remove_monster, (int, int));
 E int FDECL(undead_to_corpse, (int));
 E int FDECL(genus, (int,int));
@@ -1152,4 +1197,5 @@
 E boolean FDECL(angry_guards, (BOOLEAN_P));
 E void NDECL(pacify_guards);
+E boolean FDECL(damage_mon,(struct monst*,int,int));
 
 /* ### mondata.c ### */
@@ -1162,4 +1208,5 @@
 E boolean FDECL(resists_magm, (struct monst *));
 E boolean FDECL(resists_blnd, (struct monst *));
+E boolean FDECL(vulnerable_to, (struct monst *,int));
 E boolean FDECL(can_blnd, (struct monst *,struct monst *,UCHAR_P,struct obj *));
 E boolean FDECL(ranged_attk, (struct permonst *));
@@ -1212,4 +1259,5 @@
 /* ### mplayer.c ### */
 
+E const char *FDECL(elf_name, (size_t));
 E struct monst *FDECL(mk_mplayer, (struct permonst *,XCHAR_P,
 				   XCHAR_P,BOOLEAN_P));
@@ -1358,7 +1406,12 @@
 E boolean FDECL(the_unique_obj, (struct obj *obj));
 E char *FDECL(doname, (struct obj *));
+E char *FDECL(doname_with_price, (struct obj *));
 E boolean FDECL(not_fully_identified, (struct obj *));
 E char *FDECL(corpse_xname, (struct obj *,BOOLEAN_P));
 E char *FDECL(cxname, (struct obj *));
+E void FDECL(add_erosion_words, (struct obj *, char *));
+#ifdef SORTLOOT
+E char *FDECL(cxname2, (struct obj *));
+#endif
 E char *FDECL(killer_xname, (struct obj *));
 E const char *FDECL(singular, (struct obj *,char *(*)(OBJ_P)));
@@ -1406,4 +1459,7 @@
 E void NDECL(free_autopickup_exceptions);
 #endif /* AUTOPICKUP_EXCEPTIONS */
+#ifdef MENU_COLOR
+E boolean FDECL(add_menu_coloring, (char *));
+#endif /* MENU_COLOR */
 
 /* ### pager.c ### */
@@ -1544,4 +1600,8 @@
 E void FDECL(set_itimeout, (long *,long));
 E void FDECL(incr_itimeout, (long *,int));
+E void FDECL(incr_resistance, (long *,int));
+E void FDECL(decr_resistance, (long *,int));
+E int FDECL(how_resistant, (int));
+E int FDECL(resist_reduce, (int,int));
 E void FDECL(make_confused, (long,BOOLEAN_P));
 E void FDECL(make_stunned, (long,BOOLEAN_P));
@@ -1624,5 +1684,5 @@
 E void FDECL(com_pager, (int));
 E void FDECL(qt_pager, (int));
-E struct permonst *NDECL(qt_montype);
+E char *FDECL(string_subst, (char *));
 
 /* ### random.c ### */
@@ -1677,5 +1737,5 @@
 E void FDECL(save_regions, (int,int));
 E void FDECL(rest_regions, (int,BOOLEAN_P));
-E NhRegion* FDECL(create_gas_cloud, (XCHAR_P, XCHAR_P, int, int));
+E NhRegion* FDECL(create_gas_cloud, (XCHAR_P, XCHAR_P, int, size_t));
 
 /* ### restore.c ### */
@@ -1827,8 +1887,10 @@
 E void FDECL(check_unpaid, (struct obj *));
 E void FDECL(costly_gold, (XCHAR_P,XCHAR_P,long));
+E long FDECL(get_cost_of_shop_item, (struct obj *));
 E boolean FDECL(block_door, (XCHAR_P,XCHAR_P));
 E boolean FDECL(block_entry, (XCHAR_P,XCHAR_P));
 E char *FDECL(shk_your, (char *,struct obj *));
 E char *FDECL(Shk_Your, (char *,struct obj *));
+E void FDECL(shk_holler, (struct monst*));
 
 /* ### shknam.c ### */
@@ -1941,4 +2003,5 @@
 E void FDECL(tele_trap, (struct trap *));
 E void FDECL(level_tele_trap, (struct trap *));
+E boolean FDECL(rloc_pos_ok, (int,int,struct monst *));
 E void FDECL(rloc_to, (struct monst *,int,int));
 E boolean FDECL(rloc, (struct monst *, BOOLEAN_P));
@@ -1987,4 +2050,7 @@
 
 E void FDECL(topten, (int));
+#ifdef LOGFILE
+E void FDECL(write_log_entry, (int,long));
+#endif
 E void FDECL(prscore, (int,char **));
 E struct obj *FDECL(tt_oname, (struct obj *));
@@ -2238,4 +2304,7 @@
 E int NDECL(dbon);
 E int NDECL(enhance_weapon_skill);
+#ifdef DUMP_LOG
+E void NDECL(dump_weapon_skill);
+#endif
 E void FDECL(unrestrict_weapon_skill, (int));
 E void FDECL(use_skill, (int,int));
@@ -2260,8 +2329,10 @@
 E void FDECL(setuwep, (struct obj *));
 E void FDECL(setuqwep, (struct obj *));
+E void FDECL(setulauncher, (struct obj *));
 E void FDECL(setuswapwep, (struct obj *));
 E int NDECL(dowield);
 E int NDECL(doswapweapon);
 E int NDECL(dowieldquiver);
+E int NDECL(dowieldlauncher);
 E boolean FDECL(wield_tool, (struct obj *,const char *));
 E int NDECL(can_twoweapon);
@@ -2271,6 +2342,8 @@
 E void NDECL(uswapwepgone);
 E void NDECL(uqwepgone);
+E void NDECL(ulwepgone);
 E void NDECL(untwoweapon);
-E void FDECL(erode_obj, (struct obj *,BOOLEAN_P,BOOLEAN_P));
+E boolean FDECL(_erode_obj, (struct obj *,int));
+E void FDECL(erode_obj, (struct obj *,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P));
 E int FDECL(chwepon, (struct obj *,int));
 E int FDECL(welded, (struct obj *));
@@ -2293,5 +2366,5 @@
 E void NDECL(clonewiz);
 E int NDECL(pick_nasty);
-E int FDECL(nasty, (struct monst*));
+E int FDECL(nasty, (struct monst*,BOOLEAN_P));
 E void NDECL(resurrect);
 E void NDECL(intervene);
@@ -2369,9 +2442,9 @@
 E struct monst *FDECL(bhit, (int,int,int,int,int (*)(MONST_P,OBJ_P),
 			     int (*)(OBJ_P,OBJ_P),struct obj *));
-E struct monst *FDECL(boomhit, (int,int));
+E struct monst *FDECL(boomhit, (int,int,int));
 E int FDECL(burn_floor_paper, (int,int,BOOLEAN_P,BOOLEAN_P));
 E void FDECL(buzz, (int,int,XCHAR_P,XCHAR_P,int,int));
 E void FDECL(melt_ice, (XCHAR_P,XCHAR_P));
-E int FDECL(zap_over_floor, (XCHAR_P,XCHAR_P,int,boolean *));
+E int FDECL(zap_over_floor, (XCHAR_P,XCHAR_P,int,boolean *,boolean));
 E void FDECL(fracture_rock, (struct obj *));
 E boolean FDECL(break_statue, (struct obj *));
@@ -2380,4 +2453,7 @@
 E int FDECL(resist, (struct monst *,CHAR_P,int,int));
 E void NDECL(makewish);
+E void FDECL(monstseesu,(unsigned long));
+E void FDECL(monstseesulose,(unsigned long));
+E void NDECL(blindingflash);
 
 #endif /* !MAKEDEFS_C && !LEV_LEX_C */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/flag.h nethack/include/flag.h
--- nh_orig/include/flag.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/flag.h	2010-08-16 13:20:13.102707769 -0400
@@ -184,4 +184,10 @@
 	boolean  extmenu;	/* extended commands use menu interface */
 #endif
+#ifdef MENU_COLOR
+	boolean use_menu_color;	/* use color in menus; only if wc_color */
+#endif
+#if defined(STATUS_COLORS) && defined(TEXTCOLOR)
+	boolean use_status_colors; /* use color in status line; only if wc_color */
+#endif
 #ifdef MFLOPPY
 	boolean  checkspace;	/* check disk space before writing files */
@@ -217,4 +223,7 @@
 	boolean lan_mail_fetched; /* mail is awaiting display */
 #endif
+#ifdef SORTLOOT
+	char sortloot;          /* sort items to loot alphabetically */
+#endif
 /*
  * Window capability support.
@@ -264,4 +273,6 @@
 	boolean wc2_softkeyboard;	/* use software keyboard */
 	boolean wc2_wraptext;		/* wrap text */
+	boolean wc2_darkgray;		/* try to use PC dark-gray color
+					 * to represent black object */
 
 	boolean  cmdassist;	/* provide detailed assistance for some commands */
@@ -270,5 +281,11 @@
 	boolean  lootabc;	/* use "a/b/c" rather than "o/i/b" when looting */
 	boolean  showrace;	/* show hero glyph by race rather than by role */
+	boolean  showobjsym;	/* show object class symbol in menus where available */
 	boolean  travelcmd;	/* allow travel command */
+	boolean  show_dgn_name; /* show dungeon names instead of Dlvl: on bottom line
+										 probably only good for people taking advantage of 
+										 the wide terminals allowed in Spork */
+    int boom_flight_path; /* boomerang flight path */
+
 	int	 runmode;	/* update screen display during run moves */
 #ifdef AUTOPICKUP_EXCEPTIONS
@@ -281,4 +298,8 @@
 	char	 altkeyhandler[MAX_ALTKEYHANDLER];
 #endif
+#ifdef REALTIME_ON_BOTL
+  boolean  showrealtime; /* show actual elapsed time */
+#endif
+    boolean  dark_room;	/* show shadows in lit rooms */
 };
 
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/global.h nethack/include/global.h
--- nh_orig/include/global.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/global.h	2009-09-07 09:52:23.773293399 -0400
@@ -237,4 +237,8 @@
 #endif
 
+#ifdef OSX
+# define MENU_COLOR_REGEX_POSIX
+#endif
+
 #ifdef VMS
 /* vms_exit() (sys/vms/vmsmisc.c) expects the non-VMS EXIT_xxx values below.
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/hack.h nethack/include/hack.h
--- nh_orig/include/hack.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/hack.h	2009-08-02 13:49:33.029408334 -0400
@@ -19,5 +19,5 @@
 #define ON		1
 #define OFF		0
-#define BOLT_LIM	8 /* from this distance ranged attacks will be made */
+#define BOLT_LIM	16 /* from this distance ranged attacks may be made */
 #define MAX_CARR_CAP	1000	/* so that boulders can be heavier */
 #define DUMMY { 0 }
@@ -100,7 +100,8 @@
 #define FLASHED_LIGHT	3
 #define INVIS_BEAM	4
-
 #define MATCH_WARN_OF_MON(mon)	 (Warn_of_mon && flags.warntype && \
-		   		 (flags.warntype & (mon)->data->mflags2))
+		   		 ((flags.warntype == (unsigned long)(mon)->data->mlet) || \
+						(flags.warntype == S_WERE && (mon)->data->mflags2 & M2_WERE) || \
+					   (flags.warntype == S_UNDEAD && (mon)->data->mflags2 & M2_UNDEAD)))
 
 #include "trap.h"
@@ -142,4 +143,5 @@
 #define MM_IGNOREWATER	  0x80	/* ignore water when positioning */
 #define MM_ADJACENTOK	  0x100 /* it is acceptable to use adjacent coordinates */
+#define MM_UNSAFEOK		  0x200 /* potentially dangerous locations (lava) are OK */
 
 /* special mhpmax value when loading bones monster to flag as extinct or genocided */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/mkroom.h nethack/include/mkroom.h
--- nh_orig/include/mkroom.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/mkroom.h	2009-12-03 16:14:46.415273207 -0500
@@ -12,4 +12,5 @@
 	schar rtype;		/* type of room (zoo, throne, etc...) */
 	schar rlit;		/* is the room lit ? */
+	schar needfill;		/* does the room need filling? */
 	schar doorct;		/* door count */
 	schar fdoor;		/* index for the first door of the room */
@@ -62,17 +63,19 @@
 #define COCKNEST	12	/* cockatrice nest (Tom Proudfoot) */
 #define ANTHOLE		13	/* ants (Tom Proudfoot) */
-#define SHOPBASE	14	/* everything above this is a shop */
-#define ARMORSHOP	15	/* specific shop defines for level compiler */
-#define SCROLLSHOP	16
-#define POTIONSHOP	17
-#define WEAPONSHOP	18
-#define FOODSHOP	19
-#define RINGSHOP	20
-#define WANDSHOP	21
-#define TOOLSHOP	22
-#define BOOKSHOP	23
-#define UNIQUESHOP	24	/* shops here & above not randomly gen'd. */
-#define CANDLESHOP	24
-#define MAXRTYPE	24	/* maximum valid room type */
+#define TRAPROOM	14
+#define POOLROOM	15
+#define SHOPBASE	16	/* everything above this is a shop */
+#define ARMORSHOP	17	/* specific shop defines for level compiler */
+#define SCROLLSHOP	18
+#define POTIONSHOP	19
+#define WEAPONSHOP	20
+#define FOODSHOP	21
+#define RINGSHOP	22
+#define WANDSHOP	23
+#define TOOLSHOP	24
+#define BOOKSHOP	25
+#define UNIQUESHOP	26	/* shops here & above not randomly gen'd. */
+#define CANDLESHOP	26
+#define MAXRTYPE	26	/* maximum valid room type */
 
 /* Special type for search_special() */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/monattk.h nethack/include/monattk.h
--- nh_orig/include/monattk.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/monattk.h	2009-08-02 13:49:33.032408767 -0400
@@ -25,4 +25,5 @@
 #define AT_GAZE		15	/* gaze - ranged */
 #define AT_TENT		16	/* tentacles */
+#define AT_SCRE	   17 /* scream - sonic attack */
 
 #define AT_WEAP		254	/* uses weapon */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/mondata.h nethack/include/mondata.h
--- nh_orig/include/mondata.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/mondata.h	2010-04-29 10:53:23.669716280 -0400
@@ -19,4 +19,6 @@
 #define resists_acid(mon)	(((mon)->mintrinsics & MR_ACID) != 0)
 #define resists_ston(mon)	(((mon)->mintrinsics & MR_STONE) != 0)
+#define resists_sick(mon)  ((mon)->data->mlet == S_FUNGUS || \
+										(mon)->data == &mons[PM_GHOUL])
 
 #define is_lminion(mon)		(is_minion((mon)->data) && \
@@ -27,4 +29,5 @@
 #define is_flyer(ptr)		(((ptr)->mflags1 & M1_FLY) != 0L)
 #define is_floater(ptr)		((ptr)->mlet == S_EYE)
+#define is_flying(mon)		((mon)->mflying != 0L)
 #define is_clinger(ptr)		(((ptr)->mflags1 & M1_CLING) != 0L)
 #define is_swimmer(ptr)		(((ptr)->mflags1 & M1_SWIM) != 0L)
@@ -69,4 +72,10 @@
 				 (ptr) == &mons[PM_MIND_FLAYER] || \
 				 (ptr) == &mons[PM_MASTER_MIND_FLAYER])
+#define gives_telepathy(ptr)	(telepathic((ptr)) ||		       \
+				 ((ptr) == &mons[PM_KOBOLD_SHAMAN]) || \
+				 ((ptr) == &mons[PM_GOBLIN_SHAMAN]) || \
+				 ((ptr) == &mons[PM_ORC_SHAMAN]) || \
+				 ((ptr) == &mons[PM_HILL_GIANT_SHAMAN]) || \
+				 ((ptr) == &mons[PM_GNOMISH_WIZARD]))
 #define is_armed(ptr)		attacktype(ptr, AT_WEAP)
 #define acidic(ptr)		(((ptr)->mflags1 & M1_ACID) != 0L)
@@ -128,4 +137,8 @@
 				 ((ptr) == &mons[PM_LONG_WORM_TAIL]))
 #define is_covetous(ptr)	((ptr->mflags3 & M3_COVETOUS))
+#define is_skittish(ptr)   ((ptr->mflags3 & M3_SKITTISH))
+#define is_accurate(ptr)   ((ptr->mflags3 & M3_EAGLEEYE))
+#define is_berserker(ptr)  ((ptr->mflags3 & M3_BERSERK))
+#define is_shopguard(ptr)  ((ptr->mflags3 & M3_SHOPGUARD))
 #define infravision(ptr)	((ptr->mflags3 & M3_INFRAVISION))
 #define infravisible(ptr)	((ptr->mflags3 & M3_INFRAVISIBLE))
@@ -147,4 +160,6 @@
 				  (ptr) == &mons[PM_FLAMING_SPHERE] || \
 				  (ptr) == &mons[PM_SHOCKING_SPHERE] || \
+				  (ptr) == &mons[PM_GOLD_DRAGON] || \
+				  (ptr) == &mons[PM_BABY_GOLD_DRAGON] || \
 				  (ptr) == &mons[PM_FIRE_VORTEX]) ? 1 : \
 				 ((ptr) == &mons[PM_FIRE_ELEMENTAL]) ? 1 : 0)
@@ -189,5 +204,10 @@
 
 #define befriend_with_obj(ptr, obj) ((obj)->oclass == FOOD_CLASS && \
-				     is_domestic(ptr))
+				(is_domestic(ptr) || (Role_if(PM_CAVEMAN) && (ptr) == &mons[PM_MASTODON]) || \
+				 ((obj)->otyp == BANANA && ((ptr) == &mons[PM_MONKEY] || (ptr) == &mons[PM_APE]))))
+
+#define is_rockbreaker(ptr)							\
+				(((ptr)->msound == MS_LEADER || is_rider((ptr))) && \
+				 !mtmp->mpeaceful)
 
 #endif /* MONDATA_H */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/monflag.h nethack/include/monflag.h
--- nh_orig/include/monflag.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/monflag.h	2009-08-02 13:49:33.023408895 -0400
@@ -153,11 +153,19 @@
 #define M3_WAITFORU	0x0040		/* waits to see you or get attacked */
 #define M3_CLOSE	0x0080		/* lets you close unless attacked */
+/* Infravision is currently implemented for players only */
+#define M3_INFRAVISION	0x0100		/* has infravision */
+#define M3_INFRAVISIBLE 0x0200		/* visible by infravision */
+#define M3_SKITTISH  0x0400	   /* tends to stay a few squares away from you */
+#define M3_EAGLEEYE  0x0800		/* gets an accuracy bonus to hit */
+#define M3_BERSERK   0x1000	   /* extremely indiscriminate in its attacks */
+#define M3_SHOPGUARD	0x2000	   /* Guardian for a shop */
 
 #define M3_COVETOUS	0x001f		/* wants something */
 #define M3_WAITMASK	0x00c0		/* waiting... */
 
-/* Infravision is currently implemented for players only */
-#define M3_INFRAVISION	0x0100		/* has infravision */
-#define M3_INFRAVISIBLE 0x0200		/* visible by infravision */
+#define M4_VULNERABLE_FIRE		0x0001	 /* inherent elemental vulnerabilities */
+#define M4_VULNERABLE_COLD		0x0002
+#define M4_VULNERABLE_ELEC		0x0004
+#define M4_VULNERABLE_ACID		0x0008
 
 #define MZ_TINY		0		/* < 2' */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/monst.h nethack/include/monst.h
--- nh_orig/include/monst.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/monst.h	2009-09-07 11:18:19.719417264 -0400
@@ -41,5 +41,5 @@
 	struct monst *nmon;
 	struct permonst *data;
-	unsigned m_id;
+	size_t m_id;
 	short mnum;		/* permanent monster index number */
 	short movement;		/* movement points (derived from permonst definition and added effects */
@@ -64,4 +64,24 @@
 	int mspec_used;		/* monster's special ability attack timeout */
 
+/* These should stay in the same order as monattk.h so
+ * the mask translations will work properly */
+
+#define M_SEEN_NOTHING	0x0000
+#define M_SEEN_MAGR		0x0001
+#define M_SEEN_FIRE		0x0002
+#define M_SEEN_COLD		0x0004
+#define M_SEEN_SLEEP		0x0008
+#define M_SEEN_DISINT	0x0010
+#define M_SEEN_ELEC		0x0020
+#define M_SEEN_POISON	0x0040
+#define M_SEEN_ACID	 	0x0080
+#define M_SEEN_REFL		0x0100
+
+#define m_seenres(mon,mask)	((mon)->seen_resistance & (mask))
+#define m_setseen(mon,mask)	((mon)->seen_resistance |= (mask))
+#define m_sawlose(mon,mask)	((mon)->seen_resistance &= (~mask))
+
+	unsigned long seen_resistance;  /* Has seen you resist an element or magical effect */
+
 	Bitfield(female,1);	/* is female */
 	Bitfield(minvis,1);	/* currently invisible */
@@ -96,4 +116,5 @@
 	Bitfield(mcanmove,1);	/* paralysis, similar to mblinded */
 	Bitfield(mfrozen,7);
+	Bitfield(mflying,1);	  /* is monster levitating/flying artificially? */
 
 	Bitfield(msleeping,1);	/* asleep until woken */
@@ -103,7 +124,10 @@
 	Bitfield(mtrapped,1);	/* trapped in a pit, web or bear trap */
 	Bitfield(mleashed,1);	/* monster is on a leash */
+	Bitfield(mberserk,1);    /* monster is berserk */
+
 	Bitfield(isshk,1);	/* is shopkeeper */
 	Bitfield(isminion,1);	/* is a minion */
 
+	Bitfield(isshopguard,1);	 /* monster is a shop guard */
 	Bitfield(isgd,1);	/* is guard */
 	Bitfield(ispriest,1);	/* is a priest */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/monsym.h nethack/include/monsym.h
--- nh_orig/include/monsym.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/monsym.h	2009-08-02 13:49:33.040407823 -0400
@@ -74,4 +74,7 @@
 #define MAXMCLASSES 61	/* number of monster classes */
 
+#define S_WERE		100	/* don't include this in MAXMCLASSES, it's a hack for warning */
+#define S_UNDEAD	101	/* etc */
+
 #if 0	/* moved to decl.h so that makedefs.c won't see them */
 extern const char def_monsyms[MAXMCLASSES];	/* default class symbols */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/objclass.h nethack/include/objclass.h
--- nh_orig/include/objclass.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/objclass.h	2010-04-25 13:07:29.176715584 -0400
@@ -71,4 +71,5 @@
 /* is_flammable(otmp), is_rottable(otmp) in mkobj.c */
 #define is_rustprone(otmp)	(objects[otmp->otyp].oc_material == IRON)
+#define is_meltable(otmp)	(objects[otmp->otyp].oc_material == COPPER || objects[otmp->otyp].oc_material == GOLD)
 
 /* secondary damage: rot/acid/acid */
@@ -140,5 +141,6 @@
 #define CHAIN_CLASS	16
 #define VENOM_CLASS	17
-#define MAXOCLASSES	18
+#define FURNITURE_CLASS	18
+#define MAXOCLASSES	19
 
 #define ALLOW_COUNT	(MAXOCLASSES+1) /* Can be used in the object class */
@@ -148,4 +150,5 @@
 #define BURNING_OIL	(MAXOCLASSES+1) /* Can be used as input to explode. */
 #define MON_EXPLODE	(MAXOCLASSES+2) /* Exploding monster (e.g. gas spore) */
+#define MON_CASTBALL	(MAXOCLASSES+3) /* For monsters casting area-effect spells */
 
 #if 0	/* moved to decl.h so that makedefs.c won't see them */
@@ -173,4 +176,5 @@
 #define CHAIN_SYM	'_'
 #define VENOM_SYM	'.'
+#define FURNITURE_SYM	'\\'
 
 struct fruit {
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/obj.h nethack/include/obj.h
--- nh_orig/include/obj.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/obj.h	2010-05-13 09:22:22.141715011 -0400
@@ -23,5 +23,5 @@
 
 	struct obj *cobj;	/* contents list for containers */
-	unsigned o_id;
+	size_t o_id;
 	xchar ox,oy;
 	short otyp;		/* object class number */
@@ -67,4 +67,6 @@
 	Bitfield(oeroded2,2);	/* corroded/rotted weapon/armor */
 #define greatest_erosion(otmp) (int)((otmp)->oeroded > (otmp)->oeroded2 ? (otmp)->oeroded : (otmp)->oeroded2)
+#define set_erodeproof(otmp) { (otmp)->oeroded = (otmp)->oeroded2 = 0; (otmp)->oerodeproof = TRUE; }
+
 #define MAX_ERODE 3
 #define orotten oeroded		/* rotten food */
@@ -98,6 +100,13 @@
 #define spestudied corpsenm	/* # of times a spellbook has been studied */
 #define fromsink  corpsenm	/* a potion from a sink */
+
+#ifdef RECORD_ACHIEVE
+#define record_achieve_special corpsenm
+#endif
+
 	unsigned oeaten;	/* nutrition left in food, if partly eaten */
 	long age;		/* creation date */
+	long capacity;	  /* how much can this container hold? */
+#define MAX_CAPACITY 0xFFFFFF	  /* "lots" */
 
 	uchar onamelth;		/* length of name (following oxlth) */
@@ -139,6 +148,5 @@
 #define is_pole(otmp)	((otmp->oclass == WEAPON_CLASS || \
 			otmp->oclass == TOOL_CLASS) && \
-			 (objects[otmp->otyp].oc_skill == P_POLEARMS || \
-			 objects[otmp->otyp].oc_skill == P_LANCE))
+			 (objects[otmp->otyp].oc_skill == P_POLEARMS))
 #define is_spear(otmp)	(otmp->oclass == WEAPON_CLASS && \
 			 objects[otmp->otyp].oc_skill >= P_SPEAR && \
@@ -158,4 +166,11 @@
 			 objects[otmp->otyp].oc_skill >= -P_BOOMERANG && \
 			 objects[otmp->otyp].oc_skill <= -P_DART)
+#define is_thrown(otmp)	  ((otmp->oclass == WEAPON_CLASS) && \
+		  ((objects[otmp->otyp].oc_skill >= P_DART && \
+			 objects[otmp->otyp].oc_skill <= P_BOOMERANG) || \
+			 objects[otmp->otyp].oc_skill == P_DAGGER || \
+			 objects[otmp->otyp].oc_skill == P_KNIFE || \
+			(objects[otmp->otyp].oc_skill >= P_SPEAR && \
+			 objects[otmp->otyp].oc_skill <= P_TRIDENT)))
 #define is_weptool(o)	((o)->oclass == TOOL_CLASS && \
 			 objects[(o)->otyp].oc_skill != P_NONE)
@@ -218,6 +233,7 @@
 #define Has_contents(o) (/* (Is_container(o) || (o)->otyp == STATUE) && */ \
 			 (o)->cobj != (struct obj *)0)
-#define Is_container(o) ((o)->otyp >= LARGE_BOX && (o)->otyp <= BAG_OF_TRICKS)
-#define Is_box(otmp)	(otmp->otyp == LARGE_BOX || otmp->otyp == CHEST)
+#define Is_container(o) ((o)->otyp >= LARGE_BOX && (o)->otyp <= BAG_OF_POO)
+#define Is_box(otmp)	(otmp->otyp == LARGE_BOX || otmp->otyp == CHEST || \
+								otmp->otyp == IRON_SAFE)
 #define Is_mbag(otmp)	(otmp->otyp == BAG_OF_HOLDING || \
 			 otmp->otyp == BAG_OF_TRICKS)
@@ -273,5 +289,6 @@
 				|| (otmp)->otyp == TALLOW_CANDLE\
 				|| (otmp)->otyp == WAX_CANDLE\
-				|| (otmp)->otyp == POT_OIL)
+				|| (otmp)->otyp == POT_OIL\
+				|| (otmp)->otyp == BAG_OF_POO)
 /* object can be ignited */
 #define ignitable(otmp)	((otmp)->otyp == BRASS_LANTERN\
@@ -280,11 +297,12 @@
 				|| (otmp)->otyp == TALLOW_CANDLE\
 				|| (otmp)->otyp == WAX_CANDLE\
-				|| (otmp)->otyp == POT_OIL)
+				|| (otmp)->otyp == POT_OIL\
+				|| (otmp)->otyp == FUR_BRAZIER\
+				|| (otmp)->otyp == BAG_OF_POO)
 
 /* special stones */
 #define is_graystone(obj)	((obj)->otyp == LUCKSTONE || \
-				 (obj)->otyp == LOADSTONE || \
-				 (obj)->otyp == FLINT     || \
-				 (obj)->otyp == TOUCHSTONE)
+				 (obj)->otyp == LOADSTONE || (obj)->otyp == FLINT     || \
+				 (obj)->otyp == TOUCHSTONE || (obj)->otyp == SALT_CHUNK)
 
 /* misc */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/patchlevel.h nethack/include/patchlevel.h
--- nh_orig/include/patchlevel.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/patchlevel.h	2010-04-29 11:10:56.036011963 -0400
@@ -3,7 +3,7 @@
 /* NetHack may be freely redistributed.  See license for details. */
 
-/* NetHack 3.4.3 */
-#define VERSION_MAJOR	3
-#define VERSION_MINOR	4
+/* SporkHack 0.3.0 */
+#define VERSION_MAJOR	0
+#define VERSION_MINOR	6
 /*
  * PATCHLEVEL is updated for each release.
@@ -17,8 +17,8 @@
 
 #define COPYRIGHT_BANNER_A \
-"NetHack, Copyright 1985-2003"
+"SporkHack, copyright 2007 Derek S. Ray; a variant of NetHack 3.4.3, "
 
 #define COPYRIGHT_BANNER_B \
-"         By Stichting Mathematisch Centrum and M. Stephenson."
+"  copyright 1985-2003 by Stichting Mathematisch Centrum and M. Stephenson."
 
 #define COPYRIGHT_BANNER_C \
@@ -34,5 +34,7 @@
  * with all four numbers specified as two hexadecimal digits.
  */
-#define VERSION_COMPATIBILITY 0x03040000L	/* 3.4.0-0 */
+
+/*                            0xMMmmPPeeL            */
+#define VERSION_COMPATIBILITY 0x00060300L	/* 0.6.1-0 */
 
 
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/permonst.h nethack/include/permonst.h
--- nh_orig/include/permonst.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/permonst.h	2009-09-13 08:38:18.966292366 -0400
@@ -56,7 +56,8 @@
 	uchar		mresists;		/* resistances */
 	uchar		mconveys;		/* conveyed by eating */
-	unsigned long	mflags1,		/* boolean bitflags */
-			mflags2;		/* more boolean bitflags */
-	unsigned short	mflags3;		/* yet more boolean bitflags */
+	unsigned long	mflags1;		/* boolean bitflags */
+	unsigned long  mflags2;		/* more boolean bitflags */
+	unsigned long	mflags3;		/* yet more boolean bitflags */
+	unsigned long	mflags4;	  /* Add room for more */
 # ifdef TEXTCOLOR
 	uchar		mcolor;			/* color to use */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/prop.h nethack/include/prop.h
--- nh_orig/include/prop.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/prop.h	2009-09-05 10:47:01.555291838 -0400
@@ -74,5 +74,14 @@
 #define WARN_OF_MON		65
 #define DETECT_MONSTERS		66
-#define LAST_PROP		(DETECT_MONSTERS)
+#define WERE_RES			67
+#define BLIND_RES			68
+#define SLOW				69
+#define VISION				70
+#define LUCKY				71
+#define VULN_FIRE			72
+#define VULN_COLD			73
+#define VULN_ELEC			74
+#define VULN_ACID			75
+#define LAST_PROP		 	(VULN_ACID)
 
 /*** Where the properties come from ***/
@@ -100,4 +109,5 @@
 #	define W_ART	    0x00001000L /* Carrying artifact (not really worn) */
 #	define W_ARTI	    0x00002000L /* Invoked artifact  (not really worn) */
+#  define W_LAUNCHER  0x00004000L /* Selected ranged launcher */
 	/* Amulets, rings, tools, and other items */
 #	define W_AMUL	    0x00010000L /* Amulet */
@@ -123,5 +133,6 @@
 #	define FROMRACE     0x02000000L /* Gain/lose with experience, for race */
 #	define FROMOUTSIDE  0x04000000L /* By corpses, prayer, thrones, etc. */
-#	define INTRINSIC    (FROMOUTSIDE|FROMRACE|FROMEXPER)
+#  define HAVEPARTIAL  0x08000000L /* This is no longer a timeout, but a partial resistance */
+#	define INTRINSIC    (FROMOUTSIDE|FROMRACE|FROMEXPER|HAVEPARTIAL)
 	/* Control flags */
 #	define I_SPECIAL    0x10000000L /* Property is controllable */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/rm.h nethack/include/rm.h
--- nh_orig/include/rm.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/rm.h	2010-05-14 11:22:24.447714895 -0400
@@ -31,42 +31,42 @@
 
 /* Level location types */
-#define STONE		0
-#define VWALL		1
-#define HWALL		2
-#define TLCORNER	3
-#define TRCORNER	4
-#define BLCORNER	5
-#define BRCORNER	6
-#define CROSSWALL	7	/* For pretty mazes and special levels */
-#define TUWALL		8
-#define TDWALL		9
-#define TLWALL		10
-#define TRWALL		11
-#define DBWALL		12
-#define TREE		13	/* KMH */
-#define SDOOR		14
-#define SCORR		15
-#define POOL		16
-#define MOAT		17	/* pool that doesn't boil, adjust messages */
-#define WATER		18
-#define DRAWBRIDGE_UP	19
-#define LAVAPOOL	20
-#define IRONBARS	21	/* KMH */
-#define DOOR		22
-#define CORR		23
-#define ROOM		24
-#define STAIRS		25
-#define LADDER		26
-#define FOUNTAIN	27
-#define THRONE		28
-#define SINK		29
-#define GRAVE		30
-#define ALTAR		31
-#define ICE		32
-#define DRAWBRIDGE_DOWN 33
-#define AIR		34
-#define CLOUD		35
-
-#define MAX_TYPE	36
+enum {
+    STONE = 0,
+    VWALL,
+    HWALL,
+    TLCORNER,
+    TRCORNER,
+    BLCORNER,
+    BRCORNER,
+    CROSSWALL,		/* For pretty mazes and special levels */
+    TUWALL,
+    TDWALL,
+    TLWALL,
+    TRWALL,
+    DBWALL,
+    TREE,			/* KMH */
+    SDOOR,
+    SCORR,
+    POOL,
+    MOAT,			/* pool that doesn't boil, adjust messages */
+    WATER,
+    DRAWBRIDGE_UP,
+    LAVAPOOL,
+    IRONBARS,		/* KMH */
+    DOOR,
+    CORR,
+    ROOM,
+    STAIRS,
+    LADDER,
+    FOUNTAIN,
+    SINK,
+    GRAVE,
+    ALTAR,
+    ICE,
+    DRAWBRIDGE_DOWN,
+    AIR,
+    CLOUD,
+    MAX_TYPE
+};
 #define INVALID_TYPE	127
 
@@ -87,5 +87,4 @@
 #define SPACE_POS(typ)	((typ) > DOOR)
 #define IS_POOL(typ)	((typ) >= POOL && (typ) <= DRAWBRIDGE_UP)
-#define IS_THRONE(typ)	((typ) == THRONE)
 #define IS_FOUNTAIN(typ) ((typ) == FOUNTAIN)
 #define IS_SINK(typ)	((typ) == SINK)
@@ -104,113 +103,117 @@
 
 /* begin dungeon characters */
-
-#define S_stone		0
-#define S_vwall		1
-#define S_hwall		2
-#define S_tlcorn	3
-#define S_trcorn	4
-#define S_blcorn	5
-#define S_brcorn	6
-#define S_crwall	7
-#define S_tuwall	8
-#define S_tdwall	9
-#define S_tlwall	10
-#define S_trwall	11
-#define S_ndoor		12
-#define S_vodoor	13
-#define S_hodoor	14
-#define S_vcdoor	15	/* closed door, vertical wall */
-#define S_hcdoor	16	/* closed door, horizontal wall */
-#define S_bars		17	/* KMH -- iron bars */
-#define S_tree		18	/* KMH */
-#define S_room		19
-#define S_corr		20
-#define S_litcorr	21
-#define S_upstair	22
-#define S_dnstair	23
-#define S_upladder	24
-#define S_dnladder	25
-#define S_altar		26
-#define S_grave		27
-#define S_throne	28
-#define S_sink		29
-#define S_fountain	30
-#define S_pool		31
-#define S_ice		32
-#define S_lava		33
-#define S_vodbridge	34
-#define S_hodbridge	35
-#define S_vcdbridge	36	/* closed drawbridge, vertical wall */
-#define S_hcdbridge	37	/* closed drawbridge, horizontal wall */
-#define S_air		38
-#define S_cloud		39
-#define S_water		40
+enum {
+    S_stone = 0,
+    S_vwall,
+    S_hwall,
+    S_tlcorn,
+    S_trcorn,
+    S_blcorn,
+    S_brcorn,
+    S_crwall,
+    S_tuwall,
+    S_tdwall,
+    S_tlwall,
+    S_trwall,
+    S_ndoor,
+    S_vodoor,
+    S_hodoor,
+    S_vcdoor,		/* closed door, vertical wall */
+    S_hcdoor,		/* closed door, horizontal wall */
+    S_bars,		/* KMH -- iron bars */
+    S_tree,		/* KMH */
+    S_room,
+    S_darkroom,
+    S_corr,
+    S_litcorr,
+    S_upstair,
+    S_dnstair,
+    S_upladder,
+    S_dnladder,
+    S_altar,
+    S_grave,
+    S_sink,
+    S_fountain,
+    S_pool,
+    S_ice,
+    S_lava,
+    S_vodbridge,
+    S_hodbridge,
+    S_vcdbridge,       	/* closed drawbridge, vertical wall */
+    S_hcdbridge,	/* closed drawbridge, horizontal wall */
+    S_air,
+    S_cloud,
+    S_water,
 
 /* end dungeon characters, begin traps */
 
-#define S_arrow_trap		41
-#define S_dart_trap		42
-#define S_falling_rock_trap	43
-#define S_squeaky_board		44
-#define S_bear_trap		45
-#define S_land_mine		46
-#define S_rolling_boulder_trap	47
-#define S_sleeping_gas_trap	48
-#define S_rust_trap		49
-#define S_fire_trap		50
-#define S_pit			51
-#define S_spiked_pit		52
-#define S_hole			53
-#define S_trap_door		54
-#define S_teleportation_trap	55
-#define S_level_teleporter	56
-#define S_magic_portal		57
-#define S_web			58
-#define S_statue_trap		59
-#define S_magic_trap		60
-#define S_anti_magic_trap	61
-#define S_polymorph_trap	62
+    S_arrow_trap,
+    S_dart_trap,
+    S_falling_rock_trap,
+    S_squeaky_board,
+    S_bear_trap,
+    S_land_mine,
+    S_rolling_boulder_trap,
+    S_sleeping_gas_trap,
+    S_rust_trap,
+    S_fire_trap,
+    S_pit,
+    S_spiked_pit,
+    S_hole,
+    S_trap_door,
+    S_teleportation_trap,
+    S_level_teleporter,
+    S_magic_portal,
+    S_web,
+    S_statue_trap,
+    S_magic_trap,
+    S_anti_magic_trap,
+    S_polymorph_trap,
+    S_spear_trap,
+    S_falling_rocks_trap,
+    S_magic_beam_trap,
 
 /* end traps, begin special effects */
 
-#define S_vbeam		63	/* The 4 zap beam symbols.  Do NOT separate. */
-#define S_hbeam		64	/* To change order or add, see function     */
-#define S_lslant	65	/* zapdir_to_glyph() in display.c.	    */
-#define S_rslant	66
-#define S_digbeam	67	/* dig beam symbol */
-#define S_flashbeam	68	/* camera flash symbol */
-#define S_boomleft	69	/* thrown boomerang, open left, e.g ')'    */
-#define S_boomright	70	/* thrown boomerand, open right, e.g. '('  */
-#define S_ss1		71	/* 4 magic shield glyphs */
-#define S_ss2		72
-#define S_ss3		73
-#define S_ss4		74
+    S_vbeam,		/* The 4 zap beam symbols.  Do NOT separate. */
+    S_hbeam,		/* To change order or add, see function     */
+    S_lslant,		/* zapdir_to_glyph() in display.c.	    */
+    S_rslant,
+    S_digbeam,		/* dig beam symbol */
+    S_flashbeam,	/* camera flash symbol */
+    S_boomleft,		/* thrown boomerang, open left, e.g ')'    */
+    S_boomright,	/* thrown boomerand, open right, e.g. '('  */
+    S_ss1,		/* 4 magic shield glyphs */
+    S_ss2,
+    S_ss3,
+    S_ss4,
 
 /* The 8 swallow symbols.  Do NOT separate.  To change order or add, see */
 /* the function swallow_to_glyph() in display.c.			 */
-#define S_sw_tl		75	/* swallow top left [1]			*/
-#define S_sw_tc		76	/* swallow top center [2]	Order:	*/
-#define S_sw_tr		77	/* swallow top right [3]		*/
-#define S_sw_ml		78	/* swallow middle left [4]	1 2 3	*/
-#define S_sw_mr		79	/* swallow middle right [6]	4 5 6	*/
-#define S_sw_bl		80	/* swallow bottom left [7]	7 8 9	*/
-#define S_sw_bc		81	/* swallow bottom center [8]		*/
-#define S_sw_br		82	/* swallow bottom right [9]		*/
+    S_sw_tl,			/* swallow top left [1]			*/
+    S_sw_tc,			/* swallow top center [2]	Order:	*/
+    S_sw_tr,			/* swallow top right [3]		*/
+    S_sw_ml,			/* swallow middle left [4]	1 2 3	*/
+    S_sw_mr,			/* swallow middle right [6]	4 5 6	*/
+    S_sw_bl,			/* swallow bottom left [7]	7 8 9	*/
+    S_sw_bc,			/* swallow bottom center [8]		*/
+    S_sw_br,			/* swallow bottom right [9]		*/
 
-#define S_explode1	83	/* explosion top left			*/
-#define S_explode2	84	/* explosion top center			*/
-#define S_explode3	85	/* explosion top right		 Ex.	*/
-#define S_explode4	86	/* explosion middle left		*/
-#define S_explode5	87	/* explosion middle center	 /-\	*/
-#define S_explode6	88	/* explosion middle right	 |@|	*/
-#define S_explode7	89	/* explosion bottom left	 \-/	*/
-#define S_explode8	90	/* explosion bottom center		*/
-#define S_explode9	91	/* explosion bottom right		*/
+    S_explode1,		/* explosion top left			*/
+    S_explode2,		/* explosion top center			*/
+    S_explode3,		/* explosion top right		 Ex.	*/
+    S_explode4,		/* explosion middle left		*/
+    S_explode5,		/* explosion middle center	 /-\	*/
+    S_explode6,		/* explosion middle right	 |@|	*/
+    S_explode7,		/* explosion bottom left	 \-/	*/
+    S_explode8,		/* explosion bottom center		*/
+    S_explode9,		/* explosion bottom right		*/
 
 /* end effects */
 
-#define MAXPCHARS	92	/* maximum number of mapped characters */
+    MAXPCHARS		/* maximum number of mapped characters */
+};
 #define MAXDCHARS	41	/* maximum of mapped dungeon characters */
-#define MAXTCHARS	22	/* maximum of mapped trap characters */
+#define MAXTCHARS	25	/* maximum of mapped trap characters */
 #define MAXECHARS	29	/* maximum of mapped effects characters */
 #define MAXEXPCHARS	9	/* number of explosion characters */
@@ -246,4 +249,5 @@
 #define D_LOCKED	8
 #define D_TRAPPED	16
+#define D_SECRET	32 /* only used by sp_lev.c, NOT in rm-struct */
 
 /*
@@ -253,9 +257,4 @@
 
 /*
- * Thrones should only be looted once.
- */
-#define T_LOOTED	1
-
-/*
  * Trees have more than one kick result.
  */
@@ -343,4 +342,15 @@
 };
 
+
+#define SET_TYPLIT(x,y,ttyp,llit)				\
+{								\
+    if ((ttyp) < MAX_TYPE) levl[(x)][(y)].typ = (ttyp);		\
+    if ((ttyp) == LAVAPOOL) levl[(x)][(y)].lit = 1;		\
+    else if ((schar)(llit) != -2) {				\
+	if ((schar)(llit) == -1) levl[(x)][(y)].lit = rn2(2);	\
+	else levl[(x)][(y)].lit = (llit);			\
+    }								\
+}
+
 /*
  * Add wall angle viewing by defining "modes" for each wall type.  Each
@@ -463,7 +473,39 @@
 	Bitfield(graveyard,1);		/* has_morgue, but remains set */
 	Bitfield(is_maze_lev,1);
+	Bitfield(stormy,1);		/* thunderous clouds */
 
 	Bitfield(is_cavernous_lev,1);
 	Bitfield(arboreal, 1);		/* Trees replace rock */
+	/* and where it is written "ad aquarium"... */
+	Bitfield(vault_is_aquarium,1);
+};
+
+struct mon_gen_tuple {
+    int freq;
+    boolean is_sym;
+    int monid;
+    struct mon_gen_tuple *next;
+};
+
+struct mon_gen_override {
+    int override_chance;
+    int total_mon_freq;
+    struct mon_gen_tuple *gen_chances;
+};
+
+#define LVLSND_HEARD	0	/* You_hear(msg); */
+#define LVLSND_PLINED	1	/* pline(msg); */
+#define LVLSND_VERBAL	2	/* verbalize(msg); */
+#define LVLSND_FELT	3	/* You_feel(msg); */
+
+struct lvl_sound_bite {
+    int flags; /* LVLSND_foo */
+    char *msg;
+};
+
+struct lvl_sounds {
+    int freq;
+    int n_sounds;
+    struct lvl_sound_bite *sounds;
 };
 
@@ -485,4 +527,6 @@
     struct damage	*damagelist;
     struct levelflags	flags;
+    struct mon_gen_override *mon_gen;
+    struct lvl_sounds	*sounds;
 }
 dlevel_t;
@@ -513,10 +557,5 @@
 #define MON_BURIED_AT(x,y)	(level.monsters[x][y] != (struct monst *)0 && \
 				(level.monsters[x][y])->mburied)
-#ifndef STEED
-#define place_monster(m,x,y)	((m)->mx=(x),(m)->my=(y),\
-				 level.monsters[(m)->mx][(m)->my]=(m))
-#endif
 #define place_worm_seg(m,x,y)	level.monsters[x][y] = m
-#define remove_monster(x,y)	level.monsters[x][y] = (struct monst *)0
 #define m_at(x,y)		(MON_AT(x,y) ? level.monsters[x][y] : \
 						(struct monst *)0)
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/sp_lev.h nethack/include/sp_lev.h
--- nh_orig/include/sp_lev.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/sp_lev.h	2010-04-26 14:12:02.404715531 -0400
@@ -18,13 +18,262 @@
 
     /* Per level flags */
-#define NOTELEPORT	1
-#define HARDFLOOR	2
-#define NOMMAP		4
-#define SHORTSIGHTED	8
-#define ARBOREAL	16
+#define NOTELEPORT	0x00000001L
+#define HARDFLOOR	0x00000002L
+#define NOMMAP		0x00000004L
+#define SHORTSIGHTED	0x00000008L
+#define ARBOREAL	0x00000010L
+#define NOFLIPX		0x00000020L
+#define NOFLIPY		0x00000040L
+#define MAZELEVEL	0x00000080L
+#define PREMAPPED	0x00000100L
+#define SHROUD		0x00000200L
+#define STORMY		0x00000400L
+#define GRAVEYARD	0x00000800L
 
-    /* special level types */
-#define SP_LEV_ROOMS	1
-#define SP_LEV_MAZE	2
+/* different level layout initializers */
+#define LVLINIT_NONE		0
+#define LVLINIT_SOLIDFILL	1
+#define LVLINIT_MAZEGRID	2
+#define LVLINIT_MINES		3
+
+/* max. layers of object containment */
+#define MAX_CONTAINMENT 10
+
+/* max. # of random registers */
+#define MAX_REGISTERS	10
+
+/* max. nested depth of subrooms */
+#define MAX_NESTED_ROOMS 5
+
+/* max. # of opcodes per special level */
+#define SPCODER_MAX_RUNTIME	65536
+
+/* Opcodes for creating the level
+ * If you change these, also change opcodestr[] in util/lev_main.c
+ */
+enum opcode_defs {
+    SPO_NULL = 0,
+    SPO_MESSAGE,
+    SPO_MONSTER,
+    SPO_OBJECT,
+    SPO_ENGRAVING,
+    SPO_ROOM,
+    SPO_SUBROOM,
+    SPO_DOOR,
+    SPO_STAIR,
+    SPO_LADDER,
+    SPO_ALTAR,
+    SPO_FOUNTAIN,
+    SPO_SINK,
+    SPO_POOL,
+    SPO_TRAP,
+    SPO_GOLD,
+    SPO_CORRIDOR,
+    SPO_LEVREGION,
+    SPO_DRAWBRIDGE,
+    SPO_MAZEWALK,
+    SPO_NON_DIGGABLE,
+    SPO_NON_PASSWALL,
+    SPO_WALLIFY,
+    SPO_MAP,
+    SPO_ROOM_DOOR,
+    SPO_REGION,
+    SPO_CMP,
+    SPO_JMP,
+    SPO_JL,
+    SPO_JLE,
+    SPO_JG,
+    SPO_JGE,
+    SPO_JE,
+    SPO_JNE,
+    SPO_SPILL,
+    SPO_TERRAIN,
+    SPO_REPLACETERRAIN,
+    SPO_EXIT,
+    SPO_ENDROOM,
+    SPO_POP_CONTAINER,
+    SPO_PUSH,
+    SPO_POP,
+    SPO_RN2,
+    SPO_DEC,
+    SPO_INC,
+    SPO_MATH_ADD,
+    SPO_MATH_SUB,
+    SPO_MATH_MUL,
+    SPO_MATH_DIV,
+    SPO_MATH_MOD,
+    SPO_COPY,
+    SPO_MON_GENERATION,
+    SPO_END_MONINVENT,
+    SPO_GRAVE,
+    SPO_FRAME_PUSH,
+    SPO_FRAME_POP,
+    SPO_CALL,
+    SPO_RETURN,
+    SPO_INITLEVEL,
+    SPO_LEVEL_FLAGS,
+    SPO_LEVEL_SOUNDS,
+    SPO_WALLWALK,
+    SPO_VAR_INIT, /* variable_name data */
+    SPO_SHUFFLE_ARRAY,
+    SPO_DICE,
+
+    SPO_SEL_ADD,
+    SPO_SEL_POINT,
+    SPO_SEL_RECT,
+    SPO_SEL_FILLRECT,
+    SPO_SEL_LINE,
+    SPO_SEL_RNDLINE,
+    SPO_SEL_GROW,
+    SPO_SEL_FLOOD,
+    SPO_SEL_RNDCOORD,
+    SPO_SEL_ELLIPSE,
+    SPO_SEL_FILTER,
+
+    MAX_SP_OPCODES
+};
+
+/* MONSTER and OBJECT can take a variable number of parameters,
+ * they also pop different # of values from the stack. So,
+ * first we pop a value that tells what the _next_ value will
+ * mean.
+ */
+/* MONSTER */
+#define SP_M_V_PEACEFUL         0
+#define SP_M_V_ALIGN            1
+#define SP_M_V_ASLEEP           2
+#define SP_M_V_APPEAR           3
+#define SP_M_V_NAME             4
+
+#define SP_M_V_FEMALE		5
+#define SP_M_V_INVIS		6
+#define SP_M_V_CANCELLED	7
+#define SP_M_V_REVIVED		8
+#define SP_M_V_AVENGE		9
+#define SP_M_V_FLEEING		10
+#define SP_M_V_BLINDED		11
+#define SP_M_V_PARALYZED	12
+#define SP_M_V_STUNNED		13
+#define SP_M_V_CONFUSED		14
+#define SP_M_V_SEENTRAPS	15
+
+#define SP_M_V_END              16 /* end of variable parameters */
+
+/* OBJECT */
+#define SP_O_V_SPE              0
+#define SP_O_V_CURSE            1
+#define SP_O_V_CORPSENM         2
+#define SP_O_V_NAME             3
+#define SP_O_V_QUAN		4
+#define SP_O_V_BURIED		5
+#define SP_O_V_LIT		6
+#define SP_O_V_ERODED		7
+#define SP_O_V_LOCKED		8
+#define SP_O_V_TRAPPED		9
+#define SP_O_V_RECHARGED	10
+#define SP_O_V_INVIS		11
+#define SP_O_V_GREASED		12
+#define SP_O_V_BROKEN		13
+#define SP_O_V_COORD		14
+#define SP_O_V_END              15 /* end of variable parameters */
+
+
+/* When creating objects, we need to know whether
+ * it's a container and/or contents.
+ */
+#define SP_OBJ_CONTENT		0x1
+#define SP_OBJ_CONTAINER	0x2
+
+
+
+#define SPOVAR_NULL	0x00
+#define SPOVAR_INT	0x01 /* l */
+#define SPOVAR_STRING	0x02 /* str */
+#define SPOVAR_VARIABLE	0x03 /* str (contains the variable name) */
+#define SPOVAR_COORD	0x04 /* coordinate, encoded in l; use SP_COORD_X() and SP_COORD_Y() */
+#define SPOVAR_REGION	0x05 /* region, encoded in l; use SP_REGION_X1() etc */
+#define SPOVAR_MAPCHAR	0x06 /* map char, in l */
+#define SPOVAR_MONST	0x07 /* monster class & specific monster, encoded in l; use SP_MONST_... */
+#define SPOVAR_OBJ	0x08 /* object class & specific object type, encoded in l; use SP_OBJ_... */
+#define SPOVAR_SEL	0x09 /* selection. char[COLNO][ROWNO] in str */
+#define SPOVAR_ARRAY	0x40 /* used in splev_var & lc_vardefs, not in opvar */
+
+#define SP_COORD_X(l)	(l & 0xff)
+#define SP_COORD_Y(l)	((l >> 16) & 0xff)
+#define SP_COORD_PACK(x,y) ((( x ) & 0xff) + ((( y ) & 0xff) << 16))
+
+#define SP_REGION_X1(l)	(l & 0xff)
+#define SP_REGION_Y1(l)	((l >> 8) & 0xff)
+#define SP_REGION_X2(l)	((l >> 16) & 0xff)
+#define SP_REGION_Y2(l)	((l >> 24) & 0xff)
+#define SP_REGION_PACK(x1,y1,x2,y2) ((( x1 ) & 0xff) + ((( y1 ) & 0xff) << 8) + ((( x2 ) & 0xff) << 16) + ((( y2 ) & 0xff) << 24))
+
+#define SP_MONST_CLASS(l) (l & 0xff)
+#define SP_MONST_PM(l)	  ((l >> 8) & 0xffff)
+#define SP_MONST_PACK(m,c) ((( m ) << 8) + ((char)( c )))
+
+#define SP_OBJ_CLASS(l)	  (l & 0xff)
+#define SP_OBJ_TYP(l)	  ((l >> 8) & 0xffff)
+#define SP_OBJ_PACK(o,c)  ((( o ) << 8) + ((char)( c )))
+
+#define SP_MAPCHAR_TYP(l) (l & 0xff)
+#define SP_MAPCHAR_LIT(l) ((l >> 8) & 0xff)
+#define SP_MAPCHAR_PACK(typ,lit) ((( lit ) << 8) + ((char)( typ )))
+
+struct opvar {
+    xchar spovartyp; /* one of SPOVAR_foo */
+    union {
+	char *str;
+	long l;
+    } vardata;
+};
+
+struct splev_var {
+    struct splev_var *next;
+    char *name;
+    xchar svtyp; /* SPOVAR_foo */
+    union {
+	struct opvar *value;
+	struct opvar **arrayvalues;
+    } data;
+    long array_len;
+};
+
+struct splevstack {
+    long depth;
+    long depth_alloc;
+    struct opvar **stackdata;
+};
+
+
+struct sp_frame {
+    struct sp_frame *next;
+    struct splevstack *stack;
+    struct splev_var *variables;
+    long n_opcode;
+};
+
+
+struct sp_coder {
+    struct splevstack *stack;
+    struct sp_frame *frame;
+    int allow_flips;
+    int premapped;
+    struct mkroom *croom;
+    struct mkroom *tmproomlist[MAX_NESTED_ROOMS+1];
+    boolean failed_room[MAX_NESTED_ROOMS+1];
+    int n_subroom;
+    boolean exit_script;
+    int  lvl_is_joined;
+
+    int opcode;  /* current opcode */
+    struct opvar *opdat; /* current push data (req. opcode == SPO_PUSH) */
+};
+
+/* special level coder CPU flags */
+#define SP_CPUFLAG_LT	1
+#define SP_CPUFLAG_GT	2
+#define SP_CPUFLAG_EQ	4
+#define SP_CPUFLAG_ZERO	8
 
 /*
@@ -32,4 +281,20 @@
  */
 
+typedef struct {
+    xchar x1,y1,x2,y2;
+    xchar fg, lit;
+    int roughness;
+    xchar thick;
+} randline;
+
+typedef struct {
+	int cmp_what;
+	int cmp_val;
+} opcmp;
+
+typedef struct {
+	long jmp_target;
+} opjmp;
+
 typedef union str_or_len {
 	char *str;
@@ -38,8 +303,10 @@
 
 typedef struct {
-	boolean init_present, padding;
+	xchar   init_style; /* one of LVLINIT_foo */
 	char	fg, bg;
 	boolean smoothed, joined;
 	xchar	lit, walled;
+	long	flags;
+	schar	filling;
 } lev_init;
 
@@ -53,5 +320,5 @@
 
 typedef struct {
-	xchar x, y, chance, type;
+	xchar x, y, type;
 } trap;
 
@@ -60,6 +327,9 @@
 	short id;
 	aligntyp align;
-	xchar x, y, chance, class, appear;
+	xchar x, y, class, appear;
 	schar peaceful, asleep;
+        short female, invis, cancelled, revived, avenge, fleeing, blinded, paralyzed, stunned, confused;
+        long seentraps;
+	short has_invent;
 } monster;
 
@@ -68,6 +338,10 @@
 	int   corpsenm;
 	short id, spe;
-	xchar x, y, chance, class, containment;
+	xchar x, y, class, containment;
 	schar curse_state;
+	int   quan;
+	short buried;
+	short lit;
+        short eroded, locked, trapped, recharged, invis, greased, broken;
 } object;
 
@@ -83,5 +357,5 @@
 
 typedef struct {
-	xchar x, y, dir;
+    xchar x, y, dir, stocked, typ;
 } walk;
 
@@ -103,4 +377,16 @@
 } region;
 
+typedef struct {
+    xchar areatyp;
+    xchar x1,y1,x2,y2;
+    xchar ter, tlit;
+} terrain;
+
+typedef struct {
+    xchar chance;
+    xchar x1,y1,x2,y2;
+    xchar fromter, toter, tolit;
+} replaceterrain;
+
 /* values for rtype are defined in dungeon.h */
 typedef struct {
@@ -135,92 +421,21 @@
 } pool;
 
-typedef struct {
-	char halign, valign;
-	char xsize, ysize;
-	char **map;
-	char nrobjects;
-	char *robjects;
-	char nloc;
-	char *rloc_x;
-	char *rloc_y;
-	char nrmonst;
-	char *rmonst;
-	char nreg;
-	region **regions;
-	char nlreg;
-	lev_region **lregions;
-	char ndoor;
-	door **doors;
-	char ntrap;
-	trap **traps;
-	char nmonster;
-	monster **monsters;
-	char nobject;
-	object **objects;
-	char ndrawbridge;
-	drawbridge **drawbridges;
-	char nwalk;
-	walk **walks;
-	char ndig;
-	digpos **digs;
-	char npass;
-	digpos **passs;
-	char nlad;
-	lad **lads;
-	char nstair;
-	stair **stairs;
-	char naltar;
-	altar **altars;
-	char ngold;
-	gold **golds;
-	char nengraving;
-	engraving **engravings;
-	char nfountain;
-	fountain **fountains;
-} mazepart;
-
-typedef struct {
-	long flags;
-	lev_init init_lev;
-	schar filling;
-	char numpart;
-	mazepart **parts;
-} specialmaze;
-
 typedef struct _room {
-	char  *name;
-	char  *parent;
+	Str_or_Len name;
+	Str_or_Len parent;
 	xchar x, y, w, h;
 	xchar xalign, yalign;
 	xchar rtype, chance, rlit, filled;
-	char ndoor;
-	room_door **doors;
-	char ntrap;
-	trap **traps;
-	char nmonster;
-	monster **monsters;
-	char nobject;
-	object **objects;
-	char naltar;
-	altar **altars;
-	char nstair;
-	stair **stairs;
-	char ngold;
-	gold **golds;
-	char nengraving;
-	engraving **engravings;
-	char nfountain;
-	fountain **fountains;
-	char nsink;
-	sink **sinks;
-	char npool;
-	pool **pools;
-	/* These three fields are only used when loading the level... */
-	int nsubroom;
-	struct _room *subrooms[MAX_SUBROOMS];
-	struct mkroom *mkr;
 } room;
 
 typedef struct {
+    	schar zaligntyp;
+	schar keep_region;
+	schar halign, valign;
+	char xsize, ysize;
+	char **map;
+} mazepart;
+
+typedef struct {
 	struct {
 		xchar room;
@@ -230,17 +445,35 @@
 } corridor;
 
-/* used only by lev_comp */
 typedef struct {
-	long flags;
-	lev_init init_lev;
-	char nrobjects;
-	char *robjects;
-	char nrmonst;
-	char *rmonst;
-	xchar nroom;
-	room **rooms;
-	xchar ncorr;
-	corridor **corrs;
-} splev;
+    int opcode;
+    struct opvar *opdat;
+} _opcode;
+
+typedef struct {
+    _opcode  *opcodes;
+    long     n_opcodes;
+} sp_lev;
+
+typedef struct {
+	xchar x, y, direction, count, lit;
+	char typ;
+} spill;
+
+
+/* only used by lev_comp */
+
+struct lc_funcdefs {
+    struct lc_funcdefs *next;
+    char *name;
+    long addr;
+    sp_lev code;
+    long n_called;
+};
+
+struct lc_vardefs {
+    struct lc_vardefs *next;
+    char *name;
+    long var_type; /* SPOVAR_foo */
+};
 
 #endif /* SP_LEV_H */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/system.h nethack/include/system.h
--- nh_orig/include/system.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/system.h	2009-09-07 09:52:30.877293621 -0400
@@ -474,5 +474,5 @@
 #ifdef NEED_VARARGS
 # if defined(USE_STDARG) || defined(USE_VARARGS)
-#  if !defined(SVR4) && !defined(apollo)
+#  if !defined(SVR4) && !defined(apollo) && !defined(OSX)
 #   if !(defined(ULTRIX_PROTO) && defined(__GNUC__))
 #    if !(defined(SUNOS4) && defined(__STDC__)) /* Solaris unbundled cc (acc) */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/trap.h nethack/include/trap.h
--- nh_orig/include/trap.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/trap.h	2009-09-28 07:52:26.134418460 -0400
@@ -73,5 +73,8 @@
 #define ANTI_MAGIC	21
 #define POLY_TRAP	22
-#define TRAPNUM 23
+#define SPEAR_TRAP 23
+#define COLLAPSE_TRAP 24
+#define MAGIC_BEAM_TRAP	25
+#define TRAPNUM 26
 
 #endif /* TRAP_H */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/unixconf.h nethack/include/unixconf.h
--- nh_orig/include/unixconf.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/unixconf.h	2010-04-26 14:16:44.817948018 -0400
@@ -33,10 +33,11 @@
 
 /* define any of the following that are appropriate */
-#define SVR4		/* use in addition to SYSV for System V Release 4 */
+/* #define SVR4		/* use in addition to SYSV for System V Release 4 */
 			/* including Solaris 2+ */
 #define NETWORK		/* if running on a networked system */
 			/* e.g. Suns sharing a playground through NFS */
 /* #define SUNOS4 */	/* SunOS 4.x */
-/* #define LINUX */	/* Another Unix clone */
+#define LINUX /* Another Unix clone */
+/* #define OSX	 /* Apple OS X */
 /* #define CYGWIN32 */	/* Unix on Win32 -- use with case sensitive defines */
 /* #define GENIX */	/* Yet Another Unix Clone */
@@ -110,9 +111,7 @@
  * If defined, it can be overridden by the environment variable PAGER.
  * Hack will use its internal pager if DEF_PAGER is not defined.
- * (This might be preferable for security reasons.)
- * #define DEF_PAGER	".../mydir/mypager"
- */
-
+ * (This might be preferable for security reasons.)*/
 
+/*#define DEF_PAGER	"/usr/bin/less"*/
 
 /*
@@ -133,5 +132,5 @@
  * a fine-grained timer.
  */
-/* #define TIMED_DELAY */	/* usleep() */
+#define TIMED_DELAY /* usleep() */
 #endif
 
@@ -144,5 +143,5 @@
  */
 
-#define MAIL			/* Deliver mail during the game */
+/* #define MAIL			/* Deliver mail during the game */
 
 /* The Andrew Message System does mail a little differently from normal
@@ -210,4 +209,10 @@
 #define FCMASK	0660	/* file creation mask */
 
+/* fcntl(2) is a POSIX-portable call for manipulating file descriptors.
+ * Comment out the USE_FCNTL if for some reason you have a strange
+ * os/filesystem combination for which fcntl(2) does not work. */
+#ifdef POSIX_TYPES
+# define USE_FCNTL
+#endif
 
 /*
@@ -271,5 +276,5 @@
 #define tgetch getchar
 
-#define SHELL		/* do not delete the '!' command */
+/* #define SHELL		do not delete the '!' command */
 
 #include "system.h"
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/unixconf.h.~1~ nethack/include/unixconf.h.~1~
--- nh_orig/include/unixconf.h.~1~	1969-12-31 19:00:00.000000000 -0500
+++ nethack/include/unixconf.h.~1~	2009-08-02 13:49:33.035408669 -0400
@@ -0,0 +1,356 @@
+/*	SCCS Id: @(#)unixconf.h 3.4	1999/07/02	*/
+/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
+/* NetHack may be freely redistributed.  See license for details. */
+
+#ifdef UNIX
+#ifndef UNIXCONF_H
+#define UNIXCONF_H
+
+/*
+ * Some include files are in a different place under SYSV
+ *	BSD		   SYSV
+ * <sys/time.h>		<time.h>
+ * <sgtty.h>		<termio.h>
+ *
+ * Some routines are called differently
+ * index		strchr
+ * rindex		strrchr
+ *
+ */
+
+/* define exactly one of the following four choices */
+/* #define BSD 1 */	/* define for 4.n/Free/Open/Net BSD  */
+			/* also for relatives like SunOS 4.x, DG/UX, and */
+			/* older versions of Linux */
+/* #define ULTRIX */	/* define for Ultrix v3.0 or higher (but not lower) */
+			/* Use BSD for < v3.0 */
+			/* "ULTRIX" not to be confused with "ultrix" */
+#define SYSV		/* define for System V, Solaris 2.x, newer versions */
+			/* of Linux */
+/* #define HPUX */	/* Hewlett-Packard's Unix, version 6.5 or higher */
+			/* use SYSV for < v6.5 */
+
+
+/* define any of the following that are appropriate */
+/* #define SVR4		/* use in addition to SYSV for System V Release 4 */
+			/* including Solaris 2+ */
+#define NETWORK		/* if running on a networked system */
+			/* e.g. Suns sharing a playground through NFS */
+/* #define SUNOS4 */	/* SunOS 4.x */
+#define LINUX /* Another Unix clone */
+/* #define OSX	 /* Apple OS X */
+/* #define CYGWIN32 */	/* Unix on Win32 -- use with case sensitive defines */
+/* #define GENIX */	/* Yet Another Unix Clone */
+/* #define HISX */	/* Bull Unix for XPS Machines */
+/* #define BOS */	/* Bull Open Software - Unix for DPX/2 Machines */
+/* #define UNIXPC */	/* use in addition to SYSV for AT&T 7300/3B1 */
+/* #define AIX_31 */	/* In AIX 3.1 (IBM RS/6000) use BSD ioctl's to gain
+			 * job control (note that AIX is SYSV otherwise)
+			 * Also define this for AIX 3.2 */
+
+#define TERMINFO	/* uses terminfo rather than termcap */
+			/* Should be defined for most SYSV, SVR4 (including
+			 * Solaris 2+), HPUX, and Linux systems.  In
+			 * particular, it should NOT be defined for the UNIXPC
+			 * unless you remove the use of the shared library in
+			 * the Makefile */
+#define TEXTCOLOR	/* Use System V r3.2 terminfo color support */
+			/* and/or ANSI color support on termcap systems */
+			/* and/or X11 color */
+#define POSIX_JOB_CONTROL /* use System V / Solaris 2.x / POSIX job control */
+			/* (e.g., VSUSP) */
+#define POSIX_TYPES	/* use POSIX types for system calls and termios */
+			/* Define for many recent OS releases, including
+			 * those with specific defines (since types are
+			 * changing toward the standard from earlier chaos).
+			 * For example, platforms using the GNU libraries,
+			 * Linux, Solaris 2.x
+			 */
+
+/* #define OPENWINBUG */	/* avoid a problem using OpenWindows 3.0 for
+				   X11 on SunOS 4.1.x, x>= 2.  Do not define
+				   for other X11 implementations. */
+/* #define PYRAMID_BUG */	/* avoid a bug on the Pyramid */
+/* #define BSD_43_BUG */	/* for real 4.3BSD cc's without schain botch fix */
+/* #define MICROPORT_BUG */	/* problems with large arrays in structs */
+/* #define MICROPORT_286_BUG */ /* changes needed in termcap.c to get it to
+				   run with Microport Sys V/AT version 2.4.
+				   By Jay Maynard */
+/* #define AIXPS_2BUG */	/* avoid a problem with little_to_big() optimization */
+
+/* #define RANDOM */		/* if neither random/srandom nor lrand48/srand48
+				   is available from your system */
+
+/* see sys/unix/snd86unx.shr for more information on these */
+/* #define UNIX386MUSIC */	/* play real music through speaker on systems
+				   with music driver installed */
+/* #define VPIX_MUSIC */	/* play real music through speaker on systems
+				   with built-in VPIX support */
+
+
+/*
+ * The next two defines are intended mainly for the Andrew File System,
+ * which does not allow hard links.  If NO_FILE_LINKS is defined, lock files
+ * will be created in LOCKDIR using open() instead of in the playground using
+ * link().
+ *		Ralf Brown, 7/26/89 (from v2.3 hack of 10/10/88)
+ */
+
+/* #define NO_FILE_LINKS */	/* if no hard links */
+/* #define LOCKDIR "/usr/games/lib/nethackdir" */	/* where to put locks */
+
+/*
+ * If you want the static parts of your playground on a read-only file
+ * system, define VAR_PLAYGROUND to be where the variable parts are kept.
+ */
+/* #define VAR_PLAYGROUND "/var/lib/games/nethack" */
+
+
+/*
+ * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more"
+ * If defined, it can be overridden by the environment variable PAGER.
+ * Hack will use its internal pager if DEF_PAGER is not defined.
+ * (This might be preferable for security reasons.)*/
+
+/*#define DEF_PAGER	"/usr/bin/less"*/
+
+/*
+ * Define PORT_HELP to be the name of the port-specfic help file.
+ * This file is found in HACKDIR.
+ * Normally, you shouldn't need to change this.
+ * There is currently no port-specific help for Unix systems.
+ */
+/* #define PORT_HELP "Unixhelp" */
+
+#ifdef TTY_GRAPHICS
+/*
+ * To enable the `timed_delay' option for using a timer rather than extra
+ * screen output when pausing for display effect.  Requires that `msleep'
+ * function be available (with time argument specified in milliseconds).
+ * Various output devices can produce wildly varying delays when the
+ * "extra output" method is used, but not all systems provide access to
+ * a fine-grained timer.
+ */
+#define TIMED_DELAY /* usleep() */
+#endif
+
+/*
+ * If you define MAIL, then the player will be notified of new mail
+ * when it arrives.  If you also define DEF_MAILREADER then this will
+ * be the default mail reader, and can be overridden by the environment
+ * variable MAILREADER; otherwise an internal pager will be used.
+ * A stat system call is done on the mailbox every MAILCKFREQ moves.
+ */
+
+/* #define MAIL			/* Deliver mail during the game */
+
+/* The Andrew Message System does mail a little differently from normal
+ * UNIX.  Mail is deposited in the user's own directory in ~/Mailbox
+ * (another directory).  MAILBOX is the element that will be added on to
+ * the user's home directory path to generate the Mailbox path - just in
+ * case other Andrew sites do it differently from CMU.
+ *
+ *		dan lovinger
+ *		dl2n+@andrew.cmu.edu (dec 19 1989)
+ */
+
+/* #define AMS */		/* use Andrew message system for mail */
+
+/* NO_MAILREADER is for kerberos authenticating filesystems where it is
+ * essentially impossible to securely exec child processes, like mail
+ * readers, when the game is running under a special token.
+ *
+ *	       dan
+ */
+
+/* #define NO_MAILREADER */	/* have mail daemon just tell player of mail */
+
+#ifdef	MAIL
+# if defined(BSD) || defined(ULTRIX)
+#  ifdef AMS
+#define AMS_MAILBOX	"/Mailbox"
+#  else
+#   if defined(__FreeBSD__) || defined(__OpenBSD__)
+#define DEF_MAILREADER	"/usr/bin/mail"
+#   else
+#define DEF_MAILREADER	"/usr/ucb/Mail"
+#   endif
+#  endif
+#else
+# if (defined(SYSV) || defined(DGUX) || defined(HPUX)) && !defined(LINUX)
+#  if defined(M_XENIX)
+#define DEF_MAILREADER	"/usr/bin/mail"
+#  else
+#   ifdef __sgi
+#define DEF_MAILREADER	"/usr/sbin/Mail"
+#   else
+#define DEF_MAILREADER	"/usr/bin/mailx"
+#   endif
+#  endif
+# else
+#define DEF_MAILREADER	"/bin/mail"
+# endif
+#endif
+
+#define MAILCKFREQ	50
+#endif	/* MAIL */
+
+
+
+#ifdef COMPRESS
+/* Some implementations of compress need a 'quiet' option.
+ * If you've got one of these versions, put -q here.
+ * You can also include any other strange options your compress needs.
+ * If you have a normal compress, just leave it commented out.
+ */
+/* #define COMPRESS_OPTIONS "-q" */
+#endif
+
+#define FCMASK	0660	/* file creation mask */
+
+/* fcntl(2) is a POSIX-portable call for manipulating file descriptors.
+ * Comment out the USE_FCNTL if for some reason you have a strange
+ * os/filesystem combination for which fcntl(2) does not work. */
+#ifdef POSIX_TYPES
+# define USE_FCNTL
+#endif
+
+/*
+ * The remainder of the file should not need to be changed.
+ */
+
+#ifdef _AUX_SOURCE
+# ifdef AUX /* gcc ? */
+#  define _SYSV_SOURCE
+#  define _BSD_SOURCE
+#else
+#  define AUX
+# endif
+#endif /* _AUX_SOURCE */
+
+#if defined(LINUX) || defined(bsdi)
+# ifndef POSIX_TYPES
+#  define POSIX_TYPES
+# endif
+# ifndef POSIX_JOB_CONTROL
+#  define POSIX_JOB_CONTROL
+# endif
+#endif
+
+/*
+ * BSD/ULTRIX systems are normally the only ones that can suspend processes.
+ * Suspending NetHack processes cleanly should be easy to add to other systems
+ * that have SIGTSTP in the Berkeley sense.  Currently the only such systems
+ * known to work are HPUX and AIX 3.1; other systems will probably require
+ * tweaks to unixtty.c and ioctl.c.
+ *
+ * POSIX defines a slightly different type of job control, which should be
+ * equivalent for NetHack's purposes.  POSIX_JOB_CONTROL should work on
+ * various recent SYSV versions (with possibly tweaks to unixtty.c again).
+ */
+#ifndef POSIX_JOB_CONTROL
+# if defined(BSD) || defined(ULTRIX) || defined(HPUX) || defined(AIX_31)
+#  define BSD_JOB_CONTROL
+# else
+#  if defined(SVR4)
+#   define POSIX_JOB_CONTROL
+#  endif
+# endif
+#endif
+#if defined(BSD_JOB_CONTROL) || defined(POSIX_JOB_CONTROL) || defined(AUX)
+#define SUSPEND		/* let ^Z suspend the game */
+#endif
+
+
+#if defined(BSD) || defined(ULTRIX)
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+
+#define HLOCK	"perm"	/* an empty file used for locking purposes */
+
+#ifndef REDO
+#define Getchar nhgetch
+#endif
+#define tgetch getchar
+
+/* #define SHELL		do not delete the '!' command */
+
+#include "system.h"
+
+#if defined(POSIX_TYPES) || defined(__GNUC__)
+#include <stdlib.h>
+#include <unistd.h>
+#endif
+
+#if defined(POSIX_TYPES) || defined(__GNUC__) || defined(BSD) || defined(ULTRIX)
+#include <sys/wait.h>
+#endif
+
+#if defined(BSD) || defined(ULTRIX)
+# if !defined(DGUX) && !defined(SUNOS4)
+#define memcpy(d, s, n)		bcopy(s, d, n)
+#define memcmp(s1, s2, n)	bcmp(s2, s1, n)
+# endif
+# ifdef SUNOS4
+#include <memory.h>
+# endif
+#else	/* therefore SYSV */
+# ifndef index	/* some systems seem to do this for you */
+#define index	strchr
+# endif
+# ifndef rindex
+#define rindex	strrchr
+# endif
+#endif
+
+/* Use the high quality random number routines. */
+#if defined(BSD) || defined(LINUX) || defined(ULTRIX) || defined(CYGWIN32) || defined(RANDOM) || defined(__APPLE__)
+#define Rand()	random()
+#else
+#define Rand()	lrand48()
+#endif
+
+#ifdef TIMED_DELAY
+# if defined(SUNOS4) || defined(LINUX) || (defined(BSD) && !defined(ULTRIX))
+# define msleep(k) usleep((k)*1000)
+# endif
+# ifdef ULTRIX
+# define msleep(k) napms(k)
+# endif
+#endif
+
+#ifdef hc	/* older versions of the MetaWare High-C compiler define this */
+# ifdef __HC__
+#  undef __HC__
+# endif
+# define __HC__ hc
+# undef hc
+#endif
+
+#if defined(GNOME_GRAPHICS)
+#if defined(LINUX)
+# include <linux/unistd.h>
+# if defined(__NR_getresuid) && defined(__NR_getresgid)	/* ie., >= v2.1.44 */
+#  define GETRES_SUPPORT
+# endif
+#else
+# if defined(BSD) || defined(SVR4)
+/*
+ * [ALI] We assume that SVR4 means we can safely include syscall.h
+ * (although it's really a BSDism). This is certainly true for Solaris 2.5,
+ * Solaris 7, Solaris 8 and Compaq Tru64 5.1
+ * Later BSD systems will have the getresid system calls.
+ */
+# include <sys/syscall.h>
+# if (defined (SYS_getuid) || defined(SYS_getresuid)) && \
+  (defined(SYS_getgid) || defined(SYS_getresgid))
+#  define GETRES_SUPPORT
+# endif
+# endif	/* BSD || SVR4 */
+#endif /* LINUX */
+#endif	/* GNOME_GRAPHICS */
+
+#endif /* UNIXCONF_H */
+#endif /* UNIX */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/wincurs.h nethack/include/wincurs.h
--- nh_orig/include/wincurs.h	1969-12-31 19:00:00.000000000 -0500
+++ nethack/include/wincurs.h	2009-09-05 11:30:14.265303603 -0400
@@ -0,0 +1,250 @@
+#ifndef WINCURS_H
+#define WINCURS_H
+
+/* Global declarations for curses interface */
+
+int term_rows, term_cols; /* size of underlying terminal */
+
+WINDOW *base_term;    /* underlying terminal window */
+
+WINDOW *mapborderwin;
+
+
+#define TEXTCOLOR   /* Allow color */
+#define NHW_END 19
+#define OFF 0
+#define ON 1
+#define NONE -1
+#define KEY_ESC 0x1b
+#define DIALOG_BORDER_COLOR CLR_MAGENTA
+#define HIGHLIGHT_COLOR CLR_WHITE
+#define MORECOLOR CLR_ORANGE
+#define STAT_UP_COLOR CLR_GREEN
+#define STAT_DOWN_COLOR CLR_RED
+#define MESSAGE_WIN 1
+#define STATUS_WIN  2
+#define MAP_WIN     3
+#define HPOS_WIN    4
+#define MESG_HISTORY_MAX   200
+
+
+typedef enum orient_type
+{
+    CENTER,
+    UP,
+    DOWN,
+    RIGHT,
+    LEFT
+} orient;
+
+
+/* cursmain.c */
+
+extern struct window_procs curses_procs;
+
+extern void curses_init_nhwindows(int* argcp, char** argv);
+
+extern void curses_player_selection(void);
+
+extern void curses_askname(void);
+
+extern void curses_get_nh_event(void);
+
+extern void curses_exit_nhwindows(const char *str);
+
+extern void curses_suspend_nhwindows(const char *str);
+
+extern void curses_resume_nhwindows(void);
+
+extern winid curses_create_nhwindow(int type);
+
+extern void curses_clear_nhwindow(winid wid);
+
+extern void curses_display_nhwindow(winid wid, BOOLEAN_P block);
+
+extern void curses_destroy_nhwindow(winid wid);
+
+extern void curses_curs(winid wid, int x, int y);
+
+extern void curses_putstr(winid wid, int attr, const char *text);
+
+extern void curses_display_file(const char *filename,BOOLEAN_P must_exist);
+
+extern void curses_start_menu(winid wid);
+
+extern void curses_add_menu(winid wid, int glyph, const ANY_P * identifier,
+		CHAR_P accelerator, CHAR_P group_accel, int attr, 
+		const char *str, BOOLEAN_P presel);
+
+extern void curses_end_menu(winid wid, const char *prompt);
+
+extern int curses_select_menu(winid wid, int how, MENU_ITEM_P **selected);
+
+extern void curses_update_inventory(void);
+
+extern void curses_mark_synch(void);
+
+extern void curses_wait_synch(void);
+
+extern void curses_cliparound(int x, int y);
+
+extern void curses_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,int glyph);
+
+extern void curses_raw_print(const char *str);
+
+extern void curses_raw_print_bold(const char *str);
+
+extern int curses_nhgetch(void);
+
+extern int curses_nh_poskey(int *x, int *y, int *mod);
+
+extern void curses_nhbell(void);
+
+extern int curses_doprev_message(void);
+
+extern char curses_yn_function(const char *question, const char *choices, CHAR_P def);
+
+extern void curses_getlin(const char *question, char *input);
+
+extern int curses_get_ext_cmd(void);
+
+extern void curses_number_pad(int state);
+
+extern void curses_delay_output(void);
+
+extern void curses_start_screen(void);
+
+extern void curses_end_screen(void);
+
+extern void curses_outrip(winid wid, int how);
+
+extern void genl_outrip(winid tmpwin, int how);
+
+extern void curses_preference_update(const char *pref);
+
+
+/* curswins.c */
+
+extern WINDOW *curses_create_window(int width, int height, orient orientation);
+
+extern void curses_destroy_win(WINDOW *win);
+
+extern WINDOW *curses_get_nhwin(winid wid);
+
+extern void curses_add_nhwin(winid wid, int height, int width, int y,
+ int x, orient orientation, boolean border);
+
+extern void curses_refresh_nhwin(winid wid);
+
+extern void curses_refresh_nethack_windows(void);
+
+extern void curses_del_nhwin(winid wid);
+
+extern void curses_putch(winid wid, int x, int y, int ch, int color, int attrs);
+
+extern void curses_get_window_size(winid wid, int *height, int *width);
+
+extern boolean curses_window_has_border(winid wid);
+
+extern boolean curses_window_exists(winid wid);
+
+extern int curses_get_window_orientation(winid wid);
+
+extern void curses_get_window_xy(winid wid, int *x, int *y);
+
+extern void curses_puts(winid wid, int attr, const char *text);
+
+
+/* cursmisc.c */
+
+extern int curses_read_char(void);
+
+extern void curses_toggle_color_attr(WINDOW *win, int color, int attr, int onoff);
+
+extern void curses_bail(const char *mesg);
+
+extern winid curses_get_wid(int type);
+
+extern char *curses_copy_of(const char *s);
+
+extern int curses_num_lines(const char *str, int width);
+
+extern char *curses_break_str(const char *str, int width, int line_num);
+
+extern char *curses_str_remainder(const char *str, int width, int line_num);
+
+extern boolean curses_is_menu(winid wid);
+
+extern boolean curses_is_text(winid wid);
+
+extern int curses_convert_glyph(int ch, int glyph);
+
+extern void curses_move_cursor(winid wid, int x, int y);
+
+extern void curses_prehousekeeping(void);
+
+extern void curses_posthousekeeping(void);
+
+extern void curses_view_file(const char *filename, boolean must_exist);
+
+extern char *curses_rtrim(char *str);
+
+
+/* cursdial.c */
+
+extern void curses_line_input_dialog(const char *prompt, char *answer, int buffer);
+
+extern int curses_character_input_dialog(const char *prompt, const char *choices, CHAR_P def);
+
+extern int curses_ext_cmd(void);
+
+extern void curses_create_nhmenu(winid wid);
+
+extern void curses_add_nhmenu_item(winid wid, const ANY_P *identifier,
+ CHAR_P accelerator, CHAR_P group_accel, int attr, const char *str,
+ BOOLEAN_P presel);
+
+extern void curses_finalize_nhmenu(winid wid, const char *prompt);
+
+extern int curses_display_nhmenu(winid wid, int how, MENU_ITEM_P **_selected);
+
+extern boolean curses_menu_exists(winid wid);
+
+extern void curses_del_menu(winid wid);
+
+
+/* cursstat.c */
+
+extern void curses_update_stats(void);
+
+extern void curses_decrement_highlight(void);
+
+
+/* cursinit.c */
+
+extern void curses_create_main_windows(void);
+
+extern void curses_init_nhcolors(void);
+
+extern void curses_choose_character(void);
+
+extern int curses_character_dialog(const char** choices, const char *prompt);
+
+extern void curses_init_options(void);
+
+
+/* cursmesg.c */
+
+extern void curses_message_win_puts(const char *message, boolean recursed);
+
+extern void curses_more(void);
+
+extern void curses_clear_unhighlight_message_window(void);
+
+extern void curses_last_messages(void);
+
+extern void curses_init_mesg_history(void);
+
+
+#endif  /* WINCURS_H */
+
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/winprocs.h nethack/include/winprocs.h
--- nh_orig/include/winprocs.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/winprocs.h	2010-04-11 12:36:57.794750618 -0400
@@ -177,6 +177,7 @@
 #define WC2_FULLSCREEN		0x01L	/* 01 display full screen                    */
 #define WC2_SOFTKEYBOARD	0x02L	/* 02 software keyboard                      */
-#define WC2_WRAPTEXT		0x04L	/* 04 wrap long lines of text                */
-					/* 29 free bits */
+#define WC2_WRAPTEXT		0x04L	/* 03 wrap long lines of text                */
+#define WC2_DARKGRAY		0x08L	/* 04 try to use "bright black" color        */
+					/* 28 free bits */
 
 #define ALIGN_LEFT	1
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/you.h nethack/include/you.h
--- nh_orig/include/you.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/you.h	2010-03-24 12:55:58.963750958 -0400
@@ -89,9 +89,5 @@
 	      ldrnum,		/* PM_ of quest leader (questpgr.c) */
 	      guardnum,		/* PM_ of quest guardians (questpgr.c) */
-	      neminum,		/* PM_ of quest nemesis (questpgr.c) */
-	      enemy1num,	/* specific quest enemies (NON_PM == random) */
-	      enemy2num;
-	char  enemy1sym,	/* quest enemies by class (S_) */
-	      enemy2sym;
+	      neminum;		/* PM_ of quest nemesis (questpgr.c) */
 	short questarti;	/* index (ART_) of quest artifact (questpgr.c) */
 
@@ -264,4 +260,6 @@
 	struct prop uprops[LAST_PROP+1];
 
+    int u_telepathy_dist;
+
 	unsigned umconf;
 	char usick_cause[PL_PSIZ+20]; /* sizeof "unicorn horn named "+1 */
@@ -345,4 +343,5 @@
 	long	ucleansed;	/* to record moves when player was cleansed */
 	long	usleep;		/* sleeping; monstermove you last started */
+	long  udiseased;  /* diseased: are you diseased, and how badly? */
 	int uinvault;
 	struct monst *ustuck;
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/include/youprop.h nethack/include/youprop.h
--- nh_orig/include/youprop.h	2003-12-07 18:39:13.000000000 -0500
+++ nethack/include/youprop.h	2009-08-02 13:49:33.040407823 -0400
@@ -61,4 +61,24 @@
 				 resists_drli(&youmonst))
 
+#define HVulnerable_fire  u.uprops[VULN_FIRE].intrinsic
+#define EVulnerable_fire  u.uprops[VULN_FIRE].extrinsic
+#define Vulnerable_fire	  (HVulnerable_fire || EVulnerable_fire || \
+		vulnerable_to(&youmonst,AD_FIRE))
+
+#define HVulnerable_cold  u.uprops[VULN_COLD].intrinsic
+#define EVulnerable_cold  u.uprops[VULN_COLD].extrinsic
+#define Vulnerable_cold	  (HVulnerable_cold || EVulnerable_cold || \
+		vulnerable_to(&youmonst,AD_COLD))
+
+#define HVulnerable_elec  u.uprops[VULN_ELEC].intrinsic
+#define EVulnerable_elec  u.uprops[VULN_ELEC].extrinsic
+#define Vulnerable_elec	  (HVulnerable_elec || EVulnerable_elec || \
+		vulnerable_to(&youmonst,AD_ELEC))
+
+#define HVulnerable_acid  u.uprops[VULN_ACID].intrinsic
+#define EVulnerable_acid  u.uprops[VULN_ACID].extrinsic
+#define Vulnerable_acid	  (HVulnerable_acid || EVulnerable_acid || \
+		vulnerable_to(&youmonst,AD_ACID))
+
 /* Intrinsics only */
 #define HSick_resistance	u.uprops[SICK_RES].intrinsic
@@ -80,4 +100,10 @@
 #define Stone_resistance	(EStone_resistance || resists_ston(&youmonst))
 
+#define EWere_resistance  u.uprops[WERE_RES].extrinsic
+#define Were_resistance	  (EWere_resistance)
+
+#define EBlind_resistance  u.uprops[BLIND_RES].extrinsic
+#define Blind_resistance	(EBlind_resistance || Vision)
+
 
 /*** Troubles ***/
@@ -87,10 +113,16 @@
 /* Those implemented solely as timeouts (we use just intrinsic) */
 #define HStun			u.uprops[STUNNED].intrinsic
-#define Stunned			(HStun || u.umonnum == PM_STALKER || \
-				 youmonst.data->mlet == S_BAT)
+#define Stunned			(!Stun_resistance && \
+							(HStun || u.umonnum == PM_STALKER || youmonst.data->mlet == S_BAT))
 		/* Note: birds will also be stunned */
 
 #define HConfusion		u.uprops[CONFUSION].intrinsic
-#define Confusion		HConfusion
+#define Confusion					  (HConfusion && !Confusion_resistance)
+
+/* cheap hack to avoid breaking save */
+#define EConfusion_resistance	  u.uprops[CONFUSION].extrinsic
+#define Confusion_resistance	  EConfusion_resistance
+#define EStun_resistance		  u.uprops[STUNNED].extrinsic
+#define Stun_resistance			  EStun_resistance
 
 #define Blinded			u.uprops[BLINDED].intrinsic
@@ -98,7 +130,10 @@
 		/* ...means blind because of a cover */
 #define Blind	((Blinded || Blindfolded || !haseyes(youmonst.data)) && \
-		 !(ublindf && ublindf->oartifact == ART_EYES_OF_THE_OVERWORLD))
+		 !(ublindf && ublindf->oartifact == ART_EYES_OF_THE_OVERWORLD) && \
+		 !(haseyes(youmonst.data) && Blind_resistance))
+
 		/* ...the Eyes operate even when you really are blind
-		    or don't have any eyes */
+		    or don't have any eyes, but blindness resistance won't
+			 grant sight to something that didn't have it... */
 
 #define Sick			u.uprops[SICK].intrinsic
@@ -112,5 +147,5 @@
 #define HHallucination		u.uprops[HALLUC].intrinsic
 #define EHalluc_resistance	u.uprops[HALLUC_RES].extrinsic
-#define Halluc_resistance	(EHalluc_resistance || \
+#define Halluc_resistance	(EHalluc_resistance || Vision || \
 				 (Upolyd && dmgtype(youmonst.data, AD_HALU)))
 #define Hallucination		(HHallucination && !Halluc_resistance)
@@ -138,11 +173,12 @@
 #define ESee_invisible		u.uprops[SEE_INVIS].extrinsic
 #define See_invisible		(HSee_invisible || ESee_invisible || \
-				 perceives(youmonst.data))
+				 perceives(youmonst.data) || Vision)
 
 #define HTelepat		u.uprops[TELEPAT].intrinsic
 #define ETelepat		u.uprops[TELEPAT].extrinsic
-#define Blind_telepat		(HTelepat || ETelepat || \
-				 telepathic(youmonst.data))
-#define Unblind_telepat		(ETelepat)
+#define Blind_telepat		((HTelepat || ETelepat || \
+				 telepathic(youmonst.data)) && !BTelepat)
+#define Unblind_telepat		(ETelepat && !BTelepat)
+#define BTelepat	 u.uprops[TELEPAT].blocked
 
 #define HWarning		u.uprops[WARNING].intrinsic
@@ -150,4 +186,10 @@
 #define Warning			(HWarning || EWarning)
 
+/* See invisible, infravision, protection from shape changers,
+ * blindness and hallucination resistance all rolled into one */
+#define EVision		 u.uprops[VISION].extrinsic
+#define Vision			 (EVision)
+
+
 /* Warning for a specific type of monster */
 #define HWarn_of_mon		u.uprops[WARN_OF_MON].intrinsic
@@ -171,5 +213,5 @@
 #define EInfravision		u.uprops[INFRAVISION].extrinsic
 #define Infravision		(HInfravision || EInfravision || \
-				  infravision(youmonst.data))
+				  infravision(youmonst.data) || Vision)
 
 #define HDetect_monsters	u.uprops[DETECT_MONSTERS].intrinsic
@@ -241,4 +283,5 @@
 	/* May touch surface; does not override any others */
 
+#define EWwalking	   u.uprops[WWALKING].extrinsic
 #define Wwalking		(u.uprops[WWALKING].extrinsic && \
 				 !Is_waterlevel(&u.uz))
@@ -310,5 +353,6 @@
 #define Protection_from_shape_changers \
 				(HProtection_from_shape_changers || \
-				 EProtection_from_shape_changers)
+				 EProtection_from_shape_changers || \
+				 Vision)
 
 #define HPolymorph		u.uprops[POLYMORPH].intrinsic
@@ -326,9 +370,14 @@
 #define HFast			u.uprops[FAST].intrinsic
 #define EFast			u.uprops[FAST].extrinsic
-#define Fast			(HFast || EFast)
-#define Very_fast		((HFast & ~INTRINSIC) || EFast)
+#define Fast			((HFast || EFast) && !Slow)
+#define Very_fast		(((HFast & ~INTRINSIC) || EFast) && !Slow)
+
+#define HSlow		   u.uprops[SLOW].intrinsic
+#define ESlow		   u.uprops[SLOW].extrinsic
+#define Slow			(HSlow || ESlow)
 
+#define HReflecting		u.uprops[REFLECTING].intrinsic
 #define EReflecting		u.uprops[REFLECTING].extrinsic
-#define Reflecting		(EReflecting || \
+#define Reflecting		(EReflecting || HReflecting || \
 				 (youmonst.data == &mons[PM_SILVER_DRAGON]))
 
@@ -339,4 +388,6 @@
 #define Lifesaved		u.uprops[LIFESAVED].extrinsic
 
+#define ELucky				u.uprops[LUCKY].extrinsic
+#define Lucky				(ELucky)
 
 #endif /* YOUPROP_H */
diff -X /home/derek/bin/nhdiff_exceptions -iNdEwr -U2 nh_orig/nh343-curses-a2.patch nethack/nh343-curses-a2.patch
--- nh_orig/nh343-curses-a2.patch	1969-12-31 19:00:00.000000000 -0500
+++ nethack/nh343-curses-a2.patch	2009-09-05 10:31:56.532294000 -0400
@@ -0,0 +1,9003 @@
+diff -burN nethack-3.4.3/doc/window.doc nethack/doc/window.doc
+--- nethack-3.4.3/doc/window.doc	2003-12-07 18:39:13.000000000 -0500
++++ nethack/doc/window.doc	2009-03-11 13:33:19.000000000 -0400
+@@ -518,6 +518,9 @@
+   |  fullscreen        | WC2_FULLSCREEN     | wc2_fullscreen     |boolean |
+   |  softkeyboard      | WC2_SOFTKEYBOARD   | wc2_softkeyboard   |boolean |
+   |  wraptext          | WC2_WRAPTEXT       | wc2_wraptext       |boolean |
++  |  term_cols         | WC2_TERM_COLS      | wc2_term_cols      |int     |
++  |  term_rows         | WC2_TERM_ROWS      | wc2_term_rows      |int     |
++  |  windowborders     | WC2_WINDOWBORDERS  | wc2_windowborders  |int     |
+   +--------------------+--------------------+--------------------+--------+
+ 
+ align_message	-- where to place message window (top, bottom, left, right)
+@@ -548,6 +551,8 @@
+ 		   is this number of cells away from the edge of the window.
+ softkeyboard    -- handhelds should display an on-screen keyboard if possible.
+ splash_screen   -- port should/should not display an opening splashscreen.
++term_cols       -- Terminal should size itself to specified width, if possible.
++term_rows       -- Terminal should size itself to specified height, if possible.
+ tiled_map	-- port should display a tiled map if it can.
+ tile_width	-- port should display tiles with this width or round to closest
+ 		   if it can.
+@@ -558,6 +563,8 @@
+ use_inverse	-- port should display inverse when NetHack asks for it.
+ vary_msgcount	-- port should display this number of messages at a time in
+ 		   the message window.
++windowborders   -- port should display borders around main NetHack windows.
++                Can be set to (1) on, (2) off, or (3) auto.
+ windowcolors
+ 		-- port should use these colors for window foreground/background
+ 		   colors.  Syntax:
+diff -burN nethack-3.4.3/include/config.h nethack/include/config.h
+--- nethack-3.4.3/include/config.h	2003-12-07 18:39:13.000000000 -0500
++++ nethack/include/config.h	2009-03-05 13:50:37.000000000 -0500
+@@ -42,7 +42,8 @@
+  * Define all of those you want supported in your binary.
+  * Some combinations make no sense.  See the installation document.
+  */
+-#define TTY_GRAPHICS	/* good old tty based graphics */
++/* #define TTY_GRAPHICS */	/* good old tty based graphics */
++#define CURSES_GRAPHICS     /* Proper curses interface */
+ /* #define X11_GRAPHICS */	/* X11 interface */
+ /* #define QT_GRAPHICS */	/* Qt interface */
+ /* #define GNOME_GRAPHICS */	/* Gnome interface */
+@@ -113,6 +114,15 @@
+ # define HACKDIR "\\nethack"
+ #endif
+ 
++#ifdef CURSES_GRAPHICS
++# ifdef TTY_GRAPHICS
++# undef TTY_GRAPHICS
++# endif
++# ifndef DEFAULT_WINDOW_SYS
++#  define DEFAULT_WINDOW_SYS "curses"
++# endif
++#endif
++
+ #ifndef DEFAULT_WINDOW_SYS
+ # define DEFAULT_WINDOW_SYS "tty"
+ #endif
+@@ -169,11 +179,11 @@
+ 
+ #ifdef UNIX
+ /* path and file name extension for compression program */
+-#define COMPRESS "/usr/bin/compress"	/* Lempel-Ziv compression */
+-#define COMPRESS_EXTENSION ".Z"		/* compress's extension */
++/* #define COMPRESS "/usr/bin/compress" */	/* Lempel-Ziv compression */
++/* #define COMPRESS_EXTENSION ".Z"	*/	/* compress's extension */
+ /* An example of one alternative you might want to use: */
+-/* #define COMPRESS "/usr/local/bin/gzip" */	/* FSF gzip compression */
+-/* #define COMPRESS_EXTENSION ".gz" */		/* normal gzip extension */
++#define COMPRESS "/bin/gzip"	/* FSF gzip compression */
++#define COMPRESS_EXTENSION ".gz"		/* normal gzip extension */
+ #endif
+ 
+ #ifndef COMPRESS
+diff -burN nethack-3.4.3/include/flag.h nethack/include/flag.h
+--- nethack-3.4.3/include/flag.h	2003-12-07 18:39:13.000000000 -0500
++++ nethack/include/flag.h	2009-03-05 13:50:37.000000000 -0500
+@@ -156,6 +156,7 @@
+ 
+ struct instance_flags {
+ 	boolean  cbreak;	/* in cbreak mode, rogue format */
++    boolean  cursesgraphics;    /* Use portable curses extended characters */
+ 	boolean  DECgraphics;	/* use DEC VT-xxx extended character set */
+ 	boolean  echo;		/* 1 to echo characters */
+ 	boolean  IBMgraphics;	/* use IBM extended character set */
+@@ -181,6 +182,8 @@
+ #endif
+ #ifdef TTY_GRAPHICS
+ 	char prevmsg_window;	/* type of old message window to use */
++#endif
++#if defined(TTY_GRAPHICS) || defined(CURSES_GRAPHICS)
+ 	boolean  extmenu;	/* extended commands use menu interface */
+ #endif
+ #ifdef MFLOPPY
+@@ -263,6 +266,9 @@
+ 	boolean wc2_fullscreen;		/* run fullscreen */
+ 	boolean wc2_softkeyboard;	/* use software keyboard */
+ 	boolean wc2_wraptext;		/* wrap text */
++    int     wc2_term_cols;      /* terminal width, in characters */
++    int     wc2_term_rows;      /* terminal height, in characters */
++    int     wc2_windowborders;  /* display borders on NetHack windows */
+ 
+ 	boolean  cmdassist;	/* provide detailed assistance for some commands */
+ 	boolean	 obsolete;	/* obsolete options can point at this, it isn't used */
+diff -burN nethack-3.4.3/include/ntconf.h nethack/include/ntconf.h
+--- nethack-3.4.3/include/ntconf.h	2003-12-07 18:39:13.000000000 -0500
++++ nethack/include/ntconf.h	2009-03-11 13:27:04.000000000 -0400
+@@ -159,7 +159,9 @@
+ long _RTLENTRY _EXPFUNC lseek  (int __handle, long __offset, int __fromwhere);
+ int  _RTLENTRY _EXPFUNC read  (int __handle, void _FAR *__buf, unsigned __len);
+ #endif
+-#include <conio.h>
++#ifndef CURSES_GRAPHICS
++# include <conio.h>
++#endif
+ #undef kbhit		/* Use our special NT kbhit */
+ #define kbhit (*nt_kbhit)
+ 
+diff -burN nethack-3.4.3/include/rm.h nethack/include/rm.h
+--- nethack-3.4.3/include/rm.h	2003-12-07 18:39:13.000000000 -0500
++++ nethack/include/rm.h	2009-03-05 13:50:38.000000000 -0500
+@@ -234,6 +234,7 @@
+ #define IBM_GRAPHICS	1	/* PC graphic characters */
+ #define DEC_GRAPHICS	2	/* VT100 line drawing characters */
+ #define MAC_GRAPHICS	3	/* Macintosh drawing characters */
++#define CURS_GRAPHICS   4   /* Portable curses drawing characters */
+ 
+ /*
+  * The 5 possible states of doors
+diff -burN nethack-3.4.3/include/wincurs.h nethack/include/wincurs.h
+--- nethack-3.4.3/include/wincurs.h	1969-12-31 19:00:00.000000000 -0500
++++ nethack/include/wincurs.h	2009-03-05 13:50:38.000000000 -0500
+@@ -0,0 +1,250 @@
++#ifndef WINCURS_H
++#define WINCURS_H
++
++/* Global declarations for curses interface */
++
++int term_rows, term_cols; /* size of underlying terminal */
++
++WINDOW *base_term;    /* underlying terminal window */
++
++WINDOW *mapborderwin;
++
++
++#define TEXTCOLOR   /* Allow color */
++#define NHW_END 19
++#define OFF 0
++#define ON 1
++#define NONE -1
++#define KEY_ESC 0x1b
++#define DIALOG_BORDER_COLOR CLR_MAGENTA
++#define HIGHLIGHT_COLOR CLR_WHITE
++#define MORECOLOR CLR_ORANGE
++#define STAT_UP_COLOR CLR_GREEN
++#define STAT_DOWN_COLOR CLR_RED
++#define MESSAGE_WIN 1
++#define STATUS_WIN  2
++#define MAP_WIN     3
++#define HPOS_WIN    4
++#define MESG_HISTORY_MAX   200
++
++
++typedef enum orient_type
++{
++    CENTER,
++    UP,
++    DOWN,
++    RIGHT,
++    LEFT
++} orient;
++
++
++/* cursmain.c */
++
++extern struct window_procs curses_procs;
++
++extern void curses_init_nhwindows(int* argcp, char** argv);
++
++extern void curses_player_selection(void);
++
++extern void curses_askname(void);
++
++extern void curses_get_nh_event(void);
++
++extern void curses_exit_nhwindows(const char *str);
++
++extern void curses_suspend_nhwindows(const char *str);
++
++extern void curses_resume_nhwindows(void);
++
++extern winid curses_create_nhwindow(int type);
++
++extern void curses_clear_nhwindow(winid wid);
++
++extern void curses_display_nhwindow(winid wid, BOOLEAN_P block);
++
++extern void curses_destroy_nhwindow(winid wid);
++
++extern void curses_curs(winid wid, int x, int y);
++
++extern void curses_putstr(winid wid, int attr, const char *text);
++
++extern void curses_display_file(const char *filename,BOOLEAN_P must_exist);
++
++extern void curses_start_menu(winid wid);
++
++extern void curses_add_menu(winid wid, int glyph, const ANY_P * identifier,
++		CHAR_P accelerator, CHAR_P group_accel, int attr, 
++		const char *str, BOOLEAN_P presel);
++
++extern void curses_end_menu(winid wid, const char *prompt);
++
++extern int curses_select_menu(winid wid, int how, MENU_ITEM_P **selected);
++
++extern void curses_update_inventory(void);
++
++extern void curses_mark_synch(void);
++
++extern void curses_wait_synch(void);
++
++extern void curses_cliparound(int x, int y);
++
++extern void curses_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,int glyph);
++
++extern void curses_raw_print(const char *str);
++
++extern void curses_raw_print_bold(const char *str);
++
++extern int curses_nhgetch(void);
++
++extern int curses_nh_poskey(int *x, int *y, int *mod);
++
++extern void curses_nhbell(void);
++
++extern int curses_doprev_message(void);
++
++extern char curses_yn_function(const char *question, const char *choices, CHAR_P def);
++
++extern void curses_getlin(const char *question, char *input);
++
++extern int curses_get_ext_cmd(void);
++
++extern void curses_number_pad(int state);
++
++extern void curses_delay_output(void);
++
++extern void curses_start_screen(void);
++
++extern void curses_end_screen(void);
++
++extern void curses_outrip(winid wid, int how);
++
++extern void genl_outrip(winid tmpwin, int how);
++
++extern void curses_preference_update(const char *pref);
++
++
++/* curswins.c */
++
++extern WINDOW *curses_create_window(int width, int height, orient orientation);
++
++extern void curses_destroy_win(WINDOW *win);
++
++extern WINDOW *curses_get_nhwin(winid wid);
++
++extern void curses_add_nhwin(winid wid, int height, int width, int y,
++ int x, orient orientation, boolean border);
++
++extern void curses_refresh_nhwin(winid wid);
++
++extern void curses_refresh_nethack_windows(void);
++
++extern void curses_del_nhwin(winid wid);
++
++extern void curses_putch(winid wid, int x, int y, int ch, int color, int attrs);
++
++extern void curses_get_window_size(winid wid, int *height, int *width);
++
++extern boolean curses_window_has_border(winid wid);
++
++extern boolean curses_window_exists(winid wid);
++
++extern int curses_get_window_orientation(winid wid);
++
++extern void curses_get_window_xy(winid wid, int *x, int *y);
++
++extern void curses_puts(winid wid, int attr, const char *text);
++
++
++/* cursmisc.c */
++
++extern int curses_read_char(void);
++
++extern void curses_toggle_color_attr(WINDOW *win, int color, int attr, int onoff);
++
++extern void curses_bail(const char *mesg);
++
++extern winid curses_get_wid(int type);
++
++extern char *curses_copy_of(const char *s);
++
++extern int curses_num_lines(const char *str, int width);
++
++extern char *curses_break_str(const char *str, int width, int line_num);
++
++extern char *curses_str_remainder(const char *str, int width, int line_num);
++
++extern boolean curses_is_menu(winid wid);
++
++extern boolean curses_is_text(winid wid);
++
++extern int curses_convert_glyph(int ch, int glyph);
++
++extern void curses_move_cursor(winid wid, int x, int y);
++
++extern void curses_prehousekeeping(void);
++
++extern void curses_posthousekeeping(void);
++
++extern void curses_view_file(const char *filename, boolean must_exist);
++
++extern char *curses_rtrim(char *str);
++
++
++/* cursdial.c */
++
++extern void curses_line_input_dialog(const char *prompt, char *answer, int buffer);
++
++extern int curses_character_input_dialog(const char *prompt, const char *choices, CHAR_P def);
++
++extern int curses_ext_cmd(void);
++
++extern void curses_create_nhmenu(winid wid);
++
++extern void curses_add_nhmenu_item(winid wid, const ANY_P *identifier,
++ CHAR_P accelerator, CHAR_P group_accel, int attr, const char *str,
++ BOOLEAN_P presel);
++
++extern void curses_finalize_nhmenu(winid wid, const char *prompt);
++
++extern int curses_display_nhmenu(winid wid, int how, MENU_ITEM_P **_selected);
++
++extern boolean curses_menu_exists(winid wid);
++
++extern void curses_del_menu(winid wid);
++
++
++/* cursstat.c */
++
++extern void curses_update_stats(void);
++
++extern void curses_decrement_highlight(void);
++
++
++/* cursinit.c */
++
++extern void curses_create_main_windows(void);
++
++extern void curses_init_nhcolors(void);
++
++extern void curses_choose_character(void);
++
++extern int curses_character_dialog(const char** choices, const char *prompt);
++
++extern void curses_init_options(void);
++
++
++/* cursmesg.c */
++
++extern void curses_message_win_puts(const char *message, boolean recursed);
++
++extern void curses_more(void);
++
++extern void curses_clear_unhighlight_message_window(void);
++
++extern void curses_last_messages(void);
++
++extern void curses_init_mesg_history(void);
++
++
++#endif  /* WINCURS_H */
++
+diff -burN nethack-3.4.3/include/winprocs.h nethack/include/winprocs.h
+--- nethack-3.4.3/include/winprocs.h	2003-12-07 18:39:13.000000000 -0500
++++ nethack/include/winprocs.h	2009-03-05 13:50:38.000000000 -0500
+@@ -176,8 +176,11 @@
+ 
+ #define WC2_FULLSCREEN		0x01L	/* 01 display full screen                    */
+ #define WC2_SOFTKEYBOARD	0x02L	/* 02 software keyboard                      */
+-#define WC2_WRAPTEXT	