Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: most DnD Exports does not work #120

Open
1 task done
dave-bp opened this issue Dec 18, 2023 · 6 comments
Open
1 task done

[Bug]: most DnD Exports does not work #120

dave-bp opened this issue Dec 18, 2023 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@dave-bp
Copy link

dave-bp commented Dec 18, 2023

Expected Behavior

I select the mapping, click on expert, select in mapping mentioned PDF => get filled PDF

Current Behavior

If i try to export my DnD Character, the most of the mappings bring the error
grafik
The only DnD Mapping which works is the mapping for "charakterbogen_ataendler_v2.8.1.pdf".

Log:
grafik

Steps to Reproduce

  1. go to settings
  2. set Mapping to a DnD Sheept except the ataendler
  3. save
  4. download PDF which is mentioned in the mapping
  5. open DnD player Char
  6. Export to PDF
  7. select downloaded pdf
  8. -> Error

Context

No response

Version

0.24.9

Foundry VTT Version

11.315

Operating System

Windows 10

Browser / App

Firefox

Game System

DnD 5e

Modules Disabled

  • I can confirm that disabling all of my other modules doesn't fix this issue.
@dave-bp dave-bp added the bug Something isn't working label Dec 18, 2023
@fverdoja
Copy link

fverdoja commented Dec 23, 2023

Can confirm, same issue here, only the ataendler mapping exports correctly.

I can provide the json of one of sheets that fails to export if it can help.

Version

0.24.9

Foundry VTT Version

11.315

Game System

DnD5e 2.4.1

@fverdoja
Copy link

fverdoja commented Dec 23, 2023

I can provide the json of one of sheets that fails to export if it can help.

Here it is: fvtt-Actor-jebeddo-dei-mari-Ixby2TiGJNDB3KBu.json

@davelamorte
Copy link

Like I said in other posts, the workaround is simple, delete any extra language. If you only leave "common" it works.
I don't know anything how to fix the issue on the code.. otherwise I would have done myself; I found out about the workaround after a little testing weeks ago!

@ALXLight
Copy link

ALXLight commented Dec 29, 2023

The problem is the languages is not a straight map but an object, so line
" a = @ system.traits.languages.value.map(x => game.dnd5e.config.languages[x]).first();"
wont work.
It shold be rewritten ro recoursive search for getting obj[x] if it is string or dive deeper for f(obj[x].children).

UPD.
Managed to get it work for 'dnd5eV11extended'.

replaced
a = @ system.traits.languages.value.map(x => game.dnd5e.config.languages[x]).first();
by

function findValRecursively(m, x)
{
  for(let k in m)
  {
    if(k == x)
      return m[k];
    if(m[k] instanceof Object){
      let res = findValRecursively(m[k].children, x);
      if (res) 
      return res;
    }
  }
}
a =  @ system.traits.languages.value.map(x => findValRecursively(game.dnd5e.config.languages,x)).first();

Not sure if it is a good way but it works for me

@shinkei13
Copy link

In addition to the fix shown from @ALXLight above, I was having a similar issue with spells refusing to import, however you can fix it by replacing every instance of:
x.system.components.vocal with x.system.properties.has("vocal")
x.system.components.somatic with x.system.properties.has("somatic")
x.system.components.material with x.system.properties.has("material")
x.system.components.ritual with x.system.properties.has("ritual")
x.system.components.concentration with x.system.properties.has("concentration")

Here's a complete version of dnd5eV11 that I was able to get working:

/* PDF: https://media.wizards.com/2016/dnd/downloads/5E_CharacterSheet_Fillable.pdf */
[
  /* Page #1 */
  { "pdf": "ClassLevel", "foundry": @items.filter(i => i.type === 'class').map(i => `${i.name} ${i.system.levels}`).join(' / ') },
  { "pdf": "Background", "foundry": (@system.details.background ? @system.details.background : (@items.find((item)=>item.type==='background')?.name ? @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": (function() {
    const theWeapon = actor.items.filter(i => i.type === 'weapon' && i.system.equipped && i.hasAttack && i.hasDamage)[0];
    theWeapon?.prepareFinalAttributes();
    return theWeapon?.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": (function() {
    const theWeapon = actor.items.filter(i => i.type === 'weapon' && i.system.equipped && i.hasAttack && i.hasDamage)[1];
    theWeapon?.prepareFinalAttributes();
    return theWeapon?.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": (function() {
    const theWeapon = actor.items.filter(i => i.type === 'weapon' && i.system.equipped && i.hasAttack && i.hasDamage)[2];
    theWeapon?.prepareFinalAttributes();
    return theWeapon?.labels?.toHit?.replace(/^\+ $/,"0") || ""
    })()
  },
  { "pdf": "Check Box 11", "foundry": @system.abilities.str.proficient },
  { "pdf": "Check Box 18", "foundry": @system.abilities.dex.proficient },
  { "pdf": "Check Box 19", "foundry": @system.abilities.con.proficient },
  { "pdf": "Check Box 20", "foundry": @system.abilities.int.proficient },
  { "pdf": "Check Box 21", "foundry": @system.abilities.wis.proficient },
  { "pdf": "Check Box 22", "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.per.total },
  { "pdf": "Medicine", "foundry": @system.skills.med.total },
  { "pdf": "Religion", "foundry": @system.skills.rel.total },
  { "pdf": "Stealth", "foundry": @system.skills.ste.total },
  { "pdf": "Check Box 23", "foundry": @system.skills.acr.value },
  { "pdf": "Check Box 24", "foundry": @system.skills.ani.value },
  { "pdf": "Check Box 25", "foundry": @system.skills.arc.value },
  { "pdf": "Check Box 26", "foundry": @system.skills.ath.value },
  { "pdf": "Check Box 27", "foundry": @system.skills.dec.value },
  { "pdf": "Check Box 28", "foundry": @system.skills.his.value },
  { "pdf": "Check Box 29", "foundry": @system.skills.ins.value },
  { "pdf": "Check Box 30", "foundry": @system.skills.itm.value },
  { "pdf": "Check Box 31", "foundry": @system.skills.inv.value },
  { "pdf": "Check Box 32", "foundry": @system.skills.med.value },
  { "pdf": "Check Box 33", "foundry": @system.skills.nat.value },
  { "pdf": "Check Box 34", "foundry": @system.skills.prc.value },
  { "pdf": "Check Box 35", "foundry": @system.skills.prf.value },
  { "pdf": "Check Box 36", "foundry": @system.skills.per.value },
  { "pdf": "Check Box 37", "foundry": @system.skills.rel.value },
  { "pdf": "Check Box 38", "foundry": @system.skills.slt.value },
  { "pdf": "Check Box 39", "foundry": @system.skills.ste.value },
  { "pdf": "Check Box 40", "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 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}Weapons: ${a} ${b.join(', ')}\n`; }
      a = @system.traits.armorProf.value.map(x => game.dnd5e.config.armorProficiencies[x]
        || game.packs.get("dnd5e.items").index.get(game.dnd5e.config.armorIds[x])?.name).first();
      b = @system.traits.armorProf.custom.split(";").filter(x => String(x) && x?.length);
      if (a?.length > 0) { s = `${s}Armor: ${a} ${b.join(', ')}\n`; }
      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(",");
        console.log(a);
      if (a?.length > 0) { s = `${s}Tools: ${a} \n`; }
      function findValRecursively(m, x)
{
  for(let k in m)
  {
    if(k == x)
      return m[k];
    if(m[k] instanceof Object){
      let res = findValRecursively(m[k].children, x);
      if (res) 
      return res;
    }
  }
}
a =  @ system.traits.languages.value.map(x => findValRecursively(game.dnd5e.config.languages,x)).first();
      b = @system.traits.languages.custom.split(";").filter(x => String(x) && x?.length);
      if (a?.length > 0) { s = `${s}Languages: ${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": @flags["tidy5e-sheet"]?.age || "" },
  { "pdf": "Height", "foundry": @flags["tidy5e-sheet"]?.height || "" },
  { "pdf": "Weight", "foundry": @flags["tidy5e-sheet"]?.weight || "" },
  { "pdf": "Eyes", "foundry": @flags["tidy5e-sheet"]?.eyes || "" },
  { "pdf": "Skin", "foundry": @flags["tidy5e-sheet"]?.skin || "" },
  { "pdf": "Hair", "foundry": @flags["tidy5e-sheet"]?.hair || "" },
  { "pdf": "Faction Symbol 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": @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.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[0] || "" },
  { "pdf": "Spells 1016", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 0).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[1] || "" },
  { "pdf": "Spells 1017", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 0).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[2] || "" },
  { "pdf": "Spells 1018", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 0).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[3] || "" },
  { "pdf": "Spells 1019", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 0).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[4] || "" },
  { "pdf": "Spells 1020", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 0).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[5] || "" },
  { "pdf": "Spells 1021", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 0).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[6] || "" },
  { "pdf": "Spells 1022", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 0).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[7] || "" },
  /* 1st Level Spells */
  { "pdf": "Spells 1015", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[0] || "" },
  { "pdf": "Spells 1023", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[1] || "" },
  { "pdf": "Spells 1024", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[2] || "" },
  { "pdf": "Spells 1025", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[3] || "" },
  { "pdf": "Spells 1026", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[4] || "" },
  { "pdf": "Spells 1027", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[5] || "" },
  { "pdf": "Spells 1028", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[6] || "" },
  { "pdf": "Spells 1029", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[7] || "" },
  { "pdf": "Spells 1030", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[8] || "" },
  { "pdf": "Spells 1031", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[9] || "" },
  { "pdf": "Spells 1032", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[10] || "" },
  { "pdf": "Spells 1033", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1).map(x => x.name + " " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[11] || "" },

  { "pdf": "Check Box 251", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[0]?.system.preparation.prepared || "" },
  { "pdf": "Check Box 309", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[1]?.system.preparation.prepared || "" },
  { "pdf": "Check Box 3010", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[2]?.system.preparation.prepared || "" },
  { "pdf": "Check Box 3011", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[3]?.system.preparation.prepared || "" },
  { "pdf": "Check Box 3012", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[4]?.system.preparation.prepared || "" },
  { "pdf": "Check Box 3013", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[5]?.system.preparation.prepared || "" },
  { "pdf": "Check Box 3014", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[6]?.system.preparation.prepared || "" },
  { "pdf": "Check Box 3015", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[7]?.system.preparation.prepared || "" },
  { "pdf": "Check Box 3016", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[8]?.system.preparation.prepared || "" },
  { "pdf": "Check Box 3017", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[9]?.system.preparation.prepared || "" },
  { "pdf": "Check Box 3018", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[10]?.system.preparation.prepared || "" },
  { "pdf": "Check Box 3019", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 1)[11]?.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.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[0] || "" },
  { "pdf": "Spells 1034", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[1] || "" },
  { "pdf": "Spells 1035", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[2] || "" },
  { "pdf": "Spells 1036", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[3] || "" },
  { "pdf": "Spells 1037", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[4] || "" },
  { "pdf": "Spells 1038", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[5] || "" },
  { "pdf": "Spells 1039", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[6] || "" },
  { "pdf": "Spells 1040", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[7] || "" },
  { "pdf": "Spells 1041", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[8] || "" },
  { "pdf": "Spells 1042", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[9] || "" },
  { "pdf": "Spells 1043", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[10] || "" },
  { "pdf": "Spells 1044", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[11] || "" },
  { "pdf": "Spells 1045", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 2).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("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.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[0] || "" },
  { "pdf": "Spells 1047", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[1] || "" },
  { "pdf": "Spells 1049", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[2] || "" },
  { "pdf": "Spells 1050", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[3] || "" },
  { "pdf": "Spells 1051", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[4] || "" },
  { "pdf": "Spells 1052", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[5] || "" },
  { "pdf": "Spells 1053", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[6] || "" },
  { "pdf": "Spells 1054", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[7] || "" },
  { "pdf": "Spells 1055", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[8] || "" },
  { "pdf": "Spells 1056", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[9] || "" },
  { "pdf": "Spells 1057", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[10] || "" },
  { "pdf": "Spells 1058", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[11] || "" },
  { "pdf": "Spells 1059", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 3).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("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.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[0] || "" },
  { "pdf": "Spells 1060", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[1] || "" },
  { "pdf": "Spells 1062", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[2] || "" },
  { "pdf": "Spells 1063", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[3] || "" },
  { "pdf": "Spells 1064", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[4] || "" },
  { "pdf": "Spells 1065", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[5] || "" },
  { "pdf": "Spells 1066", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[6] || "" },
  { "pdf": "Spells 1067", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[7] || "" },
  { "pdf": "Spells 1068", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[8] || "" },
  { "pdf": "Spells 1069", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[9] || "" },
  { "pdf": "Spells 1070", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[10] || "" },
  { "pdf": "Spells 1071", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[11] || "" },
  { "pdf": "Spells 1072", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 4).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("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.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[0] || "" },
  { "pdf": "Spells 1073", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[1] || "" },
  { "pdf": "Spells 1075", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[2] || "" },
  { "pdf": "Spells 1076", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[3] || "" },
  { "pdf": "Spells 1077", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[4] || "" },
  { "pdf": "Spells 1078", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[5] || "" },
  { "pdf": "Spells 1079", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[6] || "" },
  { "pdf": "Spells 1080", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[7] || "" },
  { "pdf": "Spells 1081", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 5).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("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.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[0] || "" },
  { "pdf": "Spells 1082", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[1] || "" },
  { "pdf": "Spells 1084", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[2] || "" },
  { "pdf": "Spells 1085", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[3] || "" },
  { "pdf": "Spells 1086", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[4] || "" },
  { "pdf": "Spells 1087", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[5] || "" },
  { "pdf": "Spells 1088", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[6] || "" },
  { "pdf": "Spells 1089", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[7] || "" },
  { "pdf": "Spells 1090", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 6).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("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.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[0] || "" },
  { "pdf": "Spells 1091", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[1] || "" },
  { "pdf": "Spells 1093", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[2] || "" },
  { "pdf": "Spells 1094", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[3] || "" },
  { "pdf": "Spells 1095", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[4] || "" },
  { "pdf": "Spells 1096", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[5] || "" },
  { "pdf": "Spells 1097", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[6] || "" },
  { "pdf": "Spells 1098", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[7] || "" },
  { "pdf": "Spells 1099", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 7).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("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.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[0] || "" },
  { "pdf": "Spells 10100", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[1] || "" },
  { "pdf": "Spells 10102", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[2] || "" },
  { "pdf": "Spells 10103", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[3] || "" },
  { "pdf": "Spells 10104", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[4] || "" },
  { "pdf": "Spells 10105", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[5] || "" },
  { "pdf": "Spells 10106", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 8).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("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.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[0] || "" },
  { "pdf": "Spells 10107", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[1] || "" },
  { "pdf": "Spells 10109", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[2] || "" },
  { "pdf": "Spells 101010", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[3] || "" },
  { "pdf": "Spells 101011", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[4] || "" },
  { "pdf": "Spells 101012", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("concentration")?"C":"")).sort()[5] || "" },
  { "pdf": "Spells 101013", "foundry": @items.filter(i => i.type === 'spell' && i.system.level === 9).map(x => x.name + " - " + (x.system.properties.has("vocal")?"V":"") + (x.system.properties.has("somatic")?"S":"") + (x.system.properties.has("material")?"M":"") + (x.system.properties.has("ritual")?"R":"") + (x.system.properties.has("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": "" }
]

@davelamorte
Copy link

Yes, unfortunately it only works some times (I'd say one out of 5) with the current Foundry v12.331 and DND 5e 4.3.3... and now the error isn't the languages, I can't figure out what it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants