Skip to content

Commit

Permalink
edit robe/staff scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
moo-man committed Apr 26, 2024
1 parent 58cd4be commit aca959e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 25 deletions.
15 changes: 3 additions & 12 deletions scripts/PeZYj8b0vedyJj00.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,11 @@
let mainEffect = this.item.effects.contents[0];
if (mainEffect.name.includes("(Lore)"))
{
let choice = await ItemDialog.create(ItemDialog.objectToArray({
beasts : game.wfrp4e.config.magicLores["beasts"],
death : game.wfrp4e.config.magicLores["death"],
fire : game.wfrp4e.config.magicLores["fire"],
heavens : game.wfrp4e.config.magicLores["heavens"],
metal : game.wfrp4e.config.magicLores["metal"],
life : game.wfrp4e.config.magicLores["life"],
light : game.wfrp4e.config.magicLores["light"],
shadow : game.wfrp4e.config.magicLores["shadow"]
}, this.item.img), 1, "Choose Lore");
let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, "Choose Lore");
if (choice.length)
{
mainEffect.updateSource({name : mainEffect.name.replace("Lore", choice[0].name)})
this.item.updateSource({name : this.item.name += ` (${choice[0].name})`})
mainEffect.update({name : mainEffect.name.replace("Lore", choice[0].name)})
this.item.update({name : this.item.name += ` (${choice[0].name})`})
}
}

Expand Down
3 changes: 2 additions & 1 deletion scripts/UsuwsmU1TUQLQVM2.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
return !args.spell
let lore = this.effect.name.split("(")[1].split(")")[0].toLowerCase();
return !args.spell || (args.type == "cast" && ["petty", lore].includes(args.spell.system.lore.value));
15 changes: 3 additions & 12 deletions scripts/sB4KB9bT3nQhAoqG.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,11 @@
let mainEffect = this.item.effects.contents[0];
if (mainEffect.name.includes("<Lore>"))
{
let choice = await ItemDialog.create(ItemDialog.objectToArray({
beasts : game.wfrp4e.config.magicLores["beasts"],
death : game.wfrp4e.config.magicLores["death"],
fire : game.wfrp4e.config.magicLores["fire"],
heavens : game.wfrp4e.config.magicLores["heavens"],
metal : game.wfrp4e.config.magicLores["metal"],
life : game.wfrp4e.config.magicLores["life"],
light : game.wfrp4e.config.magicLores["light"],
shadow : game.wfrp4e.config.magicLores["shadow"]
}, this.item.img), 1, "Choose Lore");
let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, "Choose Lore");
if (choice.length)
{
mainEffect.updateSource({name : mainEffect.name.replace("<Lore>", choice[0].name)})
this.item.updateSource({name : this.item.name += ` (${choice[0].name})`})
mainEffect.update({name : mainEffect.name.replace("<Lore>", choice[0].name)})
this.item.update({name : this.item.name += ` (${choice[0].name})`})
}
}

Expand Down

0 comments on commit aca959e

Please sign in to comment.