I'd like to expand on this a bit, since the below would cap the mod_stat field at 25... if you really want to cap the stat itself at 25, you should do something like this:
case APPLY_STR: ch->mod_stat[STAT_STR] += UMIN(pc_race_table[ch->race].max_stat[STAT_STR] - (get_curr_stat(ch, STAT_STR)), mod); break; quick disclaimer: not having my code in front of me, I'm not positive that that's how you reference the max stats for each race, but you get the idea... get_curr_stat shouldn't return anything higher than the lower of the race's max stat and 25, as it caps the total stat at the lower of those 2 values, so you should never come out with a value that's less than 0, thereby causing the UMIN to actually subtract from mod_stat (unless it's actually a negative apply, in which case the negative value should always win the UMIN)... and this would make sure that the actual combined values of perm_stat and mod_stat never exceed the race's max value for that stat... all of that being said, I'm w/ the previous posters about working out the issues w/ overenhanced eq rather than trying to code around those things :D I'd also like to point out a flaw with trying to code workarounds like that... say you've got +10 str gauntlets of ogre power, and the player's str maxes at 25 and they're at 20 when they wear them... now the code checks the little chunk I wrote above and sees to only add +5 to the mod_stat value, making them 20(25), since adding more would exceed 25 (even though only 25 of that would be counted during fight sequences and whatnot)... now they decide to remove them... the code sees the gauntlets are +10 str, and cuts 10 strength from the character, who is now at 20(15)... now let's say you find a way to code around *that* also, so that the object itself now keeps track of how much of its +str has been applied to the character, so that only that amount is removed... now it all matters what order things happen in... if they're at 20(20), wear the gauntlets, boost to 20(25), someone casts a -5 str poison on them, now they're 20(20) again, they remove the gauntlets, the code checks how much was applied, sees only 5 was, makes them 20(15), they rewear the gauntlets, the code sees they max at 25, and applies the entire +10 on them to the character, so now they're back at 20(25), and all the coding workarounds were pointless :D Richard Lindsey. -----Original Message----- From: Sandi Fallon [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 24, 2005 12:58 PM To: [email protected] Subject: Re: Player Stats In handler.c: case APPLY_STR: ch->mod_stat[STAT_STR] += mod; break; change the '+= mod' to: = UMAX( 25, ch->mod_stat[STAT_STR] + mod) And of course, continue to do the same with the rest. However, I agree that it's questionable as to whether or not you should fix something that isn't broken. Wearing enough Str EQ so you don't drop your sword when you get poisoned is a time honored tactic among better players. Invalidate their hard earned wisdom and they'll leave in frustration. Sandi -- ROM mailing list [email protected] Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom

