Update scripts
This commit is contained in:
38
scripts/tfdKU6nmvUtEjXE2.js
Normal file
38
scripts/tfdKU6nmvUtEjXE2.js
Normal file
@ -0,0 +1,38 @@
|
||||
let choice = await Dialog.wait({
|
||||
title : "Choice",
|
||||
content :
|
||||
`<p>
|
||||
Select your choice
|
||||
</p>
|
||||
`,
|
||||
buttons : {
|
||||
1 : {
|
||||
label : "Shield",
|
||||
callback : () => {
|
||||
return "shield"
|
||||
}
|
||||
},
|
||||
2 : {
|
||||
label : "Two-Handed Weapon",
|
||||
callback : () => {
|
||||
return "twohanded"
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
let weapons = await warhammer.utility.findAllItems("weapon", "Loading Weapons");
|
||||
let items
|
||||
if (choice == "shield")
|
||||
{
|
||||
items = await game.wfrp4e.apps.ItemDialog.create(weapons.filter(i => i.system.properties.qualities.shield), 1, "Choisissez a Shield");
|
||||
}
|
||||
else if (choice == "twohanded")
|
||||
{
|
||||
items = await game.wfrp4e.apps.ItemDialog.create(weapons.filter(i => i.system.weaponGroup.value == "twohanded"), 1, "Choisissez a Two-Handed Weapon");
|
||||
}
|
||||
items = items.map(i => i.toObject())
|
||||
|
||||
items.forEach(i => i.system.equipped.value)
|
||||
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
Reference in New Issue
Block a user