-+-+-+-+-+-+-+-+ START OF PART 23 -+-+-+-+-+-+-+-+ X`09 prt('File name: ',1,1); X`09 if (get_string(filename1,1,12,64)) then X`09 begin X`09 if (length(filename1) = 0) then filename1 := 'MORIAOBJ.DAT'; X`09 open(file1,filename1,error:=continue); X`09 if (status(file1) = 0) then X`09`09begin X`09`09 writev(tmp_str,nobj:1); X`09`09 prt(tmp_str + ' random objects being produced...',1,1); X`09`09 put_qio; X`09`09 rewrite(file1,error:=continue); X`09writeln(file1,'*** Random Object Sampling:',error:=continue); X`09writeln(file1,'*** ',nobj:1,' objects',error:=continue); X`09writeln(file1,'*** For Level ',level:1,error:=continue); X`09writeln(file1,'',error:=continue); X`09writeln(file1,'',error:=continue); X`09`09 popt(i2); X`09`09 for i1 := 1 to nobj do X`09`09 begin X`09`09 t_list`5Bi2`5D := object_list`5Bget_obj_num(level)`5D; X`09`09 magic_treasure(i2,level); X`09`09 inventory`5Binven_max`5D := t_list`5Bi2`5D; X`09`09 with inventory`5Binven_max`5D do X`09`09`09begin X`09`09`09 unquote(name); X`09`09`09 known1(name); X`09`09`09 known2(name); X`09`09`09end; X`09`09 objdes(tmp_str,inven_max,true); X`09`09 writeln(file1,tmp_str,error:=continue); X`09`09 end; X`09`09 pusht(i2); X`09`09 close(file1,error:=continue); X`09`09 prt('Completed.',1,1); X`09`09end X`09 else X`09`09prt('File could not be opened.',1,1); X`09 end; X`09end; X end; X X X`09`7B Prints a listing of monsters`09`09`09`09-RAK-`09`7D X`5Bpsect(wizard$code)`5D procedure print_monsters; X var X`09i1,i2,xpos,atype,adesc : integer; X`09file1 : text; X`09out_val,filename1 : vtype; X`09attstr,attx : vtype; X`09damstr : dtype; X X begin X prt('File name: ',1,1); X if (get_string(filename1,1,12,64)) then X`09begin X`09 if (length(filename1) = 0) then filename1 := 'MORIAMON.DAT'; X`09 open(file1,filename1,error:=continue); X`09 if (status(file1) = 0) then X`09 begin X`09 prt('Writing Monster Dictionary...',1,1); X`09 put_qio; X`09 rewrite(file1,error:=continue); X`09 for i1 := 1 to max_creatures do X`09`09with c_list`5Bi1`5D do X`09`09 begin X`09`7B Begin writing to file `7D Xwriteln(file1,'--------------------------------------------',error:=continue V); Xout_val := name + ' '; Xwriteln(file1,i1:3,' ',out_val:30,' (',cchar:1,')',error:=continue); Xwriteln(file1,' Speed =',speed:2,' Level =',level:2,' Exp =',mexp: V5, X`09`09`09`09`09`09`09error:=continue); Xwriteln(file1,' AC =',ac:2, ' Eye-sight =',aaf:2,' HD =',hd:5, X`09`09`09`09`09`09`09error:=continue); Xif (uand(%X'80000000',cmove) <> 0) then X writeln(file1,' Creature is a ***Win Creature***',error:=continue); Xif (uand(%X'00080000',cmove) <> 0) then X writeln(file1,' Creature Eats/kills other creatures.',error:=continue) V; Xif (uand(%X'0001',cdefense) <> 0) then X writeln(file1,' Creature is a dragon.',error:=continue); Xif (uand(%X'0002',cdefense) <> 0) then X writeln(file1,' Creature is a monster.',error:=continue); Xif (uand(%X'0004',cdefense) <> 0) then X writeln(file1,' Creature is evil.',error:=continue); Xif (uand(%X'0008',cdefense) <> 0) then X writeln(file1,' Creature is undead.',error:=continue); Xif (uand(%X'0010',cdefense) <> 0) then X writeln(file1,' Creature harmed by cold.',error:=continue); Xif (uand(%X'0020',cdefense) <> 0) then X writeln(file1,' Creature harmed by fire.',error:=continue); Xif (uand(%X'0040',cdefense) <> 0) then X writeln(file1,' Creature harmed by poison.',error:=continue); Xif (uand(%X'0080',cdefense) <> 0) then X writeln(file1,' Creature harmed by acid.',error:=continue); Xif (uand(%X'0100',cdefense) <> 0) then X writeln(file1,' Creature harmed by blue light.',error:=continue); Xif (uand(%X'0200',cdefense) <> 0) then X writeln(file1,' Creature harmed by Stone-to-Mud.',error:=continue); Xif (uand(%X'1000',cdefense) <> 0) then X writeln(file1,' Creature cannot be charmed or slept.',error:=continue) V; Xif (uand(%X'2000',cdefense) <> 0) then X writeln(file1,' Creature seen with Infra-Vision.',error:=continue); Xif (uand(%X'4000',cdefense) <> 0) then X writeln(file1,' Creature has MAX hit points.',error:=continue); Xif (uand(%X'00010000',cmove) <> 0) then X writeln(file1,' Creature is invisible.',error:=continue); Xif (uand(%X'00100000',cmove) <> 0) then X writeln(file1,' Creature picks up objects.',error:=continue); Xif (uand(%X'00200000',cmove) <> 0) then X writeln(file1,' Creature multiplies.',error:=continue); Xif (uand(%X'01000000',cmove) <> 0) then X writeln(file1,' Carries object(s).',error:=continue); Xif (uand(%X'02000000',cmove) <> 0) then X writeln(file1,' Carries gold, gems, ect.',error:=continue); Xif (uand(%X'04000000',cmove) <> 0) then X writeln(file1,' Has object/gold 60% of time.',error:=continue); Xif (uand(%X'08000000',cmove) <> 0) then X writeln(file1,' Has object/gold 90% of time.',error:=continue); Xif (uand(%X'10000000',cmove) <> 0) then X writeln(file1,' Has 1d2 object(s)/gold.',error:=continue); Xif (uand(%X'20000000',cmove) <> 0) then X writeln(file1,' Has 2d2 object(s)/gold.',error:=continue); Xif (uand(%X'40000000',cmove) <> 0) then X writeln(file1,' Has 4d2 object(s)/gold.',error:=continue); X`09`7B Creature casts spells / Breaths Dragon breath... `7D Xif (spells > 0) then X begin X writeln(file1,' --Spells/Dragon Breath =',error:=continue); X writeln(file1,' Casts spells 1 out of ',uand(%X'F',spells):1, X`09`09' turns.',error:=continue); X if (uand(%X'00000010',spells) <> 0) then X writeln(file1,' Can teleport short.',error:=continue); X if (uand(%X'00000020',spells) <> 0) then X writeln(file1,' Can teleport long.',error:=continue); X if (uand(%X'00000040',spells) <> 0) then X writeln(file1,' Teleport player to itself.',error:=continue); X if (uand(%X'00000080',spells) <> 0) then X writeln(file1,' Cause light wounds.',error:=continue); X if (uand(%X'00000100',spells) <> 0) then X writeln(file1,' Cause serious wounds.',error:=continue); X if (uand(%X'00000200',spells) <> 0) then X writeln(file1,' Hold person.',error:=continue); X if (uand(%X'00000400',spells) <> 0) then X writeln(file1,' Cause blindness.',error:=continue); X if (uand(%X'00000800',spells) <> 0) then X writeln(file1,' Cause confusion.',error:=continue); X if (uand(%X'00001000',spells) <> 0) then X writeln(file1,' Cause fear.',error:=continue); X if (uand(%X'00002000',spells) <> 0) then X writeln(file1,' Summon a monster.',error:=continue); X if (uand(%X'00004000',spells) <> 0) then X writeln(file1,' Summon an undead.',error:=continue); X if (uand(%X'00008000',spells) <> 0) then X writeln(file1,' Slow person.',error:=continue); X if (uand(%X'00010000',spells) <> 0) then X writeln(file1,' Drains mana for healing.',error:=continue); X if (uand(%X'00020000',spells) <> 0) then X writeln(file1,' **Unknown spell value**',error:=continue); X if (uand(%X'00040000',spells) <> 0) then X writeln(file1,' **Unknown spell value**',error:=continue); X if (uand(%X'00080000',spells) <> 0) then X writeln(file1,' Breaths Lightning Dragon Breath.',error:=continu Ve); X if (uand(%X'00100000',spells) <> 0) then X writeln(file1,' Breaths Gas Dragon Breath.',error:=continue); X if (uand(%X'00200000',spells) <> 0) then X writeln(file1,' Breaths Acid Dragon Breath.',error:=continue); X if (uand(%X'00400000',spells) <> 0) then X writeln(file1,' Breaths Frost Dragon Breath.',error:=continue); X if (uand(%X'00800000',spells) <> 0) then X writeln(file1,' Breaths Fire Dragon Breath.',error:=continue); X end; X`09`7B Movement for creature `7D Xwriteln(file1,' --Movement =',error:=continue); Xif (uand(%X'00000001',cmove) <> 0) then X writeln(file1,' Move only to attack.',error:=continue); Xif (uand(%X'00000002',cmove) <> 0) then X writeln(file1,' Move and attack normally.',error:=continue); Xif (uand(%X'00000008',cmove) <> 0) then X writeln(file1,' 20% random movement.',error:=continue); Xif (uand(%X'00000010',cmove) <> 0) then X writeln(file1,' 40% random movement.',error:=continue); Xif (uand(%X'00000020',cmove) <> 0) then X writeln(file1,' 75% random movement.',error:=continue); Xif (uand(%X'00020000',cmove) <> 0) then X writeln(file1,' Can open doors.',error:=continue); Xif (uand(%X'00040000',cmove) <> 0) then X writeln(file1,' Can phase through walls.',error:=continue); Xwriteln(file1,' --Creature attacks =',error:=continue); Xattstr := damage; Xwhile (length(attstr) > 0) do X begin X xpos := index(attstr,'`7C'); X if (xpos > 0) then X begin X`09attx := substr(attstr,1,xpos-1); X`09attstr := substr(attstr,xpos+1,length(attstr)-xpos); X end X else X begin X`09attx := attstr; X`09attstr := ''; X end; X readv(attx,atype,adesc,damstr); X out_val := ''; X case adesc of X`091 : out_val := ' Hits for '; X`092 : out_val := ' Bites for '; X`093 : out_val := ' Claws for '; X`094 : out_val := ' Stings for '; X`095 : out_val := ' Touches for '; X`096 : out_val := ' Kicks for '; X`097 : out_val := ' Gazes for '; X`098 : out_val := ' Breathes for '; X`099 : out_val := ' Spits for '; X`0910: out_val := ' Wails for '; X`0911: out_val := ' Embraces for '; X`0912: out_val := ' Crawls on you for '; X`0913: out_val := ' Shoots spores for '; X`0914: out_val := ' Begs for money for '; X`0915: out_val := ' Slimes you for '; X`0916: out_val := ' Crushes you for '; X`0917: out_val := ' Tramples you for '; X`0999: out_val := ' Is repelled...'; X`09otherwise out_val := ' **Unknown value** '; X end; X case atype of X`7BNormal attack `7D 1 : out_val := out_val + 'normal damage.'; X`7BPoison Strength`7D 2 : out_val := out_val + 'lowering strength.'; X`7BConfusion attack`7D 3 : out_val := out_val + 'confusion.'; X`7BFear attack `7D 4 : out_val := out_val + 'fear.'; X`7BFire attack `7D 5 : out_val := out_val + 'fire damage.'; X`7BAcid attack `7D 6 : out_val := out_val + 'acid damage.'; X`7BCold attack `7D 7 : out_val := out_val + 'cold damage.'; X`7BLightning attack`7D 8 : out_val := out_val + 'lightning damage.'; X`7BCorrosion attack`7D 9 : out_val := out_val + 'corrosion damage.'; X`7BBlindness attack`7D 10 : out_val := out_val + 'blindness.'; X`7BParalysis attack`7D 11 : out_val := out_val + 'paralyzation.'; X`7BSteal Money `7D 12 : out_val := out_val + 'stealing money.'; X`7BSteal Object `7D 13 : out_val := out_val + 'stealing object.'; X`7BPoison `7D 14 : out_val := out_val + 'poison damage.'; X`7BLose Dex `7D 15 : out_val := out_val + 'lose dexterity.'; X`7BLose Con `7D 16 : out_val := out_val + 'lose constitution.'; X`7BLose Int `7D 17 : out_val := out_val + 'lose intelligence.'; X`7BLose Wis `7D 18 : out_val := out_val + 'lose wisdom.'; X`7BLose Exp `7D 19 : out_val := out_val + 'lose experience.'; X`7BAggravation `7D 20 : out_val := out_val + 'aggravates monsters.'; X`7BDisenchant `7D 21 : out_val := out_val + 'disenchants objects.'; X`7BEats food `7D 22 : out_val := out_val + 'eating food.'; X`7BEats light `7D 23 : out_val := out_val + 'eating light source.'; X`7BEats charges `7D 24 : out_val := out_val + 'absorbing charges.'; X`7B Special `7D 99 : out_val := out_val + 'blank message.'; X`09`09 otherwise out_val := out_val + '**Unknown value**'; X end; X out_val := out_val + ' (' + damstr + ')'; X writeln(file1,out_val,error:=continue); X end; X for i2 := 1 to 2 do writeln(file1,' ',error:=continue); Xend; X`09`7B End writing to file `7D X`09 close(file1,error:=continue); X`09 prt('Completed.',1,1); X`09 end; X`09end X end; X X X`09`7B Print the character to a file or device`09`09-RAK-`09`7D X`5Bpsect(misc2$code)`5D procedure file_character; X var X`09i1,i2,xbth,xbthb,xfos,xsrh,xstl,xdis : integer; X`09xsave,xdev : integer; X`09xinfra : vtype; X`09file1 : text; X`09out_val,filename1,prt1,prt2,new_page : vtype; X`09out_str,out_int,out_wis,out_dex,out_con,out_chr : stat_type; X X begin X prt('File name: ',1,1); X if (get_string(filename1,1,12,64)) then X`09begin X`09 if (length(filename1) = 0) then filename1 := 'MORIACHR.DAT'; X`09 open(file1,filename1,error:=continue); X`09 if (status(file1) = 0) then X`09 begin X`09 prt('Writing character sheet...',1,1); X`09 put_qio; X`09 rewrite(file1,error:=continue); X`09 new_page := chr(12); X`09 writeln(file1,new_page,error:=continue); X`09 cnv_stat(py.stat.cstr,out_str); X`09 cnv_stat(py.stat.cint,out_int); X`09 cnv_stat(py.stat.cwis,out_wis); X`09 cnv_stat(py.stat.cdex,out_dex); X`09 cnv_stat(py.stat.ccon,out_con); X`09 cnv_stat(py.stat.cchr,out_chr); X`09 writeln(file1,' ',error:=continue); X`09 writeln(file1,' ',error:=continue); X`09 writeln(file1,' ',error:=continue); Xwrite(file1, ' Name :',pad(py.misc.name,' ',25),error:=continue); Xwrite(file1, ' Age :',py.misc.age:4,error:=continue); Xwriteln(file1,' Strength :',out_str:6,error:=continue); Xwrite(file1, ' Race :',pad(py.misc.race,' ',25),error:=continue); Xwrite(file1, ' Height :',py.misc.ht:4,error:=continue); Xwriteln(file1,' Intelligence :',out_int:6,error:=continue); Xwrite(file1, ' Sex :',pad(py.misc.sex,' ',25),error:=continue); Xwrite(file1, ' Weight :',py.misc.wt:4,error:=continue); Xwriteln(file1,' Wisdom :',out_wis:6,error:=continue); Xwrite(file1, ' Class :',pad(py.misc.tclass,' ',25),error:=continue); Xwrite(file1, ' Social Class:',py.misc.sc:4,error:=continue); Xwriteln(file1,' Dexterity :',out_dex:6,error:=continue); +-+-+-+-+-+-+-+- END OF PART 23 +-+-+-+-+-+-+-+-