It'd be an eval script. Looking at the encumberance table there doesn't seem to be a set formula for max weight, which will make things tedious. Here is a rough sketch of the eval,
var newstr as number
var newmaxwt as number
var newmedwt as number
var newlitwt as number
~ If we have enhancement bonus 1 or higher, we don't stack, so stop now.
doneif (hero.child[aSTR].field[BonEnhance].value >= 1)
~ Get our strength +1
newstr = hero.child[aSTR].field[aFinalVal].value + 1
~ Generate our new max encumberance, this is annoying
if (newstr = 29) then
newmaxwt = 1400
elseif (newstr = 28) then
newmaxwt = 1200
~ On and on until newstr = 2, just following the table
~ If we are quadrapedal we multiply by one factor based on size...
if (hero.tagis[Helper.Quadraped] <> 0) then
~ If we are Colossal for example it is x24
if (herofield[tSize].value >= 4) then
newmaxwt *= 24
~ If we are gargantuan...
elseif (herofield[tSize].value = 3) then
newmaxwt *= 12
~ and down through all the sizes
BLAHBLAH
endif
~ now we need to check for non-quadraped and do the same
elseif (hero.tagis[Helper.Quadraped] = 0) then
~ If we are Colossal for example it is x16
if (herofield[tSize].value >= 4) then
newmaxwt *= 16
~ If we are gargantuan...
elseif (herofield[tSize].value = 3) then
newmaxwt *= 8
BLAHBLAH
endif
endif
~ Now that we have the max wt, we need to define out medium encumberance and light encumberance limits. Fortunately they are merely 2/3 and 1/3 of our max, rounded down to the nearest pound.
newmedwt = round(newmaxwt *.66, 0, -1)
newlitwt = round(newmaxwt *.33, 0, -1)
~ Now compare our values to the current encumberance values and adjust them up
var diff as number
diff = newmaxwt - herofield[tEncumHvy].value
herofield[tEncumHvy].value += diff
diff = newmedwt - herofield[tEncumMed].value
herofield[tEncumMed].value += diff
diff = newlitwt - herofield[tEncumLgt].value
herofield[tEncumLgt].value += diff
|