Re: Newbie: Training stats

From: Jeff Maynard (jlm@he.net)
Date: 12/09/02


Craig Wilson wrote:
> Below the code for the train stat command. The problem I have is that
> the command does not change the stat til the person exits the realm. Any
> ideas where I could have stuffed up?

>   if (!strcmp(arg,"str"))
>   {
>     if (GET_STR(ch)==18)
>     send_to_char(ch, "You can only have 18 Strenght. \r\n");
>     else
>         {
>           int num = GET_STR(ch) +1;
>           ch->real_abils.str = num;
>       ch->real_abils.cp = GET_CP(ch) -1;
>       send_to_char(ch, "Your Strenght is increased by 1 CP. \r\n");
>         }

Replace:

       int num = GET_STR(ch) +1;
       ch->real_abils.str = num;

With:

       GET_STR(ch) += 1;

Real Abilities doesn't reflect the current strength.  If you look at the
GET_STR definition, it's pointing to aff_abils.  That's what you need to set
to have it reflect in the current character.  When real abilities are saved
on exit and the player comes back, the real abilities are copied to the aff
abilities and reflect your changes.  Hope that made sense :)

Jeff

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT