-+-+-+-+-+-+-+-+ START OF PART 6 -+-+-+-+-+-+-+-+ X else wl('There''s no room here.',echo); X end X else wl('You''ll have to take that to another shop.'); X end X else wl('Better check your inventory.',echo); Xend; X Xprocedure do_duplicate; Xvar X n,obj_slot:integer; X an_object:uniqueobj; Xbegin X if get_name(name`5Bna_obj`5D.id,'Duplicate: ',n) then X begin X with an_object do X begin X num := n; X condition := 100; X end; X obj_slot := place_object(an_object,pl`5Bnow`5D.where.x,pl`5Bnow`5D.where V.y,pl`5Bnow`5D.attrib_ex`5Bst_base`5D); X if obj_slot > 0 then X begin X act_out(plr`5Bnow`5D.log,e_drop,pl`5Bnow`5D.where.x,pl`5Bnow`5D.where. Vy,n,obj_slot,normal,,name`5Bna_obj`5D.id`5Bn`5D); X wl(name`5Bna_obj`5D.id`5Bn`5D+' duplicated.'); X end X else wl('There is no space here.'); X end; Xend; X Xprocedure do_pray; Xvar X fg_slot,num_points:integer := 0; X ok:boolean := true; X X procedure update_player; X begin X if pl`5Bnow`5D.attrib`5Bat_points`5D > 0 then X pl`5Bnow`5D.attrib`5Bat_points`5D := pl`5Bnow`5D.attrib`5Bat_points`5D - V num_points; X getplayer(plr`5Bnow`5D.log); X player := pl`5Bnow`5D; X putplayer; X stats; X wl('Your prayers have been answered!'); X if window_name = name`5Bna_player`5D.id`5Bplr`5Bnow`5D.log`5D then show_ Vstats; X end; X X procedure select_spell; X var X an_index:indexrec; X i,j,sn:integer; X found:boolean := false; X begin X for i := 1 to indx`5Bi_spell`5D.top do an_index.on`5Bi`5D := false; X i := 0; X while (i < 100) and (not found) do X begin X i := i + 1; X sn := rnum(indx`5Bi_spell`5D.top); X if (not an_index.on`5Bsn`5D) and not pl`5Bnow`5D.spell`5Bsn`5D then X begin X an_index.on`5Bsn`5D := true; X getspell(sn); X`09freespell; X if spell.element = fg.effect`5Bfg_slot`5D.fparm2 then X`09begin X`09 found := true; X`09 pl`5Bnow`5D.spell`5Bsn`5D := true; X`09 save_player; X`09 wl('You have learned the '+name`5Bna_spell`5D.id`5Bsn`5D+' spell!'); X`09end; X end; X end; X end; X X function curve(current,maximum:integer; step:integer := 1):integer; X var X i:integer; X total:real; X begin X total := current; X for i := 1 to num_points do X total := total + step*(1 - total/maximum); X curve := trunc(total); X end; X Xbegin X if not foreground_found(pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y,pl`5Bnow`5 VD.attrib_ex`5Bst_base`5D,pl`5Bnow`5D.attrib`5Bat_size`5D, X`09`09`09fg_college,fg_slot) then ok := false X else wl('You fall to your knees.'); X if pl`5Bnow`5D.attrib`5Bat_points`5D > 0 then num_points := pl`5Bnow`5D.at Vtrib`5Bat_points`5D X else if pl`5Bnow`5D.attrib_ex`5Bst_experience`5D < 100 then X begin X pl`5Bnow`5D.attrib_ex`5Bst_experience`5D := pl`5Bnow`5D.attrib_ex`5Bst_e Vxperience`5D + 10; X num_points := 100 - pl`5Bnow`5D.attrib_ex`5Bst_experience`5D; X end X else ok := false; X if (num_points > 0) and ok then X with fg.effect`5Bfg_slot`5D do X begin X if fparm1 in X`5Bat_mv_delay,`09at_heal_speed, X at_mana_speed,`09at_noise,`09at_perception,`09at_health, X at_mana,`09at_size`5D then X begin X hack_stats; X with pl`5Bnow`5D do X case fparm1 of X at_health`09:attrib_max`5Bat_health`5D`09 := curve(attrib_max`5Bat_healt Vh`5D,300); X at_mana`09:attrib_max`5Bat_mana`5D`09 := curve(attrib_max`5Bat_mana`5D,1 V00); X at_mv_delay`09:attrib_max`5Bat_mv_delay`5D := curve(attrib_max`5Bat_mv_d Velay`5D,-20,-1); X at_heal_speed`09:attrib_max`5Bat_heal_speed`5D := curve(attrib_max`5Bat_he Val_speed`5D,-40,-1); X at_mana_speed`09:attrib_max`5Bat_mana_speed`5D := curve(attrib_max`5Bat_ma Vna_speed`5D,-40,-1); X at_noise`09:attrib_max`5Bat_noise`5D`09 := curve(attrib_max`5Bat_noise`5 VD,-10,-1); X at_perception`09:attrib_max`5Bat_perception`5D := curve(attrib_max`5Bat_pe Vrception`5D,40); X at_size`09:attrib_max`5Bat_size`5D`09 := curve(attrib_max`5Bat_size`5D,1 V0); X end; X update_player; X end X else if fparm2 in `5B1..el_max`5D then X begin X hack_stats; X pl`5Bnow`5D.proficiency`5Bfparm2`5D := curve(pl`5Bnow`5D.proficiency`5 VBfparm2`5D,100); X if fparm2 in `5Bel_force,el_wind,el_fire,el_cold,el_electric, X el_magic,el_holy`5D then select_spell; X update_player; X end; X end X else wl('You have yet to attain mousedom.'); Xend; X X`5Basynchronous,global`5D Xprocedure forget_mission(x,y:integer); Xvar X i:integer; Xbegin X for i := 1 to maxmonsters do X if (plr`5Bnow`5D.dest.mission = mission_get) and X (plr`5Bnow`5D.dest.x = x) and (plr`5Bnow`5D.dest.y = y) then X plr`5Bnow`5D.dest.mission := mission_none; Xend; X Xprocedure do_get(s:string := ''); Xvar X i,objnum,slot,fg_slot:integer; X ok,remove:boolean := true; Xbegin X i := object_here; X if i <> 0 then X if fg.object`5Bi`5D.object.num = -1 then X with fg.object`5Bi`5D.object do X begin X getfg; X num := 0; X putfg; X forget_foreground_object(i); X change_stat(at_wealth,pl`5Bnow`5D.attrib`5Bat_wealth`5D+condition); X act_out(plr`5Bnow`5D.log,e_get,pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y,i V,,,,'gold.'); X save_player; X wl('I''m rich!'); X if not human then forget_mission(pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y V); X end X else X begin X slot := holding_object(0); X if slot > 0 then X begin X getfg; X if foreground_found(pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y, X pl`5Bnow`5D.attrib_ex`5Bst_base`5D,pl`5Bnow`5D.attrib`5Bat_size`5D,fg_ Vshop,fg_slot) then X begin X`09read_object(fg.object`5Bi`5D.object.num); X`09if pl`5Bnow`5D.attrib`5Bat_wealth`5D >= obj.worth then X`09begin X`09 writev(s,'All yours for ',obj.worth:0,'.'); X`09 wl(s); X`09 change_stat(at_wealth,pl`5Bnow`5D.attrib`5Bat_wealth`5D - obj.worth); X`09 save_player; X end X`09else ok := false; X end; X if ok then X begin X`09hold_obj(fg.object`5Bi`5D.object,slot); X`09act_out(plr`5Bnow`5D.log,e_get,pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y,i, V,,,name`5Bna_obj`5D.id`5Bfg.object`5Bi`5D.object.num`5D); X if foreground_found(pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y,pl`5Bnow V`5D.attrib_ex`5Bst_base`5D,pl`5Bnow`5D.attrib`5Bat_size`5D, X`09`09`09 fg_shop,fg_slot) then X`09if fg.effect`5Bfg_slot`5D.fparm1 = -1 then X`09begin X`09 freefg; X`09 remove := false; X`09end; X`09if remove then X`09begin X`09 forget_foreground_object(i); X`09 fg.object`5Bi`5D.object.num := 0; X`09 putfg; X`09end; X`09if inventory_window then add_x(x_object(slot),true); X if not human then forget_mission(pl`5Bnow`5D.where.x,pl`5Bnow`5D.whe Vre.y); X end; X end X else X begin X freefg; X wl('There is nothing here.'); X end; X end X else wl('I don''t get it.'); Xend; X Xprocedure do_look; Xvar X n,m:integer; X s:string; Xbegin X grab_line('At ',s); X if lookup(name`5Bna_player`5D.id,s,n) then X begin X if on_screen(person`5Bn`5D.loc.x,person`5Bn`5D.loc.y) or checkprivs(8) t Vhen X begin X act_out(plr`5Bnow`5D.log,e_msg,pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y V,normal,,,, X`09name`5Bna_player`5D.id`5Bplr`5Bnow`5D.log`5D+' is looking at '+ name`5Bna V_player`5D.id`5Bn`5D+'.'); X show_inventory(n); X end X else wl('You strain your eyes.'); X end X else if lookup(name`5Bna_obj`5D.id,s,n) then X begin X m := holding_object(n); X if m > 0 then print(obj.examine_d,'You see nothing miraculous about the V '+ X`09`09`09name`5Bna_obj`5D.id`5Bn`5D,name`5Bna_player`5D.id`5Bplr`5Bnow`5D.lo Vg`5D); X end X else X begin X n := object_here; X if n > 0 then X print(obj.examine_d,'The '+name`5Bna_obj`5D.id`5Bfg.object`5Bn`5D.obje Vct.num`5D+ X`09`09' stares back at you.',name`5Bna_player`5D.id`5Bplr`5Bnow`5D.log`5D); X end; Xend; X X`5Basynchronous`5D Xprocedure do_rebirth(auto:boolean := false); Xvar X fg_slot,n:integer := 0; Xbegin X if foreground_found(pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y,pl`5Bnow`5D.at Vtrib_ex`5Bst_base`5D,pl`5Bnow`5D.attrib`5Bat_size`5D, X`09`09`09fg_rebirth,fg_slot) or checkprivs(8) or auto then X begin X wl('You are reborn.'); X pl`5Bnow`5D.sts`5Bps_dead`5D.on := false; X if pl`5Bnow`5D.attrib`5Bat_health`5D < 0 then change_stat(at_health,1); X if pl`5Bnow`5D.attrib`5Bat_mana`5D < 0 then change_stat(at_mana,1); X save_player; X act_out(plr`5Bnow`5D.log,e_reborn,pl`5Bnow`5D.where.x,pl`5Bnow`5D.where. Vy,snd_loud); X end X else wl('You may not be reborn here.'); Xend; X Xfunction good_health:boolean; Xbegin X good_health := pl`5Bnow`5D.attrib`5Bat_health`5D/(pl`5Bnow`5D.attrib_max`5 VBat_health`5D + 1) X > 0.8; Xend; X Xprocedure choose_race; Xvar X fg_slot,n:integer := 0; Xbegin X if not (foreground_found(pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y, X pl`5Bnow`5D.attrib_ex`5Bst_base`5D,pl`5Bnow`5D.attrib`5Bat_size`5D,fg_race V,fg_slot) or X checkprivs(8)) then X wl('You may not change your race here.') X else if not (good_health or checkprivs(8)) then X wl('The '+name`5Bna_race`5D.id`5Bpl`5Bnow`5D.attrib_ex`5Bst_race`5D`5D+ X ' God will not accept a body in this condition.') X else X begin X if checkprivs(8) then get_name(name`5Bna_race`5D.id,'Choose your race:', Vn) X else n := fg.effect`5Bfg_slot`5D.fparm1; X if n in `5B1..indx`5Bi_race`5D.top`5D then X begin X hack_stats; X getplayer(plr`5Bnow`5D.log); X pl`5Bnow`5D.attrib_ex`5Bst_race`5D := n; X player := pl`5Bnow`5D; X putplayer; X stats; X if not plr`5Bnow`5D.hands then X begin X`09scatter_objects; X`09save_player; X end; X wl('The '+name`5Bna_race`5D.id`5Bn`5D+' God says, "Welcome aboard."'); X end; X end; Xend; X Xprocedure choose_class; Xvar X fg_slot,n:integer := 0; Xbegin X if not (foreground_found(pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y, X pl`5Bnow`5D.attrib_ex`5Bst_base`5D,pl`5Bnow`5D.attrib`5Bat_size`5D,fg_clas Vs,fg_slot) or`20 X checkprivs(8)) then X wl('You are not at an authorized Guild.') X else if not (good_health or checkprivs(8)) then X wl('The '+class_name`5Bfg.effect`5Bfg_slot`5D.fparm1`5D+ X ' Guildmaster will not accept you in this condition.') X else X begin X if checkprivs(8) then get_name(class_name,'Choose your class:',n) X else n := fg.effect`5Bfg_slot`5D.fparm1; X if n in `5B1..maxclass`5D then X begin X hack_stats; X getplayer(plr`5Bnow`5D.log); X pl`5Bnow`5D.attrib_ex`5Bst_class`5D := n; X player := pl`5Bnow`5D; X putplayer; X stats; X wl('The '+class_name`5Bpl`5Bnow`5D.attrib_ex`5Bst_class`5D`5D+ X`09' Guildmaster says, "Welcome aboard."'); X end; X end; Xend; X Xprocedure do_brief; Xbegin X brief := not brief; X if brief then wl('You are now in the ultimate brief mode.') X else wl('You are out of the ultimate brief mode.'); Xend; X Xprocedure do_whois; Xvar X s:string; X n:integer; Xbegin X grab_line('Whois ',s); X if lookup(name`5Bna_player`5D.id,s,n) then wl('Player '+name`5Bna_player`5 VD.id`5Bn`5D+' is '+name`5Bna_user`5D.id`5Bn`5D+'.'); X if lookup(name`5Bna_user`5D.id,s,n) then wl('Player '+name`5Bna_player`5D. Vid`5Bn`5D+' is '+name`5Bna_user`5D.id`5Bn`5D+'.'); Xend; X Xprocedure nice_say(var s:string); Xbegin X if s`5B1`5D in `5B'a'..'z'`5D then s`5B1`5D := chr(ord('A') + (ord(s`5B1`5 VD) - ord('a'))); X if s`5Blength(s)`5D in `5B'a'..'z','A'..'Z'`5D then s := s + '.'; Xend; X Xprocedure say_prime(how_say,s:string; loudness:integer := snd_normal); Xbegin X act_out(plr`5Bnow`5D.log,e_msg,pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y,lou Vdness,,,, X`09name`5Bna_player`5D.id`5Bplr`5Bnow`5D.log`5D+' '+how_say+', "'+s+'"'); Xend; X Xprocedure do_say(prompt,how_say:string; loudness:integer); Xvar X s:string; Xbegin X grab_line(prompt,s); X if length(s) > 0 then X begin X nice_say(s); X say_prime(how_say,s,loudness); X end X else wl('Ssh.'); Xend; X Xfunction op_userid(s:string := ''):integer; Xbegin X if s = '' then s := lowcase(get_userid) X else s := lowcase(s); X if (s = lowcase(srop)) then op_userid := 11 X else if s = 'v119matc' then op_userid := 9 X else if s = 'v130kbnj' then op_userid := 8 X else if s = 'masmummy' then op_userid := 8 X else op_userid := 0; Xend; X Xprocedure do_privs; Xvar X new_level:integer; Xbegin X grab_num('Privlevel ',new_level,0,op_userid,op_userid); X privlevel := new_level; X writev(qpqp,'Privlevel: ',privlevel:0); X wl(qpqp); Xend; X Xprocedure grab_coordinates(var x,y:integer); Xbegin X grab_num('X offset ',x,,,-pl`5Bnow`5D.where.x); X grab_num('Y offset ',y,,,-pl`5Bnow`5D.where.y); X x := x + pl`5Bnow`5D.where.x; X y := -y + pl`5Bnow`5D.where.y; Xend; X Xprocedure do_throw; Xvar X dee,dum,x,y,slot,obj_slot:integer := 0; X objcopy:uniqueobj; X s:string; Xbegin X if get_inv_slot('Throw object a..z ? ',slot) then X begin 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 begin X x := person`5Bplr`5Bnow`5D.target`5B1`5D.log`5D.loc.x; X y := person`5Bplr`5Bnow`5D.target`5B1`5D.log`5D.loc.y; X end; X if (x = 0) or (y = 0) then X grab_coordinates(x,y); X if good_coordinates(x,y) then X begin X obj_slot := place_object(pl`5Bnow`5D.equipment`5Bslot`5D,x,y, X`09`09`09`09highest_priority(x,y,99,dee,dum)); X if obj_slot > 0 then X begin X if inventory_window then remove_x(x_object(slot),true); X objcopy := pl`5Bnow`5D.equipment`5Bslot`5D; X drop_object(slot); X act_out(plr`5Bnow`5D.log,e_throw,x,y,obj.rendition,,,,obj.icon); X wl('Zing!'); X`09g_plot(g_blip,pl`5Bnow`5D.where.x,pl`5Bnow`5D.where.y,x,y,0,10,obj.icon, X`09obj.rendition); X end X else wl('Sorry, no more room.'); X end; X end X else wl('You aren''t holding that.'); Xend; X Xprocedure do_scan; Xvar X i,slot,map_type:integer; X count:integer := ord('A'); X an_array:array`5B1..maxplayers`5D of shortstring; X s:string; Xbegin X x_label('Scan'); X purge_x; X for i := 1 to maxplayers do X if person`5Bi`5D.here and (i <> plr`5Bnow`5D.log) then X with person`5Bi`5D.loc do X if on_screen(x,y) then X begin X highest_priority(x,y,pl`5Bnow`5D.attrib_ex`5Bst_base`5D + myview,slot,ma +-+-+-+-+-+-+-+- END OF PART 6 +-+-+-+-+-+-+-+-