Member
Join Date: Oct 2010
Posts: 74
|
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 |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
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. |
#2 |
Member
Join Date: Oct 2010
Posts: 74
|
So what code can I add to give the character +2 uses of impromptu sneak attack?
|
#3 |
Senior Member
Join Date: Jan 2007
Location: NW Arkansas
Posts: 1,321
|
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 |
#4 |
Member
Join Date: Oct 2010
Posts: 74
|
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?
|
#5 |
Member
Join Date: Oct 2010
Posts: 74
|
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! |
#6 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,217
|
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) |
#7 |
|
|