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

13 lines
600 B
JavaScript
Raw Permalink Normal View History

2024-10-25 11:14:29 +02:00
let spells = await warhammer.utility.findAllItems("spell", "Chargement des sorts", true);
2024-05-16 17:57:51 +02:00
let choice = await ItemDialog.create(spells, 1);
if (choice[0])
{
this.script.scriptMessage(`Choisir @UUID[${choice[0].uuid}]{${choice[0].name}}`)
2024-05-16 17:57:51 +02:00
let spell = (await fromUuid(choice[0].uuid)).toObject(); // Might be an index so retrieve item object for sure
setProperty(spell, "flags.wfrp4e.boonOfTzeentch", true);
spell.system.wind.value = "Focalisation (Dhar)";
2024-05-16 17:57:51 +02:00
spell.system.memorized.value = true;
this.actor.createEmbeddedDocuments("Item", [spell], {fromEffect: this.effect.id})
}