-+-+-+-+-+-+-+-+ START OF PART 15 -+-+-+-+-+-+-+-+ Xbarter with the owner for items you can afford. But be warned Xthat the owners can easily be insulted, and may even throw you Xout for a while if you insult them too often. To enter a store, Xsimply move onto the entrance represented by the numbers 1 Xthrough 6. X X Once inside a store, his inventory will appear on the screen Xalong with a set of options for your character. You may browse Xthe store's inventory if it takes more than one page to display, Xand you may sell or purchase items in his inventory. You can Xexecute your inventory and equipment commands to see what you are Xcarrying. Not shown with the options are the wear, take-off, and Xexchange commands which will also work, but were excluded to keep Xthe options simple. X X Stores do not always have everything in stock. As the game Xprogresses, they may get new items so check from time to time. XAlso, if you sell them an item, it may get sold to a customer Xwhile you are adventuring so don't always expect to be able to Xget back anything you have sold. X X Store owners will not buy harmful or useless items. If an Xobject is unidentified, they will pay you some base price for it. XOnce they have bought it they will immediately identify the Xobject. If it is a good object, they will add it to their Xinventory. If it was a bad bargain, they simply throw the item Xaway. In any case, you may receive some knowledge of the if Xanother is encountered. X X3 Alchemy shop X The Alchemy Shop deals in all manner of potions and scrolls. 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 M4.40`09COPYRIGHT (c) Robert Alan Koeneke`09`09`7D X`7B`09`09`09Public Domain`09`09`09`09`09`7D X`7B`09`09`09`09`09`09`09`09`09`7D X`7B`09I lovingly dedicate this game to hackers and adventurers`09`7D X`7B`09everywhere...`09`09`09`09`09`09`09`7D X`7B`09`09`09`09`09`09`09`09`09`7D X`7B`09`09`09`09`09`09`09`09`09`7D X`7B`09Designer and Programmer : Robert Alan Koeneke`09`09`09`7D X`7B`09`09`09`09 University of Oklahoma`09`09`7D X`7B`09Assitant Programmer`09: Jimmey Wayne Todd`09`09`09`7D X`7B`09`09`09`09 University of Oklahoma`09`09`7D X`7B`09`09`09`09`09`09`09`09`09`7D X`7B`09Moria may be copied and modified freely as long as the above`09`7D X`7B`09credits are retained. No one who-so-ever may sell or market`09`7D X`7B`09this software in any form without the expressed written`09consent`09`7 VD X`7B`09of the author Robert Alan Koeneke.`09`09`09`09`7D X`7B`09`09`09`09`09`09`09`09`09`7D 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`5Bexternal,asynchronous`5D function oh_no( X`09`09var sa : array `5B$u1..$u2:integer`5D of integer; X`09`09var ma : array `5B$u3..$u4:integer`5D of `5Bunsafe`5D integer) X`09`09 : `5Bunsafe`5D integer; X`09 external; X`09`7B Libraries of routines`09`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`09`7B TERMDEF is external so that new terminals can be defined-RAK-`09`7D X`09`7B wihtout recompiling the entire source.`09`09`09`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 establish(oh_no);`09`7B Establish error trap handler `7D 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`09`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`09`7D X`09`7B If not wizard then No_Control_Y`09`09`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`09`7B Retrieve character`09`7D X`09generate := get_char(finam); X`09change_name; X`09magic_init(randes_seed); X end X else X begin`09`7B Create character`09`7D X`09create_character; X`09char_inven_init; X`09if (class`5Bpy.misc.pclass`5D.mspell) then X`09 begin`09`09`7B Magic realm`09`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`09`09`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;`09`09`7B Description seed`09`7D X`09town_seed := seed;`09`09`7B Town generation seed`09`7D X`09magic_init(randes_seed); X`09generate := true; X end; X X`09`7B Begin the game`09`09`09`09`7D 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;`09`09`7B New level`09`7D X dungeon;`09`09`09`09`09`7B Dungeon logic`09`7D X generate := true; X until (death); X upon_death;`09`09`09`09`7B Character gets buried`09`7D X end. $ CALL UNPACK [.SOURCE]MORIA.PAS;1 1848117095 $ 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`09addressing codes. New terminals can be added, or existing ones`09`7D X`7B`09changed wihtout re-compiling the main source. You can use`09`7D X`7B`09compile.com by specifying:`09`09`09`09`09`7D X`7B`09`09$ cterm :== @DISK_NAME:`5BFILE_PATH`5Dcompile termdef`09`7D X X`5Bglobal`5D procedure termdef; X type X`09term_type`09=`09packed array `5B1..3`5D of char; X`09dvi_type`09=`09record X`09`09item_len`09: wordint; X`09`09item_code`09: wordint; X`09`09buff_add`09: `5Einteger; X`09`09len_add`09`09: `5Einteger; X`09`09end_item`09: integer; X`09end; X const X`09tt$m_eightbit = 32768; X`09tt2$m_ansicrt = 16777216; X`09tt2$m_deccrt2 = 1073741824; X`09dvi$_devtype = 6; X`09dvi$_devdepend = 10; X`09dvi$_devdepend2 = 28; X var X`09dvi_buff`09: dvi_type; X`09i1`09`09: integer; X`09tmp_str`09`09: varying`5B10`5D of char; X`09tmp`09`09: char; X`09escape`09`09: char; X`09csi`09`09: char; X`09devdepend`09: integer; X`09devdepend2`09: integer; X`09term_code`09: integer; X`09ansi_crt, X`09eightbit`09: boolean; X `5Bexternal(SYS$GETDVI)`5D function get_dvi`09( X`09`09 efn`09`09: integer := %immed 0; X`09`09 chan`09`09: integer := %immed 0; X`09%stdescr terminal`09: term_type; X`09%ref`09 itmlst`09`09: dvi_type; X`09`09 isob`09`09: integer := %immed 0; X`09`09 astadr`09`09: integer := %immed 0; X`09`09 astprm`09`09: integer := %immed 0; X`09`09 undefined`09: integer := %immed 0 X`09`09`09`09`09`09) : integer; X`09external; X X begin X escape := chr(27); X csi := chr(155); X with dvi_buff do X begin X`09item_len := 4; X`09item_code := dvi$_devtype; X`09new(buff_add); X`09new(len_add); X`09end_item := 0; X end; X get_dvi(terminal:='TT:',itmlst:=dvi_buff); X term_code := dvi_buff.buff_add`5E; X with dvi_buff do X`09item_code := dvi$_devdepend; X get_dvi(terminal:='TT:',itmlst:=dvi_buff); X devdepend := dvi_buff.buff_add`5E; X with dvi_buff do X`09item_code := dvi$_devdepend2; X get_dvi(terminal:='TT:',itmlst:=dvi_buff); X devdepend2 := dvi_buff.buff_add`5E; X `09`7B Determine the generic terminal type.`09`09`09`09`7D X`09`7B set the following variables:`09`09`09`09`09`7D X`09`7B`09ANSI_CRT true if TT2$M_ANSICRT is set`09`09`09`7D X`09`7B`09EIGHTBIT true if TT$M_EIGHTBIT and TT2$M_DECCRT2 set`09`7D X`09if uand(devdepend2,tt2$m_ansicrt) <> 0 then`09`7B It's an ANSI crt `7D X`09`09term_code := 96;`09`09`09`7B Force to VT100 type `7D X`09eightbit := (uand(devdepend2,tt2$m_deccrt2) <> 0) and X`09`09 (uand(devdepend,tt$m_eightbit) <> 0); X`09`7B Add new terminals in this case statement. The case number is`09`7D X`09`7B returned by SYS$GETVI. Terminals are either row then col, or`09`7D X`09`7B col then row.`09`09`09`09`09`09`09`7D X`09`7B ROW_FIRST should be true if the row is given first. `09`7D X`09`7B CURSOR_ERL is the sequence for erase-to-end-of-line.`09`7D X`09`7B CURSOR_ERP is the sequence for erase-to-end-of-page.`09`7D X`09`7B CURLEN_R is the length of the ROW portion of cursor address`09`7D X`09`7B CURLEN_C is the length of the COL portion of cursor address`09`7D X`09`7B CURLEN_L is CURLEN_R + CURLEN_C`09`09`09`09`7D X`09`7B CURSOR_R is the ROW cursor portion characters`09`09`7D X`09`7B CURSOR_C is the COL cursor portion characters`09`09`7D X case term_code of X`0917 :`09`7B ADM-3A (/FT2)`09`09`09`7D X`09`09begin X`09`09 row_first := true;`09`7B Sequence is row,col`09`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);`09`09`09`7B Row char`7D X`09`09 cursor_r`5Bi1`5D := escape + '=' + tmp;`09`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);`09`09`09`7B Col char`7D X`09`09 cursor_c`5Bi1`5D := tmp;`09`09`09`7B Col part`7D X`09`09 end; X`09`09end; X`0918 :`09`7B ADDS100 (/FT3)`09`09`09`7D X`09`09begin X`09`09 row_first := true;`09`7B Sequence is row,col`09`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);`09`09`09`7B Row char`7D X`09`09 cursor_r`5Bi1`5D := escape + 'Y' + tmp;`09`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);`09`09`09`7B Col char`7D X`09`09 cursor_c`5Bi1`5D := tmp;`09`09`09`7B Col part`7D X`09`09 end; X`09`09end; X`0919 :`09`7B IBM3101 (/FT4)`09`09`09`7D X`09`09begin X`09`09 row_first := true;`09`7B Sequence is row,col`09`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);`09`09`09`7B Row char`7D X`09`09 cursor_r`5Bi1`5D := escape + 'Y' + tmp;`09`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);`09`09`09`7B Col char`7D X`09`09 cursor_c`5Bi1`5D := tmp;`09`09`09`7B Col part`7D X`09`09 end; X`09`09end; X`0916 :`09`7B Teleray 10 (/FT1)`09`09`09`7D X`09`09begin X`09`09 row_first := true;`09`7B Sequence is row,col`09`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);`09`09`09`7B Row char`7D X`09`09 cursor_r`5Bi1`5D := escape + 'Y' + tmp;`09`7B Row part`7D +-+-+-+-+-+-+-+- END OF PART 15 +-+-+-+-+-+-+-+-