14 lines
616 B
JavaScript
14 lines
616 B
JavaScript
let column = await ValueDialog.create("Selectionnez la colonne pour déterminer la Tête de Bête", "Sélectionner la colonne", "", ["Undivided", "Khorne", "Nurgle", "Slaanesh", "Tzeentch"]);
|
|
|
|
if (column)
|
|
{
|
|
let result = await game.wfrp4e.tables.rollTable("beasthead", {}, column);
|
|
this.script.scriptMessage(`<strong>${result.title}</strong><br>${result.result}`);
|
|
let uuid = `Compendium.${result.object.documentCollection}.${result.object.documentId}`;
|
|
let item = await fromUuid(uuid);
|
|
if (item)
|
|
{
|
|
this.actor.createEmbeddedDocuments("Item", [item])
|
|
this.item.delete();
|
|
}
|
|
} |