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

18 lines
512 B
JavaScript
Raw Permalink Normal View History

2024-05-16 17:57:51 +02:00
let table = game.wfrp4e.tables.findTable("mutatemental");
if (!table)
{
ui.notifications.error("Impossible de trouver la table des Mutations Mentales")
2024-05-16 17:57:51 +02:00
}
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("Impossible de trouver l'item: " + uuid)
2024-05-16 17:57:51 +02:00
}