-+-+-+-+-+-+-+-+ START OF PART 20 -+-+-+-+-+-+-+-+ X reset_flag := false; X if (randint(100) < chance) then X msg_print('You failed to get the spell off!') X else X BEGIN X y_dumy := char_row; X x_dumy := char_col; X`7B Spells. `7D X CASE choice of X 1 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X fire_bolt(0,dir,char_row,char_col, X damroll('2d6')+1,'Magic Missle'); X 2 : detect_monsters; X 3 : teleport(10); X 4 : light_area(char_row,char_col); X 5 : hp_player(damroll('4d4'),'a magic spell.'); X 6 : BEGIN X detect_sdoor; X detect_trap; X END; X 7 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X fire_ball(2,dir,char_row,char_col,9,'Stinking Cloud'); X 8 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X confuse_monster(dir,char_row,char_col); X 9 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X fire_bolt(1,dir,char_row,char_col, X damroll('3d8')+1,'Lightning Bolt'); X 10 : td_destroy; X 11 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X sleep_monster(dir,char_row,char_col); X 12 : cure_poison; X 13 : teleport(py.misc.lev*5); X 14 : for i1 := 23 to inven_max-1 do X with inventory`5Bi1`5D do X flags := uand(flags,%X'7FFFFFFF'); X 15 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X fire_bolt(4,dir,char_row,char_col, X damroll('4d8')+1,'Frost Bolt'); X 16 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X wall_to_mud(dir,char_row,char_col); X 17 : ident_spell; X 18 : recharge(20); X 19 : sleep_monsters2_3(char_row,char_col,1); X 20 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X poly_monster(dir,char_row,char_col); X 21 : create_food; X 22 : sleep_monsters2_3(char_row,char_col,20); X 23 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X fire_bolt(5,dir,char_row,char_col, X damroll('6d8')+1,'Fire Bolt'); X 24 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X speed_monster(dir,char_row,char_col,-1); X 25 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X fire_ball(4,dir,char_row,char_col,33,'Frost Ball'); X 26 : recharge(50); X 27 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X teleport_monster(dir,char_row,char_col); X 28 : with py.flags do X fast := fast + randint(20) + py.misc.lev; X 29 : if (get_dir('Which direction?',dir,dumy,y_dumy,x_dumy)) then X fire_ball(5,dir,char_row,char_col,49,'Fire Ball'); X 30 : destroy_area(char_row,char_col); X 31 : genocide; X otherwise ; X END; X `7B END of spells.`7D X if (not(reset_flag)) then X with py.misc do X BEGIN X exp := exp + sexp; X prt_experience; X sexp := 0; X END X END; X with py.misc do X if (not(reset_flag)) then X BEGIN X if (smana > cmana) then X BEGIN X msg_print('You faint from the effort!' V); X py.flags.paralysis := X randint(5*trunc(smana-cmana)); X cmana := 0; X if (randint(3) = 1) then X BEGIN X msg_print('You have damaged your health!') V; X py.stat.ccon := de_statp(py.stat.ccon); X prt_constitution; X END; X END X else X cmana := cmana - smana; X prt_mana; X END X END X END X else X if (redraw) then draw_cave; X END X else X msg_print('But you are not carrying any spell-books!'); X END X else X msg_print('But you are not carrying any spell-books!') X else X msg_print('You can''t cast spells!'); X END; X `20 $ CALL UNPACK [.SOURCE.INCLUDE]EXTRA.INC;1 2015151485 $ create 'f' X`7B Attempt to open the intro file `7D X`5Bpsect(setup$code)`5D procedure intro(var finam : vtype); X var X xpos,i1 : integer; X dummy : char; X day_test,in_line: vtype; X file1 : text; X file2 : file of key_type; X exit_flag : boolean; X BEGIN X exit_flag := false; X clear(1,1); X`7B Attempt to read hours.dat. If it does not exist, then create a standard V one.`7D X priv_switch(1); X open(file1,file_name:=MORIA_HOU, X history:=readonly,sharing:=readonly,error:=continue); X if (status(file1) = 0) then X BEGIN X reset(file1); X repeat X readln(file1,in_line,error:=continue); X if (length(in_line) > 3) then X BEGIN X day_test := substr(in_line,1,4); X if (day_test = 'SUN:') then days`5B1`5D := in_line X else if (day_test = 'MON:') then days`5B2`5D := in_line X else if (day_test = 'TUE:') then days`5B3`5D := in_line X else if (day_test = 'WED:') then days`5B4`5D := in_line X else if (day_test = 'THU:') then days`5B5`5D := in_line X else if (day_test = 'FRI:') then days`5B6`5D := in_line X else if (day_test = 'SAT:') then days`5B7`5D := in_line; X END; X until(eof(file1)); X close(file1,error:=continue); X priv_switch(0); X END X else `7B Create a standard hours file `7D X BEGIN X priv_switch(0); X open(file1,file_name:=MORIA_HOU, X organization:=sequential,history:=new, X sharing:=readwrite,error:=continue); X if (status(file1) = 0) then X BEGIN X rewrite(file1,error:=continue); X writeln(file1,' Moria operating hours are:'); X writeln(file1,' `7C AM `7C PM `7C'); X writeln(file1,' 1 111 111'); X writeln(file1,' 2123456789012123456789012'); X for i1 := 1 to 7 do X writeln(file1,days`5Bi1`5D); X writeln(file1,' (X=Open; .=Closed)'); X close(file1,error:=continue); X writeln('Created ',MORIA_HOU); X exit_flag := true; X END X else X BEGIN X writeln('Error in creating ',MORIA_HOU); X exit; X END; X END; X`20 X`7B Check the hours, if closed then require password `7D X if (not(exit_flag)) then X BEGIN X xpos := index(finam,'/WIZARD'); X if ( xpos > 0) then X`7B Opusii `7D if (valid_user) then`20 X insert_str(finam,'/WIZARD',''); X if (not(wizard)) then X no_controly; X if (not(check_time)) then X if (not(wizard)) then X BEGIN X priv_switch(1); X open(file1,file_name:=MORIA_HOU, X history:=readonly,sharing:=readonly,error:=continue) V; X if (status(file1) = 0) then X BEGIN X reset(file1); X repeat X readln(file1,in_line); X writeln(in_line); X until(eof(file1)); X close(file1,error:=continue); X END; X priv_switch(0); X exit; X END; X END; X`20 X`7B Print the introduction message, news, ect.`7D X priv_switch(1); X open(file1,file_name:=MORIA_MOR, X organization:=sequential,history:=old, X sharing:=readwrite,error:=continue); X if (status(file1) = 0) then X BEGIN X if (not(exit_flag)) then X BEGIN X reset(file1); X repeat X readln(file1,in_line,error:=continue); X writeln(in_line); X until (eof(file1)); X pause_exit(24,0); X close(file1,error:=continue); X END X else X close(file1,error:=continue); X priv_switch(0); X END X else `7B Create one.`7D X BEGIN X priv_switch(0); X open(file1,file_name:=MORIA_MOR, X organization:=sequential,history:=new, X sharing:=readwrite,error:=continue); X if (status(file1) = 0) then X BEGIN X rewrite(file1,error:=continue); Xwriteln(file1,' *************************'); Xwriteln(file1,' ** Moria UB ',cur_version:4:2,' V **'); Xwriteln(file1,' *************************'); Xwriteln(file1,' COPYRIGHT (c) Robert Alan Koeneke'); Xwriteln(file1,' '); Xwriteln(file1,'Programers : Robert Alan Koeneke / University of Oklahoma'); Xwriteln(file1,' Jimmey Wayne Todd / University of Oklahoma'); Xwriteln(file1,' '); Xwriteln(file1,' '); Xwriteln(file1,'Modified by: Bill Palter / State University of New York') V; Xwriteln(file1,' Nick B Triantos / State University of New York') V; Xwriteln(file1,' `09`09`09`09`09`09'); Xwriteln(file1,' '); Xwriteln(file1,'Dungeon Master: This file may contain updates and news.'); X close(file1,error:=continue); X writeln('Created ',MORIA_MOR); X exit_flag := true; X END X else X BEGIN X writeln('Error in creating ',MORIA_MOR); X exit; X END; X END; X`7B Check for MASTER.DAT `7D X priv_switch(1); X open (file2,file_name:=moria_mas, X access_method:=keyed,organization:=indexed,history:=readonly V, X sharing:=readwrite,error:=continue); X if (status(file2) <> 0) then X BEGIN X priv_switch(0); X open (file2,file_name:=moria_mas, X access_method:=keyed,organization:=indexed,history:=new, X sharing:=readwrite,error:=continue); X if (status(file2) = 0) then X BEGIN X writeln('Created ',MORIA_MAS); X close(file2,error:=continue); X exit_flag := true; X END X else X BEGIN X writeln('Error in creating ',MORIA_MAS); X exit; X END; X END X else X BEGIN X close(file2,error:=continue); X priv_switch(0); X END; X`7B Check for TOPTWENTY.DAT `7D X priv_switch(1); X open (file1,file_name:=moria_top, X organization:=sequential,history:=readonly, X sharing:=readwrite,error:=continue); X if ((status(file1) <> 0) and (status(file1) <> 2)) then X BEGIN X priv_switch(0); X open (file1,file_name:=moria_top, X organization:=sequential,history:=new, X sharing:=readwrite,error:=continue); X if (status(file1) = 0) then X BEGIN X writeln('Created ',MORIA_TOP); X close(file1,error:=continue); X exit_flag := true; X END X else X BEGIN X writeln('Error in creating ',MORIA_TOP); X exit; X END; X END X else X BEGIN X close(file1,error:=continue); X priv_switch(0); X END; X if (exit_flag) then X BEGIN X writeln('Notice: System MORIA wizard should set the protection') V; X writeln(' on files just created. See INSTALL.HLP for') V; X writeln(' help on setting protection on the files.'); X writeln('Notice: File HOURS.DAT may be edited to set operating') V; X writeln(' hours for MORIA.'); X writeln('Notice: File MORIA.DAT may be edited to contain news') V; X writeln(' items, etc...'); X exit; X END; X END; X`20 X`20 X`7B Prints dungeon map to external file `7D X`5Bpsect(misc2$code)`5D procedure print_map; X var X i1,i2,i3,i4,i5,i6,i7,i8 : integer; X dun_line: varying `5B133`5D of char; X filename1 : varying `5B80`5D of char; X tmp : char; X file1 : text; 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 := 'MORIAMAP.DAT'; X open(file1,filename1,error:=continue); X if (status(file1) = 0) then +-+-+-+-+-+-+-+- END OF PART 20 +-+-+-+-+-+-+-+-