I can't get this code to apply the Wisdom Modifier to ranged attacks i've tried altering the timing but to no avail.
Timing final phase 10000
Code:
var bonus as number
bonus = maximum(hero.child[aWIS].field[aModBonus].value - hero.child[aDEX].field[aModBonus].value , 0)
doneif (bonus= 0)
foreach pick in hero where "wCategory.RangeProj & wCategory.RangeThrow & !wCategory.Melee"
eachpick.field[wAttBonus].value += bonus
nexteach
Any pointers on what i'm doing wrong.