[code] Newbie equipping mobile

From: Gabriel (ngray@fortnet.org)
Date: 12/07/96


Hello again, everyone.  This is my first serious attempt at writing a
special procedure =).

I created the mob, and assigned it this spec_proc, and in interpreter.c I
added a newbie
command with do_not_here, as Paul Shinn said to in his butcher spec. (I
borrowed some
code from it...thanks Paul!)

The mob stands there and talks, saying his stuff, plus the "Getting this
far, to the CMD_IS 
Function" part.  When I type newbie, nothing happens.  No 'Huh?!?' shows up,
just nothing.
If I type newbie anywhere else, I get the standard 'You can't do that here!'.
Can anyone tell me what I did wrong?  I'm sure it's something small...but I
can't see it.
My C isn't what I wished it was.

        As always, much groveling and thanks.

                Gabriel


/* My first attempt at a newbie equipping mob.  Gabriel 12/6/96      */

SPECIAL(newbie)
{
  struct char_data *victim;
  struct obj_data *obj;
  int z;

  int give_obj[] = { 3040, 3041, 3042, 3043, 3044, 3045, 3046, -1};


      switch (number(0, 5)) {
        case 0:
          act("$n says, 'Anyone new here need help?'", FALSE, ch, 0, 0,
TO_ROOM);
          break;
        case 1:
          act("$n says, 'I'm a very helpful mobile.'", FALSE, ch, 0, 0,
TO_ROOM);
          break;
        case 2:
          act("$n says, 'I can help you.  Trust me.'", FALSE, ch, 0, 0,
TO_ROOM);
          break;
        case 3:
          act("$n says, 'If anyone needs help, just say it.'", FALSE, ch, 0,
0, TO_ROOM);
          break;
        default:
          break;
    }
   act("$n says,'Getting this far, to the CMD_IS function.'", FALSE, ch, 0,
0, TO_ROOM);

  if (CMD_IS("newbie"))
    {
      argument = one_argument(argument, buf);
      if (!*buf) {
        act("$n says, 'Whom do you want me to help?'", FALSE, ch, 0, 0,
TO_ROOM);
        return TRUE;
        } 
      if(!(victim = get_char_vis(ch, buf))) {
        act("$n says, 'I can't see that person.  Where are they?'", FALSE,
ch, 0, 0, TO_ROOM);
        WAIT_STATE(ch, PULSE_VIOLENCE);
        act("$n frowns.", FALSE, ch, 0, 0, TO_ROOM);
        return TRUE;
      }
      if (GET_LEVEL(victim) > 3) {
        act("$n says, 'I think they are a little too experienced for me to
help.'", FALSE, ch, 0, 0,
TO_ROOM);
        WAIT_STATE(ch, PULSE_VIOLENCE);
        act("$n says, 'Sorry.'", FALSE, ch, 0, 0, TO_ROOM);
        return TRUE;
      }
      /* If they made it this far, they are eligible for the mob's help */
      /* So, we help them!                                              */
     
      for (z = 0; give_obj[z] != -1; z++) {
        obj = read_object(give_obj[z], VIRTUAL);
        if (obj == NULL)
          continue;
        obj_to_char(obj, victim);
      }

      act("$n says, 'Here you go.'", FALSE, ch, 0, 0, TO_ROOM);
      send_to_char("$n gives you several items.\r\n", victim);
      act("$n gives $n several items.", FALSE, ch, 0, victim, TO_ROOM);
      act("$n pats $n on the head.", FALSE, ch, 0, victim, TO_ROOM);
      act("$n smiles broadly.", FALSE, ch, 0, 0, TO_ROOM);
      sprintf(buf, "%s was newbie equipped.", GET_NAME(victim));
      mudlog(buf, CMP, LVL_IMMORT, TRUE);
      return TRUE;
  }
  return FALSE;
}

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST