-+-+-+-+-+-+-+-+ START OF PART 75 -+-+-+-+-+-+-+-+ X prt(' a) Increase Saving Throw',7,1); prt_num('',oa,7,66); X prt(' b) Increase Resources',8,1);`09 prt_num('',ob,8,66); X prt(' c) Increase Wisdom',9,1);`09 prt_num('',oc,9,66); X case ord(get_option) of `7B97-99`7D X 97: Begin X`09 if (py.misc.au < oa) then X`09 msg_print(too_poor) X`09 else X`09 begin X`09 `09msg_print('You study the mystical arts of avoiding pain.'); X`09`09turn := turn + 2880; X`09`09py.misc.au := py.misc.au - oa; X`09`09py.flags.food := py.flags.food - 3000;`09`09 X`09`09py.misc.save := py.misc.save + 5 + randint(5); X`09 end; X`09 End; X 98: Begin X`09 if (py.misc.au < ob) then X`09 msg_print(too_poor) X`09 else if(py.misc.pclass in `5B1,4`5D) then X`09 msg_print('You don''t use resources! How unresourceful.') X`09 else X`09 begin X`09 `09msg_print('You learn a few ways to conserve your resources.'); X`09`09turn := turn + 720; X`09`09py.misc.au := py.misc.au - ob; X`09`09py.flags.food := py.flags.food - 700;`09`09 X`09`09py.misc.mana := py.misc.mana + 1 + wis_adj; X`09 end; X`09 End; X 99: Begin X`09 if (py.misc.au < oc) then X`09 msg_print(too_poor) X`09 else X`09 begin X `09 msg_print('You spend hours studying all sorts of theology books.' V); X`09`09turn := turn + 2880; X`09`09py.misc.au := py.misc.au - oc; X`09`09py.flags.food := py.flags.food - 3000;`09`09 X`09`09py.stat.cwis := in_statt(py.stat.cwis); X`09`09if (py.stat.cwis > py.stat.wis) then X`09`09 py.stat.wis := py.stat.cwis; X`09 end; X`09 End; X`09otherwise turn := turn + 12; X End;`09 `09`09 XEND; X X`5Bpsect(store$code)`5D procedure dtrain; X X var X i3,oa,ob,oc,od`09:`09integer; X too_poor`09`09:`09ttype; X `20 X XBEGIN X begin `7Bset price on options`7D X oa := trunc(1000*(py.misc.mhp/py.misc.hitdie)); X ob := (py.flags.see_infra + 1)*100; X oc := 20*py.stat.cchr**2; X od := 500; X end; X too_poor := 'You cannot afford our chemical talents.'; X prt('Welcome to the Secret Society of Chemists',3,15); X prt(' How can we help you?',5,1); prt(' Your Price:',5,61); X prt(' a) Increase Hit Points',7,1); prt_num('',oa,7,66); X prt(' b) Increase Infra-Vision',8,1); prt_num('',ob,8,66); X prt(' c) Increase Charisma',9,1);`09 prt_num('',oc,9,66); X prt(' d) Sex Change',10,1);`09 prt_num('',od,10,66); X case ord(get_option) of `7B97-100`7D X 97: if (py.misc.au < oa) then X`09 msg_print(too_poor) X`09 else X`09 Begin X`09 msg_print('You are bathed in a juicy mixture.'); X`09 msg_print(''); X`09 turn := turn + 360; X`09 with py.misc do X`09 begin X`09 au := au - oa; X`09`09 i3 := get_hitdie; X`09`09 chp := chp + i3; `09mhp := mhp + i3; X`09`09end;`09 `09`09`20 X`09 End; X 98: if (py.misc.au < ob) then X`09 msg_print(too_poor) X`09 else X`09 Begin X`09 msg_print('Strange chemicals are squirted into your eyes.'); X`09 msg_print(''); X`09 turn := turn + 120; X`09 py.misc.au := py.misc.au - ob; X`09 py.flags.see_infra := py.flags.see_infra + 1;`09 `20 X`09 End;`09 `20 X 99: if (py.misc.au < oc) then X`09 msg_print(too_poor) X`09 else X`09 Begin X`09 msg_print('You are given several skin treatments and'); X`09 msg_print('taught a few social graces.'); X`09 msg_print(''); X`09 turn := turn + 2160; X`09 py.misc.au := py.misc.au - oc; X`09 py.flags.food := py.flags.food - 3000; X`09 py.stat.cchr := in_statt(py.stat.cchr);`09 `09 `20 X`09 if (py.stat.cchr > py.stat.chr) then`20 X`09`09 py.stat.chr := py.stat.cchr; X`09 End; X 100: if (py.misc.au < od) then X`09 msg_print(too_poor) X`09 else X`09 Begin X`09 msg_print('The Chemists lock you in a dark closet for hours...'); X`09 msg_print(''); X`09 turn := turn + 2880; X `09 py.flags.food := py.flags.food - 2880; X`09 with py.misc do X`09 begin X`09`09 if (randint(10) = 10) then X`09`09 begin X`09`09 sex := 'Neuter'; X msg_print('A horrible thing has happened! The Chemists refund your money. V'); X`09`09 msg_print(''); X`09`09 end X`09`09 else X`09`09 au := au - od; X`09`09 if (sex = 'Male') then`20 X`09`09 sex := 'Female' X`09`09 else X`09`09 sex := 'Male'; X`09`09 end; X`09 End; X`09 otherwise X`09 turn := turn + 12; X`09End; XEND; X X`5Bpsect(store$code)`5D procedure atrain; X X var X oa,ob,oc`09`09:`09integer; X too_poor`09`09:`09ttype; `20 XBEGIN X oa := py.misc.wierd*10; X if (py.misc.pclass in `5B2,5`5D) then X ob := py.misc.lev*600 X else X ob := py.misc.lev*1000; X oc := 20*py.stat.cint**2; X too_poor := 'You are too poor for us to help you. Where is your money? V'; X prt('Welcome to the Academy of Unknown Sciences',3,15); X prt(' Shall we assist you?',5,1); prt(' Your Price:',5,61); X prt(' a) Increase Wierd Device',7,1); prt_num('',oa,7,66); X prt(' b) Increase Resources',8,1);`09 prt_num('',ob,8,66); X prt(' c) Increase Intellegence',9,1); prt_num('',oc,9,66); X case ord(get_option) of `7B97-99`7D X 97: Begin X`09 if (py.misc.au < oa) then X`09 msg_print(too_poor) X`09 else X`09 begin X`09 `09msg_print('You play around with a few strange thingies.'); X`09`09turn := turn + 2880; X`09`09py.misc.au := py.misc.au - oa; X`09`09py.flags.food := py.flags.food - 3000;`09`09 X`09`09py.misc.wierd := py.misc.wierd + 5 + randint(5); X`09 end; X`09 End; X 98: Begin X`09 if (py.misc.au < ob) then X`09 msg_print(too_poor) X`09 else if(py.misc.pclass in `5B1,4`5D) then X`09 msg_print('You don''t use resources! How unresourceful.') X`09 else X`09 begin X`09 `09msg_print('You learn a few ways to conserve your resources.'); X`09`09turn := turn + 720; X`09`09py.misc.au := py.misc.au - ob; X`09`09py.flags.food := py.flags.food - 700;`09`09 X`09`09py.misc.mana := py.misc.mana + 1 + int_adj; X`09 end; X`09 End; X 99: Begin X`09 if (py.misc.au < oc) then X`09 msg_print(too_poor) X`09 else X`09 begin X `09 msg_print('You study your brains out and learn more about llamas. V'); X`09`09turn := turn + 2880; X`09`09py.misc.au := py.misc.au - oc; X`09`09py.flags.food := py.flags.food - 3000;`09`09 X`09`09py.stat.cint := in_statt(py.stat.cint); X`09`09if (py.stat.cint > py.stat.int) then X`09`09 py.stat.int := py.stat.cint; X`09 end; X`09 End; X`09otherwise turn := turn + 12; X End;`09 `09`09 XEND; X X X`5Bpsect(store$code)`5D procedure gtrain; X X var X oa,ob,oc`09`09:`09integer; X too_poor`09`09:`09ttype; `20 X XBEGIN X begin `7Bset prices`7D X oa := py.misc.disarm*10; X if (py.misc.pclass in `5B7,8`5D) then X ob := py.misc.lev*600 X else X ob := py.misc.lev*1000; X oc := 20*py.stat.cdex**2; X end; X too_poor := 'We can''t afford to help charity cases like you.'; X prt('Welcome to the Guild of Honest Citizens',3,15); X prt(' What can we do for you?',5,1); prt(' Your Price:',5,61); X prt(' a) Increase Disarming Skill',7,1); prt_num('',oa,7,66); X prt(' b) Increase Resources',8,1);`09 prt_num('',ob,8,66); X prt(' c) Increase Dexterity',9,1);`09 prt_num('',oc,9,66); X case ord(get_option) of `7B97-99`7D X 97: Begin X`09 if (py.misc.au < oa) then X`09 msg_print(too_poor) X`09 else X`09 begin X `09msg_print('You carefully experiment with dangerous mousetraps.'); X`09`09turn := turn + 2880; X`09`09py.misc.au := py.misc.au - oa; X`09`09py.flags.food := py.flags.food - 3000;`09`09 X`09`09py.misc.disarm := py.misc.disarm + 5 + randint(5); X`09 end; X`09 End; X 98: Begin X`09 if (py.misc.au < ob) then X`09 msg_print(too_poor) X else if(py.misc.pclass in `5B1,4`5D) then X`09 msg_print('You don''t use resources! How unresourceful.') X`09 else X`09 begin X`09 `09msg_print('You learn a few ways to conserve your resources.'); X`09`09turn := turn + 720; X`09`09py.misc.au := py.misc.au - ob; X`09`09py.flags.food := py.flags.food - 700;`09`09 X`09`09py.misc.mana := py.misc.mana + 1 + chr_adj; X`09 end; X`09 End; X 99: Begin X`09 if (py.misc.au < oc) then X`09 msg_print(too_poor) X`09 else X`09 begin X `09 msg_print('You spend a few hours juggling and throwing darts. V'); X`09`09turn := turn + 2880; X`09`09py.misc.au := py.misc.au - oc; X`09`09py.flags.food := py.flags.food - 3000;`09`09 X`09`09py.stat.cdex := in_statt(py.stat.cdex); X`09`09if (py.stat.cdex > py.stat.dex) then X`09`09 py.stat.dex := py.stat.cdex; X`09 end; X`09 End; X`09otherwise turn := turn + 12; X End;`09 `09`09 XEND; X X X`7BSpecial Training- From inside a store`7D X`5Bpsect(store$code)`5D procedure training(store_num : integer); X X var X `09i5 : integer; X XBEGIN X`09i5 := turn; X`09clear(1,1); X`09Case store_num of`20 X`09 2: ltrain; X`09 3: wtrain; X`09 4: ttrain; X`09 5: dtrain; X`09 6: atrain; X`09 11: gtrain; X otherwise msg_print('You find no trainers here. Try a different store.' V); X`09End; X if (py.flags.food < 650) then py.flags.food := 650; X if ((i5 < 4320) and (turn > 4320)) then moria_flag := true; X if ((i5 < 12960) and (turn > 12960)) then moria_flag := true; X if (turn > 17280) then`20 X midnight; X msg_print(''); XEND; X X`09 `20 X`5Bpsect(store$code)`5D function get_job_option(var option : char) : boolean V; X var`20 X com_val`09`09:`09integer; X exit_flag`09:`09boolean; X `20 XBegin X exit_flag := false; X get_job_option := false; X prt_num('Dollars Remaining : ',py.misc.au,19,23); X prt('You may:',21,1); Xprt(' p) Pick a part time job. space) Browse options.',22,6); Xprt(' `5EZ) Exit. `5ER) Redraw the screen.',23,6) V; X repeat X if (get_com('',command)) then X begin X `09 msg_flag := false; X`09 com_val := ord(command); X`09 case com_val of`20 X`09 18 :; X`09 32 :prt('All jobs are shown.',1,1); X`09 112 :begin X`09`09 prt('Which would you like?',1,1); X`09`09 exit_flag := get_com('',option); X`09`09 if ((ord(option) < 49) or (ord(option) > 57)) then X`09`09 exit_flag := false X`09`09 else`20 X`09`09 get_job_option := true; X`09`09 end; X`09 otherwise prt('Invalid Command.',1,1); X`09 end; X`09end X else X exit_flag := true; `20 X until(exit_flag); X END; X X X`5Bpsect(store$code)`5D procedure get_job; X X var X option`09`09:`09char; X qualified`09:`09integer; X i1,i3,i4`09`09:`09integer; XBEGIN X qualified := (py.misc.lev div 4) + 2; X clear(1,1); X prt('Blue Fish Temporary Hiring Services, Inc.',3,16); X prt(' List of Jobs Available:',5,1); prt(' Hourly Wage:',5,61); X for i1 := 1 to 9 do X begin X prt_num(' ',i1,i1+6,1); X prt(')',i1+6,4); X prt(joblist`5Bi1`5D,i1+6,5); X prt_num('$',jobwage`5Bi1`5D,i1+6,66); X end; X if (get_job_option(option)) then`20 X i3 := ord(option) - 48; `7B1-9`7D X If (i3 > qualified) then`20 X msg_print('You are not qualified for that job.') X Else X Begin X msg_print('You endure several hours of work'); X`09 turn := turn + 5760; X`09 i4 := randint(100); X`09 Case i3 of X`09 1: Begin X`09 if (i4 > 95) then begin X`09`09 msg_print('You lose a finger in the disposal machine'); X`09`09 py.stat.cdex := de_statt(py.stat.cdex); X`09`09 end `20 X`09`09else if (i4 > 80) then begin X`09`09 msg_print('You find a missing earring and are rewarded!');`20 X`09`09 py.misc.au := py.misc.au + 20; X`09`09 end; X`09 End; X 2: Begin X`09 if (i4 > 90) then begin X`09 msg_print('You are steamed badly and your health declines.'); X`09`09 py.stat.ccon := de_statt(py.stat.ccon); X`09`09 end`09`09 `20 X`09`09else if (i4 > 80) then begin X`09`09 msg_print('Your determination earns you a pay bonus!');`20 X`09`09 py.misc.au := py.misc.au + 30; X`09`09 end; X`09 End; X 3: Begin X`09 if (i4 > 95) then begin X`09 msg_print('You take the wrong elevator out!'); X`09`09 dun_level := 2; X`09`09 end`09`09 `20 X`09`09else if (i4 > 90) then begin X`09`09 msg_print('A wealty couple gives you a *big* tip!');`20 X`09`09 py.misc.au := py.misc.au + 50; X`09`09 end; X`09 End; X`09 Otherwise; X`09 end; X`09 py.misc.au := py.misc.au + (jobwage`5Bi3`5D*8); X`09 py.flags.food := py.flags.food - 5760; X`09 zero_pyflag; X End;`09 `09`09 XEND; X X`5Bpsect(towns$code)`5D procedure take_bus; XBEGIN XEND; X X $ CALL UNPACK [.INC]TRAIN.INC;1 151799450 $ create 'f' X`7B Chance of treasure having magic abilities X Chance increases with each dungeon power `7D X X`7BPre-declared in MISC.INC`7D Xprocedure magic_treasure; X X `7B parameters:`20 X var item : treasure_type; X power : integer;`20 X `7D X X var X chance,special,unique,cursed,i1 : integer; X`20 X`7B Boolean : is object enchanted `7D X function magik(chance : integer) : boolean; X BEGIN X if (randint(100) <= chance) then X magik := true X else X magik := false; X end; X`20 X procedure inc_damage(var dice : dtype; amount : integer); X var X num,sides,i1 : integer; X begin X for i1 := 1 to length(dice) do X`09if (dice`5Bi1`5D = 'd') then X dice`5Bi1`5D := ' '; X`09num := 0; X`09sides := 0; X`09readv(dice,num,sides,error:=continue); X`09i1 := num*amount; X`09if ((i1 > 9) and (sides > 99)) then X i1 := 9 X else if ((i1 > 99) and (sides > 9)) then X i1 := 99; X dice := ''; X writev(dice,i1:1,'d',sides:1); X end; X X`7B Enchant a bonus based on degree desired `7D X function m_bonus(base,max_std,power : integer) : integer; X var +-+-+-+-+-+-+-+- END OF PART 75 +-+-+-+-+-+-+-+-