Thread: Compile error
View Single Post
Old 07-14-2002, 11:24 PM   #19
melker
New Member
 
Join Date: Jul 2002
Posts: 20
melker is on a distinguished road
Send a message via AIM to melker
Merc.h
[code]

#define IS_GOOD(ch) (ch->alignment >= 350)
#define IS_EVIL(ch) (ch->alignment <= -350)
#define IS_NEUTRAL(ch) (!IS_GOOD(ch) && !IS_EVIL(ch))

struct race_type
{
char * name; /* call name of the race */
bool pc_race; /* can be chosen by pcs */
long act; /* act bits for the race */
long aff; /* aff bits for the race */
long off; /* off bits for the race */
long imm /* imm bits for the race */
long res /* res bits for the race */
long vuln; /* vuln bits for the race */
long shd; /* shd bits for the race */
long form; /* default form flag for the race */
long parts; /* default parts for the race */
bool good;
bool neutral;
bool evil;
};


struct pc_race_type /* additional data for pc races */
{
char * name; /* MUST be in race_type */
char who_name[6];
sh_int points; /* cost in points of the race */
sh_int class_mult[MAX_CLASS];
char * skills[5]; /* bonus skills for the race */
sh_int stats[MAX_STATS]; /* starting stats */
sh_int max_stats[MAX_STATS]; /* maximum stats */
sh_int size; /* aff bits for the race */
bool good;
bool neutral;
bool evil;
};
[/quote]

[code]
case CON_GET_ALIGNMENT;
{

switch ( argument[0] )
{
case '1'; ch->alignment = 1000; break;
case '2'; ch->alignment = 750; break;
case '3'; ch->alignment = 500; break;
case '4'; ch->alignment = 250; break;
case '5'; ch->alignment = 0; break;
case '6'; ch->alignment = -250; break;
case '7'; ch->alignment = -500; break;
case '8'; ch->alignment = -750; break;
case '9'; ch->alignment = -1000; break;
default;
send_to_char("Sorry thats not a valid alignment.\n\r\n\r",ch);
return;
}

}
write_to_buffer(d,"\n\r",0);
for ( race = 0; race < MAX_PC_RACE; race++ ) {
do_help( ch, "NANNY_RACES" );
if (IS_GOOD(ch))
{
do_help(ch,"GOOD_RACES");
write_to_buffer(d,"\n\r\n\r",1);
send_to_char( "Enter the name of your desired race; ", ch );
d->connected = CON_GET_NEW_RACE;
break;
}
if (IS_NEUTRAL(ch))
{
do_help(ch,"NEUTRAL_RACES");
write_to_buffer(d,"\n\r\n\r",1);
send_to_char( "Enter the name of your desired race; ", ch );
d->connected = CON_GET_NEW_RACE;
break;
}
if (IS_EVIL(ch))
{
do_help(ch,"EVIL_RACES");
write_to_buffer(d,"\n\r\n\r",1);
send_to_char( "Enter the name of your desired race; ", ch );
d->connected = CON_GET_NEW_RACE;
break;
}
}
break;

case CON_GET_NEW_RACE;
one_argument(argument,arg);


if (!strcmp(arg,"help"))
{
argument = one_argument(argument,arg);
if (argument[0] == '\0')
do_help(ch,"race help");
else
do_help(ch,argument);
write_to_buffer(d,
"What is your race (help for more information)? ",0);
break;
}

race = race_lookup(argument);


if ((race == 0)
|| (!race_table[race].pc_race)
|| (IS_GOOD(ch) && !race_table[race].good)
|| (IS_NEUTRAL(ch) && !race_table[race].neutral)
|| (IS_EVIL(ch) && !race_table[race].evil))

ch->race = race;
/* initialize stats */
for (i = 0; i < MAX_STATS; i++)
ch->perm_stat[i] = pc_race_table[race].stats[i];
ch->affected_by = ch->affected_by|race_table[race].aff;
ch->shielded_by = ch->shielded_by|race_table[race].shd;
ch->imm_flags = ch->imm_flags|race_table[race].imm;
ch->res_flags = ch->res_flags|race_table[race].res;
ch->vuln_flags = ch->vuln_flags|race_table[race].vuln;
ch->form = race_table[race].form;
ch->parts = race_table[race].parts;
// ch->alignment = race_table[race].good;
// ch->alignment = race_table[race].neutral;
// ch->alignment = race_table[race].evil;

[/quote]
melker is offline   Reply With Quote