================================================================================
Definition of Exile Scenario File

One time only
Struct100 - Scenario Data Area - 81142 bytes
Strings100 - Scenario Text Strings - variable length

Repeating; row order, e.g. x0y0, x0y1, x0y2, x1y0, x1y1, x1y2, etc.
Struct200 - Outdoor Data Area  - 4146 bytes
Strings200 - Outdoor Text Strings - variable length

Repeating
Struct300 - Town Data Area - Sm - 5446 bytes, Md - 7106 bytes, Lg - 9562 bytes
Strings300 - Town Text Strings - variable length
Struct400 - Town Dialog Data Area - 1400 bytes
Strings400 -Town Dialog Strings - variable length

Struct100 - Scenario Data Area

0x00000000	0	Integer			Signature1 ; PC-10260 ; MAC-5130
0x00000002	2	Integer			Signature2 ; PC-20540 ; MAC-10270
0x00000004	4	Byte (0-2)		Version
0x00000007	7	Byte (0-4)		Filler
0x0000000b	11	Byte			Number of towns
0x0000000c	12	Byte			Outdoors Width
0x0000000d	13	Byte			Outdoors Height
0x0000000e	14	Byte			Difficulty
0x0000000f	15	Byte			Scenario Icon
0x00000010	16	Byte			Filler
0x00000011	17	Byte (0-199)		Town Size Flag; , Lg = 0, Md = 1,  = 2
0x000000d9	217	Byte (0-199)		Town Hidden Flag
0x000001a2	418	Integer			??Stamp1??
0x000001a4	420	Integer			Filler
0x000001a6	422	Integer			Filler
0x000001a8	424	Byte			Start Town Xcoord
0x000001a9	425	Byte			Start Town Ycoord
0x000001aa	426	Byte			Start Outdoor Section X
0x000001ab	427	Byte			Start Outdoor Section Y
0x000001ac	428	Byte			Start Outdoor Xcoord
0x000001ad	429	Byte			Start Outdoor Ycoord
0x000001ae	430	Integer			Start Town Number
0x000001b0	432	Integer			??Lock1??
0x000001b2	434	Struct101 (0-199)		Town Data Size (See below)
0x00000982	2434	Struct102 		Variable Town Entry (See below)
0x000009be	2494	Integer			??Lock2??
0x000009c0	2496	Struct103 (0-99)		Out Data Size (See below)
0x00000b50	2896	Struct104		Saved Item Rectangles (See below)
0x00000b6e	2926	Integer 			??Lock3??
0x00000b70	2928	Integer(0-49)		Special Item flags ; Start with = 10, Usable = 1
0x00000bd4	3028	Integer (0-49)		Special Item special nodes
0x00000c38	3128	Integer			Rating
0x00000c3a	3130	Integer			Filler
0x00000c3c	3132	Integer			??Lock4??
0x00000c3e	3134	Struct105 (0-255)		Monster Definitions (See below)
0x0000783e	30782	Struct106 (0-29)		Boats (See below) (only 24 are used)
0x0000796a	31083	Struct106 (0-29)		Horses (See below) (only 24 are used)
0x00007a96	31382	Integer			??Stamp2??
0x00007a98	31384	Struct107 (0-255)		Terrain Definitions
0x00008a98	35480	Struct108		Scenario Event Timers (See below)
0x00008ae8	35560	Integer 			??Lock5??
0x00008af6	35562	Struct900(0-255)		Special Nodes (See below)
0x0000a0ea	41194	Struct109 (0-9)		Item Placement Shortcuts (See below)
0x0000a2a2	41634	Integer			??Lock6??
0x0000a2a4	41636	Byte (0-299)		Text Lengths for strings; only first 260 are used
0x0000a3d0	41936	Byte (0-2)		Filler
0x0000a3d2	41938	Byte			Current Outdoor Xcoord
0x0000a3d3	41939	Byte			Current Outdoor Ycoord
0x0000a3d4	41940	Integer			Current Town Number
0x0000a3d6	41942	Struct110 (0-399)		Item Definitions (See below)
0x00010af6	68342	String*20 (0-255)		Monster Names
0x00011ef6	73462	String*30 (0-255)		Terrain Names

Struct101 - Town Data Size

    DbSize As Integer	'Sm - 5446, Md - 7106, Lg - 9562
    StrSize1 As Integer	'Size of 1st 60 strings (0-59)
    StrSize2 As Integer	'Size of next 80 strings (60-139)
    DlgSize1 As Integer	'Size of Dialog Defs + 1st 80 strings
    DlgSize2 As Integer	'Size of Remaining Dialog strings


Struct102 - Variable Town Entry

TownNum(9) as Integer	'Town number to be affected
SDAdust(9,2) as Integer  	'(X,Y) (is 9,2 or is it 2,9)


Struct103 - Outdoor Data Size

    DbSize As Integer	'All - 4146
    StrSize As Integer	'Size of text strings


Struct104 - Saved Item Rectangles

PC	Top0 as Integer		MAC	Left0 as Integer
Left0 as Integer 			Top0 as Integer
Bottom0 as Integer		Right0 as Integer
Right0 as Integer			Bottom0 as Integer
Top1 as Integer			Left1 as Integer
Left1 as Integer			Top1 as Integer
Bottom1 as Integer		Right1 as Integer
Right1 as Integer			Bottom1 as Integer
Top2 as Integer			Left2 as Integer
Left2 as Integer			Top2 as Integer
Bottom2 as Integer		Right2 as Integer
Right2 as Integer			Bottom2 as Integer
Town0 as Integer			Town0 as Integer
Town1 as Integer			Town1 as Integer
Town2 as Integer			Town2 as Integer


Struct105 - Monster Definitions

MonsterNum as Byte
Level as Byte		' Values 0-40
Filler1(25) as Byte
Health as Integer		' Values 0-2500
Current Health as Integer	 Values 0-2500
SpellPoints as integer
Current SpellPoints as integer
Armor as Byte		' Values 0-50
Skill as Byte		' Values 0-40
AttackDice1 as Integer	' See examples below
AttackDice2 as Integer	' ditto
AttackDice3 as Integer	' ditto
AttackType1 as Byte	' Values 0-9
AttackType2 as Byte	' Values 0-9
MonsterType as Byte	' Values 0-15
Speed as Byte		' Values 1-12
Filler3 as Byte
MagicLev as Byte	' Values 0-7
PriestLev as Byte		' Values 0-7
BreathWpn as Byte	' Values 0-40
BreathStr as Byte		' Values 0-3
Treasure	 as Byte		 Values 0-3
SpAbility as Byte		' Values 0-25
Poison as Byte		' Values 0-8
Morale as Integer		 Values 0-500
Current Morale as Integer	 Values 0-500
ItemDropped as Integer	' Item to be dropped when killed
ChanceDrop as Integer	' % chance that item will be dropped
Filler6(30) as Byte
Resistances as Byte	' Bitmapped values; see below
Filler7(1) as byte
PicWidth as byte		 Width of picture
PicHeight as byte		 Height of picture
CreateGenerate as Byte	' Summon monsters or generate fields
CreateStrength as Byte	 
Attitude as Byte		 Values 0-3
SummonType as Byte	 Values 0-3
TalkPic as Integer	' Talking picture
Filler8 as byte
Picture as Integer		' Picture on map

Attack Dice Examples:
	1d1 = 0x65 or 101 decimal
	1d6 = 0x6a or 106 decimal
	2d6 = 0xce or 206 decimal
	20d50 = 0x802 or 2050 decimal (max values)

Resistances Bitmap values:
	0x1 = resist magic		0x10 = resist cold
	0x2 = immune magic		0x20 = immune cold
	0x4 = resist fire			0x40 = resist poison
	0x8 = immune fire		0x80 = immune poison



Struct106 - Scenario items placement (boats/horses)
    Xcoord As Byte
    Ycoord As Byte
    Unused1 As Integer
    Unused2 As Integer
    TownNumber As Integer 	 Default -1
    Unused3 as Byte
    Property As Byte


Struct107 - Terrain Definitions

Pict as Integer
Blockage as Byte		'Values 0-5
Extra1 as Byte
Extra2 as Byte		
SpProperty as Byte	'Values 0-17
Transform as Byte
FlyOver as Byte		'Values 0,1
BoatOver as Byte		'Values 0,1
HorseBlock as Byte	'Values 0,1
Light as Byte		'Values 0-8
Sound as Byte		'Values 0-3
ShortcutKey as Byte
Filler(2) as Byte


Struct108 - Scenario Event Timers
'Note: Can only edit the 1st 10 (0-9)
Moves(0-19) as Integer
SpecNode(0-19) as Integer


Struct109 - Item Placement Shortcuts

TerrainType as Integer
ItemNumber(9) as Integer
PctPlace(9) as Integer
Property as Integer


Struct110 - Item Definitions

Type as Integer		
Level as Byte		 Values 1-50
Filler1 a Byte
Awkwardness as Byte	 Values 0-20
Bonus as Byte		 Values 0-10
Protection as Byte	 Values 10  20
Charges as Byte		 Values 0-100
WeaponType as Byte	 Values 0-2
ItemUses as Byte		 Values 0-3
Picture as Byte
SpecAbility as Byte	 Values defined below
AbilityStrength as Byte	 Values 0-10
TypeFlag as Byte 	 Values 0-255; Groups like items (documentation says 1000 but is wrong)
Filler2 as Integer
Value as Integer		 Values 0-10000
Weight as Byte		 Values 0-250
SpecClass as Byte	 Values 0-100
Filler3 as Integer
Name as String*25	 Full Identified Name
UnIDName as String*15	 Short Unidentified Name
TreasureType as Byte	 Values 0-4
Flags as Byte		 Bitmapped; see below
Filler4 as Integer

Special Ability Values
	Weapon		1  15		General		1e  3e
	Nonspell Usable	46  5e		Spell Usable	6e 87
	Reagents	96  a1		Missile		aa  b0

Bitmapped Flags
	Identified	0x1		Cursed		0x10
	Magical		0x4		Conceal Ability	0x20


Struct200 - Outdoor Data Area

Map(47,47) as Byte
SpecLocs(17,1) as Byte		 Special locations on map		Default (100,0)
SpecNodes(17) as Byte		 Special Node Numbers		Default 0
TownLocs(7,1) as Byte		 Town locations on map		Default (100,0)
TownNums(7) as Byte		 Town Numbers			Defaut 0
SignLocs(7,1) as Byte		 Sign Locations			Default (100,0)
Wandering(3) as Struct201	 Wandering monsters		
SpecEncounters(3) as  Struct201	 Special encounters
WanderingLocs(3,1) as Byte	 X,Y Location of wandering monsters
					order in file is 3,2,1,0
AreaDescLocs(7,3) as Integer	 Locations of area descriptions	Default (0,0,0,0)
				 PC Top, Left, Bottom, Right
				 MAC Left, Top, Right, Bottom
TextLen(179) as Byte		 Length of text strings; only the first 108 are used
SpecNodes(59) as Struct900	 Special nodes


Struct201  Outdoor Wandering monsters

MonsterNum(9) as byte		 10 monsters per encounter
StartSpecial as Integer		 Special node to call at start of encounter
WinsSpecial as Integer		 Special node to call if party wins
LoseSpecial as Integer		 Special node to call if party loses
Flags as Byte			 Bitmapped  0x1  Monster cant flee
				                     0xa  Encounter forced
StuffDone1 as Integer
StuffDone2 as Integer




Struct300 - Town Data Area - Offsets are relative to the beginning of the block
Note: Each size town is the same except for the map and the area following it.

DayDies as Integer		 Day the town dies
EventStop as Integer		 Event that prevents town death
WanderingMonsters(3,3) as Byte	 4 sets of 4 monsters
WanderingLocs(3,1) as Byte	 X,Y coordinates of wandering monsters  Default (100,0)
SpecLocs(49,1) as Byte		 X,Y coordinates for Special		Default (100,0)
SpecNums(49) as Byte		 Special nodes called from map		Default (-1)
SignLocs(14,1) as Byte		 X,Y coordinates of Signs			Default (100,0)
Light as Integer			 Lightness/Darkness of  Town
EntryLocs(3,1) as Byte		 X,Y coordinates of town entries; T, L, B, R		Default (-1,-1)
ExitLocs(3,1) as Byte		 X,Y coordinates of outdoor when leave town; T, L, B, R   Default (-1)
ExitSpecials(3) as Integer		 Special nodes to call when leave town		Default (-1)
Boundaries(3) as Integer		 Town Boundaries; PC T,L,B,R MAC L, T, R, B
Items(63) As Struct301		 Item placement and overrides
MaxMonsters as Integer		 Max monsters to be killed before town is abandoned
Fields(49) as Struct302		 Field effects
EntrySpecials(1) as Integer	 Special nodes to call when enter town
EventTimers(1,7) as Integer	 Moves and Specials for event timers
TextLen(179) As Byte		 Length of text strings; only first 140 are used
SpecNodes(99) As Struct900	 Special nodes
Filler3(3) as Byte
Difficulty as Integer		 Difficulty of town
Select Case of 
	Small
		Map(31,31) as Byte
		AreaDesc(15,3) as Integer		' Locations of area descs.' TLBR/LTRB
		Monsters(29) as Struct303
		Data1(127) as Byte
	Medium
		Map(47,47) As Byte
AreaDesc(15,3) as Integer		 Locations of area descs.; TLBR/LTRB
Monsters(39) as Struct303
Data1(287) as Byte
	Large
		Map(63,63) as Byte
		AreaDesc(15,3) as Integer		' Locations of area descs.' TLBR/LTRB
		Monsters(59) as Struct303
		Data1(511) as Byte
End Select

Struct301 -  Town Items

Xcoord as Byte			Default(100)
Ycoord as Byte			Default(0)
ItemNum as Integer		Default(-1)
Charges as Integer		Default(0)
Filler1 as Byte
AlwaysHere as Byte		Default(0)
Property as Byte			Default(0)	If is property of the NPC's
ContainedIn as Byte		Default(0)	If item is inside a container




Struct302 - Field Effects

Xcoord as Byte			Default (100)
Ycoord as Byte			Default (0)
Type as Byte			Default (0)	See below
Filler as Byte

3 = Web, 4 = Box, 5 = Barrel, 6 = Fire Barrier, 7 = Force Barrier, 8 = Quickfire, 14 = Sm. Blood, 15 = Av. Blood, 16 = Lg. Blood, 17 = Sm. Slime, 18 = Lg. Slime, 19 = Ash, 20 = Bones, 21 = Rocks
(Im going to convert to sequential numbers,  0-13)

Struct303 - Town Monsters

MonsterType as Byte		Default(0)
Attitude as Byte			Default(0)	' Value 0-3
Xcoord as Byte			Default(0)
Ycoord as Byte			Default(0)
CanMove as Byte			Default(0)	' Value 0,1
CreatureHere as Byte		Default(0)	' Value 0-8
Filler1 as Integer
StuffDone1 as Integer		Initial(0) Default(-1)	 Set when monster killed
StuffDone2 as Integer		Initial(0) Default(-1)	' Set when monster killed
SpecEncounterGrp as Byte	Default(0)	' Value 0-10
Extra1 as Byte			Default(0)
Extra0 as Byte			Default(0)
Filler2 as Byte
Personality as Integer		Initial(0) Default(-1)	' Personality dialog
KilledSpecNode as Integer		Initial(0) Default(-1)	' Special node to call when monster is killed
TalkingPic as Integer		Initial(0) Default(1)	' Dialog picture


Struct400 - Dialog Data Area

TextLen(169) as Byte
NodeDefs(59) as Struct401		' Dialog Node Definitions


Struct401 - Dialog Node Definition

Personality as Integer
Type as Integer			' Value 0-0x1e
Word1 as Char*4
Word2 as Char*4
A as Integer
B as Integer
C as Integer
D as Integer

Notes:	Dialog strings are ordered as follows:

	Name
	Look Response
	Name Response
	Job Response
	Dialog Nodes 0-59; two strings each
	Don't Understand Response
Struct900 - Special Nodes

    Type As Integer		default 0
    StuffDone1 As Integer		default -1
    StuffDone2 As Integer		default -1
    Pict As Integer			default 1; set to 0 when used
    Mess1 As Integer		default -1
    Mess2 As Integer		default -1
    Extra1a As Integer		default -1
    Extra1b As Integer		default -1
    Extra2a As Integer		default -1
    Extra2b As Integer		default -1
    JumpTo As Integer		default -1
