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

15 lines
664 B
JavaScript
Raw Permalink Normal View History

2024-05-16 17:57:51 +02:00
let result = await game.wfrp4e.tables.rollTable("gift-of-slaanesh")
if (result.object.documentId && result.object.documentCollection)
{
let item = await fromUuid(`Compendium.${result.object.documentCollection}.${result.object.documentId}`);
if (item)
{
let data = item.toObject();
// Some items need sourceTest for their effects
setProperty(data, "flags.wfrp4e.sourceTest", this.effect.sourceTest);
await this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id});
}
}
this.script.scriptMessage(game.wfrp4e.tables.formatChatRoll("gift-of-slaanesh", {lookup : result.roll, hideDSN: true}));