[Code] Final Product

From: Count Zero (count.zero@panacom.com)
Date: 03/03/97

I am posting the final code setup that I used for Mobs who switch there
attacks between multiple attackers...

As it stands, this code was a direct work of suggestions by several people
off of this list.. and I thank them for there help... The two most
influential ppl were Daniel Koepke and Erwin Andreasen.. although others
did help as well...

Anyway, enough of the thanks and so on... here it is if anyone cares...

/* all changes made in fight.c */

--- in routine perform_violence (on or about line 854)

after line:
struct char_data *ch;

struct char_data *vict;

after lines:

    if (GET_POS(ch) < POS_FIGHTING) {
      send_to_char("You can't fight while sitting!!\r\n", ch);

add lines:

  if (IS_NPC(ch)) {      /* only want Mobs to switch */
    for (vict = world[ch->in_room].people; vict; vict = vict->next_in_room)
      if ((FIGHTING(vict) == ch) && (!number(0, 2)))
    if (!vict)
     vict = FIGHTING(ch);
   else {
     vict = FIGHTING(ch);

in line:


change to:

  hit(ch, vict, TYPE_UNDEFINED);

thats it.....  now you'll have mobs who will switch attacks between a group
of combatants...  they tend to concentrate their attacks on whomever the
"leader" of the group is... (ie the person who attacked the mob first) but
at least a third of the time it will take a swing at one of the other party
members...  I have playtested this and find it works out well...  it takes
some of the burden off of individual players and spreads the damage out
pretty equally amongst the members of a group... (assuming that they all
attack and dont just sit still)


-Count Zero-

| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
|    Or send 'info circle' to majordomo@cspo.queensu.ca     |

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