Re: [NEWBIE] A Mob Idea

From: Daniel Koepke (dkoepke@CALIFORNIA.COM)
Date: 11/18/97


On Tue, 18 Nov 1997, Hellwolf wrote:

->I want to create a mob that will look into other rooms, and if it sees a
->character in that room, will fire a projectile into it.  This code has
->been done, I think something like Archer on the snippets page.  The
->difference is that if the MOB hits, it will grab the character and pull
->him/her into the room with it and begin attacking.

It shouldn't be too difficult to acheive.  Actually, I probably
shouldn't give you any code for it, simply because it's fairly simple
stuff.  But, hey, I'll do it anyway:

  int i = 0, rnum = 0;
  struct char_data *targ;
  ACMD(do_say);

  /* pick the character */
  for (i=0;i<NUM_OF_DIRS;i++) {
    /* no exit, or exit is blocked */
    if (!EXIT(ch, i) || EXIT(ch, i)->to_room == NOWHERE ||
         IS_SET(EXIT(ch, i)->exit_info, EX_CLOSED))
      continue;
    /* now find a character in that room */
    for (targ=world[EXIT(ch, i)->to_room]; targ; targ=targ->next_in_list)
      if (!IS_NPC(targ) && !number(0, 4)) /* 20% chance */
        break;
    if (targ)
      break;
  }

  /*
   * here would go the code to hit the person with the projectile
   * I leave this code up to you to write
   */

  /* now transfer them to the mobile's room */
  act("$N drags $n out of the room by a rope attached to the spear"
      "point imbedded in $n's throat.", FALSE, targ, 0, ch, TO_ROOM);
  act("$N drags you out of the room!", FALSE, targ, 0, ch, TO_CHAR);
  char_from_room(targ);

  act("$n drags $N into the room by a rope!", ch, 0, targ, TO_ROOM);
  char_to_room(targ, ch->in_room);

  switch (number(0, 1)) {
  case 0:
    do_say(ch, "Get over here!", 0, 0);
    break;
  case 1:
    do_say(ch, "Come here!", 0, 0);
    break;
  }

  return TRUE;

The code to strike the person with the projectile was ommitted, as I
have no such code, and I don't think I want to write everything for
you.  It's obvious (at least, from my standpoint) that my spec-proc is
modeled off of the _Mortal_Kombat_ character, Scorpion, complete with
the "cliche" sayings after he drags his opponent over with the
spear-point-like thing attached to a rope...or whatever it is(?)...


daniel koepke / dkoepke@california.com


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



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