Starting new characters with maxed skills.

Posted by Tymeless on Thu 31 Jul 2003 06:33 AM — 8 posts, 25,307 views.

#0
How would I start of new characters with maxed skills/spells? I know it would be done somewhere in comm.c, but where and how?
Australia Forum Administrator #1
I haven't tried this, but I would try using the code from "sset self all 100" and add it into comm.c. Here seems to be the relevant part ...


{
  int sn;
  for ( sn = 0; sn < top_sn; sn++ )
    {
    if ( skill_table[sn]->name
    && ( ch->level >= skill_table[sn]->skill_level[ch->class]))
       ch->pcdata->learned[sn] = GET_ADEPT( ch, sn );
    }
}


I would put that in comm.c around where it sets up the character's default values ...


ch->level   = 1;
ch->exp     = 0;
ch->max_hit    += race_table[ch->race]->hit;
ch->max_mana   += race_table[ch->race]->mana;
ch->hit     = UMAX(1,ch->max_hit);


#2
This worked, but not on every skill. How would I fix that?
Australia Forum Administrator #3
Part of the test above was to compare the character's level to the skill level. You could take that part out.
#4
Exactly which part? (I'm a newbie coder, sorr for all the questions)
Australia Forum Administrator #5
I sense trouble brewing here, however this should work ...



{
  int sn;
  for ( sn = 0; sn < top_sn; sn++ )
    {
    if ( skill_table[sn]->name)
       ch->pcdata->learned[sn] = GET_ADEPT( ch, sn );
    }
}
#6
Alright, that worked. But whenever that person is attacked, the mud crashes. How about another method, like a way for mortals to use sset to set all their skills to 100 but not on another?
Australia Forum Administrator #7
Looks like the test - the one you took out - was there for a reason. Effectively that code duplicates what sset does, because that is where I found it.

To solve both your problems you need to find why it crashes. See the posts on gdb for how to do that.