home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / games / vmsnet / monhl104 / part10 < prev    next >
Internet Message Format  |  1992-08-02  |  44KB

  1. Path: uunet!mcsun!news.funet.fi!hydra!klaava!hurtta
  2. From: Kari.Hurtta@Helsinki.FI (Kari E. Hurtta)
  3. Newsgroups: vmsnet.sources.games
  4. Subject: Monster Helsinki V 1.04 - part 10/32
  5. Keywords: Monster, a multiplayer adventure game
  6. Message-ID: <1992Jun14.004836.3978@klaava.Helsinki.FI>
  7. Date: 14 Jun 92 00:48:36 GMT
  8. Sender: hurtta@klaava.Helsinki.FI (Kari Hurtta)
  9. Followup-To: vmsnet.sources.d
  10. Organization: University of Helsinki
  11. Lines: 1217
  12.  
  13. Archieve-name: monster_helsinki_104/part10
  14. Author: Kari.Hurtta@Helsinki.FI
  15. Product: Monster Helsinki V 1.04
  16. Environment: VMS, Pascal
  17. Part: 10/32
  18.  
  19. -+-+-+-+-+-+-+-+ START OF PART 10 -+-+-+-+-+-+-+-+
  20. X`009`009`009`009`009if param > '' then s := param
  21. X`009`009`009`009`009else begin
  22. X`009`009`009`009`009`009writeln('Enter * for no home.');
  23. X`009`009`009`009`009`009writeln('Set home of object. ');
  24. X`009`009`009`009`009`009grab_line('Home? ',s,
  25. X`009`009`009`009`009`009    eof_handler := leave);
  26. X`009`009`009`009`009end;
  27. X`009`009`009`009`009if s = '*' then begin
  28. X`009`009`009`009`009`009getobj(objnum);
  29. X`009`009`009`009`009`009obj.home := 0;
  30. X`009`009`009`009`009`009putobj;
  31. X`009`009`009`009`009`009writeln('Object modified.');
  32. X`009`009`009`009`009end else if lookup_room(n,s) then begin
  33. X`009`009`009`009`009    gethere(n);
  34. X`009`009`009`009`009    if (here.owner <> userid) and`032
  35. X`009`009`009`009`009`009    (not owner_priv) then
  36. X`009`009`009`009`009`009    writeln('Can''t set home to others room')
  37. X`009`009`009`009`009    else begin
  38. X`009`009`009`009`009`009getobj(objnum);
  39. X`009`009`009`009`009`009obj.home := n;
  40. X`009`009`009`009`009`009putobj;
  41. X`009`009`009`009`009`009writeln('Object modified.');
  42. X`009`009`009`009`009    end;
  43. X`009`009`009`009`009end else writeln('No such room.');
  44. X`009`009`009`009     end;
  45. X`009`009`009`009'u': begin
  46. X`009`009`009`009`009if param > '' then s := param
  47. X`009`009`009`009`009else begin
  48. X`009`009`009`009`009`009writeln('Enter * for no object');
  49. X`009`009`009`009`009`009grab_line('Object required for USE? ',
  50. X`009`009`009`009`009`009    s,eof_handler := leave);
  51. X`009`009`009`009`009end;
  52. X`009`009`009`009`009if s = '*' then begin
  53. X`009`009`009`009`009`009getobj(objnum);
  54. X`009`009`009`009`009`009obj.useobjreq := 0;
  55. X`009`009`009`009`009`009putobj;
  56. X`009`009`009`009`009end else if lookup_obj(n,s) then begin
  57. X`009`009`009`009`009`009getobj(objnum);
  58. X`009`009`009`009`009`009obj.useobjreq := n;
  59. X`009`009`009`009`009`009putobj;
  60. X`009`009`009`009`009`009writeln('Object modified.');
  61. X`009`009`009`009`009end else
  62. X`009`009`009`009`009`009writeln('No such object.');
  63. X`009`009`009`009     end;
  64. X`009`009`009`009'2': begin
  65. X`009`009`009`009`009if param > '' then s := param
  66. X`009`009`009`009`009else begin
  67. X`009`009`009`009`009`009writeln('Enter * for no special place');
  68. X`009`009`009`009`009`009grab_line('Place required for USE? ',
  69. X`009`009`009`009`009`009    s,eof_handler := leave);
  70. X`009`009`009`009`009end;
  71. X`009`009`009`009`009if s = '*' then begin
  72. X`009`009`009`009`009`009getobj(objnum);
  73. X`009`009`009`009`009`009obj.uselocreq := 0;
  74. X`009`009`009`009`009`009putobj;
  75. X`009`009`009`009`009end else if lookup_room(n,s) then begin
  76. X`009`009`009`009`009`009getobj(objnum);
  77. X`009`009`009`009`009`009obj.uselocreq := n;
  78. X`009`009`009`009`009`009putobj;
  79. X`009`009`009`009`009`009writeln('Object modified.');
  80. X`009`009`009`009`009end else
  81. X`009`009`009`009`009`009writeln('No such object.');
  82. X`009`009`009`009     end;
  83. X`009`009`009`009's': begin
  84. X`009`009`009`009`009getobj(objnum);
  85. X`009`009`009`009`009obj.sticky := not(obj.sticky);
  86. X`009`009`009`009`009putobj;
  87. X`009`009`009`009`009if obj.sticky then
  88. X`009`009`009`009`009`009writeln('The object will not be takeable.')
  89. X`009`009`009`009`009else
  90. X`009`009`009`009`009`009writeln('The object will be takeable.');
  91. X`009`009`009`009     end;
  92. X`009`009`009`009'a': begin
  93. X`009`009`009`009`009writeln;
  94. X`009  `009`009`009`009writeln('Select the article for your object:');
  95. X`009`009`009`009`009writeln;
  96. X`009`009`009`009`009writeln('0)`009None                ex: " You have taken
  97. V Excalibur "');
  98. X`009`009`009`009`009writeln('1)`009"a"                 ex: " You have taken
  99. V a small box "');
  100. X`009`009`009`009`009writeln('2)`009"an"                ex: " You have taken
  101. V an empty bottle "');
  102. X`009`009`009`009`009writeln('3)`009"some"              ex: " You have picked
  103. V up some jelly beans "');
  104. X`009`009`009`009`009writeln('4)     "the"               ex: " You have picke
  105. Vd up the Scepter of Power"');
  106. X`009`009`009`009`009writeln;
  107. X`009`009`009`009`009grab_line('? ',s,eof_handler := leave);
  108. X`009`009`009`009`009if isnum(s) then begin
  109. X`009`009`009`009`009`009n := number(s);
  110. X`009`009`009`009`009`009if n in `0910..4`093 then begin
  111. X`009`009`009`009`009`009`009getobj(objnum);
  112. X`009`009`009`009`009`009`009obj.particle := n;
  113. X`009`009`009`009`009`009`009putobj;
  114. X`009`009`009`009`009`009end else
  115. X`009`009`009`009`009`009`009writeln('Out of range.');
  116. X`009`009`009`009`009end else
  117. X`009`009`009`009`009`009writeln('No changes.');
  118. X`009`009`009`009     end;
  119. X`009`009`009`009'k': begin
  120. X`009`009`009`009`009prog_kind(objnum);
  121. X`009`009`009`009     end;
  122. X`009`009`009`009'p': begin
  123. X`009`009`009`009`009prog_obj(objnum);
  124. X`009`009`009`009     end;
  125. X`009`009`009`009'd': begin
  126. X`009`009`009`009`009newdsc := obj.examine;
  127. X`009`009`009`009`009writeln('`091 Editing the description of the object `093
  128. V');
  129. X`009`009`009`009`009if edit_desc(newdsc) then begin
  130. X`009`009`009`009`009`009getobj(objnum);
  131. X`009`009`009`009`009`009obj.examine := newdsc;
  132. X`009`009`009`009`009`009putobj;
  133. X`009`009`009`009`009end;
  134. X`009`009`009`009     end;
  135. X`009`009`009`009'x': begin
  136. X`009`009`009`009`009newdsc := obj.d1;
  137. X`009`009`009`009`009writeln('`091 Editing extra description #1 `093');
  138. X`009`009`009`009`009if obj.kind = O_WEAPON then`032
  139. X                                          WriteLn ('Victim sees this. ',
  140. X`009`009`009`009`009`009'# attacks you.')
  141. X`009`009`009`009`009else if obj.kind = O_TRAP then
  142. X`009`009    `009`009`009  writeln ('Others see this. ',
  143. X`009`009`009`009`009`009'# tries to get a trap.');
  144. X                                        if edit_desc(newdsc) then begin
  145. X`009`009`009`009`009`009getobj(objnum);
  146. X`009`009`009`009`009`009obj.d1 := newdsc;
  147. X`009`009`009`009`009`009putobj;
  148. X`009`009`009`009`009end;
  149. X`009`009`009`009     end;
  150. X`009`009`009`009'5': begin
  151. X`009`009`009`009`009newdsc := obj.d2;
  152. X`009`009`009`009`009writeln('`091 Editing extra description #2 `093');
  153. X`009`009`009`009`009if obj.kind = O_WEAPON then
  154. X                                          WriteLn ('Others see this. ',
  155. X`009`009`009`009`009`009'# is attacker.');
  156. X                                        if edit_desc(newdsc) then begin
  157. X`009`009`009`009`009`009getobj(objnum);
  158. X`009`009`009`009`009`009obj.d2 := newdsc;
  159. X`009`009`009`009`009`009putobj;
  160. X`009`009`009`009`009end;
  161. X`009`009`009`009     end;
  162. X`009`009`009`009'f': begin
  163. X`009`009`009`009`009newdsc := obj.getfail;
  164. X`009`009`009`009`009writeln('`091 Editing the get failure description `093')
  165. V;
  166. X`009`009`009`009`009if edit_desc(newdsc) then begin
  167. X`009`009`009`009`009`009getobj(objnum);
  168. X`009`009`009`009`009`009obj.getfail := newdsc;
  169. X`009`009`009`009`009`009putobj;
  170. X`009`009`009`009`009end;
  171. X`009`009`009`009     end;
  172. X`009`009`009`009'1': begin
  173. X`009`009`009`009`009newdsc := obj.getsuccess;
  174. X`009`009`009`009`009writeln('`091 Editing the get success description `093')
  175. V;
  176. X`009`009`009`009`009if edit_desc(newdsc) then begin
  177. X`009`009`009`009`009`009getobj(objnum);
  178. X`009`009`009`009`009`009obj.getsuccess := newdsc;
  179. X`009`009`009`009`009`009putobj;
  180. X`009`009`009`009`009end;
  181. X`009`009`009`009     end;
  182. X`009`009`009`009'3': begin
  183. X`009`009`009`009`009newdsc := obj.usefail;
  184. X`009`009`009`009`009writeln('`091 Editing the use failure description `093')
  185. V;
  186. X`009`009`009`009`009if edit_desc(newdsc) then begin
  187. X`009`009`009`009`009`009getobj(objnum);
  188. X`009`009`009`009`009`009obj.usefail := newdsc;
  189. X`009`009`009`009`009`009putobj;
  190. X`009`009`009`009`009end;
  191. X`009`009`009`009     end;
  192. X`009`009`009`009'6': begin
  193. X`009`009`009`009`009newdsc := obj.homedesc;
  194. X`009`009`009`009`009writeln('`091 Editing the home description `093');
  195. X`009`009`009`009`009if edit_desc(newdsc) then begin
  196. X`009`009`009`009`009`009getobj(objnum);
  197. X`009`009`009`009`009`009obj.homedesc := newdsc;
  198. X`009`009`009`009`009`009putobj;
  199. X`009`009`009`009`009end;
  200. X`009`009`009`009     end;
  201. X`009`009`009`009'4': begin
  202. X`009`009`009`009`009newdsc := obj.usesuccess;
  203. X`009`009`009`009`009writeln('`091 Editing the use success description `093')
  204. V;
  205. X`009`009`009`009`009if obj.kind = O_WEAPON then
  206. X`009`009`009`009`009`009writeln ('# is victim.');
  207. X`009`009`009`009`009if edit_desc(newdsc) then begin
  208. X`009`009`009`009`009`009getobj(objnum);
  209. X`009`009`009`009`009`009obj.usesuccess := newdsc;
  210. X`009`009`009`009`009`009putobj;
  211. X`009`009`009`009`009end;
  212. X`009`009`009`009     end;
  213. X`009`009`009`009'l': begin
  214. X`009`009`009`009`009writeln('Enter a one line description of what the object
  215. V will look like in any room.');
  216. X`009`009`009`009`009writeln('Example: "There is an as yet unknown object her
  217. Ve."');
  218. X`009`009`009`009`009writeln;
  219. X`009`009`009`009`009getobj(objnum);
  220. X`009`009`009`009`009freeobj;
  221. X`009`009`009`009`009n := obj.linedesc;
  222. X`009`009`009`009`009make_line(n);
  223. X`009`009`009`009`009getobj(objnum);
  224. X`009`009`009`009`009obj.linedesc := n;
  225. X`009`009`009`009`009putobj;
  226. X`009`009`009`009     end;
  227. X`009`009`009`009otherwise writeln('-- Bad command, type ? for a list');
  228. X`009`009`009end;
  229. X`009`009end;
  230. X`009`009log_event(myslot,E_OBJDONE,objnum,0);
  231. X
  232. X`009end else
  233. X`009`009writeln('You are not allowed to program that object.');
  234. X`009end else
  235. X`009`009writeln('There is no object by that name.');
  236. X`009end;
  237. X`009exit_label:
  238. Xend;
  239. X
  240. X`123 -----------------------------------------------------------------------
  241. V---- `125
  242. X`091global`093 PROCEDURE type_paper;
  243. Xvar c_file: text;
  244. X    count,errorcode: integer;
  245. X    line: string;
  246. X    continue: boolean;
  247. X
  248. X    procedure leave;
  249. X    begin
  250. X`009writeln('EXIT');
  251. X`009line  := '-';
  252. X    end;
  253. X
  254. Xbegin
  255. X   open(c_file,root+'COMMANDS.PAPER',HISTORY := READONLY,
  256. X      sharing := READONLY ,error := continue);
  257. X   errorcode := status(c_file);
  258. X   if errorcode > 0 then begin
  259. X      case errorcode of
  260. X`0093: `123 PAS$K_FILNOTFOU `125 writeln('%File COMMANDS.PAPER not found.');
  261. X`009otherwise writeln('%Can''t open file COMMANDS.PAPER, error code (status)
  262. V: ',
  263. X`009    errorcode:1);
  264. X      end; `123 case `125
  265. X      writeln('% Notify Monster Manager.');
  266. X   end else begin
  267. X      reset(c_file);
  268. X      count := 0;
  269. X      continue := true;
  270. X      while not eof(c_file) and continue do begin
  271. X         readln(c_file,line);
  272. X         writeln(line);
  273. X         count := count +1;
  274. X         if count > terminal_page_len -2 then begin
  275. X            grab_line('-more-',line,,true,eof_handler := leave);
  276. X            continue := line = '';
  277. X            count := 0;
  278. X         end;
  279. X      end;
  280. X      close(c_file);
  281. X   end;
  282. Xend; `123 type_paper `125
  283. X
  284. Xprocedure do_y_altmsg;
  285. Xvar
  286. X`009newdsc: integer;
  287. X
  288. Xbegin
  289. X`009if is_owner then begin
  290. X`009`009gethere;
  291. X`009`009newdsc := here.xmsg2;
  292. X`009`009writeln('`091 Editing the alternate mystery message for this room `0
  293. V93');
  294. X`009`009if edit_desc(newdsc) then begin
  295. X`009`009`009getroom;
  296. X`009`009`009here.xmsg2 := newdsc;
  297. X`009`009`009putroom;
  298. X`009`009end;
  299. X`009end;
  300. Xend;
  301. X
  302. X
  303. Xprocedure do_group1;
  304. Xlabel exit_label;
  305. Xvar
  306. X`009grpnam: string;
  307. X`009loc: integer;
  308. X`009tmp: string;
  309. X
  310. X    procedure leave;
  311. X    begin
  312. X`009writeln('EXIT - No changes.');
  313. X`009goto exit_label;
  314. X    end;
  315. X
  316. X`009
  317. Xbegin
  318. X`009if is_owner then begin
  319. X`009`009gethere;
  320. X`009`009if here.grploc1 = 0 then
  321. X`009`009`009writeln('No primary group location set')
  322. X`009`009else begin
  323. X`009`009`009getnam;
  324. X`009`009`009freenam;
  325. X`009`009`009writeln('The primary group location is ',nam.idents`091here.grpl
  326. Voc1`093,'.');
  327. X`009`009`009writeln('Descriptor string: `091',here.grpnam1,'`093');
  328. X`009`009end;
  329. X`009`009writeln;
  330. X`009`009writeln('Type * to turn off the primary group location');
  331. X`009`009grab_line('Room name of primary group? ',grpnam,
  332. X`009`009    eof_handler := leave);
  333. X`009`009if length(grpnam) = 0 then
  334. X`009`009`009writeln('No changes.')
  335. X`009`009else if grpnam = '*' then begin
  336. X`009`009`009getroom;
  337. X`009`009`009here.grploc1 := 0;
  338. X`009`009`009putroom;
  339. X`009`009end else if lookup_room(loc,grpnam) then begin
  340. X`009`009`009writeln('Enter the descriptive string.  It will be placed after
  341. V player names.');
  342. X`009`009`009writeln('Example:  Monster Manager is `091descriptive string, in
  343. Vstead of "here."`093');
  344. X`009`009`009writeln;
  345. X`009`009`009grab_line('Enter string? ',tmp,
  346. X`009`009`009    eof_handler := leave);
  347. X`009`009`009if length(tmp) > shortlen then begin
  348. X`009`009`009`009writeln('Your string was truncated to ',shortlen:1,' charact
  349. Vers.');
  350. X`009`009`009`009tmp := substr(tmp,1,shortlen);
  351. X`009`009`009end;
  352. X`009`009`009getroom;
  353. X`009`009`009here.grploc1 := loc;
  354. X`009`009`009here.grpnam1 := tmp;
  355. X`009`009`009putroom;
  356. X`009`009end else
  357. X`009`009`009writeln('No such room.');
  358. X`009end;
  359. X    exit_label:
  360. Xend;
  361. X
  362. Xprocedure do_group2;
  363. Xlabel exit_label;
  364. Xvar
  365. X`009grpnam: string;
  366. X`009loc: integer;
  367. X`009tmp: string;
  368. X
  369. X    procedure leave;
  370. X    begin
  371. X`009writeln('EXIT - No changes.');
  372. X`009goto exit_label;
  373. X    end;
  374. X
  375. Xbegin
  376. X`009if is_owner then begin
  377. X`009`009gethere;
  378. X`009`009if here.grploc2 = 0 then
  379. X`009`009`009writeln('No secondary group location set')
  380. X`009`009else begin
  381. X`009`009`009getnam;
  382. X`009`009`009freenam;
  383. X`009`009`009writeln('The secondary group location is ',nam.idents`091here.gr
  384. Vploc2`093,'.');
  385. X`009`009`009writeln('Descriptor string: `091',here.grpnam2,'`093');
  386. X`009`009end;
  387. X`009`009writeln;
  388. X`009`009writeln('Type * to turn off the secondary group location');
  389. X`009`009grab_line('Room name of secondary group? ',grpnam,
  390. X`009`009    eof_handler := leave);
  391. X`009`009if length(grpnam) = 0 then
  392. X`009`009`009writeln('No changes.')
  393. X`009`009else if grpnam = '*' then begin
  394. X`009`009`009getroom;
  395. X`009`009`009here.grploc2 := 0;
  396. X`009`009`009putroom;
  397. X`009`009end else if lookup_room(loc,grpnam) then begin
  398. X`009`009`009writeln('Enter the descriptive string.  It will be placed after
  399. V player names.');
  400. X`009`009`009writeln('Example:  Monster Manager is `091descriptive string, in
  401. Vstead of "here."`093');
  402. X`009`009`009writeln;
  403. X`009`009`009grab_line('Enter string? ',tmp,
  404. X`009`009`009    eof_handler := leave);
  405. X`009`009`009if length(tmp) > shortlen then begin
  406. X`009`009`009`009writeln('Your string was truncated to ',shortlen:1,' charact
  407. Vers.');
  408. X`009`009`009`009tmp := substr(tmp,1,shortlen);
  409. X`009`009`009end;
  410. X`009`009`009getroom;
  411. X`009`009`009here.grploc2 := loc;
  412. X`009`009`009here.grpnam2 := tmp;
  413. X`009`009`009putroom;
  414. X`009`009end else
  415. X`009`009`009writeln('No such room.');
  416. X`009end;
  417. X    exit_label:
  418. Xend;
  419. X
  420. X`123 custom MONSTER --------------------------------------------------------
  421. V---- `125
  422. X
  423. Xprocedure view2_monster(mid: integer);
  424. Xbegin
  425. X    getpers;
  426. X    freepers;
  427. X    writeln('Monster     : ',pers.idents`091mid`093);
  428. X    getint(N_EXPERIENCE);
  429. X    freeint;
  430. X    writeln(' experience : ',anint.int`091mid`093:1);
  431. X    writeln(' level      : ',leveltable`091level(anint.int`091mid`093)`093.n
  432. Vame);
  433. X    getint(N_HEALTH);
  434. X    freeint;
  435. X    writeln(' health     : ',anint.int`091mid`093:1);
  436. X    getint(N_PRIVILEGES);
  437. X    freeint;
  438. X    write  (' privileges : '); list_privileges(uint(anint.int`091mid`093));
  439. X    writeln;
  440. X    getint(N_SELF);
  441. X    freeint;
  442. X    if (anint.int`091mid`093 = 0) or (anint.int`091mid`093 = DEFAULT_LINE) t
  443. Vhen
  444. X`009writeln('Monster haven''t the self-description.')
  445. X    else print_desc(anint.int`091mid`093);
  446. Xend; `123 view2_monster `125
  447. X
  448. Xprocedure lister(code: integer);
  449. Xlabel 0; `123 out `125
  450. Xvar count: integer;
  451. X
  452. X    procedure leave;
  453. X    begin
  454. X`009writeln('EXIT');
  455. X`009goto 0;
  456. X    end;
  457. X
  458. X
  459. X    procedure print(l: mega_string);
  460. X    var s: string;
  461. X    begin
  462. X`009writeln(l);
  463. X`009count := count +1;
  464. X`009if count > terminal_page_len -2 then begin
  465. X`009    grab_line('-more-',s,erase := true,eof_handler := leave);
  466. X`009    if s > '' then goto 0;
  467. X`009    count := 0;
  468. X`009end;
  469. X    end; `123 print `125
  470. X
  471. Xbegin
  472. X    count := 0;
  473. X    list_program(code,print,terminal_line_len);
  474. X    0:
  475. Xend; `123 lister `125
  476. X
  477. Xprocedure lister_2(code: integer; param: string);
  478. Xlabel exit_label;
  479. Xvar list_file: text;
  480. X    name: string;
  481. X    counter,errorcode: integer;
  482. X    s: string;
  483. X
  484. X    procedure print(l: mega_string);
  485. X    begin
  486. X`009counter := counter + 1;
  487. X`009if (counter mod 50) = 0 then checkevents(TRUE);
  488. X`009writeln(list_file,l);
  489. X    end; `123 print `125
  490. X
  491. X    procedure leave;
  492. X    begin
  493. X`009writeln('EXIT');
  494. X`009goto exit_label;
  495. X    end;
  496. X
  497. Xbegin
  498. X    counter := 0;
  499. X    if param = '' then begin
  500. X`009writeln('File name for listing ?');
  501. X`009writeln('Default: MDL.LIS');
  502. X`009grab_line('File name? ',s,eof_handler := leave);
  503. X    end else s := param;
  504. X    open(list_file,s,new,default := 'MDL.LIS',error := continue);
  505. X    errorcode := status(list_file);
  506. X    if errorcode > 0 then case errorcode of
  507. X`0094: `123 PAS$K_INVFILSYN `125 writeln('Illegal file name.');
  508. X`009otherwise writeln('Can''t open file for writing, error code (status): ',
  509. X`009    errorcode:1)
  510. X    end `123case `125
  511. X    else begin
  512. X`009rewrite(list_file);
  513. X`009list_program(code,print,terminal_line_len);
  514. X`009close(list_file);
  515. X    end;
  516. X    exit_label:
  517. Xend; `123 lister_2 `125
  518. X              `032
  519. XPROCEDURE custom_monster; `123 (name: string); forward; `125
  520. Xlabel exit_label;
  521. Xvar s,param,def: string;
  522. X    done,ok: boolean;
  523. X    mid,mslot,code,self,oldloc,old: integer;
  524. X    mname: shortstring;    `032
  525. X    notice: shortstring;
  526. X    lev,max,value,health,exp,i: integer;
  527. X    prevloc: integer;
  528. X
  529. X    procedure leave;
  530. X    begin
  531. X`009writeln('EXIT');
  532. X        log_event (myslot,E_MONSTERDONE,0,0,'');
  533. X`009goto exit_label;
  534. X    end;
  535. X
  536. X
  537. Xbegin
  538. X  oldloc := location;
  539. X  if not is_owner(location,TRUE) then `123 is_owner make gethere `125
  540. X     writeln('You must be in one of your own rooms to customize a monster.')
  541. X  else if name = '' then writeln('To customize a monster, type CUSTOM MONSTE
  542. VR <monster name>.')
  543. X  else if parse_pers(mslot,name) then begin
  544. X
  545. X     mname := here.people`091mslot`093.name;
  546. X     def := trim_filename(mname);
  547. X
  548. X     if exact_pers(mid,mname) then begin   `032
  549. X        if here.people`091mslot`093.kind = P_MONSTER then begin
  550. X           code := here.people`091mslot`093.parm;
  551. X           if (monster_owner(code) = userid) or owner_priv then begin
  552. X              log_action (e_custommonster,0);
  553. X              done := false;
  554. X              repeat
  555. X`009`009prevloc := location;
  556. X                grab_line ('Custom monster> ',s,eof_handler := leave);
  557. X                param := lowcase(s);
  558. X`009`009s := bite(param);
  559. X                getint(N_LOCATION);
  560. X                freeint;
  561. X`009`009if prevloc <> location then begin
  562. X`009`009   writeln('You can no longer customize this monster.');
  563. X                   done := true;
  564. X                end else if anint.int`091mid`093 <> location then begin
  565. X                   writeln ('Monster is no longer here.');
  566. X                   done := true
  567. X                end else if s > '' then case s`0911`093 of
  568. X                  'h','?': command_help('*monster help*');
  569. X                  'a'    : begin`032
  570. X                             lev := level(myexperience);
  571. X`009`009`009     if lev = levels then max := maxexperience
  572. X`009`009`009     else if leveltable`091lev+1`093.exp > maxexperience then
  573. X`009`009`009`009 max := maxexperience
  574. X`009`009`009     else max := leveltable`091lev+1`093.exp -1;
  575. X                             if param > '' then s := param
  576. X                             else begin
  577. X                                write('Give monster''s level ');
  578. X                                write(leveltable`0911`093.name,' - ');
  579. X`009`009`009`009writeln(leveltable`091lev`093.name);
  580. X`009`009`009`009writeln('or experience 0 - ',max:1,'.');
  581. X                                grab_line('Level or experience? ',s,
  582. X`009`009`009`009    eof_handler := leave);
  583. X                             end;
  584. X`009`009`009     value := -1;
  585. X                             if lookup_level(value,s) then begin
  586. X`009`009`009`009 value := leveltable`091value`093.exp;
  587. X`009`009`009     end else if isnum(s) then begin
  588. X`009`009`009`009 value := number(s);
  589. X`009`009`009`009 if (value < 0) or (value > max) then begin
  590. X`009`009`009`009     writeln('Out of range.');
  591. X`009`009`009`009     value := -1;
  592. X`009`009`009`009 end;
  593. X`009`009`009     end else begin
  594. X`009`009`009`009 writeln('Not such level or experience.');
  595. X`009`009`009`009 value := -1
  596. X`009`009`009     end;
  597. X`009`009`009     if userid <> MM_userid then begin
  598. X`009`009`009`009if leveltable`091level(value)`093.hidden and`032
  599. X`009`009`009`009    (level(value) <> lev) then begin
  600. X`009`009`009`009    writeln('You can give only your own hidden level.');
  601. X`009`009`009`009    value := -1;
  602. X`009`009`009`009end else if level(value) > lev then begin
  603. X`009`009`009`009    writeln('Not allowed.');
  604. X`009`009`009`009    value := -1;
  605. X`009`009`009`009end;
  606. X`009`009`009    end;
  607. X`009`009`009    if value >= 0 then begin
  608. X`009`009`009`009exp := value;`032
  609. X                                lev := level(value);
  610. X                                health := leveltable`091lev`093.health * goo
  611. Vdhealth`032
  612. X                                   div 10;
  613. X         `032
  614. X                                getroom;
  615. X                                here.people`091mslot`093.health := health;
  616. X                                here.people`091mslot`093.experience := exp;
  617. X                                putroom;
  618. X                                getint(N_HEALTH);
  619. X                                anint.int`091mid`093 := health;
  620. X                                putint;
  621. X                                getint(N_EXPERIENCE);
  622. X                                anint.int`091mid`093 := exp;
  623. X                                putint;
  624. X                                writeln('Monster''s experience is now ',exp:
  625. V1);
  626. X                                writeln('and health is ',health:1);
  627. X                             end;
  628. X                           end;
  629. X`009`009  'i'    : begin
  630. X`009`009`009     getint(N_EXPERIENCE);
  631. X`009`009`009     freeint;
  632. X`009`009`009     lev := level(anint.int`091mid`093);
  633. X`009`009`009     max := leveltable`091lev`093.health;
  634. X`009`009`009     if param > '' then s := param
  635. X`009`009`009     else begin
  636. X`009`009`009`009writeln('Give monster''s health 0 - ',max:1);
  637. X`009`009`009`009grab_line('Health? ',s,eof_handler := leave);
  638. X`009`009`009    end;
  639. X`009`009`009    if not isnum(s) then
  640. X`009`009`009`009writeln('Not such value.')
  641. X`009`009`009    else if (number(s) < 0) or (number(s) > max) then
  642. X`009`009`009`009writeln('Out of range.')
  643. X`009`009`009    else begin
  644. X`009`009`009`009health := number(s);
  645. X                                getroom;
  646. X                                here.people`091mslot`093.health := health;
  647. X                                putroom;
  648. X                                getint(N_HEALTH);
  649. X                                anint.int`091mid`093 := health;
  650. X                                putint;
  651. X`009`009`009`009writeln('Database updated.');
  652. X`009`009`009    end;
  653. X`009`009`009end;
  654. X                  'b'    : set_runnable(code,false);
  655. X                  'c'    : type_paper;
  656. X                  'd'    : begin
  657. X                             getint(N_PRIVILEGES);
  658. X                             freeint;
  659. X                             value := anint.int`091mid`093;
  660. X                             if custom_privileges(value,
  661. X`009`009`009`009read_cur_priv) then begin
  662. X                                getint(N_PRIVILEGES);
  663. X                                anint.int`091mid`093 := value;
  664. X                                putint;
  665. X                                writeln('Database updated.');
  666. X                             end else writeln('Database not updated.');
  667. X                           end;
  668. X                  'p'    : if monster_priv then monsterpriv(code)
  669. X                           else writeln ('This command is for Monster Manage
  670. Vr.');
  671. X                  'f'    : set_runnable(code,true);
  672. X                  'v'    : begin
  673. X`009`009`009       view2_monster(mid);
  674. X`009`009`009       grab_line('-more-',s,erase := true,
  675. X`009`009`009`009    eof_handler := leave);
  676. X`009`009`009       if s = '' then view_monster(code);
  677. X`009`009`009   end;
  678. X                  'm'    : begin
  679. X                             if param > '' then s := param
  680. X                             else grab_line('Label? ',s,eof_handler := leave
  681. V);
  682. X                             if s > '' then begin
  683. X                                if length(s) > shortlen then
  684. X                                  s := substr(s,1,shortlen);
  685. X                                if not run_monster(mname,code,s,'','',
  686. X                                   sysdate+' '+systime)
  687. X                                   then writeln ('Label not found or monster
  688. V is dead.');
  689. X                                if oldloc <> location then begin
  690. X                                   writeln('You are no longer customizing mo
  691. Vnster.');
  692. X                                   done := true;
  693. X                                end;
  694. X                             end;
  695. X                           end;
  696. X                  'g'    : begin
  697. X                             if param > '' then s := param
  698. X                             else begin
  699. X`009`009`009`009writeln('Default: ',def);
  700. X`009`009`009`009grab_line('File name? ',s,eof_handler := leave);
  701. X`009`009`009     end;
  702. X`009`009`009     load(code,s,sysdate+' '+systime,userid,def);
  703. X`009`009`009     getint(N_PRIVILEGES);
  704. X`009`009`009     value := anint.int`091mid`093;
  705. X`009`009`009     anint.int`091mid`093 := 0;
  706. X`009`009`009     putint;
  707. X`009`009`009     if value <> 0 then writeln('Monster''s privilege set is now
  708. V empty.');
  709. X                           end;
  710. X`009`009  'j'    : begin
  711. X`009`009`009     if get_flag(code,CF_NO_CONTROL) then begin
  712. X`009`009`009`009set_flag(code,CF_NO_CONTROL,false);
  713. X`009`009`009`009getint(N_PRIVILEGES);
  714. X`009`009`009`009value := anint.int`091mid`093;
  715. X`009`009`009`009anint.int`091mid`093 := 0;
  716. X`009`009`009`009putint;
  717. X`009`009`009`009if value <> 0 then writeln('Monster''s pprivilege set is now
  718. V empty.');
  719. X`009`009`009     end else set_flag(code,CF_NO_CONTROL,TRUE);
  720. X`009`009`009     writeln('Databse updated.');
  721. X`009`009`009   end;
  722. X                  's'    : begin
  723. X                             writeln ('Edit monster self description');
  724. X                             getint(N_SELF);
  725. X                             freeint;
  726. X                             self := anint.int`091mid`093;
  727. X                             if edit_desc(self) then begin
  728. X                                getroom;
  729. X                                here.people`091mslot`093.self := self;
  730. X                                putroom;
  731. X                                getint(N_SELF);
  732. X                                anint.int`091mid`093 := self;
  733. X                                putint;
  734. X                             end;
  735. X                           end;
  736. X                  'l'    : lister (code);
  737. X`009`009  'o'`009 : lister_2 (code,param);
  738. X                  'n'    : begin
  739. X                              if param > '' then s := param
  740. X                              else grab_line ('New name? ',s,eof_handler :=
  741. V leave);
  742. X                              if s = '' then writeln ('No changes')
  743. X                              else if length(s) > shortlen then
  744. X                                 writeln('Limit new name to ',shortlen:1,' c
  745. Vharacters.')
  746. X                              else if lowcase(s) = 'monster manager' then
  747. X                                 writeln ('That name is reserved for the Mon
  748. Vster Manager.')
  749. X                              else begin
  750. X                                 if exact_pers(old,s) then
  751. X                                    if old = mid then ok := true
  752. X                                    else begin
  753. X                                       ok := false;
  754. X                                       writeln ('Someone already has that na
  755. Vme.');
  756. X                                    end
  757. X                                 else ok := true;
  758. X                                 if ok then begin
  759. X                                    getroom;
  760. X                                    notice := here.people`091mslot`093.name;
  761. X                                    here.people`091mslot`093.name := s;
  762. X                                    putroom;
  763. X                                    getpers;
  764. X                                    pers.idents`091mid`093 := s;
  765. X                                    putpers;
  766. X                                    mname := s;
  767. X                                    log_event(0,E_SETNAM,0,0,notice+' is now
  768. V known as ' + s);
  769. X                                 end
  770. X                              end;
  771. X                           end;
  772. X                  'e','q': done := true;
  773. X                   otherwise writeln ('Enter ? for help.');
  774. X                end; `123 case `125
  775. X              until done;               `032
  776. X              log_event (myslot,E_MONSTERDONE,0,0,'');
  777. X           end else writeln ('You are not the owner of this monster.');
  778. X        end else writeln ('You can only customize monsters.');
  779. X     end else writeln ('%serius error in custom_monster. Notify monster mana
  780. Vger.');
  781. X  end else writeln ('That monster isn''t here.');
  782. X   exit_label:
  783. X
  784. Xend;`009`123 custom_monster `125
  785. X
  786. X`123 custom HOOK -----------------------------------------------------------
  787. V---- `125
  788. X
  789. XPROCEDURE custom_hook `123(var code: integer; owner: shortstring;
  790. X`009`009`009default: string := '.MDL')`125;
  791. Xlabel exit_label;
  792. Xvar done: boolean;
  793. X    s,param: string;
  794. X
  795. X    procedure leave;
  796. X    begin
  797. X`009writeln('EXIT');
  798. X`009goto exit_label;
  799. X    end;
  800. X
  801. X
  802. Xbegin
  803. X  if code = 0 then begin `123 alloc code `125
  804. X     if alloc_general(I_HEADER,code) then begin
  805. X        create_program (code,owner,sysdate+' '+systime);
  806. X        writeln ('New hook created.');
  807. X     end else begin
  808. X        writeln ('There is no place for any more hooks in this universe.');
  809. X        code := 0
  810. X     end;
  811. X  end;
  812. X  if code > 0 then begin
  813. X     done := false;
  814. X     repeat
  815. X        grab_line ('Custom hook> ',s,eof_handler := leave);
  816. X        param := lowcase(s);
  817. X`009s := bite(param);
  818. X        if s > '' then case s`0911`093 of
  819. X           'h','?': command_help('*hook help*');
  820. X           'b'    : set_runnable(code,false);
  821. X           'c'    : type_paper;
  822. X           'p'    : if monster_priv then monsterpriv(code)
  823. X                    else writeln ('This command is for Monster Manager.');
  824. X           'f'    : set_runnable(code,true);
  825. X           'v'    : view_monster(code);
  826. X           'm'    : begin
  827. X                       if param > '' then s := param
  828. X                       else grab_line('Label? ',s,eof_handler := leave);
  829. X                       if s > '' then begin
  830. X                          if length(s) > shortlen then
  831. X                             s := substr(s,1,shortlen);
  832. X                          if not run_monster('',code,s,'','',
  833. X                             sysdate+' '+systime)
  834. X                             then writeln ('Label not found.');
  835. X                       end;
  836. X                    end;
  837. X           'g'    : begin
  838. X                       if param > '' then s := param
  839. X                       else begin
  840. X`009`009`009    writeln('Default: ',default);
  841. X`009`009`009    grab_line('File name? ',s,eof_handler := leave);
  842. X`009`009       end;
  843. X`009`009       load(code,s,sysdate+' '+systime,userid,default);
  844. X                    end;                      `032
  845. X           'l'    : lister (code);
  846. X`009   'o'`009  : lister_2 (code,param);
  847. X           'e','q': done := true;
  848. X           'd'    : begin
  849. X                       delete_program(code);
  850. X                       delete_general(I_HEADER,code);
  851. X                       done := true;
  852. X                       code := 0;
  853. X                       writeln ('Hook deleted.');
  854. X                    end;
  855. X           otherwise writeln ('Enter ? for help.');
  856. X       end; `123 case `125
  857. X     until done;
  858. X  end;
  859. X  exit_label:
  860. Xend;
  861. X
  862. X`123 custom SPELL ----------------------------------------------------------
  863. V----- `125
  864. X
  865. X`091global`093 PROCEDURE custom_spell(s: string);
  866. Xlabel exit_label;
  867. X
  868. Xvar done: boolean;
  869. X    param: string;
  870. X    code: integer; owner: shortstring;
  871. X    default: string;
  872. X
  873. X    procedure leave;
  874. X    begin
  875. X`009writeln('EXIT');
  876. X`009log_event(myslot,E_SPELLDONE,0,0,'');
  877. X`009goto exit_label;
  878. X    end;
  879. X
  880. X    var new: boolean;
  881. X`009sid,player: integer;
  882. Xbegin
  883. X  if (s = '') or (s = '?') then`032
  884. X    writeln('Use SET SPELL <spell name> to customize spell.')
  885. X  else begin
  886. X    new := not lookup_spell(sid,s);
  887. X `032
  888. X    if new then begin
  889. X`009code := 0;
  890. X`009if alloc_general(I_SPELL,sid) then begin
  891. X`009    getspell_name;
  892. X`009    spell_name.idents`091sid`093 := s;
  893. X`009    putspell_name;
  894. X
  895. X`009    if alloc_general(I_HEADER,code) then begin
  896. X`009`009create_program (code,userid,sysdate+' '+systime);
  897. X`009`009getint(N_SPELL);
  898. X`009`009anint.int`091sid`093 := code;
  899. X`009`009putint;
  900. X
  901. X`009`009getindex(I_PLAYER);
  902. X`009`009freeindex;
  903. X`009`009for player := 1 to indx.top do if not indx.free`091player`093 then
  904. X`009`009    begin
  905. X`009`009`009getspell(player);
  906. X`009`009`009spell.level`091sid`093 := 0;
  907. X`009`009`009putspell;
  908. X`009`009    end;
  909. X`009`009writeln ('New spell created.');
  910. X`009`009       `009`009
  911. X`009    end else begin
  912. X`009`009writeln ('There is no place for any more spell codes in this univers
  913. Ve.');
  914. X`009`009code := 0;
  915. X`009`009getspell_name;
  916. X`009`009spell_name.idents`091sid`093 := '';
  917. X`009`009putspell_name;
  918. X`009`009delete_general(I_SPELL,sid);
  919. X`009    end;
  920. X`009end else writeln('There is no place for any more spells in this universe
  921. V.');
  922. X
  923. X    end else begin
  924. X`009getint(N_SPELL);
  925. X`009freeint;
  926. X`009code := anint.int`091sid`093;
  927. X
  928. X`009if not is_spell_owner(sid) then
  929. X`009    begin
  930. X`009`009writeln('You haven''t owner of this spell.');
  931. X`009`009code := 0;
  932. X`009    end;
  933. X    end;
  934. X
  935. X    if code > 0 then begin
  936. X       getspell_name;
  937. X       freespell_name;
  938. X       default := trim_filename(spell_name.idents`091sid`093);
  939. X       log_action(e_customspell,0);
  940. X
  941. X       done := false;
  942. X       repeat
  943. X        grab_line ('Custom spell> ',s,eof_handler := leave);
  944. X        param := lowcase(s);
  945. X`009s := bite(param);
  946. X        if s > '' then case s`0911`093 of
  947. X           'h','?': command_help('*spell help*');
  948. X           'b'    : set_runnable(code,false);
  949. X           'c'    : type_paper;
  950. X           'p'    : if monster_priv then monsterpriv(code)
  951. X                    else writeln ('This command is for Monster Manager.');
  952. X           'f'    : set_runnable(code,true);
  953. X           'v'    : view_monster(code);
  954. X           'm'    : begin
  955. X                       if param > '' then s := param
  956. X                       else grab_line('Label? ',s,eof_handler := leave);
  957. X                       if s > '' then begin
  958. X                          if length(s) > shortlen then
  959. X                             s := substr(s,1,shortlen);
  960. X                          if not run_monster('',code,s,'','',
  961. X                             sysdate+' '+systime)
  962. X                             then writeln ('Label not found.');
  963. X                       end;
  964. X                    end;
  965. X           'g'    : begin
  966. X                       if param > '' then s := param
  967. X                       else begin
  968. X`009`009`009    writeln('Default: ',default);
  969. X`009`009`009    grab_line('File name? ',s,eof_handler := leave);
  970. X`009`009       end;
  971. X`009`009       if get_flag(code, CF_SPELL_MODE) then`032
  972. X`009`009`009    set_flag(code, CF_SPELL_MODE,FALSE);
  973. X`009`009       load(code,s,sysdate+' '+systime,userid,default);
  974. X                    end;                      `032
  975. X           'l'    : lister (code);
  976. X`009   'o'`009  : lister_2 (code,param);
  977. X           'e','q': done := true;
  978. X           'd'    : begin
  979. X                       delete_program(code);
  980. X                       delete_general(I_HEADER,code);
  981. X
  982. X`009`009       getspell_name;
  983. X`009`009       spell_name.idents`091sid`093 := '';
  984. X`009`009       putspell_name;
  985. X`009`009       getint(N_SPELL);
  986. X`009`009       anint.int`091sid`093 := 0;
  987. X`009`009       putint;
  988. X
  989. X`009`009       delete_general(I_SPELL,sid);
  990. X                       done := true;
  991. X                       code := 0;
  992. X                       writeln ('Spell deleted.');
  993. X                    end;
  994. X`009`009'i': begin
  995. X                       if param > '' then s := param
  996. X                       else begin
  997. X`009`009`009    writeln('Seting your level of this spell.');
  998. X`009`009`009    grab_line('Level? ',s,eof_handler := leave);
  999. X`009`009       end;
  1000. X`009`009`009
  1001. X`009`009       if isnum(s) then begin
  1002. X`009`009`009  if number(s) < 0 then writeln('Must be positive or zero.')
  1003. X`009`009`009  else begin
  1004. X`009`009`009    getspell(mylog);
  1005. X`009`009`009    spell.level`091sid`093 := number(s);
  1006. X`009`009`009    putspell;
  1007. X`009`009`009    writeln('Database modified');
  1008. X`009`009`009end;
  1009. X`009`009       end else writeln('Invalid number.');
  1010. X`009`009`009`032
  1011. X`009`009     end;
  1012. X           'a'`009  : if get_flag(code, CF_SPELL_MODE) then`032
  1013. X`009`009`009set_flag(code, CF_SPELL_MODE,FALSE)
  1014. X`009`009    else if not spell_priv then`032
  1015. X`009`009`009writeln('You haven''t power for this.')
  1016. X`009`009    else set_flag(code, CF_SPELL_MODE,TRUE);
  1017. X           otherwise writeln ('Enter ? for help.');
  1018. X       end; `123 case `125
  1019. X       until done;
  1020. X       log_event (myslot,E_SPELLDONE,0,0,'');
  1021. X     end;
  1022. X  end;
  1023. X  exit_label:
  1024. Xend;
  1025. X
  1026. X`123 Global Code -----------------------------------------------------------
  1027. V---- `125
  1028. X
  1029. X`091global`093 procedure exec_global(flag: integer; label_name: shortstring;
  1030. V`032
  1031. X`009force_read: boolean := false; variable: shortstring := '';
  1032. X`009value: mega_string := '');
  1033. Xvar code: integer;
  1034. Xbegin
  1035. X    if Gf_Types `091 flag`093 <> G_code then begin
  1036. X`009writeln('%Error in exec_global:');
  1037. X        writeln('%Global value #',flag:1,' isn''t global MDL code');
  1038. X`009writeln('%Notify Monster Manager.');
  1039. X`009code := 0;
  1040. X    end else begin
  1041. X`009if read_global or force_read then begin
  1042. X`009    getglobal;
  1043. X`009    freeglobal;
  1044. X`009    read_global := false;
  1045. X`009end;
  1046. X`009code := global.int`091flag`093;
  1047. X    end;
  1048. X
  1049. X    if code <> 0 then`032
  1050. X`009run_monster(monster_name := '',
  1051. X`009`009    code := code,
  1052. X`009`009    label_name := label_name,
  1053. X`009`009    variable := variable,
  1054. X`009`009    value := value,
  1055. X`009`009    time := sysdate + ' ' + systime);
  1056. X
  1057. Xend; `123 exec_global `125
  1058. X
  1059. XPROCEDURE custom_g_code(var code: integer);
  1060. Xlabel exit_label;
  1061. X
  1062. Xvar done: boolean;
  1063. X    param: string;
  1064. X    default,s: string;
  1065. X
  1066. X    procedure leave;
  1067. X    begin
  1068. X`009writeln('EXIT');
  1069. X`009goto exit_label;
  1070. X    end;
  1071. X
  1072. Xbegin
  1073. X    if code = 0 then begin
  1074. X`009if alloc_general(I_HEADER,code) then begin
  1075. X`009    create_program (code,system_id,sysdate+' '+systime);
  1076. X
  1077. X`009    writeln ('New global MDL code created.');
  1078. X`009`009       `009`009
  1079. X`009end else begin
  1080. X`009    writeln ('There is no place for any more codes in this universe.');
  1081. X`009    code := 0;
  1082. X`009end;
  1083. X    end;
  1084. X
  1085. X    if code > 0 then begin
  1086. X       default := 'GLOBAL_CODE';
  1087. X
  1088. X       done := false;
  1089. X       repeat
  1090. X        grab_line ('Custom global code> ',s,eof_handler := leave);
  1091. X        param := lowcase(s);
  1092. X`009s := bite(param);
  1093. X        if s > '' then case s`0911`093 of
  1094. X           'h','?': command_help('*global c help*');
  1095. X           'b'    : set_runnable(code,false);
  1096. X           'c'    : type_paper;
  1097. X           'f'    : set_runnable(code,true);
  1098. X           'v'    : view_monster(code);
  1099. X           'm'    : begin
  1100. X                       if param > '' then s := param
  1101. X                       else grab_line('Label? ',s,eof_handler := leave);
  1102. X                       if s > '' then begin
  1103. X                          if length(s) > shortlen then
  1104. X                             s := substr(s,1,shortlen);
  1105. X                          if not run_monster('',code,s,'','',
  1106. X                             sysdate+' '+systime)
  1107. X                             then writeln ('Label not found.');
  1108. X                       end;
  1109. X                    end;
  1110. X           'g'    : begin
  1111. X                       if param > '' then s := param
  1112. X                       else begin
  1113. X`009`009`009    writeln('Default: ',default);
  1114. X`009`009`009    grab_line('File name? ',s,eof_handler := leave);
  1115. X`009`009       end;
  1116. X`009`009       load(code,s,sysdate+' '+systime,userid,default);
  1117. X                    end;                      `032
  1118. X           'l'    : lister (code);
  1119. X`009   'o'`009  : lister_2 (code,param);
  1120. X           'e','q': done := true;
  1121. X           'd'    : begin
  1122. X                       delete_program(code);
  1123. X                       delete_general(I_HEADER,code);
  1124. X
  1125. X                       code := 0;
  1126. X                       writeln ('Code deleted.');
  1127. X`009`009       done := true;
  1128. X                    end;
  1129. X           otherwise writeln ('Enter ? for help.');
  1130. X       end; `123 case `125
  1131. X       until done;
  1132. X     end;
  1133. X   exit_label:
  1134. Xend;
  1135. X
  1136. X`091global`093 procedure custom_global_code(code: integer);
  1137. Xvar val,lcv: integer;
  1138. Xbegin
  1139. X    if GF_Types`091code`093 <> G_code then begin
  1140. X`009writeln('%Error in custom_global_code:');
  1141. X`009writeln('%Global item #',code:1,' isn''t global MDL code.');
  1142. X`009writeln('%Notify Monster Manager.');
  1143. X    end else begin
  1144. X`009case code of
  1145. X`009    GF_CODE: writeln('Customize global hook.');
  1146. X`009    otherwise writeln('Edit global code #',code:1,' (unknown).');
  1147. X`009end; `123 case `125
  1148. X`009getglobal; freeglobal;
  1149. X`009val := global.int`091code`093;
  1150. X`009custom_g_code(val);
  1151. X`009getglobal;
  1152. X`009global.int`091code`093 := val;
  1153. X`009putglobal;
  1154. X`009read_global := false;
  1155. X        writeln('Database is updated.');
  1156. X`009for lcv :=1 to numevnts do log_event(0,E_GLOBAL_CHANGE,0,0,'',lcv);
  1157. X    end;
  1158. Xend; `123 custom_global_code `125
  1159. X
  1160. X
  1161. X`123 -----------------------------------------------------------------------
  1162. V---- `125
  1163. X
  1164. X`123 TO BEGIN DO ; `125
  1165. X`032
  1166. X`123 TO END DO ; `125
  1167. X
  1168. XEND.
  1169. $ CALL UNPACK CUSTOM.PAS;61 1193144491
  1170. $ create/nolog 'f'
  1171. X`091environment,inherit ('Global','Guts')`093
  1172. XMODULE database (output);
  1173. X`123+
  1174. XCOMPONENT: Tietokannan liittym`228
  1175. X`032
  1176. XPROGRAM DESCRIPTION:
  1177. X`032
  1178. X   `032
  1179. X`032
  1180. XAUTHORS:
  1181. X`032
  1182. X    Rich Skrenta (when code was in MON.PAS)
  1183. X    Kari Hurtta
  1184. X`032
  1185. XCREATION DATE: Unknown
  1186. X`032
  1187. XDESIGN ISSUES:
  1188. X`032
  1189. X    Saada MON.PAS pienemm`228ksi
  1190. X
  1191. X`032
  1192. XMODIFICATION HISTORY:
  1193. X`032
  1194. X     Date     `124   Name  `124 Description
  1195. X--------------+---------+---------------------------------------------------
  1196. V----
  1197. X    31.5.1992 `124`009Hurtta`009`124 T`228m`228 headeri, add* rutiineihin yl
  1198. V`228rajan tarkistus
  1199. X-`125
  1200. X
  1201. XVar
  1202. X    root: `091external`093 string;`009`123 database root `125
  1203. X    mylog: `091global`093 integer;`009`123 which log entry this player is `1
  1204. V25
  1205. X    location: `091global`093 integer := 0;`009`123 current place number `125
  1206. X
  1207. X    inmem: `091global`093 boolean := FALSE;`009
  1208. X`009`009`009 `123 Is this rooms roomrec (here....) in memory?
  1209. X`009`009`009   We call gethere many times to make sure
  1210. X`009`009`009   here is current.  However, we only want to
  1211. X`009`009`009   actually do a getroom if the roomrec has been
  1212. X`009`009`009   modified`009`125
  1213. X
  1214. X
  1215. X    `123 Tietueet : `125
  1216. X
  1217. X    header: `091global`093 headerrec;`009    `123 koodin header -tietue `125
  1218. X    here:   `091global`093 room;`009`009`123 current room record `125
  1219. X    event:  `091global`093 eventrec;
  1220. X`009nam,`009`009`009`123 record 1 is room names `125
  1221. X`009own,`009`009`009`123 rec 2 is room owners `125
  1222. X`009pers,`009`009`009`123  3 is player personal names `125
  1223. X`009user,`009`009`009`123  4 is player userid`009`125
  1224. X`009objnam,`009`009`009`123  5 is object name `125
  1225. X`009objown,`009`009`009`123  6 is object owner `125
  1226. X`009adate,`009`009`009`123  7 is date of last play `125
  1227. X`009atime,`009`009`009`123  8 is time of last play `125
  1228. X`009passwd,`009`009`009`123  9 is player password `125
  1229. +-+-+-+-+-+-+-+-  END  OF PART 10 +-+-+-+-+-+-+-+-
  1230.