• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Weird bug with home-programmed magus Spell Combat

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
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
 
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.
 
Back
Top