Re: [BUG] Spells reduce stats

From: Phillip Tran (witpens@optushome.com.au)
Date: 10/20/01


> -   i = (IS_NPC(ch) ? 25 : 18);
> +   i = (IS_NPC(ch) || (GET_LEVEL(ch) >= LVL_GRGOD) ? 25 : 18);
>
> +   GET_CHA(ch) = MAX(0, MIN(GET_CHA(ch), i));
>     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);
> --<snip>--
>
> This will fix most of the problem, but it still leaves strength as being
> 18. Does anyone have ideas as to how to fix this?

This leaves str to 18 because you are doing the same check again for
strength alone for the last if statement.
Change
if (IS_NPC(ch)) {
GET_STR(ch) = MIN(GET_STR(ch, i);
TO
if (IS_NPC(ch) || (GET_LEVEL(ch) >= LVL_GRGOD) {

PS: This is only a simple fix and it really doesnt reflect racial
maximums ie. this fix only allows greater gods to have stats over 18.
What if you wanted your elf race to have dex of 19? If you already
defined your races, then do the following:-
at the top of the proc:
int race_modifier[][6] = {
 {18, 18, 18, 18, 18, 18}, /* If you defined RACE_HUMAN = 0 */
 {18, 19, 18, 18, 17, 18}, /* If you defined RACE_ELF = 1 */
 {18, 17, 18, 18, 19, 18} /* if you defined RACE_DWARF = 2 */
};
NOTE: You can assign any racial limits you like - I am just providing
arbitrary numbers here.

then for the GET_CHA etc statements, get rid of them and replace with:-
GET_CHA(ch) = MAX(0, MIN(GET_CHA(ch), race_modifier[GET_RACE(ch)][0]));
GET_DEX(ch) = MAX(0, MIN(GET_DEX(ch), race_modifier[GET_RACE(ch)][1]));
and so on and so on.
NOTE: I hope you have defined GET_RACE or whatever it is you call to
check for race.

Hope this helps.
Horus,
Dark Realms III

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST