Autodiagnosis Code [by Will Shaw]
Snippet Posted Wednesday, August 12th @ 11:24:07 PM, by George Greer in the Commands dept.
Added May 6, 1997. Click the link below to read it or download it.

From: Will Shaw <romulan@carol.net>
Subject: Autodiag code

All line numbers are relative to stock circle.


File fight.c
-------------
Around line 45, with the other external procedures, add:
....
void diag_char_to_char(struct char_data * i, struct char_data * ch);
....


Around line 880, add:
....
if (PRF_FLAGGED(ch, PRF_AUTODIAG) && !IS_NPC(ch) && FIGHTING(ch))
   diag_char_to_char(FIGHTING(ch), ch);
....
The above should come immediateley after the line:
hit(ch, FIGHTING(ch), TYPE_UNDEFINED);

If you have multihit code, it should not be much different; just make sure
you put the code in after all the hits have been dealt out, not after each
individual hit--kinda spammy that way.



File structs.h
--------------
Around line 176, add:
....
#define PRF_AUTODIAG

(1 << X)
....


File constants.c
----------------
/* PRF_x */
....
  "!GTZ",
  "RMFLG",
  "AUTODIAG",  <--- add this line
....


File act.other.c
----------------
Change the end of tog_messages (starts around line 789) to:
....

{"Autoexits disabled.\r\n",

"Autoexits enabled.\r\n"},

{"Autodiag disabled.\r\n",

"Autodiag enabled.\r\n"}
};
....


Around line 878, just after the case for 'SCMD_AUTOEXIT', add:
....

case SCMD_AUTODIAG:

 result = PRF_TOG_CHK(ch, PRF_AUTODIAG);
       break;
....



File interpreter.h
------------------

Around line 111, add:
....
#define SCMD_AUTODIAG
X
....



File interpreter.c
------------------
Somewhere in the Master Command List(tm), add:
....
 { "autodiag" , POS_DEAD    , do_gen_tog  , 0, SCMD_AUTODIAG },
....


That's all there is to it.  Updates and improvements are welcome...  Drop
me a line at romulan@carol.net if you have trouble with this code.

--
Will Shaw
romulan@carol.net


<< Autoassist Code [by Josh B.] | Reply | View as text | Flattened | Autoexit Code [by Nashak] >>

 


Related Links
  download
Related Articles
More by greerga
 
 

CircleMUD Snippets
 
Note: Not all of these snippets will work perfectly with your version of code, so be prepared to fix one or two bugs that may arise, and please let me know what you needed to do to fix it. Sending a corrected version is always welcome.
Finally, if you wish to use any of the snippets from this page, you are more than welcome, just mention the authors in your credits. If you wish to release any of these snippets to the public on another site, contact me FIRST.