• 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

get half a class level with minimum of 1

psych777

Well-known member
so i'm trying to get half the level of my class with min value of 1. i've got a script that i copied from somewhere and trying to use with some edits. oh, this is on a class special if that has something to do with it.
trying to use the levelcount macro to get the starting number, but it doesn't seem to want to divide in half. its getting the correct number of levels, just not dividing it.

Code:
field[abValue].value += maximum(round(#levelcount[Dread]/2,0,-1),1)

found that this below will halve it correctly, just wondering why the single line above doesn't work.
Code:
field[abValue2].value = #levelcount[Dread]
field[abValue].value += maximum(round(field[abValue2].value/2,0,-1),1)
 
If you are on a class special you don't want to hard-code the class. What if we re-use this ability on a different class? Instead simply use the field already on the Class Special do to the math:

Post-Levels/10000
Code:
~ Calculate half character level minimum 1
field[abValue].value += maximum(round(field[xTotalLev].value/2,0,-1),1)

If this is something for Uses Per day you can just set Tags on the Class Ability instead and not even need a script. This is found in the "Charge Information" section right under "Show in Tracked Resources List?".
 
If you are on a class special you don't want to hard-code the class. What if we re-use this ability on a different class? Instead simply use the field already on the Class Special do to the math:

Post-Levels/10000
Code:
~ Calculate half character level minimum 1
field[abValue].value += maximum(round(field[xTotalLev].value/2,0,-1),1)

If this is something for Uses Per day you can just set Tags on the Class Ability instead and not even need a script. This is found in the "Charge Information" section right under "Show in Tracked Resources List?".

What if there was a way get abValues by assigning tags like that *whistles innocently*
 
Back
Top