
When making a roll, players have the option of increasing the chances of success by spending LUK. For each point of LUK they spend, the roll total increases by 5.
I have a button on the character sheet similar to this:
<button type="roll" name="roll_attr" value="&{template:BXDH}{{name=@{character_name}}}{{roll=[[1d20 + @{level} + ?{Luck Points?|0}*5]]]]}}"></button>
The template and roll work just fine, but the player has to manually decrease their LUK score.
What I'd like is for the LUK attribute to be decreased automatically (by the number entered), and from everything I've gathered I'd have to do this with an custom script. I thought I might be able to get this to work with ChatSetAttr, but haven't had any luck (so to speak).
My questions:
1) Is there a better/easier/any way to do this than creating a script?
2) Is this something I can actually accomplish with the api?
a) player-clicked button on character sheet
b) uses character attributes and player-entered values
c) displays template in chat results
d) modifies an attribute based on one of the player-entered values
3) Can anyone suggest any fairly simple scripts that do parts of what I'm looking to do?
I'm not particularly familiar with javascript, but if given something to work from I can usually pick things up from example.
Thanks!