TobyFox2002
Well-known member
I am trying to set up a more efficient way of handling Difficulty Class of invocation spell like abilities. Currently the DCs is hard-coded and doesn't easily allow for user editing of things such as ability mod, and other variables.
I've gotten most of it set up the way I want it, but I've hit a snag where it comes to Ability Focus since the DC is modified after all normal DC calculations are applied the Ability focus doesn't automatically apply the +2 bonus.
Final/12000
When I try and compile this, I get a syntax error. Non-existent thing "id" used by script. It apparently doesnt like me trying to pull the idstring and stuff that into the abDC.
Is this the way I should be handling this, or am I making this needlessly difficult? Any input would be appreciated.
Once that is done, I will take this script and convert it into a procedure call to easily apply it to all invocations.
I've gotten most of it set up the way I want it, but I've hit a snag where it comes to Ability Focus since the DC is modified after all normal DC calculations are applied the Ability focus doesn't automatically apply the +2 bonus.
Final/12000
Code:
~ This script can run no earlier than Final/11000 or acts weird.
var dcMod as number
var DC as number
var id as string
if (tagis[StandardDC.aSTR] <> 0) then
dcMod = #attrmod[aSTR]
elseif (tagis[StandardDC.aDEX] <> 0) then
dcMod = #attrmod[aDEX]
elseif (tagis[StandardDC.aCON] <> 0) then
dcMod = #attrmod[aCON]
elseif (tagis[StandardDC.aINT] <> 0) then
dcMod = #attrmod[aINT]
elseif (tagis[StandardDC.aWIS] <> 0) then
dcMod = #attrmod[aWIS]
elseif (tagis[StandardDC.aCHA] <> 0) then
dcMod = #attrmod[aCHA]
~ create an embeded if...else to handle undead characters.
elseif (tagis[StandardDC.BAB] <> 0) then
dcMod = #BAB[]
else
dcMod = 0
endif
~ abValue5 is the equivilant spell level of the invocation.
DC = 10 + field[abValue5].value + dcMod
DC = round(DC, 0, -1)
field[abDC].value = DC
debug "We are using " & tagnames[StandardDC.?] & " with a value of " & dcMod & " for our DC."
debug "Our DC is " & field[abDC].value
doneif (hero.childfound[fAbilFoc].field[usrChosen1].ischosen = 0)
[COLOR="Red"]id[/COLOR] = hero.childfound[fAbilFoc].field[usrChosen1].chosen.idstring
debug hero.childfound[fAbilFoc].field[usrChosen1].chosen.idstring
hero.child[[COLOR="Red"]id[/COLOR]].field[abDC].value += 2
When I try and compile this, I get a syntax error. Non-existent thing "id" used by script. It apparently doesnt like me trying to pull the idstring and stuff that into the abDC.
Is this the way I should be handling this, or am I making this needlessly difficult? Any input would be appreciated.
Once that is done, I will take this script and convert it into a procedure call to easily apply it to all invocations.