-+-+-+-+-+-+-+-+ START OF PART 21 -+-+-+-+-+-+-+-+ X BEGIN X prt('Writing Moria Dungeon Map...',1,1); X put_qio; X rewrite(file1,error:=continue); X i1 := 1; X i7 := 0; X repeat X i2 := 1; X i3 := i1 + outpage_height - 1; X if (i3 > cur_height) then X i3 := cur_height; X i7 := i7 + 1; X i8 := 0; X repeat X i4 := i2 + outpage_width - 1; X if (i4 > cur_width) then X i4 := cur_width; X i8 := i8 + 1; X writeln(file1,chr(12),error:=continue); X write(file1,'Section`5B',i7:1,',',i8:1,'`5D; ', X error:=continue); X writeln(file1,'Depth : ',(dun_level*50):1,' (feet)', X error:=continue); X writeln(file1,' ',error:=continue); X write(file1,' ',error:=continue); X for i5 := i2 to i4 do X BEGIN X i6 := trunc(i5/100); X write(file1,i6:1,error:=continue); X END; X writeln(file1,error:=continue); X write(file1,' ',error:=continue); X for i5 := i2 to i4 do X BEGIN X i6 := trunc(i5/10) - trunc(i5/100)*10; X write(file1,i6:1,error:=continue); X END; X writeln(file1,error:=continue); X write(file1,' ',error:=continue); X for i5 := i2 to i4 do X BEGIN X i6 := i5 - trunc(i5/10)*10; X write(file1,i6:1,error:=continue); X END; X writeln(file1,error:=continue); X for i5 := i1 to i3 do X BEGIN X writev(dun_line,i5:3); X for i6 := i2 to i4 do X BEGIN X if (test_light(i5,i6)) then X loc_symbol(i5,i6,tmp) X else X tmp := ' '; X dun_line := dun_line + tmp; X END; X writeln(file1,dun_line,error:=continue); X END; X i2 := i2 + outpage_width; X until (i2 >= cur_width); X i1 := i1 + outpage_height; X until (i1 >= cur_height); X close(file1,error:=continue); X prt('Completed.',1,1); X END; X END X END; X`20 X`20 X`7B Prints a list of random objects to a file. Note that the object file X is a sampling of objects which be expected to appear on that level. `7D X`5Bpsect(misc2$code)`5D procedure print_objects; X var X nobj,i1,i2,level : integer; X filename1,tmp_str : varying `5B80`5D of char; X file1 : text; X BEGIN X prt('Produce objects on what level?: ',1,1); X get_string(tmp_str,1,33,10); X level := 0; X readv(tmp_str,level,error:=continue); X prt('Produce how many objects?: ',1,1); X get_string(tmp_str,1,28,10); X nobj := 0; X readv(tmp_str,nobj,error:=continue); X if ((nobj > 0) and (level > -1) and (level < 1201)) then X BEGIN X if (nobj > 9999) then nobj := 9999; X prt('File name: ',1,1); X if (get_string(filename1,1,12,64)) then X BEGIN X if (length(filename1) = 0) then filename1 := 'MORIAOBJ.DAT'; X open(file1,filename1,error:=continue); X if (status(file1) = 0) then X BEGIN X writev(tmp_str,nobj:1); X prt(tmp_str + ' random objects being produced...',1,1); X put_qio; X rewrite(file1,error:=continue); X writeln(file1,'*** Random Object Sampling:',error:=continue); X writeln(file1,'*** ',nobj:1,' objects',error:=continue); X writeln(file1,'*** For Level ',level:1,error:=continue); X writeln(file1,'',error:=continue); X writeln(file1,'',error:=continue); X popt(i2); X for i1 := 1 to nobj do X BEGIN X t_list`5Bi2`5D := object_list`5Bget_obj_num(level)`5D; X magic_treasure(i2,level); X inventory`5Binven_max`5D := t_list`5Bi2`5D; X with inventory`5Binven_max`5D do X BEGIN X unquote(name); X known1(name); X known2(name); X END; X objdes(tmp_str,inven_max,true); X writeln(file1,tmp_str,error:=continue); X END; X pusht(i2); X close(file1,error:=continue); X prt('Completed.',1,1); X END X else X prt('File could not be opened.',1,1); X END; X END; X END; X`20 X`20 X`7B Prints a listing of monsters `7D X`5Bpsect(wizard$code)`5D procedure print_monsters; X var X i1,i2,xpos,atype,adesc : integer; X file1 : text; X out_val,filename1 : vtype; X attstr,attx : vtype; X damstr : dtype; X`20 X BEGIN X prt('File name: ',1,1); X if (get_string(filename1,1,12,64)) then X BEGIN X if (length(filename1) = 0) then filename1 := 'MORIAMON.DAT'; X open(file1,filename1,error:=continue); X if (status(file1) = 0) then X BEGIN X prt('Writing Monster Dictionary...',1,1); X put_qio; X rewrite(file1,error:=continue); X for i1 := 1 to max_creatures do X with c_list`5Bi1`5D do X BEGIN X`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 error:=continue); Xwriteln(file1,' AC =',ac:2, ' Eye-sight =',aaf:2,' HD =',hd:5, X error:=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`7B Creature casts spells / Breathes 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 ' 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,' Breathes Lightning Dragon Breath.',error:=contin Vue); X if (uand(%X'00100000',spells) <> 0) then X writeln(file1,' Breathes Gas Dragon Breath.',error:=continue); X if (uand(%X'00200000',spells) <> 0) then X writeln(file1,' Breathes Acid Dragon Breath.',error:=continue); X if (uand(%X'00400000',spells) <> 0) then X writeln(file1,' Breathes Frost Dragon Breath.',error:=continue); X if (uand(%X'00800000',spells) <> 0) then X writeln(file1,' Breathes Fire Dragon Breath.',error:=continue); X END; X`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 attx := substr(attstr,1,xpos-1); X attstr := substr(attstr,xpos+1,length(attstr)-xpos); X END X else X BEGIN X attx := attstr; X attstr := ''; X END; X readv(attx,atype,adesc,damstr); X out_val := ''; X CASE adesc of X 1 : out_val := ' Hits for '; X 2 : out_val := ' Bites for '; X 3 : out_val := ' Claws for '; X 4 : out_val := ' Stings for '; X 5 : out_val := ' Touches for '; X 6 : out_val := ' Kicks for '; X 7 : out_val := ' Gazes for '; X 8 : out_val := ' Breathes for '; X 9 : out_val := ' Spits for '; X 10: out_val := ' Wails for '; X 11: out_val := ' Embraces for '; X 12: out_val := ' Crawls on you for '; X 13: out_val := ' Shoots spores for '; X 14: out_val := ' Begs for money for '; X 15: out_val := ' Slimes you for '; X 16: out_val := ' Crushes you for '; X 17: out_val := ' Tramples you for '; X 18: out_val := ' Drools on you for '; X`0919: out_val := ' "Iggy attacks" you for '; X`0920: out_val := ' Touches you with its tentacles for '; X 99: out_val := ' Is repelled...'; X otherwise out_val := ' **Unknown description** '; X END; X CASE atype of X`7BNormal attack `7D 1 : out_val := out_val + 'normal damage.'; +-+-+-+-+-+-+-+- END OF PART 21 +-+-+-+-+-+-+-+-