--- WildMage\Setup-WildMage.TP2	Fri Jul 17 11:05:36 2009
+++ D:\EE_Patchstudio\patched files\WildMage\Setup-WildMage.TP2	Tue Jan 19 18:12:08 2016
@@ -1,5 +1,38 @@
 BACKUP ~WildMage/backup~
 AUTHOR ~jo.ge@gmx.net~
+VERSION ~v1.7 BWP Fix~
+
+ALWAYS
+  ACTION_IF ENGINE_IS ~bgee bg2ee iwdee eet~ BEGIN
+  
+	ACTION_IF "%WEIDU_OS%" STRING_EQUAL_CASE ~win32~ BEGIN
+		AT_NOW ~if not exist "iconv" mkdir iconv~
+		AT_NOW ~if not exist "iconv\iconv.exe" copy "BiG World Fixpack\_utils\iconv" "iconv"~
+	END
+	
+    ACTION_DEFINE_ASSOCIATIVE_ARRAY charsetsTable BEGIN
+      "german" => "CP1252"
+      "english" => "CP1252"
+      "french" => "CP1252"
+      "italian" => "CP1252"
+      "polish" => "CP1250"
+      "russian" => "CP1251"
+      "castilian" => "CP1252"
+    END
+    ACTION_DEFINE_ARRAY charsetsConvertArray BEGIN text dialog END
+    ACTION_DEFINE_ARRAY charsetsReloadArray BEGIN text END
+    LAF ~HANDLE_CHARSETS~
+      INT_VAR
+      infer_charsets = 0
+      STR_VAR
+      tra_path = "WildMage/translations"
+      iconv_path = ~iconv~ //available as part of the base system on OS X and GNU/Linux
+      charset_table = charsetsTable
+      convert_array = charsetsConvertArray
+      reload_array = charsetsReloadArray
+    END
+  END
+END
 
 LANGUAGE ~English~
          ~english~
@@ -28,7 +61,7 @@
 //******************************************************
 
 BEGIN @1
-REQUIRE_FILE ~Data/25Dialog.bif~ @10
+REQUIRE_PREDICATE GAME_IS ~tob tutu tutu_totsc bgee bg2ee iwdee eet~ @10
 
 //------------------------------------------------------
 //		Mod-start in Baldur.BCS
@@ -328,9 +361,16 @@
 // BGT Compatibility (Retain Spellbook on Transfer from BG1 to BG2)
 //-----------------------------------------------------------------
 
-ACTION_IF FILE_EXISTS ~DATA/BG1ARE.BIF~ THEN BEGIN
+ACTION_IF GAME_IS ~bgt~ BEGIN
+  OUTER_SPRINT aram00 ~aram00~
+END ELSE ACTION_IF GAME_IS ~eet~ BEGIN
+  OUTER_SPRINT aram00 ~K#TELBGT~
+END
 
-EXTEND_TOP ~aram00.bcs~ ~WildMage/0/baf/wm_aram00.baf~
+ACTION_IF GAME_IS ~bgt eet~ THEN BEGIN
+
+COPY_EXISTING ~%aram00%.BCS~ ~override~
+  REPLACE_BCS_BLOCK ~WildMage/0/baf/owm_aram00.baf~ ~WildMage/0/baf/nwm_aram00.baf~
 EXTEND_TOP ~ar0602.bcs~ ~WildMage/0/baf/wm_ar0602.baf~
 
 END
@@ -674,21 +714,24 @@
   SAY DESC @69999
   
 
-ACTION_IF FILE_EXISTS ~DATA/BG1ARE.BIF~ THEN BEGIN			// Outside Candlekeep BGT
-
-EXTEND_TOP ~ar6526.bcs~ ~WildMage/4/baf/wm_bgt.baf~
-COPY_EXISTING ~Gorion.cre~ ~override~
-ADD_CRE_ITEM ~wm_scrl~ #0 #0 #0 ~IDENTIFIED~ ~INV16~
-
+ACTION_IF GAME_IS ~bgee~ BEGIN
+  OUTER_SPRINT gorion_cre ~GORION~
+  OUTER_SPRINT Candlekeep_Ch6_BCS ~AR2626~
+END ELSE ACTION_IF GAME_IS ~eet~ BEGIN
+  OUTER_SPRINT gorion_cre ~GORION~
+  OUTER_SPRINT Candlekeep_Ch6_BCS ~BG2626~
+END ELSE ACTION_IF GAME_IS ~bgt~ BEGIN
+  OUTER_SPRINT gorion_cre ~GORION~
+  OUTER_SPRINT Candlekeep_Ch6_BCS ~AR6526~
+END ELSE ACTION_IF GAME_IS ~tutu tutu_totsc~ BEGIN
+  OUTER_SPRINT gorion_cre ~_GORION~
+  OUTER_SPRINT Candlekeep_Ch6_BCS ~_AR2626~
 END
 
-
-ACTION_IF FILE_EXISTS ~OVERRIDE/FW2700.ARE~ THEN BEGIN			// Outside Candlekeep BG1-TUTU 
-
-EXTEND_TOP ~_AR2700.BCS~ ~WildMage/4/baf/wm_bgt.baf~
-COPY_EXISTING ~_GORION.CRE~ ~override~
+ACTION_IF GAME_IS ~bgee eet bgt tutu tutu_totsc~ BEGIN // Outside Candlekeep
+  EXTEND_TOP ~%Candlekeep_Ch6_BCS%.bcs~ ~WildMage/4/baf/wm_bgt.baf~
+  COPY_EXISTING ~%gorion_cre%.cre~ ~override~
 ADD_CRE_ITEM ~wm_scrl~ #0 #0 #0 ~IDENTIFIED~ ~INV16~
-
 END
 
 
