(no subject)

From: Kresimir Kukulj (madmax@fly.cc.etf.hr)
Date: 02/13/96


Hallo

   If anyone is using function hunt_victim() in file graph.c this is a small
fix for some small bugs...

First it adds a check for ROOM_PEACEFUL, also for ROOM_NOMOB (mob can't
track down a player and go to a room which forbidds mobs.

Second, it fixes a stupid bud which caused mob to say:

Guard says ' Guard says ' Guars says '

(Fix is to use some other variable than buf ie. bufffff)

Finally, mob can now hit a player if he comes to him! Check in code for 
          BFS_ALREADY_THERE, that will explain it for you ( I hope :))

Kresimir

Here is a complete finction:
-------------------CUT HERE-------------------------------

void hunt_victim(struct char_data * ch)
{
  ACMD(do_say);
  extern struct char_data *character_list;

  int dir;
  byte found;
  struct char_data *tmp;
  char buffff[160];

  if (!ch || !HUNTING(ch))
    return;
  if (GET_POS(ch) <= POS_FIGHTING)
    return;

  /* make sure the char still exists */
  for (found = 0, tmp = character_list; tmp && !found; tmp = tmp->next)
    if (HUNTING(ch) == tmp)
      found = 1;

  if (!found) {
    do_say(ch, "Damn!  My prey is gone!!", 0, 0);
    HUNTING(ch) = 0;
    return;
  }
  dir = find_first_step(ch->in_room, HUNTING(ch)->in_room);
  if (dir < 0) {
    if (dir == BFS_ALREADY_THERE) 
      if ((ch->in_room == HUNTING(ch)->in_room)) {
        if (!ROOM_FLAGGED(ch->in_room, ROOM_PEACEFUL)) {
          hit(ch, HUNTING(ch), TYPE_UNDEFINED);
          do_say(ch, "You son of a bitch! I found you at last! Die!!", 0, 0);
          return;
        } else 
            return;
      }

    buffff[0] = '\0'; 
    sprintf(buffff, "Damn!  Lost %s!", HMHR(HUNTING(ch)));
    do_say(ch, buffff, 0, 0);
    HUNTING(ch) = 0;
    return;
  } else {
   if (ROOM_FLAGGED(EXIT(ch, dir)->to_room, ROOM_NOMOB))
     return;

    perform_move(ch, dir, 1);
    if ((ch->in_room == HUNTING(ch)->in_room) && 
       (!ROOM_FLAGGED(ch->in_room, ROOM_PEACEFUL))) {
      hit(ch, HUNTING(ch), TYPE_UNDEFINED);
      do_say(ch, "You son of a bitch! I found you at last! Die!!", 0, 0);
      }
    return;
  }
}



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