Senior Member
Join Date: Jul 2010
Posts: 149
|
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 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 |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
xIndex is the field that specifies the position of that ability in the list of class specials for that class.
xCount is the number of copies that have been activated, so if you're making changes, you want to use xCount, not xIndex. |
#2 |
|
|