Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ SMAUG ➜ SMAUG coding ➜ Starting new characters with maxed skills.

Starting new characters with maxed skills.

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Tymeless   (5 posts)  Bio
Date Thu 31 Jul 2003 06:33 AM (UTC)
Message
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?
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 31 Jul 2003 11:00 PM (UTC)
Message
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);



- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Tymeless   (5 posts)  Bio
Date Reply #2 on Fri 01 Aug 2003 06:31 AM (UTC)
Message
This worked, but not on every skill. How would I fix that?
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #3 on Fri 01 Aug 2003 08:36 AM (UTC)
Message
Part of the test above was to compare the character's level to the skill level. You could take that part out.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Tymeless   (5 posts)  Bio
Date Reply #4 on Sat 02 Aug 2003 05:39 AM (UTC)
Message
Exactly which part? (I'm a newbie coder, sorr for all the questions)
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #5 on Sat 02 Aug 2003 10:26 PM (UTC)
Message
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 );
    }
}

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Tymeless   (5 posts)  Bio
Date Reply #6 on Sun 03 Aug 2003 12:06 AM (UTC)
Message
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?
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #7 on Sun 03 Aug 2003 02:29 AM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


18,421 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.