Welcome to the Builder Academy

Question For Rumble - Luck, Will and Reflex

More
10 Apr 2013 21:19 - 10 Apr 2013 21:25 #1894 by JTP
Hey Rumble

Im working on adding your luck, while i was at it also Will and Reflex
Went just fine until the very last part where a new post comes up saying dg_variables.c case 'l'
Code:
else if (!str_cmp(field, "Luck")) { if (subfield && *subfield) { int addition = atoi(subfield); int max = (IS_NPC(c) || GET_LEVEL(c) >= LVL_GRGOD) ? 25 : 18; GET_LCK(c) += addition; if(GET_LCK(c) > max) GET_LCK(c) = max; if(GET_LCK(c) < 1) GET_LCK(c) = 1; } snprintf(str, slen, "%d", GET_LCK(c)); }
.


My case 'l' looks like this
Code:
case 'l': if (!str_cmp(field, "level")) { if (subfield && *subfield) { int lev = atoi(subfield); GET_LEVEL(c) = MIN(MAX(lev, 0), LVL_IMMORT-1); } else snprintf(str, slen, "%d", GET_LEVEL(c)); } break;
.

Dunno where to input the Luck part

And what cases can i then put the Will and Reflex part in ?

Look forward to respons as its the very last thing i need.

Tnx in advance.
Last edit: 10 Apr 2013 21:25 by JTP.

Please Log in or Create an account to join the conversation.

More
10 Apr 2013 21:34 - 10 Apr 2013 21:40 #1896 by Fizban
Each case contains fields that start with the case letter as their first letter.

ie.
Code:
case 'd': if (!str_cmp(field, "damroll")) { if (subfield && *subfield) { int addition = atoi(subfield); GET_DAMROLL(c) = MAX(1, GET_DAMROLL(c) + addition); } snprintf(str, slen, "%d", GET_DAMROLL(c)); } else if (!str_cmp(field, "dex")) { if (subfield && *subfield) { int addition = atoi(subfield); int max = (IS_NPC(c) || GET_LEVEL(c) >= LVL_GRGOD) ? 25 : 18; GET_DEX(c) += addition; if (GET_DEX(c) > max) GET_DEX(c) = max; if (GET_DEX(c) < 3) GET_DEX(c) = 3; } snprintf(str, slen, "%d", GET_DEX(c)); } else if (!str_cmp(field, "drunk")) { if (subfield && *subfield) { int addition = atoi(subfield); GET_COND(c, DRUNK) = MAX(-1, MIN(addition, 24)); } snprintf(str, slen, "%d", GET_COND(c, DRUNK)); } break;

luck goes in

case 'l':

will in

case 'w':

reflex in

case 'r':

Not sure if I'm a fan of increasing luck by the listed amount though.

ie. it could be coded so that:

nop %actor.luck(3)% sets the actors luck to 3, or increases it by 3, not sure which most people'd consider to be more intuitive, both ways allow you to set and raise in scripts though, it's just that whichever isn't the default will require a workaround.

for example, if I wanted to set luck TO 18 with the current setup I'd do this:
Code:
eval luckgain 18 - %actor.luck% nop %actor.luck(%luckgain%)%
Last edit: 10 Apr 2013 21:40 by Fizban.

Please Log in or Create an account to join the conversation.

More
10 Apr 2013 22:23 - 10 Apr 2013 22:30 #1898 by JTP
but rent/quit only saves Luck not will and reflex, even though i added every thing 3 times, just 2nd times called things will/wil etc instead of luck, and 3rd time, called it reflex/ref etc instead.

what files saves info ?

Very wierd.
Last edit: 10 Apr 2013 22:30 by JTP.

Please Log in or Create an account to join the conversation.

More
11 Apr 2013 00:13 #1900 by Rumble
doublecheck the tutorial to make sure you didn't miss adding the other two somewhere you added luck.

Rumble
The Builder Academy
tbamud.com 9091
rumble@tbamud.com

Please Log in or Create an account to join the conversation.

More
12 Apr 2013 06:01 #1902 by JTP
Ok it works now and saves, but now a char can Roll stats over 18 and up to 25
Not really intended cus con25 on my mud gave the char 12k hp at max level,
when i took code out again everything is back to normal and people dont Roll those
crazy High stats.

So obviously now question is, where in rumbles code did it suddently give access to High stats ?

Please Log in or Create an account to join the conversation.

More
12 Apr 2013 11:28 #1903 by rudeboyrave
int max = (IS_NPC(c) || GET_LEVEL(c) >= LVL_GRGOD) ? 25 : 18;

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.

Please Log in or Create an account to join the conversation.

Time to create page: 0.358 seconds