Update scripts

This commit is contained in:
2024-10-08 20:52:09 +02:00
parent 1f1d871e53
commit fc4fa1deb5
178 changed files with 12247 additions and 10701 deletions

View File

@ -1,17 +1,7 @@
let choices = await Promise.all([game.wfrp4e.utility.findItemId("1zaqojk0Oq1m8vYv"), game.wfrp4e.utility.findItemId("zIuarD5mB0EF0ji0")])
let items = await game.wfrp4e.apps.ItemDialog.create(choices, 1, "Choisir une arme")
items = items.map(i => i.toObject())
items.forEach(i => equip(i))
this.actor.createEmbeddedDocuments("Item", items);
function equip(item)
{
if (item.type == "armour")
item.data.worn.value = true
else if (item.type == "weapon")
item.data.equipped = true
else if (item.type == "trapping" && item.data.trappingType.value == "clothingAccessories")
item.data.worn = true
}
let choices = await Promise.all([warhammer.utility.findItemId("1zaqojk0Oq1m8vYv"), warhammer.utility.findItemId("zIuarD5mB0EF0ji0")])
let items = await game.wfrp4e.apps.ItemDialog.create(choices, 1, "Choisissez a Weapon")
items = items.map(i => i.toObject())
items.forEach(i => i.system.equipped.value = true);
this.actor.createEmbeddedDocuments("Item", items);