-+-+-+-+-+-+-+-+ START OF PART 49 -+-+-+-+-+-+-+-+ X`09`09 else if (uand(%X'80000000',inventory`5B32`5D.flags) <> 0) then X`09`09 i4 := 32 X`09`09 else if (uand(%X'80000000',inventory`5B24`5D.flags) <> 0) then X`09`09 i4 := 24 X`09`09 else if (uand(%X'80000000',inventory`5B28`5D.flags) <> 0) then X`09`09 i4 := 28; X`09`09 if (i4 > 0) then X`09`09 with inventory`5Bi4`5D do X`09`09 begin X`09`09`09objdes(out_val,i4,false); X`09`09`09msg_print('Your ' + out_val + ' glows faintly!'); X`09`09`09if (enchant(toac)) then X`09`09`09 begin X`09`09`09 flags := uand(%X'7FFFFFFF',flags); X`09`09`09 py_bonuses(blank_treasure,0); X`09`09`09 end X`09`09`09else X`09`09`09 msg_print('The enchantment fails...'); X`09`09 end; X`09`09 ident := true; X`09`09end; X`09 4 : begin X`09`09 identify(inventory`5Bitem_val`5D); X`09`09 msg_print('This is an identify scroll'); X`09`09 msg_print(' '); X`09`09 if (ident_spell) then first := false; X`09`09end; X`09 5 : if (remove_curse) then X`09`09 begin X`09`09 msg_print('You feel as if someone is watching over you.'); X`09`09 ident := true;; X`09`09 end; X`09 6 : ident := light_area(char_row,char_col); X`09 7 : begin X`09`09 for i3 := 1 to randint(3) do X`09`09 begin X`09`09 y := char_row; X`09`09 x := char_col; X`09`09 summon_monster(y,x,false); X`09`09 end; X`09`09 ident := true; X`09`09end; X`09 8 : begin X`09`09 teleport(10); X`09`09 ident := true; X`09`09end; X`09 9 : begin X`09`09 teleport(100); X`09`09 ident := true; X`09`09end; X`09 10 : begin X`09`09 dun_level := dun_level - 3 + 2*randint(2); X`09`09 if (dun_level < 1) then X`09`09 dun_level := 1; X`09`09 moria_flag := true; X`09`09 ident := true; X`09`09end; X`09 11 : begin X`09`09 msg_print('Your hands begin to glow.'); X`09`09 py.flags.confuse_monster := true; X`09`09 ident := true; X`09`09end; X`09 12 : ident := map_area; X`09 13 : ident := sleep_monsters1(char_row,char_col); X`09 14 : ident := warding_glyph; X`09 15 : ident := detect_treasure; X`09 16 : ident := detect_object; X`09 17 : ident := detect_trap; X`09 18 : ident := detect_sdoor; X`09 19 : begin X`09`09 msg_print('This is a mass genocide scroll.'); X`09`09 msg_print(' '); X`09`09 ident := mass_genocide; X`09`09end; X`09 20 : ident := detect_invisible; X`09 21 : begin X`09`09 ident := aggravate_monster(20); X`09`09 msg_print('There is a high pitched humming noise'); X`09`09end; X`09 22 : ident := trap_creation; X`09 23 : ident := td_destroy; X`09 24 : ident := door_creation; X`09 25 : begin X`09`09 identify(inventory`5Bitem_val`5D); X`09`09 msg_print('This is a Recharge-Item scroll.'); X`09`09 msg_print(' '); X`09`09 if (recharge(60)) then first := false; X`09`09end; X`09 26 : begin X`09`09 msg_print('This is a genocide scroll.'); X`09`09 msg_print(' '); X`09`09 ident := genocide; X`09`09end; X`09 27 : ident := unlight_area(char_row,char_col); X`09 28 : ident := protect_evil; X`09 29 : ident := create_food; X`09 30 : ident := dispell_creature(%X'0008',60); X`09 31 : begin X`09`09 msg_print('That scroll appeared to be blank.'); X`09`09 ident := true; X`09`09end; X`09 32 : with inventory`5B23`5D do X`09`09 begin X`09`09 if (tval > 0) then X`09`09 begin X`09`09 objdes(out_val,23,false); X`09`09 msg_print('Your ' + out_val + ' glows brightly!'); X`09`09 flag := false; X`09`09 for i3 := 1 to randint(2) do X`09`09`09if (enchant(tohit)) then X`09`09`09 flag := true; X`09`09 for i3 := 1 to randint(2) do X`09`09`09if (enchant(todam)) then X`09`09`09 flag := true; X`09`09 if (flag) then X`09`09`09begin X`09`09`09 flags := uand(%X'7FFFFFFF',flags); X`09`09`09 py_bonuses(blank_treasure,0); X`09`09`09end X`09`09 else X`09`09`09msg_print('The enchantment fails...'); X`09`09 end; X`09`09 ident := true; X`09`09 end; X`09 33 : with inventory`5B23`5D do X`09`09 begin X`09`09 if (tval > 0) then X`09`09 begin X`09`09`09inventory`5Binven_max`5D := inventory`5B23`5D; X`09`09`09objdes(out_val,23,false); X`09`09`09msg_print('Your ' + out_val + X`09`09`09`09' glows black, then fades.'); X`09`09`09tohit := -randint(5) - randint(5); X`09`09`09todam := -randint(5) - randint(5); X`09`09`09flags := %X'80000000'; X`09`09`09py_bonuses(inventory`5Binven_max`5D,-1); X`09`09`09ident := true; X`09`09 end; X`09`09 end; X`09 34 : begin X`09`09 if (uand(%X'80000000',inventory`5B26`5D.flags) <> 0) then X`09`09 i3 := 26 X`09`09 else if (uand(%X'80000000',inventory`5B27`5D.flags) <> 0) then X`09`09 i3 := 27 X`09`09 else if (uand(%X'80000000',inventory`5B32`5D.flags) <> 0) then X`09`09 i3 := 32 X`09`09 else if (uand(%X'80000000',inventory`5B24`5D.flags) <> 0) then X`09`09 i3 := 24 X`09`09 else if (uand(%X'80000000',inventory`5B28`5D.flags) <> 0) then X`09`09 i3 := 28 X`09`09 else if (inventory`5B26`5D.tval > 0) then X`09`09 i3 := 26 X`09`09 else if (inventory`5B27`5D.tval > 0) then X`09`09 i3 := 27 X`09`09 else if (inventory`5B24`5D.tval > 0) then X`09`09 i3 := 24 X`09`09 else if (inventory`5B28`5D.tval > 0) then X`09`09 i3 := 28 X`09`09 else X`09`09 i3 := 0; X`09`09 if (i3 > 0) then X`09`09 with inventory`5Bi3`5D do X`09`09 begin X`09`09`09objdes(out_val,i3,false); X`09`09`09msg_print('Your ' + out_val + ' glows brightly!'); X`09`09`09flag := false; X`09`09`09for i3 := 1 to randint(2) + 1 do X`09`09`09 if (enchant(toac)) then X`09`09`09 flag := true; X`09`09`09if (flag) then X`09`09`09 begin X`09`09`09 flags := uand(%X'7FFFFFFF',flags); X`09`09`09 py_bonuses(blank_treasure,0); X`09`09`09 end X`09`09`09else X`09`09`09 msg_print('The enchantment fails...'); X`09`09 end; X`09`09 ident := true; X`09`09end; X`09 35 : begin X`09`09 if ((inventory`5B26`5D.tval > 0) and (randint(4) = 1)) then X`09`09 i3 := 26 X`09`09 else if ((inventory`5B27`5D.tval > 0) and (randint(3) = 1)) then X`09`09 i3 := 27 X`09`09 else if ((inventory`5B32`5D.tval > 0) and (randint(3) = 1)) then X`09`09 i3 := 32 X`09`09 else if ((inventory`5B24`5D.tval > 0) and (randint(3) = 1)) then X`09`09 i3 := 24 X`09`09 else if ((inventory`5B28`5D.tval > 0) and (randint(3) = 1)) then X`09`09 i3 := 28 X`09`09 else if (inventory`5B26`5D.tval > 0) then X`09`09 i3 := 26 X`09`09 else if (inventory`5B27`5D.tval > 0) then X`09`09 i3 := 27 X`09`09 else if (inventory`5B32`5D.tval > 0) then X`09`09 i3 := 32 X`09`09 else if (inventory`5B24`5D.tval > 0) then X`09`09 i3 := 24 X`09`09 else if (inventory`5B28`5D.tval > 0) then X`09`09 i3 := 28 X`09`09 else X`09`09 i3 := 0; X`09`09 if (i3 > 0) then X`09`09 with inventory`5Bi3`5D do X`09`09 begin X`09`09`09inventory`5Binven_max`5D := inventory`5Bi3`5D; X`09`09`09objdes(out_val,i3,false); X`09`09 msg_print('Your ' + out_val + X`09`09`09`09' glows black, then fades.'); X`09`09`09flags := %X'80000000'; X`09`09`09toac := -randint(5) - randint(5); X`09`09`09py_bonuses(inventory`5Binven_max`5D,-1); X`09`09`09ident := true; X`09`09 end; X`09`09end; X`09 36 : begin X`09`09 for i3 := 1 to randint(3) do X`09`09 begin X`09`09 y := char_row; X`09`09 x := char_col; X`09`09 summon_undead(y,x); X`09`09 end; X`09`09 ident := true; X`09`09end; X`09 37 : ident := bless(randint(12)+6); X`09 38 : ident := bless(randint(24)+12); X`09 39 : ident := bless(randint(48)+24); X`09 40 : begin X`09`09 ident := true; X`09`09 py.flags.word_recall := 25 + randint(30); X`09`09 msg_print('The air about you becomes charged...'); X`09`09end; X`09 41 : ident := destroy_area(char_row,char_col); X`09 42 : ; X`09 43 : ; X`09 44 : ; X`09 45 : ; X`09 46 : ; X`09 47 : ; X`09 48 : ; X`09 49 : ; X`09 50 : ; X`09 51 : ; X`09 52 : ; X`09 53 : ; X`09 54 : ; X`09 55 : ; X`09 56 : ; X`09 57 : ; X`09 58 : ; X`09 59 : ; X`09 60 : ; X`09 61 : ; X`09 62 : ; X`09 otherwise ; X`09end; X`09`7B End of Scrolls... `7D X`09`09`09 end; X`09`09`09if (not(reset_flag)) then X`09`09`09 begin X`09`09`09 if (ident) then X`09`09`09 identify(inventory`5Bitem_val`5D); X`09`09`09 if (not(first)) then X`09`09`09 begin X`09`09`09`09desc_remain(item_val); X`09`09`09`09inven_destroy(item_val); X`09`09`09`09if (flags <> 0) then X`09`09`09`09 with py.misc do X`09`09`09`09 begin X`09`09`09`09 exp := exp + round(level/lev); X`09`09`09`09 prt_experience; X`09`09`09`09 end; X`09`09`09 end; X`09`09`09 end; X`09`09 end X`09`09 else X`09`09 if (redraw) then draw_cave; X`09`09end X`09 else X`09 msg_print('You are not carrying any scrolls.'); X`09 end X`09else X`09 msg_print('But you are not carrying anything.'); X end; $ CALL UNPACK [.SOURCE.INCLUDE]SCROLLS.INC;1 1277913221 $ create 'f' X`7B Following are spell procedure/functions`09`09`09-RAK-`09`7D X`7B These routines are commonly used in the scroll, potion, wands, and `7 VD X`7B staves routines, and are occassionly called from other areas. `7 VD X`7B Now included are creature spells also... -RAK `7 VD X X`09`7B Sleep creatures adjacent to player`09`09`09-RAK-`09`7D X`5Bpsect(misc6$code)`5D function sleep_monsters1(y,x : integer) : boolean; X var X`09`09i1,i2 : integer; X begin X`09sleep_monsters1 := false; X`09for i1 := y-1 to y+1 do X`09 for i2 := x-1 to x+1 do X`09 with cave`5Bi1,i2`5D do X`09 if (cptr > 1) then X`09`09with m_list`5Bcptr`5D do X`09`09 with c_list`5Bmptr`5D do X`09`09 begin X`09`09 sleep_monsters1 := true; X`09`09 if ((randint(max_mons_level) < level) or X`09`09`09 (uand(%X'1000',cdefense) <> 0)) then X`09`09`09msg_print('The ' + name + ' is unaffected.') X`09`09 else X`09`09`09begin X`09`09`09 msg_print('The ' + name + ' falls asleep.'); X`09`09`09 csleep := 500; X`09`09`09end; X`09`09 end; X end; X X`09`7B Detect any monsters on the current panel`09`09-RAK-`09`7D X`5Bpsect(misc6$code)`5D function detect_treasure : boolean; X var X`09`09i1,i2 : integer; X begin X`09detect_treasure := false; X`09for i1 := panel_row_min to panel_row_max do X`09 for i2 := panel_col_min to panel_col_max do X`09 with cave`5Bi1,i2`5D do X`09 if (tptr > 0) then X`09`09if (t_list`5Btptr`5D.tval = 100) then X`09`09 if (not (test_light(i1,i2))) then X`09`09 begin X`09`09 lite_spot(i1,i2); X`09`09 tl := true; X`09`09 detect_treasure := true; X`09`09 end; X end; X X`09`7B Detect all objects on the current panel`09`09-RAK-`09`7D X`5Bpsect(misc6$code)`5D function detect_object : boolean; X var X`09`09i1,i2 : integer; X begin X`09detect_object := false; X`09for i1 := panel_row_min to panel_row_max do X`09 for i2 := panel_col_min to panel_col_max do X`09 with cave`5Bi1,i2`5D do X`09 if (tptr > 0) then X`09`09if (t_list`5Btptr`5D.tval < 100) then X`09`09 if (not (test_light(i1,i2))) then X`09`09 begin X`09`09 lite_spot(i1,i2); X`09`09 tl := true; X`09`09 detect_object := true; X`09`09 end; X end; X X`09`7B Locates and displays traps on current panel`09`09-RAK-`09`7D X`5Bpsect(misc6$code)`5D function detect_trap : boolean; X var X`09`09i1,i2 : integer; X begin X`09detect_trap := false; X`09for i1 := panel_row_min to panel_row_max do X`09 for i2 := panel_col_min to panel_col_max do X`09 with cave`5Bi1,i2`5D do X`09 if (tptr > 0) then X`09`09if (t_list`5Btptr`5D.tval = 101) then X`09`09 begin X`09`09 change_trap(i1,i2); X`09`09 fm := true; X`09`09 detect_trap := true; X`09`09 end X`09`09else if (t_list`5Btptr`5D.tval = 2) then X`09`09 with t_list`5Btptr`5D do X`09`09 known2(name); X end; X X`09`7B Locates and displays all secret doors on current panel -RAK-`09`7D X`5Bpsect(misc6$code)`5D function detect_sdoor : boolean; X var X`09`09i1,i2 : integer; X begin X`09detect_sdoor := false; X`09for i1 := panel_row_min to panel_row_max do X`09 for i2 := panel_col_min to panel_col_max do X`09 with cave`5Bi1,i2`5D do X`09 if (tptr > 0) then X`09`09`7B Secret doors `7D X`09`09if (t_list`5Btptr`5D.tval = 109) then X`09`09 begin X`09`09 fval := corr_floor3.ftval; X`09`09 change_trap(i1,i2); X`09`09 fm := true; X`09`09 detect_sdoor := true; X`09`09 end X`09`09`7B Staircases `7D X`09`09else if (t_list`5Btptr`5D.tval in `5B107,108`5D) then X`09`09 if (not(fm)) then X`09`09 begin X`09`09 fm := true; X`09`09 lite_spot(i1,i2); X`09`09 detect_sdoor := true; X`09`09 end; X end; X X`09`7B Locates and displays all invisible creatures on current panel -RAK-`7 VD X`5Bpsect(misc6$code)`5D function detect_invisible : boolean; X var X`09`09i1 : integer; X`09`09dummy : char; X`09`09flag : boolean; X begin X`09flag := false; X`09i1 := muptr; X`09repeat X`09 with m_list`5Bi1`5D do X`09 if (panel_contains(fy,fx)) then X`09 if (uand(%X'10000',c_list`5Bmptr`5D.cmove) <> 0) then X`09`09begin X`09`09 ml := true; X`09`09 print(c_list`5Bmptr`5D.cchar,fy,fx); X`09`09 flag := true; X`09`09end; X`09 i1 := m_list`5Bi1`5D.nptr; X`09until(i1 = 0); X`09if (flag) then X`09 begin X`09 msg_print('You sense the presence of invisible creatures!'); X`09 msg_print(' '); X`09 msg_flag := false; X`09 end; X`09detect_invisible := flag; X end; X X`09`7B Light an area: 1. If corridor then light immediate area -RAK-`7D X`09`7B 2. If room then light entire room. `7D X`5Bpsect(misc6$code)`5D function light_area(y,x : integer) : boolean; X var X`09`09i1,i2 : integer; X begin X`09msg_print('You are surrounded by a white light.'); X`09light_area := true; X`09if ((cave`5By,x`5D.fval in `5B1,2`5D) and (dun_level > 0)) then X`09 light_room(y,x) X`09else X`09 for i1 := y-1 to y+1 do X`09 for i2 := x-1 to x+1 do X`09 if (in_bounds(i1,i2)) then X`09`09begin X`09`09 if (not (test_light(i1,i2))) then X`09`09 lite_spot(i1,i2); X`09`09 cave`5Bi1,i2`5D.pl := true; X`09`09end; X end; X X`09`7B Darken an area, opposite of light area`09`09-RAK-`09`7D +-+-+-+-+-+-+-+- END OF PART 49 +-+-+-+-+-+-+-+-