• 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

Update throwing off or me just wrong?

willuwontu

Well-known member
Code:
adds 1 to the threat range of light or one-handed swords they are wielding in (20 becomes 19-20, 19-20 becomes 18-20, etc.). This bonus is doubled with the Improved critical feat, keen, or the keen edge spell.

Code:
Phase: First  Priority: 10000

    ~ only perform the calculations for the first copy
      doneif (tagis[Helper.FirstCopy] = 0)

      ~ If we're not shown, just get out now
      doneif (tagis[Helper.ShowSpec] = 0)

foreach pick in hero from BaseWep where "(thingid.wSwordBast| thingid.wButtSwo| thingid.wDuelSwo| thingid.wFalcata| thingid.wGladius| thingid.wKatana| thingid.wKhopesh| thingid.wLongsword| thingid.wBroaNine| thingid.wRapier| thingid.wPFSawtoot| thingid.wScimitar| thingid.wScizore| thingid.wShortswd| thingid.wShotel| thingid.wSica| thingid.wSwordCane| thingid.wPFTempleS| thingid.wWakizashi | thingid.wUnarmed) & wCritMin.16"
        perform eachpick.delete[wCritMin.16]
        perform eachpick.assign[wCritMin.15]
nexteach

foreach pick in hero from BaseWep where "(thingid.wSwordBast| thingid.wButtSwo| thingid.wDuelSwo| thingid.wFalcata| thingid.wGladius| thingid.wKatana| thingid.wKhopesh| thingid.wLongsword| thingid.wBroaNine| thingid.wRapier| thingid.wPFSawtoot| thingid.wScimitar| thingid.wScizore| thingid.wShortswd| thingid.wShotel| thingid.wSica| thingid.wSwordCane| thingid.wPFTempleS| thingid.wWakizashi | thingid.wUnarmed) & wCritMin.17"
        perform eachpick.delete[wCritMin.17]
        perform eachpick.assign[wCritMin.16]
nexteach

foreach pick in hero from BaseWep where "(thingid.wSwordBast| thingid.wButtSwo| thingid.wDuelSwo| thingid.wFalcata| thingid.wGladius| thingid.wKatana| thingid.wKhopesh| thingid.wLongsword| thingid.wBroaNine| thingid.wRapier| thingid.wPFSawtoot| thingid.wScimitar| thingid.wScizore| thingid.wShortswd| thingid.wShotel| thingid.wSica| thingid.wSwordCane| thingid.wPFTempleS| thingid.wWakizashi | thingid.wUnarmed) & wCritMin.18"
        perform eachpick.delete[wCritMin.18]
        perform eachpick.assign[wCritMin.17]
nexteach

foreach pick in hero from BaseWep where "(thingid.wSwordBast| thingid.wButtSwo| thingid.wDuelSwo| thingid.wFalcata| thingid.wGladius| thingid.wKatana| thingid.wKhopesh| thingid.wLongsword| thingid.wBroaNine| thingid.wRapier| thingid.wPFSawtoot| thingid.wScimitar| thingid.wScizore| thingid.wShortswd| thingid.wShotel| thingid.wSica| thingid.wSwordCane| thingid.wPFTempleS| thingid.wWakizashi | thingid.wUnarmed) & wCritMin.19"
        perform eachpick.delete[wCritMin.19]
        perform eachpick.assign[wCritMin.18]
nexteach

foreach pick in hero from BaseWep where "(thingid.wSwordBast| thingid.wButtSwo| thingid.wDuelSwo| thingid.wFalcata| thingid.wGladius| thingid.wKatana| thingid.wKhopesh| thingid.wLongsword| thingid.wBroaNine| thingid.wRapier| thingid.wPFSawtoot| thingid.wScimitar| thingid.wScizore| thingid.wShortswd| thingid.wShotel| thingid.wSica| thingid.wSwordCane| thingid.wPFTempleS| thingid.wWakizashi | thingid.wUnarmed) & wCritMin.20"
        perform eachpick.delete[wCritMin.20]
        perform eachpick.assign[wCritMin.19]
nexteach

So prior to me updating today this script was working(at least yesterday it was), any Idea on what is going wrong with it now?
 
While I'm not sure why your code isn't working, I did work up a cleaner version that might help.

Code:
var critrange as number

foreach pick in hero from BaseWep where "wClass.OneHanded | wClass.Light"
   critrange = eachpick.tagvalue[wCritMin.?]
   critrange -= 1
   perform eachpick.delete[wCritMin.?]
   perform eachpick.assignstr["wCritMin." & critrange]
nexteach

Not tested, but should work
 
Last edited:
thanks for the code cleanup help. I'm horrible at setting up var in this.

on the other had now my herolab is broken i think. Putting in that code brought up this error

Code:
Hero Lab was forced to stop compilation after the following errors were detected:

Syntax error in 'eval' script for Thing 'cBMDdlyBld' (Eval Script '#1') on line 10
  -> Reference to undeclared variable: 'foreach'

It still shows up when I switch back to the old code.....wtf
 
Class special ability.

Semi found the issue

Code:
      ~ If we're not shown, just get out now
      doneif (tagis[Helper.ShowSpec] = 0)

I had that above the code initially but I guess the timing isn't right for it anymore. This creates other issues now (like this happening at level 1 when it's supposed start at level 9)
 
try this

Code:
~we're earlier than the normal test for whether we've reached the correct level, so we'll recreate that test here
doneif (root.field[cTotalLev].value + field[xExtraLev].value + field[xEffectLev].value < tagvalue[ClSpecWhen.?])
 
Hmm that fixed it. Thank you for your help.... I can't figure out why I set it as first still hmm...

Seriously Though, thanks
 
Back
Top