=============================================================================== Definition of New Save File =============================================================================== Section I. Scenario Data (1x) Scenario Header 24 bytes ------------------------------------------------------------------------------- 1 Signature long 4 bytes (>EXS) (0x5358453e) (1398293822) 5 Version(2) byte 3 bytes 8 Num Towns byte 1 byte value < 200 9 Out Width byte 1 byte outwidth * outheight < 100 10 Out Height byte 1 byte 11 Difficulty byte 1 byte value 0,1,2,3 12 Rating byte 1 byte value 0,1,2,3 13 Icon byte 1 byte 14 Current Town byte 1 byte 15 Current OutX byte 1 byte 16 Current OutY byte 1 byte 17 Start Town byte 1 byte 18 Start TownX byte 1 byte 19 Start TownY byte 1 byte 20 Start OutSectX byte 1 byte 21 StartOutSectY byte 1 byte 24 StartOutX byte 1 byte 23 StartOutY byte 1 byte 24 Lock Lists byte 1 byte ------------------------------------------------------------------------------- Scenario Parameters 8 bytes 25 NumSPNode integer 2 bytes default 255 27 NumText integer 2 bytes default 319 29 Pad(1) integer 4 bytes ------------------------------------------------------------------------------- Outdoor Parameters 16 bytes 33 NumSpNode integer 2 bytes default 59 35 NumText integer 2 bytes default 107 37 NumSpecial integer 2 bytes default 17 overridden in outdoor bloc 39 NumSign integer 2 bytes default 15 41 NumTown integer 2 bytes default 7 43 Pad(2) integer 2 bytes ------------------------------------------------------------------------------- Town Parameters 32 bytes 49 NumSPNode integer 2 bytes default 99 51 NumText integer 2 bytes default 189 was 139 53 NumSpecial integer 2 bytes default 49 overridden in town block 55 NumSign integer 2 bytes default 15 57 NumFields integer 2 bytes default 255 overridden in town block 59 NumItem integer 2 bytes default 63 overridden in town block 61 NumMonster integer 2 bytes default 59 overridden in town block 63 NumDlgNode integer 2 bytes default 59 65 Pad(7) integer 16 bytes 81 DBPtrs(299) long 1200 bytes ------------------------------------------------------------------------------- 1281 Terrain Data 256x 48 12288 bytes Name string*30 30 bytes Picture integer 2 bytes can be custom Extra1 integer 2 bytes Extra2 integer 2 bytes Blockage byte 1 byte value 0-5 SpProperty byte 1 byte value 0-17 Transform byte 1 byte value 0-255 Flyover byte 1 byte value 0,1 Boatover byte 1 byte value 0,1 Horseblock byte 1 byte value 0,1 Light byte 1 byte value 0,8 Sound byte 1 byte value 0,3 Shortcutkey byte 1 byte character Pad byte 3 byte ------------------------------------------------------------------------------- Monster Data 256 x 64 16384 bytes Name string*20 20 bytes Picture integer 2 bytes can be custom PicWidth byte 1 byte value 0,3 PicHeight byte 1 byte value 0,3 Talk Picture integer 2 bytes can be custom Type byte 1 byte value 0-15 Level byte 1 byte value 0-40 Health integer 2 bytes value 0-2500 Armor byte 1 byte value 0-50 Skill byte 1 byte value 0-40 Speed byte 1 byte value 0-12 MageLevel byte 1 byte value 0-7 PriestLevel byte 1 byte value 0-7 Attitude byte 1 byte value 0-3 Treasure byte 1 byte value 0-3 Item Dropped integer 2 bytes value 0-511 ChanceDrop integer 2 bytes value 0-99 Poison byte 1 byte value 0-8 SpAbility byte 1 byte value 0-25 AttackType(2) byte 3 bytes value 0-9 AttackDice(2) byte 3 bytes value 0-99 AttackDSides(2) byte 3 bytes value 0-99 Breath Weapon byte 1 byte 0-3 Breath Strength byte 1 byte 0-40 Create/Generate byte 1 byte Create Strength byte 1 byte SummonType byte 1 byte value 0-3 Magic Res. byte 1 byte value 0,1,2 Fire Res. byte 1 byte value 0,1,2 Cold Res. byte 1 byte value 0,1,2 Poison Res. byte 1 byte value 0,1,2 Pad byte 3 bytes ------------------------------------------------------------------------------- Item Data 512x 64 32768 bytes Full Name string*25 25 bytes Short Name string*15 15 bytes Picture integer 2 bytes ItemType byte 1 byte value 0-27 Value integer 2 bytes value 0-10000 Weight byte 1 byte value 0-250 Level byte 1 byte value 1-50 Awkwardness byte 1 byte value 0-20 Bonus byte 1 byte value 0-10 Protection byte 1 byte value 10 - 20 Charges byte 1 byte value 0-100 Weapon type byte 1 byte value 1-3 Item uses byte 1 byte value 0-3 SpAbility byte 1 byte value 0-b0 with gaps SpAbilityStr byte 1 byte value 0-10 Type Flag integer 2 bytes value 0-1000 SpecClass byte 1 byte value 0-100 TreasureType byte 1 byte value 0-4 Always Id’d byte 1 byte value 0-1 Magical byte 1 byte value 0-1 Cursed byte 1 byte value 0-1 Conceal ability byte 1 byte value 0-1 Pad byte 1 byte ------------------------------------------------------------------------------- ItemPlace. S.C 10x 42 420 bytes TerrainType byte 1 byte Property byte 1 byte Item(9) integer 20 bytes PctPlace(9) integer 20 bytes ------------------------------------------------------------------------------- Var Town Entry 10x 6 60 bytes TownNum integer 2 bytes SDAdjust(1) integer 4 bytes ------------------------------------------------------------------------------- Saved Items 4x 6 24 bytes TownNum integer 2 bytes Top byte 1 byte Left byte 1 byte Bottom byte 1 byte Right byte 1 byte ------------------------------------------------------------------------------- Scen Event Timer 20x 4 40 bytes Moves integer 2 bytes SpNode integer 2 bytes ------------------------------------------------------------------------------- Special Items 50x 4 200 bytes ScenSPNode integer 2 bytes StartWith byte 1 byte Usable byte 1 byte ------------------------------------------------------------------------------- Transport 48x 5 240 bytes (24 boats, 24 horses) TownNumber integer 2 bytes Xcoord byte 1 byte Ycoord byte 1 byte Property byte 1 byte ------------------------------------------------------------------------------- Scen SPNodes 256x 22 5632 bytes Number of nodes adjustable Type integer 2 bytes SD1 integer 2 bytes SD2 integer 2 bytes Mess1 integer 2 bytes Mess2 integer 2 bytes Pict integer 2 bytes Extra(2,2) integer 8 bytes Jumpto integer 2 bytes ------------------------------------------------------------------------------- Text Variable length Number of nodes adjustable Length(319) byte 320 bytes Text string variable length ------------------------------------------------------------------------------- Usage of Text for Scenario 0 1 Scenario Name 1-3 3 Credits 4-9 6 Intro Text 10-11 2 Death Text 12-59 48 Journal Strings 60-159 50x2 Special Items (2 strings each) 160-259 100 Special Strings 260-319 60 Button texts ------------------------------------------------------------------------------- Usage of Text for Outarea 0 0 Outdoor Area Name 0-8 8 Area Rectangles 9 1 Comment 10-99 90 Special Strings 100-107 8 Signs Usage of Text for Towns 0 1 Town Name 1-16 16 Area Rectangles 17-19 3 Comment 20-169 150 Special Strings Was 100 170-189 20 Signs 20-199 180 Special Strings Was 100 200-219 20 Signs =============================================================================== SectionII. Outdoor Data (1-100x) Number of Specials 2 bytes multiples of 8 Area Descriptions 8x 4 32 bytes Loc(3) byte 4 bytes (top, left, bottom, right) ------------------------------------------------------------------------------- WanderingLocs 4x 2 8 bytes WandLocX byte 1 byte WandLocY byte 1 byte ------------------------------------------------------------------------------- Wandering Monsters 4x 22 88 bytes Monst Num(9) byte 10 bytes StartSpecial integer 2 bytes WinsSpecial integer 2 bytes LoseSpecial integer 2 bytes MonsterFlee byte 1 byte Encounter Force byte 1 byte SDFlag(1) integer 4 bytes ------------------------------------------------------------------------------- Special Encounters 4x 22 88 bytes Monst Num(9) byte 10 bytes StartSpecial integer 2 bytes WinsSpecial integer 2 bytes LoseSpecial integer 2 bytes MonsterFlee byte 1 byte Encounter Force byte 1 byte SDFlag(1) integer 4 bytes ------------------------------------------------------------------------------- Signs 8x 2 16 bytes Number of nodes adjustable SignLocX byte 1 byte SignLocY byte 1 byte ------------------------------------------------------------------------------- Towns 8x 4 32 bytes Number of nodes adjustable TownNum integer 2 bytes TownLocX byte 1 byte TownLocY byte 1 byte ------------------------------------------------------------------------------- Specials variable x 4 variable Determined by outdoor block SpecNum integer 2 bytes SpecLocX byte 1 byte SpecLocY byte 1 byte ------------------------------------------------------------------------------- SPNodes 60x 22 1320 bytes Number of nodes adjustable Type integer 2 bytes SD1 integer 2 bytes SD2 integer 2 bytes Mess1 integer 2 bytes Mess2 integer 2 bytes Pict integer 2 bytes Extra(2,2) integer 8 bytes Jumpto integer 2 bytes Map(47,47) byte 2304 bytes TextLen(107) byte 108 bytes Number of nodes adjustable Text string variable length =============================================================================== Section III. Town data (1-200) NField integer 2 bytes (number of fields multiple of 8) NItem integer 2 bytes (number of item; multiple of 8) NMonst integer 2 bytes (number of monsters; multiple of 8) NSpecials integer 2 bytes (number of specials; multiple of 8) TownSize byte 1 byte TownHidden byte 1 byte Light integer 2 byte Difficulty integer 2 byte DayDies integer 2 bytes EventStop integer 2 bytes MaxMonsters integer 2 bytes EntrySpec(1) integer 4 bytes ExitSpec(3) integer 8 bytes Boundaries(3) byte 4 bytes ------------------------------------------------------------------------------- Area Descriptions 16x 4 64 bytes Loc(3) byte 4 bytes (top, left, bottom, right) ------------------------------------------------------------------------------- EntryLocs 4x 2 8 bytes EntryX byte 1 byte EntryY byte 1 byte ------------------------------------------------------------------------------- ExitLocs 4x 2 8 bytes ExitX byte 1 byte ExitY byte 1 byte ------------------------------------------------------------------------------- EventTimers 8x 4 24 bytes Moves integer 2 bytes SPNode integer 2 bytes ------------------------------------------------------------------------------- WanderingLocs 4x 2 8 bytes WandLocX byte 1 byte WandLocY byte 1 byte ------------------------------------------------------------------------------- Wandering Monsters 4x 4 16 bytes Monster(3) byte 1 byte ------------------------------------------------------------------------------- Signs 15x 2 16 bytes Number of nodes adjustable SignLocX byte 1 byte SignLocY byte 1 byte ------------------------------------------------------------------------------- Specials variable x 4 variable Determined by town block SpecNum integer 2 byte SpecLocX byte 1 byte SpecLocY byte 1 byte ------------------------------------------------------------------------------- Fields variable x 4 variable Determined by town block FieldType integer 1 byte FieldX byte 1 byte FieldY byte 1 byte ------------------------------------------------------------------------------- Items variable x 8 variable Determined by town block ItemNum integer 2 bytes Coord(1) byte 2 bytes Charges byte 1 byte AlwaysHere byte 1 byte Property byte 1 byte ContainedIn byte 1 byte ------------------------------------------------------------------------------- Monsters variable x 18 variable Determined by town block MonstNum byte 1 byte MonstX byte 1 byte MonstY byte 1 byte Attitude byte 1 byte CanMove byte 1 byte CreatureHere byte 1 byte SDFlag(1) integer 4 bytes SPEncounter byte 1 byte Personality byte 1 byte TalkingPic integer 2 bytes Extra(1) byte 2 bytes KilledSpNode integer 2 bytes ------------------------------------------------------------------------------- SPNodes 100x 22 2200 bytes Number of nodes adjustable Type integer 2 bytes SD1 integer 2 bytes SD2 integer 2 bytes Mess1 integer 2 bytes Mess2 integer 2 bytes Pict integer 2 bytes Extra(2,2) integer 8 bytes Jumpto integer 2 bytes ------------------------------------------------------------------------------- Select Case Town Size Case 0 (Lg) Map(63,63) byte 4096 bytes Case 1 (Md) Map(47,47) byte 2304 bytes Case2 (Sm) Map(31,31) byte 1024 bytes End Select ------------------------------------------------------------------------------- TextLen(219) byte 180 bytes Number of nodes adjustable Text string variable length ------------------------------------------------------------------------------- DialogNode 60x 20 120 bytes Personality integer 2 bytes Type integer 2 bytes Word(1) string*4 8 bytes Extra(3) integer 8 bytes ------------------------------------------------------------------------------- DialogLen(169) byte 170 byte DialogText string variable length Notes: Dialog strings are ordered as follows: 1 - Name 4 - Name Response 2 - Huh Response 5 - Job Response 3 - Look Response 6 - Dialog Node Strings ( 2 strings per node) ===============================================================================