Re: [CODE] Function to find random targets in rooms

From: Angus Mezick (
Date: 05/24/99

Ok, here is that Hollar :)
1) add more direction to the TARG_ variables.  Things like TARG_FIGHTERS,
TARG_SWITCH (change targets for each swing), TARG_HIGHHIT (greatest +hr
in room), TARG_HIGHDAM (greatest damage in room)

2)  All of this malloc'ing worries me.  more of a performance issue to me.
You might want to make an array of struct *char_data targets[30];

Chuck Reed <> on 05/21/99 06:07:26 PM

If anyone sees any problems with this or has an idea of how it can be
please give me a holler to let me know at this email address.  Anyhow, here
are the
instructions on installing it.  It should work with all versions of

1) The following should be added somewhere in structs.h:

// Definitions for random_target() by Chuck Reed
#define TARG_MORT       (1 << 0)
#define TARG_IMM        (1 << 1)
#define TARG_MOB        (1 << 2)
#define TARG_SELF       (1 << 3)
#define TARG_ALL        (1 << 4)

struct target_data
   struct char_data *c;
   struct target_data *prev;
   struct target_data *next;


         ctp = malloc(sizeof(struct target_data));


     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

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