// Remake Spawns for Major Bonehill Areas

COPY_EXISTING	~BH0300.ARE~	~override~
 READ_LONG  0x54  "actors_offset"
 READ_SHORT 0x58  "actors_num"
 READ_SHORT 0x5a  "infotrig_num"
 READ_LONG  0x5c  "infotrig_offset"
 READ_LONG  0x60  "spawns_offset"
 READ_LONG  0x64  "spawns_num"
 READ_LONG  0x68  "entrances_offset"
 READ_LONG  0x6c  "entrances_num"
 READ_LONG  0x70  "cont_offset"
 READ_SHORT 0x74  "cont_num"
 READ_SHORT 0x76  "items_num"
 READ_LONG  0x78  "items_offset"
 READ_LONG  0x7c  "vert_offset"
 READ_SHORT 0x80  "vert_num"
 READ_SHORT 0x82  "amb_num"
 READ_LONG  0x84  "amb_offset"
 READ_LONG  0x88  "vars_offset"
 READ_LONG  0x8c  "vars_num"
 READ_LONG  0xa0  "expbmp_offset"
 READ_LONG  0xa4  "doors_num"
 READ_LONG  0xa8  "doors_offset"
 READ_LONG  0xac  "anim_num"
 READ_LONG  0xb0  "anim_offset"
 READ_LONG  0xb4  "tiled_num"
 READ_LONG  0xb8  "tiled_offset"
 READ_LONG  0xbc  "songs_offset"
 READ_LONG  0xc0  "rest_spawns_offset"
 READ_LONG  0xc4  "automap_offset"
 READ_LONG  0xc8  "automap_num"

 SET info_1=1
 FOR( cnt=0; cnt<"%infotrig_num%"; cnt=cnt+1 ) BEGIN  //info triggers loop
   READ_ASCII ("%infotrig_offset%"+0xc4*cnt)       "info_name"
   PATCH_IF (("%info_name%" STRING_COMPARE_CASE "BH030001")=0) BEGIN  //if already exists
     info_1=0
   END
 END

 PATCH_IF (info_1=1) BEGIN                //adding new info trigger  *******************************
   SET offset = ("%infotrig_offset%"+0xc4*"%infotrig_num%")
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH030001~
   WRITE_SHORT (offset+0x20) 0             //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 285           //bounding box left
   WRITE_SHORT (offset+0x24) 457           //bounding box top
   WRITE_SHORT (offset+0x26) 385           //bounding box right
   WRITE_SHORT (offset+0x28) 557           //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4             //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"  //first vertex index
   WRITE_LONG  (offset+0x34) 0             //cursor frame number
   WRITE_LONG  (offset+0x60) 2             //flag
   SAY         (offset+0x64) ~~		 //info text
   WRITE_SHORT (offset+0x6c) 1             //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0             //And not detected
   WRITE_SHORT (offset+0x70) 335           //Trap location X
   WRITE_SHORT (offset+0x72) 507           //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH030001~	 //script
   SET "infotrig_num"="%infotrig_num%"+1
   WRITE_SHORT 0x5a  "%infotrig_num%"
 END

 SET "info_ext"=0xc4*info_1
 PATCH_IF ("%actors_offset%">="%infotrig_offset%") BEGIN
   "actors_offset"="%actors_offset%"+"%info_ext%"
   WRITE_LONG  0x54 "%actors_offset%"
 END
 PATCH_IF ("%spawns_offset%">="%infotrig_offset%") BEGIN
   "spawns_offset"="%spawns_offset%"+"%info_ext%"
   WRITE_LONG  0x60  "%spawns_offset%"
 END
 PATCH_IF ("%entrances_offset%">="%infotrig_offset%") BEGIN
   "entrances_offset"="%entrances_offset%"+"%info_ext%"
   WRITE_LONG  0x68  "%entrances_offset%"
 END
 PATCH_IF ("%cont_offset%">="%infotrig_offset%") BEGIN
   "cont_offset"="%cont_offset%"+"%info_ext%"
   WRITE_LONG  0x70  "%cont_offset%"
 END
 PATCH_IF ("%items_offset%">="%infotrig_offset%") BEGIN
   "items_offset"="%items_offset%"+"%info_ext%"
   WRITE_LONG  0x78  "%items_offset%"
 END
 PATCH_IF ("%vert_offset%">="%infotrig_offset%") BEGIN
   "vert_offset"="%vert_offset%"+"%info_ext%"
   WRITE_LONG  0x7c  "%vert_offset%"
 END
 PATCH_IF ("%amb_offset%">="%infotrig_offset%") BEGIN
   "amb_offset"="%amb_offset%"+"%info_ext%"
   WRITE_LONG  0x84  "%amb_offset%"
 END
 PATCH_IF ("%vars_offset%">="%infotrig_offset%") BEGIN
   "vars_offset"="%vars_offset%"+"%info_ext%"
   WRITE_LONG  0x88  "%vars_offset%"
 END
 PATCH_IF ("%expbmp_offset%">="%infotrig_offset%") BEGIN
   "expbmp_offset"="%expbmp_offset%"+"%info_ext%"
   WRITE_LONG  0xa0  "%expbmp_offset%"
 END
 PATCH_IF ("%doors_offset%">="%infotrig_offset%") BEGIN
   "doors_offset"="%doors_offset%"+"%info_ext%"
   WRITE_LONG  0xa8  "%doors_offset%"
 END
 PATCH_IF ("%anim_offset%">="%infotrig_offset%") BEGIN
   "anim_offset"="%anim_offset%"+"%info_ext%"
   WRITE_LONG  0xb0  "%anim_offset%"
 END
 PATCH_IF ("%tiled_offset%">="%infotrig_offset%") BEGIN
   "tiled_offset"="%tiled_offset%"+"%info_ext%"
   WRITE_LONG  0xb8  "%tiled_offset%"
 END
 PATCH_IF ("%songs_offset%">="%infotrig_offset%") BEGIN
   "songs_offset"="%songs_offset%"+"%info_ext%"
   WRITE_LONG  0xbc  "%songs_offset%"
 END
 PATCH_IF ("%rest_spawns_offset%">="%infotrig_offset%") BEGIN
   "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%"
   WRITE_LONG  0xc0  "%rest_spawns_offset%"
 END
 PATCH_IF ("%automap_offset%">="%infotrig_offset%") BEGIN
   "automap_offset"="%automap_offset%"+"%info_ext%"
   WRITE_LONG  0xc4  "%automap_offset%"
 END

 PATCH_IF (info_1=1) BEGIN            //adding vertices for the new trigger
   SET offset = ("%vert_offset%"+0x04*"%vert_num%")
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      285
   WRITE_SHORT  (offset+2)  457
   WRITE_SHORT  (offset+4)  385
   WRITE_SHORT  (offset+6)  457
   WRITE_SHORT  (offset+8)  385
   WRITE_SHORT  (offset+10) 557
   WRITE_SHORT  (offset+12) 285
   WRITE_SHORT  (offset+14) 557
   SET "vert_num"="%vert_num%"+4
   WRITE_SHORT 0x80  "%vert_num%"
 END

 SET "info_ext"=0x04*info_1*4
 PATCH_IF ("%actors_offset%">="%vert_offset%") BEGIN
   "actors_offset"="%actors_offset%"+"%info_ext%"
   WRITE_LONG  0x54 "%actors_offset%"
 END
 PATCH_IF ("%spawns_offset%">="%vert_offset%") BEGIN
   "spawns_offset"="%spawns_offset%"+"%info_ext%"
   WRITE_LONG  0x60  "%spawns_offset%"
 END
 PATCH_IF ("%entrances_offset%">="%vert_offset%") BEGIN
   "entrances_offset"="%entrances_offset%"+"%info_ext%"
   WRITE_LONG  0x68  "%entrances_offset%"
 END
 PATCH_IF ("%cont_offset%">="%vert_offset%") BEGIN
   "cont_offset"="%cont_offset%"+"%info_ext%"
   WRITE_LONG  0x70  "%cont_offset%"
 END
 PATCH_IF ("%items_offset%">="%vert_offset%") BEGIN
   "items_offset"="%items_offset%"+"%info_ext%"
   WRITE_LONG  0x78  "%items_offset%"
 END
 PATCH_IF ("%infotrig_offset%">="%vert_offset%") BEGIN
   "infotrig_offset"="%infotrig_offset%"+"%info_ext%"
   WRITE_LONG  0x5c  "%infotrig_offset%"
 END
 PATCH_IF ("%amb_offset%">="%vert_offset%") BEGIN
   "amb_offset"="%amb_offset%"+"%info_ext%"
   WRITE_LONG  0x84  "%amb_offset%"
 END
 PATCH_IF ("%vars_offset%">="%vert_offset%") BEGIN
   "vars_offset"="%vars_offset%"+"%info_ext%"
   WRITE_LONG  0x88  "%vars_offset%"
 END
 PATCH_IF ("%expbmp_offset%">="%vert_offset%") BEGIN
   "expbmp_offset"="%expbmp_offset%"+"%info_ext%"
   WRITE_LONG  0xa0  "%expbmp_offset%"
 END
 PATCH_IF ("%doors_offset%">="%vert_offset%") BEGIN
   "doors_offset"="%doors_offset%"+"%info_ext%"
   WRITE_LONG  0xa8  "%doors_offset%"
 END
 PATCH_IF ("%anim_offset%">="%vert_offset%") BEGIN
   "anim_offset"="%anim_offset%"+"%info_ext%"
   WRITE_LONG  0xb0  "%anim_offset%"
 END
 PATCH_IF ("%tiled_offset%">="%vert_offset%") BEGIN
   "tiled_offset"="%tiled_offset%"+"%info_ext%"
   WRITE_LONG  0xb8  "%tiled_offset%"
 END
 PATCH_IF ("%songs_offset%">="%vert_offset%") BEGIN
   "songs_offset"="%songs_offset%"+"%info_ext%"
   WRITE_LONG  0xbc  "%songs_offset%"
 END
 PATCH_IF ("%rest_spawns_offset%">="%vert_offset%") BEGIN
   "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%"
   WRITE_LONG  0xc0  "%rest_spawns_offset%"
 END
 PATCH_IF ("%automap_offset%">="%vert_offset%") BEGIN
   "automap_offset"="%automap_offset%"+"%info_ext%"
   WRITE_LONG  0xc4  "%automap_offset%"
 END
BUT_ONLY
END

//Add 15 new proximity triggers and 60 new vertices for those triggers to BH1100.ARE
COPY_EXISTING ~BH1100.ARE~  ~override~
 READ_LONG  0x54  "actors_offset"
 READ_SHORT 0x58  "actors_num"
 READ_SHORT 0x5a  "infotrig_num"
 READ_LONG  0x5c  "infotrig_offset"
 READ_LONG  0x60  "spawns_offset"
 READ_LONG  0x64  "spawns_num"
 READ_LONG  0x68  "entrances_offset"
 READ_LONG  0x6c  "entrances_num"
 READ_LONG  0x70  "cont_offset"
 READ_SHORT 0x74  "cont_num"
 READ_SHORT 0x76  "items_num"
 READ_LONG  0x78  "items_offset"
 READ_LONG  0x7c  "vert_offset"
 READ_SHORT 0x80  "vert_num"
 READ_SHORT 0x82  "amb_num"
 READ_LONG  0x84  "amb_offset"
 READ_LONG  0x88  "vars_offset"
 READ_LONG  0x8c  "vars_num"
 READ_LONG  0xa0  "expbmp_offset"
 READ_LONG  0xa4  "doors_num"
 READ_LONG  0xa8  "doors_offset"
 READ_LONG  0xac  "anim_num"
 READ_LONG  0xb0  "anim_offset"
 READ_LONG  0xb4  "tiled_num"
 READ_LONG  0xb8  "tiled_offset"
 READ_LONG  0xbc  "songs_offset"
 READ_LONG  0xc0  "rest_spawns_offset"
 READ_LONG  0xc4  "automap_offset"
 READ_LONG  0xc8  "automap_num"

 SET info_1=1
 FOR( cnt=0; cnt<"%infotrig_num%"; cnt=cnt+1 ) BEGIN  //info triggers loop
   READ_ASCII ("%infotrig_offset%"+0xc4*cnt)       "info_name"
   PATCH_IF (("%info_name%" STRING_COMPARE_CASE "BH110001")=0) BEGIN  //if already exists
     info_1=0
   END
 END

 PATCH_IF (info_1=1) BEGIN                //adding new info trigger  *******************************
//adding 15 new proximity triggers ************************************************
   SET offset = ("%infotrig_offset%"+0xc4*"%infotrig_num%")
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH110001~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 884             //bounding box left
   WRITE_SHORT (offset+0x24) 255             //bounding box top
   WRITE_SHORT (offset+0x26) 984             //bounding box right
   WRITE_SHORT (offset+0x28) 355             //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"    //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 934             //Trap location X
   WRITE_SHORT (offset+0x72) 305             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH110001~       //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH110002~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 1007             //bounding box left
   WRITE_SHORT (offset+0x24) 247             //bounding box top
   WRITE_SHORT (offset+0x26) 1107            //bounding box right
   WRITE_SHORT (offset+0x28) 347             //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+4  //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 1057            //Trap location X
   WRITE_SHORT (offset+0x72) 297             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH110002~       //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH110003~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 1117            //bounding box left
   WRITE_SHORT (offset+0x24) 194             //bounding box top
   WRITE_SHORT (offset+0x26) 1217            //bounding box right
   WRITE_SHORT (offset+0x28) 294             //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+8  //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 1167            //Trap location X
   WRITE_SHORT (offset+0x72) 244             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH110003~       //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH110004~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 1998            //bounding box left
   WRITE_SHORT (offset+0x24) 197             //bounding box top
   WRITE_SHORT (offset+0x26) 2098            //bounding box right
   WRITE_SHORT (offset+0x28) 297             //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+12 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 2048            //Trap location X
   WRITE_SHORT (offset+0x72) 247             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH110004~       //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH110005~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3016            //bounding box left
   WRITE_SHORT (offset+0x24) 465             //bounding box top
   WRITE_SHORT (offset+0x26) 3116            //bounding box right
   WRITE_SHORT (offset+0x28) 565             //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+16 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3066            //Trap location X
   WRITE_SHORT (offset+0x72) 515             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH110005~       //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH110006~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3575            //bounding box left
   WRITE_SHORT (offset+0x24) 587             //bounding box top
   WRITE_SHORT (offset+0x26) 3675            //bounding box right
   WRITE_SHORT (offset+0x28) 687             //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+20 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3625            //Trap location X
   WRITE_SHORT (offset+0x72) 637             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH110006~       //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH110007~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 4166            //bounding box left
   WRITE_SHORT (offset+0x24) 1066            //bounding box top
   WRITE_SHORT (offset+0x26) 4266            //bounding box right
   WRITE_SHORT (offset+0x28) 1166            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+24 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 4216            //Trap location X
   WRITE_SHORT (offset+0x72) 1116            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH110007~       //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH110008~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3301            //bounding box left
   WRITE_SHORT (offset+0x24) 486             //bounding box top
   WRITE_SHORT (offset+0x26) 3401            //bounding box right
   WRITE_SHORT (offset+0x28) 586             //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+28 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3351            //Trap location X
   WRITE_SHORT (offset+0x72) 536             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH110008~       //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH110009~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3003            //bounding box left
   WRITE_SHORT (offset+0x24) 1233            //bounding box top
   WRITE_SHORT (offset+0x26) 3103            //bounding box right
   WRITE_SHORT (offset+0x28) 1333            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+32 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3053            //Trap location X
   WRITE_SHORT (offset+0x72) 1283            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH110009~       //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH110010~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3867            //bounding box left
   WRITE_SHORT (offset+0x24) 346             //bounding box top
   WRITE_SHORT (offset+0x26) 3967            //bounding box right
   WRITE_SHORT (offset+0x28) 446             //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+36 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3917            //Trap location X
   WRITE_SHORT (offset+0x72) 396             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH110010~       //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH110011~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3362            //bounding box left
   WRITE_SHORT (offset+0x24) 2518            //bounding box top
   WRITE_SHORT (offset+0x26) 3462            //bounding box right
   WRITE_SHORT (offset+0x28) 2618            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+40 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3412            //Trap location X
   WRITE_SHORT (offset+0x72) 2568            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH110011~       //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH110012~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3240            //bounding box left
   WRITE_SHORT (offset+0x24) 2436            //bounding box top
   WRITE_SHORT (offset+0x26) 3340            //bounding box right
   WRITE_SHORT (offset+0x28) 2536            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+44 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3290            //Trap location X
   WRITE_SHORT (offset+0x72) 2486            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH110012~       //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH110013~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 2285            //bounding box left
   WRITE_SHORT (offset+0x24) 2803            //bounding box top
   WRITE_SHORT (offset+0x26) 2385            //bounding box right
   WRITE_SHORT (offset+0x28) 2903            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+48 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 2335            //Trap location X
   WRITE_SHORT (offset+0x72) 2853            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH110013~       //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH110014~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 2057            //bounding box left
   WRITE_SHORT (offset+0x24) 1710            //bounding box top
   WRITE_SHORT (offset+0x26) 2157            //bounding box right
   WRITE_SHORT (offset+0x28) 1810            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+52 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 2107            //Trap location X
   WRITE_SHORT (offset+0x72) 1760            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH110014~       //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH110015~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 4348            //bounding box left
   WRITE_SHORT (offset+0x24) 2966            //bounding box top
   WRITE_SHORT (offset+0x26) 4448            //bounding box right
   WRITE_SHORT (offset+0x28) 3066            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+56 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 4398            //Trap location X
   WRITE_SHORT (offset+0x72) 3016            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH110015~       //Trap script

   SET "infotrig_num"="%infotrig_num%"+15
   WRITE_SHORT 0x5a  "%infotrig_num%"

   SET "info_ext"=0xc4*15
   PATCH_IF ("%actors_offset%">="%infotrig_offset%") BEGIN
     "actors_offset"="%actors_offset%"+"%info_ext%"
     WRITE_LONG  0x54 "%actors_offset%"
   END
   PATCH_IF ("%spawns_offset%">="%infotrig_offset%") BEGIN
     "spawns_offset"="%spawns_offset%"+"%info_ext%"
     WRITE_LONG  0x60  "%spawns_offset%"
   END
   PATCH_IF ("%entrances_offset%">="%infotrig_offset%") BEGIN
     "entrances_offset"="%entrances_offset%"+"%info_ext%"
     WRITE_LONG  0x68  "%entrances_offset%"
   END
   PATCH_IF ("%cont_offset%">="%infotrig_offset%") BEGIN
     "cont_offset"="%cont_offset%"+"%info_ext%"
     WRITE_LONG  0x70  "%cont_offset%"
   END
   PATCH_IF ("%items_offset%">="%infotrig_offset%") BEGIN
     "items_offset"="%items_offset%"+"%info_ext%"
     WRITE_LONG  0x78  "%items_offset%"
   END
   PATCH_IF ("%vert_offset%">="%infotrig_offset%") BEGIN
     "vert_offset"="%vert_offset%"+"%info_ext%"
     WRITE_LONG  0x7c  "%vert_offset%"
   END
   PATCH_IF ("%amb_offset%">="%infotrig_offset%") BEGIN
     "amb_offset"="%amb_offset%"+"%info_ext%"
     WRITE_LONG  0x84  "%amb_offset%"
   END
   PATCH_IF ("%vars_offset%">="%infotrig_offset%") BEGIN
     "vars_offset"="%vars_offset%"+"%info_ext%"
     WRITE_LONG  0x88  "%vars_offset%"
   END
   PATCH_IF ("%expbmp_offset%">="%infotrig_offset%") BEGIN
     "expbmp_offset"="%expbmp_offset%"+"%info_ext%"
     WRITE_LONG  0xa0  "%expbmp_offset%"
   END
   PATCH_IF ("%doors_offset%">="%infotrig_offset%") BEGIN
     "doors_offset"="%doors_offset%"+"%info_ext%"
     WRITE_LONG  0xa8  "%doors_offset%"
   END
   PATCH_IF ("%anim_offset%">="%infotrig_offset%") BEGIN
     "anim_offset"="%anim_offset%"+"%info_ext%"
     WRITE_LONG  0xb0  "%anim_offset%"
   END
   PATCH_IF ("%tiled_offset%">="%infotrig_offset%") BEGIN
     "tiled_offset"="%tiled_offset%"+"%info_ext%"
     WRITE_LONG  0xb8  "%tiled_offset%"
   END
   PATCH_IF ("%songs_offset%">="%infotrig_offset%") BEGIN
     "songs_offset"="%songs_offset%"+"%info_ext%"
     WRITE_LONG  0xbc  "%songs_offset%"
   END
   PATCH_IF ("%rest_spawns_offset%">="%infotrig_offset%") BEGIN
     "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%"
     WRITE_LONG  0xc0  "%rest_spawns_offset%"
   END
   PATCH_IF ("%automap_offset%">="%infotrig_offset%") BEGIN
     "automap_offset"="%automap_offset%"+"%info_ext%"
     WRITE_LONG  0xc4  "%automap_offset%"
   END

  //adding 60 new vertices for triggers
   SET offset = ("%vert_offset%"+0x04*"%vert_num%")
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      884
   WRITE_SHORT  (offset+2)  255
   WRITE_SHORT  (offset+4)  984
   WRITE_SHORT  (offset+6)  255
   WRITE_SHORT  (offset+8)  984
   WRITE_SHORT  (offset+10) 355
   WRITE_SHORT  (offset+12) 884
   WRITE_SHORT  (offset+14) 355
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      1007
   WRITE_SHORT  (offset+2)  247
   WRITE_SHORT  (offset+4)  1107
   WRITE_SHORT  (offset+6)  247
   WRITE_SHORT  (offset+8)  1107
   WRITE_SHORT  (offset+10) 347
   WRITE_SHORT  (offset+12) 1007
   WRITE_SHORT  (offset+14) 347
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      1117
   WRITE_SHORT  (offset+2)  194
   WRITE_SHORT  (offset+4)  1217
   WRITE_SHORT  (offset+6)  194
   WRITE_SHORT  (offset+8)  1217
   WRITE_SHORT  (offset+10) 294
   WRITE_SHORT  (offset+12) 1117
   WRITE_SHORT  (offset+14) 294
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      1998
   WRITE_SHORT  (offset+2)  197
   WRITE_SHORT  (offset+4)  2098
   WRITE_SHORT  (offset+6)  197
   WRITE_SHORT  (offset+8)  2098
   WRITE_SHORT  (offset+10) 297
   WRITE_SHORT  (offset+12) 1998
   WRITE_SHORT  (offset+14) 297
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3016
   WRITE_SHORT  (offset+2)  465
   WRITE_SHORT  (offset+4)  3116
   WRITE_SHORT  (offset+6)  465
   WRITE_SHORT  (offset+8)  3116
   WRITE_SHORT  (offset+10) 565
   WRITE_SHORT  (offset+12) 3016
   WRITE_SHORT  (offset+14) 565
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3575
   WRITE_SHORT  (offset+2)  587
   WRITE_SHORT  (offset+4)  3675
   WRITE_SHORT  (offset+6)  587
   WRITE_SHORT  (offset+8)  3675
   WRITE_SHORT  (offset+10) 687
   WRITE_SHORT  (offset+12) 3575
   WRITE_SHORT  (offset+14) 687
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      4166
   WRITE_SHORT  (offset+2)  1066
   WRITE_SHORT  (offset+4)  4266
   WRITE_SHORT  (offset+6)  1066
   WRITE_SHORT  (offset+8)  4266
   WRITE_SHORT  (offset+10) 1166
   WRITE_SHORT  (offset+12) 4166
   WRITE_SHORT  (offset+14) 1166
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3301
   WRITE_SHORT  (offset+2)  486
   WRITE_SHORT  (offset+4)  3401
   WRITE_SHORT  (offset+6)  486
   WRITE_SHORT  (offset+8)  3401
   WRITE_SHORT  (offset+10) 586
   WRITE_SHORT  (offset+12) 3301
   WRITE_SHORT  (offset+14) 586
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3003
   WRITE_SHORT  (offset+2)  1233
   WRITE_SHORT  (offset+4)  3103
   WRITE_SHORT  (offset+6)  1233
   WRITE_SHORT  (offset+8)  3103
   WRITE_SHORT  (offset+10) 1333
   WRITE_SHORT  (offset+12) 3003
   WRITE_SHORT  (offset+14) 1333
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3867
   WRITE_SHORT  (offset+2)  346
   WRITE_SHORT  (offset+4)  3967
   WRITE_SHORT  (offset+6)  346
   WRITE_SHORT  (offset+8)  3967
   WRITE_SHORT  (offset+10) 446
   WRITE_SHORT  (offset+12) 3867
   WRITE_SHORT  (offset+14) 446
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3362
   WRITE_SHORT  (offset+2)  2518
   WRITE_SHORT  (offset+4)  3462
   WRITE_SHORT  (offset+6)  2518
   WRITE_SHORT  (offset+8)  3462
   WRITE_SHORT  (offset+10) 2618
   WRITE_SHORT  (offset+12) 3362
   WRITE_SHORT  (offset+14) 2618
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3240
   WRITE_SHORT  (offset+2)  2436
   WRITE_SHORT  (offset+4)  3340
   WRITE_SHORT  (offset+6)  2436
   WRITE_SHORT  (offset+8)  3340
   WRITE_SHORT  (offset+10) 2536
   WRITE_SHORT  (offset+12) 3240
   WRITE_SHORT  (offset+14) 2536
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      2285
   WRITE_SHORT  (offset+2)  2803
   WRITE_SHORT  (offset+4)  2385
   WRITE_SHORT  (offset+6)  2803
   WRITE_SHORT  (offset+8)  2385
   WRITE_SHORT  (offset+10) 2903
   WRITE_SHORT  (offset+12) 2285
   WRITE_SHORT  (offset+14) 2903
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      2057
   WRITE_SHORT  (offset+2)  1710
   WRITE_SHORT  (offset+4)  2157
   WRITE_SHORT  (offset+6)  1710
   WRITE_SHORT  (offset+8)  2157
   WRITE_SHORT  (offset+10) 1810
   WRITE_SHORT  (offset+12) 2057
   WRITE_SHORT  (offset+14) 1810
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      4348
   WRITE_SHORT  (offset+2)  2966
   WRITE_SHORT  (offset+4)  4448
   WRITE_SHORT  (offset+6)  2966
   WRITE_SHORT  (offset+8)  4448
   WRITE_SHORT  (offset+10) 3066
   WRITE_SHORT  (offset+12) 4348
   WRITE_SHORT  (offset+14) 3066

   SET "vert_num"="%vert_num%"+60
   WRITE_SHORT 0x80  "%vert_num%"

   SET "info_ext"=0x04*60
   PATCH_IF ("%actors_offset%">="%vert_offset%") BEGIN
     "actors_offset"="%actors_offset%"+"%info_ext%"
     WRITE_LONG  0x54 "%actors_offset%"
   END
   PATCH_IF ("%spawns_offset%">="%vert_offset%") BEGIN
     "spawns_offset"="%spawns_offset%"+"%info_ext%"
     WRITE_LONG  0x60  "%spawns_offset%"
   END
   PATCH_IF ("%entrances_offset%">="%vert_offset%") BEGIN
     "entrances_offset"="%entrances_offset%"+"%info_ext%"
     WRITE_LONG  0x68  "%entrances_offset%"
   END
   PATCH_IF ("%cont_offset%">="%vert_offset%") BEGIN
     "cont_offset"="%cont_offset%"+"%info_ext%"
     WRITE_LONG  0x70  "%cont_offset%"
   END
   PATCH_IF ("%items_offset%">="%vert_offset%") BEGIN
     "items_offset"="%items_offset%"+"%info_ext%"
     WRITE_LONG  0x78  "%items_offset%"
   END
   PATCH_IF ("%infotrig_offset%">="%vert_offset%") BEGIN
     "infotrig_offset"="%infotrig_offset%"+"%info_ext%"
     WRITE_LONG  0x5c  "%infotrig_offset%"
   END
   PATCH_IF ("%amb_offset%">="%vert_offset%") BEGIN
     "amb_offset"="%amb_offset%"+"%info_ext%"
     WRITE_LONG  0x84  "%amb_offset%"
   END
   PATCH_IF ("%vars_offset%">="%vert_offset%") BEGIN
     "vars_offset"="%vars_offset%"+"%info_ext%"
     WRITE_LONG  0x88  "%vars_offset%"
   END
   PATCH_IF ("%expbmp_offset%">="%vert_offset%") BEGIN
     "expbmp_offset"="%expbmp_offset%"+"%info_ext%"
     WRITE_LONG  0xa0  "%expbmp_offset%"
   END
   PATCH_IF ("%doors_offset%">="%vert_offset%") BEGIN
     "doors_offset"="%doors_offset%"+"%info_ext%"
     WRITE_LONG  0xa8  "%doors_offset%"
   END
   PATCH_IF ("%anim_offset%">="%vert_offset%") BEGIN
     "anim_offset"="%anim_offset%"+"%info_ext%"
     WRITE_LONG  0xb0  "%anim_offset%"
   END
   PATCH_IF ("%tiled_offset%">="%vert_offset%") BEGIN
     "tiled_offset"="%tiled_offset%"+"%info_ext%"
     WRITE_LONG  0xb8  "%tiled_offset%"
   END
   PATCH_IF ("%songs_offset%">="%vert_offset%") BEGIN
     "songs_offset"="%songs_offset%"+"%info_ext%"
     WRITE_LONG  0xbc  "%songs_offset%"
   END
   PATCH_IF ("%rest_spawns_offset%">="%vert_offset%") BEGIN
     "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%"
     WRITE_LONG  0xc0  "%rest_spawns_offset%"
   END
   PATCH_IF ("%automap_offset%">="%vert_offset%") BEGIN
     "automap_offset"="%automap_offset%"+"%info_ext%"
     WRITE_LONG  0xc4  "%automap_offset%"
   END
BUT_ONLY
END

//Add 6 new proximity triggers and 24 new vertices for those triggers to BH1200.ARE
COPY_EXISTING ~BH1200.ARE~  ~override~
 READ_LONG  0x54  "actors_offset"
 READ_SHORT 0x58  "actors_num"
 READ_SHORT 0x5a  "infotrig_num"
 READ_LONG  0x5c  "infotrig_offset"
 READ_LONG  0x60  "spawns_offset"
 READ_LONG  0x64  "spawns_num"
 READ_LONG  0x68  "entrances_offset"
 READ_LONG  0x6c  "entrances_num"
 READ_LONG  0x70  "cont_offset"
 READ_SHORT 0x74  "cont_num"
 READ_SHORT 0x76  "items_num"
 READ_LONG  0x78  "items_offset"
 READ_LONG  0x7c  "vert_offset"
 READ_SHORT 0x80  "vert_num"
 READ_SHORT 0x82  "amb_num"
 READ_LONG  0x84  "amb_offset"
 READ_LONG  0x88  "vars_offset"
 READ_LONG  0x8c  "vars_num"
 READ_LONG  0xa0  "expbmp_offset"
 READ_LONG  0xa4  "doors_num"
 READ_LONG  0xa8  "doors_offset"
 READ_LONG  0xac  "anim_num"
 READ_LONG  0xb0  "anim_offset"
 READ_LONG  0xb4  "tiled_num"
 READ_LONG  0xb8  "tiled_offset"
 READ_LONG  0xbc  "songs_offset"
 READ_LONG  0xc0  "rest_spawns_offset"
 READ_LONG  0xc4  "automap_offset"
 READ_LONG  0xc8  "automap_num"

 SET info_1=1
 FOR( cnt=0; cnt<"%infotrig_num%"; cnt=cnt+1 ) BEGIN  //info triggers loop
   READ_ASCII ("%infotrig_offset%"+0xc4*cnt)       "info_name"
   PATCH_IF (("%info_name%" STRING_COMPARE_CASE "BH120001")=0) BEGIN  //if already exists
     info_1=0
   END
 END

 PATCH_IF (info_1=1) BEGIN                //adding new info trigger  *******************************

//adding 6 new proximity triggers ************************************************
   SET offset = ("%infotrig_offset%"+0xc4*"%infotrig_num%")
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH120001~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 928             //bounding box left
   WRITE_SHORT (offset+0x24) 633             //bounding box top
   WRITE_SHORT (offset+0x26) 1028            //bounding box right
   WRITE_SHORT (offset+0x28) 733             //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"    //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 978             //Trap location X
   WRITE_SHORT (offset+0x72) 683             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH120001~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH120002~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3201            //bounding box left
   WRITE_SHORT (offset+0x24) 1051            //bounding box top
   WRITE_SHORT (offset+0x26) 3301            //bounding box right
   WRITE_SHORT (offset+0x28) 1151            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+4  //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3251            //Trap location X
   WRITE_SHORT (offset+0x72) 1101            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH120002~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH120003~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 4386            //bounding box left
   WRITE_SHORT (offset+0x24) 293             //bounding box top
   WRITE_SHORT (offset+0x26) 4486            //bounding box right
   WRITE_SHORT (offset+0x28) 393             //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+8  //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 4436            //Trap location X
   WRITE_SHORT (offset+0x72) 343             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH120003~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH120004~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 4350            //bounding box left
   WRITE_SHORT (offset+0x24) 2289            //bounding box top
   WRITE_SHORT (offset+0x26) 4450            //bounding box right
   WRITE_SHORT (offset+0x28) 2389            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+12 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 4400            //Trap location X
   WRITE_SHORT (offset+0x72) 2339            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH120004~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH120005~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3565            //bounding box left
   WRITE_SHORT (offset+0x24) 3124            //bounding box top
   WRITE_SHORT (offset+0x26) 3665            //bounding box right
   WRITE_SHORT (offset+0x28) 3224            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+16 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3615            //Trap location X
   WRITE_SHORT (offset+0x72) 3174            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH120005~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH120006~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 1766            //bounding box left
   WRITE_SHORT (offset+0x24) 3023            //bounding box top
   WRITE_SHORT (offset+0x26) 1866            //bounding box right
   WRITE_SHORT (offset+0x28) 3123            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+20 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 1816            //Trap location X
   WRITE_SHORT (offset+0x72) 3073            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH120006~      //Trap script

   SET "infotrig_num"="%infotrig_num%"+6
   WRITE_SHORT 0x5a  "%infotrig_num%"

   SET "info_ext"=0xc4*6
   PATCH_IF ("%actors_offset%">="%infotrig_offset%") BEGIN
     "actors_offset"="%actors_offset%"+"%info_ext%"
     WRITE_LONG  0x54 "%actors_offset%"
   END
   PATCH_IF ("%spawns_offset%">="%infotrig_offset%") BEGIN
     "spawns_offset"="%spawns_offset%"+"%info_ext%"
     WRITE_LONG  0x60  "%spawns_offset%"
   END
   PATCH_IF ("%entrances_offset%">="%infotrig_offset%") BEGIN
     "entrances_offset"="%entrances_offset%"+"%info_ext%"
     WRITE_LONG  0x68  "%entrances_offset%"
   END
   PATCH_IF ("%cont_offset%">="%infotrig_offset%") BEGIN
     "cont_offset"="%cont_offset%"+"%info_ext%"
     WRITE_LONG  0x70  "%cont_offset%"
   END
   PATCH_IF ("%items_offset%">="%infotrig_offset%") BEGIN
     "items_offset"="%items_offset%"+"%info_ext%"
     WRITE_LONG  0x78  "%items_offset%"
   END
   PATCH_IF ("%vert_offset%">="%infotrig_offset%") BEGIN
     "vert_offset"="%vert_offset%"+"%info_ext%"
     WRITE_LONG  0x7c  "%vert_offset%"
   END
   PATCH_IF ("%amb_offset%">="%infotrig_offset%") BEGIN
     "amb_offset"="%amb_offset%"+"%info_ext%"
     WRITE_LONG  0x84  "%amb_offset%"
   END
   PATCH_IF ("%vars_offset%">="%infotrig_offset%") BEGIN
     "vars_offset"="%vars_offset%"+"%info_ext%"
     WRITE_LONG  0x88  "%vars_offset%"
   END
   PATCH_IF ("%expbmp_offset%">="%infotrig_offset%") BEGIN
     "expbmp_offset"="%expbmp_offset%"+"%info_ext%"
     WRITE_LONG  0xa0  "%expbmp_offset%"
   END
   PATCH_IF ("%doors_offset%">="%infotrig_offset%") BEGIN
     "doors_offset"="%doors_offset%"+"%info_ext%"
     WRITE_LONG  0xa8  "%doors_offset%"
   END
   PATCH_IF ("%anim_offset%">="%infotrig_offset%") BEGIN
     "anim_offset"="%anim_offset%"+"%info_ext%"
     WRITE_LONG  0xb0  "%anim_offset%"
   END
   PATCH_IF ("%tiled_offset%">="%infotrig_offset%") BEGIN
     "tiled_offset"="%tiled_offset%"+"%info_ext%"
     WRITE_LONG  0xb8  "%tiled_offset%"
   END
   PATCH_IF ("%songs_offset%">="%infotrig_offset%") BEGIN
     "songs_offset"="%songs_offset%"+"%info_ext%"
     WRITE_LONG  0xbc  "%songs_offset%"
   END
   PATCH_IF ("%rest_spawns_offset%">="%infotrig_offset%") BEGIN
     "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%"
     WRITE_LONG  0xc0  "%rest_spawns_offset%"
   END
   PATCH_IF ("%automap_offset%">="%infotrig_offset%") BEGIN
     "automap_offset"="%automap_offset%"+"%info_ext%"
     WRITE_LONG  0xc4  "%automap_offset%"
   END

  //adding 24 new vertices for triggers
   SET offset = ("%vert_offset%"+0x04*"%vert_num%")
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      928
   WRITE_SHORT  (offset+2)  633
   WRITE_SHORT  (offset+4)  1028
   WRITE_SHORT  (offset+6)  633
   WRITE_SHORT  (offset+8)  1028
   WRITE_SHORT  (offset+10) 733
   WRITE_SHORT  (offset+12) 928
   WRITE_SHORT  (offset+14) 733
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3201
   WRITE_SHORT  (offset+2)  1051
   WRITE_SHORT  (offset+4)  3301
   WRITE_SHORT  (offset+6)  1051
   WRITE_SHORT  (offset+8)  3301
   WRITE_SHORT  (offset+10) 1151
   WRITE_SHORT  (offset+12) 3201
   WRITE_SHORT  (offset+14) 1151
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      4386
   WRITE_SHORT  (offset+2)  293
   WRITE_SHORT  (offset+4)  4486
   WRITE_SHORT  (offset+6)  293
   WRITE_SHORT  (offset+8)  4486
   WRITE_SHORT  (offset+10) 393
   WRITE_SHORT  (offset+12) 4386
   WRITE_SHORT  (offset+14) 393
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      4350
   WRITE_SHORT  (offset+2)  2289
   WRITE_SHORT  (offset+4)  4450
   WRITE_SHORT  (offset+6)  2289
   WRITE_SHORT  (offset+8)  4450
   WRITE_SHORT  (offset+10) 2389
   WRITE_SHORT  (offset+12) 4350
   WRITE_SHORT  (offset+14) 2389
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3565
   WRITE_SHORT  (offset+2)  3124
   WRITE_SHORT  (offset+4)  3665
   WRITE_SHORT  (offset+6)  3124
   WRITE_SHORT  (offset+8)  3665
   WRITE_SHORT  (offset+10) 3224
   WRITE_SHORT  (offset+12) 3565
   WRITE_SHORT  (offset+14) 3224
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      1766
   WRITE_SHORT  (offset+2)  3023
   WRITE_SHORT  (offset+4)  1866
   WRITE_SHORT  (offset+6)  3023
   WRITE_SHORT  (offset+8)  1866
   WRITE_SHORT  (offset+10) 3123
   WRITE_SHORT  (offset+12) 1766
   WRITE_SHORT  (offset+14) 3123

   SET "vert_num"="%vert_num%"+24
   WRITE_SHORT 0x80  "%vert_num%"

   SET "info_ext"=0x04*24
   PATCH_IF ("%actors_offset%">="%vert_offset%") BEGIN
     "actors_offset"="%actors_offset%"+"%info_ext%"
     WRITE_LONG  0x54 "%actors_offset%"
   END
   PATCH_IF ("%spawns_offset%">="%vert_offset%") BEGIN
     "spawns_offset"="%spawns_offset%"+"%info_ext%"
     WRITE_LONG  0x60  "%spawns_offset%"
   END
   PATCH_IF ("%entrances_offset%">="%vert_offset%") BEGIN
     "entrances_offset"="%entrances_offset%"+"%info_ext%"
     WRITE_LONG  0x68  "%entrances_offset%"
   END
   PATCH_IF ("%cont_offset%">="%vert_offset%") BEGIN
     "cont_offset"="%cont_offset%"+"%info_ext%"
     WRITE_LONG  0x70  "%cont_offset%"
   END
   PATCH_IF ("%items_offset%">="%vert_offset%") BEGIN
     "items_offset"="%items_offset%"+"%info_ext%"
     WRITE_LONG  0x78  "%items_offset%"
   END
   PATCH_IF ("%infotrig_offset%">="%vert_offset%") BEGIN
     "infotrig_offset"="%infotrig_offset%"+"%info_ext%"
     WRITE_LONG  0x5c  "%infotrig_offset%"
   END
   PATCH_IF ("%amb_offset%">="%vert_offset%") BEGIN
     "amb_offset"="%amb_offset%"+"%info_ext%"
     WRITE_LONG  0x84  "%amb_offset%"
   END
   PATCH_IF ("%vars_offset%">="%vert_offset%") BEGIN
     "vars_offset"="%vars_offset%"+"%info_ext%"
     WRITE_LONG  0x88  "%vars_offset%"
   END
   PATCH_IF ("%expbmp_offset%">="%vert_offset%") BEGIN
     "expbmp_offset"="%expbmp_offset%"+"%info_ext%"
     WRITE_LONG  0xa0  "%expbmp_offset%"
   END
   PATCH_IF ("%doors_offset%">="%vert_offset%") BEGIN
     "doors_offset"="%doors_offset%"+"%info_ext%"
     WRITE_LONG  0xa8  "%doors_offset%"
   END
   PATCH_IF ("%anim_offset%">="%vert_offset%") BEGIN
     "anim_offset"="%anim_offset%"+"%info_ext%"
     WRITE_LONG  0xb0  "%anim_offset%"
   END
   PATCH_IF ("%tiled_offset%">="%vert_offset%") BEGIN
     "tiled_offset"="%tiled_offset%"+"%info_ext%"
     WRITE_LONG  0xb8  "%tiled_offset%"
   END
   PATCH_IF ("%songs_offset%">="%vert_offset%") BEGIN
     "songs_offset"="%songs_offset%"+"%info_ext%"
     WRITE_LONG  0xbc  "%songs_offset%"
   END
   PATCH_IF ("%rest_spawns_offset%">="%vert_offset%") BEGIN
     "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%"
     WRITE_LONG  0xc0  "%rest_spawns_offset%"
   END
   PATCH_IF ("%automap_offset%">="%vert_offset%") BEGIN
     "automap_offset"="%automap_offset%"+"%info_ext%"
     WRITE_LONG  0xc4  "%automap_offset%"
   END
BUT_ONLY
END

//Add 8 new proximity triggers and 32 new vertices for those triggers to BH1300.ARE
COPY_EXISTING ~BH1300.ARE~  ~override~
 READ_LONG  0x54  "actors_offset"
 READ_SHORT 0x58  "actors_num"
 READ_SHORT 0x5a  "infotrig_num"
 READ_LONG  0x5c  "infotrig_offset"
 READ_LONG  0x60  "spawns_offset"
 READ_LONG  0x64  "spawns_num"
 READ_LONG  0x68  "entrances_offset"
 READ_LONG  0x6c  "entrances_num"
 READ_LONG  0x70  "cont_offset"
 READ_SHORT 0x74  "cont_num"
 READ_SHORT 0x76  "items_num"
 READ_LONG  0x78  "items_offset"
 READ_LONG  0x7c  "vert_offset"
 READ_SHORT 0x80  "vert_num"
 READ_SHORT 0x82  "amb_num"
 READ_LONG  0x84  "amb_offset"
 READ_LONG  0x88  "vars_offset"
 READ_LONG  0x8c  "vars_num"
 READ_LONG  0xa0  "expbmp_offset"
 READ_LONG  0xa4  "doors_num"
 READ_LONG  0xa8  "doors_offset"
 READ_LONG  0xac  "anim_num"
 READ_LONG  0xb0  "anim_offset"
 READ_LONG  0xb4  "tiled_num"
 READ_LONG  0xb8  "tiled_offset"
 READ_LONG  0xbc  "songs_offset"
 READ_LONG  0xc0  "rest_spawns_offset"
 READ_LONG  0xc4  "automap_offset"
 READ_LONG  0xc8  "automap_num"

 SET info_1=1
 FOR( cnt=0; cnt<"%infotrig_num%"; cnt=cnt+1 ) BEGIN  //info triggers loop
   READ_ASCII ("%infotrig_offset%"+0xc4*cnt)       "info_name"
   PATCH_IF (("%info_name%" STRING_COMPARE_CASE "BH130001")=0) BEGIN  //if already exists
     info_1=0
   END
 END

 PATCH_IF (info_1=1) BEGIN                //adding new info trigger  *******************************

//adding 8 new proximity triggers ************************************************
   SET offset = ("%infotrig_offset%"+0xc4*"%infotrig_num%")
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH130001~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 2542            //bounding box left
   WRITE_SHORT (offset+0x24) 1885            //bounding box top
   WRITE_SHORT (offset+0x26) 2642            //bounding box right
   WRITE_SHORT (offset+0x28) 1985            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"    //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 2592            //Trap location X
   WRITE_SHORT (offset+0x72) 1935            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH130001~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH130002~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3281            //bounding box left
   WRITE_SHORT (offset+0x24) 1827            //bounding box top
   WRITE_SHORT (offset+0x26) 3381            //bounding box right
   WRITE_SHORT (offset+0x28) 1927            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+4  //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3331            //Trap location X
   WRITE_SHORT (offset+0x72) 1877            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH130002~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH130003~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3491            //bounding box left
   WRITE_SHORT (offset+0x24) 1364            //bounding box top
   WRITE_SHORT (offset+0x26) 3591            //bounding box right
   WRITE_SHORT (offset+0x28) 1464            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+8  //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3541            //Trap location X
   WRITE_SHORT (offset+0x72) 1414            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH130003~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH130004~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 387             //bounding box left
   WRITE_SHORT (offset+0x24) 713             //bounding box top
   WRITE_SHORT (offset+0x26) 487             //bounding box right
   WRITE_SHORT (offset+0x28) 813             //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+12 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 437             //Trap location X
   WRITE_SHORT (offset+0x72) 763             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH130004~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH130005~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 743             //bounding box left
   WRITE_SHORT (offset+0x24) 2678            //bounding box top
   WRITE_SHORT (offset+0x26) 843             //bounding box right
   WRITE_SHORT (offset+0x28) 2778            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+16 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 793             //Trap location X
   WRITE_SHORT (offset+0x72) 2728            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH130005~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH130006~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 2335            //bounding box left
   WRITE_SHORT (offset+0x24) 3218            //bounding box top
   WRITE_SHORT (offset+0x26) 2435            //bounding box right
   WRITE_SHORT (offset+0x28) 3318            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+20 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 2385            //Trap location X
   WRITE_SHORT (offset+0x72) 3268            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH130006~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH130007~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3475            //bounding box left
   WRITE_SHORT (offset+0x24) 1672            //bounding box top
   WRITE_SHORT (offset+0x26) 3575            //bounding box right
   WRITE_SHORT (offset+0x28) 1772            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+24 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3525            //Trap location X
   WRITE_SHORT (offset+0x72) 1722            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH130007~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH130008~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3022            //bounding box left
   WRITE_SHORT (offset+0x24) 1870            //bounding box top
   WRITE_SHORT (offset+0x26) 3122            //bounding box right
   WRITE_SHORT (offset+0x28) 1970            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+28 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3072            //Trap location X
   WRITE_SHORT (offset+0x72) 1920            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH130008~      //Trap script

   SET "infotrig_num"="%infotrig_num%"+8
   WRITE_SHORT 0x5a  "%infotrig_num%"

   SET "info_ext"=0xc4*8
   PATCH_IF ("%actors_offset%">="%infotrig_offset%") BEGIN
     "actors_offset"="%actors_offset%"+"%info_ext%"
     WRITE_LONG  0x54 "%actors_offset%"
   END
   PATCH_IF ("%spawns_offset%">="%infotrig_offset%") BEGIN
     "spawns_offset"="%spawns_offset%"+"%info_ext%"
     WRITE_LONG  0x60  "%spawns_offset%"
   END
   PATCH_IF ("%entrances_offset%">="%infotrig_offset%") BEGIN
     "entrances_offset"="%entrances_offset%"+"%info_ext%"
     WRITE_LONG  0x68  "%entrances_offset%"
   END
   PATCH_IF ("%cont_offset%">="%infotrig_offset%") BEGIN
     "cont_offset"="%cont_offset%"+"%info_ext%"
     WRITE_LONG  0x70  "%cont_offset%"
   END
   PATCH_IF ("%items_offset%">="%infotrig_offset%") BEGIN
     "items_offset"="%items_offset%"+"%info_ext%"
     WRITE_LONG  0x78  "%items_offset%"
   END
   PATCH_IF ("%vert_offset%">="%infotrig_offset%") BEGIN
     "vert_offset"="%vert_offset%"+"%info_ext%"
     WRITE_LONG  0x7c  "%vert_offset%"
   END
   PATCH_IF ("%amb_offset%">="%infotrig_offset%") BEGIN
     "amb_offset"="%amb_offset%"+"%info_ext%"
     WRITE_LONG  0x84  "%amb_offset%"
   END
   PATCH_IF ("%vars_offset%">="%infotrig_offset%") BEGIN
     "vars_offset"="%vars_offset%"+"%info_ext%"
     WRITE_LONG  0x88  "%vars_offset%"
   END
   PATCH_IF ("%expbmp_offset%">="%infotrig_offset%") BEGIN
     "expbmp_offset"="%expbmp_offset%"+"%info_ext%"
     WRITE_LONG  0xa0  "%expbmp_offset%"
   END
   PATCH_IF ("%doors_offset%">="%infotrig_offset%") BEGIN
     "doors_offset"="%doors_offset%"+"%info_ext%"
     WRITE_LONG  0xa8  "%doors_offset%"
   END
   PATCH_IF ("%anim_offset%">="%infotrig_offset%") BEGIN
     "anim_offset"="%anim_offset%"+"%info_ext%"
     WRITE_LONG  0xb0  "%anim_offset%"
   END
   PATCH_IF ("%tiled_offset%">="%infotrig_offset%") BEGIN
     "tiled_offset"="%tiled_offset%"+"%info_ext%"
     WRITE_LONG  0xb8  "%tiled_offset%"
   END
   PATCH_IF ("%songs_offset%">="%infotrig_offset%") BEGIN
     "songs_offset"="%songs_offset%"+"%info_ext%"
     WRITE_LONG  0xbc  "%songs_offset%"
   END
   PATCH_IF ("%rest_spawns_offset%">="%infotrig_offset%") BEGIN
     "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%"
     WRITE_LONG  0xc0  "%rest_spawns_offset%"
   END
   PATCH_IF ("%automap_offset%">="%infotrig_offset%") BEGIN
     "automap_offset"="%automap_offset%"+"%info_ext%"
     WRITE_LONG  0xc4  "%automap_offset%"
   END

  //adding 32 new vertices for triggers
   SET offset = ("%vert_offset%"+0x04*"%vert_num%")
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      2542
   WRITE_SHORT  (offset+2)  1885
   WRITE_SHORT  (offset+4)  2642
   WRITE_SHORT  (offset+6)  1885
   WRITE_SHORT  (offset+8)  2642
   WRITE_SHORT  (offset+10) 1985
   WRITE_SHORT  (offset+12) 2542
   WRITE_SHORT  (offset+14) 1985
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3281
   WRITE_SHORT  (offset+2)  1827
   WRITE_SHORT  (offset+4)  3381
   WRITE_SHORT  (offset+6)  1827
   WRITE_SHORT  (offset+8)  3381
   WRITE_SHORT  (offset+10) 1927
   WRITE_SHORT  (offset+12) 3281
   WRITE_SHORT  (offset+14) 1927
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3491
   WRITE_SHORT  (offset+2)  1364
   WRITE_SHORT  (offset+4)  3591
   WRITE_SHORT  (offset+6)  1364
   WRITE_SHORT  (offset+8)  3591
   WRITE_SHORT  (offset+10) 1464
   WRITE_SHORT  (offset+12) 3491
   WRITE_SHORT  (offset+14) 1464
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      387
   WRITE_SHORT  (offset+2)  713
   WRITE_SHORT  (offset+4)  487
   WRITE_SHORT  (offset+6)  713
   WRITE_SHORT  (offset+8)  487
   WRITE_SHORT  (offset+10) 813
   WRITE_SHORT  (offset+12) 387
   WRITE_SHORT  (offset+14) 813
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      743
   WRITE_SHORT  (offset+2)  2678
   WRITE_SHORT  (offset+4)  843
   WRITE_SHORT  (offset+6)  2678
   WRITE_SHORT  (offset+8)  843
   WRITE_SHORT  (offset+10) 2778
   WRITE_SHORT  (offset+12) 743
   WRITE_SHORT  (offset+14) 2778
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      2335
   WRITE_SHORT  (offset+2)  3218
   WRITE_SHORT  (offset+4)  2435
   WRITE_SHORT  (offset+6)  3218
   WRITE_SHORT  (offset+8)  2435
   WRITE_SHORT  (offset+10) 3318
   WRITE_SHORT  (offset+12) 2335
   WRITE_SHORT  (offset+14) 3318
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3475
   WRITE_SHORT  (offset+2)  1672
   WRITE_SHORT  (offset+4)  3575
   WRITE_SHORT  (offset+6)  1672
   WRITE_SHORT  (offset+8)  3575
   WRITE_SHORT  (offset+10) 1772
   WRITE_SHORT  (offset+12) 3475
   WRITE_SHORT  (offset+14) 1772
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3022
   WRITE_SHORT  (offset+2)  1870
   WRITE_SHORT  (offset+4)  3122
   WRITE_SHORT  (offset+6)  1870
   WRITE_SHORT  (offset+8)  3122
   WRITE_SHORT  (offset+10) 1970
   WRITE_SHORT  (offset+12) 3022
   WRITE_SHORT  (offset+14) 1970

   SET "vert_num"="%vert_num%"+32
   WRITE_SHORT 0x80  "%vert_num%"

   SET "info_ext"=0x04*32
   PATCH_IF ("%actors_offset%">="%vert_offset%") BEGIN
     "actors_offset"="%actors_offset%"+"%info_ext%"
     WRITE_LONG  0x54 "%actors_offset%"
   END
   PATCH_IF ("%spawns_offset%">="%vert_offset%") BEGIN
     "spawns_offset"="%spawns_offset%"+"%info_ext%"
     WRITE_LONG  0x60  "%spawns_offset%"
   END
   PATCH_IF ("%entrances_offset%">="%vert_offset%") BEGIN
     "entrances_offset"="%entrances_offset%"+"%info_ext%"
     WRITE_LONG  0x68  "%entrances_offset%"
   END
   PATCH_IF ("%cont_offset%">="%vert_offset%") BEGIN
     "cont_offset"="%cont_offset%"+"%info_ext%"
     WRITE_LONG  0x70  "%cont_offset%"
   END
   PATCH_IF ("%items_offset%">="%vert_offset%") BEGIN
     "items_offset"="%items_offset%"+"%info_ext%"
     WRITE_LONG  0x78  "%items_offset%"
   END
   PATCH_IF ("%infotrig_offset%">="%vert_offset%") BEGIN
     "infotrig_offset"="%infotrig_offset%"+"%info_ext%"
     WRITE_LONG  0x5c  "%infotrig_offset%"
   END
   PATCH_IF ("%amb_offset%">="%vert_offset%") BEGIN
     "amb_offset"="%amb_offset%"+"%info_ext%"
     WRITE_LONG  0x84  "%amb_offset%"
   END
   PATCH_IF ("%vars_offset%">="%vert_offset%") BEGIN
     "vars_offset"="%vars_offset%"+"%info_ext%"
     WRITE_LONG  0x88  "%vars_offset%"
   END
   PATCH_IF ("%expbmp_offset%">="%vert_offset%") BEGIN
     "expbmp_offset"="%expbmp_offset%"+"%info_ext%"
     WRITE_LONG  0xa0  "%expbmp_offset%"
   END
   PATCH_IF ("%doors_offset%">="%vert_offset%") BEGIN
     "doors_offset"="%doors_offset%"+"%info_ext%"
     WRITE_LONG  0xa8  "%doors_offset%"
   END
   PATCH_IF ("%anim_offset%">="%vert_offset%") BEGIN
     "anim_offset"="%anim_offset%"+"%info_ext%"
     WRITE_LONG  0xb0  "%anim_offset%"
   END
   PATCH_IF ("%tiled_offset%">="%vert_offset%") BEGIN
     "tiled_offset"="%tiled_offset%"+"%info_ext%"
     WRITE_LONG  0xb8  "%tiled_offset%"
   END
   PATCH_IF ("%songs_offset%">="%vert_offset%") BEGIN
     "songs_offset"="%songs_offset%"+"%info_ext%"
     WRITE_LONG  0xbc  "%songs_offset%"
   END
   PATCH_IF ("%rest_spawns_offset%">="%vert_offset%") BEGIN
     "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%"
     WRITE_LONG  0xc0  "%rest_spawns_offset%"
   END
   PATCH_IF ("%automap_offset%">="%vert_offset%") BEGIN
     "automap_offset"="%automap_offset%"+"%info_ext%"
     WRITE_LONG  0xc4  "%automap_offset%"
   END
BUT_ONLY
END

//Add 12 new proximity triggers and 48 new vertices for those triggers to BH1400.ARE
COPY_EXISTING ~BH1400.ARE~  ~override~
 READ_LONG  0x54  "actors_offset"
 READ_SHORT 0x58  "actors_num"
 READ_SHORT 0x5a  "infotrig_num"
 READ_LONG  0x5c  "infotrig_offset"
 READ_LONG  0x60  "spawns_offset"
 READ_LONG  0x64  "spawns_num"
 READ_LONG  0x68  "entrances_offset"
 READ_LONG  0x6c  "entrances_num"
 READ_LONG  0x70  "cont_offset"
 READ_SHORT 0x74  "cont_num"
 READ_SHORT 0x76  "items_num"
 READ_LONG  0x78  "items_offset"
 READ_LONG  0x7c  "vert_offset"
 READ_SHORT 0x80  "vert_num"
 READ_SHORT 0x82  "amb_num"
 READ_LONG  0x84  "amb_offset"
 READ_LONG  0x88  "vars_offset"
 READ_LONG  0x8c  "vars_num"
 READ_LONG  0xa0  "expbmp_offset"
 READ_LONG  0xa4  "doors_num"
 READ_LONG  0xa8  "doors_offset"
 READ_LONG  0xac  "anim_num"
 READ_LONG  0xb0  "anim_offset"
 READ_LONG  0xb4  "tiled_num"
 READ_LONG  0xb8  "tiled_offset"
 READ_LONG  0xbc  "songs_offset"
 READ_LONG  0xc0  "rest_spawns_offset"
 READ_LONG  0xc4  "automap_offset"
 READ_LONG  0xc8  "automap_num"

 SET info_1=1
 FOR( cnt=0; cnt<"%infotrig_num%"; cnt=cnt+1 ) BEGIN  //info triggers loop
   READ_ASCII ("%infotrig_offset%"+0xc4*cnt)       "info_name"
   PATCH_IF (("%info_name%" STRING_COMPARE_CASE "BH140001")=0) BEGIN  //if already exists
     info_1=0
   END
 END

 PATCH_IF (info_1=1) BEGIN                //adding new info trigger  *******************************

//adding 12 new proximity triggers ************************************************
   SET offset = ("%infotrig_offset%"+0xc4*"%infotrig_num%")
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH140001~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 503             //bounding box left
   WRITE_SHORT (offset+0x24) 914             //bounding box top
   WRITE_SHORT (offset+0x26) 603             //bounding box right
   WRITE_SHORT (offset+0x28) 1014            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"    //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 553             //Trap location X
   WRITE_SHORT (offset+0x72) 964             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH140001~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH140002~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 2407             //bounding box left
   WRITE_SHORT (offset+0x24) 697             //bounding box top
   WRITE_SHORT (offset+0x26) 2507            //bounding box right
   WRITE_SHORT (offset+0x28) 797             //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+4  //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 2457            //Trap location X
   WRITE_SHORT (offset+0x72) 747             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH140002~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH140003~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 4018            //bounding box left
   WRITE_SHORT (offset+0x24) 1153            //bounding box top
   WRITE_SHORT (offset+0x26) 4118            //bounding box right
   WRITE_SHORT (offset+0x28) 1253            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+8  //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 4068            //Trap location X
   WRITE_SHORT (offset+0x72) 1203            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH140003~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH140004~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3862            //bounding box left
   WRITE_SHORT (offset+0x24) 2148            //bounding box top
   WRITE_SHORT (offset+0x26) 3962            //bounding box right
   WRITE_SHORT (offset+0x28) 2248            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+12 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3912            //Trap location X
   WRITE_SHORT (offset+0x72) 2198            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH140004~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH140005~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3985            //bounding box left
   WRITE_SHORT (offset+0x24) 3216            //bounding box top
   WRITE_SHORT (offset+0x26) 4085            //bounding box right
   WRITE_SHORT (offset+0x28) 3316            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+16 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 4035            //Trap location X
   WRITE_SHORT (offset+0x72) 3266            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH140005~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH140006~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 2116            //bounding box left
   WRITE_SHORT (offset+0x24) 2821            //bounding box top
   WRITE_SHORT (offset+0x26) 2216            //bounding box right
   WRITE_SHORT (offset+0x28) 2921            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+20 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 2166            //Trap location X
   WRITE_SHORT (offset+0x72) 2871            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH140006~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH140007~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 1830            //bounding box left
   WRITE_SHORT (offset+0x24) 2943            //bounding box top
   WRITE_SHORT (offset+0x26) 1930            //bounding box right
   WRITE_SHORT (offset+0x28) 3043            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+24 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 1880            //Trap location X
   WRITE_SHORT (offset+0x72) 2993            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH140007~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH140008~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 1502            //bounding box left
   WRITE_SHORT (offset+0x24) 3028            //bounding box top
   WRITE_SHORT (offset+0x26) 1602            //bounding box right
   WRITE_SHORT (offset+0x28) 3128            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+28 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 1552            //Trap location X
   WRITE_SHORT (offset+0x72) 3078            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH140008~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH140009~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3203            //bounding box left
   WRITE_SHORT (offset+0x24) 1941            //bounding box top
   WRITE_SHORT (offset+0x26) 3303            //bounding box right
   WRITE_SHORT (offset+0x28) 2041            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+32 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3253            //Trap location X
   WRITE_SHORT (offset+0x72) 1991            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH140009~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH140010~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 379             //bounding box left
   WRITE_SHORT (offset+0x24) 1416            //bounding box top
   WRITE_SHORT (offset+0x26) 479             //bounding box right
   WRITE_SHORT (offset+0x28) 1516            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+36 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 429             //Trap location X
   WRITE_SHORT (offset+0x72) 1466            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH140010~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH140011~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 509             //bounding box left
   WRITE_SHORT (offset+0x24) 3651            //bounding box top
   WRITE_SHORT (offset+0x26) 609             //bounding box right
   WRITE_SHORT (offset+0x28) 3751            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+40 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 559             //Trap location X
   WRITE_SHORT (offset+0x72) 3701            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH140011~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH140012~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 1614            //bounding box left
   WRITE_SHORT (offset+0x24) 1998            //bounding box top
   WRITE_SHORT (offset+0x26) 1714            //bounding box right
   WRITE_SHORT (offset+0x28) 2098            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+44 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 1664            //Trap location X
   WRITE_SHORT (offset+0x72) 2048            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH140012~      //Trap script

   SET "infotrig_num"="%infotrig_num%"+12
   WRITE_SHORT 0x5a  "%infotrig_num%"

   SET "info_ext"=0xc4*12
   PATCH_IF ("%actors_offset%">="%infotrig_offset%") BEGIN
     "actors_offset"="%actors_offset%"+"%info_ext%"
     WRITE_LONG  0x54 "%actors_offset%"
   END
   PATCH_IF ("%spawns_offset%">="%infotrig_offset%") BEGIN
     "spawns_offset"="%spawns_offset%"+"%info_ext%"
     WRITE_LONG  0x60  "%spawns_offset%"
   END
   PATCH_IF ("%entrances_offset%">="%infotrig_offset%") BEGIN
     "entrances_offset"="%entrances_offset%"+"%info_ext%"
     WRITE_LONG  0x68  "%entrances_offset%"
   END
   PATCH_IF ("%cont_offset%">="%infotrig_offset%") BEGIN
     "cont_offset"="%cont_offset%"+"%info_ext%"
     WRITE_LONG  0x70  "%cont_offset%"
   END
   PATCH_IF ("%items_offset%">="%infotrig_offset%") BEGIN
     "items_offset"="%items_offset%"+"%info_ext%"
     WRITE_LONG  0x78  "%items_offset%"
   END
   PATCH_IF ("%vert_offset%">="%infotrig_offset%") BEGIN
     "vert_offset"="%vert_offset%"+"%info_ext%"
     WRITE_LONG  0x7c  "%vert_offset%"
   END
   PATCH_IF ("%amb_offset%">="%infotrig_offset%") BEGIN
     "amb_offset"="%amb_offset%"+"%info_ext%"
     WRITE_LONG  0x84  "%amb_offset%"
   END
   PATCH_IF ("%vars_offset%">="%infotrig_offset%") BEGIN
     "vars_offset"="%vars_offset%"+"%info_ext%"
     WRITE_LONG  0x88  "%vars_offset%"
   END
   PATCH_IF ("%expbmp_offset%">="%infotrig_offset%") BEGIN
     "expbmp_offset"="%expbmp_offset%"+"%info_ext%"
     WRITE_LONG  0xa0  "%expbmp_offset%"
   END
   PATCH_IF ("%doors_offset%">="%infotrig_offset%") BEGIN
     "doors_offset"="%doors_offset%"+"%info_ext%"
     WRITE_LONG  0xa8  "%doors_offset%"
   END
   PATCH_IF ("%anim_offset%">="%infotrig_offset%") BEGIN
     "anim_offset"="%anim_offset%"+"%info_ext%"
     WRITE_LONG  0xb0  "%anim_offset%"
   END
   PATCH_IF ("%tiled_offset%">="%infotrig_offset%") BEGIN
     "tiled_offset"="%tiled_offset%"+"%info_ext%"
     WRITE_LONG  0xb8  "%tiled_offset%"
   END
   PATCH_IF ("%songs_offset%">="%infotrig_offset%") BEGIN
     "songs_offset"="%songs_offset%"+"%info_ext%"
     WRITE_LONG  0xbc  "%songs_offset%"
   END
   PATCH_IF ("%rest_spawns_offset%">="%infotrig_offset%") BEGIN
     "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%"
     WRITE_LONG  0xc0  "%rest_spawns_offset%"
   END
   PATCH_IF ("%automap_offset%">="%infotrig_offset%") BEGIN
     "automap_offset"="%automap_offset%"+"%info_ext%"
     WRITE_LONG  0xc4  "%automap_offset%"
   END

  //adding 48 new vertices for triggers
   SET offset = ("%vert_offset%"+0x04*"%vert_num%")
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      503
   WRITE_SHORT  (offset+2)  914
   WRITE_SHORT  (offset+4)  603
   WRITE_SHORT  (offset+6)  914
   WRITE_SHORT  (offset+8)  603
   WRITE_SHORT  (offset+10) 1014
   WRITE_SHORT  (offset+12) 503
   WRITE_SHORT  (offset+14) 1014
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      2407
   WRITE_SHORT  (offset+2)  697
   WRITE_SHORT  (offset+4)  2507
   WRITE_SHORT  (offset+6)  697
   WRITE_SHORT  (offset+8)  2507
   WRITE_SHORT  (offset+10) 797
   WRITE_SHORT  (offset+12) 2407
   WRITE_SHORT  (offset+14) 797
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      4018
   WRITE_SHORT  (offset+2)  1153
   WRITE_SHORT  (offset+4)  4118
   WRITE_SHORT  (offset+6)  1153
   WRITE_SHORT  (offset+8)  4118
   WRITE_SHORT  (offset+10) 1253
   WRITE_SHORT  (offset+12) 4018
   WRITE_SHORT  (offset+14) 1253
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3862
   WRITE_SHORT  (offset+2)  2148
   WRITE_SHORT  (offset+4)  3962
   WRITE_SHORT  (offset+6)  2148
   WRITE_SHORT  (offset+8)  3962
   WRITE_SHORT  (offset+10) 2248
   WRITE_SHORT  (offset+12) 3862
   WRITE_SHORT  (offset+14) 2248
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3985
   WRITE_SHORT  (offset+2)  3216
   WRITE_SHORT  (offset+4)  4085
   WRITE_SHORT  (offset+6)  3216
   WRITE_SHORT  (offset+8)  4085
   WRITE_SHORT  (offset+10) 3316
   WRITE_SHORT  (offset+12) 3985
   WRITE_SHORT  (offset+14) 3316
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      2116
   WRITE_SHORT  (offset+2)  2821
   WRITE_SHORT  (offset+4)  2216
   WRITE_SHORT  (offset+6)  2821
   WRITE_SHORT  (offset+8)  2216
   WRITE_SHORT  (offset+10) 2921
   WRITE_SHORT  (offset+12) 2116
   WRITE_SHORT  (offset+14) 2921
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      1830
   WRITE_SHORT  (offset+2)  2943
   WRITE_SHORT  (offset+4)  1930
   WRITE_SHORT  (offset+6)  2943
   WRITE_SHORT  (offset+8)  1930
   WRITE_SHORT  (offset+10) 3043
   WRITE_SHORT  (offset+12) 1830
   WRITE_SHORT  (offset+14) 3043
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      1502
   WRITE_SHORT  (offset+2)  3028
   WRITE_SHORT  (offset+4)  1602
   WRITE_SHORT  (offset+6)  3028
   WRITE_SHORT  (offset+8)  1602
   WRITE_SHORT  (offset+10) 3128
   WRITE_SHORT  (offset+12) 1502
   WRITE_SHORT  (offset+14) 3128
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3203
   WRITE_SHORT  (offset+2)  1941
   WRITE_SHORT  (offset+4)  3303
   WRITE_SHORT  (offset+6)  1941
   WRITE_SHORT  (offset+8)  3303
   WRITE_SHORT  (offset+10) 2041
   WRITE_SHORT  (offset+12) 3203
   WRITE_SHORT  (offset+14) 2041
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      379
   WRITE_SHORT  (offset+2)  1416
   WRITE_SHORT  (offset+4)  479
   WRITE_SHORT  (offset+6)  1416
   WRITE_SHORT  (offset+8)  479
   WRITE_SHORT  (offset+10) 1516
   WRITE_SHORT  (offset+12) 379
   WRITE_SHORT  (offset+14) 1516
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      509
   WRITE_SHORT  (offset+2)  3651
   WRITE_SHORT  (offset+4)  609
   WRITE_SHORT  (offset+6)  3651
   WRITE_SHORT  (offset+8)  609
   WRITE_SHORT  (offset+10) 3751
   WRITE_SHORT  (offset+12) 509
   WRITE_SHORT  (offset+14) 3751
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      1614
   WRITE_SHORT  (offset+2)  1998
   WRITE_SHORT  (offset+4)  1714
   WRITE_SHORT  (offset+6)  1998
   WRITE_SHORT  (offset+8)  1714
   WRITE_SHORT  (offset+10) 2098
   WRITE_SHORT  (offset+12) 1614
   WRITE_SHORT  (offset+14) 2098

   SET "vert_num"="%vert_num%"+48
   WRITE_SHORT 0x80  "%vert_num%"

   SET "info_ext"=0x04*48
   PATCH_IF ("%actors_offset%">="%vert_offset%") BEGIN
     "actors_offset"="%actors_offset%"+"%info_ext%"
     WRITE_LONG  0x54 "%actors_offset%"
   END
   PATCH_IF ("%spawns_offset%">="%vert_offset%") BEGIN
     "spawns_offset"="%spawns_offset%"+"%info_ext%"
     WRITE_LONG  0x60  "%spawns_offset%"
   END
   PATCH_IF ("%entrances_offset%">="%vert_offset%") BEGIN
     "entrances_offset"="%entrances_offset%"+"%info_ext%"
     WRITE_LONG  0x68  "%entrances_offset%"
   END
   PATCH_IF ("%cont_offset%">="%vert_offset%") BEGIN
     "cont_offset"="%cont_offset%"+"%info_ext%"
     WRITE_LONG  0x70  "%cont_offset%"
   END
   PATCH_IF ("%items_offset%">="%vert_offset%") BEGIN
     "items_offset"="%items_offset%"+"%info_ext%"
     WRITE_LONG  0x78  "%items_offset%"
   END
   PATCH_IF ("%infotrig_offset%">="%vert_offset%") BEGIN
     "infotrig_offset"="%infotrig_offset%"+"%info_ext%"
     WRITE_LONG  0x5c  "%infotrig_offset%"
   END
   PATCH_IF ("%amb_offset%">="%vert_offset%") BEGIN
     "amb_offset"="%amb_offset%"+"%info_ext%"
     WRITE_LONG  0x84  "%amb_offset%"
   END
   PATCH_IF ("%vars_offset%">="%vert_offset%") BEGIN
     "vars_offset"="%vars_offset%"+"%info_ext%"
     WRITE_LONG  0x88  "%vars_offset%"
   END
   PATCH_IF ("%expbmp_offset%">="%vert_offset%") BEGIN
     "expbmp_offset"="%expbmp_offset%"+"%info_ext%"
     WRITE_LONG  0xa0  "%expbmp_offset%"
   END
   PATCH_IF ("%doors_offset%">="%vert_offset%") BEGIN
     "doors_offset"="%doors_offset%"+"%info_ext%"
     WRITE_LONG  0xa8  "%doors_offset%"
   END
   PATCH_IF ("%anim_offset%">="%vert_offset%") BEGIN
     "anim_offset"="%anim_offset%"+"%info_ext%"
     WRITE_LONG  0xb0  "%anim_offset%"
   END
   PATCH_IF ("%tiled_offset%">="%vert_offset%") BEGIN
     "tiled_offset"="%tiled_offset%"+"%info_ext%"
     WRITE_LONG  0xb8  "%tiled_offset%"
   END
   PATCH_IF ("%songs_offset%">="%vert_offset%") BEGIN
     "songs_offset"="%songs_offset%"+"%info_ext%"
     WRITE_LONG  0xbc  "%songs_offset%"
   END
   PATCH_IF ("%rest_spawns_offset%">="%vert_offset%") BEGIN
     "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%"
     WRITE_LONG  0xc0  "%rest_spawns_offset%"
   END
   PATCH_IF ("%automap_offset%">="%vert_offset%") BEGIN
     "automap_offset"="%automap_offset%"+"%info_ext%"
     WRITE_LONG  0xc4  "%automap_offset%"
   END
BUT_ONLY
END

//Add 8 new proximity triggers and 32 new vertices for those triggers to BH2200.ARE
COPY_EXISTING ~BH2200.ARE~  ~override~
 READ_LONG  0x54  "actors_offset"
 READ_SHORT 0x58  "actors_num"
 READ_SHORT 0x5a  "infotrig_num"
 READ_LONG  0x5c  "infotrig_offset"
 READ_LONG  0x60  "spawns_offset"
 READ_LONG  0x64  "spawns_num"
 READ_LONG  0x68  "entrances_offset"
 READ_LONG  0x6c  "entrances_num"
 READ_LONG  0x70  "cont_offset"
 READ_SHORT 0x74  "cont_num"
 READ_SHORT 0x76  "items_num"
 READ_LONG  0x78  "items_offset"
 READ_LONG  0x7c  "vert_offset"
 READ_SHORT 0x80  "vert_num"
 READ_SHORT 0x82  "amb_num"
 READ_LONG  0x84  "amb_offset"
 READ_LONG  0x88  "vars_offset"
 READ_LONG  0x8c  "vars_num"
 READ_LONG  0xa0  "expbmp_offset"
 READ_LONG  0xa4  "doors_num"
 READ_LONG  0xa8  "doors_offset"
 READ_LONG  0xac  "anim_num"
 READ_LONG  0xb0  "anim_offset"
 READ_LONG  0xb4  "tiled_num"
 READ_LONG  0xb8  "tiled_offset"
 READ_LONG  0xbc  "songs_offset"
 READ_LONG  0xc0  "rest_spawns_offset"
 READ_LONG  0xc4  "automap_offset"
 READ_LONG  0xc8  "automap_num"

 SET info_1=1
 FOR( cnt=0; cnt<"%infotrig_num%"; cnt=cnt+1 ) BEGIN  //info triggers loop
   READ_ASCII ("%infotrig_offset%"+0xc4*cnt)       "info_name"
   PATCH_IF (("%info_name%" STRING_COMPARE_CASE "BH220001")=0) BEGIN  //if already exists
     info_1=0
   END
 END

 PATCH_IF (info_1=1) BEGIN                //adding new info trigger  *******************************

//adding 8 new proximity triggers ************************************************
   SET offset = ("%infotrig_offset%"+0xc4*"%infotrig_num%")
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH220001~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3980            //bounding box left
   WRITE_SHORT (offset+0x24) 575             //bounding box top
   WRITE_SHORT (offset+0x26) 4080            //bounding box right
   WRITE_SHORT (offset+0x28) 675            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"    //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 4030            //Trap location X
   WRITE_SHORT (offset+0x72) 625             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH220001~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH220002~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3908            //bounding box left
   WRITE_SHORT (offset+0x24) 733             //bounding box top
   WRITE_SHORT (offset+0x26) 4008            //bounding box right
   WRITE_SHORT (offset+0x28) 833             //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+4  //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3958            //Trap location X
   WRITE_SHORT (offset+0x72) 783             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH220002~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH220003~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 4239            //bounding box left
   WRITE_SHORT (offset+0x24) 483             //bounding box top
   WRITE_SHORT (offset+0x26) 4339            //bounding box right
   WRITE_SHORT (offset+0x28) 583            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+8  //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 4289            //Trap location X
   WRITE_SHORT (offset+0x72) 533             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH220003~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH220004~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3939            //bounding box left
   WRITE_SHORT (offset+0x24) 1474            //bounding box top
   WRITE_SHORT (offset+0x26) 4039            //bounding box right
   WRITE_SHORT (offset+0x28) 1574            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+12 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3989            //Trap location X
   WRITE_SHORT (offset+0x72) 1524            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH220004~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH220005~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 4196            //bounding box left
   WRITE_SHORT (offset+0x24) 2513            //bounding box top
   WRITE_SHORT (offset+0x26) 4296            //bounding box right
   WRITE_SHORT (offset+0x28) 2613            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+16 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 4246            //Trap location X
   WRITE_SHORT (offset+0x72) 2563            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH220005~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH220006~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 2579            //bounding box left
   WRITE_SHORT (offset+0x24) 2331            //bounding box top
   WRITE_SHORT (offset+0x26) 2679            //bounding box right
   WRITE_SHORT (offset+0x28) 2431            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+20 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 2629            //Trap location X
   WRITE_SHORT (offset+0x72) 2381            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH220006~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH220007~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 94              //bounding box left
   WRITE_SHORT (offset+0x24) 2095            //bounding box top
   WRITE_SHORT (offset+0x26) 194             //bounding box right
   WRITE_SHORT (offset+0x28) 2195            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+24 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 144             //Trap location X
   WRITE_SHORT (offset+0x72) 2145            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH220007~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH220008~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 1812            //bounding box left
   WRITE_SHORT (offset+0x24) 965             //bounding box top
   WRITE_SHORT (offset+0x26) 1912            //bounding box right
   WRITE_SHORT (offset+0x28) 1065            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+28 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 1862            //Trap location X
   WRITE_SHORT (offset+0x72) 1015            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH220008~      //Trap script

   SET "infotrig_num"="%infotrig_num%"+8
   WRITE_SHORT 0x5a  "%infotrig_num%"

   SET "info_ext"=0xc4*8
   PATCH_IF ("%actors_offset%">="%infotrig_offset%") BEGIN
     "actors_offset"="%actors_offset%"+"%info_ext%"
     WRITE_LONG  0x54 "%actors_offset%"
   END
   PATCH_IF ("%spawns_offset%">="%infotrig_offset%") BEGIN
     "spawns_offset"="%spawns_offset%"+"%info_ext%"
     WRITE_LONG  0x60  "%spawns_offset%"
   END
   PATCH_IF ("%entrances_offset%">="%infotrig_offset%") BEGIN
     "entrances_offset"="%entrances_offset%"+"%info_ext%"
     WRITE_LONG  0x68  "%entrances_offset%"
   END
   PATCH_IF ("%cont_offset%">="%infotrig_offset%") BEGIN
     "cont_offset"="%cont_offset%"+"%info_ext%"
     WRITE_LONG  0x70  "%cont_offset%"
   END
   PATCH_IF ("%items_offset%">="%infotrig_offset%") BEGIN
     "items_offset"="%items_offset%"+"%info_ext%"
     WRITE_LONG  0x78  "%items_offset%"
   END
   PATCH_IF ("%vert_offset%">="%infotrig_offset%") BEGIN
     "vert_offset"="%vert_offset%"+"%info_ext%"
     WRITE_LONG  0x7c  "%vert_offset%"
   END
   PATCH_IF ("%amb_offset%">="%infotrig_offset%") BEGIN
     "amb_offset"="%amb_offset%"+"%info_ext%"
     WRITE_LONG  0x84  "%amb_offset%"
   END
   PATCH_IF ("%vars_offset%">="%infotrig_offset%") BEGIN
     "vars_offset"="%vars_offset%"+"%info_ext%"
     WRITE_LONG  0x88  "%vars_offset%"
   END
   PATCH_IF ("%expbmp_offset%">="%infotrig_offset%") BEGIN
     "expbmp_offset"="%expbmp_offset%"+"%info_ext%"
     WRITE_LONG  0xa0  "%expbmp_offset%"
   END
   PATCH_IF ("%doors_offset%">="%infotrig_offset%") BEGIN
     "doors_offset"="%doors_offset%"+"%info_ext%"
     WRITE_LONG  0xa8  "%doors_offset%"
   END
   PATCH_IF ("%anim_offset%">="%infotrig_offset%") BEGIN
     "anim_offset"="%anim_offset%"+"%info_ext%"
     WRITE_LONG  0xb0  "%anim_offset%"
   END
   PATCH_IF ("%tiled_offset%">="%infotrig_offset%") BEGIN
     "tiled_offset"="%tiled_offset%"+"%info_ext%"
     WRITE_LONG  0xb8  "%tiled_offset%"
   END
   PATCH_IF ("%songs_offset%">="%infotrig_offset%") BEGIN
     "songs_offset"="%songs_offset%"+"%info_ext%"
     WRITE_LONG  0xbc  "%songs_offset%"
   END
   PATCH_IF ("%rest_spawns_offset%">="%infotrig_offset%") BEGIN
     "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%"
     WRITE_LONG  0xc0  "%rest_spawns_offset%"
   END
   PATCH_IF ("%automap_offset%">="%infotrig_offset%") BEGIN
     "automap_offset"="%automap_offset%"+"%info_ext%"
     WRITE_LONG  0xc4  "%automap_offset%"
   END

  //adding 32 new vertices for triggers
   SET offset = ("%vert_offset%"+0x04*"%vert_num%")
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3980
   WRITE_SHORT  (offset+2)  575
   WRITE_SHORT  (offset+4)  4080
   WRITE_SHORT  (offset+6)  575
   WRITE_SHORT  (offset+8)  4080
   WRITE_SHORT  (offset+10) 675
   WRITE_SHORT  (offset+12) 3980
   WRITE_SHORT  (offset+14) 675
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3908
   WRITE_SHORT  (offset+2)  733
   WRITE_SHORT  (offset+4)  4008
   WRITE_SHORT  (offset+6)  733
   WRITE_SHORT  (offset+8)  4008
   WRITE_SHORT  (offset+10) 833
   WRITE_SHORT  (offset+12) 3908
   WRITE_SHORT  (offset+14) 833
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      4239
   WRITE_SHORT  (offset+2)  483
   WRITE_SHORT  (offset+4)  4339
   WRITE_SHORT  (offset+6)  483
   WRITE_SHORT  (offset+8)  4339
   WRITE_SHORT  (offset+10) 583
   WRITE_SHORT  (offset+12) 4239
   WRITE_SHORT  (offset+14) 583
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3939
   WRITE_SHORT  (offset+2)  1474
   WRITE_SHORT  (offset+4)  4039
   WRITE_SHORT  (offset+6)  1474
   WRITE_SHORT  (offset+8)  4039
   WRITE_SHORT  (offset+10) 1574
   WRITE_SHORT  (offset+12) 3939
   WRITE_SHORT  (offset+14) 1574
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      4196
   WRITE_SHORT  (offset+2)  2513
   WRITE_SHORT  (offset+4)  4296
   WRITE_SHORT  (offset+6)  2513
   WRITE_SHORT  (offset+8)  4296
   WRITE_SHORT  (offset+10) 2613
   WRITE_SHORT  (offset+12) 4196
   WRITE_SHORT  (offset+14) 2613
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      2579
   WRITE_SHORT  (offset+2)  2331
   WRITE_SHORT  (offset+4)  2679
   WRITE_SHORT  (offset+6)  2331
   WRITE_SHORT  (offset+8)  2679
   WRITE_SHORT  (offset+10) 2431
   WRITE_SHORT  (offset+12) 2579
   WRITE_SHORT  (offset+14) 2431
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      94
   WRITE_SHORT  (offset+2)  2095
   WRITE_SHORT  (offset+4)  194
   WRITE_SHORT  (offset+6)  2095
   WRITE_SHORT  (offset+8)  194
   WRITE_SHORT  (offset+10) 2195
   WRITE_SHORT  (offset+12) 94
   WRITE_SHORT  (offset+14) 2195
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      1812
   WRITE_SHORT  (offset+2)  965
   WRITE_SHORT  (offset+4)  1912
   WRITE_SHORT  (offset+6)  965
   WRITE_SHORT  (offset+8)  1912
   WRITE_SHORT  (offset+10) 1065
   WRITE_SHORT  (offset+12) 1812
   WRITE_SHORT  (offset+14) 1065

   SET "vert_num"="%vert_num%"+32
   WRITE_SHORT 0x80  "%vert_num%"

   SET "info_ext"=0x04*32
   PATCH_IF ("%actors_offset%">="%vert_offset%") BEGIN
     "actors_offset"="%actors_offset%"+"%info_ext%"
     WRITE_LONG  0x54 "%actors_offset%"
   END
   PATCH_IF ("%spawns_offset%">="%vert_offset%") BEGIN
     "spawns_offset"="%spawns_offset%"+"%info_ext%"
     WRITE_LONG  0x60  "%spawns_offset%"
   END
   PATCH_IF ("%entrances_offset%">="%vert_offset%") BEGIN
     "entrances_offset"="%entrances_offset%"+"%info_ext%"
     WRITE_LONG  0x68  "%entrances_offset%"
   END
   PATCH_IF ("%cont_offset%">="%vert_offset%") BEGIN
     "cont_offset"="%cont_offset%"+"%info_ext%"
     WRITE_LONG  0x70  "%cont_offset%"
   END
   PATCH_IF ("%items_offset%">="%vert_offset%") BEGIN
     "items_offset"="%items_offset%"+"%info_ext%"
     WRITE_LONG  0x78  "%items_offset%"
   END
   PATCH_IF ("%infotrig_offset%">="%vert_offset%") BEGIN
     "infotrig_offset"="%infotrig_offset%"+"%info_ext%"
     WRITE_LONG  0x5c  "%infotrig_offset%"
   END
   PATCH_IF ("%amb_offset%">="%vert_offset%") BEGIN
     "amb_offset"="%amb_offset%"+"%info_ext%"
     WRITE_LONG  0x84  "%amb_offset%"
   END
   PATCH_IF ("%vars_offset%">="%vert_offset%") BEGIN
     "vars_offset"="%vars_offset%"+"%info_ext%"
     WRITE_LONG  0x88  "%vars_offset%"
   END
   PATCH_IF ("%expbmp_offset%">="%vert_offset%") BEGIN
     "expbmp_offset"="%expbmp_offset%"+"%info_ext%"
     WRITE_LONG  0xa0  "%expbmp_offset%"
   END
   PATCH_IF ("%doors_offset%">="%vert_offset%") BEGIN
     "doors_offset"="%doors_offset%"+"%info_ext%"
     WRITE_LONG  0xa8  "%doors_offset%"
   END
   PATCH_IF ("%anim_offset%">="%vert_offset%") BEGIN
     "anim_offset"="%anim_offset%"+"%info_ext%"
     WRITE_LONG  0xb0  "%anim_offset%"
   END
   PATCH_IF ("%tiled_offset%">="%vert_offset%") BEGIN
     "tiled_offset"="%tiled_offset%"+"%info_ext%"
     WRITE_LONG  0xb8  "%tiled_offset%"
   END
   PATCH_IF ("%songs_offset%">="%vert_offset%") BEGIN
     "songs_offset"="%songs_offset%"+"%info_ext%"
     WRITE_LONG  0xbc  "%songs_offset%"
   END
   PATCH_IF ("%rest_spawns_offset%">="%vert_offset%") BEGIN
     "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%"
     WRITE_LONG  0xc0  "%rest_spawns_offset%"
   END
   PATCH_IF ("%automap_offset%">="%vert_offset%") BEGIN
     "automap_offset"="%automap_offset%"+"%info_ext%"
     WRITE_LONG  0xc4  "%automap_offset%"
   END
BUT_ONLY
END

//Add 8 new proximity triggers and 32 new vertices for those triggers to BH2300.ARE
COPY_EXISTING ~BH2300.ARE~  ~override~
 READ_LONG  0x54  "actors_offset"
 READ_SHORT 0x58  "actors_num"
 READ_SHORT 0x5a  "infotrig_num"
 READ_LONG  0x5c  "infotrig_offset"
 READ_LONG  0x60  "spawns_offset"
 READ_LONG  0x64  "spawns_num"
 READ_LONG  0x68  "entrances_offset"
 READ_LONG  0x6c  "entrances_num"
 READ_LONG  0x70  "cont_offset"
 READ_SHORT 0x74  "cont_num"
 READ_SHORT 0x76  "items_num"
 READ_LONG  0x78  "items_offset"
 READ_LONG  0x7c  "vert_offset"
 READ_SHORT 0x80  "vert_num"
 READ_SHORT 0x82  "amb_num"
 READ_LONG  0x84  "amb_offset"
 READ_LONG  0x88  "vars_offset"
 READ_LONG  0x8c  "vars_num"
 READ_LONG  0xa0  "expbmp_offset"
 READ_LONG  0xa4  "doors_num"
 READ_LONG  0xa8  "doors_offset"
 READ_LONG  0xac  "anim_num"
 READ_LONG  0xb0  "anim_offset"
 READ_LONG  0xb4  "tiled_num"
 READ_LONG  0xb8  "tiled_offset"
 READ_LONG  0xbc  "songs_offset"
 READ_LONG  0xc0  "rest_spawns_offset"
 READ_LONG  0xc4  "automap_offset"
 READ_LONG  0xc8  "automap_num"

 SET info_1=1
 FOR( cnt=0; cnt<"%infotrig_num%"; cnt=cnt+1 ) BEGIN  //info triggers loop
   READ_ASCII ("%infotrig_offset%"+0xc4*cnt)       "info_name"
   PATCH_IF (("%info_name%" STRING_COMPARE_CASE "BH230001")=0) BEGIN  //if already exists
     info_1=0
   END
 END

 PATCH_IF (info_1=1) BEGIN                //adding new info trigger  *******************************

//adding 8 new proximity triggers ************************************************
   SET offset = ("%infotrig_offset%"+0xc4*"%infotrig_num%")
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH230001~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 733             //bounding box left
   WRITE_SHORT (offset+0x24) 459             //bounding box top
   WRITE_SHORT (offset+0x26) 833             //bounding box right
   WRITE_SHORT (offset+0x28) 559             //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"    //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 783             //Trap location X
   WRITE_SHORT (offset+0x72) 509             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH230001~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH230002~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 1785            //bounding box left
   WRITE_SHORT (offset+0x24) 376             //bounding box top
   WRITE_SHORT (offset+0x26) 1885            //bounding box right
   WRITE_SHORT (offset+0x28) 476             //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+4  //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 1835            //Trap location X
   WRITE_SHORT (offset+0x72) 426             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH230002~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH230003~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 4809            //bounding box left
   WRITE_SHORT (offset+0x24) 812             //bounding box top
   WRITE_SHORT (offset+0x26) 4909            //bounding box right
   WRITE_SHORT (offset+0x28) 912             //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+8  //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 4859            //Trap location X
   WRITE_SHORT (offset+0x72) 862             //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH230003~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH230004~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 4366            //bounding box left
   WRITE_SHORT (offset+0x24) 1678            //bounding box top
   WRITE_SHORT (offset+0x26) 4466            //bounding box right
   WRITE_SHORT (offset+0x28) 1778            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+12 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 4416            //Trap location X
   WRITE_SHORT (offset+0x72) 1728            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH230004~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH230005~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 4518            //bounding box left
   WRITE_SHORT (offset+0x24) 3097            //bounding box top
   WRITE_SHORT (offset+0x26) 4618            //bounding box right
   WRITE_SHORT (offset+0x28) 3197            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+16 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 4568            //Trap location X
   WRITE_SHORT (offset+0x72) 3147            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH230005~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH230006~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 839             //bounding box left
   WRITE_SHORT (offset+0x24) 3098            //bounding box top
   WRITE_SHORT (offset+0x26) 939             //bounding box right
   WRITE_SHORT (offset+0x28) 3198            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+20 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 889             //Trap location X
   WRITE_SHORT (offset+0x72) 3148            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH230006~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH230007~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 831             //bounding box left
   WRITE_SHORT (offset+0x24) 2014            //bounding box top
   WRITE_SHORT (offset+0x26) 931             //bounding box right
   WRITE_SHORT (offset+0x28) 2114            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+24 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 881             //Trap location X
   WRITE_SHORT (offset+0x72) 2064            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH230007~      //Trap script
   SET offset = offset+0xc4
   INSERT_BYTES offset 0xc4
   WRITE_ASCII offset ~BH230008~
   WRITE_SHORT (offset+0x20) 0               //trigger 0=Prox, 1=Info, 2=Trav
   WRITE_SHORT (offset+0x22) 3530            //bounding box left
   WRITE_SHORT (offset+0x24) 1484            //bounding box top
   WRITE_SHORT (offset+0x26) 3630            //bounding box right
   WRITE_SHORT (offset+0x28) 1584            //bounding box bottom
   WRITE_SHORT (offset+0x2a) 4               //vertices number
   WRITE_LONG  (offset+0x2c) "%vert_num%"+28 //first vertex index
   WRITE_LONG  (offset+0x34) 0               //cursor frame number
   WRITE_LONG  (offset+0x60) 2               //flags
   WRITE_SHORT (offset+0x6c) 1               //Yup, it's trapped alrighty
   WRITE_SHORT (offset+0x6e) 0               //And not detected
   WRITE_SHORT (offset+0x70) 3580            //Trap location X
   WRITE_SHORT (offset+0x72) 1534            //Trap location Y
   WRITE_ASCII (offset+0x7c) ~BH230008~      //Trap script

   SET "infotrig_num"="%infotrig_num%"+8
   WRITE_SHORT 0x5a  "%infotrig_num%"

   SET "info_ext"=0xc4*8
   PATCH_IF ("%actors_offset%">="%infotrig_offset%") BEGIN
     "actors_offset"="%actors_offset%"+"%info_ext%"
     WRITE_LONG  0x54 "%actors_offset%"
   END
   PATCH_IF ("%spawns_offset%">="%infotrig_offset%") BEGIN
     "spawns_offset"="%spawns_offset%"+"%info_ext%"
     WRITE_LONG  0x60  "%spawns_offset%"
   END
   PATCH_IF ("%entrances_offset%">="%infotrig_offset%") BEGIN
     "entrances_offset"="%entrances_offset%"+"%info_ext%"
     WRITE_LONG  0x68  "%entrances_offset%"
   END
   PATCH_IF ("%cont_offset%">="%infotrig_offset%") BEGIN
     "cont_offset"="%cont_offset%"+"%info_ext%"
     WRITE_LONG  0x70  "%cont_offset%"
   END
   PATCH_IF ("%items_offset%">="%infotrig_offset%") BEGIN
     "items_offset"="%items_offset%"+"%info_ext%"
     WRITE_LONG  0x78  "%items_offset%"
   END
   PATCH_IF ("%vert_offset%">="%infotrig_offset%") BEGIN
     "vert_offset"="%vert_offset%"+"%info_ext%"
     WRITE_LONG  0x7c  "%vert_offset%"
   END
   PATCH_IF ("%amb_offset%">="%infotrig_offset%") BEGIN
     "amb_offset"="%amb_offset%"+"%info_ext%"
     WRITE_LONG  0x84  "%amb_offset%"
   END
   PATCH_IF ("%vars_offset%">="%infotrig_offset%") BEGIN
     "vars_offset"="%vars_offset%"+"%info_ext%"
     WRITE_LONG  0x88  "%vars_offset%"
   END
   PATCH_IF ("%expbmp_offset%">="%infotrig_offset%") BEGIN
     "expbmp_offset"="%expbmp_offset%"+"%info_ext%"
     WRITE_LONG  0xa0  "%expbmp_offset%"
   END
   PATCH_IF ("%doors_offset%">="%infotrig_offset%") BEGIN
     "doors_offset"="%doors_offset%"+"%info_ext%"
     WRITE_LONG  0xa8  "%doors_offset%"
   END
   PATCH_IF ("%anim_offset%">="%infotrig_offset%") BEGIN
     "anim_offset"="%anim_offset%"+"%info_ext%"
     WRITE_LONG  0xb0  "%anim_offset%"
   END
   PATCH_IF ("%tiled_offset%">="%infotrig_offset%") BEGIN
     "tiled_offset"="%tiled_offset%"+"%info_ext%"
     WRITE_LONG  0xb8  "%tiled_offset%"
   END
   PATCH_IF ("%songs_offset%">="%infotrig_offset%") BEGIN
     "songs_offset"="%songs_offset%"+"%info_ext%"
     WRITE_LONG  0xbc  "%songs_offset%"
   END
   PATCH_IF ("%rest_spawns_offset%">="%infotrig_offset%") BEGIN
     "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%"
     WRITE_LONG  0xc0  "%rest_spawns_offset%"
   END
   PATCH_IF ("%automap_offset%">="%infotrig_offset%") BEGIN
     "automap_offset"="%automap_offset%"+"%info_ext%"
     WRITE_LONG  0xc4  "%automap_offset%"
   END

  //adding 32 new vertices for triggers
   SET offset = ("%vert_offset%"+0x04*"%vert_num%")
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      753
   WRITE_SHORT  (offset+2)  459
   WRITE_SHORT  (offset+4)  853
   WRITE_SHORT  (offset+6)  459
   WRITE_SHORT  (offset+8)  853
   WRITE_SHORT  (offset+10) 559
   WRITE_SHORT  (offset+12) 753
   WRITE_SHORT  (offset+14) 559
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      1785
   WRITE_SHORT  (offset+2)  376
   WRITE_SHORT  (offset+4)  1885
   WRITE_SHORT  (offset+6)  376
   WRITE_SHORT  (offset+8)  1885
   WRITE_SHORT  (offset+10) 476
   WRITE_SHORT  (offset+12) 1785
   WRITE_SHORT  (offset+14) 476
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      4809
   WRITE_SHORT  (offset+2)  812
   WRITE_SHORT  (offset+4)  4909
   WRITE_SHORT  (offset+6)  812
   WRITE_SHORT  (offset+8)  4909
   WRITE_SHORT  (offset+10) 912
   WRITE_SHORT  (offset+12) 4809
   WRITE_SHORT  (offset+14) 912
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      4366
   WRITE_SHORT  (offset+2)  1678
   WRITE_SHORT  (offset+4)  4466
   WRITE_SHORT  (offset+6)  1678
   WRITE_SHORT  (offset+8)  4466
   WRITE_SHORT  (offset+10) 1778
   WRITE_SHORT  (offset+12) 4366
   WRITE_SHORT  (offset+14) 1778
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      4518
   WRITE_SHORT  (offset+2)  3097
   WRITE_SHORT  (offset+4)  4618
   WRITE_SHORT  (offset+6)  3097
   WRITE_SHORT  (offset+8)  4618
   WRITE_SHORT  (offset+10) 3197
   WRITE_SHORT  (offset+12) 4518
   WRITE_SHORT  (offset+14) 3197
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      839
   WRITE_SHORT  (offset+2)  3098
   WRITE_SHORT  (offset+4)  939
   WRITE_SHORT  (offset+6)  3098
   WRITE_SHORT  (offset+8)  939
   WRITE_SHORT  (offset+10) 3198
   WRITE_SHORT  (offset+12) 839
   WRITE_SHORT  (offset+14) 3198
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      831
   WRITE_SHORT  (offset+2)  2014
   WRITE_SHORT  (offset+4)  931
   WRITE_SHORT  (offset+6)  2014
   WRITE_SHORT  (offset+8)  931
   WRITE_SHORT  (offset+10) 2114
   WRITE_SHORT  (offset+12) 831
   WRITE_SHORT  (offset+14) 2114
   SET offset = offset + 4*4
   INSERT_BYTES offset (0x04*4)
   WRITE_SHORT  offset      3530
   WRITE_SHORT  (offset+2)  1484
   WRITE_SHORT  (offset+4)  3630
   WRITE_SHORT  (offset+6)  1484
   WRITE_SHORT  (offset+8)  3630
   WRITE_SHORT  (offset+10) 1584
   WRITE_SHORT  (offset+12) 3530
   WRITE_SHORT  (offset+14) 1584

   SET "vert_num"="%vert_num%"+32
   WRITE_SHORT 0x80  "%vert_num%"

   SET "info_ext"=0x04*32
   PATCH_IF ("%actors_offset%">="%vert_offset%") BEGIN
     "actors_offset"="%actors_offset%"+"%info_ext%"
     WRITE_LONG  0x54 "%actors_offset%"
   END
   PATCH_IF ("%spawns_offset%">="%vert_offset%") BEGIN
     "spawns_offset"="%spawns_offset%"+"%info_ext%"
     WRITE_LONG  0x60  "%spawns_offset%"
   END
   PATCH_IF ("%entrances_offset%">="%vert_offset%") BEGIN
     "entrances_offset"="%entrances_offset%"+"%info_ext%"
     WRITE_LONG  0x68  "%entrances_offset%"
   END
   PATCH_IF ("%cont_offset%">="%vert_offset%") BEGIN
     "cont_offset"="%cont_offset%"+"%info_ext%"
     WRITE_LONG  0x70  "%cont_offset%"
   END
   PATCH_IF ("%items_offset%">="%vert_offset%") BEGIN
     "items_offset"="%items_offset%"+"%info_ext%"
     WRITE_LONG  0x78  "%items_offset%"
   END
   PATCH_IF ("%infotrig_offset%">="%vert_offset%") BEGIN
     "infotrig_offset"="%infotrig_offset%"+"%info_ext%"
     WRITE_LONG  0x5c  "%infotrig_offset%"
   END
   PATCH_IF ("%amb_offset%">="%vert_offset%") BEGIN
     "amb_offset"="%amb_offset%"+"%info_ext%"
     WRITE_LONG  0x84  "%amb_offset%"
   END
   PATCH_IF ("%vars_offset%">="%vert_offset%") BEGIN
     "vars_offset"="%vars_offset%"+"%info_ext%"
     WRITE_LONG  0x88  "%vars_offset%"
   END
   PATCH_IF ("%expbmp_offset%">="%vert_offset%") BEGIN
     "expbmp_offset"="%expbmp_offset%"+"%info_ext%"
     WRITE_LONG  0xa0  "%expbmp_offset%"
   END
   PATCH_IF ("%doors_offset%">="%vert_offset%") BEGIN
     "doors_offset"="%doors_offset%"+"%info_ext%"
     WRITE_LONG  0xa8  "%doors_offset%"
   END
   PATCH_IF ("%anim_offset%">="%vert_offset%") BEGIN
     "anim_offset"="%anim_offset%"+"%info_ext%"
     WRITE_LONG  0xb0  "%anim_offset%"
   END
   PATCH_IF ("%tiled_offset%">="%vert_offset%") BEGIN
     "tiled_offset"="%tiled_offset%"+"%info_ext%"
     WRITE_LONG  0xb8  "%tiled_offset%"
   END
   PATCH_IF ("%songs_offset%">="%vert_offset%") BEGIN
     "songs_offset"="%songs_offset%"+"%info_ext%"
     WRITE_LONG  0xbc  "%songs_offset%"
   END
   PATCH_IF ("%rest_spawns_offset%">="%vert_offset%") BEGIN
     "rest_spawns_offset"="%rest_spawns_offset%"+"%info_ext%"
     WRITE_LONG  0xc0  "%rest_spawns_offset%"
   END
   PATCH_IF ("%automap_offset%">="%vert_offset%") BEGIN
     "automap_offset"="%automap_offset%"+"%info_ext%"
     WRITE_LONG  0xc4  "%automap_offset%"
   END
BUT_ONLY
END

