You could make a link list of the stuff, like how skills are handled, and
just print off the immunities which they have based ont he list, and load
them, stead of having a whole bunch of ints stored in the char_data
structure.
basically here is what you would do....
in your merc.h
#define IMM_SUMMON 1
#deifne IMM_BUBBLEGUM 2
#define IMM_HAIR 3
#define IMM_DORK 4
ect ect. for each immunity
then have this
typedef struct imm_data IMM_DATA;
struct imm_data
{
IMM_DATA *next; //next in the list
int type; //the type of immunity it is
sh_int percent; //percentage person is immune to it
};
in char_data you would have
IMM_DATA first_imm;
and basically just stack them ontop of eachother.
then basically you would have a access function somewhere like
sh_int get_immune( int type )
{
IMM_DATA *immune = NULL;
for ( immune = ch->first_imml immune; immune = immine->next )
{
if ( type == immune->type )
return immune->percent;
}
return 0l //not immune by default
}
for saving you basically cycle through the linked list and write out
something like:
IMM type percent
then just go through in your loading process and load them.
I changed everything in my new source over to LINKED LISTS as it makes the
data handling a hell lot easier.
hope this helps
Steven Raidziul
excuse my crapping programming as this is not a snipplet, yet a way to
explain my idea, and hope you find it useful. If you really wanna get into
it, I can give you further a hand check my q my msn is [EMAIL PROTECTED]
q = 2711015