Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ Stat Roller
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Yourdrunkendad
(35 posts) Bio
|
Date
| Sat 23 Aug 2003 05:32 PM (UTC) Amended on Sat 23 Aug 2003 05:35 PM (UTC) by Yourdrunkendad
|
Message
| I'm trying to get my stat roller working perfectly (mainly using bits of other stat rollers than I found and liked certain aspects of each, and I'm combining them frankenstein styles) and I'm soo close, I hope someone out there can fill in the missing link for me. Originally my statroller wasn't calling the racial attributes into play at all until the player entered the game, nor was it setting the classes prime attribute (on my mud the classes prime attribute can not be lower than16 base) so I've played around I got it to take into account racial bonuses, with a call to the following edited version of name_stamp_stats
void name_stamp_stats( CHAR_DATA *ch )
{
ch->perm_str = 6 + dice( 2,6 );
ch->perm_dex = 6 + dice( 2,6 );
ch->perm_wis = 6 + dice( 2,6 );
ch->perm_int = 6 + dice( 2,6 );
ch->perm_con = 6 + dice( 2,6 );
ch->perm_cha = 6 + dice( 2,6 );
ch->perm_lck = 6 + dice( 2,6 );
switch ( class_table[ch->class]->attr_prime )
{
case APPLY_STR: ch->perm_str = 16; break;
case APPLY_INT: ch->perm_int = 16; break;
case APPLY_WIS: ch->perm_wis = 16; break;
case APPLY_DEX: ch->perm_dex = 16; break;
case APPLY_CON: ch->perm_con = 16; break;
case APPLY_CHA: ch->perm_cha = 16; break;
case APPLY_LCK: ch->perm_lck = 16; break;
}
ch->perm_str += race_table[ch->race]->str_plus;
ch->perm_int += race_table[ch->race]->int_plus;
ch->perm_wis += race_table[ch->race]->wis_plus;
ch->perm_dex += race_table[ch->race]->dex_plus;
ch->perm_con += race_table[ch->race]->con_plus;
ch->perm_cha += race_table[ch->race]->cha_plus;
ch->perm_lck += race_table[ch->race]->lck_plus;
}
It now sets the racial attributes into the roller, and also the classes prime attribute, however the problem is this:
I want the minimum prime attribute to be 16, not always 16, which is what it's giving now and then adding racial bonuses.
I tried adding
if ( class_table[ch->class]->attr_prime <=15)
before the switch (class_table..... however that did nothing.
Basically what I'm asking is if anyone can see a way to make that code give the character a minimum of 16 roll on their prime attribute stat but still allow them a possible higher roll of 17 or 18 after racial attributes. I really appreciate the help. Thank You! |
Shampoo is for sissies real men use poo*
[werd]thewerd.com "Smacking Your Mom Then Running Away" | Top |
|
Posted by
| Nick Gammon
Australia (23,140 posts) Bio
Forum Administrator |
Date
| Reply #1 on Sun 24 Aug 2003 05:17 AM (UTC) |
Message
| To make 16 the minimum, don't you want something like:
case APPLY_STR: ch->perm_str = UMAX (ch->perm_str, 16); break;
In other words, take the current value, or 16, whichever is higher.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| mudsonthetires
(5 posts) Bio
|
Date
| Reply #2 on Mon 17 May 2004 03:42 AM (UTC) |
Message
| I am having a problem with a stat roller very similar to Yourdrunkendad's. My code is :
void name_stamp_stats( CHAR_DATA *ch )
{
ch->perm_str = 6 + dice( 2,6 );
ch->perm_dex = 6 + dice( 2,6 );
ch->perm_wis = 6 + dice( 2,6 );
ch->perm_int = 6 + dice( 2,6 );
ch->perm_con = 6 + dice( 2,6 );
ch->perm_cha = 6 + dice( 2,6 );
ch->perm_lck = 6 + dice( 2,6 );
ch->perm_str += race_table[ch->race]->str_plus;
ch->perm_int += race_table[ch->race]->int_plus;
ch->perm_wis += race_table[ch->race]->wis_plus;
ch->perm_dex += race_table[ch->race]->dex_plus;
ch->perm_con += race_table[ch->race]->con_plus;
ch->perm_cha += race_table[ch->race]->cha_plus;
ch->perm_lck += race_table[ch->race]->lck_plus;
}
The problem is this : The stats do not include racial or class bonuses when they are displayed, and if these bonuses take the stat beyond 18, it gets reset back down to 16.
For example, a human warrior is created(stock race and class) and the player rolls a 17 for strength. Since strength is the warrior's prime attribute and humans get no strength bonus, it should bring strength up to 19. Instead the stat becomes 16 after the player finishes creating the character.
Any suggestions? | Top |
|
Posted by
| Greven
Canada (835 posts) Bio
|
Date
| Reply #3 on Mon 17 May 2004 07:05 AM (UTC) |
Message
| A couple: Where is it being reset to 16? Find that place, and looks like it should fix your problem. Another: Why use something like that function? Not quite sure what your looking for, but IMHO, stock SWR's stat roller is a fairly good one, if your like stat rollers, which I don't, but thats another topic. Its fairly easy to do, in fact, and is only a simply case statement in nanny(). I would suggest you take a look at it, as it may shed some light on your current issue, if you don't decide to use it instead.
There is a copy in the Nicks download section in the smaug releases as SWRFUSS. |
Nobody ever expects the spanish inquisition!
darkwarriors.net:4848
http://darkwarriors.net | Top |
|
Posted by
| mudsonthetires
(5 posts) Bio
|
Date
| Reply #4 on Thu 20 May 2004 01:19 AM (UTC) |
Message
| Thanks for the help Greven. I installed the SWR stat roller and was able to get it working properly with a bit of tinkering. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
15,343 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top