2024-05-16 17:57:51 +02:00
|
|
|
let etiquette = (await fromUuid("Compendium.wfrp4e-core.items.Item.sYbgpSnRqSZWgwFP")).toObject();
|
2024-05-17 01:07:37 +02:00
|
|
|
etiquette.name += ` (Suivants de Tzeentch)`;
|
2024-05-16 17:57:51 +02:00
|
|
|
|
|
|
|
let animosity = (await fromUuid("Compendium.wfrp4e-core.items.Item.0VpT5yubw4UL7j6f")).toObject();
|
2024-05-17 01:07:37 +02:00
|
|
|
animosity.system.specification.value = "Suivants de Nurgle";
|
2024-05-16 17:57:51 +02:00
|
|
|
|
|
|
|
let roll = await new Roll("ceil(1d10 / 3)").roll();
|
|
|
|
|
|
|
|
roll.toMessage(this.script.getChatData());
|
|
|
|
|
|
|
|
let mutations = [];
|
2024-05-17 01:07:37 +02:00
|
|
|
let msg = `<p><strong>Mutations acquises</strong></p>`
|
2024-05-16 17:57:51 +02:00
|
|
|
for(let i = 0; i < roll.total; i++)
|
|
|
|
{
|
|
|
|
let item;
|
|
|
|
let uuid;
|
|
|
|
let result;
|
|
|
|
if (i % 2 == 0)
|
|
|
|
{
|
|
|
|
result = await game.wfrp4e.tables.rollTable("mutatemental", {hideDSN: true}, "Tzeentch")
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
result = await game.wfrp4e.tables.rollTable("mutatephys", {hideDSN: true}, "Tzeentch")
|
|
|
|
}
|
|
|
|
uuid = `Compendium.${result.object.documentCollection}.${result.object.documentId}`;
|
|
|
|
item = await fromUuid(uuid);
|
|
|
|
if (item)
|
|
|
|
{
|
|
|
|
msg += `<p>@UUID[${uuid}]{${item.name}}</p>`
|
|
|
|
mutations.push(item.toObject());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.actor.createEmbeddedDocuments("Item", mutations.concat([etiquette, animosity]), {fromEffect : this.effect.id})
|
|
|
|
this.script.scriptMessage(msg);
|