-+-+-+-+-+-+-+-+ START OF PART 53 -+-+-+-+-+-+-+-+ X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,mage_spell`5Bpy.misc.pclass,i1`5D.learned) X end; X end X else X begin X for i1 := 1 to 31 do X with mage_spell`5Bpy.misc.pclass,i1`5D do X begin X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,learned,sexp) X end; X for i1 := 1 to 31 do X with priest_spell`5Bpy.misc.pclass,i1`5D do X begin X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,learned,sexp) X end; X for i1 := 1 to 31 do X with extra_spell`5Bpy.misc.pclass,i1`5D do X begin X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,learned,sexp) X end; X end; X`20 X `7B If same version, restore dungeon level... `7D X if (not(dun_flag)) then X begin X `7B Read the important dungeon info and floor `7D X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,cur_height,cur_width,max_panel_rows,max_panel_cols) V; X`20 X `7B Restore the floor `7D X for i1 := 1 to cur_height do X begin X readln(f1,in_rec); X decrypt(in_rec); X for i2 := 1 to cur_width do X begin X xfloor := ord(in_rec`5Bi2`5D); X with cave`5Bi1,i2`5D do X begin X fval := int(uand(%X'0F',xfloor)); X if (uand(%X'10',xfloor) <> 0) then X fopen := true; X if (uand(%X'20',xfloor) <> 0) then X pl := true; X if (uand(%X'40',xfloor) <> 0) then X fm := true; X tl := false; X tptr := 0; X cptr := 0; X end; X end; X end; X`20 X `7B Restore the Treasure List `7D X tlink; X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,tot_treasures); X for i1 := 1 to tot_treasures do X begin X popt(i2); X with t_list`5Bi2`5D do X begin X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,i3,i4); X cave`5Bi3,i4`5D.tptr := i2; X`20 X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,tchar,name); X`20 X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,damage); X`20 X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,tval,subval,weight,number,tohit,todam,ac,to Vac, X p1,flags,level,cost); X end; X end; X`20 X `7B Re-identify objects `7D X readln(f1,in_rec); X decrypt(in_rec); X for i1 := 1 to max_objects do X if (in_rec`5Bi1`5D = 'T') then X identify(object_list`5Bi1`5D) X else X object_ident`5Bi1`5D := false; X`20 X `7B Restore the Monster List `7D X mlink; X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,tot_monsters); X i3 := 0; X for i1 := 1 to tot_monsters do X begin X readln(f1,in_rec); X decrypt(in_rec); X popm(i2); X with m_list`5Bi2`5D do X begin X readv(in_rec,fy,fx,mptr,hp,cspeed,csleep,cdis,ml,confuse Vd); X cave`5Bfy,fx`5D.cptr := i2; X if (muptr = 0) then X muptr := i2 X else X m_list`5Bi3`5D.nptr := i2; X nptr := 0; X i3 := i2; X end; X end; X`20 X `7B Restore the town level stores `7D X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,town_seed); X for i1 := 1 to max_stores do X with store`5Bi1`5D do X begin X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,i2); X store_ctr := i2; X `7B If not current version then re-outfit the stores `7 VD X if (dun_flag) then X begin X i2 := 0; X store_ctr := 0; X end; X for i3 := 1 to i2 do X with store_inven`5Bi3`5D.sitem do X begin X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,store_inven`5Bi3`5D.scost); X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,tchar,name); X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,damage); X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,tval,subval,weight,number,tohit,todam, X ac,toac,p1,flags,level,cost); X end; X readln(f1,in_rec); X decrypt(in_rec); X readv(in_rec,owner,insult_cur,store_open); X end; X store_maint; X end; X`20 X close(f1,error:=continue); X open (f1,file_name:=fnam, X record_length:=1024,history:=old,disposition:=delete, X error:=continue); X close(f1,error:=continue); X seed := get_seed; X get_char := dun_flag; X end; X`20 X`20 X `7B Wizard command for restoring character -RAK- `7 VD X`5Bpsect(save$code)`5D procedure restore_char; X var X i1 : integer; X fnam : vtype; X in_rec,temp : ntype; X temp_id : packed array `5B1..70`5D o Vf char; X f1 : text; X f2 : file of key_type; X flag : boolean; X`20 X begin X prt('Name of file to be restored: ',1,1); X if (get_string(fnam,1,30,48)) then X begin X priv_switch(1); X open (f1,file_name:=fnam, X record_length:=1024,history:=old,error:=continue); X if (status(f1) <> 0) then X msg_print('Error Opening> '+fnam) X else X begin X flag := true; X open (f2,file_name:=moria_mas, X access_method:=keyed,organization:=indexed, X history:=old,sharing:=readwrite,error:=continue); X if (status(f2) <> 0) then X begin X open (f2,file_name:=moria_mas, X access_method:=keyed,organization:=indexed, X history:=new,sharing:=readwrite,error:=continue); X if (status(f2) <> 0) then X begin X msg_print('MASTER could not be opened.'); X flag := false; X end; X end; X if (flag) then X begin X reset(f1,error:=continue); X readln(f1,in_rec,error:=continue); X seed := encrypt_seed2; X decrypt(in_rec); X temp := substr(in_rec,14,70); X seed := encrypt_seed1; X encrypt(temp); X for i1 := 1 to 70 do X key_rec.file_id`5Bi1`5D := temp`5Bi1`5D; X temp_id := ' '; X findk(f2,0,temp_id,eql,error:=continue); X delete(f2,error:=continue); X f2`5E := key_rec; X put(f2,error:=continue); X if (status(f2) = 0) then X msg_print('Character restored...') X else X msg_print('Could not write ID in MASTER.'); X end; X close(f1,error:=continue); X close(f2,error:=continue); X end; X seed := get_seed; X priv_switch(0); X end; X end; $ CALL UNPACK [.SOURCE.INCLUDE]SAVE.INC;1 102979932 $ create 'f' X `7B Scrolls for the reading -RAK- `7 VD X`5Bpsect(misc2$code)`5D procedure read; X var X i1 : unsigned; X i2,i3,i4,item_val,mk1,mklev, X thit,tdam,y,x : integer; X tmp : array `5B1..5`5D of intege Vr; X out_val,tmp_str,mkstr : vtype; X redraw,ident,first,flag : boolean; X begin X first := true; X reset_flag := true; X if (inven_ctr > 0) then X begin X if (find_range(`5B70,71`5D,i2,i3)) then X if (py.flags.blind > 0) then X msg_print('You can''t see to read the scroll.') X else if (no_light) then X msg_print('You have no light to read by.') X else if (py.flags.confused > 0) then X begin X msg_print('The text seems to swim about the page!'); X msg_print('You are too confused to read...'); X end X else X begin X redraw := false; X if (get_item(item_val,'Read which scroll?',redraw, X i2,i3)) then X with inventory`5Bitem_val`5D do X begin X if (redraw) then draw_cave; X reset_flag := false; X i1 := flags; X ident := false; X while (i1 > 0) do X begin X i2 := bit_pos(i1); X if (tval = 71) then i2 := i2 + 31; X if (first) then X if (not(i2 in `5B4,25`5D)) then X begin X msg_print('As you read the scroll it vanishes.'); X first := false; X end; X`20 X `7B Scrolls... `7D X case (i2) of `20 X 1 : with inventory`5B23`5D do X begin X if (tval > 0) then X begin `20 X objdes(out_val,23,false); X msg_print('Your ' + out_val + ' glows faintly!'); X if (enchant(tohit)) then X begin X flags := uand(%X'7FFFFFFF',flags); X py_bonuses(blank_treasure,0); X end X else X msg_print('The enchantment fails...'); X end; X ident := true; X end; X 2 : with inventory`5B23`5D do X begin X if (tval > 0) then X begin X objdes(out_val,23,false); X msg_print('Your ' + out_val + ' glows faintly!'); X if (enchant(todam)) then X begin X flags := uand(%X'7FFFFFFF',flags); X py_bonuses(blank_treasure,0); X end X else X msg_print('The enchantment fails...'); X end; X ident := true; X end; X 3 : begin X i3 := 0; X i4 := 0; X if (inventory`5B26`5D.tval > 0) then X begin X i3 := i3 + 1; X tmp`5Bi3`5D := 26; X end; X if (inventory`5B27`5D.tval > 0) then X begin X i3 := i3 + 1; X tmp`5Bi3`5D := 27; X end; X if (inventory`5B32`5D.tval > 0) then X begin X i3 := i3 + 1; X tmp`5Bi3`5D := 32; X end; X if (inventory`5B28`5D.tval > 0) then X begin X i3 := i3 + 1; X tmp`5Bi3`5D := 28; X end; X if (inventory`5B24`5D.tval > 0) then X begin X i3 := i3 + 1; X tmp`5Bi3`5D := 24; X end; X if (i3 > 0) then i4 := tmp`5Brandint(i3)`5D; X if (uand(%X'80000000',inventory`5B26`5D.flags) <> 0) then X i4 := 26 X else if (uand(%X'80000000',inventory`5B27`5D.flags) <> 0) V then X i4 := 27 X else if (uand(%X'80000000',inventory`5B32`5D.flags) <> 0) V then X i4 := 32 X else if (uand(%X'80000000',inventory`5B24`5D.flags) <> 0) V then X i4 := 24 +-+-+-+-+-+-+-+- END OF PART 53 +-+-+-+-+-+-+-+-