diff --git a/mappings/README.md b/mappings/README.md index f5f60ef..654a828 100644 --- a/mappings/README.md +++ b/mappings/README.md @@ -15,4 +15,5 @@ This directory contains mappings created by the community. Feel free to contribu * [Pathfinder 2e (extended)](./pathfinder2e-extended-descriptions.mapping) by `dyoung418#0658` - [PDF](https://drive.google.com/uc?export=download&id=18kg1iXG4NUajc3t4tTUrc4taD2F4tM1j) * [Dungeon Crawl Classics](./0LevelFillableSheet.mapping) by `@OrganicByte#6682` - [PDF](https://goodman-games.com/wp-content/uploads/2021/04/0level_fillable.pdf) * [SWADE - Savage Worlds Adventure Edition](./SWADE-SavageWorldsAdventureEdition.mapping) by `@Samcho#8710` - [PDF](https://peginc.com/store/savage-worlds-character-sheet-pdf-swade/) -* [Starfinder](./sfrpg.mapping) by `@Beff#1513` - [PDF](https://cdn.discordapp.com/attachments/877667041119731734/1076448094897573928/Autofillable_CharacterSheet.pdf) \ No newline at end of file +* [Starfinder](./sfrpg.mapping) by `@Beff#1513` - [PDF](https://cdn.discordapp.com/attachments/877667041119731734/1076448094897573928/Autofillable_CharacterSheet.pdf) +* [D&D 5e - Italian](./dnd5e_ITA.mapping) by `@Bembe83` [PDF](https://gitlab.com/bembe83/file-repository/-/raw/main/D_D_5e_Scheda_Personaggio_FoundryVTT.pdf?inline=false) diff --git a/mappings/dnd5e_ITA.mapping b/mappings/dnd5e_ITA.mapping new file mode 100644 index 0000000..ff86970 --- /dev/null +++ b/mappings/dnd5e_ITA.mapping @@ -0,0 +1,459 @@ +/* PDF: https://gitlab.com/bembe83/file-repository/-/raw/main/D_D_5e_Scheda_Personaggio_FoundryVTT.pdf?inline=false */ +[ + /* Page #1 */ + { "pdf": "ClassLevel", "foundry": @items.filter(i => i.type === 'class').map(i => `${i.name} ${i.system.levels}`).join(' / ') }, + { "pdf": "Background", "foundry": @items.find((item)=>item.type==='background').name }, + { "pdf": "PlayerName", "foundry": Object.entries(@ownership).filter(entry => entry[1] === 3).map(entry => entry[0]).map(id => !game.users.get(id)?.isGM ? game.users.get(id)?.name : null).filter(x => x).join(", ") }, + { "pdf": "CharacterName", "foundry": @name }, + { "pdf": "Race", "foundry": @system.details.race }, + { "pdf": "Alignment", "foundry": @system.details.alignment }, + { "pdf": "XP", "foundry": @system.details.xp.value }, + { "pdf": "Inspiration", "foundry": @system.attributes.inspiration ? "x" : "" }, + { "pdf": "STR", "foundry": @system.abilities.str.value }, + { "pdf": "ProfBonus", "foundry": @system.attributes.prof }, + { "pdf": "AC", "foundry": @system.attributes.ac.value }, + { "pdf": "Initiative", "foundry": @system.attributes.init.total }, + { "pdf": "Speed", "foundry": (function() { + const mo = actor.system.attributes.movement; + const mt = Object.entries(game.dnd5e.config.movementTypes).map(e => e[0]); + const ma = Object.entries(mo).filter(e => e[1] && mt.includes(e[0])); + if (mo.walk && ma?.length === 1) { + return `${ma[0][1]}${mo.units}${mo.hover ? "\n(hover)" : ""}`; + } else { + return ma.map(m => `${m[0].substring(0,2)}:${m[1]}${mo.units}`).join('\n').concat(mo.hover ? "\n(hover)" : ""); + } + })() + }, + { "pdf": "PersonalityTraits", "foundry": (function(h) { + const d = document.createElement("div"); + d.innerHTML = h; + return d.textContent || d.innerText || ""; + })(@system.details.trait) + }, + { "pdf": "STRmod", "foundry": @system.abilities.str.mod }, + { "pdf": "ST Strength", "foundry": @system.abilities.str.save }, + { "pdf": "DEX", "foundry": @system.abilities.dex.value }, + { "pdf": "Ideals", "foundry": (function(h) { + const d = document.createElement("div"); + d.innerHTML = h; + return d.textContent || d.innerText || ""; + })(@system.details.ideal) + }, + { "pdf": "DEXmod", "foundry": @system.abilities.dex.mod }, + { "pdf": "Bonds", "foundry": (function(h) { + const d = document.createElement("div"); + d.innerHTML = h; + return d.textContent || d.innerText || ""; + })(@system.details.bond) + }, + { "pdf": "CON", "foundry": @system.abilities.con.value }, + { "pdf": "HDTotal", "foundry": @system.attributes.hd }, + { "pdf": "Check Box 12", "foundry": @system.attributes.death.success }, + { "pdf": "Check Box 13", "foundry": @system.attributes.death.success }, + { "pdf": "Check Box 14", "foundry": @system.attributes.death.success }, + { "pdf": "CONmod", "foundry": @system.abilities.con.mod }, + { "pdf": "Check Box 15", "foundry": @system.attributes.death.failure }, + { "pdf": "Check Box 16", "foundry": @system.attributes.death.failure }, + { "pdf": "Check Box 17", "foundry": @system.attributes.death.failure }, + { "pdf": "HD", "foundry": @system.attributes.hd }, + { "pdf": "Flaws", "foundry": (function(h) { + const d = document.createElement("div"); + d.innerHTML = h; + return d.textContent || d.innerText || ""; + })(@system.details.flaw) + }, + { "pdf": "INT", "foundry": @system.abilities.int.value }, + { "pdf": "ST Dexterity", "foundry": @system.abilities.dex.save }, + { "pdf": "ST Constitution", "foundry": @system.abilities.con.save }, + { "pdf": "ST Intelligence", "foundry": @system.abilities.int.save }, + { "pdf": "ST Wisdom", "foundry": @system.abilities.wis.save }, + { "pdf": "ST Charisma", "foundry": @system.abilities.cha.save }, + { "pdf": "Acrobatics", "foundry": @system.skills.acr.total }, + { "pdf": "Animal", "foundry": @system.skills.ani.total }, + { "pdf": "Athletics", "foundry": @system.skills.ath.total }, + { "pdf": "Deception", "foundry": @system.skills.dec.total }, + { "pdf": "History", "foundry": @system.skills.his.total }, + { "pdf": "Wpn Name", "foundry": @items.filter(i => i.type === 'weapon' && i.system.equipped && i.hasAttack && i.hasDamage)[0]?.name || "" }, + { "pdf": "Wpn1 AtkBonus", "foundry": @items.filter(i => i.type === 'weapon' && i.system.equipped && i.hasAttack && i.hasDamage)[0]?.labels.toHit.replace(/^\+ $/,"0") || "" }, + { "pdf": "Wpn1 Damage", "foundry": (function() { + const dda = Array.from(actor.itemTypes.weapon.filter(i => i.system.equipped && i.hasAttack && i.hasDamage))?.[0]?.labels.derivedDamage; + return !dda ? "" : dda.map(dd => `${dd.formula || ""} ${game.dnd5e.config.damageTypes[dd.damageType]}`).join('\n'); + })() + }, + { "pdf": "Insight", "foundry": @system.skills.ins.total }, + { "pdf": "Intimidation", "foundry": @system.skills.itm.total }, + { "pdf": "Wpn Name 2", "foundry": @items.filter(i => i.type === 'weapon' && i.system.equipped && i.hasAttack && i.hasDamage)[1]?.name || "" }, + { "pdf": "Wpn2 AtkBonus", "foundry": @items.filter(i => i.type === 'weapon' && i.system.equipped && i.hasAttack && i.hasDamage)[1]?.labels.toHit.replace(/^\+ $/,"0") || "" }, + { "pdf": "Wpn Name 3", "foundry": @items.filter(i => i.type === 'weapon' && i.system.equipped && i.hasAttack && i.hasDamage)[2]?.name || "" }, + { "pdf": "Wpn3 AtkBonus", "foundry": @items.filter(i => i.type === 'weapon' && i.system.equipped && i.hasAttack && i.hasDamage)[2]?.labels.toHit.replace(/^\+ $/,"0") || "" }, + { "pdf": "STRprof", "foundry": @system.abilities.str.proficient }, + { "pdf": "DEXprof", "foundry": @system.abilities.dex.proficient }, + { "pdf": "CONprof", "foundry": @system.abilities.con.proficient }, + { "pdf": "INTprof", "foundry": @system.abilities.int.proficient }, + { "pdf": "WISprof", "foundry": @system.abilities.wis.proficient }, + { "pdf": "CHAprof", "foundry": @system.abilities.cha.proficient }, + { "pdf": "INTmod", "foundry": @system.abilities.int.mod }, + { "pdf": "Wpn2 Damage", "foundry": (function() { + const dda = Array.from(actor.itemTypes.weapon.filter(i => i.system.equipped && i.hasAttack && i.hasDamage))?.[1]?.labels.derivedDamage; + return !dda ? "" : dda.map(dd => `${dd.formula || ""} ${game.dnd5e.config.damageTypes[dd.damageType]}`).join('\n'); + })() + }, + { "pdf": "Investigation", "foundry": @system.skills.inv.total }, + { "pdf": "WIS", "foundry": @system.abilities.wis.value }, + { "pdf": "Arcana", "foundry": @system.skills.arc.total }, + { "pdf": "Perception", "foundry": @system.skills.prc.total }, + { "pdf": "WISmod", "foundry": @system.abilities.wis.mod }, + { "pdf": "CHA", "foundry": @system.abilities.cha.value }, + { "pdf": "Nature", "foundry": @system.skills.nat.total }, + { "pdf": "Performance", "foundry": @system.skills.prf.total }, + { "pdf": "Medicine", "foundry": @system.skills.med.total }, + { "pdf": "Religion", "foundry": @system.skills.rel.total }, + { "pdf": "Stealth", "foundry": @system.skills.ste.total }, + { "pdf": "ACROP", "foundry": @system.skills.acr.value }, + { "pdf": "ANIMP", "foundry": @system.skills.ani.value }, + { "pdf": "ARCP", "foundry": @system.skills.arc.value }, + { "pdf": "ATHP", "foundry": @system.skills.ath.value }, + { "pdf": "DECP", "foundry": @system.skills.dec.value }, + { "pdf": "HISTP", "foundry": @system.skills.his.value }, + { "pdf": "INSP", "foundry": @system.skills.ins.value }, + { "pdf": "INTIP", "foundry": @system.skills.itm.value }, + { "pdf": "INVP", "foundry": @system.skills.inv.value }, + { "pdf": "MEDP", "foundry": @system.skills.med.value }, + { "pdf": "NATP", "foundry": @system.skills.nat.value }, + { "pdf": "PERCP", "foundry": @system.skills.prc.value }, + { "pdf": "PERFP", "foundry": @system.skills.prf.value }, + { "pdf": "PERSP", "foundry": @system.skills.per.value }, + { "pdf": "RELP", "foundry": @system.skills.rel.value }, + { "pdf": "SLEP", "foundry": @system.skills.slt.value }, + { "pdf": "STLTHP", "foundry": @system.skills.ste.value }, + { "pdf": "SURVP", "foundry": @system.skills.sur.value }, + { "pdf": "Persuasion", "foundry": @system.skills.per.total }, + { "pdf": "HPMax", "foundry": @system.attributes.hp.max }, + { "pdf": "HPCurrent", "foundry": @system.attributes.hp.value }, + { "pdf": "HPTemp", "foundry": @system.attributes.hp.temp }, + { "pdf": "Wpn3 Damage", "foundry": (function() { + const dda = Array.from(actor.itemTypes.weapon.filter(i => i.system.equipped && i.hasAttack && i.hasDamage))?.[2]?.labels.derivedDamage; + return !dda ? "" : dda.map(dd => `${dd.formula || ""} ${game.dnd5e.config.damageTypes[dd.damageType]}`).join('\n'); + })() + }, + { "pdf": "SleightofHand", "foundry": @system.skills.slt.total }, + { "pdf": "CHamod", "foundry": @system.abilities.cha.mod }, + { "pdf": "Survival", "foundry": @system.skills.sur.total }, + { "pdf": "AttacksSpellcasting", "foundry": "" }, + { "pdf": "Passive", "foundry": @system.skills.prc.passive }, + { "pdf": "CP", "foundry": @system.currency.cp || "" }, + { "pdf": "ProficienciesLang", "foundry": (function() { + let s = ""; + let obj = window.translate("Weapons","en", game.i18n.lang); + let a = @system.traits.weaponProf.value.map(x => game.dnd5e.config.weaponProficiencies[x] + || game.packs.get("dnd5e.items").index.get(game.dnd5e.config.weaponIds[x])?.name).first(); + let b = @system.traits.weaponProf.custom.split(";").filter(x => String(x) && x?.length); + if (a?.length > 0) { s = `${s}${obj}: ${a} ${b.join(', ')}\n`; } + obj = window.translate("Armor","en", game.i18n.lang); + a = Array.from(@system.traits.armorProf.value.map(x => game.dnd5e.config.armorProficiencies[x] + || game.packs.get("dnd5e.items").index.get(game.dnd5e.config.armorIds[x])?.name)).join(', '); + b = @system.traits.armorProf.custom.split(";").filter(x => String(x) && x?.length); + if (a?.length > 0) { s = `${s}${obj}: ${a} ${b.join(', ')}\n`; } + obj = window.translate("Tools","en", game.i18n.lang); + a = Object.keys(@system.tools).map(x => game.dnd5e.config.toolProficiencies[x] + || game.packs.get("dnd5e.items").index.get(game.dnd5e.config.toolIds[x])?.name).join(', '); + b = [];/*@system.traits.toolProf.custom.split(";").filter(x => String(x) && x?.length);*/ + if (a?.length > 0) { s = `${s}${obj}: ${a} ${b.join(', ')}\n`; } + a = Array.from(@system.traits.languages.value.map(x => game.dnd5e.config.languages[x])).join(', '); + b = @system.traits.languages.custom.split(";").filter(x => String(x) && x?.length); + obj = window.translate("Languages","en", game.i18n.lang); + if (a?.length > 0) { s = `${s}${obj}: ${a} ${b.join(', ')}\n`; } + return s; + })() + }, + { "pdf": "SP", "foundry": @system.currency.sp || "" }, + { "pdf": "EP", "foundry": @system.currency.ep || "" }, + { "pdf": "GP", "foundry": @system.currency.gp || "" }, + { "pdf": "PP", "foundry": @system.currency.pp || "" }, + { "pdf": "Equipment", "foundry": @items.filter(i => ['weapon', 'equipment', 'tool'].includes(i.type)).map(i => (i.system.quantity <= 1) ? i.name : `${i.name} (${i.system.quantity})`).join(', ') }, + { "pdf": "Features and Traits", "foundry": @items.filter(i => ["feat", "trait"].includes(i.type)).slice(0, 16).map(i => `${i.name} - ${i.system.source}: \n${((h) => { + const d = document.createElement("div"); + d.innerHTML = h; + return d.textContent || d.innerText || ""; + })(i.system.description.value.substring(0,299))}${(i.system.description.value.length>300)?'...':''}\n`).join("\n") + }, + + /* Page #2 */ + + { "pdf": "CharacterName 2", "foundry": @name || "" }, + { "pdf": "Age", "foundry": @system.details.age || "" }, + { "pdf": "Height", "foundry": @system.details.height || "" }, + { "pdf": "Weight", "foundry": @system.details.weight || "" }, + { "pdf": "Eyes", "foundry": @system.details.eyes || "" }, + { "pdf": "Skin", "foundry": @system.details.skin || "" }, + { "pdf": "Hair", "foundry": @system.details.hair || "" }, + { "pdf": "Text1", "foundry": (function(h) { + const d = document.createElement("div"); + d.innerHTML = h; + return d.textContent || d.innerText || ""; + })(@system.details.appearance) }, + { "pdf": "Faction Image", "foundry": "" }, /* Images are not supported */ + { "pdf": "Allies", "foundry": "" }, /* There is no field for this on the Foundry character sheet */ + { "pdf": "FactionName", "foundry": "" }, /* There is no field for this on the Foundry character sheet */ + { "pdf": "Backstory", "foundry": (function(h) { + const d = document.createElement("div"); + d.innerHTML = h; + return d.textContent || d.innerText || ""; + })(@system.details.biography.value) + }, + { "pdf": "Feat+Traits", "foundry": @items.filter(i => ['feat', 'trait'].includes(i.type)).slice(16).map(i => `${i.name} - ${i.system.source}`).join('\n') }, + { "pdf": "Treasure", "foundry": @items.filter(i => ['backpack', 'consumable', 'loot'].includes(i.type)).map(i => (i.system.quantity <= 1) ? i.name : `${i.name} (${i.system.quantity})`).join(', ') }, + + /* Page #3 */ + { "pdf": "Spellcasting Class 2", "foundry": @items.filter(i => i.type === 'class').map(i => `${i.name}`).join(' / ') }, /* Doesn't work with multiple classes properly */ + { "pdf": "SpellcastingAbility 2", "foundry": (function(h) { + const sel = document.getElementsByName("system.attributes.spellcasting")[0]; + console.log(sel); + return sel.options[sel.selectedIndex].text || h || ""; + })(@system.attributes.spellcasting.capitalize()) + }, + { "pdf": "SpellSaveDC 2", "foundry": @system.attributes.spelldc || "" }, + { "pdf": "SpellAtkBonus 2", "foundry": "+" + String(@system.attributes.spelldc - 8) }, /* Doesn't account for negative values */ + /* Spellslots Max + counts */ + { "pdf": "SlotsTotal 19", "foundry": @system.spells.spell1.max || "" }, + { "pdf": "SlotsRemaining 19", "foundry": @system.spells.spell1.value || "" }, + { "pdf": "SlotsTotal 20", "foundry": @system.spells.spell2.max || "" }, + { "pdf": "SlotsRemaining 20", "foundry": @system.spells.spell2.value || "" }, + { "pdf": "SlotsTotal 21", "foundry": @system.spells.spell3.max || "" }, + { "pdf": "SlotsRemaining 21", "foundry": @system.spells.spell3.value || "" }, + { "pdf": "SlotsTotal 22", "foundry": @system.spells.spell4.max || "" }, + { "pdf": "SlotsRemaining 22", "foundry": @system.spells.spell4.value || "" }, + { "pdf": "SlotsTotal 23", "foundry": @system.spells.spell5.max || "" }, + { "pdf": "SlotsRemaining 23", "foundry": @system.spells.spell5.value || "" }, + { "pdf": "SlotsTotal 24", "foundry": @system.spells.spell6.max || "" }, + { "pdf": "SlotsRemaining 24", "foundry": @system.spells.spell6.value || "" }, + { "pdf": "SlotsTotal 25", "foundry": @system.spells.spell7.max || "" }, + { "pdf": "SlotsRemaining 25", "foundry": @system.spells.spell7.value || "" }, + { "pdf": "SlotsTotal 26", "foundry": @system.spells.spell8.max || "" }, + { "pdf": "SlotsRemaining 26", "foundry": @system.spells.spell8.value || "" }, + { "pdf": "SlotsTotal 27", "foundry": @system.spells.spell9.max || "" }, + { "pdf": "SlotsRemaining 27", "foundry": @system.spells.spell9.value || "" }, + /* Cantrips */ + { "pdf": "Spells 1014", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 0).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[0] || "" }, + { "pdf": "Spells 1016", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 0).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[1] || "" }, + { "pdf": "Spells 1017", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 0).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[2] || "" }, + { "pdf": "Spells 1018", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 0).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[3] || "" }, + { "pdf": "Spells 1019", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 0).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[4] || "" }, + { "pdf": "Spells 1020", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 0).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[5] || "" }, + { "pdf": "Spells 1021", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 0).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[6] || "" }, + { "pdf": "Spells 1022", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 0).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[7] || "" }, + /* 1st Level Spells */ + { "pdf": "Spells 101014", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[0] || "" }, + { "pdf": "Spells 1015", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[1] || "" }, + { "pdf": "Spells 1023", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[2] || "" }, + { "pdf": "Spells 1024", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[3] || "" }, + { "pdf": "Spells 1025", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[4] || "" }, + { "pdf": "Spells 1026", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[5] || "" }, + { "pdf": "Spells 1027", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[6] || "" }, + { "pdf": "Spells 1028", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[7] || "" }, + { "pdf": "Spells 1029", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[8] || "" }, + { "pdf": "Spells 1030", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[9] || "" }, + { "pdf": "Spells 1031", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[10] || "" }, + { "pdf": "Spells 1032", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[11] || "" }, + { "pdf": "Spells 1033", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[12] || "" }, + + { "pdf": "Check Box 2510", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[0]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 251", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[1]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 309", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[2]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3010", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[3]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3011", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[4]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3012", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[5]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3013", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[6]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3014", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[7]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3015", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[8]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3016", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[9]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3017", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[10]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3018", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[11]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3019", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[12]?.system.preparation.prepared || "" }, + + /* 2nd Level Spells */ + { "pdf": "Spells 1046", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[0] || "" }, + { "pdf": "Spells 1034", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[1] || "" }, + { "pdf": "Spells 1035", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[2] || "" }, + { "pdf": "Spells 1036", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[3] || "" }, + { "pdf": "Spells 1037", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[4] || "" }, + { "pdf": "Spells 1038", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[5] || "" }, + { "pdf": "Spells 1039", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[6] || "" }, + { "pdf": "Spells 1040", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[7] || "" }, + { "pdf": "Spells 1041", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[8] || "" }, + { "pdf": "Spells 1042", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[9] || "" }, + { "pdf": "Spells 1043", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[10] || "" }, + { "pdf": "Spells 1044", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[11] || "" }, + { "pdf": "Spells 1045", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[12] || "" }, + + { "pdf": "Check Box 313", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2)[0]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 310", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2)[1]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3020", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2)[2]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3021", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2)[3]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3022", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2)[4]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3023", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2)[5]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3024", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2)[6]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3025", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2)[7]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3026", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2)[8]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3027", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2)[9]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3028", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2)[10]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3029", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2)[11]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3030", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2)[12]?.system.preparation.prepared || "" }, + + /* 3rd Level Spells */ + { "pdf": "Spells 1048", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[0] || "" }, + { "pdf": "Spells 1047", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[1] || "" }, + { "pdf": "Spells 1049", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[2] || "" }, + { "pdf": "Spells 1050", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[3] || "" }, + { "pdf": "Spells 1051", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[4] || "" }, + { "pdf": "Spells 1052", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[5] || "" }, + { "pdf": "Spells 1053", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[6] || "" }, + { "pdf": "Spells 1054", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[7] || "" }, + { "pdf": "Spells 1055", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[8] || "" }, + { "pdf": "Spells 1056", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[9] || "" }, + { "pdf": "Spells 1057", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[10] || "" }, + { "pdf": "Spells 1058", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[11] || "" }, + { "pdf": "Spells 1059", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[12] || "" }, + + { "pdf": "Check Box 315", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3)[0]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 314", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3)[1]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3031", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3)[2]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3032", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3)[3]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3033", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3)[4]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3034", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3)[5]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3035", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3)[6]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3036", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3)[7]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3037", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3)[8]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3038", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3)[9]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3039", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3)[10]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3040", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3)[11]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3041", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3)[12]?.system.preparation.prepared || "" }, + + /* 4th Level Spells */ + { "pdf": "Spells 1061", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[0] || "" }, + { "pdf": "Spells 1060", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[1] || "" }, + { "pdf": "Spells 1062", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[2] || "" }, + { "pdf": "Spells 1063", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[3] || "" }, + { "pdf": "Spells 1064", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[4] || "" }, + { "pdf": "Spells 1065", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[5] || "" }, + { "pdf": "Spells 1066", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[6] || "" }, + { "pdf": "Spells 1067", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[7] || "" }, + { "pdf": "Spells 1068", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[8] || "" }, + { "pdf": "Spells 1069", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[9] || "" }, + { "pdf": "Spells 1070", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[10] || "" }, + { "pdf": "Spells 1071", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[11] || "" }, + { "pdf": "Spells 1072", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[12] || "" }, + + { "pdf": "Check Box 317", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4)[0]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 316", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4)[1]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3042", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4)[2]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3043", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4)[3]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3044", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4)[4]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3045", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4)[5]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3046", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4)[6]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3047", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4)[7]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3048", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4)[8]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3049", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4)[9]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3050", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4)[10]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3051", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4)[11]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3052", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4)[12]?.system.preparation.prepared || "" }, + + /* 5th Level Spells */ + { "pdf": "Spells 1074", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[0] || "" }, + { "pdf": "Spells 1073", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[1] || "" }, + { "pdf": "Spells 1075", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[2] || "" }, + { "pdf": "Spells 1076", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[3] || "" }, + { "pdf": "Spells 1077", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[4] || "" }, + { "pdf": "Spells 1078", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[5] || "" }, + { "pdf": "Spells 1079", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[6] || "" }, + { "pdf": "Spells 1080", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[7] || "" }, + { "pdf": "Spells 1081", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[8] || "" }, + + { "pdf": "Check Box 319", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5)[0]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 318", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5)[1]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3053", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5)[2]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3054", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5)[3]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3055", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5)[4]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3056", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5)[5]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3057", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5)[6]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3058", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5)[7]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3059", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5)[8]?.system.preparation.prepared || "" }, + + /* 6th Level Spells */ + { "pdf": "Spells 1083", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[0] || "" }, + { "pdf": "Spells 1082", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[1] || "" }, + { "pdf": "Spells 1084", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[2] || "" }, + { "pdf": "Spells 1085", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[3] || "" }, + { "pdf": "Spells 1086", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[4] || "" }, + { "pdf": "Spells 1087", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[5] || "" }, + { "pdf": "Spells 1088", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[6] || "" }, + { "pdf": "Spells 1089", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[7] || "" }, + { "pdf": "Spells 1090", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[8] || "" }, + + { "pdf": "Check Box 321", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6)[0]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 320", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6)[1]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3060", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6)[2]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3061", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6)[3]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3062", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6)[4]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3063", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6)[5]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3064", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6)[6]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3065", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6)[7]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3066", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6)[8]?.system.preparation.prepared || "" }, + + /* 7th Level Spells */ + { "pdf": "Spells 1092", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[0] || "" }, + { "pdf": "Spells 1091", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[1] || "" }, + { "pdf": "Spells 1093", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[2] || "" }, + { "pdf": "Spells 1094", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[3] || "" }, + { "pdf": "Spells 1095", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[4] || "" }, + { "pdf": "Spells 1096", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[5] || "" }, + { "pdf": "Spells 1097", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[6] || "" }, + { "pdf": "Spells 1098", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[7] || "" }, + { "pdf": "Spells 1099", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[8] || "" }, + + { "pdf": "Check Box 323", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7)[0]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 322", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7)[1]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3067", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7)[2]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3068", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7)[3]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3069", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7)[4]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3070", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7)[5]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3071", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7)[6]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3072", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7)[7]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3073", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7)[8]?.system.preparation.prepared || "" }, + + /* 8th Level Spells */ + { "pdf": "Spells 10101", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[0] || "" }, + { "pdf": "Spells 10100", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[1] || "" }, + { "pdf": "Spells 10102", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[2] || "" }, + { "pdf": "Spells 10103", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[3] || "" }, + { "pdf": "Spells 10104", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[4] || "" }, + { "pdf": "Spells 10105", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[5] || "" }, + { "pdf": "Spells 10106", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[6] || "" }, + + { "pdf": "Check Box 325", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8)[0]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 324", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8)[1]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3074", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8)[2]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3075", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8)[3]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3076", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8)[4]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3077", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8)[5]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3078", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8)[6]?.system.preparation.prepared || "" }, + + /* 9th Level Spells */ + { "pdf": "Spells 10108", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[0] || "" }, + { "pdf": "Spells 10107", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[1] || "" }, + { "pdf": "Spells 10109", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[2] || "" }, + { "pdf": "Spells 101010", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[3] || "" }, + { "pdf": "Spells 101011", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[4] || "" }, + { "pdf": "Spells 101012", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[5] || "" }, + { "pdf": "Spells 101013", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9).map(x => x.name + " - " + (x.system.components.vocal?"V":"") + (x.system.components.somatic?"S":"") + (x.system.components.material?"M":"") + (x.system.components.ritual?"R":"") + (x.system.components.concentration?"C":"")).sort()[6] || "" }, + + { "pdf": "Check Box 327", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9)[0]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 326", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9)[1]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3079", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9)[2]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3080", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9)[3]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3081", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9)[4]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3082", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9)[5]?.system.preparation.prepared || "" }, + { "pdf": "Check Box 3083", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9)[6]?.system.preparation.prepared || "" }, + + { "pdf": "", "foundry": "" } +] diff --git a/scripts/pdfsheet.js b/scripts/pdfsheet.js index 8e5be85..666f654 100644 --- a/scripts/pdfsheet.js +++ b/scripts/pdfsheet.js @@ -32,6 +32,22 @@ Hooks.on("init", () => { }, }); } + + window.translate = function(sourceText, sourceLang, targetLang){ + $.ajaxSetup({ + async: false + }); + var retString = ""; + if(sourceText) { + console.log(sourceText); + var url = "https://translate.googleapis.com/translate_a/single?client=gtx&sl="+ sourceLang + "&tl=" + targetLang + "&dt=t&q=" + encodeURI(sourceText); + $.getJSON(url, function(data) { + retString = data[0][0][0]; + }); + console.log(retString); + } + return retString; + } }); // Inject editor into the settings menu