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

18 lines
494 B
JavaScript
Raw Permalink Normal View History

let table = game.wfrp4e.tables.findTable("mutatemental");
if (!table)
{
ui.notifications.error("Cannot find table with key: mutatemental")
}
let result = (await table.roll()).results[0];
let uuid = `Compendium.${result.documentCollection}.${result.documentId}`
let item = await fromUuid(uuid);
if (item)
{
this.script.scriptNotification(`${item.name} added`)
this.actor.createEmbeddedDocuments("Item", [item])
}
else
{
ui.notifications.error("Item could not be found: " + uuid)
}