View Single Post
Frodie
Senior Member
 
Join Date: May 2007
Location: Durham, NC
Posts: 1,747

Old March 2nd, 2011, 04:28 PM
Well now the numbers go up, cool, but I get a bonus every other level. lol IDK, it seems like it just will not work with any other class. Well here is the script, maybe I am missing something.

~build up a tag expression to identify all weapon training abilities for
~this class
var expr as string
~Change cHelpInq to be the class
expr = "wFtrGroup.? & CustTaken.cHelpMdH"
~first, make sure we have any weapon training abilities for this class.
~If we don't, there's nothing to do here.
doneif (hero.haschild[BaseCustSp,expr] = 0)
~the best bonus available to all weapon training abilities is 1 at 5th level,
~+1 per 4 levels after that. If we don't have a bonus, we're done.
var bonus as number
~ Set to the number of secondary Abilities actually taken
bonus = hero.child[cHelpMdH].field[cUsedSp4th].value
debug bonus
var tagbonus as number
~We need to decrease the bonus to the 1st thing only as the first one
~is always calculating at least a value of 1.
var nX as number
nX = 1
doneif (bonus = 0)
~go through all of our weapon training abilities in ascending order,
~giving a decreasing bonus to each.
~This removed as _CompSeq_ causes errors
~foreach pick in hero from BaseCustSp where expr sortas _CompSeq_
foreach pick in hero from BaseCustSp where expr
~if our net bonus is 0 because we're run out of weapon types, we're
~done
doneif (bonus <= 0)
~Decrease the first one bonus
bonus -= nX
~set the bonus for this ability
eachpick.field[abValue].value = bonus
tagbonus = eachpick.field[abValue].value
~forward the weapon group tag we're assigned to the class a number of
~times equal to the bonus we're receiving
if (eachpick.field[abValue].value >= 1) then
var i as number
var wepexpr as string
var bonustag as string
wepexpr = eachpick.tagids[wFtrGroup.?," | "]
bonustag = eachpick.tagids[TrainBonus.?, ""]
foreach pick in hero from BaseWep where wepexpr
for i = 1 to tagbonus
perform eachpick.assignstr[bonustag]
next
nexteach
endif
~Add one back to bonus so other Things are correct
bonus += nX
~Set to 0 so that we no longer remove one from the bonus value
nX = 0
~our next ability has a bonus of 1 lower
bonus -= 1
nexteach

Last edited by Frodie; March 2nd, 2011 at 04:41 PM.
Frodie is offline   #14 Reply With Quote