[CODE] Switching victims in attacks

From: Amy & Ryan Biggs (nauvie@netcom.ca)
Date: 10/03/96


Ok, I know Sammy and I have discussed doing this for a neat addition to the
MUD so that if you are attacking something like a cityguard and a
peacekeeper comes in, you want to attack the peacekeeper first and kill the
cityguard later, as the peacekeeper is a bigger threat.  I looked into it,
and low and behold it's simple as pie.  How simple?  Take a look.  This is
the end of the code from do_hit in act.offensive.c

    if ((GET_POS(ch) == POS_STANDING) && (vict != FIGHTING(ch))) {
      hit(ch, vict, TYPE_UNDEFINED);
      WAIT_STATE(ch, PULSE_VIOLENCE + 2);
    } else
      send_to_char("You do the best you can!\r\n", ch);
  }
}

Well, to fix it, do this:
change
    } else
      send_to_char("You do the best you can!\r\n", ch);
to
    } else {
      stop_fighting(ch);
      hit(ch, vict, TYPE_UNDEFINED);
    }

Simple?  Well, it is.  So now if you want to switch your attacks to the
peacekeeper, just type "kill peacekeeper" and it switches over.  The guard
will still attack you (you damaged him, so he's kinda upset about that) but
now you can take care of that pesky keeper.  Next thing to probably do, is
to have mobs do the same sort of thing.  Perhaps even use the MOB_ flags
suggested in the original Rome zone and have mobs attack certain players.
(Like MOB_NOMAGE)

The Husband and Wife team from heck!
E-mail: nauvie@netcom.ca
Amy Biggs:  http://www.geocities.com/SiliconValley/3461
Ryan Biggs: http://www.geocities.com/SiliconValley/3460


+-----------------------------------------------------------+
| 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