Add all systems effects scripts + translations
This commit is contained in:
21
reference_scripts/RHyBLYT5oHf7EPnG.js
Normal file
21
reference_scripts/RHyBLYT5oHf7EPnG.js
Normal file
@ -0,0 +1,21 @@
|
||||
let skills = this.actor.itemTypes.skill.filter(i => i.name.includes(game.i18n.localize("NAME.Melee")))
|
||||
|
||||
let skill = await ItemDialog.create(skills, 1, "Select the skill used by the weapon")
|
||||
let group = game.wfrp4e.utility.extractParenthesesText(skill[0]?.name)
|
||||
let groupKey = game.wfrp4e.utility.findKey(group, game.wfrp4e.config.weaponGroups)
|
||||
|
||||
let weapon = {
|
||||
name : this.effect.name,
|
||||
type : "weapon",
|
||||
img : this.effect.img,
|
||||
system : {
|
||||
"damage.value" : this.actor.system.characteristics.wp.bonus,
|
||||
"weaponGroup.value" : groupKey || "basic",
|
||||
"twohanded.value" : ["polearm", "twohanded"].includes(groupKey),
|
||||
"reach.value" : "average",
|
||||
"qualities.value" : [{name : "magical"}]
|
||||
},
|
||||
}
|
||||
|
||||
Item.implementation.create(foundry.utils.expandObject(weapon), {parent : this.actor, fromEffect : this.effect.id})
|
||||
this.script.scriptNotification("Item created. Further customization must be done manually within the Item's sheet");
|
Reference in New Issue
Block a user