--- Setup-Exnem.TP2	Fri Apr 15 11:47:12 2005
+++ C:\BWP Patchstudio\patched files\Setup-Exnem.TP2	Wed Apr 14 22:38:11 2010
@@ -2,6 +2,8 @@
 BACKUP ~exnem/backup~ 
 AUTHOR ~Sir_BillyBob~
 
+VERSION ~v5 BWP Fix~
+
 BEGIN ~Exnem Vault v5, Install Items~
 
 /////////////////////////
@@ -2156,15 +2158,58 @@
 5th   SCRXX21 SCRXX22 SCRXX23 SCRXX24 SCRXX25 SCRXX26 SCRXX27 SCRXX04 SCRXX05 SCRXX18 SCRXX19 SCRXX20 SCRXX27 SCRXX01 SCRXX06 SCRXX07 SCRXX15 SCRXX16 SCRXX21 SCRXX26~
 UNLESS ~4th~
 
-ACTION_IF FILE_EXISTS ~data/ctbitm.bif~
-THEN BEGIN
-  COPY ~EXNEM\RNDTREAS.CTB~ ~OVERRIDE\RNDTREAS.2DA~
-END
-
-ACTION_IF NOT FILE_EXISTS ~data/ctbitm.bif~
-THEN BEGIN
-  COPY ~EXNEM\RNDTREAS.2DA~ ~OVERRIDE\RNDTREAS.2DA~
-END
+
+// ACTION_IF FILE_EXISTS ~data/ctbitm.bif~
+// THEN BEGIN
+//   COPY ~EXNEM\RNDTREAS.CTB~ ~OVERRIDE\RNDTREAS.2DA~
+// END
+
+// ACTION_IF NOT FILE_EXISTS ~data/ctbitm.bif~
+// THEN BEGIN
+//   COPY ~EXNEM\RNDTREAS.2DA~ ~OVERRIDE\RNDTREAS.2DA~
+// END
+
+COPY_EXISTING ~RNDTREAS.2DA~ ~override~
+    COUNT_2DA_ROWS 20 "rows"
+    FOR (i = 0; i < "%rows%" ; i += 1) BEGIN
+      READ_2DA_ENTRY %i% 0 20 "row_name"
+      PATCH_IF !("%row_name%" STRING_COMPARE_CASE "WELL_OFF") BEGIN
+        SET_2DA_ENTRY %i% 1 20 RNDMAG05
+        SET_2DA_ENTRY %i% 2 20 RNDMAG03
+        SET_2DA_ENTRY %i% 6 20 RNDMAG06
+        SET_2DA_ENTRY %i% 8 20 RNDMAG04
+        SET_2DA_ENTRY %i% 9 20 RNDSCR03
+        SET_2DA_ENTRY %i% 10 20 RNDMAG03
+        SET_2DA_ENTRY %i% 15 20 RNDMAG07
+        SET_2DA_ENTRY %i% 19 20 RNDMAG04
+      END
+      PATCH_IF !("%row_name%" STRING_COMPARE_CASE "WEALTHY") BEGIN
+      	SET_2DA_ENTRY %i% 1 20 RNDMAG06
+      	SET_2DA_ENTRY %i% 7 20 RNDSCR04
+      	SET_2DA_ENTRY %i% 10 20 RNDMAG07
+      	SET_2DA_ENTRY %i% 12 20 RNDMAG06
+      	SET_2DA_ENTRY %i% 16 20 RNDMAG08
+      	SET_2DA_ENTRY %i% 18 20 RNDMAG08
+      	SET_2DA_ENTRY %i% 19 20 RNDMAG07
+      END
+      PATCH_IF !("%row_name%" STRING_COMPARE_CASE "RICH") BEGIN
+	      SET_2DA_ENTRY %i% 1 20 RNDMAG01
+	      SET_2DA_ENTRY %i% 3 20 RNDMAG03
+	      SET_2DA_ENTRY %i% 4 20 RNDMAG04
+	      SET_2DA_ENTRY %i% 5 20 RNDMAG05
+	      SET_2DA_ENTRY %i% 6 20 RNDMAG06
+	      SET_2DA_ENTRY %i% 7 20 RNDMAG07
+	      SET_2DA_ENTRY %i% 8 20 RNDMAG08
+	      SET_2DA_ENTRY %i% 9 20 RNDMAG09
+	      SET_2DA_ENTRY %i% 15 20 RNDSCR05
+	      SET_2DA_ENTRY %i% 16 20 RNDMAG05
+	      SET_2DA_ENTRY %i% 17 20 RNDMAG06
+	      SET_2DA_ENTRY %i% 18 20 RNDMAG07
+      	SET_2DA_ENTRY %i% 19 20 RNDMAG08
+      END
+    END
+  BUT_ONLY
+
 
 ///
 ///  Add items to creatures in game
