foundryvtt-wh4-lang-fr-fr/reference_scripts/OEy2lxvic37dRBEt.js

30 lines
623 B
JavaScript
Raw Permalink Normal View History

let filters = [
{
property : "type",
value : "spell"
},
{
property : "system.lore.value",
value : "petty"
}
]
let petty = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 3, "Choose 3 Petty Spells")
filters = [
{
property : "type",
value : "spell"
},
{
property : "system.lore.value",
value : ""
}
]
let arcane = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 3, "Choose 3 Arcane Spells")
let items = petty.concat(arcane).map(i => i.toObject())
this.actor.createEmbeddedDocuments("Item", items);