• 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

Adding to a class ability

furby076

Well-known member
So my DM provided me with an item that gives me two additional uses of the Impromptu Sneak Attack ability (arcane trickster). I am working on creating this item and am trying to use pre-existing items as a template (e.g., Monk Robes).

I am not having much luck and was wondering, for the Eval Script what would work. Currently I have:

-- if (field[gIsEquip].value <> 0) then
~ Get 2 additional Impromptu Sneak Attack uses
if (#hasability[cATrImpSnk] <> 0) then
#trkmax[cATrImpSnk] += 2
endif

Probably, the If statement (if has ability) is not needed because the item is going to an Arcane Trickster, and it will never be used for an different class. Though having the proper code (for the if portion) would be helpful for future development.

Regards
 
You can leave out the #hasability[] test - #trkmax[] will simply do nothing if you were to add this item to a character with no Arcane Trickster levels.

#hasability[] is only intended for prereqs, not scripts - it's determined too late in the phase & priority sequence (at Final/9999999900) to be useful in a script.
 
Could you do something like:

Code:
doneif (field[gIsEquip].value = 0)

doneif (#trkmax[cATrImpSnk] = 0)
  
~ Get 2 additional Impromptu Sneak Attack uses
#trkmax[cATrImpSnk] += 2
 
Well, no errors, which is good. Unfortunately it did not add any to the existing ability (or add a new ability). Is there something I would have to add on top of that which I may have missed?
 
OK. I figured it out, with your help TCA. I removed the two "doneif" statements and it works.

What makes this nice is I can use the code for other items that add abilities :)

Thank you!
 
phase & priority?

(removing the doneif on the trkmax was needed, but without the gIsEquip, this item will add its bonus whether it's equipped or not - even if you move it to a different location)
 
Back
Top