-+-+-+-+-+-+-+-+ START OF PART 7 -+-+-+-+-+-+-+-+ Vp_type); X if map_type = map_player then X begin X smg$put_chars(gwind,chr(count),y,x); X writev(s,chr(count),' - ',i:2,' - ',name`5Bna_player`5D.id`5Bi`5D); X add_x(s); X count := count + 1; X if count = ord('Z') then count := ord('a'); X if count = ord('z') then count := ord('A'); X end; X end; X draw_x; Xend; X Xprocedure do_who; Xvar X i:integer; X s:string; Xbegin X getint(n_location); X freeint; X getindex(i_ingame); X freeindex; X x_label('Who list'); X purge_x; X add_x('Game name Location'); X for i := 1 to maxplayers do X if indx`5Bi_ingame`5D.on`5Bi`5D and X (((an_int`5Bn_location`5D.int`5Bi`5D = here.valid) and indx`5Bi_npc`5D. Von`5Bi`5D) X`09or (not indx`5Bi_npc`5D.on`5Bi`5D)) then X begin X writev(s,write_nice(name`5Bna_player`5D.id`5Bi`5D,20),' ', X`09 write_nice(name`5Bna_room`5D.id`5Ban_int`5Bn_location`5D.int`5Bi`5D` V5D,8)); X add_x(s); X end; X draw_x; Xend; X Xprocedure do_password; Xvar X s,s1,s2:string; Xbegin X grab_line('Enter old password ',s,,false); X if (pl`5Bnow`5D.password = lowcase(s)) or checkprivs(10) then X begin X grab_line('Enter new password ',s1,,false); X grab_line('One more time for verification ',s2,,false); X if lowcase(s1) = lowcase(s2) then X begin X pl`5Bnow`5D.password := s1; X save_player; X wl('Password altered.'); X end X else wl('Try again.'); X end X else wl('It boggles the mind.'); Xend; X `20 Xprocedure do_players; Xvar X i:integer; X s:string; Xbegin X purge_x; X x_label('Player list'); X add_x(' # Game name Username'); X for i := 1 to maxplayers do X if indx`5Bi_player`5D.on`5Bi`5D then X begin X writev(s,i:2,' ',write_nice(name`5Bna_player`5D.id`5Bi`5D,17),' ',name`5 VBna_user`5D.id`5Bi`5D:8); X add_x(s); X end; X draw_x; Xend; X Xprocedure do_target; Xbegin X with plr`5Bnow`5D.target`5B1`5D do X if get_name(name`5Bna_player`5D.id,'Player to target',log) then X if log <> 0 then X wl(name`5Bna_player`5D.id`5Blog`5D+' is now targeted for termination.'); Xend; X Xprocedure do_name; Xvar X n:integer; X s:string; Xbegin X grab_line('New name ',s); X if valid_name(na_player,s) then X begin X name`5Bna_player`5D.id`5Bplr`5Bnow`5D.log`5D := s; X getname(na_player); X name`5Bna_player`5D.id`5Bplr`5Bnow`5D.log`5D := s; X putname(na_player); X wl('You are now known as '+s+'.'); X end; Xend; X `20 Xprocedure do_scroll; Xvar X s:string; X newratio:integer; Xbegin X wl('This is 1/ how close you are to the edge to get an update.'); X writev(s,'Currently 1/',scrollratio:2); X wl(s); X grab_num('Set to 1/',newratio,1,,5); X scrollratio := newratio; Xend; `20 X Xprocedure show_coordinates(x,y:integer); Xvar X s:string; Xbegin X writev(s,'`5B',x:3,'`5D `5B',y:3,'`5D'); X wl(s); Xend; X Xprocedure do_identify; Xvar X fg_slot,i:integer; X s:string; Xbegin X for i := 1 to fg_layers do X begin X fg_slot := fg.map`5Bpl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y,i`5D; X if fg_slot <> 0 then X with fg.effect`5Bfg_slot`5D do X begin X writev(s,write_nice(fg.name`5Bfg_slot`5D,20), X`09boo(fg.effect`5Bfg_slot`5D.on), X`09' ( # ',fg_slot:2,') >'+icon, X`09'< `5BKind '+fg_type`5Bkind`5D, X`09'`5D`5BBase ',base:2, X`09'`5D`5BAltitude ',altitude:2,'`5D'); X wl(s); X end; X end; Xend; X Xfunction do_cast(sn:integer := 0; auto_cast:boolean := false; X`09`09 spell_name:shortstring := ''):boolean; Xvar X x,y,s_parm:integer; X an_act:actrec; X ok,did_cast:boolean := false; X X function can_cast:boolean; X begin X can_cast := false; X with spell do X begin X if frozen then wl('You are frozen!') X else if pl`5Bnow`5D.attrib`5Bat_mana`5D < mana then wl('Not enough man Va!') X else if not pl`5Bnow`5D.spell`5Bsn`5D then wl('You do not know that sp Vell!') X else if (rnum(100) + pl`5Bnow`5D.proficiency`5Bspell.element`5D < X spell.difficulty) then wl('You failed to get the spell off!') X else can_cast := true; X end; X end; X Xbegin X if (sn = 0) then ok := get_name(name`5Bna_spell`5D.id,'Spell',sn) X else ok := true; X if ok then X begin X if (sn <> spell.valid) then X begin X getspell(sn); X freespell; X end; X if spell_name = '' then spell_name := name`5Bna_spell`5D.id`5Bsn`5D; X if not auto_cast then ok := (can_cast or checkprivs(8)); X if ok then X with spell do X begin X did_cast := true; X if not auto_cast then X change_stat(at_mana,max(0,pl`5Bnow`5D.attrib`5Bat_mana`5D - mana)); X case effect of Xsp_hurt,sp_freeze,sp_teleport,sp_invisible: X`09begin X`09 if plr`5Bnow`5D.target`5B1`5D.log = 0 then X`09 plr`5Bnow`5D.target`5B1`5D.log := plr`5Bnow`5D.log; X`09 x := person`5Bplr`5Bnow`5D.target`5B1`5D.log`5D.loc.x; X`09 y := person`5Bplr`5Bnow`5D.target`5B1`5D.log`5D.loc.y; X`09 if (not indx`5Bi_offense`5D.on`5Bsn`5D) and (not spell.prompt) then X`09 begin X`09 x := pl`5Bnow`5D.where.x; X`09 y := pl`5Bnow`5D.where.y; X`09 end; X`09 if good_coordinates(x,y) then X`09 begin X`09 clear_shot(pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y,x,y, X`09 (pl`5Bnow`5D.proficiency`5Belement`5D * parm`5B4`5D) div 100); X`09 if (duration = 0) and (not spell.caster) then X`09 special_effect(geometry,geo1,geo2,pl`5Bnow`5D.where.x, X`09 pl`5Bnow`5D.where.y,x,y,icon,rendition); X`09 act_out(plr`5Bnow`5D.log,e_spell, X`09`09compress(x,y), X`09`09compress(geometry,geo1,geo2), X`09`09compress(effect,element), X`09`09compress( X`09`09(pl`5Bnow`5D.proficiency`5Belement`5D * parm`5B1`5D) div 100, X`09`09(pl`5Bnow`5D.proficiency`5Belement`5D * parm`5B2`5D) div 100), X`09`09compress( X`09`09(pl`5Bnow`5D.proficiency`5Belement`5D * parm`5B3`5D) div 100, X`09`09(pl`5Bnow`5D.proficiency`5Belement`5D * parm`5B4`5D) div 100), X`09`09compress(duration,rendition), X`09`09icon,spell_name); X`09 if caster then X`09 begin X`09 with an_act do X`09 begin X`09`09sender := plr`5Bnow`5D.log; X`09`09action := e_spell; X`09`09xloc := compress(x,y); X`09`09yloc := compress(geometry,geo1,geo2); X`09`09parm1 := compress(effect,element); X`09`09parm2 := compress( X`09`09(pl`5Bnow`5D.proficiency`5Belement`5D * parm`5B1`5D) div 100, X`09`09(pl`5Bnow`5D.proficiency`5Belement`5D * parm`5B2`5D) div 100); X`09`09parm3 := compress( X`09`09(pl`5Bnow`5D.proficiency`5Belement`5D * parm`5B3`5D) div 100, X`09`09(pl`5Bnow`5D.proficiency`5Belement`5D * parm`5B4`5D) div 100); X`09`09parm4 := compress(duration,rendition); X`09`09msg := icon; X`09`09note := spell_name; X`09 end; X`09 handle_spell(an_act); X`09 end; X`09 end; X`09end; X end; X draw_me; X if casterdesc <> '' then X begin X`09if plr`5Bnow`5D.target`5B1`5D.log <> 0 then X`09print(casterdesc,'Zot',name`5Bna_player`5D.id`5Bplr`5Bnow`5D.target`5B1`5 VD.log`5D) X`09else print(casterdesc,'Zot'); X end; X freeze(castingtime/100); X end; X end; X do_cast := did_cast; Xend; X `20 Xfunction select_weapon:integer; Xvar X i,num:integer := 1; X done:boolean := false; Xbegin X while (i < 10) and (not done) do X begin X i := i + 1; X num := rnum(maxnaturalweapon); X if plr`5Bnow`5D.n_weapon`5Bnum`5D <> 0 then done := true; X end; X if not done then X for i := 1 to maxnaturalweapon do X if plr`5Bnow`5D.n_weapon`5Bi`5D <> 0 then num := i; X select_weapon := num; Xend; X Xprocedure do_use; Xvar X destroy_chance,obj_slot:integer; Xbegin X if get_inv_slot('Use object?',obj_slot) then X begin X read_object(pl`5Bnow`5D.equipment`5Bobj_slot`5D.num); X if obj.spell = 0 then wl('Nothing happens.') X else X begin X do_cast(obj.spell,true); X if lookup_obj_parm(ef_destroy,destroy_chance) then X begin X`09if rnum(100) < destroy_chance then X`09wl('The '+name`5Bna_obj`5D.id`5Bobj.valid`5D+' is gone.'); X`09drop_object(obj_slot,false); X end; X end; X end; Xend; X Xfunction do_attack(weapon_used:integer := 0):boolean; Xvar X x,y:integer := 0; X destroy_chance,dir:integer; X at_char:char; X s:string; Xbegin X do_attack := false; X if plr`5Bnow`5D.target`5B1`5D.log <> 0 then X if person`5Bplr`5Bnow`5D.target`5B1`5D.log`5D.here then X if person`5Bplr`5Bnow`5D.target`5B1`5D.log`5D.alive then X begin X if plr`5Bnow`5D.weapon <> 0 then X do_attack := do_cast(plr`5Bnow`5D.weapon,true,plr`5Bnow`5D.weapon_name) X else X begin X if weapon_used <> 0 then X do_attack := do_cast(plr`5Bnow`5D.n_weapon`5Bweapon_used`5D,true) X else do_attack := do_cast(plr`5Bnow`5D.n_weapon`5Bselect_weapon`5D,tru Ve); X end; X end X else wl('Let the deceased rest.') X else wl('I do not believe that person is here.') X else wl('Maybe you should re-target.')`20 Xend; X Xprocedure do_poof; Xvar X toroom:loc; Xbegin X if not get_name(name`5Bna_room`5D.id,'Poof to',toroom.r) then X`09toroom.r := pl`5Bnow`5D.where.r; X getroom(toroom.r); X freeroom; X grab_num('X coordinate ',toroom.x,1,here.size.x,here.size.x div 2); X grab_num('Y coordinate ',toroom.y,1,here.size.y,here.size.y div 2); X poof_prime(toroom); Xend; X Xprocedure do_remote_poof; Xvar X toroom:loc; X log:integer; Xbegin X if get_name(name`5Bna_player`5D.id,'Player to poof',log) then X begin X if not get_name(name`5Bna_room`5D.id,'To room',toroom.r) then X`09toroom.r := pl`5Bnow`5D.where.r; X getroom(toroom.r); X freeroom; X grab_num('X coordinate ',toroom.x,1,here.size.x,pl`5Bnow`5D.where.x); X grab_num('Y coordinate ',toroom.y,1,here.size.y,pl`5Bnow`5D.where.y - 1) V; X if toroom.y < 1 then toroom.y := 2; X act_out(plr`5Bnow`5D.log,e_remotepoof,toroom.x,toroom.y,toroom.r,log,,,, V,true); X getroom(pl`5Bnow`5D.where.r); X freeroom; X end; Xend; X Xprocedure vp_center; Xvar X i:integer; Xbegin X grab_num('Horiz ',i); X vpmaxx := i; X grab_num('Vert ',i); X vpmaxy := i; Xend; X Xprocedure do_window; Xvar X redraw:boolean; X newx,newy:integer; Xbegin X redraw := false; X grab_num('Enter new X size, `5B3..48`5D ',newx,3,48,48); X grab_num('Enter new Y size, `5B3..15`5D ',newy,3,15,15); X if (newx <> myvpmaxx) or (newy <> myvpmaxy) then X begin X myvpmaxx := newx; X myvpmaxy := newy; X smg$begin_pasteboard_update(pasteboard); X draw_screen(true); X draw_me; X end; Xend; X Xprocedure do_open; Xvar X key:varying`5B1`5D of char; X fg_slot:integer; Xbegin X new_prompt('Toggle door (n,s,e,w)? '); X key := lowcase(getkey(key_get_direction)); X case key`5B1`5D of X'n','8':if pl`5Bnow`5D.where.y > 1 then X if foreground_found(pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y - 1,pl`5Bn Vow`5D.attrib_ex`5Bst_base`5D,pl`5Bnow`5D.attrib`5Bat_size`5D, X`09fg_door,fg_slot) then toggle_door(pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y V - 1,fg_slot,true); X's','2':if pl`5Bnow`5D.where.y < here.size.y then X if foreground_found(pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y + 1,pl`5Bn Vow`5D.attrib_ex`5Bst_base`5D,pl`5Bnow`5D.attrib`5Bat_size`5D, X`09fg_door,fg_slot) then toggle_door(pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y V + 1,fg_slot,true); X'e','6':if pl`5Bnow`5D.where.x < here.size.x then X if foreground_found(pl`5Bnow`5D.where.x + 1,pl`5Bnow`5D.where.y,pl`5Bn Vow`5D.attrib_ex`5Bst_base`5D,pl`5Bnow`5D.attrib`5Bat_size`5D, X`09fg_door,fg_slot) then toggle_door(pl`5Bnow`5D.where.x + 1,pl`5Bnow`5D.whe Vre.y,fg_slot,true); X'w','4':if pl`5Bnow`5D.where.x > 1 then X if foreground_found(pl`5Bnow`5D.where.x - 1,pl`5Bnow`5D.where.y,pl`5Bn Vow`5D.attrib_ex`5Bst_base`5D,pl`5Bnow`5D.attrib`5Bat_size`5D, X`09fg_door,fg_slot) then toggle_door(pl`5Bnow`5D.where.x - 1,pl`5Bnow`5D.whe Vre.y,fg_slot,true); X end; Xend; X Xend. $ CALL UNPACK SRCOM.PAS;1 1297060584 $ create 'f' X$ define/nolog root $1$dua12:`5Btemp.maself`5D X! This is where the .pas files are to be kept. X$ set process/priority = 4 X$ pn = "set proc/name = " X$ set def temp X! temp is a variable I have previously defined. I keep the scratch work out X! of my regular account this way. You might DEFINE TEMP SYS$SCRATCH or X! something like that. X$ if p1 .eqs. "D" X$ then X$ pas = "pascal/debug/noopt" X$ link = "link/debug" X$ endif X$ define makefile root:srgod.make X! Place where the makefile is kept. (W/ the .pas files...in my case). X$ make X$ write sys$output "Jinkies." $ CALL UNPACK SRGOD.COM;1 1782529760 $ create 'f' Xsrgod.exe: srgod.obj X`09pn "g_linking" X`09link srgod,srinit,srsys,srio,srother,srgodact,srcom,srop,srtime,srmap,srm Vove,srmisc,srmenu Xsrgod.obj: root:srgod.pas root:srclass.pas srinit.obj srsys.obj srio.obj sro Vther.obj srmisc.obj srmenu.obj srmap.obj srmove.obj srop.obj srcom.obj srgod Vact.obj srtime.obj X`09pn "srgod" X`09pas root:srgod Xsrinit.obj: root:srinit.pas X`09pn "srinit" X`09pas root:srinit Xsrsys.obj: srinit.obj root:srsys.pas X`09pn "srsys" X`09pas root:srsys Xsrio.obj: srsys.obj root:srio.pas X`09pn "srio" X`09pas root:srio Xsrother.obj: srio.obj root:srother.pas X`09pn "srother" X`09pas root:srother Xsrmisc.obj: srother.obj root:srmisc.pas X`09pn "srmisc" X`09pas root:srmisc Xsrmenu.obj: srother.obj root:srmenu.pas X`09pn "srmenu" X`09pas root:srmenu Xsrmap.obj: srmisc.obj root:srmap.pas X`09pn "srmap" X`09pas root:srmap Xsrmove.obj: srmap.obj root:srmove.pas X`09pn "srmove" X`09pas root:srmove Xsrop.obj: srmisc.obj srmenu.obj root:srop.pas X`09pn "srop" X`09pas root:srop Xsrcom.obj: srmove.obj root:srcom.pas X`09pn "srcom" X`09pas root:srcom Xsrgodact.obj: srmove.obj root:srgodact.pas X`09pn "srgodact" X`09pas root:srgodact Xsrtime.obj: srmove.obj root:srtime.pas X`09pn "srtime" X`09pas root:srtime $ CALL UNPACK SRGOD.MAKE;1 288192931 $ create 'f' X`5Binherit X('srinit','srsys','srio','srother','srop','srgodact','srcom','srmove', X 'srtime','srmisc','sys$library:starlet')`5D X Xprogram srgod(input,output); Xconst X silly_name_max = 138; Xvar X range:array`5B1..maxmonsters,1..maxnaturalweapon`5D of integer; X X silly_name:array`5B1..silly_name_max`5D of tinystring := ( X'Agroth','Agrit','Atamut','Ali Baba','Arnold','Aluzin','Aarg','Agmeish', X'Buster','Boozer','Brent','Bugzool','Butch','Barhirin','Broog','Bidmog', X'Buffy','Bonkme', +-+-+-+-+-+-+-+- END OF PART 7 +-+-+-+-+-+-+-+-