16 Oct, 2007, goran wrote in the 1st comment:
Votes: 0

I am looking for some advice and code help. I am
trying to either remove the cap from Stats(str, int, dex, etc)
or atleast set it very high perhaps around 300 for each stat.

I have been looking over the code that needs to be changed
or I should say the code I believe needs to be changed.

I would like to work on a game based around these stats.
Each race would recieve a base set of stats and also a cap for each
stat in that set.

Example off the top of my head..no disrespect to goblins..
Race Base Stats(Stat Cap Based On Race)
goblin Str 16(35) Wis 10(20) Int 10(13) etc

The stat cap would restrict trains but still allow for items, buffs
and immortals to adjust the stats beyond the race cap.

I just don't know where to begin when I look at things like

* Attribute bonus tables.
const struct str_app_type str_app[26]
{-5, -4, 0, 0}, /* 0 */
{-5, -4, 3, 1}, /* 1 */

Not sure if I have been very clear on this..would like some help
or insight perhaps someone has an idea with current stock Rom 2.4 stat system?

Any help would be excellent!
16 Oct, 2007, Zeno wrote in the 2nd comment:
Votes: 0
You'll have to expand the table for each extra stat, or redo how stats are handled. So if you're adding like 100+ max stats, it may be better to simply take out the table and handle it differently. That's what I did for Smaug.
16 Oct, 2007, Conner wrote in the 3rd comment:
Votes: 0
You ever snippetize that, Zeno? :tongue:
16 Oct, 2007, Zeno wrote in the 4th comment:
Votes: 0
Nope, it'd probably be more fit for a tutorial instead of a snippet.

I think the table was used in order to return various values (based on the stat) you couldn't generate with a formula.
16 Oct, 2007, Conner wrote in the 5th comment:
Votes: 0
*nod* Makes sense, oh well, was worth a shot.. I'd considered a few times now changing my stat caps. *shrug*
16 Oct, 2007, Hades_Kane wrote in the 6th comment:
Votes: 0
I'm at work and thus away from my code, but we set our stat caps at 255. If I recall right, in ROM there is a MAX_STAT or MAX_STR etc. declared somewhere in merc.h and somewhere in const.c you have another entry that deals with the maximum on the stats, which also deals with the maximum for race and class stuff.

Then there is a large table for str_app and wis_app, etc. I'm sure there is a more elegant way to do this, but I expanded the table all the way to 255 and changed the values that each stat spits out. A formula or some other way of dealing with that many stats would probably be better, but I did that when I was first getting started.

In regards to wanting stats able to go higher, but not be trained past a certain point, a new value in your race struct detailing the max for that race to be able to be trained, followed by a check against that value in train might work well enough, or if you wouldn't be sure how to do that, a check for race followed by stat followed by value to directly restrict it in the train function would work.

Gotta go, hope I was some help.
16 Oct, 2007, Omega wrote in the 7th comment:
Votes: 0
I suggest you use midboss's stat release.

It allows you to vanquish having those internal tables, and it just uses an algorythm todo it, alteast thats my understanding of the snippet he released.

I suggest you look into it.
16 Oct, 2007, Hades_Kane wrote in the 8th comment:
Votes: 0
Here you go:


I think that is what he's referring to.
16 Oct, 2007, Midboss wrote in the 9th comment:
Votes: 0
It's in C++, though, so you might have trouble if you're using completely stock ROM. If you're using one of the cleaned up versions here that compiles in G++, though, it should be fine.
17 Oct, 2007, Darmond wrote in the 10th comment:
Votes: 0
actualy most amazeingly this might be something I can help with since I had a simaler problem *wanting to remove that evil stat tabole* I ended up just outright linking each substat to gains themselfs …. so like dam bonus would be say 1/10 of ones current strength

basacoly in my merc.h it looks like this

#define GET_ATTACK(ch) \

err my substats etc are difernt part of why I am only listing one that and I dont want to reveal too much of my possaboly doomed to fail project. but anyways…. doing it up like this all I had to do was place some limiters in a few other places so that stats couldent go any higher. if your useing the train command still then placeing a racial ifcheck in there is what I see beeing one of the better roughts but I could be wrong since I dont know what you have planned stat wise.

P.S. I will note that I am definitly not the best coder in existance and anything I create could be highly unstabole and cause the entier univers to implode at any given moment but then again this is my hobby not my job so I dont have to be perfishent in it I just have to enjoy it
as for why the tabole exists I beleve its ment to give it more of a D&D feel seriously if I am not mistaken it even follows the old D&D stats in how they work *except for the trains etc* I could be wrong though ether way I always hated that thing its waaaayyy too limiting