Newbie code/Stock Bug

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


Hello all.  Just a few things I want to share :

Small stock bug, just a cosmetic thingy, really.  In the do_advance
function in act.wizard.c, if you advance another character from a higher
level to a lower level, the message gets sent to the god instead of the
victim.  (Hey, I'm a stickler for little things =)

send_to_char("You are momentarily enveloped by darkness!\r\n"
             "You feel somewhat diminished.\r\n", ch);
                         Just need to change this ^^ to victim, and you'll 
                         be set.

And here's my almost completed newbie spec_procedure, with one small bug.
I'm sure there are many more efficient ways to impliment this, but this is
how I went about doing it.  I added a plr flag, PLR_NEWBIED, for the mob
to check if the character has been newbied.  I'm sure I'll change it in
the future, beacuse it seems a shame to waste the flag, but for now it
works just fine.  I'm not the world's best coder.  Yet.  -)

Everything works except when the newbie helper equips a newbie, it displays
'The newbie helper give the newbie helper several items.'  I can't seem to 
figure out why it displays that.  Could someone point it out to me?
Anyway, here it is.  Enjoy!  Remember to add the flag in structs.h

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

  int give_obj[] = { 3030, 3032, 3102, 3102, 3102, 3009, 3043, 3076, 3081,
3071, 3023, -1};

  self = (struct char_data *)me;

  if (CMD_IS("newbie"))
    {
      if (IS_NPC(ch)) {
        act("$n says, 'Mobs are not eligible for my help.'", FALSE, self, 0,
0, TO_ROOM);
        act("$n frowns.", FALSE, self, 0, 0, TO_ROOM);
        return TRUE;
      }
      if (GET_LEVEL(ch) > 1) {
        sprintf(buf, "The newbie helper tells you, 'You are too experienced
for me to help.'\r\n");
        send_to_char(buf, ch);
        act("$n smiles happily.", FALSE, self, 0, 0, TO_ROOM);
        return TRUE;
     }
     if (IS_SET(PLR_FLAGS(ch), PLR_NEWBIED)) {
        sprintf(buf, "The newbie helper tells you, 'I've already helped you!
Please don't bother me for anything else.'\r\n");
        send_to_char(buf, ch);
        act("$n frowns slightly.", FALSE, self, 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, ch);
      }

      act("$n tells you, 'Here you go.'", FALSE, self, 0, ch, TO_VICT);
      act("$n gives you several items.", FALSE, self, 0, ch, TO_VICT);
      act("$n gives $n several items.", FALSE, self, 0, ch, TO_NOTVICT);
      act("$n smiles happily.", FALSE, self, 0, 0, TO_ROOM);
      sprintf(buf, "%s was newbie equipped.", GET_NAME(ch));
      SET_BIT(PLR_FLAGS(ch), PLR_NEWBIED);
      mudlog(buf, CMP, LVL_IMMORT, TRUE);
      return TRUE;
  }
  if (cmd)
    return FALSE;

  if(AWAKE(ch)) {

    switch (number(0, 20))
      {
        case 0:
          act("$n says, 'Anyone 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, 'If anyone needs help, just ask for it.'", FALSE,
ch, 0, 0, TO_ROOM);
          break;
        case 3:
          act("$n sighs loudly, scratching his head.", FALSE, ch, 0, 0,
TO_ROOM);
          break;
        default:
          break;
        }
      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