Affect 2 by Cherun, this file will tell you what to do in order to add a
affect2 slot to your mud so you can have more spell affects becuase rom2.4b4
rom 2.4b6 and so on only really allow you to add 2 other spell affects to the
ones already coded in. Ill make this as easy as I can for you newbie coders out there.
Ok first open up your merc.h file
in your /*where definitions*/ part of merc.h
it looks like this
#define TO_AFFECTS 0
#define TO_OBJECT 1
#define TO_IMMUNE 2
#define TO_RESIST 3
#define TO_VULN 4
#define TO_WEAPON 5
to the bottom of this add
#define TO_AFFECTS2 6
ok now underneath your
/*
* Bits for 'affected_by'.
* Used in #MOBILES.
*/
at the bottom of this after all the spell_affect defines type this in
/*
*affects2 for additional affects
*/
this way you know where to put the second set of affects.
ok now find where it says
struct mob_index_data
look in the list underneath it find the line that looks like this
long affected_by;
add underneath it
long affected2_by;
now find the line
struct char_data
look in the list for
long affected_by;
and add underneath it
long affected2_by;
then in character macros section
find the line
#define IS_AFFECTED(ch, sn) (IS_SET((ch)->affected_by, (sn)))
underneath it add
#define IS_AFFECTED2(ch, sn) (IS_SET((ch)->affected2_by, (sn)))
now find the handler.c area
look for this line
char * affect_bit_name args( ( int vector ) );
underneath it add
char * affect2_bit_name args( ( int vector ) );
now open up your handler.c file
find the line
void affect_modify (CHAR_DATA * ch, AFFECT_DATA * paf, bool fAdd)
look for
case TO_AFFECTS:
SET_BIT (ch->affected_by, paf->bitvector);
break;
underneath it put
case TO_AFFECTS2:
SET_BIT(ch->affected2_by, paf->bitvector);
break;
look a little bit down from that youll see another case TO_AFFECTS
itll look like this though
case TO_AFFECTS:
REMOVE_BIT (ch->affected_by, paf->bitvector);
break;
again undearneath this one add this
case TO_AFFECTS2:
REMOVE_BIT(ch->affected2_by, paf->bitvector);
break;
look for the line void affect_check (CHAR_DATA * ch, int where, int vector)
find case TO_AFFECTS:
SET_BIT (ch->affected_by, vector);
break;
add
case TO_AFFECTS2:
SET_BIT(ch->affected2_by, vector);
break;
again scroll down a bit from there youll find this
case TO_AFFECTS:
SET_BIT (ch->affected_by, vector);
break;
underneath that one add
case TO_AFFECTS2:
SET_BIT(ch->affected2_by, vector);
break;
go down a bit more youll find another one
case TO_AFFECTS:
SET_BIT (ch->affected_by, vector);
break;
underneath it add
case TO_AFFECTS2:
SET_BIT(ch->affected2_by, vector);
break;
Now open up act_wiz.c
find the line
void do_mstat (CHAR_DATA * ch, char *argument)
look down in this function for this:
if (victim->affected_by)
{
sprintf (buf, "Affected by %s\n\r",
affect_bit_name (victim->affected_by));
send_to_char (buf, ch);
}
underneath it add
if (victim->affected2_by)
{
sprintf(buf, "Also affected by %s\n\r",
affect2_bit_name(victim->affected2_by) );
send_to_char (buf, ch);
}