doneif (field[gIsEquip].value = 0)
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...
if (newstr = 29) then
newmaxwt = 1400
elseif (newstr = 28) then
newmaxwt = 1200
elseif (newstr = 27) then
newmaxwt = 1040
elseif (newstr = 26) then
newmaxwt = 920
elseif (newstr = 25) then
newmaxwt = 800
elseif (newstr = 24) then
newmaxwt = 700
elseif (newstr = 23) then
newmaxwt = 600
elseif (newstr = 22) then
newmaxwt = 520
elseif (newstr = 21) then
newmaxwt = 460
elseif (newstr = 20) then
newmaxwt = 400
elseif (newstr = 19) then
newmaxwt = 350
elseif (newstr = 18) then
newmaxwt = 300
elseif (newstr = 17) then
newmaxwt = 260
elseif (newstr = 16) then
newmaxwt = 230
elseif (newstr = 15) then
newmaxwt = 200
elseif (newstr = 14) then
newmaxwt = 175
elseif (newstr = 13) then
newmaxwt = 150
elseif (newstr = 12) then
newmaxwt = 130
elseif (newstr = 11) then
newmaxwt = 115
elseif (newstr = 10) then
newmaxwt = 100
elseif (newstr = 9) then
newmaxwt = 90
elseif (newstr = 8) then
newmaxwt = 80
elseif (newstr = 7) then
newmaxwt = 70
elseif (newstr = 6) then
newmaxwt = 60
elseif (newstr = 5) then
newmaxwt = 50
elseif (newstr = 4) then
newmaxwt = 40
elseif (newstr = 3) then
newmaxwt = 30
elseif (newstr = 2) then
newmaxwt = 20
elseif (newstr = 1) then
newmaxwt = 10
endif
if (hero.tagis[Helper.Quadruped] <> 0) then
if (herofield[tSize].value >= 4) then
newmaxwt *= 24
elseif (herofield[tSize].value >= 3) then
newmaxwt *= 12
elseif (herofield[tSize].value >= 2) then
newmaxwt *= 6
elseif (herofield[tSize].value >= 1) then
newmaxwt *= 3
elseif (herofield[tSize].value >= 0) then
newmaxwt *= 1.5
elseif (herofield[tSize].value >= -1) then
newmaxwt *= 1
elseif (herofield[tSize].value >= -2) then
newmaxwt *= .75
elseif (herofield[tSize].value >= -3) then
newmaxwt *= .50
elseif (herofield[tSize].value >= -4) then
newmaxwt *= .25
endif
if (hero.tagis[Helper.Quadruped] = 0) then
if (herofield[tSize].value >= 4) then
newmaxwt *= 16
elseif (herofield[tSize].value >= 3) then
newmaxwt *= 8
elseif (herofield[tSize].value >= 2) then
newmaxwt *= 4
elseif (herofield[tSize].value >= 1) then
newmaxwt *= 2
elseif (herofield[tSize].value >= 0) then
newmaxwt *= 0
elseif (herofield[tSize].value >= -1) then
newmaxwt *= .75
elseif (herofield[tSize].value >= -2) then
newmaxwt *= .50
elseif (herofield[tSize].value >= -3) then
newmaxwt *= .25
elseif (herofield[tSize].value >= -4) then
newmaxwt *= .125
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
endif