2024-10-25 11:14:29 +02:00
|
|
|
let careers = await warhammer.utility.findAllItems("career", "", true);
|
2024-05-16 17:57:51 +02:00
|
|
|
careers.forEach(c => {
|
|
|
|
if (!c.id)
|
|
|
|
{
|
|
|
|
c.id = c._id;
|
|
|
|
}
|
|
|
|
});
|
2024-05-17 01:07:37 +02:00
|
|
|
let choice = await ItemDialog.create(careers, 1, "Choisissez la carrière de votre double identité");
|
2024-05-16 17:57:51 +02:00
|
|
|
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})`})
|
|
|
|
}
|