Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted by MalcolmX86 ( 12 years ago )
This is a program to dump the contents of the PARTY.SAV file from the popular ULTIMA IV game. The data file is separate and it is below the source code which follows . 

>U4dump.pas
var
 fin:file;
 ftxt:TextFile;
 s,l:string;
 party:array[0..$1F5] of byte ;
 i,v:word;
 c:word absolute l;

Begin
 assign(ftxt,'list.dat');
 assign(fin, paramstr(1));
 reset(fin);reset(ftxt);
 blockread(fin,party,$1F6,i);
 close(fin);
 i:=0;
 while i<$1F6 do begin
  readln(ftxt,s);
  val(s[1],v,c);
  l:=('             ');
  l:=hexstr(i,3)+':';
  while v>0 do begin
   l:=l+hexstr(party[i],2);
   inc(i);dec(v);end;
  setlength(l,13);
  delete(s,1,3);
  Writeln(l+s);end;
 close(ftxt);
end.




>list.dat
4  Counter (incremented regularly, probably every screen update)
2  Moves (low word)
2  Moves (high word)
2  HP
2  Maximum HP
2  XP
2  Strength
2  Dexterity
2  Intelligence
2  MP
2  ???
2  Weapon
2  Armor
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Sex (0xb-male, 0xc-female)
1  Class
1  Status ('G'-good, 'P'-poisoned, 'S'-sleeping, 'D'-dead)
2  HP
2  Maximum HP
2  XP
2  Strength
2  Dexterity
2  Intelligence
2  MP
2  ???
2  Weapon
2  Armor
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Sex (0xb-male, 0xc-female)
1  Class
1  Status ('G'-good, 'P'-poisoned, 'S'-sleeping, 'D'-dead)
2  HP
2  Maximum HP
2  XP
2  Strength
2  Dexterity
2  Intelligence
2  MP
2  ???
2  Weapon
2  Armor
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Sex (0xb-male, 0xc-female)
1  Class
1  Status ('G'-good, 'P'-poisoned, 'S'-sleeping, 'D'-dead)
2  HP
2  Maximum HP
2  XP
2  Strength
2  Dexterity
2  Intelligence
2  MP
2  ???
2  Weapon
2  Armor
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Sex (0xb-male, 0xc-female)
1  Class
1  Status ('G'-good, 'P'-poisoned, 'S'-sleeping, 'D'-dead)
2  HP
2  Maximum HP
2  XP
2  Strength
2  Dexterity
2  Intelligence
2  MP
2  ???
2  Weapon
2  Armor
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Sex (0xb-male, 0xc-female)
1  Class
1  Status ('G'-good, 'P'-poisoned, 'S'-sleeping, 'D'-dead)
2  HP
2  Maximum HP
2  XP
2  Strength
2  Dexterity
2  Intelligence
2  MP
2  ???
2  Weapon
2  Armor
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Sex (0xb-male, 0xc-female)
1  Class
1  Status ('G'-good, 'P'-poisoned, 'S'-sleeping, 'D'-dead)
2  HP
2  Maximum HP
2  XP
2  Strength
2  Dexterity
2  Intelligence
2  MP
2  ???
2  Weapon
2  Armor
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Sex (0xb-male, 0xc-female)
1  Class
1  Status ('G'-good, 'P'-poisoned, 'S'-sleeping, 'D'-dead)
2  HP
2  Maximum HP
2  XP
2  Strength
2  Dexterity
2  Intelligence
2  MP
2  ???
2  Weapon
2  Armor
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Name
1  Sex (0xb-male, 0xc-female)
1  Class
1  Status ('G'-good, 'P'-poisoned, 'S'-sleeping, 'D'-dead)
4  Food (in units of hundredths)
2  Gold
2  Karma honesty
2  Karma compassion
2  Karma valor
2  Karma justice
2  Karma sacrifice
2  Karma honor
2  Karma spirituality
2  Karma humility
2  Torches
2  Gems
2  Keys
2  Sextants
2  Armor none (unused)
2  Armor cloth
2  Armor leather
2  Armor chain
2  Armor plate
2  Armor magic chain
2  Armor magic plate
2  Armor mystic robes
2  Weapons none (unused)
2  Weapons staves
2  Weapons daggers
2  Weapons slings
2  Weapons maces
2  Weapons axes
2  Weapons swords
2  Weapons bows
2  Weapons crossbows
2  Weapons oil
2  Weapons halberds
2  Weapons magic axes
2  Weapons magic swords
2  Weapons magic bows
2  Weapons magic wands
2  Weapons mystic swords
2  Reagents sulfurous ash
2  Reagents ginseng
2  Reagents garlic
2  Reagents spider silk
2  Reagents blood moss
2  Reagents black pearl
2  Reagents nightshade
2  Reagents mandrake
2  Mixtures awaken
2  Mixtures blink
2  Mixtures cure
2  Mixtures dispel
2  Mixtures energy
2  Mixtures fireball
2  Mixtures gate
2  Mixtures heal
2  Mixtures iceball
2  Mixtures jinx
2  Mixtures kill
2  Mixtures light
2  Mixtures magic missile
2  Mixtures negate
2  Mixtures open
2  Mixtures protection
2  Mixtures quickness
2  Mixtures resurrect
2  Mixtures sleep
2  Mixtures tremor
2  Mixtures undead
2  Mixtures view
2  Mixtures winds
2  Mixtures x-it
2  Mixtures y-up
2  Mixtures z-down
1  Items (1 bit each )
1  Items (1 bit each (3 bits unused))
1  X coordinate
1  Y coordinate
1  Stones (1 bit each for BYRGOPWB)
1  Runes (1 bit each for HCVJSHSH)
2  Number of characters in party
2  (10,11,12,13-ship,14,15-horse,18-balloon,1f-on foot)
2  balloon(0-on ground, 1-flying)/in dungeon:torch duration
2  Current phase of left moon (Trammel); range = 0-7
2  Current phase of right moon (Felucca); range = 0-7
2  Hull integrity of currently boarded ship
2  Lord British (0-not introduced, 1-introduced)
2  Time of last successful hole up & camp.
2  Time of last mandrake/nightshade find.
2  Time of last successful meditation at a shrine.
2  Time of last virtue-related conversation.
2  coordinates of dungeon, or last entered dungeon
2  Orientation in dungeon (0-west, 1-north, 2-east, 3-south)
2  Dungeon level (starting at zero, 0xffff = surface)
2  Current party location

 

Revise this Paste

Your Name: Code Language: