ZVSE
ERMS_ScriptDate=15.8(August).2004
_WARNING_#1=IMPORTANT! This file is not in a plain text format. NEVER use any editor except ERM_S for making any kind of changes!
ERMS_PoweredBy=ERM Scripter v. 2004.6.29.918
*Made by Jonas Gustafsson. Email me at jonas@byteware.de
*This is a script to change the orginal Battlefields in the game
*Put all ***.pcx files in DATA folder
*The script is made by Donald X, Robert Bergerfjll and Timothy Pulver
*The file hosting by Dieter Averbeck
*Many thanks to you guys!
*Battlefield pictures are made by Dutch, Robert Bergerfjll and Jonas Gustafsson.

* Updated: August 15, 2004

** Variables used: v1 plus local variables only
** Function used: FU62

!?BA0&1000; [do this code when a battle starts but not for AI-only battles]
!!FU62:P;

!?BA50&1000; [for defender in MP battle]
!!FU62:P;

!?FU62;
!!UN:P68/?y-1; [check if script is enabled]
!!BA:Q?y-5; [state of Quick Combat: y-5=1 if it's a Quick Combat battle]
!!BA&y-5=0:B-1; [enable default battlefield if battle isn't a Quick Combat]
!!FU|y-1<>1/y-5=1:E; [exit if script isn't enabled or if battle is a Quick Combat]
!!BA:P?v1/?v2/?v3; [get x/y/level of battle in v1-v3]
!!TR1:T?y-2/d/d/d/d/d/d/d;  [get terrain, rivers, roads]
!!TR1:G?y-3; [check for special terrain: y-3]
!!VRy-4:S0 R2; [random number, 0 to 2]
!!FU&y-4=2:E; [Exit trigger if y-4=2 and use default picture]

!!IF:V1/0; [Initialize Flag 1 to False]
!!UN&y-2=0/y-4=0:J8/5/^dirt1.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-2=0/y-4=1:J8/5/^dirt2.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-2=1/y-4=0:J8/5/^sand1.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-2=1/y-4=1:J8/5/^sand2.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-2=2/y-4=0:J8/5/^grass1.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-2=2/y-4=1:J8/5/^grass2.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-2=3/y-4=0:J8/5/^snow1.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-2=3/y-4=1:J8/5/^snow2.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-2=4/y-4=0:J8/5/^swamp1.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-2=4/y-4=1:J8/5/^swamp2.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-2=5/y-4=0:J8/5/^rough1.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-2=5/y-4=1:J8/5/^rough2.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-2=6/y-4=0:J8/5/^subt1.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-2=6/y-4=1:J8/5/^subt2.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-2=7/y-4=0:J8/5/^lava1.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-2=7/y-4=1:J8/5/^lava2.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-3=046/y-4=0:J8/5/^magic.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-3=226/y-4=0:J8/5/^fiery.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-3=231/y-4=0:J8/5/^rockl.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-3=229/y-4=0:J8/5/^air.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-3=228/y-4=0:J8/5/^lucid.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-3=227/y-4=0:J8/5/^holy.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-3=222/y-4=0:J8/5/^clover.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-3=224/y-4=0:J8/5/^evil.pcx^; [Check if file is present: Flag 1=0 if file missing]
!!UN&y-3=021/y-4=0:J8/5/^cursed.pcx^; [Check if file is present: Flag 1=0 if file missing]

!!BA&y-2=0/y-4=0/1:B^s\dirt1.pcx^; [if dirt, use your dirt1.pcx file half the time]
!!BA&y-2=0/y-4=1/1:B^s\dirt2.pcx^; [your other dirt picture, the other half of the time]
!!BA&y-2=1/y-4=0/1:B^s\sand1.pcx^; [and so on]
!!BA&y-2=1/y-4=1/1:B^s\sand2.pcx^;
!!BA&y-2=2/y-4=0/1:B^s\grass1.pcx^;
!!BA&y-2=2/y-4=1/1:B^s\grass2.pcx^;
!!BA&y-2=3/y-4=0/1:B^s\snow1.pcx^;
!!BA&y-2=3/y-4=1/1:B^s\snow2.pcx^;
!!BA&y-2=4/y-4=0/1:B^s\swamp1.pcx^;
!!BA&y-2=4/y-4=1/1:B^s\swamp2.pcx^;
!!BA&y-2=5/y-4=0/1:B^s\rough1.pcx^;
!!BA&y-2=5/y-4=1/1:B^s\rough2.pcx^;
!!BA&y-2=6/y-4=0/1:B^s\subt1.pcx^;
!!BA&y-2=6/y-4=1/1:B^s\subt2.pcx^;
!!BA&y-2=7/y-4=0/1:B^s\lava1.pcx^;
!!BA&y-2=7/y-4=1/1:B^s\lava2.pcx^;
!!BA&y-3=046/1:B^s\magic.pcx^; 
!!BA&y-3=226/1:B^s\fiery.pcx^;  
!!BA&y-3=231/1:B^s\rockl.pcx^; 
!!BA&y-3=229/1:B^s\air.pcx^;   
!!BA&y-3=228/1:B^s\lucid.pcx^; 
!!BA&y-3=227/1:B^s\holy.pcx^;   
!!BA&y-3=222/1:B^s\clover.pcx^;  
!!BA&y-3=224/1:B^s\evil.pcx^;    
!!BA&y-3=021/1:B^s\cursed.pcx^;

