This Code donated by Whiplash.


It's real easy, first things are to remember that adding a new field
in char_data means you'll wanna add a new field in your race_table as well,
Here's what I did:
in merc.h

struct race_type
ADD -> long      act2;

struct mob_index_data
ADD  -> long     act2;

struct char_data
ADD  -> long     act2;

then in comm.c
in nanny() where the players level, hitpoints, gold, mana, etc are all
initially set, you have to initialize any act2 bits the player will have
based on race:
ch->act2  = race_table[ch->race].act2; 

finally in db.c or db2.c when you load mobiles into the game:
load_mobiles()  (ps: I only load one format so no load_old_mobiles() )
you have to load the mobiles with their act2 bits that are racial, as 
well as any additional act2 bits:

pMobIndex->act2  = fread_flag( fp ) | race_table[pMobIndex->race].act2; 

You'll wnna be able to save any PLAYER act2 info, so in save.c:
in fwrite_char( )
 if(ch->act2 != 0 )
 fprintf(fp, "Act2 %d\n", ch->act2 ); 

in fread_char()
KEY( "Act2", ch->act2,  fread_number( fp ) ); 

The same goes for fwrite_pet, and fread_pet (if you use pets).

The bad thing is, all your area files will need to be updated, you'll need
a new field for your MOBILES section for each mob, I just wrote a little
patch to set all mobiles act bit to 0 to start instead of having to go thru
by hand and doing it.
Secondly, you'll have to update all the races in comm.c if you want to assign
any mob->act2 bits (we use stuff like ACT2_APATHY, ACT2_LYCANTHROPE)
so it takes a little time, but it creates many new possibilites :)

Hope that helps..

--- --- --- --- --- --- --- --- --- --- --- --- --- --- -- -                 -
- "We're jolly green giants walking the earth, with guns." full metal jacket -
-             - -- --- --- --- --- --- --- --- --- --- whiplash@armory.com ---


