I think I know what your trying to do. SWR uses something similiar to this, since it comes with the trainer code. SWR uses hard coded racial statistics, referenced out of a table. It looks something like this:/*
* Race table.
*/
const struct race_type race_table [MAX_RACE] =
{
/* Race name Racial Affects str dex wis int con cha lck frc hp mn re su RESTRICTION LANGUAGE */
{"Human", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, LANG_BASIC }
};
You could set something similiar up, and then have the get_curr_(attribute) functions in handler.c reference that, something to this affect:sh_int get_curr_cha( CHAR_DATA *ch )
{
sh_int max;
max = UMIN(max,35);
max = 20 + race_table[ch->race].cha_plus;
return URANGE( 3, ch->perm_cha + ch->mod_cha, max );
}
The trainging code adds to perm_(attribute), but I assume your running smaug, and I'm pretty sure its not in there. This will make it so that whatever their rolled stat(perm) and their modified stats(mod_) will never be able to go over what you set. Hope that helps. |