-+-+-+-+-+-+-+-+ START OF PART 15 -+-+-+-+-+-+-+-+ XThe entrance to the Alchemy Shop is a '5'. X X3 Armory X The Armory is where the town's armor is fashioned. All Xsorts of protective gear may be bought and sold here. The Xentrance to the Armory is a '2'. X X3 General Store X The General Store sells foods, drinks, some clothing, Xtorches, lamps, oil, and spikes. All of these items, and others, Xcan be sold back to the General store for money. The entrance to Xthe General Store is a '1'. X X3 Magic User's Shop X The Magic User's Shop is the most expensive of all the Xstores. It deals in all sorts of rings, wands, amulets, and Xstaves. The entrance to the Magic Shop is a '6'. X X3 Temple X The Temple deals in healing and restoration potions, as well Xas bless scrolls, word-of-recall scrolls, some approved priestly Xweapons, etc. The entrance to the Temple is a '4'. X X3 Weaponsmith's Shop X The Weaponsmith's Shop is where the town's weapons are Xfashioned. Hand and missile weapons may be purchased and sold Xhere, along with arrows, bolts, and shots. The entrance to the XWeaponsmiths is a '3'. X X2 Supplies X Your character will begin his adventure with some supplies Xalready on him. Use the Inventory 'i' command to check what Xthese supplies are. It will be necessary to buy other supplies Xbefore continuing into the dungeon, however, so be sure to enter Xeach of the stores. X X2 Townsmen X The town contains many different kinds of people. There are Xthe street urchins, young children who will mob an adventurer for Xmoney, and seem to come out of the woodwork when excited. XBlubbering Idiots which are a constant anoyance, but not harmful. XPublic drunks which wander about the town singing, and are of no Xthreat to anyone. Sneaky rogues, which hang about watching for a Xlikely victim to mug. And finally, what town would be complete Xwithout a swarm of half drunk warriors, who take offense or Xbecome annoyed just for the fun of it. X X Most of the towns people should be avoided by the largest Xpossible distance when you wander from store to store. Fights Xwill break out though, so be prepared. Since your character grew Xup in this world of intrigue, no experience is awarded for Xkilling on the town level. $ CALL UNPACK [.EXECUTE]MORIAHLP.HLP;1 1210322776 $ create 'f' X`7B Moria Version 4.8`09COPYRIGHT (c) Robert Alan Koeneke`09`09`7D X`7B Public Domain `7 VD X`7B `7 VD X`7B I lovingly dedicate this game to hackers and adventurers `7 VD X`7B everywhere... `7 VD X`7B `7 VD X`7B `7 VD X`7B Designer and Programmer : Robert Alan Koeneke `7 VD X`7B University of Oklahoma `7 VD X`7B `7 VD X`7B Assitant Programmers : Jimmey Wayne Todd `7 VD X`7B University of Oklahoma `7 VD X`7B `7 VD X`7B Gary D. McAdoo `7 VD X`7B University of Oklahoma `7 VD X`7B `7 VD X`7B Moria may be copied and modified freely as long as the above `7 VD X`7B credits are retained. No one who-so-ever may sell or market `7 VD X`7B this software in any form without the expressed written consent `7 VD X`7B of the author Robert Alan Koeneke. `7 VD X`7B `7 VD X`5Benvironment('moria.env')`5D program moria(input,output); X X`09`7B Globals`09`09`09`09`09`09-RAK-`09`7D X`09%INCLUDE 'MOR_INCLUDE:CONSTANTS.INC' X`09%INCLUDE 'MOR_INCLUDE:TYPES.INC' X`09%INCLUDE 'MOR_INCLUDE:VARIABLES.INC' X`09%INCLUDE 'MOR_INCLUDE:VALUES.INC' X X`09`7B Libraries of routines `09`09`09`09-RAK-`09`7D X`09%INCLUDE 'MOR_INCLUDE:IO.INC' X`09%INCLUDE 'MOR_INCLUDE:MISC.INC' X`09%INCLUDE 'MOR_INCLUDE:DEATH.INC' X`09%INCLUDE 'MOR_INCLUDE:HELP.INC' X`09%INCLUDE 'MOR_INCLUDE:DESC.INC' X`09%INCLUDE 'MOR_INCLUDE:FILES.INC' X`09%INCLUDE 'MOR_INCLUDE:STORE1.INC' X`09%INCLUDE 'MOR_INCLUDE:SAVE.INC' X`09%INCLUDE 'MOR_INCLUDE:CREATE.INC' X`09%INCLUDE 'MOR_INCLUDE:GENERATE.INC' X`09%INCLUDE 'MOR_INCLUDE:MORIA.INC' X X X`09`7B TERMDEF is external so that new terminals can be defined-RAK- `7D X`09`7B wihtout recompiling the entire source. `7D X`09`5Bexternal`5D procedure termdef; X`09 external; X X`09`7B Initialize, restore, and get the ball rolling...`09-RAK-`09`7D X begin X X`09`7B SYSPRV stays off except when needed...`09`7D X priv_switch(0); X X`09`7B Check the terminal type and see if it is supported`7D X termdef; X X`09`7B Get the directory location of the image`09`7D X get_paths; X X`09`7B Setup pause time for IO`09`09`09`7D X setup_io_pause; X X`09`7B Some neccesary initializations`09`09`7D X msg_line := 1; X quart_height := trunc(screen_height/4); X quart_width := trunc(screen_width /4); X dun_level := 0; X X`09`7B Init an IO channel for QIO`09`09`09`7D X init_channel; X X`09`7B Grab a random seed from the clock`09`09`7D X seed := get_seed; X X`09`7B Sort the objects by level`09`09`09`7D X sort_objects; X X`09`7B Init monster and treasure levels for allocate `7D X init_m_level; X init_t_level; X X`09`7B Init the store inventories`09`09`09`7D X store_init; X if (cost_adj <> 1.00) then price_adjust; X X`09`7B Build the secret wizard and god passwords`09`7D X bpswd; X X`09`7B Check operating hours `09`09`09`7D X`09`7B If not wizard then No_Control_Y `7D X get_foreign(finam); X X`09`7B Check or create hours.dat, print message`09`7D X intro(finam); X X`09`7B Generate a character, or retrieve old one...`09`7D X if (length(finam) > 0) then X begin `7B Retrieve character `7D X`09generate := get_char(finam); X`09change_name; X`09magic_init(randes_seed); X end X else X begin `7B Create character `7D X`09create_character; X`09char_inven_init; X`09if (class`5Bpy.misc.pclass`5D.mspell) then X`09 begin `7B Magic realm `7D X`09 learn_spell(msg_flag); X`09 gain_mana(int_adj); X`09 end X`09else if (class`5Bpy.misc.pclass`5D.pspell) then X`09 begin `7B Clerical realm`7D X`09 learn_prayer; X`09 gain_mana(wis_adj); X`09 end; X`09py.misc.cmana := py.misc.mana; X`09randes_seed := seed; `7B Description seed `7D X`09town_seed := seed; `7B Town generation seed `7D X`09magic_init(randes_seed); X`09generate := true; X end; X X`09`7B Begin the game`09`09`09`09`7D X with py.misc do `7B This determines the maximum player level `7 VD X`09player_max_exp := trunc(player_exp`5Bmax_player_level-1`5D*expfact); X clear(1,1); X prt_stat_block; X X`09`7B Loop till dead, or exit`09`09`09`7D X repeat X if (generate) then generate_cave; `7B New level `7D X dungeon; `7B Dungeon logic `7D X generate := true; X until (death); X upon_death; `7B Character gets buried `7D X end. $ CALL UNPACK [.SOURCE]MORIA.PAS;1 2016941029 $ create 'f' X`5Binherit('moria.env')`5D module a; X`7B TERMDEF : uses the values returned by SYS$GETDVI to set up the proper`7 VD X`7B addressing codes. New terminals can be added, or existing ones `7 VD X`7B changed wihtout re-compiling the main source. You can use `7 VD X`7B compile.com by specifying: `7 VD X`7B $ cterm :== @DISK_NAME:`5BFILE_PATH`5Dcompile termdef V `7D X`5Bglobal`5D procedure termdef; X type X`09term_type = packed array `5B1..3`5D of char; X`09dvi_type = record X`09`09item_len : wordint; X`09`09item_code : wordint; X`09`09buff_add : `5Einteger; X`09`09len_add : `5Einteger; X`09`09end_item : integer; X`09end; X var X`09dvi_buff : dvi_type; X`09i1 : integer; X`09tmp_str : varying`5B10`5D of char; X`09tmp : char; X`09escape : char; X X `5Bexternal(SYS$GETDVI)`5D function get_dvi`09( X`09`09 efn : integer := %immed 0; X`09`09 chan : integer := %immed 0; X`09%stdescr terminal : term_type; X`09%ref itmlst : dvi_type; X`09`09 isob : integer := %immed 0; X`09`09 astadr : integer := %immed 0; X`09`09 astprm : integer := %immed 0; X`09`09 undefined : integer := %immed 0 X`09`09`09`09`09`09) : integer; X`09external; X X begin X escape := chr(27); X with dvi_buff do X begin X`09item_len := 4; X`09item_code := 6; X`09new(buff_add); X`09new(len_add); X`09end_item := 0; X end; X get_dvi(terminal:='TT:',itmlst:=dvi_buff); X`09`7B Add new terminals in this case statement. The case number is `7D X`09`7B returned by SYS$GETVI. Terminals are either row then col, or `7D X`09`7B col then row. `7D X`09`7B ROW_FIRST should be true if the row is given first. `7D X`09`7B CURSOR_ERL is the sequence for erase-to-end-of-line. `7D X`09`7B CURSOR_ERP is the sequence for erase-to-end-of-page. `7D X`09`7B CURLEN_R is the length of the ROW portion of cursor address `7D X`09`7B CURLEN_C is the length of the COL portion of cursor address `7D X`09`7B CURLEN_L is CURLEN_R + CURLEN_C `7D X`09`7B CURSOR_R is the ROW cursor portion characters `7D X`09`7B CURSOR_C is the COL cursor portion characters `7D X case dvi_buff.buff_add`5E of X`0917 : `7B ADM-3A (/FT2) `7D X`09`09begin X`09`09 row_first := true; `7B Sequence is row,col `7D X`09`09 cursor_erl := chr(24); X`09`09 cursor_erp := chr(23); X`09`09 curlen_r := 3; X`09`09 curlen_c := 1; X`09`09 cursor_l := 4; X`09`09 for i1 := 1 to 24 do X`09`09 begin X`09`09 tmp := chr(i1+31); `7B Row char`7D X`09`09 cursor_r`5Bi1`5D := escape + '=' + tmp; `7B Row part`7D X`09`09 end; X`09`09 for i1 := 1 to 80 do X`09`09 begin X`09`09 tmp := chr(i1+31); `7B Col char`7D X`09`09 cursor_c`5Bi1`5D := tmp; `7B Col part`7D X`09`09 end; X`09`09end; X`0918 : `7B ADDS100 (/FT3) `7D X`09`09begin X`09`09 row_first := true; `7B Sequence is row,col `7D X`09`09 cursor_erl := escape + 'K'; X`09`09 cursor_erp := escape + 'k'; X`09`09 curlen_r := 3; X`09`09 curlen_c := 1; X`09`09 cursor_l := 4; X`09`09 for i1 := 1 to 24 do X`09`09 begin X`09`09 tmp := chr(i1+31); `7B Row char`7D X`09`09 cursor_r`5Bi1`5D := escape + 'Y' + tmp; `7B Row part`7D X`09`09 end; X`09`09 for i1 := 1 to 80 do X`09`09 begin X`09`09 tmp := chr(i1+31); `7B Col char`7D X`09`09 cursor_c`5Bi1`5D := tmp; `7B Col part`7D X`09`09 end; X`09`09end; X`0919 : `7B IBM3101 (/FT4) `7D X`09`09begin X`09`09 row_first := true; `7B Sequence is row,col `7D X`09`09 cursor_erl := escape + 'I'; X`09`09 cursor_erp := escape + 'J'; X`09`09 curlen_r := 3; X`09`09 curlen_c := 1; X`09`09 cursor_l := 4; X`09`09 for i1 := 1 to 24 do X`09`09 begin X`09`09 tmp := chr(i1+39); `7B Row char`7D X`09`09 cursor_r`5Bi1`5D := escape + 'Y' + tmp; `7B Row part`7D X`09`09 end; X`09`09 for i1 := 1 to 80 do X`09`09 begin X`09`09 tmp := chr(i1+39); `7B Col char`7D X`09`09 cursor_c`5Bi1`5D := tmp; `7B Col part`7D X`09`09 end; X`09`09end; X`0916 : `7B Teleray 10 (/FT1) `7D X`09`09begin X`09`09 row_first := true; `7B Sequence is row,col `7D X`09`09 cursor_erl := escape + 'K'; X`09`09 cursor_erp := escape + 'J'; X`09`09 curlen_r := 3; X`09`09 curlen_c := 1; X`09`09 cursor_l := 4; X`09`09 for i1 := 1 to 24 do X`09`09 begin X`09`09 tmp := chr(i1+31); `7B Row char`7D X`09`09 cursor_r`5Bi1`5D := escape + 'Y' + tmp; `7B Row part`7D X`09`09 end; X`09`09 for i1 := 1 to 80 do X`09`09 begin X`09`09 tmp := chr(i1+31); `7B Col char`7D X`09`09 cursor_c`5Bi1`5D := tmp; `7B Col part`7D X`09`09 end; X`09`09end; X`0964 : `7B VT52 (/VT52) `7D X`09`09begin X`09`09 row_first := true; `7B Sequence is row,col `7D X`09`09 cursor_erl := escape + 'K'; X`09`09 cursor_erp := escape + 'J'; X`09`09 curlen_r := 3; X`09`09 curlen_c := 1; X`09`09 cursor_l := 4; X`09`09 for i1 := 1 to 24 do X`09`09 begin X`09`09 tmp := chr(i1+31); `7B Row char`7D X`09`09 cursor_r`5Bi1`5D := escape + 'Y' + tmp; `7B Row part`7D X`09`09 end; X`09`09 for i1 := 1 to 80 do X`09`09 begin X`09`09 tmp := chr(i1+31); `7B Col char`7D X`09`09 cursor_c`5Bi1`5D := tmp; `7B Col part`7D X`09`09 end; X`09`09end; X`0996,110: `7B VT100 and ANSI X3.64 standard (/VT100) `7D X`09`09`7B VT200 series terminals `7D X`09`09`7B Note that the row and column strings must always `7D X`09`09`7B of the same length `7D X`09`09begin X`09`09 row_first := true; `7B Sequence is row,col `7D X`09`09 cursor_erl := escape + '`5BK'; X`09`09 cursor_erp := escape + '`5BJ'; X`09`09 curlen_r := 4; X`09`09 curlen_c := 4; X`09`09 cursor_l := 8; X`09`09 for i1 := 1 to 24 do X`09`09 begin X`09`09 writev(tmp_str,'00',i1:1); `7B Row chars`7D +-+-+-+-+-+-+-+- END OF PART 15 +-+-+-+-+-+-+-+-