Redcap's Corner
Well-known member
A few months back I put together a replacement ability for the magus's Spell Combat in an attempt to make the ability functional in Hero Lab. It works fine... except any time I close out Hero Lab with Spell Combat still activated, it adds a -2 untyped penalty to my character's attacks IN ADDITION to the one I get from activating the ability. Can anyone take a quick look at my code and see if they can figure out why I'm occasionally getting this extra stacking penalty? I'm sure it's something simple, like adding one of the standard doneif statements. I'm just trying to figure out which of those statements is necessary and when.
Post-Attributes/1000
Post-Attributes/1000
Code:
~ If this ability hasn't been activated, ignore the following.
doneif (field[abilActive].value = 0)
~ Apply the attack penalty.
hero.child[Attack].field[atmPenalty].value += field[actUser].value - 2
~ Apply the concentration bonus.
if (field[xIndex].value >= 4) then
perform delete[Helper.UserAdjust]
elseif (field[xIndex].value = 3) then
hero.child[cHelpMag].field[cConcCheck].value -= field[actUser].value * 2
elseif (field[xIndex].value = 2) then
hero.child[cHelpMag].field[cConcCheck].value -= field[actUser].value + 2
else
hero.child[cHelpMag].field[cConcCheck].value -= field[actUser].value
endif