on('change:repeating_spells01 change:repeating_spells02 change:repeating_spells03 change:repeating_spells04 change:repeating_spells05' + 'change:repeating_spells06 change:repeating_spells07 change:repeating_spells08 change:repeating_spells09 change:int change:wis change:cha', () => {
const statsallowed = ['int', 'wis', 'cha'];
const spells = [];
const output = {};
getSectionIDs('repeating_spells01', ids_level01 => {
ids_level01.forEach(id => spells.push(`repeating_spells01_${id}_statbonus`));
getSectionIDs('repeating_spells02', ids_level02 => {
ids_level02.forEach(id => spells.push(`repeating_spells02_${id}_statbonus`));
getSectionIDs('repeating_spells03', ids_level03 => {
ids_level03.forEach(id => spells.push(`repeating_spells03_${id}_statbonus`));
getSectionIDs('repeating_spells04', ids_level04 => {
ids_level04.forEach(id => spells.push(`repeating_spells04_${id}_statbonus`));
getSectionIDs('repeating_spells05', ids_level05 => {
ids_level05.forEach(id => spells.push(`repeating_spells05_${id}_statbonus`));
getSectionIDs('repeating_spells06', ids_level06 => {
ids_level06.forEach(id => spells.push(`repeating_spells06_${id}_statbonus`));
getSectionIDs('repeating_spells07', ids_level07 => {
ids_level07.forEach(id => spells.push(`repeating_spells07_${id}_statbonus`));
getSectionIDs('repeating_spells08', ids_level08 => {
ids_level08.forEach(id => spells.push(`repeating_spells08_${id}_statbonus`));
getSectionIDs('repeating_spells09', ids_level09 => {
ids_level09.forEach(id => spells.push(`repeating_spells09_${id}_statbonus`));
getAttrs([...spells, ...statsallowed], values => {
ids_level01.forEach(id => {
const stat = values[`repeating_spells01_${id}_statbonus`];
output[`repeating_spells01_${id}_spellmodifier`] = values[stat];
});
ids_level02.forEach(id => {
const stat = values[`repeating_spells02_${id}_statbonus`];
output[`repeating_spells02_${id}_spellmodifier`] = values[stat];
});
ids_level03.forEach(id => {
const stat = values[`repeating_spells03_${id}_statbonus`];
output[`repeating_spells03_${id}_spellmodifier`] = values[stat];
});
ids_level04.forEach(id => {
const stat = values[`repeating_spells04_${id}_statbonus`];
output[`repeating_spells04_${id}_spellmodifier`] = values[stat];
});
ids_level05.forEach(id => {
const stat = values[`repeating_spells05_${id}_statbonus`];
output[`repeating_spells05_${id}_spellmodifier`] = values[stat];
});
ids_level06.forEach(id => {
const stat = values[`repeating_spells06_${id}_statbonus`];
output[`repeating_spells06_${id}_spellmodifier`] = values[stat];
});
ids_level07.forEach(id => {
const stat = values[`repeating_spells07_${id}_statbonus`];
output[`repeating_spells07_${id}_spellmodifier`] = values[stat];
});
ids_level08.forEach(id => {
const stat = values[`repeating_spells08_${id}_statbonus`];
output[`repeating_spells08_${id}_spellmodifier`] = values[stat];
});
ids_level09.forEach(id => {
const stat = values[`repeating_spells09_${id}_statbonus`];
output[`repeating_spells09_${id}_spellmodifier`] = values[stat];
});
setAttrs(output);
});
});
});
});
});
});
});
});
});
});
});