I'm trying to get my stat roller working perfectly (mainly using bits of other stat rollers than I found and liked certain aspects of each, and I'm combining them frankenstein styles) and I'm soo close, I hope someone out there can fill in the missing link for me. Originally my statroller wasn't calling the racial attributes into play at all until the player entered the game, nor was it setting the classes prime attribute (on my mud the classes prime attribute can not be lower than16 base) so I've played around I got it to take into account racial bonuses, with a call to the following edited version of name_stamp_stats
It now sets the racial attributes into the roller, and also the classes prime attribute, however the problem is this:
I want the minimum prime attribute to be 16, not always 16, which is what it's giving now and then adding racial bonuses.
I tried adding
before the switch (class_table..... however that did nothing.
Basically what I'm asking is if anyone can see a way to make that code give the character a minimum of 16 roll on their prime attribute stat but still allow them a possible higher roll of 17 or 18 after racial attributes. I really appreciate the help. Thank You!
void name_stamp_stats( CHAR_DATA *ch )
{
ch->perm_str = 6 + dice( 2,6 );
ch->perm_dex = 6 + dice( 2,6 );
ch->perm_wis = 6 + dice( 2,6 );
ch->perm_int = 6 + dice( 2,6 );
ch->perm_con = 6 + dice( 2,6 );
ch->perm_cha = 6 + dice( 2,6 );
ch->perm_lck = 6 + dice( 2,6 );
switch ( class_table[ch->class]->attr_prime )
{
case APPLY_STR: ch->perm_str = 16; break;
case APPLY_INT: ch->perm_int = 16; break;
case APPLY_WIS: ch->perm_wis = 16; break;
case APPLY_DEX: ch->perm_dex = 16; break;
case APPLY_CON: ch->perm_con = 16; break;
case APPLY_CHA: ch->perm_cha = 16; break;
case APPLY_LCK: ch->perm_lck = 16; break;
}
ch->perm_str += race_table[ch->race]->str_plus;
ch->perm_int += race_table[ch->race]->int_plus;
ch->perm_wis += race_table[ch->race]->wis_plus;
ch->perm_dex += race_table[ch->race]->dex_plus;
ch->perm_con += race_table[ch->race]->con_plus;
ch->perm_cha += race_table[ch->race]->cha_plus;
ch->perm_lck += race_table[ch->race]->lck_plus;
}
It now sets the racial attributes into the roller, and also the classes prime attribute, however the problem is this:
I want the minimum prime attribute to be 16, not always 16, which is what it's giving now and then adding racial bonuses.
I tried adding
if ( class_table[ch->class]->attr_prime <=15)before the switch (class_table..... however that did nothing.
Basically what I'm asking is if anyone can see a way to make that code give the character a minimum of 16 roll on their prime attribute stat but still allow them a possible higher roll of 17 or 18 after racial attributes. I really appreciate the help. Thank You!