Ajout de la commande /voyage et grosse MAJK de la commande /auberge

This commit is contained in:
2026-01-07 15:04:49 +01:00
parent c8119601d8
commit f525b6c07a
1329 changed files with 24138 additions and 4397 deletions

View File

@@ -1,4 +1,4 @@
let spells = await warhammer.utility.findAllItems("spell", "Chargement des sorts")
let spells = await warhammer.utility.findAllItems("spell", "Chargement des sorts", true, ["system.lore.value"])
let text = (await game.wfrp4e.tables.rollTable("random-caster", {hideDSN: true})).result
@@ -6,15 +6,15 @@ lore = Array.from(text.matchAll(/{(.+?)}/gm))[0][1]
if (text == "GM's Choice")
{
return this.script.scriptNotification(text)
return this.script.notification(text)
}
if (spellsWithLore.length > 0)
{
let spellsWithLore = spells.filter(i => game.wfrp4e.config.magicLores[i.system.lore.value] == lore)
let selectedSpell = spellsWithLore[Math.floor(CONFIG.Dice.randomUniform() * spellsWithLore.length)]
this.script.scriptNotification(selectedSpell.name);
this.actor.createEmbeddedDocuments("Item", [selectedSpell])
this.script.notification(selectedSpell.name);
this.actor.createEmbeddedDocuments("Item", [(await fromUuid(selectedSpell)).toObject()])
}
else
{