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

17 lines
543 B
JavaScript

let careers = await game.wfrp4e.utility.findAll("career", "", true);
careers.forEach(c => {
if (!c.id)
{
c.id = c._id;
}
});
let choice = await ItemDialog.create(careers, 1, "Choose Double Life Career");
if (choice[0])
{
let career = await fromUuid(choice[0].uuid);
let data = career.toObject();
setProperty(data, "flags.wfrp4e.doubleLife", true);
this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id})
this.effect.updateSource({name : this.effect.name + ` (${data.name})`})
}