Re: receptionist actions

From: Daniel A. Koepke (
Date: 02/10/02

On Thu, 7 Feb 2002, Daniel A. Koepke wrote:

> [...] the second checks if the special procedure has been invoked by
> something other than a command or NPC activity (i.e., fighting).

Replying to myself: this is incorrect.  I assumed that when called by
perform_violence(), the special procedure would have ch == FIGHTING(ch),
but this is incorrect.  It's also unfortunate because it makes it
impossible to differentiate between spec proc calls on mob and violence

So here's what I'll do to fight.c:perform_violence(), barring any

- if (MOB_FLAGGED(ch, MOB_SPEC) && mob_index[GET_MOB_RNUM(ch)].func != \
+ if (MOB_FLAGGED(ch, MOB_SPEC) && GET_MOB_SPEC(ch) != NULL) {
    char actbuf[MAX_INPUT_LENGTH] = "";
-   (mob_index[GET_MOB_RNUM(ch)].func) (ch, ch, 0, actbuf);
+   (GET_MOB_SPEC(ch)) (FIGHTING(ch), ch, 0, actbuf);

This presents the three cases for mob spec procs:

Situation 1: Called by a command.
  ch =       Character who issued the command.
  cmd =      Number of the command in the command table.
  argument = Remainder of the command line.

Situation 2: Called by a mob pulse.
  ch =       The spec proc'd mobile.
  cmd =      0
  argument = ""

Situation 3: Called by a violence pulse (while NPC is fighting).
  ch =       Character the spec proc'd mobile is fighting.
  cmd =      0
  argument = ""

We'll have to audit existing mobile spec procs to ensure that none have
any gray area when this changes.  (For instance, the receptionist's
behavior would change to where she random does an action during a fight
with a PC.)


   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT