actually, there are checks already implemented to check, as you say, how many "lives" a char has had, called tiers. Its an entry in the pfile itself, and there is a set tier for each class as well. thats not my problem.
I have the classes set up to where, right now, the remort class for each base is 10 higher than the base class, ie. the remort (for now) of mage, which is class 0, is class 10. What i am having trouble with is adding a check to see if the character of a certain class is choosing the class that is 10 above their current class.
here is the code:
if (ch->level == LEVEL_HERO)
ch->pcdata->tier++;
for ( iClass = 9; iClass <= MAX_PC_CLASS; iClass++ )
{
if ( class_table[iClass]->who_name[0] != '\0' && class_table[iClass]->remort_class <= ch->pcdata->tier-1)
{
if (!str_cmp(arg, class_table[iClass]->who_name))
break;
}
}
if (iClass == MAX_PC_CLASS)
{
if (ch->level == LEVEL_HERO)
ch->pcdata->tier--;
send_to_char("That is not a valid class.\n\r", ch);
return;
My first intuition was to add, right after (&& class_table[iClass]->remort_class <= ch->pcdata->tier-1) (&& class_table[iClass] == ch->class+10), but that crashes the damn mud. I just need to know what to add to make that check. |