Right now I'm having an issue with #hasability that I'm having a hard time understanding. I'm trying to use an eval script to give an additional bonus from a custom ability if the character has a certain class special.
I've tried running this script at final/10000, render/10000, and first/10000, all to no avail. (The frustrating bit is I have a render script testing for the exact same ability that seems to be working, so maybe I've just derped the code somehow.
I'm currently running the below at Final/10000, and I get the bonus for having the item (which is bootstrapped by the custom ability) equipped, but I'm not getting the extra bonuses for having the upgrade class ability, even though my hero has the ability. Please tell me where I'm going wrong.
I've tried running this script at final/10000, render/10000, and first/10000, all to no avail. (The frustrating bit is I have a render script testing for the exact same ability that seems to be working, so maybe I've just derped the code somehow.
I'm currently running the below at Final/10000, and I get the bonus for having the item (which is bootstrapped by the custom ability) equipped, but I'm not getting the extra bonuses for having the upgrade class ability, even though my hero has the ability. Please tell me where I'm going wrong.
Code:
var bonus as number
bonus = maximum(1,round(#levelcount[Machsmith]/2,0,-1))
perform hero.childfound[ioAnalyzer].setfocus
~ apply skill and sense bonuses if Analyzer is equipped
if (focus.field[gIsEquip].value <> 0) then
#skillbonus[skKnowArca] += bonus
~ extra bonuses if we have the first upgrade
if (#hasability[cMacGW1U1] <> 0) then
#skillbonus[skKnowDun] += bonus
#skillbonus[skKnowEng] += bonus
#skillbonus[skKnowGeog] += bonus
#skillbonus[skKnowNat] += bonus
#skillbonus[skKnowPlan] += bonus
endif
endif