Hi all, Here's my request : I've just gained the gift "durable". The description of this gift is : "When you roll a Hit Die to regain hit points, the minimum number of hit points you regain from
the roll equals twice your Constitution modifier (minimum of 2)." On my 5e OGL Character sheet, my DM is using this script automatizing the hitdie roll : on('chat:message', function(msg) { // ROLL LISTENER if(msg.playerid.toLowerCase() != "api" && msg.rolltemplate) { var cnamebase = msg.content.split("charname=")[1]; var cname = cnamebase ? cnamebase.replace('}}','').trim() : (msg.content.split("{{name=")[1]||'').split("}}")[0].trim(); var character = cname ? findObjs({name: cname, type: 'character'})[0] : undefined; if(["simple"].indexOf(msg.rolltemplate) > -1) { if(_.has(msg,'inlinerolls') && msg.content.indexOf("^{hit-dice-u}") > -1 && character) { handlehd(msg,character); } } } }); // CHECK CURRENT HD, DECREMENT HD, THEN APPLY HP var handlehd = function (msg,character) { var hd = findObjs({type: 'attribute', characterid: character.id, name: "hit_dice"}, {caseInsensitive: true})[0]; var hp = findObjs({type: 'attribute', characterid: character.id, name: "hp"}, {caseInsensitive: true})[0]; if(!hd || hd.get("current")==="" || hd.get("max")==="") { log("CHARACTER HAS NO HIT_DICE ATTRIBUTE OR HD CURRENT/MAX IS NULL"); sendChat(msg.who, "<div class='sheet-rolltemplate-simple' style='margin-top:-7px;'><div class='sheet-container'><div class='sheet-label' style='margin-top:5px;'><span>" + "HD attribute on " + character.get("name") + " is missing or current/max values are not filled out, Hit Points were not applied." + "</span></div></div></div>"); return; } else if(!hp || hp.get("current")==="" || hp.get("max")==="") { log("CHARACTER HAS NO HP ATTRIBUTE OR HP CURRENT/MAX IS NULL"); sendChat(msg.who, "<div class='sheet-rolltemplate-simple' style='margin-top:-7px;'><div class='sheet-container'><div class='sheet-label' style='margin-top:5px;'><span>" + "HP attribute on " + character.get("name") + " is missing or current/max values are not filled out, Hit Points were not applied." + "</span></div></div></div>"); return; } else { var curhd = parseInt(hd.get("current")); var newhd = curhd - 1; } if (curhd === 0) { sendChat(msg.who, "<div class='sheet-rolltemplate-simple' style='margin-top:-7px;'><div class='sheet-container'><div class='sheet-label' style='margin-top:5px;'><span>" + character.get("name") + " n'a plus de DV disponible, les PV n'ont pas été ajoutés." + "</span></div></div></div>"); } else { hd.set({current:newhd}); var maxhp = parseInt(hp.get("max")); var curhp = parseInt(hp.get("current")); var result = msg.inlinerolls[2].results.total ? msg.inlinerolls[2].results.total : false; var newhp = curhp + result; if(result === false) { log("FAILED TO GET HD RESULT"); } else if (newhp > maxhp) { hp.set({current:maxhp}); } else { hp.set({current:newhp}); } } }; My Question is : how can I automatize my pressing on "hit die" to use the right rule of the "durable" gift... When I top-arrow the hitdie thing, i get this result : @{Alfarel|wtype}&{template:simple} {{rname=^{hit-dice-u}}} {{mod=D@{Alfarel|hitdieroll}+[[@{Alfarel|constitution_mod}[CON]]]}} {{r1=[[1d@{Alfarel|hitdieroll}+[[@{Alfarel|constitution_mod}]][CON]]]}} {{normal=1}} @{Alfarel|charname_output} Is there a way to correct this so the result of pressing on hit die would be correct according to the durable gift rule ? thanks for your help if you can. EDIT : I'm not very good at all this programming, but is there a way of changing the hitdie type with something like d8r<@constitution_mod*2 in the attributes page ???