foundryvtt-wh4-lang-fr-fr/scripts/HG2fKOfruT5QV3A4.js

37 lines
944 B
JavaScript
Raw Normal View History

2024-10-08 20:52:09 +02:00
let lore = await ValueDialog.create({text : "Choisissez Lore", title : "Lore"}, "", {"fire" : "Feu", "death" : "Mort", "metal" : "Métal", "shadow" : "Ombres"});
let filters = [
{
property : "type",
value : "spell"
},
{
property : "system.lore.value",
value : "petty"
}
]
let petty = await ItemDialog.createFromFilters(filters, 3, "Choisissez 3 Sorts de Magie Mineure")
filters = [
{
property : "type",
value : "spell"
},
{
property : "system.lore.value",
value : [""]
}
]
let arcane = await ItemDialog.createFromFilters(filters, 6, "Choisissez 6 Sorts de Magie d'Arcane")
let items = petty.map(i => i.toObject()).concat(arcane.map(i => {
let spell = i.toObject();
spell.img = `modules/wfrp4e-core/icons/spells/${lore}.png`
spell.system.lore.value = lore;
return spell;
}));
this.actor.createEmbeddedDocuments("Item", items);