Re: Tracking Mobs

From: Christopher Avans (parka@CDC.NET)
Date: 05/28/98


On Wed, 28 May 1998, Pheonix Shadowflame wrote:

> I'm trying to implement tracking mobs. Mobs with the MOB_TRACKING flag
> would track the people who are in it's memory and attack em once they
> find the target. It seems like a pretty easy code, using graph.c's
> find_first_dir or something like that but I can't no matter what
> approach
> I try I can't get it to work. Anyone ever wrote this? I would guess so.
> Any hints on how I would go about codin this?
>
> Pheonix Shadowflame
>
if (MOB_FLAGGED(ch, MOB_ARRESTOR) && (!MEMORY(ch)))
                        extract_char(ch);


        /* Mob Memory */
    if (MOB_FLAGGED(ch, MOB_MEMORY) && MEMORY(ch)) {
      found = FALSE;
      for (vict = world[ch->in_room].people; vict && !found; vict =
vict->next_in_room) {
        if (IS_NPC(vict) || !CAN_SEE(ch, vict) || PRF_FLAGGED(vict,
PRF_NOHASSLE))
          continue;
        for (names = MEMORY(ch); names && !found; names = names->next)
          if (names->id == GET_IDNUM(vict)) {
            found = TRUE;
                WHYTRACK = TRUE;
           /* act("'Hey!  You're the fiend that attacked me!!!', exclaims
$n.",
                FALSE, ch, 0, 0, TO_ROOM);*/
                if (!MOB_FLAGGED(ch, MOB_ARRESTOR))  /*is he here to kill
or arrest Banyal*/
            hit(ch, vict, TYPE_UNDEFINED);
                else{
                perform_arrest(vict);
                forget(ch, vict);
                extract_char(ch);

                }
                continue;
          }
        }
        }    /*Fast track Banyal*/
        if ((WHYTRACK == FALSE) && (!MOB_FLAGGED(ch, MOB_SENTINEL))) {
        if      (MOB_FLAGGED(ch, MOB_FAST_TRACK)){
        if (MOB_FLAGGED(ch, MOB_MEMORY) && MEMORY(ch)) {
        for (i = character_list; i; i = i->next){
        for (names = MEMORY(ch); names && !found; names = names->next)
        if (names->id == GET_IDNUM(i)){
                /*hunt_victim(i);*/
                cmd_track = find_command("track");
                do_track(ch, i->player.name, cmd_track, 0);
        }
        }
        }
        }
        }
   }



This is my mob track, note that it has mob fast track. For i crated a new
pulse for memory and aggro mobs and fast track. In that taking memory and
aggro out of old mob pulse and adding a mob slow track there
wowla.
Enjoy...
Sorry I only read mail once a week and am shamed to say dont look at alot
of it


     +------------------------------------------------------------+
     | 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/15/00 PST