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