From eccf9bb7366d458155de22cf005c53cd2cb08bfb Mon Sep 17 00:00:00 2001 From: Djjus <59532170+Djjus@users.noreply.github.com> Date: Sun, 23 Mar 2025 00:41:31 +0000 Subject: [PATCH] sd spell upd --- .../Warhammer 4e Character Sheet.html | 476 +++++------------- 1 file changed, 130 insertions(+), 346 deletions(-) diff --git a/Warhammer 4e Character Sheet/Warhammer 4e Character Sheet.html b/Warhammer 4e Character Sheet/Warhammer 4e Character Sheet.html index 6de433cce1..48d8fa1c65 100644 --- a/Warhammer 4e Character Sheet/Warhammer 4e Character Sheet.html +++ b/Warhammer 4e Character Sheet/Warhammer 4e Character Sheet.html @@ -1137,6 +1137,7 @@ + @@ -11880,9 +11881,9 @@
@@ -31304,7 +31305,7 @@ - + @@ -31322,7 +31323,7 @@ - +
- +
@@ -31630,15 +31631,10 @@
- -
- - -
@@ -31703,6 +31699,7 @@ + @@ -32416,7 +32413,7 @@
+
- +
@@ -34352,13 +34349,6 @@ {{/spellcastingnumber}} - {{#accuchanexlsl}} -
-
Accu Ext SL
-
{{accuchanexlsl}}
-
- {{/accuchanexlsl}} - {{#spellsdnumber}}
@@ -34366,6 +34356,12 @@
{{/spellsdnumber}} + {{#accuchanexlsl}} +
+
Accu Ext SL
+
{{accuchanexlsl}}
+
+ {{/accuchanexlsl}} {{#accusdexlsl}}
Accu Ext SL
@@ -34468,13 +34464,17 @@ {{/^rollTotal() cond 0}} {{#rollGreater() distracted 0}} -
Distracted -{{distracted}}
+
-{{distracted}}
{{/rollGreater() distracted 0}} {{#rollGreater() drunk 0}} -
Drunk -{{drunk}}
+
-{{drunk}}
{{/rollGreater() drunk 0}} + {{#rollLess() yenlui 0}} +
{{yenlui}}
+ {{/rollLess() yenlui 0}} + {{#sl}} {{#^rollTotal() drunk 0}}
@@ -36931,6 +36931,13 @@ {{/spelldescription}} + {{#rollGreater() computed::accusdexlsl 0}} {{#spellsddesc}} +
+
+
{{spellsddesc}}
+
+ {{/spellsddesc}} {{/rollGreater() computed::accusdexlsl 0}} + {{#spelldamage}} {{#hitlocation}} @@ -45579,7 +45586,6 @@ on("change:repeating_melee:UsedDefense change:repeating_ranged:UsedRangedOff", f rangth = t.repeating_ranged_Used_RangedTwoHanded; getSectionIDs("repeating_melee", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; const output2 = {}; const output3 = {}; @@ -45587,7 +45593,6 @@ on("change:repeating_melee:UsedDefense change:repeating_ranged:UsedRangedOff", f const output5 = {}; const output6 = {}; const output7 = {}; - // loop through the row ids ids.forEach(id => { if (t.repeating_melee_UsedWeapon == 1) {output3[`repeating_melee_${id}_UsedWeapon`] = (playerclickedid.toLowerCase() == id.toLowerCase()) ? 0 : 0; @@ -46948,12 +46953,9 @@ on("clicked:activate", function(event) { // on('sheet:opened change:repeating_talents:talentname change:repeating_talents:talentlevel', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; getSectionIDs("repeating_talents", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_talents_${id}_TalentName`, `repeating_talents_${id}_TalentLevel`], function(v) { const talxp = +v[`repeating_talents_${id}_TalentLevel`]; @@ -47100,14 +47102,10 @@ on('change:repeating_trade remove:repeating_trade', function() { }); on('sheet:opened change:repeating_artspecializationr:artspecializationname change:repeating_artspecializationr:artspecializationadv', function(event) { - // makes sure the sheet worker doesnt trigger itself - if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' + if (event.sourceType === 'sheetworker') return; getSectionIDs("repeating_artspecializationr", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_artspecializationr_${id}_ArtSpecializationName`, `repeating_artspecializationr_${id}_ArtSpecializationAdv`], function(v) { const artxp = +v[`repeating_artspecializationr_${id}_ArtSpecializationAdv`]; @@ -47139,14 +47137,10 @@ on('sheet:opened change:repeating_artspecializationr:artspecializationname chang }); on('sheet:opened change:repeating_entertainspecialization:entertainspecializationname change:repeating_entertainspecialization:entertainspecializationadv', function(event) { - // makes sure the sheet worker doesnt trigger itself - if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' + if (event.sourceType === 'sheetworker') return; getSectionIDs("repeating_entertainspecialization", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_entertainspecialization_${id}_EntertainSpecializationName`, `repeating_entertainspecialization_${id}_EntertainSpecializationAdv`], function(v) { const artxp = +v[`repeating_entertainspecialization_${id}_EntertainSpecializationAdv`]; @@ -47177,14 +47171,10 @@ on('sheet:opened change:repeating_entertainspecialization:entertainspecializatio }); on('sheet:opened change:repeating_ridespecialization:ridespecializationname change:repeating_ridespecialization:ridespecializationadv', function(event) { - // makes sure the sheet worker doesnt trigger itself - if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' + if (event.sourceType === 'sheetworker') return; getSectionIDs("repeating_ridespecialization", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_ridespecialization_${id}_RideSpecializationName`, `repeating_ridespecialization_${id}_RideSpecializationAdv`], function(v) { const artxp = +v[`repeating_ridespecialization_${id}_RideSpecializationAdv`]; @@ -47215,14 +47205,10 @@ on('sheet:opened change:repeating_ridespecialization:ridespecializationname chan }); on('sheet:opened change:repeating_stealthspecialization:stealthspecializationname change:repeating_stealthspecialization:stealthspecializationadv', function(event) { - // makes sure the sheet worker doesnt trigger itself - if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' + if (event.sourceType === 'sheetworker') return; getSectionIDs("repeating_stealthspecialization", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_stealthspecialization_${id}_StealthSpecializationName`, `repeating_stealthspecialization_${id}_StealthSpecializationAdv`], function(v) { const artxp = +v[`repeating_stealthspecialization_${id}_StealthSpecializationAdv`]; @@ -47253,14 +47239,10 @@ on('sheet:opened change:repeating_stealthspecialization:stealthspecializationnam }); on('sheet:opened change:repeating_animaltraining:animaltrainingspecialization change:repeating_animaltraining:animaltrainingadv', function(event) { - // makes sure the sheet worker doesnt trigger itself - if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' + if (event.sourceType === 'sheetworker') return; getSectionIDs("repeating_animaltraining", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_animaltraining_${id}_AnimalTrainingSpecialization`, `repeating_animaltraining_${id}_AnimalTrainingAdv`], function(v) { const artxp = +v[`repeating_animaltraining_${id}_AnimalTrainingAdv`]; @@ -47290,14 +47272,10 @@ on('sheet:opened change:repeating_animaltraining:animaltrainingspecialization ch }); on('sheet:opened change:repeating_language:languagespecialization change:repeating_language:languageadv', function(event) { - // makes sure the sheet worker doesnt trigger itself - if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' + if (event.sourceType === 'sheetworker') return; getSectionIDs("repeating_language", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_language_${id}_LanguageSpecialization`, `repeating_language_${id}_LanguageAdv`], function(v) { const artxp = +v[`repeating_language_${id}_LanguageAdv`]; @@ -47329,14 +47307,10 @@ on('sheet:opened change:repeating_language:languagespecialization change:repeati on('sheet:opened change:repeating_lore:lorespecialization change:repeating_lore:loreadv', function(event) { console.log("XP Lore calc"); - // makes sure the sheet worker doesnt trigger itself - if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' + if (event.sourceType === 'sheetworker') return; getSectionIDs("repeating_lore", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_lore_${id}_LoreSpecialization`, `repeating_lore_${id}_LoreAdv`], function(v) { const artxp = +v[`repeating_lore_${id}_LoreAdv`]; @@ -47366,14 +47340,10 @@ on('sheet:opened change:repeating_lore:lorespecialization change:repeating_lore: on('sheet:opened change:repeating_perform:performspecialization change:repeating_perform:performadv', function(event) { console.log("XP Perform calc"); - // makes sure the sheet worker doesnt trigger itself - if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' + if (event.sourceType === 'sheetworker') return; getSectionIDs("repeating_perform", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_perform_${id}_PerformSpecialization`, `repeating_perform_${id}_PerformAdv`], function(v) { const artxp = +v[`repeating_perform_${id}_PerformAdv`]; @@ -47403,14 +47373,10 @@ on('sheet:opened change:repeating_perform:performspecialization change:repeating on('sheet:opened change:repeating_play:playspecialization change:repeating_play:playadv', function(event) { console.log("XP Play calc"); - // makes sure the sheet worker doesnt trigger itself - if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' + if (event.sourceType === 'sheetworker') return; getSectionIDs("repeating_play", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_play_${id}_PlaySpecialization`, `repeating_play_${id}_PlayAdv`], function(v) { const artxp = +v[`repeating_play_${id}_PlayAdv`]; @@ -47440,14 +47406,10 @@ on('sheet:opened change:repeating_play:playspecialization change:repeating_play: on('sheet:opened change:repeating_sail:sailspecialization change:repeating_sail:sailadv', function(event) { console.log("XP Sail calc"); - // makes sure the sheet worker doesnt trigger itself - if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' + if (event.sourceType === 'sheetworker') return; getSectionIDs("repeating_sail", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_sail_${id}_SailSpecialization`, `repeating_sail_${id}_SailAdv`], function(v) { const artxp = +v[`repeating_sail_${id}_SailAdv`]; @@ -47477,14 +47439,10 @@ on('sheet:opened change:repeating_sail:sailspecialization change:repeating_sail: on('sheet:opened change:repeating_secretsigns:secretsignsspecialization change:repeating_secretsigns:secretsignsadv', function(event) { console.log("XP SecretSigns calc"); - // makes sure the sheet worker doesnt trigger itself - if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' + if (event.sourceType === 'sheetworker') return; getSectionIDs("repeating_secretsigns", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_secretsigns_${id}_SecretSignsSpecialization`, `repeating_secretsigns_${id}_SecretSignsAdv`], function(v) { const artxp = +v[`repeating_secretsigns_${id}_SecretSignsAdv`]; @@ -47514,14 +47472,10 @@ on('sheet:opened change:repeating_secretsigns:secretsignsspecialization change:r on('sheet:opened change:repeating_trade:tradespecialization change:repeating_trade:tradeadv', function(event) { console.log("XP Trade calc"); - // makes sure the sheet worker doesnt trigger itself - if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' + if (event.sourceType === 'sheetworker') return; getSectionIDs("repeating_trade", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_trade_${id}_TradeSpecialization`, `repeating_trade_${id}_TradeAdv`], function(v) { const artxp = +v[`repeating_trade_${id}_TradeAdv`]; @@ -47551,14 +47505,10 @@ on('sheet:opened change:repeating_trade:tradespecialization change:repeating_tra on('sheet:opened change:repeating_otherxp:otherxp change:repeating_otherxp:otherxpdesc change:repeating_otherxp:otherxptype change:repeating_otherxp:otherxpadv', function(event) { console.log("XP Other calc"); - // makes sure the sheet worker doesnt trigger itself - if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' + if (event.sourceType === 'sheetworker') return; getSectionIDs("repeating_otherxp", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_otherxp_${id}_OtherXP`, `repeating_otherxp_${id}_OtherXPDesc`, `repeating_otherxp_${id}_OtherXPType`, `repeating_otherxp_${id}_OtherXPAdv`], function(v) { const otherxp = +v[`repeating_otherxp_${id}_OtherXP`]; @@ -48360,15 +48310,10 @@ on('change:repeating_npc-tab-page4:NPC_AmbidextrousLvl change:repeating_npc-tab- on('change:inventorytabgm clicked:repeating_npc-tab-page:npcattackroll clicked:repeating_npc-tab-page:npcattack2roll clicked:repeating_npc-tab-page:npcattack3roll clicked:repeating_npc-tab-page:npcopposedroll clicked:repeating_npc-tab-page:npcopposed2roll clicked:repeating_npc-tab-page:npcopposed3roll clicked:repeating_npc-tab-page2:npcattackroll clicked:repeating_npc-tab-page2:npcattack2roll clicked:repeating_npc-tab-page2:npcattack3roll clicked:repeating_npc-tab-page2:npcopposedroll clicked:repeating_npc-tab-page2:npcopposed2roll clicked:repeating_npc-tab-page2:npcopposed3roll clicked:repeating_npc-tab-page3:npcattackroll clicked:repeating_npc-tab-page3:npcattack2roll clicked:repeating_npc-tab-page3:npcattack3roll clicked:repeating_npc-tab-page3:npcopposedroll clicked:repeating_npc-tab-page3:npcopposed2roll clicked:repeating_npc-tab-page3:npcopposed3roll clicked:repeating_npc-tab-page4:npcattackroll clicked:repeating_npc-tab-page4:npcattack2roll clicked:repeating_npc-tab-page4:npcattack3roll clicked:repeating_npc-tab-page4:npcopposedroll clicked:repeating_npc-tab-page4:npcopposed2roll clicked:repeating_npc-tab-page4:npcopposed3rol', function(event) { console.log("Grabing NPC IDs."); - // makes sure the sheet worker doesnt trigger itself - // get the row id that the player clicked. the id is always between the second and third '_' getSectionIDs("repeating_npc-tab-page", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. output[`repeating_npc-tab-page_${id}_rep_ID`] = id; }); setAttrs(output, {silent: true}); @@ -48435,18 +48380,13 @@ on('change:repeating_npc-tab-page:npc_name', function(event) { on('change:repeating_npc-tab-page2:npc_name', function(event) { console.log("NPC named, grabing ID."); - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_npc-tab-page2", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_npc-tab-page2_${id}_rep_ID`] = playerId; @@ -48458,18 +48398,13 @@ on('change:repeating_npc-tab-page2:npc_name', function(event) { on('change:repeating_npc-tab-page3:npc_name', function(event) { console.log("NPC named, grabing ID."); - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_npc-tab-page3", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_npc-tab-page3_${id}_rep_ID`] = playerId; @@ -48481,18 +48416,13 @@ on('change:repeating_npc-tab-page3:npc_name', function(event) { on('change:repeating_npc-tab-page4:npc_name', function(event) { console.log("NPC named, grabing ID."); - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_npc-tab-page4", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_npc-tab-page4_${id}_rep_ID`] = playerId; @@ -48503,18 +48433,13 @@ on('change:repeating_npc-tab-page4:npc_name', function(event) { }); on('change:repeating_artspecializationr', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_artspecializationr", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_artspecializationr_${id}_Skill_rep_ID`] = playerId; @@ -48525,18 +48450,13 @@ on('change:repeating_artspecializationr', function(event) { }); on('change:repeating_entertainspecialization', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_entertainspecialization", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_entertainspecialization_${id}_Skill_rep_ID`] = playerId; @@ -48547,18 +48467,13 @@ on('change:repeating_entertainspecialization', function(event) { }); on('change:repeating_ridespecialization', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_ridespecialization", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_ridespecialization_${id}_Skill_rep_ID`] = playerId; @@ -48569,18 +48484,13 @@ on('change:repeating_ridespecialization', function(event) { }); on('change:repeating_stealthspecialization', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_stealthspecialization", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_stealthspecialization_${id}_Skill_rep_ID`] = playerId; @@ -48591,18 +48501,13 @@ on('change:repeating_stealthspecialization', function(event) { }); on('change:repeating_animaltraining', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_animaltraining", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_animaltraining_${id}_Skill_rep_ID`] = playerId; @@ -48613,18 +48518,13 @@ on('change:repeating_animaltraining', function(event) { }); on('change:repeating_language', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_language", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_language_${id}_Skill_rep_ID`] = playerId; @@ -48635,18 +48535,13 @@ on('change:repeating_language', function(event) { }); on('change:repeating_lore', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_lore", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_lore_${id}_Skill_rep_ID`] = playerId; @@ -48657,18 +48552,13 @@ on('change:repeating_lore', function(event) { }); on('change:repeating_perform', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_perform", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_perform_${id}_Skill_rep_ID`] = playerId; @@ -48679,18 +48569,13 @@ on('change:repeating_perform', function(event) { }); on('change:repeating_play', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_play", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_play_${id}_Skill_rep_ID`] = playerId; @@ -48701,18 +48586,13 @@ on('change:repeating_play', function(event) { }); on('change:repeating_sail', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_sail", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_sail_${id}_Skill_rep_ID`] = playerId; @@ -48723,18 +48603,13 @@ on('change:repeating_sail', function(event) { }); on('change:repeating_secretsigns', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_secretsigns", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_secretsigns_${id}_Skill_rep_ID`] = playerId; @@ -48745,18 +48620,13 @@ on('change:repeating_secretsigns', function(event) { }); on('change:repeating_trade', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_trade", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_trade_${id}_Skill_rep_ID`] = playerId; @@ -48767,9 +48637,7 @@ on('change:repeating_trade', function(event) { }); on('change:repeating_spellbookpetty change:repeating_spellbookpetty:spellname', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getAttrs(["repeating_spellbookpetty_spellname"], function(v) { @@ -48777,11 +48645,8 @@ on('change:repeating_spellbookpetty change:repeating_spellbookpetty:spellname', getSectionIDs("repeating_spellbookpetty", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_spellbookpetty_${id}_rep_ID`] = playerId; @@ -48793,19 +48658,14 @@ on('change:repeating_spellbookpetty change:repeating_spellbookpetty:spellname', }); }); on('clicked:repeating_spellbookpetty:custname', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_spellbookpetty", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; const output2 = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_spellbookpetty_${id}_spellname`] = ""; @@ -48818,9 +48678,7 @@ on('clicked:repeating_spellbookpetty:custname', function(event) { }); on('change:repeating_spellbookarcane change:repeating_spellbookarcane:spellname', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getAttrs(["repeating_spellbookarcane_spellname"], function(v) { @@ -48828,11 +48686,8 @@ on('change:repeating_spellbookarcane change:repeating_spellbookarcane:spellname' getSectionIDs("repeating_spellbookarcane", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_spellbookarcane_${id}_rep_ID`] = playerId; @@ -48844,20 +48699,15 @@ on('change:repeating_spellbookarcane change:repeating_spellbookarcane:spellname' }); }); on('clicked:repeating_spellbookarcane:custname', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_spellbookarcane", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; const output2 = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { @@ -48885,15 +48735,15 @@ on('sheet:opened change:repeating_spellbookarcane:ExtChannellingLore change:repe if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingLight})") {lore = 6; lorename = "Light";} if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingDeath})") {lore = 7; lorename = "Death";} if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingShadows})") {lore = 8; lorename = "Shadows";} - if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingWitch})") {lore = 9; lorename = "Witch";} - if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingDark})") {lore = 10; lorename = "Dark";} - if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingChaos})") {lore = 11; lorename = "Chaos";} - if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingGreatMaw})") {lore = 12; lorename = "GreatMaw";} - if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingMisc})") {lore = 13; lorename = "Misc";} - if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingHighMagic})") {lore = 14; lorename = "High Magic}";} + if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingHighMagic})") {lore = 9; lorename = "High Magic";} + if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingWitch})") {lore = 10; lorename = "Witch";} + if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingDark})") {lore = 11; lorename = "Dark";} + if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingChaos})") {lore = 12; lorename = "Chaos";} + if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingGreatMaw})") {lore = 13; lorename = "GreatMaw";} + if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingMisc})") {lore = 14; lorename = "Misc";} if (parseInt(t[`repeating_spellbookarcane_${id}_Spellmem`]) === 1) {spmem = 1} else {spmem = 2} - if (parseInt(t.Used_Enchanted_Staff) === 14) {cnout = (t[`repeating_spellbookarcane_${id}_spellcastingnumber`] * spmem) - 1} else if + if (parseInt(t.Used_Enchanted_Staff) === 15) {cnout = (t[`repeating_spellbookarcane_${id}_spellcastingnumber`] * spmem) - 1} else if (parseInt(t.Used_Enchanted_Staff) === lore) {cnout = (t[`repeating_spellbookarcane_${id}_spellcastingnumber`] * spmem) - 1} else {cnout = t[`repeating_spellbookarcane_${id}_spellcastingnumber`] * spmem} if (cnout < 0) {cnout = 0} @@ -48965,22 +48815,20 @@ on('change:repeating_spellbookrituals:ExtChannellingLore', function(event) { if (v.repeating_spellbookrituals_ExtChannellingLore == "(@{ChannellingLight})]") {lore = 6; lorename = "Light";} if (v.repeating_spellbookrituals_ExtChannellingLore == "(@{ChannellingDeath})") {lore = 7; lorename = "Death";} if (v.repeating_spellbookrituals_ExtChannellingLore == "(@{ChannellingShadows})") {lore = 8; lorename = "Shadows";} - if (v.repeating_spellbookrituals_ExtChannellingLore == "(@{ChannellingWitch})") {lore = 9; lorename = "Witch";} - if (v.repeating_spellbookrituals_ExtChannellingLore == "(@{ChannellingDark})") {lore = 10; lorename = "Dark";} - if (v.repeating_spellbookrituals_ExtChannellingLore == "(@{ChannellingChaos})") {lore = 11; lorename = "Chaos";} - if (v.repeating_spellbookrituals_ExtChannellingLore == "(@{ChannellingGreatMaw})") {lore = 12; lorename = "GreatMaw";} - if (v.repeating_spellbookrituals_ExtChannellingLore == "(@{ChannellingMisc})") {lore = 13; lorename = "Misc";} + if (v.repeating_spellbookrituals_ExtChannellingLore == "(@{ChannellingHighMagic})") {lore = 9; lorename = "High Magic";} + if (v.repeating_spellbookrituals_ExtChannellingLore == "(@{ChannellingWitch})") {lore = 10; lorename = "Witch";} + if (v.repeating_spellbookrituals_ExtChannellingLore == "(@{ChannellingDark})") {lore = 11; lorename = "Dark";} + if (v.repeating_spellbookrituals_ExtChannellingLore == "(@{ChannellingChaos})") {lore = 12; lorename = "Chaos";} + if (v.repeating_spellbookrituals_ExtChannellingLore == "(@{ChannellingGreatMaw})") {lore = 13; lorename = "GreatMaw";} + if (v.repeating_spellbookrituals_ExtChannellingLore == "(@{ChannellingMisc})") {lore = 14; lorename = "Misc";} console.log("spelllore change"); console.log(lore); getSectionIDs("repeating_spellbookrituals", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_spellbookrituals_${id}_MagicLore`] = lore; @@ -48994,9 +48842,7 @@ on('change:repeating_spellbookrituals:ExtChannellingLore', function(event) { }); on('change:repeating_divineblessings change:repeating_divineblessings:spellname', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getAttrs(["repeating_divineblessings_spellname"], function(v) { @@ -49004,11 +48850,8 @@ on('change:repeating_divineblessings change:repeating_divineblessings:spellname' getSectionIDs("repeating_divineblessings", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_divineblessings_${id}_rep_ID`] = playerId; @@ -49020,19 +48863,14 @@ on('change:repeating_divineblessings change:repeating_divineblessings:spellname' }); }); on('clicked:repeating_divineblessings:custname', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_divineblessings", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; const output2 = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_divineblessings_${id}_spellname`] = ""; @@ -49044,9 +48882,7 @@ on('clicked:repeating_divineblessings:custname', function(event) { }); }); on('change:repeating_divinemiracles change:repeating_divinemiracles:spellname', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getAttrs(["repeating_divinemiracles_spellname"], function(v) { @@ -49055,11 +48891,8 @@ on('change:repeating_divinemiracles change:repeating_divinemiracles:spellname', getSectionIDs("repeating_divinemiracles", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_divinemiracles_${id}_rep_ID`] = playerId; @@ -49071,19 +48904,14 @@ on('change:repeating_divinemiracles change:repeating_divinemiracles:spellname', }); }); on('clicked:repeating_divinemiracles:custname', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_divinemiracles", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; const output2 = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { output[`repeating_divinemiracles_${id}_spellname`] = ""; @@ -49117,20 +48945,15 @@ on('clicked:repeating_divinemiracles:custname', function(event) { }); }); on('clicked:repeating_sworddancing:custname', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_sworddancing", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; const output2 = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. let playerId = playerclickedid.toLowerCase(); if(playerId == id.toLowerCase()) { @@ -49144,18 +48967,13 @@ on('clicked:repeating_divinemiracles:custname', function(event) { }); on('sheet:opened change:repeating_inventory', function(event) { - // makes sure the sheet worker doesnt trigger itself - if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' + if (event.sourceType === 'sheetworker') return; enc = 0; getSectionIDs("repeating_inventory", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. getAttrs([`repeating_inventory_${id}_inventoryworn_repeat`, `repeating_inventory_${id}_inventoryqty_repeat`, `repeating_inventory_${id}_inventoryweight_repeat`, `repeating_inventory_${id}_weight_unit_setting`], function(v) { worn = v[`repeating_inventory_${id}_inventoryworn_repeat`]; @@ -49213,21 +49031,16 @@ on('change:talentmode change:Trait_Elite change:Trait_Big change:Trait_Brute cha var charScore = charStart + charTalents + charTalentsD + charAdv + charMod; const bonusStart = Math.floor(charScore / 10); - console.log("Test STATS 0"); setAttrs({ [stat]: charScore, [`${stat}BonusStart`]: bonusStart, }); - console.log(charScore); - console.log("Test STATS 1"); const bonusMod = +v[`${stat}BonusMod`] || 0; const bonus = bonusStart + bonusMod; setAttrs({ [`${stat}Bonus`]: bonus, }); - console.log(bonus); - console.log("Test STATS 2"); }); }); @@ -49441,7 +49254,6 @@ on('sheet:opened', function() { }); on('sheet:opened change:advantage change:repeating_npc-tab-page:advstat change:repeating_npc-tab-page2:advstat change:repeating_npc-tab-page3:advstat change:repeating_npc-tab-page4:advstat change:advantage_casting', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; getAttrs(["Advantage", "Advantage_casting"], function(v) { const adv = v.Advantage; @@ -49486,7 +49298,6 @@ on('sheet:opened change:advantage change:repeating_npc-tab-page:advstat change:r }); on('sheet:opened change:initiative_houserule', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; getAttrs(["initiative_houserule"], function(v) { const out = v.initiative_houserule; @@ -51063,9 +50874,7 @@ on('clicked:repeating_spellbookarcane:spellcast clicked:repeating_spellbookarcan ); getSectionIDs("repeating_spellbookarcane", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_spellbookarcane_${id}_MagicLore`, `repeating_spellbookarcane_${id}_UsedSpell1`, `repeating_spellbookarcane_${id}_UsedSpell2`, `repeating_spellbookarcane_${id}_UsedSpell3`], function(v) { @@ -51100,9 +50909,7 @@ on('clicked:repeating_spellbookarcane:spellcast clicked:repeating_spellbookarcan }); getSectionIDs("repeating_spellbookrituals", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_spellbookrituals_${id}_MagicLore`], function(v) { @@ -51197,9 +51004,7 @@ on('clicked:repeating_spellbookarcane:extchannellingloreroll', (eventInfo) => { ); getSectionIDs("repeating_spellbookarcane", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_spellbookarcane_${id}_MagicLore`, `repeating_spellbookarcane_${id}_UsedSpell1`, `repeating_spellbookarcane_${id}_UsedSpell2`, `repeating_spellbookarcane_${id}_UsedSpell3`, "WillPowerBonus"], function(v) { @@ -51220,9 +51025,7 @@ on('clicked:repeating_spellbookarcane:extchannellingloreroll', (eventInfo) => { }); getSectionIDs("repeating_spellbookrituals", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_spellbookrituals_${id}_MagicLore`, "WillPowerBonus"], function(v) { @@ -51251,10 +51054,8 @@ on('clicked:repeating_spellbookarcane:channelreset', (eventInfo) => { lore = ''; getSectionIDs("repeating_spellbookarcane", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; const output2 = {}; - // loop through the row ids ids.forEach(id => { if(playerclickedid.toLowerCase() == id.toLowerCase()) { @@ -51272,10 +51073,8 @@ on('clicked:repeating_spellbookarcane:channelreset', (eventInfo) => { output2[`repeating_spellbookarcane_${id}_spellchannelsl`] = 0, setAttrs(output2, {silent: true}) getSectionIDs("repeating_spellbookrituals", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; const output2 = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_spellbookrituals_${id}_MagicLore`], function(v) { @@ -51297,6 +51096,8 @@ on('clicked:repeating_spellbookarcane:channelreset', (eventInfo) => { on('clicked:repeating_spellbookrituals:spellcast clicked:repeating_spellbookrituals:spellcastdmg clicked:repeating_spellbookrituals:spellcastreroll clicked:repeating_spellbookrituals:spellcastdmgreroll', (eventInfo) => { + getAttrs(["initiative_houserule", "OverChannel", "LastRollAccuExtSL", "Used_Enchanted_Staff"], function(v) { + var trigger = eventInfo.triggerName.slice(8); var skillpre = trigger.split('_'); var skill = skillpre[3]; @@ -51313,16 +51114,13 @@ on('clicked:repeating_spellbookrituals:spellcast clicked:repeating_spellbookrit var accumod = '@{LastRollAccuExtSL}'; var prefix = eventInfo.triggerName.slice(8, -19);} - getAttrs(["initiative_houserule", "OverChannel", "LastRollAccuExtSL", "Used_Enchanted_Staff"], function(v) { cnlore = 0; const playerclickedid = eventInfo.sourceAttribute.split('_')[2] || ''; getSectionIDs("repeating_spellbookrituals", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { let playerId = playerclickedid.toLowerCase(); @@ -51396,9 +51194,7 @@ on('clicked:repeating_spellbookrituals:spellcast clicked:repeating_spellbookrit getSectionIDs("repeating_spellbookarcane", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_spellbookarcane_${id}_MagicLore`], function(v) { @@ -51414,9 +51210,7 @@ on('clicked:repeating_spellbookrituals:spellcast clicked:repeating_spellbookrit }); getSectionIDs("repeating_spellbookrituals", function (ids) { if (playerclickedid == ids.toLowerCase) return; - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_spellbookrituals_${id}_MagicLore`], function(v) { @@ -51511,9 +51305,7 @@ on('clicked:repeating_spellbookrituals:extchannellingloreroll', (eventInfo) => { ); getSectionIDs("repeating_spellbookarcane", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_spellbookarcane_${id}_MagicLore`, "WillPowerBonus"], function(v) { @@ -51534,9 +51326,7 @@ on('clicked:repeating_spellbookrituals:extchannellingloreroll', (eventInfo) => { }); getSectionIDs("repeating_spellbookrituals", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_spellbookrituals_${id}_MagicLore`, "WillPowerBonus"], function(v) { @@ -51993,29 +51783,29 @@ on('clicked:repeating_divinemiracles:miracle clicked:repeating_divinemiracles:mi else if (trigger === 'channellinglight') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{robes=[[@{Used_Wizard_Robes}]]}} {{sptal1=[[@{Talent_AethyricAttunementLvl}]]}} {{accuchanexlsl=[[@{Quick_Spell_AccuSL_6}]]}}'; addtak= '*@{ChannellingLightTaken}'; rollPart = rollPart2.replaceAll('cond-', `(@{condgen_see_move}-@{DrunkMod})`).replaceAll('>addtak<', addtak);} - else if (trigger === 'channellingdeath') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{robes=[[@{Used_Wizard_Robes}]]}} {{sptal1=[[@{Talent_AethyricAttunementLvl}]]}}'; + else if (trigger === 'channellingdeath') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{robes=[[@{Used_Wizard_Robes}]]}} {{sptal1=[[@{Talent_AethyricAttunementLvl}]]}} {{accuchanexlsl=[[@{Quick_Spell_AccuSL_7}'; addtak= '*@{ChannellingDeathTaken}'; rollPart = rollPart2.replaceAll('cond-', `(@{condgen_see_move}-@{DrunkMod})`).replaceAll('>addtak<', addtak);} - else if (trigger === 'channellingshadows') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{robes=[[@{Used_Wizard_Robes}]]}} {{sptal1=[[@{Talent_AethyricAttunementLvl}]]}}'; + else if (trigger === 'channellingshadows') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{robes=[[@{Used_Wizard_Robes}]]}} {{sptal1=[[@{Talent_AethyricAttunementLvl}]]}} {{accuchanexlsl=[[@{Quick_Spell_AccuSL_8}'; addtak= '*@{ChannellingShadowsTaken}'; rollPart = rollPart2.replaceAll('cond-', `(@{condgen_see_move}-@{DrunkMod})`).replaceAll('>addtak<', addtak);} - else if (trigger === 'channellinghighmagic') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{robes=[[@{Used_Wizard_Robes}]]}} {{sptal1=[[@{Talent_AethyricAttunementLvl}]]}} {{lileathsblessing=[[@{Talent_LileathsblessingLvl}]]}}'; + else if (trigger === 'channellinghighmagic') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{robes=[[@{Used_Wizard_Robes}]]}} {{sptal1=[[@{Talent_AethyricAttunementLvl}]]}} {{lileathsblessing=[[@{Talent_LileathsblessingLvl}]]}} {{accuchanexlsl=[[@{Quick_Spell_AccuSL_9}'; addtak= '*@{ChannellingHighMagicTaken}'; addsl = '+@{Talent_LileathsblessingLvl}'; rollPart = rollPart2.replaceAll('cond-', `(@{condgen_see_move}-@{DrunkMod})`).replaceAll('>addtak<', addtak).replaceAll('>addsl<', addsl);} - else if (trigger === 'channellingwitch') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{robes=[[@{Used_Wizard_Robes}]]}} {{sptal1=[[@{Talent_AethyricAttunementLvl}]]}}'; + else if (trigger === 'channellingwitch') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{robes=[[@{Used_Wizard_Robes}]]}} {{sptal1=[[@{Talent_AethyricAttunementLvl}]]}} {{accuchanexlsl=[[@{Quick_Spell_AccuSL_10}'; addtak= '*@{ChannellingWitchTaken}'; rollPart = rollPart2.replaceAll('cond-', `(@{condgen_see_move}-@{DrunkMod})`).replaceAll('>addtak<', addtak);} - else if (trigger === 'channellingdark') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{robes=[[@{Used_Wizard_Robes}]]}} {{sptal1=[[@{Talent_AethyricAttunementLvl}]]}}'; + else if (trigger === 'channellingdark') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{robes=[[@{Used_Wizard_Robes}]]}} {{sptal1=[[@{Talent_AethyricAttunementLvl}]]}} {{accuchanexlsl=[[@{Quick_Spell_AccuSL_11}'; addtak= '*@{ChannellingDarkTaken}'; rollPart = rollPart2.replaceAll('cond-', `(@{condgen_see_move}-@{DrunkMod})`).replaceAll('>addtak<', addtak);} - else if (trigger === 'channellingchaos') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}}'; + else if (trigger === 'channellingchaos') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{robes=[[@{Used_Wizard_Robes}]]}} {{sptal1=[[@{Talent_AethyricAttunementLvl}]]}} {{accuchanexlsl=[[@{Quick_Spell_AccuSL_12}'; addtak= '*@{ChannellingChaosTaken}'; rollPart = rollPart2.replaceAll('cond-', `(@{condgen_see_move}-@{DrunkMod})`).replaceAll('>addtak<', addtak);} - else if (trigger === 'channellinggreatmaw') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{robes=[[@{Used_Wizard_Robes}]]}} {{sptal1=[[@{Talent_AethyricAttunementLvl}]]}}'; + else if (trigger === 'channellinggreatmaw') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{robes=[[@{Used_Wizard_Robes}]]}} {{sptal1=[[@{Talent_AethyricAttunementLvl}]]}} {{accuchanexlsl=[[@{Quick_Spell_AccuSL_13}'; addtak= '*@{ChannellingGreatMawTaken}'; rollPart = rollPart2.replaceAll('cond-', `(@{condgen_see_move}-@{DrunkMod})`).replaceAll('>addtak<', addtak);} - else if (trigger === 'channellingmisc') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{robes=[[@{Used_Wizard_Robes}]]}} {{sptal1=[[@{Talent_AethyricAttunementLvl}]]}}'; + else if (trigger === 'channellingmisc') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[0]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{robes=[[@{Used_Wizard_Robes}]]}} {{sptal1=[[@{Talent_AethyricAttunementLvl}]]}} {{accuchanexlsl=[[@{Quick_Spell_AccuSL_14}'; addtak= '*@{ChannellingMiscTaken}'; rollPart = rollPart2.replaceAll('cond-', `(@{condgen_see_move}-@{DrunkMod})`).replaceAll('>addtak<', addtak);} else if (trigger === 'settrap') {cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{drunk=[[@{DrunkMod}]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}} {{trapper=[[@{Talent_TrapperLvl}]]}}'; @@ -52186,9 +51976,7 @@ on('clicked:repeating_divinemiracles:miracle clicked:repeating_divinemiracles:mi if (lore > 0) { getSectionIDs("repeating_spellbookarcane", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_spellbookarcane_${id}_MagicLore`, `repeating_spellbookarcane_${id}_spellchannelsl`, "WillPowerBonus"], function(v) { @@ -52213,9 +52001,7 @@ on('clicked:repeating_divinemiracles:miracle clicked:repeating_divinemiracles:mi }); getSectionIDs("repeating_spellbookrituals", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { getAttrs([`repeating_spellbookrituals_${id}_MagicLore`, `repeating_spellbookrituals_${id}_spellchannelsl`, "WillPowerBonus"], function(v) { @@ -52352,8 +52138,13 @@ on('clicked:repeating_divinemiracles:miracle clicked:repeating_divinemiracles:mi on('clicked:repeating_sworddancing:meleetwohandedroll2', (eventInfo) => { console.log("test"); - - let roll = '{{test=[[@{roll_rule}]]}} {{sl=[[0]]}} {{slbonus=[[0>addsl<]]}} {{sladd=[[0]]}} {{slbonusatk=[[0>addsl<]]}} {{modvalue=[[?{@{translation_modifier}|0}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{title=@{prefix2-_spellname}}} {{skill=^{SWORD-DANCING-TEST}}} {{character_name=@{character_name}}} {{target=[[ [[@{cond-}*-1]] [COND] + [[(@{>CharCharCharaddtak<]] [SKILL] + [[@{Advantage}*10>MagAdv<]] [ADV] + ?{@{translation_modifier}|0} [MOD] ]]}} {{skilltest=true}} {{SLmod=[[?{SL Modifier|0}]]}} {{advantage=[[@{AdvantageDisplay}>MagAdv<]]}} {{sitmod=[[0>sitmod<]]}} {{mod1type=[[@{prefix2-_sworddancing_modtype1}]]}} {{mod1=@{prefix2-_sworddancing_mod1}}} {{mod2type=[[@{prefix2-_sworddancing_modtype2}]]}} {{mod2=@{prefix2-_sworddancing_mod2}}} {{sitfail=[[0>sitfail<]]}} {{lore=[[15]]}} {{mod3type=[[@{prefix2-_sworddancing_modtype3}]]}} {{mod3=@{prefix2-_sworddancing_mod3}}} {{reroll=@{RT-reroll}prefix2-_meleetwohandedroll2)}} {{accusdexlsl=[[@{prefix2-_sworddancingaccusl}]]}} {{spellsdnumber=[[@{prefix2-_sworddancingsl}]]}} {{spelldescription=@{prefix2-_blessingdesc}}} {{testoutcome=[[0]]}}'; + + getAttrs(["LastRollAccuExtSL", "Quick_Spell_Mod"], function(v) { + + var accumod = '@{LastRollAccuExtSL}'; + + + let roll = '{{test=[[@{roll_rule}]]}} {{sl=[[0]]}} {{slbonus=[[0>addsl<]]}} {{sladd=[[0]]}} {{slbonusatk=[[0>addsl<]]}} {{modvalue=[[?{@{translation_modifier}|@{prefix2-_sworddancingmod}}]]}} {{unconscious=[[@{UnconsciousMod}]]}} {{title=@{prefix2-_spellname}}} {{skill=^{SWORD-DANCING-TEST}}} {{character_name=@{character_name}}} {{target=[[ [[@{cond-}*-1]] [COND] + [[(@{>CharCharCharaddtak<]] [SKILL] + [[@{Advantage}*10>MagAdv<]] [ADV] + ?{@{translation_modifier}|0} [MOD] ]]}} {{skilltest=true}} {{SLmod=[[?{SL Modifier|0}]]}} {{advantage=[[@{AdvantageDisplay}>MagAdv<]]}} {{sitmod=[[0>sitmod<]]}} {{mod1type=[[@{prefix2-_sworddancing_modtype1}]]}} {{mod1=@{prefix2-_sworddancing_mod1}}} {{mod2type=[[@{prefix2-_sworddancing_modtype2}]]}} {{mod2=@{prefix2-_sworddancing_mod2}}} {{sitfail=[[0>sitfail<]]}} {{lore=[[15]]}} {{mod3type=[[@{prefix2-_sworddancing_modtype3}]]}} {{mod3=@{prefix2-_sworddancing_mod3}}} {{reroll=@{RT-reroll}prefix2-_meleetwohandedroll2)}} {{accusdexlsl=[[@{prefix2-_sworddancingaccusl}]]}} {{spellsdnumber=[[@{prefix2-_sworddancingsl}]]}} {{spellsddesc=@{prefix2-_sddesc}}} {{yenlui=[[@{YenluiState}*30]]}} {{testoutcome=[[0]]}} {{accuchanexl=[[Accu-]]}}'; var trigger = eventInfo.triggerName.slice(52, -5); var triggercap = trigger.toUpperCase(); @@ -52362,9 +52153,7 @@ on('clicked:repeating_divinemiracles:miracle clicked:repeating_divinemiracles:mi var prefix2 = eventInfo.triggerName.slice(8, -20); console.log(eventInfo.triggerName); - console.log(trigger); - console.log(trigger2); - console.log(prefix2); + console.log(accumod); var skillpre = trigger.split('_').slice(-1); var skill = skillpre[0].slice(0, -14); @@ -52372,7 +52161,7 @@ on('clicked:repeating_divinemiracles:miracle clicked:repeating_divinemiracles:mi let rollBegins = '@{Whisper} &{template:whfrp2e}'; let rollPartPart = roll.replaceAll('>Char<', trigger); - let rollPart2 = rollPartPart.replaceAll('>Charcap<', triggercap).replaceAll('prefix-', `${trigger}`).replaceAll('prefix2-', `${prefix2}`).replaceAll('>Skill<', `${skillcap}`); + let rollPart2 = rollPartPart.replaceAll('>Charcap<', triggercap).replaceAll('prefix-', `${trigger}`).replaceAll('prefix2-', `${prefix2}`).replaceAll('>Skill<', `${skillcap}`).replaceAll('Accu-', accumod); cond = '{{cond=[[@{condgen_see_move}-@{DrunkMod}]]}} {{drunk=[[@{DrunkMod}]]}} {{fatigued=[[@{FatiguedMod}]]}} {{broken=[[@{BrokenMod}]]}} {{stuned=[[@{StunedMod}]]}} {{distracted=[[@{DistractedMod}]]}} {{poisoned=[[@{PoisonedMod}]]}} {{prone=[[@{ProneMod}]]}} {{entangled=[[@{EntangledMod}]]}} {{blinded=[[@{BlindedMod}]]}} {{deafened=[[0]]}}'; rollPart = rollPart2.replaceAll('cond-', `condgen_see_move`); @@ -52387,11 +52176,20 @@ on('clicked:repeating_divinemiracles:miracle clicked:repeating_divinemiracles:mi const lore = results.results.lore.result const slbonus = results.results.slbonus.result const slbonusatk = results.results.slbonusatk.result + const accuchanexlsl = results.results.accuchanexl.result + const accusdexlsl = results.results.accusdexlsl.result const SLmod = results.results.SLmod.result const testoutcome = results.results.testoutcome.result + const cn = results.results.spellsdnumber.result const computed = (Math.floor(target / 10) - Math.floor(test / 10)) ; const computed2 = (((test-1)%10)+1) ; - + + cnsl = accuchanexlsl - cn; + + setAttrs({ + "LastRollAccuExtSL": accusdexlsl, + }, {silent: true}); + if ( test <= target ) { var computed3 = computed + SLmod ;} else { var computed3 = computed + SLmod ;} if ( test <= target ) { var computed4 = slbonusatk ;} else { var computed4 = 0 ;} if ( test <= target ) { var computed5 = slbonusatk + SLmod ;} else { var computed5 = SLmod ;} @@ -52402,6 +52200,14 @@ on('clicked:repeating_divinemiracles:miracle clicked:repeating_divinemiracles:mi if ( test <= target ) { outcome = 1; } else { outcome = 0; } } else { outcome = 0; } + if ( computed >= computed3 ) {extsl = computed;} else {extsl = computed3;} + if ( test <= target ) {if ( extsl === 0 ) {extsl += 1;}} + + if (test > target) {extsl = 0;} + extslout = accusdexlsl + extsl; + if (extslout >= cn) {extslout = 0; extdiscout = 1;} else {extdiscout = 0;} + if (extslout < 0) {extslout = accusdexlsl;} + finishRoll( results.rollId, { @@ -52411,41 +52217,26 @@ on('clicked:repeating_divinemiracles:miracle clicked:repeating_divinemiracles:mi slbonusatk: computed4, sladd: computed5, testoutcome: outcome, + accusdexlsl: extdiscout, } ); - }); + getSectionIDs("repeating_sworddancing", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { - getAttrs([`repeating_sworddancing_${id}_MagicLore`], function(v) { - - if(v[`repeating_sworddancing_${id}_MagicLore`] == lore) - { - extslout = accuchanexlsl + extsl; - if (extslout < 0) {extslout = 0;} - output[`repeating_sworddancing_${id}_sworddancingaccusl`] = extslout, setAttrs(output, {silent: true}) - output[`Quick_Spell_AccuSL_${lore}`] = extslout, setAttrs(output, {silent: true}) - } - }); + output[`Quick_Spell_AccuSL_15`] = extslout, setAttrs(output, {silent: true}) + }); - - }); - - - - - + }); }); - + }); on('clicked:repeating_artspecializationr:artspecializationroll clicked:repeating_entertainspecialization:entertainspecializationroll clicked:repeating_ridespecialization:ridespecializationroll clicked:repeating_stealthspecialization:stealthspecializationroll', (eventInfo) => { @@ -54644,15 +54435,16 @@ on('change:Used_Enchanted_Staff change:repeating_spellbookarcane:ExtChannellingL if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingLight})") {checklore = 6;} if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingDeath})") {checklore = 7;} if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingShadows})") {checklore = 8;} - if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingWitch})") {checklore = 9;} - if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingDark})") {checklore = 10;} - if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingChaos})") {checklore = 11;} - if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingGreatMaw})") {checklore = 12;} - if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingMisc})") {checklore = 13;} + if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingHighMagic})") {checklore = 9;} + if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingWitch})") {checklore = 10;} + if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingDark})") {checklore = 11;} + if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingChaos})") {checklore = 12;} + if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingGreatMaw})") {checklore = 13;} + if(t[`repeating_spellbookarcane_${id}_ExtChannellingLore`] === "(@{ChannellingMisc})") {checklore = 14;} if (lorestaff === checklore) { output[`repeating_spellbookarcane_${id}_Used_Enchanted_Staff_show`] = 1, setAttrs(output, {silent: true}) - } else if (lorestaff === 14) { + } else if (lorestaff === 15) { output[`repeating_spellbookarcane_${id}_Used_Enchanted_Staff_show`] = 1, setAttrs(output, {silent: true}) } else { output[`repeating_spellbookarcane_${id}_Used_Enchanted_Staff_show`] = 0, setAttrs(output, {silent: true}) @@ -54675,15 +54467,16 @@ on('change:Used_Enchanted_Staff change:repeating_spellbookarcane:ExtChannellingL if(t[`repeating_spellbookrituals_${id}_ExtChannellingLore`] === "(@{ChannellingLight})") {checklore = 6;} if(t[`repeating_spellbookrituals_${id}_ExtChannellingLore`] === "(@{ChannellingDeath})") {checklore = 7;} if(t[`repeating_spellbookrituals_${id}_ExtChannellingLore`] === "(@{ChannellingShadows})") {checklore = 8;} - if(t[`repeating_spellbookrituals_${id}_ExtChannellingLore`] === "(@{ChannellingWitch})") {checklore = 9;} - if(t[`repeating_spellbookrituals_${id}_ExtChannellingLore`] === "(@{ChannellingDark})") {checklore = 10;} - if(t[`repeating_spellbookrituals_${id}_ExtChannellingLore`] === "(@{ChannellingChaos})") {checklore = 11;} - if(t[`repeating_spellbookrituals_${id}_ExtChannellingLore`] === "(@{ChannellingGreatMaw})") {checklore = 12;} - if(t[`repeating_spellbookrituals_${id}_ExtChannellingLore`] === "(@{ChannellingMisc})") {checklore = 13;} + if(t[`repeating_spellbookrituals_${id}_ExtChannellingLore`] === "(@{ChannellingHighMagic})") {checklore = 9;} + if(t[`repeating_spellbookrituals_${id}_ExtChannellingLore`] === "(@{ChannellingWitch})") {checklore = 10;} + if(t[`repeating_spellbookrituals_${id}_ExtChannellingLore`] === "(@{ChannellingDark})") {checklore = 11;} + if(t[`repeating_spellbookrituals_${id}_ExtChannellingLore`] === "(@{ChannellingChaos})") {checklore = 12;} + if(t[`repeating_spellbookrituals_${id}_ExtChannellingLore`] === "(@{ChannellingGreatMaw})") {checklore = 13;} + if(t[`repeating_spellbookrituals_${id}_ExtChannellingLore`] === "(@{ChannellingMisc})") {checklore = 14;} if (lorestaff === checklore) { output[`repeating_spellbookrituals_${id}_Used_Enchanted_Staff_show`] = 1, setAttrs(output, {silent: true}) - } else if (lorestaff === 14) { + } else if (lorestaff === 15) { output[`repeating_spellbookrituals_${id}_Used_Enchanted_Staff_show`] = 1, setAttrs(output, {silent: true}) } else { output[`repeating_spellbookrituals_${id}_Used_Enchanted_Staff_show`] = 0, setAttrs(output, {silent: true}) @@ -54697,18 +54490,15 @@ on('change:Used_Enchanted_Staff change:repeating_spellbookarcane:ExtChannellingL on("change:repeating_spellbookarcane:UsedSpell1 change:repeating_spellbookarcane:UsedSpell2 change:repeating_spellbookarcane:UsedSpell3", function (event) { if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' const playerclickedid = event.sourceAttribute.split('_')[2] || ''; var trigger = event.triggerName.slice(56); getAttrs(["repeating_spellbookarcane_UsedSpell1","repeating_spellbookarcane_UsedSpell2","repeating_spellbookarcane_UsedSpell3"],function(t) { getSectionIDs("repeating_spellbookarcane", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; const output2 = {}; const output3 = {}; - // loop through the row ids ids.forEach(id => { if (trigger === "1") { @@ -54720,7 +54510,6 @@ on("change:repeating_spellbookarcane:UsedSpell1 change:repeating_spellbookarcane }, {silent: true}); } else { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. output[`repeating_spellbookarcane_${id}_UsedSpell1`] = (playerclickedid.toLowerCase() == id.toLowerCase()) ? 1 : 0; setAttrs(output, {silent: true}); if (t.repeating_spellbookarcane_UsedSpell2*1 === 1) { @@ -54739,7 +54528,6 @@ on("change:repeating_spellbookarcane:UsedSpell1 change:repeating_spellbookarcane }, {silent: true}); } else { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. output[`repeating_spellbookarcane_${id}_UsedSpell2`] = (playerclickedid.toLowerCase() == id.toLowerCase()) ? 1 : 0; setAttrs(output, {silent: true}); if (t.repeating_spellbookarcane_UsedSpell1*1 === 1) { @@ -54758,7 +54546,6 @@ on("change:repeating_spellbookarcane:UsedSpell1 change:repeating_spellbookarcane }, {silent: true}); } else { - // check if the id is the one the player clicked; if not, set to 0, if it is, set to 1. output[`repeating_spellbookarcane_${id}_UsedSpell3`] = (playerclickedid.toLowerCase() == id.toLowerCase()) ? 1 : 0; setAttrs(output, {silent: true}); if (t.repeating_spellbookarcane_UsedSpell2*1 === 1) { @@ -54769,8 +54556,6 @@ on("change:repeating_spellbookarcane:UsedSpell1 change:repeating_spellbookarcane setAttrs(output3, {silent: true});} } } - // now all attributes have been updated, save them - // we use silent:true, so this change doesnt trigger the sheet worker again. getAttrs(["repeating_spellbookarcane_spellname", "repeating_spellbookarcane_spellcastingnumber", "repeating_spellbookarcane_spellchannelsl", "repeating_spellbookarcane_SpellMod", "repeating_spellbookarcane_rep_ID", "Used_Enchanted_Staff", "repeating_spellbookarcane_ExtChannellingLore"], function(v) { @@ -54787,15 +54572,16 @@ on("change:repeating_spellbookarcane:UsedSpell1 change:repeating_spellbookarcane if(v.repeating_spellbookarcane_ExtChannellingLore === "(@{ChannellingLight}) [Light]") {checklore = 6;} if(v.repeating_spellbookarcane_ExtChannellingLore === "(@{ChannellingDeath}) [Death]") {checklore = 7;} if(v.repeating_spellbookarcane_ExtChannellingLore === "(@{ChannellingShadows}) [Shadows]") {checklore = 8;} - if(v.repeating_spellbookarcane_ExtChannellingLore === "(@{ChannellingWitch}) [Witch]") {checklore = 9;} - if(v.repeating_spellbookarcane_ExtChannellingLore === "(@{ChannellingDark}) [Dark]") {checklore = 10;} - if(v.repeating_spellbookarcane_ExtChannellingLore === "(@{ChannellingChaos}) [Chaos]") {checklore = 11;} - if(v.repeating_spellbookarcane_ExtChannellingLore === "(@{ChannellingGreatMaw}) [GreatMaw]") {checklore = 12;} - if(v.repeating_spellbookarcane_ExtChannellingLore === "(@{ChannellingMisc}) [Misc]") {checklore = 13;} + if(v.repeating_spellbookarcane_ExtChannellingLore === "(@{ChannellingHighMagic}) [HighMagic]") {checklore = 9;} + if(v.repeating_spellbookarcane_ExtChannellingLore === "(@{ChannellingWitch}) [Witch]") {checklore = 10;} + if(v.repeating_spellbookarcane_ExtChannellingLore === "(@{ChannellingDark}) [Dark]") {checklore = 11;} + if(v.repeating_spellbookarcane_ExtChannellingLore === "(@{ChannellingChaos}) [Chaos]") {checklore = 12;} + if(v.repeating_spellbookarcane_ExtChannellingLore === "(@{ChannellingGreatMaw}) [GreatMaw]") {checklore = 13;} + if(v.repeating_spellbookarcane_ExtChannellingLore === "(@{ChannellingMisc}) [Misc]") {checklore = 14;} if (lore === checklore) { cnmod = 1; - } else if (lore === 14) { + } else if (lore === 15) { cnmod = 1; } else { cnmod = 0; @@ -55131,12 +54917,12 @@ on('sheet:opened change:Quick_Spell_Lore change:Quick_Spell_LoreMod', function(e if(v.Quick_Spell_Lore === "(@{ChannellingLight})") {lore = 6;} if(v.Quick_Spell_Lore === "(@{ChannellingDeath})") {lore = 7;} if(v.Quick_Spell_Lore === "(@{ChannellingShadows})") {lore = 8;} - if(v.Quick_Spell_Lore === "(@{ChannellingWitch})") {lore = 9;} - if(v.Quick_Spell_Lore === "(@{ChannellingDark})") {lore = 10;} - if(v.Quick_Spell_Lore === "(@{ChannellingChaos})") {lore = 11;} - if(v.Quick_Spell_Lore === "(@{ChannellingGreatMaw})") {lore = 12;} - if(v.Quick_Spell_Lore === "(@{ChannellingMisc})") {lore = 13;} - if(v.Quick_Spell_Lore === "(@{ChannellingHighMagic})") {lore = 14} + if(v.Quick_Spell_Lore === "(@{ChannellingHighMagic})") {lore = 9} + if(v.Quick_Spell_Lore === "(@{ChannellingWitch})") {lore = 10;} + if(v.Quick_Spell_Lore === "(@{ChannellingDark})") {lore = 11;} + if(v.Quick_Spell_Lore === "(@{ChannellingChaos})") {lore = 12;} + if(v.Quick_Spell_Lore === "(@{ChannellingGreatMaw})") {lore = 13;} + if(v.Quick_Spell_Lore === "(@{ChannellingMisc})") {lore = 14;} if(v.Quick_Spell_Lore === "(@{ChannellingSworddancing})") {lore = 15; loremod = 1;} if(v.Quick_Spell_Lore === "(@{Pray})") {lore = 16;} @@ -55225,12 +55011,12 @@ on('clicked:resetQuickSpell', function(event){ "Quick_Spell_AccuSL_11": 0, "Quick_Spell_AccuSL_12": 0, "Quick_Spell_AccuSL_13": 0, + "Quick_Spell_AccuSL_14": 0, + "Quick_Spell_AccuSL_15": 0, }, {silent: true}); getSectionIDs("repeating_spellbookarcane", function (ids) { - // create an object to hold all the attributes we are bout to change const output = {}; - // loop through the row ids ids.forEach(id => { output[`repeating_spellbookarcane_${id}_spellchannelsl`] = 0, setAttrs(output, {silent: true}) @@ -55430,9 +55216,7 @@ on('clicked:CharRoll', function(event){ on('change:race change:racereset', function(event) { - // makes sure the sheet worker doesnt trigger itself if (event.sourceType === 'sheetworker') return; - // get the row id that the player clicked. the id is always between the second and third '_' playerclicked = event.triggerName || '';