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

33 lines
1.5 KiB
JavaScript
Raw Normal View History

2024-05-16 17:57:51 +02:00
const templateMap = {
'P2e7Yx98bK3u110a' : "",
'iuMp3KLaMT2WCmie' : "Xp4r2KUhqfjak8zq",
'RBuYcT5tppwcmnC5' : "wYN19h3WVF1yOVq2",
'vcGpNwNbhvfzVveQ' : "ac5ClOuaYtzOYyWp",
'jmhKZy0w9TzkEK9c' : "IS3LTdTuay6uRHUq",
'9Byj6k7SmdTYis2V' : "LjMlx99gBGeRJUQu",
'laJwc2l9tzJPgaaJ' : "x5wpMprsObuqMCYg",
}
let template = (await game.wfrp4e.tables.rollTable("hireling-templates", {hideDSN: true})).object;
let physicalQuirk = (await game.wfrp4e.tables.rollTable("physical-quirks", {hideDSN: true})).text;
let workEthic = (await game.wfrp4e.tables.rollTable("work-ethic", {hideDSN: true})).text;
let personalityQuirk = (await game.wfrp4e.tables.rollTable("personality-quirks", {hideDSN: true})).text;
2024-10-08 20:52:09 +02:00
let templateItem = await warhammer.utility.findItemId(templateMap[template._id]);
2024-05-16 17:57:51 +02:00
let bio =
`
<p><strong>Template</strong>: ${template.text}</p>
2024-10-08 20:52:09 +02:00
<p><strong>Trait physique</strong>: ${physicalQuirk}</p>
<p><strong>Ethique</strong>: ${workEthic}</p>
<p><strong>Trait de personnalité</strong>: ${personalityQuirk}</p>
2024-05-16 17:57:51 +02:00
`
2024-10-08 20:52:09 +02:00
this.script.message(bio, {whisper : ChatMessage.getWhisperRecipients("GM")})
2024-05-16 17:57:51 +02:00
await this.actor.update({"system.details.gmnotes.value" : bio})
if (templateItem)
{
this.actor.createEmbeddedDocuments("Item", [templateItem.toObject()])
}