Re: Question about the Strength Spell

From: Dann Fuller (dannimal@umich.edu)
Date: 06/20/96


Odd.  I just logged on, and had my Imm test this on my mort, and you're 
right, the strength stopped at 18/100.  But, yesterday, we had a Mage 
cast this on himself enough times, that it went over.  Stating him 
reported his strength at 0/0, and affects: STR (330h) +116 to Str.  Using 
set didn't affect his strength, and we had to unaffect him to get things 
normal again.

I didn't think the code would have missed something like that, but I 
couldn't think of another reason why it would happen.  I'll see if I 
can't re-create the problem.  Thanks for the help.

  Dann

On Thu, 20 Jun 1996, Johan Dustler wrote:

> > From: Dann Fuller <dannimal@umich.edu>
> > 
> > As near as I can tell, when you cast STR, nowhere does it check to make 
> > sure you don't go over the limit of 18/100.  This is bad, because if 
> > you're at 18/100 when you cast it, bad thigns happen to your stats.  
> > 
> > After looking at the code, I can think of a couple of places to put the 
> > check in, but before I do, I was wondering if others had noticed this, 
> > and how they went about fixing it if they have.  TIA
> > 
> >   Dann
> > 
> > _____________________________________________________________________________
> > Dann Fuller 						   dannimal@umich.edu
> > ITD Contract Services System Administrator	      www.umich.edu/~dannimal
> > Kinesiology Administration  			      764-4015     
> > School of Public Policy				      764-8004
> > "He fell out of the Stupid tree and hit every branch on the way down."
> > 
> > 
> 
> There is already a check for this. If you check the function calls from
> mag_affects <magic.c> you will see that it calls affect_join <handler.c>.
> If you continue tracing function calls from affect_join you will end up
> in affect_total <handler.c>. In the second half of this function the check
> is made:
> 
>   /* Make certain values are between 0..25, not < 0 and not > 25! */
>  
>   i = (IS_NPC(ch) ? 25 : 18);
>  
>   GET_DEX(ch) = MAX(0, MIN(GET_DEX(ch), i));
>   GET_INT(ch) = MAX(0, MIN(GET_INT(ch), i));
>   GET_WIS(ch) = MAX(0, MIN(GET_WIS(ch), i));
>   GET_CON(ch) = MAX(0, MIN(GET_CON(ch), i));
>   GET_STR(ch) = MAX(0, GET_STR(ch));
>  
>   if (IS_NPC(ch)) {
>     GET_STR(ch) = MIN(GET_STR(ch), i);
>   } else {
> |->    if (GET_STR(ch) > 18) {
> |->      i = GET_ADD(ch) + ((GET_STR(ch) - 18) * 10);
> |->      GET_ADD(ch) = MIN(i, 100);
> |->      GET_STR(ch) = 18;
> |    }
> |  }
> |
> |
> 
> This part sets the str_add to a maximum of 100.
> 
> -Johan
> 

_____________________________________________________________________________
Dann Fuller 						   dannimal@umich.edu
ITD Contract Services System Administrator	      www.umich.edu/~dannimal
Kinesiology Administration  			      764-4015     
School of Public Policy				      764-8004
"It's only too much meat when I can't cram it all in my mouth."  K. Fazzari



This archive was generated by hypermail 2b30 : 12/18/00 PST