• 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

need help with xCount

mbran01

Well-known member
I am trying to create an ability that increases by +2 every time you recieve it. The first time works fine, but the second time is increasing the bonus to +6 instead of +4. The thrid and final time is supposed to increase to +6, but instead increases to +10. I can't seem to find the cause. Any help would be appreciated.

phase/priority post-levels/5000

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

      ~calculate our bonus(it's stored as a variable in case an external thing wants to alter it)
      field[abValue].value += field[xCount].value * 2

        foreach pick in hero from BaseSkill
         if (eachpick.tagis[SkillOver.aCHA] + eachpick.linkage[skillattr].tagis[thingid.aCHA] <> 0) then
         eachpick.field[Bonus].value += field[abValue].value
         endif
        nexteach

      field[livename].text = field[thingname].text & " +" & field[abValue].value
      field[abSumm].text = "+" & field[abValue].value & " to all charisma based skills and checks."
 
Looks like you forgot:
Code:
~only run the rest for the first copy
doneif (tagis[Helper.FirstCopy] = 0)

This makes it so the ability only runs once. Instead your script when added three times will actually RUN 3 times. So first time will add +2, 2nd time adds +4, 3rd time adds +6 for a grand total of +12 getting added to each skill.

Hope that makes sense...
 
Back
Top