From a308181834007667a13b2542f94725d8b859e8dc Mon Sep 17 00:00:00 2001
From: LeRatierBretonnien ${this.actor.prototypeToken.name} has
+
+
+ It’s up to Ranald if their regenerating can outpace their poisoning.
When all Poisoned Conditions are lost, so too is Regenerate.
`, + { whisper: ChatMessage.getWhisperRecipients("GM"), blind: true }) diff --git a/reference_scripts/04bAiHISSW53w94Y.js b/reference_scripts/04bAiHISSW53w94Y.js new file mode 100644 index 0000000..2909e9f --- /dev/null +++ b/reference_scripts/04bAiHISSW53w94Y.js @@ -0,0 +1 @@ +this.actor.addCondition("blinded", 3) \ No newline at end of file diff --git a/reference_scripts/06IaVCOC0RCJbxEf.js b/reference_scripts/06IaVCOC0RCJbxEf.js new file mode 100644 index 0000000..b2f49cb --- /dev/null +++ b/reference_scripts/06IaVCOC0RCJbxEf.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.8piWcBKFlQ2J1E3A") +let data = item.toObject(); +data.system.location.key= this.item.system.location.key +this.actor.createEmbeddedDocuments("Item", [data]) \ No newline at end of file diff --git a/reference_scripts/09sSpnW8z2zcVEdf.js b/reference_scripts/09sSpnW8z2zcVEdf.js new file mode 100644 index 0000000..7079a3c --- /dev/null +++ b/reference_scripts/09sSpnW8z2zcVEdf.js @@ -0,0 +1,5 @@ +if (!args.flags.quietenedApplied) +{ + args.fields.modifier += 10; + args.flags.quietenedApplied = true +} \ No newline at end of file diff --git a/reference_scripts/0BP5l7bIkf744G1k.js b/reference_scripts/0BP5l7bIkf744G1k.js new file mode 100644 index 0000000..22f117a --- /dev/null +++ b/reference_scripts/0BP5l7bIkf744G1k.js @@ -0,0 +1 @@ +return !args.options.terror && !args.extendedTest?.flags.wfrp4e?.fear \ No newline at end of file diff --git a/reference_scripts/0FNOq4J1AdPd2A0q.js b/reference_scripts/0FNOq4J1AdPd2A0q.js new file mode 100644 index 0000000..ed69d87 --- /dev/null +++ b/reference_scripts/0FNOq4J1AdPd2A0q.js @@ -0,0 +1 @@ +return !args.skill?.name.includes(game.i18n.localize("NAME.Row")) && !args.skill?.name.includes(game.i18n.localize("NAME.Sail")); \ No newline at end of file diff --git a/reference_scripts/0FWto1oEr3jbWggw.js b/reference_scripts/0FWto1oEr3jbWggw.js new file mode 100644 index 0000000..cf49a45 --- /dev/null +++ b/reference_scripts/0FWto1oEr3jbWggw.js @@ -0,0 +1,22 @@ +let spells = await game.wfrp4e.utility.findAll("spell", "Loading Spells") + +let text = (await game.wfrp4e.tables.rollTable("random-caster", {hideDSN: true})).result + +lore = Array.from(text.matchAll(/{(.+?)}/gm))[0][1] + +if (text == "GM's Choice") +{ + return this.script.scriptNotification(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]) +} +else +{ + ui.notifications.notify(`Could not find ${lore} spell. Try Again`) +} \ No newline at end of file diff --git a/reference_scripts/0KG3HoTNoZhaINIj.js b/reference_scripts/0KG3HoTNoZhaINIj.js new file mode 100644 index 0000000..195442f --- /dev/null +++ b/reference_scripts/0KG3HoTNoZhaINIj.js @@ -0,0 +1,6 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.4CMKeDTDrRQZbPIJ") +let fixation = (await game.wfrp4e.tables.rollTable("fixations")) +let data = item.toObject(); +data.system.specification.value = fixation.result; +this.item.updateSource({name : this.item.name += ` (${fixation.result})`}); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/0LCQtsiK2aUfYRmD.js b/reference_scripts/0LCQtsiK2aUfYRmD.js new file mode 100644 index 0000000..8bdb4ef --- /dev/null +++ b/reference_scripts/0LCQtsiK2aUfYRmD.js @@ -0,0 +1 @@ +return !["t", "wp"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/0R0QAr3D024kWPfo.js b/reference_scripts/0R0QAr3D024kWPfo.js new file mode 100644 index 0000000..1158f1b --- /dev/null +++ b/reference_scripts/0R0QAr3D024kWPfo.js @@ -0,0 +1,18 @@ +let table = game.wfrp4e.tables.findTable("mutatephys"); +if (!table) +{ + return ui.notifications.error("Mutation table not found, please ensure a table with the `mutatephys` key is imported in the world.") +} +let result = (await table.roll()).results[0]; +let uuid = `Compendium.${result.documentCollection}.${result.documentId}` +let item = await fromUuid(uuid); + +if (item) +{ + this.script.scriptNotification(`${item.name} added`) + this.actor.createEmbeddedDocuments("Item", [item]) +} +else +{ + ui.notifications.error("Item could not be found: " + uuid) +} \ No newline at end of file diff --git a/reference_scripts/0Uly7OmkH0zqYbxQ.js b/reference_scripts/0Uly7OmkH0zqYbxQ.js new file mode 100644 index 0000000..1f6cc4b --- /dev/null +++ b/reference_scripts/0Uly7OmkH0zqYbxQ.js @@ -0,0 +1,21 @@ +let location = this.item.system.location.key; + +if (location) +{ + let dropped = this.item.system.weaponsAtLocation; + + if (dropped.length) + { + this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(", ")}!`) + for(let weapon of dropped) + { + await weapon.system.toggleEquip(); + } + } +} + +let roll = await new Roll("max(1, 1d10 - @system.characteristics.t.bonus)", this.actor).roll() + +roll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Duration)`})); + +this.effect.updateSource({"duration.rounds" : roll.total}) \ No newline at end of file diff --git a/reference_scripts/0YKQGbsKdHSmYGE7.js b/reference_scripts/0YKQGbsKdHSmYGE7.js new file mode 100644 index 0000000..bb5ad3c --- /dev/null +++ b/reference_scripts/0YKQGbsKdHSmYGE7.js @@ -0,0 +1,9 @@ +if (args.skill?.name != game.i18n.localize("NAME.Gossip")) +{ + return true; +} +else +{ + args.data.canReverse = true; // Kind of a kludge here, the talent Tests has a specific condition, but the description simply says "any gossip test can be reversed" so check it here instead of submission +} + \ No newline at end of file diff --git a/reference_scripts/0abwNjpzo3SbEOeO.js b/reference_scripts/0abwNjpzo3SbEOeO.js new file mode 100644 index 0000000..e114510 --- /dev/null +++ b/reference_scripts/0abwNjpzo3SbEOeO.js @@ -0,0 +1,6 @@ +if (args.applyAP && args.modifiers.ap.metal) +{ + args.modifiers.ap.ignored += args.modifiers.ap.metal + args.modifiers.ap.details.push("" + this.effect.name + ": Ignore Metal (" + args.modifiers.ap.metal + ")"); + args.modifiers.ap.metal = 0 +} \ No newline at end of file diff --git a/reference_scripts/0e0UZT2FodOJDdgW.js b/reference_scripts/0e0UZT2FodOJDdgW.js new file mode 100644 index 0000000..b4db0a3 --- /dev/null +++ b/reference_scripts/0e0UZT2FodOJDdgW.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.GbDyBCu8ZjDp6dkj") +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/0e7OkamNAaAk4Oit.js b/reference_scripts/0e7OkamNAaAk4Oit.js new file mode 100644 index 0000000..60cb5c0 --- /dev/null +++ b/reference_scripts/0e7OkamNAaAk4Oit.js @@ -0,0 +1,10 @@ +let item1 = await fromUuid("Compendium.wfrp4e-core.items.3S4OYOZLauXctmev") +let item2 = await fromUuid("Compendium.wfrp4e-core.items.7mCcI3q7hgWcmbBU") + +let data1 = item1.toObject(); +data1.system.location.key = this.item.system.location.key + +let data2 = item2.toObject(); +data2.system.location.key = this.item.system.location.key + +this.actor.createEmbeddedDocuments("Item", [data1, data2], {fromEffect: this.effect.id}) diff --git a/reference_scripts/0iTLDgFHO9Rgc010.js b/reference_scripts/0iTLDgFHO9Rgc010.js new file mode 100644 index 0000000..5d34264 --- /dev/null +++ b/reference_scripts/0iTLDgFHO9Rgc010.js @@ -0,0 +1 @@ +args.fields.modifier -= 20; \ No newline at end of file diff --git a/reference_scripts/0mrUnxzufYgsR0Ph.js b/reference_scripts/0mrUnxzufYgsR0Ph.js new file mode 100644 index 0000000..2c22c29 --- /dev/null +++ b/reference_scripts/0mrUnxzufYgsR0Ph.js @@ -0,0 +1,7 @@ +this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => { + await test.roll() + if (test.failed) + { + this.actor.addCondition("stunned") + } +}) diff --git a/reference_scripts/0vaYwAlMWTmOBl8k.js b/reference_scripts/0vaYwAlMWTmOBl8k.js new file mode 100644 index 0000000..002e76f --- /dev/null +++ b/reference_scripts/0vaYwAlMWTmOBl8k.js @@ -0,0 +1,7 @@ +if (!args.flags.strikeToStun) +{ + args.flags.strikeToStun = true + args.fields.modifier += 20; + args.fields.hitLocation = "head"; +} +args.fields.successBonus++; \ No newline at end of file diff --git a/reference_scripts/0yyofYHeDRQlFliO.js b/reference_scripts/0yyofYHeDRQlFliO.js new file mode 100644 index 0000000..dda0e0e --- /dev/null +++ b/reference_scripts/0yyofYHeDRQlFliO.js @@ -0,0 +1 @@ +return args.options.terror || args.extendedTest?.flags.wfrp4e?.fear \ No newline at end of file diff --git a/reference_scripts/11uCC0mK2uL783al.js b/reference_scripts/11uCC0mK2uL783al.js new file mode 100644 index 0000000..100b843 --- /dev/null +++ b/reference_scripts/11uCC0mK2uL783al.js @@ -0,0 +1,6 @@ +let type = this.item.getFlag("wfrp4e", "breath"); + +if (["fire", "electricity", "poison"].includes(type)) +{ + args.applyAP = false; +} \ No newline at end of file diff --git a/reference_scripts/16nCOByUaSFDym1V.js b/reference_scripts/16nCOByUaSFDym1V.js new file mode 100644 index 0000000..7d16a24 --- /dev/null +++ b/reference_scripts/16nCOByUaSFDym1V.js @@ -0,0 +1 @@ +args.fields.modifier -= 20 diff --git a/reference_scripts/190PHSHKGaJ74wsR.js b/reference_scripts/190PHSHKGaJ74wsR.js new file mode 100644 index 0000000..dd52e55 --- /dev/null +++ b/reference_scripts/190PHSHKGaJ74wsR.js @@ -0,0 +1,31 @@ +if (!this.item.name.includes("(") || this.item.system.tests.value.includes("Terrain")) +{ + let tests = this.item.system.tests.value + let name = this.item.name + + // If name already specifies, make sure tests value reflects that + if (name.includes("(")) + { + let terrain = name.split("(")[1].split(")")[0] + tests = tests.replace("the Terrain", terrain) + } + else // If no sense specified, provide dialog choice + { + let choice = await ItemDialog.create(ItemDialog.objectToArray({ + coastal : "Coastal", + deserts : "Deserts", + marshes : "Marshes", + rocky : "Rocky", + tundra : "Tundra", + woodlands : "Woodlands" + }, this.item.img), 1, "Choose Terrain"); + if (choice[0]) + { + name = `${name.split("(")[0].trim()} (${choice[0].name})` + tests = tests.replace("the Terrain", choice[0].name + " Terrain") + } + } + + this.effect.updateSource({name}) + this.item.updateSource({name, "system.tests.value" : tests}) +} \ No newline at end of file diff --git a/reference_scripts/1A87vGLh2PXH0rG0.js b/reference_scripts/1A87vGLh2PXH0rG0.js new file mode 100644 index 0000000..8a4090c --- /dev/null +++ b/reference_scripts/1A87vGLh2PXH0rG0.js @@ -0,0 +1 @@ +return !args.skill?.name.includes(game.i18n.localize("NAME.Language")); \ No newline at end of file diff --git a/reference_scripts/1BT0MWM2cbhlEnrn.js b/reference_scripts/1BT0MWM2cbhlEnrn.js new file mode 100644 index 0000000..46f9433 --- /dev/null +++ b/reference_scripts/1BT0MWM2cbhlEnrn.js @@ -0,0 +1,40 @@ + let characteristics = { + "ws" : 5, + "bs" : 5, + "s" : 5, + "t" : 0, + "i" : 5, + "ag" : 5, + "dex" : 5, + "int" : 0, + "wp" : 5, + "fel" : 5 + } + let items = [] + + let updateObj = this.actor.toObject(); + + let talents = (await Promise.all([game.wfrp4e.tables.rollTable("talents"), game.wfrp4e.tables.rollTable("talents"), game.wfrp4e.tables.rollTable("talents")])).map(i => i.text) + + for (let ch in characteristics) + { + updateObj.system.characteristics[ch].modifier += characteristics[ch]; + } + + for (let talent of talents) + { + let talentItem = await game.wfrp4e.utility.findTalent(talent) + if (talentItem) + { + items.push(talentItem.toObject()); + } + else + { + ui.notifications.warn(`Could not find ${talent}`, {permanent : true}) + } + } + + + await this.actor.update(updateObj) + this.actor.createEmbeddedDocuments("Item", items); + diff --git a/reference_scripts/1E47r2ba6IGe8uFK.js b/reference_scripts/1E47r2ba6IGe8uFK.js new file mode 100644 index 0000000..f6a8c61 --- /dev/null +++ b/reference_scripts/1E47r2ba6IGe8uFK.js @@ -0,0 +1 @@ +return args.characteristic != "t" \ No newline at end of file diff --git a/reference_scripts/1IodsW9ImamYoEYz.js b/reference_scripts/1IodsW9ImamYoEYz.js new file mode 100644 index 0000000..b72334a --- /dev/null +++ b/reference_scripts/1IodsW9ImamYoEYz.js @@ -0,0 +1 @@ +args.actor.details.move.run += 4 \ No newline at end of file diff --git a/reference_scripts/1JwxZujbDcueLWBL.js b/reference_scripts/1JwxZujbDcueLWBL.js new file mode 100644 index 0000000..133c071 --- /dev/null +++ b/reference_scripts/1JwxZujbDcueLWBL.js @@ -0,0 +1,2 @@ +await this.actor.addCondition("ablaze", 2) +await this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {suppressMsg: true})) \ No newline at end of file diff --git a/reference_scripts/1LDm3OB32skZe6Xv.js b/reference_scripts/1LDm3OB32skZe6Xv.js new file mode 100644 index 0000000..f504f6b --- /dev/null +++ b/reference_scripts/1LDm3OB32skZe6Xv.js @@ -0,0 +1 @@ +return args.characteristic != "wp" \ No newline at end of file diff --git a/reference_scripts/1MDOKny7IirJPoI6.js b/reference_scripts/1MDOKny7IirJPoI6.js new file mode 100644 index 0000000..0826c2c --- /dev/null +++ b/reference_scripts/1MDOKny7IirJPoI6.js @@ -0,0 +1,6 @@ +let test = await this.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : ` ${this.effect.name}`}) +await test.roll() +if (test.succeeded) +{ + this.effect.delete(); +} diff --git a/reference_scripts/1OpT3CXs07XFWWCT.js b/reference_scripts/1OpT3CXs07XFWWCT.js new file mode 100644 index 0000000..4e10bbf --- /dev/null +++ b/reference_scripts/1OpT3CXs07XFWWCT.js @@ -0,0 +1 @@ +args.options.cardsharp = true; \ No newline at end of file diff --git a/reference_scripts/1PQPxFjmRlulHHzo.js b/reference_scripts/1PQPxFjmRlulHHzo.js new file mode 100644 index 0000000..b3f0001 --- /dev/null +++ b/reference_scripts/1PQPxFjmRlulHHzo.js @@ -0,0 +1,5 @@ +if (args.opposedTest.result.hitloc.value == this.item.system.location.key && args.totalWoundLoss > 0) +{ + args.actor.addCondition("bleeding", 2); +} + \ No newline at end of file diff --git a/reference_scripts/1UalUmNzjB4rp3SZ.js b/reference_scripts/1UalUmNzjB4rp3SZ.js new file mode 100644 index 0000000..c76dee9 --- /dev/null +++ b/reference_scripts/1UalUmNzjB4rp3SZ.js @@ -0,0 +1 @@ +return ["ws", "bs", "s", "ag", "t", "dex"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/1ZArMNUI8qqH6zkX.js b/reference_scripts/1ZArMNUI8qqH6zkX.js new file mode 100644 index 0000000..4aaa318 --- /dev/null +++ b/reference_scripts/1ZArMNUI8qqH6zkX.js @@ -0,0 +1,7 @@ +let test = await args.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : " - " + this.effect.name, context : {failure: "Gained a Stunned Condition"}}) +await test.roll(); +if (test.failed) +{ + args.actor.addCondition("stunned") +} + diff --git a/reference_scripts/1ZrzpfVwPJHdwp23.js b/reference_scripts/1ZrzpfVwPJHdwp23.js new file mode 100644 index 0000000..31f227d --- /dev/null +++ b/reference_scripts/1ZrzpfVwPJHdwp23.js @@ -0,0 +1 @@ +this.actor.status.addArmour(1, {source: this.effect, magical : true}) \ No newline at end of file diff --git a/reference_scripts/1exiWlVUHsXDLLAH.js b/reference_scripts/1exiWlVUHsXDLLAH.js new file mode 100644 index 0000000..8cd3baa --- /dev/null +++ b/reference_scripts/1exiWlVUHsXDLLAH.js @@ -0,0 +1 @@ +this.script.scriptNotification(`Cannot enter ${this.effect.name}!`); \ No newline at end of file diff --git a/reference_scripts/1fQr1Dg7DX0vfz3r.js b/reference_scripts/1fQr1Dg7DX0vfz3r.js new file mode 100644 index 0000000..13794a7 --- /dev/null +++ b/reference_scripts/1fQr1Dg7DX0vfz3r.js @@ -0,0 +1,3 @@ +let healed = parseInt(this.effect.sourceTest.result.SL) +this.actor.modifyWounds(healed) +this.script.scriptMessage(`Healed ${healed} Wounds`) \ No newline at end of file diff --git a/reference_scripts/1kB2su7hLRYDhZ2H.js b/reference_scripts/1kB2su7hLRYDhZ2H.js new file mode 100644 index 0000000..5b9bccf --- /dev/null +++ b/reference_scripts/1kB2su7hLRYDhZ2H.js @@ -0,0 +1,19 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : " - " + this.effect.name}) +await test.roll(); +if (!test.succeeded) +{ + let item = await fromUuid("Compendium.wfrp4e-core.items.ZhMADOqoo0y8Q9bx") + let data = item.toObject(); + if (this.item.system.location.key == "rLeg") + { + data.system.location.value = "Right Toe" + data.system.location.key = "rToe"; + } + else if (this.item.system.location.key == "lLeg") + { + data.system.location.value = "Left Toe" + data.system.location.key = "lToe"; + } + this.actor.createEmbeddedDocuments("Item", [data]) +} +this.effect.delete(); \ No newline at end of file diff --git a/reference_scripts/1l7Jz2ZHbAWko7Vm.js b/reference_scripts/1l7Jz2ZHbAWko7Vm.js new file mode 100644 index 0000000..ac7048c --- /dev/null +++ b/reference_scripts/1l7Jz2ZHbAWko7Vm.js @@ -0,0 +1 @@ +args.options.ballockKnife = true; \ No newline at end of file diff --git a/reference_scripts/1mNkLj9JYNr3ofC6.js b/reference_scripts/1mNkLj9JYNr3ofC6.js new file mode 100644 index 0000000..d64facd --- /dev/null +++ b/reference_scripts/1mNkLj9JYNr3ofC6.js @@ -0,0 +1,7 @@ +this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => { + await test.roll(); + if (test.failed) + { + this.actor.addCondition("stunned", 3) + } +}) \ No newline at end of file diff --git a/reference_scripts/1wEjrgff7ASxKVmy.js b/reference_scripts/1wEjrgff7ASxKVmy.js new file mode 100644 index 0000000..ab9e51b --- /dev/null +++ b/reference_scripts/1wEjrgff7ASxKVmy.js @@ -0,0 +1,2 @@ +if (args.effect.conditionId == "bleeding") + args.data.damage -= 1 \ No newline at end of file diff --git a/reference_scripts/1wKVvxRTHOyV4Qdv.js b/reference_scripts/1wKVvxRTHOyV4Qdv.js new file mode 100644 index 0000000..2ea9f2a --- /dev/null +++ b/reference_scripts/1wKVvxRTHOyV4Qdv.js @@ -0,0 +1 @@ +return !args.skill?.name?.includes(game.i18n.localize("NAME.Sail")) \ No newline at end of file diff --git a/reference_scripts/1wrPvP6lJwIAfmsl.js b/reference_scripts/1wrPvP6lJwIAfmsl.js new file mode 100644 index 0000000..1e94116 --- /dev/null +++ b/reference_scripts/1wrPvP6lJwIAfmsl.js @@ -0,0 +1,10 @@ +let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.locations), 1, "Choose Location"); + +let location = choice[0].id; + +let itemTargeted = this.actor.items.get(this.effect.getFlag("wfrp4e", "itemTargets")[0]) + +if (itemTargeted) +{ + itemTargeted.update({[`system.APdamage.${location}`] : itemTargeted.system.APdamage[location] + 1}) +} \ No newline at end of file diff --git a/reference_scripts/1yOvw74jzFfaI87b.js b/reference_scripts/1yOvw74jzFfaI87b.js new file mode 100644 index 0000000..73649e3 --- /dev/null +++ b/reference_scripts/1yOvw74jzFfaI87b.js @@ -0,0 +1 @@ +return args.options.reload diff --git a/reference_scripts/22bW97lkvCqisfHX.js b/reference_scripts/22bW97lkvCqisfHX.js new file mode 100644 index 0000000..5ab83db --- /dev/null +++ b/reference_scripts/22bW97lkvCqisfHX.js @@ -0,0 +1 @@ +return args.type != "channelling" && !args.skill?.name.includes(game.i18n.localize("NAME.Channelling")) \ No newline at end of file diff --git a/reference_scripts/23HgjCB1oecxANvA.js b/reference_scripts/23HgjCB1oecxANvA.js new file mode 100644 index 0000000..275f379 --- /dev/null +++ b/reference_scripts/23HgjCB1oecxANvA.js @@ -0,0 +1,5 @@ +if (args.item.range && args.item.range.bands) +{ +args.item.range.bands[game.i18n.localize("Long Range")].modifier = 0 +args.item.range.bands[game.i18n.localize("Extreme")].modifier /= 2 +} \ No newline at end of file diff --git a/reference_scripts/23vWiHUjxtRQ3Efz.js b/reference_scripts/23vWiHUjxtRQ3Efz.js new file mode 100644 index 0000000..5fdc693 --- /dev/null +++ b/reference_scripts/23vWiHUjxtRQ3Efz.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.eWPN3CV2Eddwz8aM") +let data = item.toObject(); +data.system.location.value = "Back" +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/2AOo7KUyzMrgIlgM.js b/reference_scripts/2AOo7KUyzMrgIlgM.js new file mode 100644 index 0000000..2982f22 --- /dev/null +++ b/reference_scripts/2AOo7KUyzMrgIlgM.js @@ -0,0 +1 @@ +game.wfrp4e.utility.postCorruptionTest(this.item.system.specification.value, {speaker : {alias: this.actor.prototypeToken.name}}) \ No newline at end of file diff --git a/reference_scripts/2AdSBXw7IwCiqawQ.js b/reference_scripts/2AdSBXw7IwCiqawQ.js new file mode 100644 index 0000000..00a7def --- /dev/null +++ b/reference_scripts/2AdSBXw7IwCiqawQ.js @@ -0,0 +1 @@ +return args.skill?.name == game.i18n.localize("NAME.Bribery") || args.skill?.name.includes(game.i18n.localize("NAME.Stealth")); \ No newline at end of file diff --git a/reference_scripts/2Cw5j0iGAnFNegWr.js b/reference_scripts/2Cw5j0iGAnFNegWr.js new file mode 100644 index 0000000..4712207 --- /dev/null +++ b/reference_scripts/2Cw5j0iGAnFNegWr.js @@ -0,0 +1 @@ +return args.item?.system.attackType diff --git a/reference_scripts/2GYAd4OC888oQFBp.js b/reference_scripts/2GYAd4OC888oQFBp.js new file mode 100644 index 0000000..5150b7b --- /dev/null +++ b/reference_scripts/2GYAd4OC888oQFBp.js @@ -0,0 +1 @@ +return !["fel"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/2NLINicPQWbuvp2n.js b/reference_scripts/2NLINicPQWbuvp2n.js new file mode 100644 index 0000000..f98dd93 --- /dev/null +++ b/reference_scripts/2NLINicPQWbuvp2n.js @@ -0,0 +1 @@ +return args.item?.name != game.i18n.localize("NAME.Navigation") \ No newline at end of file diff --git a/reference_scripts/2OqLHRqEBEjBm2LW.js b/reference_scripts/2OqLHRqEBEjBm2LW.js new file mode 100644 index 0000000..1a3189b --- /dev/null +++ b/reference_scripts/2OqLHRqEBEjBm2LW.js @@ -0,0 +1 @@ +args.fields.slBonus += this.actor.system.characteristics.wp.bonus \ No newline at end of file diff --git a/reference_scripts/2Qi1hwLYhdE6v6Hs.js b/reference_scripts/2Qi1hwLYhdE6v6Hs.js new file mode 100644 index 0000000..4983177 --- /dev/null +++ b/reference_scripts/2Qi1hwLYhdE6v6Hs.js @@ -0,0 +1,9 @@ +if (!["rLeg", "lLeg"].includes(this.effect.getFlag("wfrp4e", "location"))) + return true; + +if (args.options.dodge) +{ + args.abort = true; + this.script.scriptNotification("Cannot Dodge!") +} +return ["t", "int", "wp", "fel"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/2VNnVrtktdGUqXEV.js b/reference_scripts/2VNnVrtktdGUqXEV.js new file mode 100644 index 0000000..38a1edd --- /dev/null +++ b/reference_scripts/2VNnVrtktdGUqXEV.js @@ -0,0 +1,9 @@ +if (args.totalWoundLoss > 0) +{ + let test = await args.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) + await test.roll(); + if (test.failed && parseInt(args.opposedTest.attackerTest.result.SL) > 0) + { + args.actor.addCondition("stunned", parseInt(args.opposedTest.attackerTest.result.SL)) + } +} \ No newline at end of file diff --git a/reference_scripts/2W9uMTT6iJhfQ044.js b/reference_scripts/2W9uMTT6iJhfQ044.js new file mode 100644 index 0000000..fb037b9 --- /dev/null +++ b/reference_scripts/2W9uMTT6iJhfQ044.js @@ -0,0 +1,18 @@ +let skill = `Trade (${this.item.parenthesesText})` +let currentCareer = this.actor.system.currentCareer; +let existingSkill = this.actor.itemTypes.skill.find(i => i.name == skill); + +if (!currentCareer) return + + +let inCurrentCareer = currentCareer.system.skills.includes(skill); +if (existingSkill && inCurrentCareer) +{ + existingSkill.system.advances.costModifier = -5; +} +else +{ + currentCareer.system.skills.push(skill); +} + + diff --git a/reference_scripts/2WBq5gW780C6zfCp.js b/reference_scripts/2WBq5gW780C6zfCp.js new file mode 100644 index 0000000..90b4c35 --- /dev/null +++ b/reference_scripts/2WBq5gW780C6zfCp.js @@ -0,0 +1,9 @@ +if (args.weapon && this.item.system.usesLocation(args.weapon)) +{ + args.bleedingHand = true; + let success = await this.effect.manualScripts[0].execute({actor: this.actor}) + if (!success) + { + args.abort = true; + } +} \ No newline at end of file diff --git a/reference_scripts/2WSN306tL4apjRtD.js b/reference_scripts/2WSN306tL4apjRtD.js new file mode 100644 index 0000000..6931737 --- /dev/null +++ b/reference_scripts/2WSN306tL4apjRtD.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.9h82z72XGo9tfgQS") +let data = item.toObject(); +data.name = data.name += " (Hearing)" +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/2cKarG9ToyW2ptCd.js b/reference_scripts/2cKarG9ToyW2ptCd.js new file mode 100644 index 0000000..deb9777 --- /dev/null +++ b/reference_scripts/2cKarG9ToyW2ptCd.js @@ -0,0 +1,10 @@ +if (this.item.system.quantity.value) +{ + this.item.update({"system.quantity.value" : this.item.system.quantity.value - 0.25}) + let actor = Array.from(game.user.targets)[0]?.actor || this.actor; + actor.applyEffect({effectData : [this.item.effects.contents[1].convertToApplied()]}) +} +else +{ + this.script.scriptNotification("None left!", "error") +} \ No newline at end of file diff --git a/reference_scripts/2hzDv8ROulOe1elK.js b/reference_scripts/2hzDv8ROulOe1elK.js new file mode 100644 index 0000000..1a9e5bd --- /dev/null +++ b/reference_scripts/2hzDv8ROulOe1elK.js @@ -0,0 +1 @@ +return args.skill?.name.includes(game.i18n.localize("NAME.Lore")); \ No newline at end of file diff --git a/reference_scripts/2mFNelLOAQ6iJsZl.js b/reference_scripts/2mFNelLOAQ6iJsZl.js new file mode 100644 index 0000000..76ff0b6 --- /dev/null +++ b/reference_scripts/2mFNelLOAQ6iJsZl.js @@ -0,0 +1,4 @@ +if (args.test.isFumble) +{ + args.test.result.other.push("@Table[doomrocket-fumble]") +} \ No newline at end of file diff --git a/reference_scripts/2miWWeRrEpq1beG4.js b/reference_scripts/2miWWeRrEpq1beG4.js new file mode 100644 index 0000000..579cd50 --- /dev/null +++ b/reference_scripts/2miWWeRrEpq1beG4.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.qn4ZpvTQIX4rcJDl"); +let data = item.toObject(); +data.system.location.key = this.item.system.location.key +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id}) diff --git a/reference_scripts/2p9IK6Y5Z4NQD6FY.js b/reference_scripts/2p9IK6Y5Z4NQD6FY.js new file mode 100644 index 0000000..2facb9d --- /dev/null +++ b/reference_scripts/2p9IK6Y5Z4NQD6FY.js @@ -0,0 +1 @@ +args.prefillModifiers.difficulty = "hard" \ No newline at end of file diff --git a/reference_scripts/2rzxQlL7A9ujZ9uK.js b/reference_scripts/2rzxQlL7A9ujZ9uK.js new file mode 100644 index 0000000..b1278eb --- /dev/null +++ b/reference_scripts/2rzxQlL7A9ujZ9uK.js @@ -0,0 +1,6 @@ +if (args.opposedTest.result.winner == "attacker") { + if (args.opposedTest.defenderTest.weapon && args.opposedTest.defenderTest.item.properties.qualities.shield) { + ui.notifications.notify(`${this.effect.name}: Gained ${this.item.Advances} Advantage`) + this.actor.setAdvantage(this.item.Advances) + } +} \ No newline at end of file diff --git a/reference_scripts/2sDH6RvoOAR40oqH.js b/reference_scripts/2sDH6RvoOAR40oqH.js new file mode 100644 index 0000000..6efdf20 --- /dev/null +++ b/reference_scripts/2sDH6RvoOAR40oqH.js @@ -0,0 +1,20 @@ + + +if (!["Goblin", "Orc"].includes(this.actor.system.details.species.value)) { + let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), { appendTitle: ` - ${this.effect.name}` }) + await test.roll(); + if (test.failed) { + let infection = await fromUuid("Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg") + this.actor.createEmbeddedDocuments("Item", [infection]) + } +} + +// Since wounds change when the effect is deleted, need to wait until after +// the max wounds have been recalculated to apply damage +game.wfrp4e.utility.sleep(1000).then(async () => { + let roll = await new Roll("1d10").roll(); + + roll.toMessage(this.script.getChatData()); + this.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true })) + +}) \ No newline at end of file diff --git a/reference_scripts/2vTVR0quRZQtjNfQ.js b/reference_scripts/2vTVR0quRZQtjNfQ.js new file mode 100644 index 0000000..512f2c3 --- /dev/null +++ b/reference_scripts/2vTVR0quRZQtjNfQ.js @@ -0,0 +1,18 @@ +let currentCareer = this.actor.system.currentCareer; +if (!currentCareer) +{ + return; +} + +let talents = ["Aethyric Attunement", +"Arcane Magic (Any)", +"Chaos Magic (Tzeentch)", +"Fast Hands", +"Instinctive Diction", +"Magical Sense", +"Petty Magic", +"Second Sight", +"War Wizard", +"Witch!"].filter(t => !currentCareer.system.talents.includes(t)) + +currentCareer.system.talents = currentCareer.system.talents.concat(talents) \ No newline at end of file diff --git a/reference_scripts/2wk0yrRPlPsdqr3L.js b/reference_scripts/2wk0yrRPlPsdqr3L.js new file mode 100644 index 0000000..20b7014 --- /dev/null +++ b/reference_scripts/2wk0yrRPlPsdqr3L.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.9GNpAqgsKzxZKJpp") +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/2yctEihGmdCfTTVx.js b/reference_scripts/2yctEihGmdCfTTVx.js new file mode 100644 index 0000000..a6d16a1 --- /dev/null +++ b/reference_scripts/2yctEihGmdCfTTVx.js @@ -0,0 +1,2 @@ +args.data.canReverse = true; +args.options.fieldDressing = true; \ No newline at end of file diff --git a/reference_scripts/2zeP2nMSURjxrqYz.js b/reference_scripts/2zeP2nMSURjxrqYz.js new file mode 100644 index 0000000..a0ac1e4 --- /dev/null +++ b/reference_scripts/2zeP2nMSURjxrqYz.js @@ -0,0 +1,6 @@ +let wounds = this.actor.system.status.wounds +if (wounds.value == 0) + return this.script.scriptNotification("No effect at 0 Wounds", "error") + +this.script.scriptNotification(`Healed ${this.actor.characteristics.t.bonus} Wounds`) +await this.actor.modifyWounds(this.actor.characteristics.t.bonus) \ No newline at end of file diff --git a/reference_scripts/33PWizq5F7pkKnQT.js b/reference_scripts/33PWizq5F7pkKnQT.js new file mode 100644 index 0000000..127ff99 --- /dev/null +++ b/reference_scripts/33PWizq5F7pkKnQT.js @@ -0,0 +1,4 @@ +if (args.item.type == "spell") +{ + args.item.cn.value = Math.floor(args.item.cn.value / 2) +} \ No newline at end of file diff --git a/reference_scripts/33US8YRgaMqYu2We.js b/reference_scripts/33US8YRgaMqYu2We.js new file mode 100644 index 0000000..6569e71 --- /dev/null +++ b/reference_scripts/33US8YRgaMqYu2We.js @@ -0,0 +1 @@ +return !args.options.handling \ No newline at end of file diff --git a/reference_scripts/37UN17gb8suFeZIW.js b/reference_scripts/37UN17gb8suFeZIW.js new file mode 100644 index 0000000..145ebc8 --- /dev/null +++ b/reference_scripts/37UN17gb8suFeZIW.js @@ -0,0 +1 @@ +this.script.scriptMessage(await this.actor.applyBasicDamage(8, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true})) \ No newline at end of file diff --git a/reference_scripts/3Cn2TlRahlm5LkSj.js b/reference_scripts/3Cn2TlRahlm5LkSj.js new file mode 100644 index 0000000..c1ee085 --- /dev/null +++ b/reference_scripts/3Cn2TlRahlm5LkSj.js @@ -0,0 +1 @@ +args.fields.successBonus += 1; \ No newline at end of file diff --git a/reference_scripts/3D5ImpMgpOTPucvv.js b/reference_scripts/3D5ImpMgpOTPucvv.js new file mode 100644 index 0000000..d69e334 --- /dev/null +++ b/reference_scripts/3D5ImpMgpOTPucvv.js @@ -0,0 +1,9 @@ +if (args.test.options.cardsharp && args.test.succeeded) +{ + +let SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10) +let ones = Number(args.test.result.roll.toString().split("").pop()) + +if (ones > SL) + args.test.result.other.push(` `) +} \ No newline at end of file diff --git a/reference_scripts/3IGO7xEjRjat937X.js b/reference_scripts/3IGO7xEjRjat937X.js new file mode 100644 index 0000000..f45a41d --- /dev/null +++ b/reference_scripts/3IGO7xEjRjat937X.js @@ -0,0 +1,7 @@ +let fatigue = this.actor.hasCondition("fatigued") +if (fatigue) +{ + this.script.scriptNotification("Removing Fatigued Condition, disabled effect") + this.effect.update({disabled : true}) + await this.actor.removeCondition("fatigued") +} \ No newline at end of file diff --git a/reference_scripts/3JEzEzF1SeYA9lsV.js b/reference_scripts/3JEzEzF1SeYA9lsV.js new file mode 100644 index 0000000..1b8b828 --- /dev/null +++ b/reference_scripts/3JEzEzF1SeYA9lsV.js @@ -0,0 +1,44 @@ +let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.locations, this.effect.img), 1, "Choose Location"); +if (choice[0]) +{ + this.effect.updateSource({name : `${this.effect.name} (${choice[0].name})`}) +this.effect.updateSource({"flags.wfrp4e.location" : choice[0].id}) +} + +let location = choice[0].id; + +if (["lArm", "rArm"].includes(location)) +{ + let dropped = this.actor.itemTypes.weapon.filter(i => i.isEquipped & i.system.usesHands.includes(location)); + + if (dropped.length) + { + this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(", ")}!`) + for(let weapon of dropped) + { + await weapon.system.toggleEquip(); + } + } +} + +if (location == "body") +{ + await this.actor.addCondition("fatigued"); + test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields : {difficulty : "hard"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`}) + await test.roll(); + if (test.failed) + { + this.actor.addCondition("prone"); + } +} + +if (location == "head") +{ + await this.actor.addCondition("stunned"); + test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields : {difficulty : "average"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`}) + await test.roll(); + if (test.failed) + { + this.actor.addCondition("unconscious"); + } +} \ No newline at end of file diff --git a/reference_scripts/3LLiSgj6KGtgqcmo.js b/reference_scripts/3LLiSgj6KGtgqcmo.js new file mode 100644 index 0000000..8a4090c --- /dev/null +++ b/reference_scripts/3LLiSgj6KGtgqcmo.js @@ -0,0 +1 @@ +return !args.skill?.name.includes(game.i18n.localize("NAME.Language")); \ No newline at end of file diff --git a/reference_scripts/3R6Y4NpNTqPc83wh.js b/reference_scripts/3R6Y4NpNTqPc83wh.js new file mode 100644 index 0000000..c0857ab --- /dev/null +++ b/reference_scripts/3R6Y4NpNTqPc83wh.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.IPKRMGry6WotuS1G") +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/3TesBGh8HnlGuafu.js b/reference_scripts/3TesBGh8HnlGuafu.js new file mode 100644 index 0000000..05ab756 --- /dev/null +++ b/reference_scripts/3TesBGh8HnlGuafu.js @@ -0,0 +1,5 @@ +let modifier = this.effect.sourceTest?.result.overcast.usage.other.current || 0 + +let test = await this.actor.setupCharacteristic("dex", {fields: {modifier}, skipTargets: true, appendTitle : " - " + this.script.label}); + +test.roll(); \ No newline at end of file diff --git a/reference_scripts/3Vbe6gdW8N0bIvXJ.js b/reference_scripts/3Vbe6gdW8N0bIvXJ.js new file mode 100644 index 0000000..5bf968e --- /dev/null +++ b/reference_scripts/3Vbe6gdW8N0bIvXJ.js @@ -0,0 +1,5 @@ +if (args.item.type == "weapon" || args.item.type == "trait") +{ + args.item.qualities.value.push({name : "penetrating"}) + args.item.qualities.value.push({name : "impale"}) +} \ No newline at end of file diff --git a/reference_scripts/3aEzK0DehSHtVykd.js b/reference_scripts/3aEzK0DehSHtVykd.js new file mode 100644 index 0000000..9b294f4 --- /dev/null +++ b/reference_scripts/3aEzK0DehSHtVykd.js @@ -0,0 +1 @@ +this.effect.manualScripts[0].execute({actor : this.actor}); \ No newline at end of file diff --git a/reference_scripts/3eSaX0BeaUalNkEP.js b/reference_scripts/3eSaX0BeaUalNkEP.js new file mode 100644 index 0000000..077517d --- /dev/null +++ b/reference_scripts/3eSaX0BeaUalNkEP.js @@ -0,0 +1 @@ +return args.options.mutate \ No newline at end of file diff --git a/reference_scripts/3fdCQ3h3iVuhdDs9.js b/reference_scripts/3fdCQ3h3iVuhdDs9.js new file mode 100644 index 0000000..f3281db --- /dev/null +++ b/reference_scripts/3fdCQ3h3iVuhdDs9.js @@ -0,0 +1 @@ +args.fields.slBonus += this.actor.characteristics.ag.bonus; \ No newline at end of file diff --git a/reference_scripts/3hfMQkUKYI4rCuBy.js b/reference_scripts/3hfMQkUKYI4rCuBy.js new file mode 100644 index 0000000..7cf8f33 --- /dev/null +++ b/reference_scripts/3hfMQkUKYI4rCuBy.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.CharmAnimal") && !args.skill?.name.includes(game.i18n.localize("NAME.AnimalTraining")); \ No newline at end of file diff --git a/reference_scripts/3jm0NoYpgB6ZuUSl.js b/reference_scripts/3jm0NoYpgB6ZuUSl.js new file mode 100644 index 0000000..a7b132e --- /dev/null +++ b/reference_scripts/3jm0NoYpgB6ZuUSl.js @@ -0,0 +1 @@ +args.options.useOnesAttractive = true; \ No newline at end of file diff --git a/reference_scripts/3l7MQSa10Kve2K3P.js b/reference_scripts/3l7MQSa10Kve2K3P.js new file mode 100644 index 0000000..0d12a2b --- /dev/null +++ b/reference_scripts/3l7MQSa10Kve2K3P.js @@ -0,0 +1,2 @@ +this.script.scriptMessage(await this.actor.applyBasicDamage(Math.ceil(CONFIG.Dice.randomUniform() * 10) + 6, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true})) +this.actor.addCondition("ablaze"); \ No newline at end of file diff --git a/reference_scripts/3plV9WFqs2prfAdp.js b/reference_scripts/3plV9WFqs2prfAdp.js new file mode 100644 index 0000000..9ec91ac --- /dev/null +++ b/reference_scripts/3plV9WFqs2prfAdp.js @@ -0,0 +1 @@ +return !["NAME.Evaluate", "NAME.Gamble"].map(i => game.i18n.localize(i)).includes(args.skill?.name) \ No newline at end of file diff --git a/reference_scripts/3sfD1nedXLzuYoXJ.js b/reference_scripts/3sfD1nedXLzuYoXJ.js new file mode 100644 index 0000000..674133f --- /dev/null +++ b/reference_scripts/3sfD1nedXLzuYoXJ.js @@ -0,0 +1,4 @@ +if (this.actor.hasCondition("surprised")) +{ + this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {fields : {difficulty : "average"}, skipTargets: true, appendTitle : " - " + this.effect.name}).then(test => test.roll()) +} diff --git a/reference_scripts/3tE8gFSl28EhCmo5.js b/reference_scripts/3tE8gFSl28EhCmo5.js new file mode 100644 index 0000000..9e28dce --- /dev/null +++ b/reference_scripts/3tE8gFSl28EhCmo5.js @@ -0,0 +1,2 @@ +await args.actor.addCondition("ablaze") +await args.actor.addCondition("prone") \ No newline at end of file diff --git a/reference_scripts/454x3Q95pLvZm0Kx.js b/reference_scripts/454x3Q95pLvZm0Kx.js new file mode 100644 index 0000000..0072c5f --- /dev/null +++ b/reference_scripts/454x3Q95pLvZm0Kx.js @@ -0,0 +1 @@ +return args.skill?.name == game.i18n.localize("NAME.ConsumeAlcohol"); \ No newline at end of file diff --git a/reference_scripts/4FGKZk2f0xrmIDnp.js b/reference_scripts/4FGKZk2f0xrmIDnp.js new file mode 100644 index 0000000..59535fd --- /dev/null +++ b/reference_scripts/4FGKZk2f0xrmIDnp.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.Research") && !args.skill?.name?.includes(game.i18n.localize("NAME.Language")); \ No newline at end of file diff --git a/reference_scripts/4HN98hMdQJxM35pA.js b/reference_scripts/4HN98hMdQJxM35pA.js new file mode 100644 index 0000000..23c0294 --- /dev/null +++ b/reference_scripts/4HN98hMdQJxM35pA.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.gz2xy41OSVZ8YBgI"); +let data = item.toObject(); +data.system.location.key = this.item.system.location.key +this.actor.createEmbeddedDocuments("Item", [data]) diff --git a/reference_scripts/4JVIy5xtVwvadoqv.js b/reference_scripts/4JVIy5xtVwvadoqv.js new file mode 100644 index 0000000..bb85425 --- /dev/null +++ b/reference_scripts/4JVIy5xtVwvadoqv.js @@ -0,0 +1 @@ +this.actor.details.move.run *= 2 \ No newline at end of file diff --git a/reference_scripts/4MQ7u4INxp51oyyR.js b/reference_scripts/4MQ7u4INxp51oyyR.js new file mode 100644 index 0000000..95200bd --- /dev/null +++ b/reference_scripts/4MQ7u4INxp51oyyR.js @@ -0,0 +1,85 @@ +let characteristics = { + "ws" : 25, + "bs" : 10, + "s" : 15, + "t" : 15, + "i" : 25, + "ag" : 20, + "dex" : 0, + "int" : 10, + "wp" : 25, + "fel" : 10 +} +let skills = ["Cool", "Dodge", "Intimidate", "Intuition", "Leadership", "Lore (Warfare)", "Perception"] +let skillAdvancements = [15, 15, 15, 15, 15, 10, 10] +let talents = ["Combat Aware", "Combat Reflexes", "Feint", "Inspiring", "Resolute", "War Leader"] +let trappings = ["Hand Weapon", "Shield"] +let items = []; + +let updateObj = this.actor.toObject(); + +for (let ch in characteristics) +{ + updateObj.system.characteristics[ch].modifier += characteristics[ch]; +} + +for (let index = 0; index < skills.length; index++) +{ + let skill = skills[index] + let skillItem; + skillItem = updateObj.items.find(i => i.name == skill && i.type == "skill") + if (skillItem) + skillItem.system.advances.value += skillAdvancements[index] + else + { + skillItem = await game.wfrp4e.utility.findSkill(skill) + skillItem = skillItem.toObject(); + skillItem.system.advances.value = skillAdvancements[index]; + items.push(skillItem); + } +} + +for (let talent of talents) +{ + let talentItem = await game.wfrp4e.utility.findTalent(talent) + if (talentItem) + { + items.push(talentItem.toObject()); + } + else + { + ui.notifications.warn(`Could not find ${talent}`, {permanent : true}) + } +} + +for (let trapping of trappings) +{ + let trappingItem = await game.wfrp4e.utility.findItem(trapping) + if (trappingItem) + { + trappingItem = trappingItem.toObject() + + equip(trappingItem) + + items.push(trappingItem); + } + else + { + ui.notifications.warn(`Could not find ${trapping}`, {permanent : true}) + } +} + +updateObj.name = updateObj.name += " " + this.effect.name + +await this.actor.update(updateObj) +this.actor.createEmbeddedDocuments("Item", items); + +function equip(item) +{ + if (item.type == "armour") + item.system.worn.value = true + else if (item.type == "weapon") + item.system.equipped = true + else if (item.type == "trapping" && item.system.trappingType.value == "clothingAccessories") + item.system.worn = true +} \ No newline at end of file diff --git a/reference_scripts/4QoxhoekgVeZcQA7.js b/reference_scripts/4QoxhoekgVeZcQA7.js new file mode 100644 index 0000000..4ebe285 --- /dev/null +++ b/reference_scripts/4QoxhoekgVeZcQA7.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.M5QSWOYt2Rbv2yxW") +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/4XrAeL2DitxE8OaK.js b/reference_scripts/4XrAeL2DitxE8OaK.js new file mode 100644 index 0000000..93877a2 --- /dev/null +++ b/reference_scripts/4XrAeL2DitxE8OaK.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.0hn6UaKq8CoZP2zD") +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}); \ No newline at end of file diff --git a/reference_scripts/4cOZzUvu1nytcqNn.js b/reference_scripts/4cOZzUvu1nytcqNn.js new file mode 100644 index 0000000..b5902b0 --- /dev/null +++ b/reference_scripts/4cOZzUvu1nytcqNn.js @@ -0,0 +1 @@ +args.initiative = "-10" \ No newline at end of file diff --git a/reference_scripts/4fnTKgl0HW9ZrWyJ.js b/reference_scripts/4fnTKgl0HW9ZrWyJ.js new file mode 100644 index 0000000..e818ce4 --- /dev/null +++ b/reference_scripts/4fnTKgl0HW9ZrWyJ.js @@ -0,0 +1,10 @@ +this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty : "average"}}).then(async test => +{ + await test.roll() + if (test.failed) + { + let char = Math.ceil(CONFIG.Dice.randomUniform() * 2) == 2 ? "s" : "t"; + this.script.scriptMessage(`${this.actor.name} lost 1 point of ${game.wfrp4e.config.characteristics[char]}`) + this.actor.update({[`system.characteristics.${char}.initial`] : this.actor.system.characteristics[char].initial - 1}) + } +}) \ No newline at end of file diff --git a/reference_scripts/4gkz3LR7CK1b8ulK.js b/reference_scripts/4gkz3LR7CK1b8ulK.js new file mode 100644 index 0000000..b6432a4 --- /dev/null +++ b/reference_scripts/4gkz3LR7CK1b8ulK.js @@ -0,0 +1 @@ +return args.item?.system.attackType != "ranged" || this.actor.uuid != this.effect.sourceActor.uuid \ No newline at end of file diff --git a/reference_scripts/4iuTz0uInAfMaoGl.js b/reference_scripts/4iuTz0uInAfMaoGl.js new file mode 100644 index 0000000..d3f97d5 --- /dev/null +++ b/reference_scripts/4iuTz0uInAfMaoGl.js @@ -0,0 +1 @@ +return args.skill?.name?.includes(game.i18n.localize("NAME.Language")) || args.type == "cast" \ No newline at end of file diff --git a/reference_scripts/4pQW4WLyhjbZR85k.js b/reference_scripts/4pQW4WLyhjbZR85k.js new file mode 100644 index 0000000..8a2680f --- /dev/null +++ b/reference_scripts/4pQW4WLyhjbZR85k.js @@ -0,0 +1,7 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "average"}, context : {failure: "1 Corruption Point Gained"}}) +await test.roll(); +if (test.failed && this.actor.type == "character") +{ + this.actor.update({"system.status.corruption.value" : parseInt(this.actor.status.corruption.value) + 1}) + this.script.scriptMessage("Gained a Corruption point", {whisper : ChatMessage.getWhisperRecipients("GM")}) +} \ No newline at end of file diff --git a/reference_scripts/4rTmV3TNxctUe0ly.js b/reference_scripts/4rTmV3TNxctUe0ly.js new file mode 100644 index 0000000..30a0737 --- /dev/null +++ b/reference_scripts/4rTmV3TNxctUe0ly.js @@ -0,0 +1,6 @@ +let test = await this.actor.setupCharacteristic("ag", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}); +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("bleeding"); +} diff --git a/reference_scripts/4rb7LfMq9CTnlrpn.js b/reference_scripts/4rb7LfMq9CTnlrpn.js new file mode 100644 index 0000000..214bdc9 --- /dev/null +++ b/reference_scripts/4rb7LfMq9CTnlrpn.js @@ -0,0 +1,10 @@ +if (args.totalWoundLoss > 0) +{ + let test = await args.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : " - " + this.effect.name}) + await test.roll(); + if (test.failed) + { + args.totalWoundLoss += 5; + args.modifiers.other.push({label : this.effect.name, value : 5}) + } +} \ No newline at end of file diff --git a/reference_scripts/4rhxLzau7jZ4SDxg.js b/reference_scripts/4rhxLzau7jZ4SDxg.js new file mode 100644 index 0000000..19f3d85 --- /dev/null +++ b/reference_scripts/4rhxLzau7jZ4SDxg.js @@ -0,0 +1,2 @@ +await args.actor.addCondition("grappling") +await args.actor.addCondition("entangled") \ No newline at end of file diff --git a/reference_scripts/52kbfuWrOh6dsTtd.js b/reference_scripts/52kbfuWrOh6dsTtd.js new file mode 100644 index 0000000..d5df29a --- /dev/null +++ b/reference_scripts/52kbfuWrOh6dsTtd.js @@ -0,0 +1,2 @@ +if (!this.actor.hasCondition("blinded")) + this.actor.addCondition("blinded", 1, {"flags.wfrp4e.flockOfDoom" : true}) \ No newline at end of file diff --git a/reference_scripts/52mwb33mGrQjq89B.js b/reference_scripts/52mwb33mGrQjq89B.js new file mode 100644 index 0000000..33c3e75 --- /dev/null +++ b/reference_scripts/52mwb33mGrQjq89B.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.Research"); \ No newline at end of file diff --git a/reference_scripts/53HFDNuMnX1Aw1a4.js b/reference_scripts/53HFDNuMnX1Aw1a4.js new file mode 100644 index 0000000..d6198c0 --- /dev/null +++ b/reference_scripts/53HFDNuMnX1Aw1a4.js @@ -0,0 +1 @@ +return ["ws", "bs", "s", "ag", "dex", "int", "wp", "fel"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/58rFc9HiBoX66J6p.js b/reference_scripts/58rFc9HiBoX66J6p.js new file mode 100644 index 0000000..1e3c7a2 --- /dev/null +++ b/reference_scripts/58rFc9HiBoX66J6p.js @@ -0,0 +1,9 @@ +let sourceActor = this.effect.sourceActor; +let damage = args.totalWoundLoss; +let tb = sourceActor.system.characteristics.t.bonus +args.abort = `${this.effect.name}: Damage applied to ${sourceActor.name}`; + +let message = await sourceActor.applyBasicDamage(damage - tb, {damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}) + +this.script.scriptMessage(message.replace(`${tb} TB`, `${tb} × 2 TB`)) +args.abort = true; \ No newline at end of file diff --git a/reference_scripts/5DI6cHAg1LHo54Yv.js b/reference_scripts/5DI6cHAg1LHo54Yv.js new file mode 100644 index 0000000..6929228 --- /dev/null +++ b/reference_scripts/5DI6cHAg1LHo54Yv.js @@ -0,0 +1,6 @@ +if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 2 && args.opposedTest.result.winner == "attacker") +{ + this.actor.update({"system.status.fortune.value" : Math.max(0, (this.actor.system.status.fortune?.value - 1) || 0)}) + this.script.scriptMessage(`Fortune point stolen from ${this.actor.name}`, {blind : true, whisper : ChatMessage.getWhisperRecipients("GM")}) + +} \ No newline at end of file diff --git a/reference_scripts/5Fe1ELaS6Gnvy0Cj.js b/reference_scripts/5Fe1ELaS6Gnvy0Cj.js new file mode 100644 index 0000000..ad46ad3 --- /dev/null +++ b/reference_scripts/5Fe1ELaS6Gnvy0Cj.js @@ -0,0 +1 @@ +return args.skill?.name.includes("Channelling") || args.type == "channelling" || args.skill?.name == game.i18n.localize("NAME.Charm") || args.skill?.name.includes("Language (Magick)") || args.type == "cast" \ No newline at end of file diff --git a/reference_scripts/5IoYTyedCMYwt3ys.js b/reference_scripts/5IoYTyedCMYwt3ys.js new file mode 100644 index 0000000..cedf74b --- /dev/null +++ b/reference_scripts/5IoYTyedCMYwt3ys.js @@ -0,0 +1 @@ +args.fields.slBonus += 2; \ No newline at end of file diff --git a/reference_scripts/5JWC0l3JEpOsqbR9.js b/reference_scripts/5JWC0l3JEpOsqbR9.js new file mode 100644 index 0000000..d2eb0b6 --- /dev/null +++ b/reference_scripts/5JWC0l3JEpOsqbR9.js @@ -0,0 +1,85 @@ +let characteristics = { + "ws" : 0, + "bs" : 5, + "s" : 0, + "t" : 0, + "i" : 10, + "ag" : 10, + "dex" : 0, + "int" : 0, + "wp" : 5, + "fel" : 0 +} +let skills = ["Dodge", "Perception"] +let skillAdvancements = [10, 10] +let talents = ["Flee!", "Marksman"] +let trappings = ["Hand Weapon"] +let items = []; + +let updateObj = this.actor.toObject(); + +for (let ch in characteristics) +{ + updateObj.system.characteristics[ch].modifier += characteristics[ch]; +} + +for (let index = 0; index < skills.length; index++) +{ + let skill = skills[index] + let skillItem; + skillItem = updateObj.items.find(i => i.name == skill && i.type == "skill") + if (skillItem) + skillItem.system.advances.value += skillAdvancements[index] + else + { + skillItem = await game.wfrp4e.utility.findSkill(skill) + skillItem = skillItem.toObject(); + skillItem.system.advances.value = skillAdvancements[index]; + items.push(skillItem); + } +} + +for (let talent of talents) +{ + let talentItem = await game.wfrp4e.utility.findTalent(talent) + if (talentItem) + { + items.push(talentItem.toObject()); + } + else + { + ui.notifications.warn(`Could not find ${talent}`, {permanent : true}) + } +} + +for (let trapping of trappings) +{ + let trappingItem = await game.wfrp4e.utility.findItem(trapping) + if (trappingItem) + { + trappingItem = trappingItem.toObject() + + equip(trappingItem) + + items.push(trappingItem); + } + else + { + ui.notifications.warn(`Could not find ${trapping}`, {permanent : true}) + } +} + +updateObj.name = updateObj.name += " " + this.effect.name + +await this.actor.update(updateObj) +this.actor.createEmbeddedDocuments("Item", items); + +function equip(item) +{ + if (item.type == "armour") + item.system.worn.value = true + else if (item.type == "weapon") + item.system.equipped = true + else if (item.type == "trapping" && item.system.trappingType.value == "clothingAccessories") + item.system.worn = true +} \ No newline at end of file diff --git a/reference_scripts/5JvKJZPcd6Hz5zvn.js b/reference_scripts/5JvKJZPcd6Hz5zvn.js new file mode 100644 index 0000000..be61706 --- /dev/null +++ b/reference_scripts/5JvKJZPcd6Hz5zvn.js @@ -0,0 +1,85 @@ +let characteristics = { + "ws" : 10, + "bs" : 0, + "s" : 10, + "t" : 10, + "i" : 20, + "ag" : 10, + "dex" : 0, + "int" : 0, + "wp" : 15, + "fel" : 0 +} +let skills = ["Cool", "Dodge", "Intimidate", "Leadership"] +let skillAdvancements = [15, 15, 10, 5] +let talents = ["Combat Aware", "Combat Reflexes", "Feint", "Resolute"] +let trappings = ["Mail Coat", "Mail Chausses", "Mail Coif", "Hand Weapon", "Shield"] +let items = []; + +let updateObj = this.actor.toObject(); + +for (let ch in characteristics) +{ + updateObj.system.characteristics[ch].modifier += characteristics[ch]; +} + +for (let index = 0; index < skills.length; index++) +{ + let skill = skills[index] + let skillItem; + skillItem = updateObj.items.find(i => i.name == skill && i.type == "skill") + if (skillItem) + skillItem.system.advances.value += skillAdvancements[index] + else + { + skillItem = await game.wfrp4e.utility.findSkill(skill) + skillItem = skillItem.toObject(); + skillItem.system.advances.value = skillAdvancements[index]; + items.push(skillItem); + } +} + +for (let talent of talents) +{ + let talentItem = await game.wfrp4e.utility.findTalent(talent) + if (talentItem) + { + items.push(talentItem.toObject()); + } + else + { + ui.notifications.warn(`Could not find ${talent}`, {permanent : true}) + } +} + +for (let trapping of trappings) +{ + let trappingItem = await game.wfrp4e.utility.findItem(trapping) + if (trappingItem) + { + trappingItem = trappingItem.toObject() + + equip(trappingItem) + + items.push(trappingItem); + } + else + { + ui.notifications.warn(`Could not find ${trapping}`, {permanent : true}) + } +} + +updateObj.name = this.effect.name + " " + updateObj.name + +await this.actor.update(updateObj) +this.actor.createEmbeddedDocuments("Item", items); + +function equip(item) +{ + if (item.type == "armour") + item.system.worn.value = true + else if (item.type == "weapon") + item.system.equipped = true + else if (item.type == "trapping" && item.system.trappingType.value == "clothingAccessories") + item.system.worn = true +} \ No newline at end of file diff --git a/reference_scripts/5LdJCKfQem1AQK24.js b/reference_scripts/5LdJCKfQem1AQK24.js new file mode 100644 index 0000000..7ec5f13 --- /dev/null +++ b/reference_scripts/5LdJCKfQem1AQK24.js @@ -0,0 +1,6 @@ + +if (!args.flags.howlingWarpGale) +{ + args.fields.modifier -= 10; + args.flags.howlingWarpGale = true; // prevent double application +} \ No newline at end of file diff --git a/reference_scripts/5M6IgCUncCwyxHok.js b/reference_scripts/5M6IgCUncCwyxHok.js new file mode 100644 index 0000000..ceef2c0 --- /dev/null +++ b/reference_scripts/5M6IgCUncCwyxHok.js @@ -0,0 +1,35 @@ +let etiquette = (await fromUuid("Compendium.wfrp4e-core.items.Item.sYbgpSnRqSZWgwFP")).toObject(); +etiquette.name += ` (Followers of Tzeentch)`; + +let animosity = (await fromUuid("Compendium.wfrp4e-core.items.Item.0VpT5yubw4UL7j6f")).toObject(); +animosity.system.specification.value = "Followers of Nurgle"; + +let roll = await new Roll("ceil(1d10 / 3)").roll(); + +roll.toMessage(this.script.getChatData()); + +let mutations = []; +let msg = `Mutations Gained
` +for(let i = 0; i < roll.total; i++) +{ + let item; + let uuid; + let result; + if (i % 2 == 0) + { + result = await game.wfrp4e.tables.rollTable("mutatemental", {hideDSN: true}, "Tzeentch") + } + else + { + result = await game.wfrp4e.tables.rollTable("mutatephys", {hideDSN: true}, "Tzeentch") + } + uuid = `Compendium.${result.object.documentCollection}.${result.object.documentId}`; + item = await fromUuid(uuid); + if (item) + { + msg += `@UUID[${uuid}]{${item.name}}
` + mutations.push(item.toObject()); + } +} +this.actor.createEmbeddedDocuments("Item", mutations.concat([etiquette, animosity]), {fromEffect : this.effect.id}) +this.script.scriptMessage(msg); \ No newline at end of file diff --git a/reference_scripts/5MxRDXzUBPfp2KKD.js b/reference_scripts/5MxRDXzUBPfp2KKD.js new file mode 100644 index 0000000..578674f --- /dev/null +++ b/reference_scripts/5MxRDXzUBPfp2KKD.js @@ -0,0 +1 @@ +args.options.useOnesSupportive = true; \ No newline at end of file diff --git a/reference_scripts/5dR7Erj3nwsxLAV7.js b/reference_scripts/5dR7Erj3nwsxLAV7.js new file mode 100644 index 0000000..443c65a --- /dev/null +++ b/reference_scripts/5dR7Erj3nwsxLAV7.js @@ -0,0 +1,85 @@ +let characteristics = { + "ws" : 35, + "bs" : 10, + "s" : 25, + "t" : 30, + "i" : 30, + "ag" : 25, + "dex" : 0, + "int" : 15, + "wp" : 35, + "fel" : 15 +} +let skills = ["Cool", "Dodge", "Intimidate", "Intuition", "Leadership", "Lore (Warfare)", "Perception"] +let skillAdvancements = [25, 15, 25, 25, 30, 20, 20] +let talents = ["Combat Aware", "Combat Reflexes", "Feint", "Inspiring", "Luck", "Resolute", "Unshakable", "War Leader"] +let trappings = ["Hand Weapon", "Shield"] +let items = []; + +let updateObj = this.actor.toObject(); + +for (let ch in characteristics) +{ + updateObj.system.characteristics[ch].modifier += characteristics[ch]; +} + +for (let index = 0; index < skills.length; index++) +{ + let skill = skills[index] + let skillItem; + skillItem = updateObj.items.find(i => i.name == skill && i.type == "skill") + if (skillItem) + skillItem.system.advances.value += skillAdvancements[index] + else + { + skillItem = await game.wfrp4e.utility.findSkill(skill) + skillItem = skillItem.toObject(); + skillItem.system.advances.value = skillAdvancements[index]; + items.push(skillItem); + } +} + +for (let talent of talents) +{ + let talentItem = await game.wfrp4e.utility.findTalent(talent) + if (talentItem) + { + items.push(talentItem.toObject()); + } + else + { + ui.notifications.warn(`Could not find ${talent}`, {permanent : true}) + } +} + +for (let trapping of trappings) +{ + let trappingItem = await game.wfrp4e.utility.findItem(trapping) + if (trappingItem) + { + trappingItem = trappingItem.toObject() + + equip(trappingItem) + + items.push(trappingItem); + } + else + { + ui.notifications.warn(`Could not find ${trapping}`, {permanent : true}) + } +} + +updateObj.name = updateObj.name += " " + this.effect.name + +await this.actor.update(updateObj) +this.actor.createEmbeddedDocuments("Item", items); + +function equip(item) +{ + if (item.type == "armour") + item.system.worn.value = true + else if (item.type == "weapon") + item.system.equipped = true + else if (item.type == "trapping" && item.system.trappingType.value == "clothingAccessories") + item.system.worn = true +} \ No newline at end of file diff --git a/reference_scripts/5lc1eHIYQNpSRWip.js b/reference_scripts/5lc1eHIYQNpSRWip.js new file mode 100644 index 0000000..39f6f8b --- /dev/null +++ b/reference_scripts/5lc1eHIYQNpSRWip.js @@ -0,0 +1,8 @@ +if (["death", "necromancy"].includes(args.spell?.system.lore.value)) +{ + args.fields.successBonus += 1 +} +else if(["life", "light", "heavens"].includes(args.spell?.system.lore.value)) +{ + args.fields.modifier -= 10; +} \ No newline at end of file diff --git a/reference_scripts/5o1XiceC4rutjMms.js b/reference_scripts/5o1XiceC4rutjMms.js new file mode 100644 index 0000000..2646b2f --- /dev/null +++ b/reference_scripts/5o1XiceC4rutjMms.js @@ -0,0 +1 @@ +return !args.item?.name.includes(game.i18n.localize("NAME.Stealth")) \ No newline at end of file diff --git a/reference_scripts/5sI9iYh5j2nx2XyT.js b/reference_scripts/5sI9iYh5j2nx2XyT.js new file mode 100644 index 0000000..4a9e7b3 --- /dev/null +++ b/reference_scripts/5sI9iYh5j2nx2XyT.js @@ -0,0 +1 @@ +return !(["Animal Care", "Charm Animal"].includes(args.item?.name) || args.item?.name.includes("Ride") || args.item?.name.includes("Animal Training")) \ No newline at end of file diff --git a/reference_scripts/62Ky6bC1EnTllSJA.js b/reference_scripts/62Ky6bC1EnTllSJA.js new file mode 100644 index 0000000..8d0a535 --- /dev/null +++ b/reference_scripts/62Ky6bC1EnTllSJA.js @@ -0,0 +1,4 @@ +if (this.effect.sourceActor.uuid != args.actor.uuid) +{ + this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.overcast.usage.other.current, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true})); +} \ No newline at end of file diff --git a/reference_scripts/65o8pQj6oGNnXce6.js b/reference_scripts/65o8pQj6oGNnXce6.js new file mode 100644 index 0000000..6737896 --- /dev/null +++ b/reference_scripts/65o8pQj6oGNnXce6.js @@ -0,0 +1,2 @@ +let ch = this.effect.getFlag("wfrp4e", "characteristic") +this.actor.system.characteristics[ch].modifier += 10; \ No newline at end of file diff --git a/reference_scripts/65xE9OV5sA1ZWT7j.js b/reference_scripts/65xE9OV5sA1ZWT7j.js new file mode 100644 index 0000000..2e9318c --- /dev/null +++ b/reference_scripts/65xE9OV5sA1ZWT7j.js @@ -0,0 +1,9 @@ +if (args.test.options.diceman && args.test.succeeded) +{ + +let SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10) +let ones = Number(args.test.result.roll.toString().split("").pop()) + +if (ones > SL) + args.test.result.other.push(` `) +} \ No newline at end of file diff --git a/reference_scripts/6Aqq4F4Xui923sc6.js b/reference_scripts/6Aqq4F4Xui923sc6.js new file mode 100644 index 0000000..0a9ebf3 --- /dev/null +++ b/reference_scripts/6Aqq4F4Xui923sc6.js @@ -0,0 +1,12 @@ +// Imbibing this substance grants the user the Painless Creature Trait. +const hasColdBlooded = this.actor.has("Cold Blooded") +if (hasColdBlooded === undefined) +{ + let item = await fromUuid("Compendium.wfrp4e-core.items.mCh1KK9jomwFZcLB") + let data = item.toObject() + this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id}) + + this.script.scriptMessage(`${this.actor.prototypeToken.name} has gained the Cold Blooded Creature Trait and may reverse any failed Willpower based Tests.
+If they gain a Surprised Condition, this Condition is not lost the first time it should be (which is typically at the end of the Round or if they victim is attacked).
`, + {whisper: ChatMessage.getWhisperRecipients("GM"), blind: true }) +} \ No newline at end of file diff --git a/reference_scripts/6BmvV9c03FkfisnE.js b/reference_scripts/6BmvV9c03FkfisnE.js new file mode 100644 index 0000000..3d03be7 --- /dev/null +++ b/reference_scripts/6BmvV9c03FkfisnE.js @@ -0,0 +1,20 @@ +// Apply changes when the mask is worn + +if (args.equipped) { + this.actor.createEmbeddedDocuments("ActiveEffect", [this.item.effects.contents[1]?.convertToApplied()]) + this.script.scriptMessage(`${this.actor.name} dons the ${this.item.name}.Use Ward provided by ${this.effect.name}?`,
+ buttons : {
+ yes : {
+ label : "Yes",
+ callback: () => {
+ return true;
+ }
+ },
+ no : {
+ label: "No",
+ callback: () => {
+ return false;
+ }
+ }
+ }
+})
+
+if (useWard)
+ args.ward = 9;
\ No newline at end of file
diff --git a/reference_scripts/6mpw9cGseG4W4eyd.js b/reference_scripts/6mpw9cGseG4W4eyd.js
new file mode 100644
index 0000000..1a3b985
--- /dev/null
+++ b/reference_scripts/6mpw9cGseG4W4eyd.js
@@ -0,0 +1,12 @@
+if (this.actor.system.status.advantage.value >= 2)
+{
+ await this.actor.modifyAdvantage(-2);
+ this.script.scriptNotification("Advantage Subtracted")
+}
+else
+{
+ return this.script.scriptNotification("Not enough Advantage!", "error")
+}
+
+let test = await this.actor.setupTrait(this.item)
+await test.roll();
\ No newline at end of file
diff --git a/reference_scripts/6qUKKep5vhFYmo1J.js b/reference_scripts/6qUKKep5vhFYmo1J.js
new file mode 100644
index 0000000..0fc2aa5
--- /dev/null
+++ b/reference_scripts/6qUKKep5vhFYmo1J.js
@@ -0,0 +1 @@
+return args.type == "channelling" || args.skill?.name.includes(game.i18n.localize("NAME.Channelling"))
\ No newline at end of file
diff --git a/reference_scripts/6tjn0RH4VyOPFneS.js b/reference_scripts/6tjn0RH4VyOPFneS.js
new file mode 100644
index 0000000..0001110
--- /dev/null
+++ b/reference_scripts/6tjn0RH4VyOPFneS.js
@@ -0,0 +1 @@
+return ["NAME.Row", "NAME.Swim"].map(i => game.i18n.localize(i)).includes(args.skill?.name);
\ No newline at end of file
diff --git a/reference_scripts/6uldpFvKOCoW92cC.js b/reference_scripts/6uldpFvKOCoW92cC.js
new file mode 100644
index 0000000..9f67eea
--- /dev/null
+++ b/reference_scripts/6uldpFvKOCoW92cC.js
@@ -0,0 +1,8 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.uqGxFOEqeurwkAO3")
+item = item.toObject()
+
+item.system.specification.value = 10;
+item.name += " (Fire)"
+setProperty(item, "flags.wfrp4e.breath", "fire")
+
+Item.create(item, {parent : this.actor, fromEffect: this.effect.id})
\ No newline at end of file
diff --git a/reference_scripts/6xTtJEhRc4OjcDTf.js b/reference_scripts/6xTtJEhRc4OjcDTf.js
new file mode 100644
index 0000000..5a8b642
--- /dev/null
+++ b/reference_scripts/6xTtJEhRc4OjcDTf.js
@@ -0,0 +1,5 @@
+if (getProperty(args.data, "system.status.fortune.value"))
+{
+ this.script.scriptNotification("Cannot update Fortune");
+ delete args.data.system.status.wounds.value;
+}
\ No newline at end of file
diff --git a/reference_scripts/715G1Bf0haOHvmYQ.js b/reference_scripts/715G1Bf0haOHvmYQ.js
new file mode 100644
index 0000000..56674c9
--- /dev/null
+++ b/reference_scripts/715G1Bf0haOHvmYQ.js
@@ -0,0 +1 @@
+return !(args.skill?.name == game.i18n.localize("NAME.Bribery") || args.skill?.name.includes(game.i18n.localize("NAME.Stealth")))
\ No newline at end of file
diff --git a/reference_scripts/71DmrxCTKGYL4Z7X.js b/reference_scripts/71DmrxCTKGYL4Z7X.js
new file mode 100644
index 0000000..159a835
--- /dev/null
+++ b/reference_scripts/71DmrxCTKGYL4Z7X.js
@@ -0,0 +1 @@
+return ["fel"].includes(args.characteristic)
\ No newline at end of file
diff --git a/reference_scripts/7Ck0fkzE4WQ62qVe.js b/reference_scripts/7Ck0fkzE4WQ62qVe.js
new file mode 100644
index 0000000..6850a0b
--- /dev/null
+++ b/reference_scripts/7Ck0fkzE4WQ62qVe.js
@@ -0,0 +1,4 @@
+if (args.item.type == "skill" && args.item.name == "Melee (Basic)")
+{
+ args.item.system.modifier.value += 20;
+}
\ No newline at end of file
diff --git a/reference_scripts/7F3miqRA0ceMUBIu.js b/reference_scripts/7F3miqRA0ceMUBIu.js
new file mode 100644
index 0000000..1088080
--- /dev/null
+++ b/reference_scripts/7F3miqRA0ceMUBIu.js
@@ -0,0 +1 @@
+return args.characteristic != "int" || args.skill
\ No newline at end of file
diff --git a/reference_scripts/7F6aGxZJjwxm5e5P.js b/reference_scripts/7F6aGxZJjwxm5e5P.js
new file mode 100644
index 0000000..18e9f56
--- /dev/null
+++ b/reference_scripts/7F6aGxZJjwxm5e5P.js
@@ -0,0 +1,18 @@
+if (args.test.result.castOutcome == "failure")
+{
+ ValueDialog.create("Enter Wounds Lost to gain SL", this.effect.name, "0").then(async value => {
+ value = Math.clamped(value, 0, 3)
+ if (value == 0)
+ {
+ return;
+ }
+ else if (Number.isNumeric(value))
+ {
+ this.script.scriptNotification(`Lost ${value} Wounds`)
+ this.actor.modifyWounds(-1 * value)
+ await this.item.system.toggleEquip();
+ args.test.addSL(value);
+ args.test.preData.other.push(`${this.effect.name}: +${value} SL`)
+ }
+ })
+}
\ No newline at end of file
diff --git a/reference_scripts/7H6wYyJ6cpaoc2QQ.js b/reference_scripts/7H6wYyJ6cpaoc2QQ.js
new file mode 100644
index 0000000..05cbeea
--- /dev/null
+++ b/reference_scripts/7H6wYyJ6cpaoc2QQ.js
@@ -0,0 +1 @@
+return args.skill?.name == game.i18n.localize("NAME.Cool");
\ No newline at end of file
diff --git a/reference_scripts/7JW9t8AYSDkkzG2V.js b/reference_scripts/7JW9t8AYSDkkzG2V.js
new file mode 100644
index 0000000..5e3d751
--- /dev/null
+++ b/reference_scripts/7JW9t8AYSDkkzG2V.js
@@ -0,0 +1,21 @@
+// Apply changes when the mask is worn
+
+if (args.equipped)
+{
+ this.actor.createEmbeddedDocuments("ActiveEffect", [this.item.effects.contents[1]?.convertToApplied()])
+ this.script.scriptMessage(`${this.actor.name} dons the ${this.item.name}.
+ If they wear the mask for more than an hour or benefit from any of its effects, they are exposed to @Corruption[moderate]{Moderate Corruption}.
+ `,
+ {whisper: ChatMessage.getWhisperRecipients("GM")})
+}
+
+// Notify of lingering effects when mask is removed
+else if (!args.equipped)
+{
+ await this.item.effects.contents[0].delete();
+ await this.item.update({name : this.item.name += " (Used)"})
+ this.script.scriptMessage(`${this.item.name} on ${this.actor.name} has been taken off and loses its properties. However, the effects last for [[1d10+4]] days, after which they should be manually removed.`,
+ {whisper: ChatMessage.getWhisperRecipients("GM")}
+ )
+
+}
\ No newline at end of file
diff --git a/reference_scripts/7OmrMjaU48o2FEZi.js b/reference_scripts/7OmrMjaU48o2FEZi.js
new file mode 100644
index 0000000..4ca0181
--- /dev/null
+++ b/reference_scripts/7OmrMjaU48o2FEZi.js
@@ -0,0 +1,6 @@
+
+this.actor.characteristics.t.bonus = 10
+
+this.actor.details.move.value = 0;
+this.actor.details.move.walk= 0;
+this.actor.details.move.run = 0;
\ No newline at end of file
diff --git a/reference_scripts/7ScfB4o1QhXnNUfq.js b/reference_scripts/7ScfB4o1QhXnNUfq.js
new file mode 100644
index 0000000..a8f5e60
--- /dev/null
+++ b/reference_scripts/7ScfB4o1QhXnNUfq.js
@@ -0,0 +1 @@
+return !["int", "wp"].includes(args.characteristic)
\ No newline at end of file
diff --git a/reference_scripts/7VAhXHov6pR1SkgD.js b/reference_scripts/7VAhXHov6pR1SkgD.js
new file mode 100644
index 0000000..67dfce8
--- /dev/null
+++ b/reference_scripts/7VAhXHov6pR1SkgD.js
@@ -0,0 +1 @@
+return args.item?.name == game.i18n.localize("NAME.Endurance");
\ No newline at end of file
diff --git a/reference_scripts/7WR2hJjHPhHhHxAq.js b/reference_scripts/7WR2hJjHPhHhHxAq.js
new file mode 100644
index 0000000..45d5ca2
--- /dev/null
+++ b/reference_scripts/7WR2hJjHPhHhHxAq.js
@@ -0,0 +1,8 @@
+let poisoned = args.actor.hasCondition("poisoned")
+if (poisoned)
+{
+ this.script.scriptNotification(`Removed ${poisoned.conditionValue} Poisoned Conditions`)
+ poisoned.delete();
+}
+else
+ this.script.scriptNotification(`No Poisoned Conditions`)
\ No newline at end of file
diff --git a/reference_scripts/7ZoFUMDG2WJd8RMg.js b/reference_scripts/7ZoFUMDG2WJd8RMg.js
new file mode 100644
index 0000000..0ff8299
--- /dev/null
+++ b/reference_scripts/7ZoFUMDG2WJd8RMg.js
@@ -0,0 +1 @@
+this.script.scriptMessage(`Claimed ${this.effect.name} Bonus`);
\ No newline at end of file
diff --git a/reference_scripts/7e8FgQUF2oANANmx.js b/reference_scripts/7e8FgQUF2oANANmx.js
new file mode 100644
index 0000000..b195380
--- /dev/null
+++ b/reference_scripts/7e8FgQUF2oANANmx.js
@@ -0,0 +1 @@
+return args.skill?.name == "Melee (Brawling)" || args.item?.weaponGroup?.value == "brawling"
\ No newline at end of file
diff --git a/reference_scripts/7f6OsttTzE7Hvzfk.js b/reference_scripts/7f6OsttTzE7Hvzfk.js
new file mode 100644
index 0000000..aff4c37
--- /dev/null
+++ b/reference_scripts/7f6OsttTzE7Hvzfk.js
@@ -0,0 +1,5 @@
+if (this.actor.statuses.has("infighting")) // Only add +10 if already infighting
+ args.prefillModifiers.modifier += 10;
+
+
+args.prefillModifiers.successBonus += 1;
diff --git a/reference_scripts/7n3SEAGRA5ESK8gV.js b/reference_scripts/7n3SEAGRA5ESK8gV.js
new file mode 100644
index 0000000..f577178
--- /dev/null
+++ b/reference_scripts/7n3SEAGRA5ESK8gV.js
@@ -0,0 +1 @@
+args.options.disarm = true;
\ No newline at end of file
diff --git a/reference_scripts/7szLG4VALuuy1cPm.js b/reference_scripts/7szLG4VALuuy1cPm.js
new file mode 100644
index 0000000..1fbcead
--- /dev/null
+++ b/reference_scripts/7szLG4VALuuy1cPm.js
@@ -0,0 +1,6 @@
+let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "easy"}})
+await test.roll();
+if (test.failed)
+{
+ await this.actor.addCondition("fatigued")
+}
\ No newline at end of file
diff --git a/reference_scripts/7wBWUw05q0igh508.js b/reference_scripts/7wBWUw05q0igh508.js
new file mode 100644
index 0000000..95e3da1
--- /dev/null
+++ b/reference_scripts/7wBWUw05q0igh508.js
@@ -0,0 +1,17 @@
+// Imbibing this substance grants the user the Painless Creature Trait.
+const hasPainless = this.actor.has("Painless");
+if (hasPainless === undefined)
+{
+ let item = await fromUuid("Compendium.wfrp4e-core.items.wMwSRDmgiF2IdCJr");
+ let data = item.toObject()
+ this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id})
+
+ this.script.scriptMessage(
+ `
${this.actor.prototypeToken.name} has gained the Painless Creature Trait. This + effect lasts for one hour, after which it dissipates and the full effect + of all the imbiber's wounds come crashing down at once.
+Note that this does not prevent the user from acquiring a Critical + Wound or dying from one. It merely allows them to ignore most + of their effects.
`, + { whisper: ChatMessage.getWhisperRecipients("GM"), blind: true}) +} \ No newline at end of file diff --git a/reference_scripts/84IB8CWa55XzoAkv.js b/reference_scripts/84IB8CWa55XzoAkv.js new file mode 100644 index 0000000..3cdc615 --- /dev/null +++ b/reference_scripts/84IB8CWa55XzoAkv.js @@ -0,0 +1 @@ +return (["Animal Care", "Charm Animal"].includes(args.item?.name) || args.item?.name.includes("Ride") || args.item?.name.includes("Animal Training")) \ No newline at end of file diff --git a/reference_scripts/87rrZ3ojHrXa3lCn.js b/reference_scripts/87rrZ3ojHrXa3lCn.js new file mode 100644 index 0000000..75193a6 --- /dev/null +++ b/reference_scripts/87rrZ3ojHrXa3lCn.js @@ -0,0 +1 @@ +this.actor.modifyWounds(1) \ No newline at end of file diff --git a/reference_scripts/8AoA4bnstBtglRGZ.js b/reference_scripts/8AoA4bnstBtglRGZ.js new file mode 100644 index 0000000..ff38d2d --- /dev/null +++ b/reference_scripts/8AoA4bnstBtglRGZ.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.wMwSRDmgiF2IdCJr") +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/8ByuHnUZ4RNTdGVv.js b/reference_scripts/8ByuHnUZ4RNTdGVv.js new file mode 100644 index 0000000..37290b2 --- /dev/null +++ b/reference_scripts/8ByuHnUZ4RNTdGVv.js @@ -0,0 +1,16 @@ +let strLoss = Math.ceil(CONFIG.Dice.randomUniform() * 10) +let tghLoss = Math.ceil(CONFIG.Dice.randomUniform() * 10) + +if (!this.actor.has("Undead") && !this.actor.has("Daemonic")) +{ + this.actor.setupSkill(game.i18n.localize("NAME.Cool"), { appendTitle: " - " + this.effect.name, fields: { difficulty: "average" }, context: { failure: `Lost ${strLoss} Strength and ${tghLoss} Toughness` } }).then(async test => { + await test.roll(); + if (test.failed) { + this.actor.update({ "system.characteristics.s.initial": this.actor.system.characteristics.s.initial - strLoss, "system.characteristics.t.initial": this.actor.system.characteristics.t.initial - tghLoss }) + } + }) + +} +else { + this.script.scriptNotification(`${this.actor.name} is immune to ${this.effect.name}`) +} diff --git a/reference_scripts/8GyJgdHVBaLrHCY8.js b/reference_scripts/8GyJgdHVBaLrHCY8.js new file mode 100644 index 0000000..2ee98a7 --- /dev/null +++ b/reference_scripts/8GyJgdHVBaLrHCY8.js @@ -0,0 +1,21 @@ +let type = this.item.getFlag("wfrp4e", "breath") +let types = { + none : "None", + cold : "Cold", + corrosion : "Corrosion", + fire : "Fire", + electricity : "Electricity", + poison : "Poison", + smoke : "Smoke", + various : "Various" +} +if (!type) +{ + type = (await ItemDialog.create(ItemDialog.objectToArray(types, this.item.img), 1, "Choose Breath"))[0]?.id; + this.item.updateSource({"flags.wfrp4e.breath" : type}) +} + +if (!this.item.name.includes("(") && types[type] && type != "none") +{ + this.item.updateSource({name : this.item.name += ` (${types[type]})`, "system.specification.value" : this.item.system.specification.value.replace("(Type)", "").trim()}) +} \ No newline at end of file diff --git a/reference_scripts/8K9tpCwvFC9INk5V.js b/reference_scripts/8K9tpCwvFC9INk5V.js new file mode 100644 index 0000000..757ac38 --- /dev/null +++ b/reference_scripts/8K9tpCwvFC9INk5V.js @@ -0,0 +1,8 @@ +if (["t", "wp"].includes(args.characteristic)) +{ + args.fields.modifier += 10; +} +else if (["ag", "i", "int"].includes(args.characteristic)) +{ + args.fields.modifier -= 10; +} \ No newline at end of file diff --git a/reference_scripts/8LmUVQxOwTLSeabg.js b/reference_scripts/8LmUVQxOwTLSeabg.js new file mode 100644 index 0000000..32cd5df --- /dev/null +++ b/reference_scripts/8LmUVQxOwTLSeabg.js @@ -0,0 +1 @@ +return args.data.targets.length > 0 || !args.weapon?.system.qualities.value.find(i => i.name == "shield") // Should count even if they don't have the skill \ No newline at end of file diff --git a/reference_scripts/8N3Uqjq1ZxPxo4pk.js b/reference_scripts/8N3Uqjq1ZxPxo4pk.js new file mode 100644 index 0000000..43dddd4 --- /dev/null +++ b/reference_scripts/8N3Uqjq1ZxPxo4pk.js @@ -0,0 +1 @@ +return !args.skill?.name?.includes(game.i18n.localize("NAME.Lore")) \ No newline at end of file diff --git a/reference_scripts/8RNziYGGb4sp3BGQ.js b/reference_scripts/8RNziYGGb4sp3BGQ.js new file mode 100644 index 0000000..b853c6b --- /dev/null +++ b/reference_scripts/8RNziYGGb4sp3BGQ.js @@ -0,0 +1,5 @@ +if (!args.test.weapon?.name.includes("Drakefire")) +{ + args.test.result.misfire = game.i18n.localize("Misfire"); + args.test.result.misfireDamage = (0, eval)(parseInt(args.test.result.roll.toString().split('').pop()) + args.test.weapon.system.Damage); +} \ No newline at end of file diff --git a/reference_scripts/8ShLVT0bK1eQpinj.js b/reference_scripts/8ShLVT0bK1eQpinj.js new file mode 100644 index 0000000..9783813 --- /dev/null +++ b/reference_scripts/8ShLVT0bK1eQpinj.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.k00PimCWkff11IA0") +let data = item.toObject(); +data.system.location.key = this.item.system.location.key +this.actor.createEmbeddedDocuments("Item", [data]) \ No newline at end of file diff --git a/reference_scripts/8TRiAJ8thIKE4IoL.js b/reference_scripts/8TRiAJ8thIKE4IoL.js new file mode 100644 index 0000000..3814c2c --- /dev/null +++ b/reference_scripts/8TRiAJ8thIKE4IoL.js @@ -0,0 +1,5 @@ + +let SL = Number(getProperty(this.item, "flags.wfrp4e.sourceTest.result.SL") || 1) + +args.actor.characteristics.i.modifier += 10 * SL +args.actor.characteristics.ag.modifier += 10 * SL \ No newline at end of file diff --git a/reference_scripts/8ThudCYRqkjQIwJH.js b/reference_scripts/8ThudCYRqkjQIwJH.js new file mode 100644 index 0000000..0395373 --- /dev/null +++ b/reference_scripts/8ThudCYRqkjQIwJH.js @@ -0,0 +1,4 @@ +if (args.opposedTest.attackerTest.result.critical) +{ + args.actor.addCondition("ablaze") +} \ No newline at end of file diff --git a/reference_scripts/8WJsecxdndaHRxxS.js b/reference_scripts/8WJsecxdndaHRxxS.js new file mode 100644 index 0000000..5bd3474 --- /dev/null +++ b/reference_scripts/8WJsecxdndaHRxxS.js @@ -0,0 +1 @@ +this.actor.status.addArmour(this.actor.characteristics.wp.bonus, {source: this.effect, magical : true}) \ No newline at end of file diff --git a/reference_scripts/8WeYU5e5LN9UeWFs.js b/reference_scripts/8WeYU5e5LN9UeWFs.js new file mode 100644 index 0000000..7ede669 --- /dev/null +++ b/reference_scripts/8WeYU5e5LN9UeWFs.js @@ -0,0 +1,8 @@ +if (args.item.type == "spell") +{ + let range = parseInt(args.item.Range) + if (Number.isNumeric(range)) + { + args.item.system.range.value = "2 * " + args.item.system.range.value + } +} \ No newline at end of file diff --git a/reference_scripts/8ZAUBSH9CM9OTpTL.js b/reference_scripts/8ZAUBSH9CM9OTpTL.js new file mode 100644 index 0000000..eb0439d --- /dev/null +++ b/reference_scripts/8ZAUBSH9CM9OTpTL.js @@ -0,0 +1,11 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Perception"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "easy"}}); +await test.roll(); + +if (test.succeeded) +{ + this.actor.addCondition("stunned") +} +else if (test.failed) +{ + this.actor.addCondition("poisoned", 2); +} \ No newline at end of file diff --git a/reference_scripts/8araLuwmBq8GKEw3.js b/reference_scripts/8araLuwmBq8GKEw3.js new file mode 100644 index 0000000..66a5c92 --- /dev/null +++ b/reference_scripts/8araLuwmBq8GKEw3.js @@ -0,0 +1,7 @@ +let APIgnored = args.AP.layers.reduce((prev, current) => prev + ((current.weakpoints && !current.ignored) ? current.value : 0), 0) + +if (APIgnored) +{ + args.modifiers.ap.ignored += APIgnored + args.modifiers.ap.details.push(`${this.effect.name}: Ignore AP with Weakpoints (${APIgnored})`) +} \ No newline at end of file diff --git a/reference_scripts/8fefDfiYKFOWdPER.js b/reference_scripts/8fefDfiYKFOWdPER.js new file mode 100644 index 0000000..dc649cd --- /dev/null +++ b/reference_scripts/8fefDfiYKFOWdPER.js @@ -0,0 +1 @@ +args.update({texture : {scaleX : 2, scaleY: 2, src: "modules/wfrp4e-core/tokens/popout/gor.webp"}}); \ No newline at end of file diff --git a/reference_scripts/8g2iitsgaJarKQpr.js b/reference_scripts/8g2iitsgaJarKQpr.js new file mode 100644 index 0000000..4ce1574 --- /dev/null +++ b/reference_scripts/8g2iitsgaJarKQpr.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.V0c3qBU1CMm8bmsW") +let data = item.toObject() +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) diff --git a/reference_scripts/8gCja0mfKt4nYVZc.js b/reference_scripts/8gCja0mfKt4nYVZc.js new file mode 100644 index 0000000..d05c4f3 --- /dev/null +++ b/reference_scripts/8gCja0mfKt4nYVZc.js @@ -0,0 +1 @@ +args.fields.slBonus += 2 \ No newline at end of file diff --git a/reference_scripts/8hIyWDyfbgGAig65.js b/reference_scripts/8hIyWDyfbgGAig65.js new file mode 100644 index 0000000..bdf054c --- /dev/null +++ b/reference_scripts/8hIyWDyfbgGAig65.js @@ -0,0 +1 @@ +return ["ws", "bs", "s", "t", "ag", "dex"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/8jvEVPUCg3rKG48Y.js b/reference_scripts/8jvEVPUCg3rKG48Y.js new file mode 100644 index 0000000..38cef06 --- /dev/null +++ b/reference_scripts/8jvEVPUCg3rKG48Y.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.9fq6p9Q6H02LjaSi") +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/8noxHUQKR55Kx1YN.js b/reference_scripts/8noxHUQKR55Kx1YN.js new file mode 100644 index 0000000..d164bff --- /dev/null +++ b/reference_scripts/8noxHUQKR55Kx1YN.js @@ -0,0 +1 @@ +this.actor.system.status.corruption.max += 1 \ No newline at end of file diff --git a/reference_scripts/8oE0DTzz0krOfFlV.js b/reference_scripts/8oE0DTzz0krOfFlV.js new file mode 100644 index 0000000..e4d4736 --- /dev/null +++ b/reference_scripts/8oE0DTzz0krOfFlV.js @@ -0,0 +1,2 @@ +args.item.system.qualities.value.push({name : "magical"}) +args.item.system.qualities.value.push({name : "impact"}) diff --git a/reference_scripts/8rq4GL5d5nCn4kO7.js b/reference_scripts/8rq4GL5d5nCn4kO7.js new file mode 100644 index 0000000..79c9046 --- /dev/null +++ b/reference_scripts/8rq4GL5d5nCn4kO7.js @@ -0,0 +1,7 @@ +let caster = this.effect.sourceActor +if (caster) +{ + let healed= caster.characteristics.wp.bonus + this.actor.modifyWounds(healed); + this.script.scriptMessage(`${this.actor.prototypeToken.name} regains ${healed} Wounds`) +} \ No newline at end of file diff --git a/reference_scripts/8tyMXDfHR8AJBdDu.js b/reference_scripts/8tyMXDfHR8AJBdDu.js new file mode 100644 index 0000000..9e0a473 --- /dev/null +++ b/reference_scripts/8tyMXDfHR8AJBdDu.js @@ -0,0 +1,7 @@ +let weakpointsAP = args.AP.layers.filter(i => !i.ignored && i.weakpoints).reduce((ap, layer) => ap + layer.value, 0); + +if (weakpointsAP > 0) +{ + args.modifiers.ap.ignored += weakpointsAP; + args.modifiers.ap.details.push(`${this.effect.name} - Ignore Weakpoints (${weakpointsAP})`); +} \ No newline at end of file diff --git a/reference_scripts/8vpAtJ93GIeye1qj.js b/reference_scripts/8vpAtJ93GIeye1qj.js new file mode 100644 index 0000000..aefec45 --- /dev/null +++ b/reference_scripts/8vpAtJ93GIeye1qj.js @@ -0,0 +1 @@ +return args.type == "cast" \ No newline at end of file diff --git a/reference_scripts/8wG9l4T9fc1bM0TN.js b/reference_scripts/8wG9l4T9fc1bM0TN.js new file mode 100644 index 0000000..a043287 --- /dev/null +++ b/reference_scripts/8wG9l4T9fc1bM0TN.js @@ -0,0 +1,3 @@ +let item = (await fromUuid("Compendium.wfrp4e-core.items.Item.kJNAY1YRaCy9IgmT")).toObject(); +item.system.specification.value = 1; +this.actor.createEmbeddedDocuments("Item", [item], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/8yBr6VbdKcrWUuqw.js b/reference_scripts/8yBr6VbdKcrWUuqw.js new file mode 100644 index 0000000..ce24a5f --- /dev/null +++ b/reference_scripts/8yBr6VbdKcrWUuqw.js @@ -0,0 +1,4 @@ +this.actor.characteristics.i.value= "-" +this.actor.characteristics.int.value= "-" +this.actor.characteristics.wp.value= "-" +this.actor.characteristics.fel.value = "-" \ No newline at end of file diff --git a/reference_scripts/8zTkDVziBPaNbMQX.js b/reference_scripts/8zTkDVziBPaNbMQX.js new file mode 100644 index 0000000..c032cba --- /dev/null +++ b/reference_scripts/8zTkDVziBPaNbMQX.js @@ -0,0 +1,30 @@ +let filters = [ + { + property : "type", + value : "spell" + }, + { + property : "system.lore.value", + value : "petty" + } +] + +let petty = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 6, "Choose 6 Petty Spells") + + +filters = [ + { + property : "type", + value : "spell" + }, + { + property : "system.lore.value", + value : "" + } +] + +let arcane = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 9, "Choose 9 Arcane Spells") + +let items = petty.concat(arcane).map(i => i.toObject()) + +this.actor.createEmbeddedDocuments("Item", items); \ No newline at end of file diff --git a/reference_scripts/91S2GnBFYFbxmOCK.js b/reference_scripts/91S2GnBFYFbxmOCK.js new file mode 100644 index 0000000..3e28299 --- /dev/null +++ b/reference_scripts/91S2GnBFYFbxmOCK.js @@ -0,0 +1,2 @@ +this.actor.characteristics.s.bonus += 1 +this.actor.characteristics.s.calculationBonusModifier -= 1 \ No newline at end of file diff --git a/reference_scripts/93K85NnVwjVNXlZq.js b/reference_scripts/93K85NnVwjVNXlZq.js new file mode 100644 index 0000000..3b0ffe3 --- /dev/null +++ b/reference_scripts/93K85NnVwjVNXlZq.js @@ -0,0 +1 @@ +return !args.skill?.name.includes(game.i18n.localize("NAME.Trade")); \ No newline at end of file diff --git a/reference_scripts/956dUb5sd6OtbWZR.js b/reference_scripts/956dUb5sd6OtbWZR.js new file mode 100644 index 0000000..3f6bdb7 --- /dev/null +++ b/reference_scripts/956dUb5sd6OtbWZR.js @@ -0,0 +1 @@ +args.fields.successBonus++; \ No newline at end of file diff --git a/reference_scripts/96Y1yIH1lRjTs5hL.js b/reference_scripts/96Y1yIH1lRjTs5hL.js new file mode 100644 index 0000000..1fab3ce --- /dev/null +++ b/reference_scripts/96Y1yIH1lRjTs5hL.js @@ -0,0 +1,5 @@ +if (args.test.succeeded) + return + +if (args.test.characteristicKey == "wp") + this.actor.addCondition("broken") \ No newline at end of file diff --git a/reference_scripts/98nKfcimlaPeM9h5.js b/reference_scripts/98nKfcimlaPeM9h5.js new file mode 100644 index 0000000..dde67fd --- /dev/null +++ b/reference_scripts/98nKfcimlaPeM9h5.js @@ -0,0 +1,2 @@ +await this.actor.addCondition("bleeding") +await this.script.scriptMessage(await this.actor.applyBasicDamage(10, {suppressMsg : true})); \ No newline at end of file diff --git a/reference_scripts/9A7rYY3FKi5XLihG.js b/reference_scripts/9A7rYY3FKi5XLihG.js new file mode 100644 index 0000000..e8ade7a --- /dev/null +++ b/reference_scripts/9A7rYY3FKi5XLihG.js @@ -0,0 +1,6 @@ +fromUuid("Compendium.wfrp4e-core.items.5QcrpLQWWrsbKR79").then(item => { + let data = item.toObject(); + data.system.tests.value = data.system.tests.value.replace("coins", "metal objects"); + data.system.description.value += "This Talent also extends to any metal object because of Metallic Affinity
" + this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) +}) \ No newline at end of file diff --git a/reference_scripts/9EVj4bmZJex45Mt7.js b/reference_scripts/9EVj4bmZJex45Mt7.js new file mode 100644 index 0000000..a17d972 --- /dev/null +++ b/reference_scripts/9EVj4bmZJex45Mt7.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.Athletics"); \ No newline at end of file diff --git a/reference_scripts/9JnPK1jNUEso7Pv8.js b/reference_scripts/9JnPK1jNUEso7Pv8.js new file mode 100644 index 0000000..8c33cb3 --- /dev/null +++ b/reference_scripts/9JnPK1jNUEso7Pv8.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.9h82z72XGo9tfgQS") +let data = item.toObject(); +data.name += ` (Smell)` +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/9MDi3ok9gPwtbALf.js b/reference_scripts/9MDi3ok9gPwtbALf.js new file mode 100644 index 0000000..d6892bc --- /dev/null +++ b/reference_scripts/9MDi3ok9gPwtbALf.js @@ -0,0 +1 @@ +args.actor.details.move.value /= 2 \ No newline at end of file diff --git a/reference_scripts/9MwRUzRinhq1IjhG.js b/reference_scripts/9MwRUzRinhq1IjhG.js new file mode 100644 index 0000000..280ccc9 --- /dev/null +++ b/reference_scripts/9MwRUzRinhq1IjhG.js @@ -0,0 +1 @@ +args.actor.addCondition("grappling"); \ No newline at end of file diff --git a/reference_scripts/9RFoasDcFnYZ1txR.js b/reference_scripts/9RFoasDcFnYZ1txR.js new file mode 100644 index 0000000..8a60a20 --- /dev/null +++ b/reference_scripts/9RFoasDcFnYZ1txR.js @@ -0,0 +1 @@ +return args.skill?.name == game.i18n.localize("NAME.Perception"); \ No newline at end of file diff --git a/reference_scripts/9VfeubiCV83LN9iY.js b/reference_scripts/9VfeubiCV83LN9iY.js new file mode 100644 index 0000000..83f9f95 --- /dev/null +++ b/reference_scripts/9VfeubiCV83LN9iY.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM") +let data = item.toObject(); +data.name += ` (When Charging)` +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/9WZa63lr0K3SsP4G.js b/reference_scripts/9WZa63lr0K3SsP4G.js new file mode 100644 index 0000000..bac4c09 --- /dev/null +++ b/reference_scripts/9WZa63lr0K3SsP4G.js @@ -0,0 +1,7 @@ +let sourceItem = this.effect.sourceItem; + +if (sourceItem) +{ + this.actor.applyEffect({effectUuids : [sourceItem.effects.contents[2].uuid]}) + this.script.scriptNotification("Applied after effects"); +} \ No newline at end of file diff --git a/reference_scripts/9Yn9uViEjcuaESJ2.js b/reference_scripts/9Yn9uViEjcuaESJ2.js new file mode 100644 index 0000000..f964391 --- /dev/null +++ b/reference_scripts/9Yn9uViEjcuaESJ2.js @@ -0,0 +1,12 @@ +if (this.item.getFlag("wfrp4e", "failedCool")) +{ + this.item.name += " (No AP)" + this.item.system.AP = { + "head": 0, + "lArm": 0, + "rArm": 0, + "lLeg": 0, + "rLeg": 0, + "body": 0 + } +} \ No newline at end of file diff --git a/reference_scripts/9ZFPDCk8M2TQxh7x.js b/reference_scripts/9ZFPDCk8M2TQxh7x.js new file mode 100644 index 0000000..3529480 --- /dev/null +++ b/reference_scripts/9ZFPDCk8M2TQxh7x.js @@ -0,0 +1 @@ +args.fields.modifier += 20 diff --git a/reference_scripts/9bJGJrLqslV5lBya.js b/reference_scripts/9bJGJrLqslV5lBya.js new file mode 100644 index 0000000..9023650 --- /dev/null +++ b/reference_scripts/9bJGJrLqslV5lBya.js @@ -0,0 +1 @@ + return args.characteristic == "bs" \ No newline at end of file diff --git a/reference_scripts/9eWR4mdaoCSQawDT.js b/reference_scripts/9eWR4mdaoCSQawDT.js new file mode 100644 index 0000000..82e0ef9 --- /dev/null +++ b/reference_scripts/9eWR4mdaoCSQawDT.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.GlShFJF2TpsNh1FX"); +let data = item.toObject(); +data.system.location.key = this.item.system.location.key +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id}) diff --git a/reference_scripts/9fK07tqqZyPg7dpx.js b/reference_scripts/9fK07tqqZyPg7dpx.js new file mode 100644 index 0000000..baccb76 --- /dev/null +++ b/reference_scripts/9fK07tqqZyPg7dpx.js @@ -0,0 +1,12 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty: "veasy"}}) +await test.roll(); +if (test.failed) +{ + this.script.scriptNotification("Gained a Festering Wound") + let item = await fromUuid("Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb") + this.actor.createEmbeddedDocuments("Item", [item.toObject()]) +} +else +{ + this.script.scriptNotification("Avoided a Festering Wound") +} diff --git a/reference_scripts/9nroaZDkW3WXNkB7.js b/reference_scripts/9nroaZDkW3WXNkB7.js new file mode 100644 index 0000000..64deeef --- /dev/null +++ b/reference_scripts/9nroaZDkW3WXNkB7.js @@ -0,0 +1,2 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.Item.4MJJCiOKPkBByYwW"); +this.actor.createEmbeddedDocuments("Item", [item], {fromEffect: this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/9ob2lPnk3PDot9Tx.js b/reference_scripts/9ob2lPnk3PDot9Tx.js new file mode 100644 index 0000000..1edbafd --- /dev/null +++ b/reference_scripts/9ob2lPnk3PDot9Tx.js @@ -0,0 +1 @@ +this.actor.addCondition("blinded", this.effect.sourceTest.result.SL) \ No newline at end of file diff --git a/reference_scripts/9qWUuEF8F5nehF1y.js b/reference_scripts/9qWUuEF8F5nehF1y.js new file mode 100644 index 0000000..442e3d1 --- /dev/null +++ b/reference_scripts/9qWUuEF8F5nehF1y.js @@ -0,0 +1,2 @@ +args.item.system.qualities.value = args.item.system.qualities.value.concat([{name : "magical"}, {name : "unbreakable"}]) +args.item.system.damage.value += ` + ${this.effect.sourceActor.system.characteristics.wp.bonus}` \ No newline at end of file diff --git a/reference_scripts/A0OK0qAMmnf8iNJf.js b/reference_scripts/A0OK0qAMmnf8iNJf.js new file mode 100644 index 0000000..b3df7c5 --- /dev/null +++ b/reference_scripts/A0OK0qAMmnf8iNJf.js @@ -0,0 +1,8 @@ +if (args.test.result.SL < 0) +{ + this.script.scriptMessage(`Gained ${Math.abs(args.test.result.SL)} Corruption points`, {whisper : ChatMessage.getWhisperRecipients("GM")}) + if (args.test.failed && this.actor.type == "character") + { + this.actor.update({"system.status.corruption.value" : parseInt(this.actor.status.corruption.value) + Math.abs(args.test.result.SL)}) + } +} \ No newline at end of file diff --git a/reference_scripts/A1odAcuRbq9797ZB.js b/reference_scripts/A1odAcuRbq9797ZB.js new file mode 100644 index 0000000..04c6e12 --- /dev/null +++ b/reference_scripts/A1odAcuRbq9797ZB.js @@ -0,0 +1,94 @@ +let choice1 = [ + { + type : "skill", + name : "Melee (Basic)", + diff : { + system : { + advances : { + value : 10 + } + } + } + } +] +let choice2 = [ + { + type : "skill", + name : "Melee (Polearm)", + diff : { + system : { + advances : { + value : 10 + } + } + } + } +] + +let choice = await Dialog.wait({ + title : "Choice", + content : + `+ Select your choice +
+Apply damage with ${this.effect.name} to attacker?`,
+ buttons: {
+ yes: {
+ label: "Yes",
+ callback: () => {
+ return true;
+ }
+ },
+ no: {
+ label: "No",
+ callback: () => {
+ return false;
+ }
+ }
+ }
+ })
+
+ if (choice)
+ {
+ this.script.scriptMessage(await args.attacker.applyBasicDamage(this.actor.system.characteristics.wp.bonus, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}));
+ }
+}
\ No newline at end of file
diff --git a/reference_scripts/CkE8NZOhzPkuRrKJ.js b/reference_scripts/CkE8NZOhzPkuRrKJ.js
new file mode 100644
index 0000000..d4e519f
--- /dev/null
+++ b/reference_scripts/CkE8NZOhzPkuRrKJ.js
@@ -0,0 +1,14 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.MnMZv7ZXoRqoH9dS")
+let data = item.toObject();
+data.system.location.key = this.item.system.location.key
+this.actor.createEmbeddedDocuments("Item", [data])
+
+
+
+
+let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields: {difficulty: "hard"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})
+await test.roll();
+if (test.failed)
+{
+ this.actor.addCondition("unconscious")
+}
\ No newline at end of file
diff --git a/reference_scripts/CoImIH9OCMx9DfQZ.js b/reference_scripts/CoImIH9OCMx9DfQZ.js
new file mode 100644
index 0000000..d5f9737
--- /dev/null
+++ b/reference_scripts/CoImIH9OCMx9DfQZ.js
@@ -0,0 +1,4 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.nbhn2wX35b7Jrcbg")
+let data = item.toObject();
+data.system.location.value = "Jaw"
+this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id})
\ No newline at end of file
diff --git a/reference_scripts/D5XmzrUGFa1JN0cl.js b/reference_scripts/D5XmzrUGFa1JN0cl.js
new file mode 100644
index 0000000..fe0c170
--- /dev/null
+++ b/reference_scripts/D5XmzrUGFa1JN0cl.js
@@ -0,0 +1,2 @@
+args.prefillModifiers.modifier += 10
+
diff --git a/reference_scripts/DANLE5HxrkTNelhl.js b/reference_scripts/DANLE5HxrkTNelhl.js
new file mode 100644
index 0000000..e8601ac
--- /dev/null
+++ b/reference_scripts/DANLE5HxrkTNelhl.js
@@ -0,0 +1 @@
+args.wounds += 4;
\ No newline at end of file
diff --git a/reference_scripts/DBafsY1HrclJRTtA.js b/reference_scripts/DBafsY1HrclJRTtA.js
new file mode 100644
index 0000000..b3311bb
--- /dev/null
+++ b/reference_scripts/DBafsY1HrclJRTtA.js
@@ -0,0 +1 @@
+return args.type != "cast"
\ No newline at end of file
diff --git a/reference_scripts/DHxUKY9LMyifFgCi.js b/reference_scripts/DHxUKY9LMyifFgCi.js
new file mode 100644
index 0000000..a9beef0
--- /dev/null
+++ b/reference_scripts/DHxUKY9LMyifFgCi.js
@@ -0,0 +1 @@
+return args.skill?.name == "Trade (Apothecary)" || args.skill?.name == "Trade (Alchemist)"
\ No newline at end of file
diff --git a/reference_scripts/DL9vYNft9aXdV2aW.js b/reference_scripts/DL9vYNft9aXdV2aW.js
new file mode 100644
index 0000000..ef975b7
--- /dev/null
+++ b/reference_scripts/DL9vYNft9aXdV2aW.js
@@ -0,0 +1,12 @@
+let tooth = await fromUuid("Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv")
+tooth = tooth.toObject()
+tooth.system.specification.value = 3
+tooth.system.qualities.value = [{name : "magical"}]
+
+let claw = await fromUuid("Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM")
+claw = claw.toObject()
+claw.system.specification.value = 4
+claw.system.qualities.value = [{name : "magical"}]
+claw.name = "Claw"
+
+this.actor.createEmbeddedDocuments("Item", [tooth, claw], {fromEffect : this.effect.id})
\ No newline at end of file
diff --git a/reference_scripts/DMQ0taEpBUJU5njV.js b/reference_scripts/DMQ0taEpBUJU5njV.js
new file mode 100644
index 0000000..8fb1dd8
--- /dev/null
+++ b/reference_scripts/DMQ0taEpBUJU5njV.js
@@ -0,0 +1 @@
+args.actor.status.fortune.value = 0
\ No newline at end of file
diff --git a/reference_scripts/DTiHS6RfwhF4THbf.js b/reference_scripts/DTiHS6RfwhF4THbf.js
new file mode 100644
index 0000000..1a7339b
--- /dev/null
+++ b/reference_scripts/DTiHS6RfwhF4THbf.js
@@ -0,0 +1 @@
+return args.skill?.name != game.i18n.localize("NAME.Drive") && !args.skill?.name.includes(game.i18n.localize("NAME.Ride"));
\ No newline at end of file
diff --git a/reference_scripts/DVlZGbiuMIHEQOnM.js b/reference_scripts/DVlZGbiuMIHEQOnM.js
new file mode 100644
index 0000000..4395d41
--- /dev/null
+++ b/reference_scripts/DVlZGbiuMIHEQOnM.js
@@ -0,0 +1,10 @@
+if (this.actor.getFlag("wfrp4e", "isAttached"))
+{
+ let roll = await new Roll("1d10").roll()
+ await roll.toMessage(this.script.getChatData());
+ if (roll.total == 9 || roll.total == 10)
+ {
+ this.script.scriptMessage(`${this.actor.name} attached to ${this.actor.getFlag("wfrp4e", "isAttached")} gorges and falls off.`)
+ await this.actor.unsetFlag("wfrp4e", "isAttached")
+ }
+ }
\ No newline at end of file
diff --git a/reference_scripts/DWBxvzfWGcG7PVNP.js b/reference_scripts/DWBxvzfWGcG7PVNP.js
new file mode 100644
index 0000000..789e83f
--- /dev/null
+++ b/reference_scripts/DWBxvzfWGcG7PVNP.js
@@ -0,0 +1,5 @@
+let letter = this.item.system.location.key[0]; // "l" or "r";
+
+this.item.updateSource({"system.location.key" : letter + "Finger"})
+
+// We want the location to be Right or Left Hand, but the key to be rFinger or lFinger
\ No newline at end of file
diff --git a/reference_scripts/DcSJNRBXE9ZBBY7T.js b/reference_scripts/DcSJNRBXE9ZBBY7T.js
new file mode 100644
index 0000000..22c294b
--- /dev/null
+++ b/reference_scripts/DcSJNRBXE9ZBBY7T.js
@@ -0,0 +1 @@
+this.actor.addCondition("blinded", Math.max(0, this.effect.sourceTest.result.SL))
\ No newline at end of file
diff --git a/reference_scripts/DhZqJso1JWYtGrKk.js b/reference_scripts/DhZqJso1JWYtGrKk.js
new file mode 100644
index 0000000..5808036
--- /dev/null
+++ b/reference_scripts/DhZqJso1JWYtGrKk.js
@@ -0,0 +1,3 @@
+this.actor.addCondition("ablaze")
+let damage = this.effect.sourceTest.result.damage + this.effect.sourceTest.result.additionalDamage
+this.script.scriptMessage(await this.actor.applyBasicDamage(damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}))
\ No newline at end of file
diff --git a/reference_scripts/DmbWR9s5I8LHBwxB.js b/reference_scripts/DmbWR9s5I8LHBwxB.js
new file mode 100644
index 0000000..0875467
--- /dev/null
+++ b/reference_scripts/DmbWR9s5I8LHBwxB.js
@@ -0,0 +1,14 @@
+let column = await ValueDialog.create("Select the column to roll on to determine Beast Head", "Select Column", "", ["Undivided", "Khorne", "Nurgle", "Slaanesh", "Tzeentch"]);
+
+if (column)
+{
+ let result = await game.wfrp4e.tables.rollTable("beasthead", {}, column);
+ this.script.scriptMessage(`${result.title}
${result.result}`);
+ let uuid = `Compendium.${result.object.documentCollection}.${result.object.documentId}`;
+ let item = await fromUuid(uuid);
+ if (item)
+ {
+ this.actor.createEmbeddedDocuments("Item", [item])
+ this.item.delete();
+ }
+}
\ No newline at end of file
diff --git a/reference_scripts/DpdSEHM6NMN1ey6h.js b/reference_scripts/DpdSEHM6NMN1ey6h.js
new file mode 100644
index 0000000..aa9268a
--- /dev/null
+++ b/reference_scripts/DpdSEHM6NMN1ey6h.js
@@ -0,0 +1,4 @@
+if (parseInt(this.item.system.specification.value) > 0)
+{
+ this.actor.system.status.ward.value = parseInt(this.item.system.specification.value);
+}
\ No newline at end of file
diff --git a/reference_scripts/DqJFo74trI916qXN.js b/reference_scripts/DqJFo74trI916qXN.js
new file mode 100644
index 0000000..a2791f0
--- /dev/null
+++ b/reference_scripts/DqJFo74trI916qXN.js
@@ -0,0 +1,3 @@
+let fatigued = args.actor.hasCondition("fatigued")
+if (fatigued)
+ setProperty(fatigued, "flags.wfrp4e.scriptData", getProperty(fatigued, "flags.wfrp4e.scriptData").filter(s => s.trigger != "dialog"))
\ No newline at end of file
diff --git a/reference_scripts/DsE6rTSzxEn6uWMz.js b/reference_scripts/DsE6rTSzxEn6uWMz.js
new file mode 100644
index 0000000..63b87e9
--- /dev/null
+++ b/reference_scripts/DsE6rTSzxEn6uWMz.js
@@ -0,0 +1,7 @@
+let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "average"}})
+await test.roll();
+if (test.failed)
+{
+ await this.actor.addCondition("blinded");
+ await this.actor.addCondition("fatigued")
+}
\ No newline at end of file
diff --git a/reference_scripts/DuM5l2Yb4bdvDeaG.js b/reference_scripts/DuM5l2Yb4bdvDeaG.js
new file mode 100644
index 0000000..ddbd4db
--- /dev/null
+++ b/reference_scripts/DuM5l2Yb4bdvDeaG.js
@@ -0,0 +1 @@
+return args.skill?.name != "Athletics"
\ No newline at end of file
diff --git a/reference_scripts/DxQnamsb2AuW0p2e.js b/reference_scripts/DxQnamsb2AuW0p2e.js
new file mode 100644
index 0000000..fbdcd2f
--- /dev/null
+++ b/reference_scripts/DxQnamsb2AuW0p2e.js
@@ -0,0 +1 @@
+return !args.skill?.name.includes(game.i18n.localize("NAME.Lore"));
\ No newline at end of file
diff --git a/reference_scripts/DyZ1jH88EAp1ueOK.js b/reference_scripts/DyZ1jH88EAp1ueOK.js
new file mode 100644
index 0000000..3b86fbc
--- /dev/null
+++ b/reference_scripts/DyZ1jH88EAp1ueOK.js
@@ -0,0 +1,5 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.GlShFJF2TpsNh1FX")
+let data = item.toObject();
+data.system.location.key = this.item.system.location.key
+data.system.location.value = data.system.location.value.replace("Arm", "Wrist")
+this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id})
diff --git a/reference_scripts/E1Xo4RVuN1YRRxg7.js b/reference_scripts/E1Xo4RVuN1YRRxg7.js
new file mode 100644
index 0000000..d6efa41
--- /dev/null
+++ b/reference_scripts/E1Xo4RVuN1YRRxg7.js
@@ -0,0 +1 @@
+return args.item?.attackType != "ranged"
\ No newline at end of file
diff --git a/reference_scripts/E1vUepgop09FF5wy.js b/reference_scripts/E1vUepgop09FF5wy.js
new file mode 100644
index 0000000..3da19b7
--- /dev/null
+++ b/reference_scripts/E1vUepgop09FF5wy.js
@@ -0,0 +1,22 @@
+if (this.actor.system.status.advantage.value == 0)
+{
+ return this.script.scriptNotification("Not enough Advantage!", "error")
+}
+
+let hatred = await fromUuid("Compendium.wfrp4e-core.items.Item.aE3pyW20Orvdjzj0")
+let frenzy = await fromUuid("Compendium.wfrp4e-core.items.Item.yRhhOlt18COq4e1q");
+
+if (this.actor.system.status.advantage.value >= 3)
+{
+ this.script.scriptNotification(`Adding ${frenzy.name}`)
+ this.actor.setAdvantage(0)
+ this.actor.createEmbeddedDocuments("Item", [frenzy])
+}
+else if (this.actor.system.status.advantage.value >= 1)
+{
+ let data = hatred.toObject();
+ data.system.specification.value = "Close Combat opponents"
+ this.script.scriptNotification(`Adding ${hatred.name}`)
+ this.actor.setAdvantage(0)
+ this.actor.createEmbeddedDocuments("Item", [data])
+}
\ No newline at end of file
diff --git a/reference_scripts/E2VfOVuju67qO3VL.js b/reference_scripts/E2VfOVuju67qO3VL.js
new file mode 100644
index 0000000..200ae8f
--- /dev/null
+++ b/reference_scripts/E2VfOVuju67qO3VL.js
@@ -0,0 +1,5 @@
+let blinded = this.actor.hasCondition("blinded");
+if (blinded.getFlag("wfrp4e", "nightshroud"))
+{
+ blinded.delete()
+}
\ No newline at end of file
diff --git a/reference_scripts/E4CHDe1xfmcV3oGv.js b/reference_scripts/E4CHDe1xfmcV3oGv.js
new file mode 100644
index 0000000..c1e0400
--- /dev/null
+++ b/reference_scripts/E4CHDe1xfmcV3oGv.js
@@ -0,0 +1 @@
+return args.skill?.name == game.i18n.localize("NAME.Navigation");
\ No newline at end of file
diff --git a/reference_scripts/E6DMqfDeczqmVMFV.js b/reference_scripts/E6DMqfDeczqmVMFV.js
new file mode 100644
index 0000000..2a0bc28
--- /dev/null
+++ b/reference_scripts/E6DMqfDeczqmVMFV.js
@@ -0,0 +1,3 @@
+let test = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "average"}})
+
+await test.roll();
\ No newline at end of file
diff --git a/reference_scripts/E7D4bxz8gy4e1wL7.js b/reference_scripts/E7D4bxz8gy4e1wL7.js
new file mode 100644
index 0000000..ec82dce
--- /dev/null
+++ b/reference_scripts/E7D4bxz8gy4e1wL7.js
@@ -0,0 +1 @@
+if (["Stealth (Rural)", "Track", "Outdoor Survival", "Swim", "Perception", "Intuition"].includes(args.item?.name))
\ No newline at end of file
diff --git a/reference_scripts/EGWF3LHav3e2zFL4.js b/reference_scripts/EGWF3LHav3e2zFL4.js
new file mode 100644
index 0000000..cb217a7
--- /dev/null
+++ b/reference_scripts/EGWF3LHav3e2zFL4.js
@@ -0,0 +1 @@
+return args.skill?.name.includes(game.i18n.localize("NAME.Ranged")) || args.item?.isRanged || args.item?.name == game.i18n.localize("NAME.Charm");
\ No newline at end of file
diff --git a/reference_scripts/EJObiSth3WdcJOXN.js b/reference_scripts/EJObiSth3WdcJOXN.js
new file mode 100644
index 0000000..a98ecba
--- /dev/null
+++ b/reference_scripts/EJObiSth3WdcJOXN.js
@@ -0,0 +1,5 @@
+if (args.test.characteristicKey == "wp" && args.test.failed && args.test.result.SL <= -3)
+{
+ this.script.scriptNotification("Adding Prone");
+ this.actor.addCondition("prone")
+}
\ No newline at end of file
diff --git a/reference_scripts/EJaBfqADqlo92Fx6.js b/reference_scripts/EJaBfqADqlo92Fx6.js
new file mode 100644
index 0000000..9fd2959
--- /dev/null
+++ b/reference_scripts/EJaBfqADqlo92Fx6.js
@@ -0,0 +1,4 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.oGbDwnLOn3isPJpO")
+let data = item.toObject();
+data.name += " (To Be Determined)"
+this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id})
\ No newline at end of file
diff --git a/reference_scripts/EKkdyp51Wf4csw2B.js b/reference_scripts/EKkdyp51Wf4csw2B.js
new file mode 100644
index 0000000..e3d745d
--- /dev/null
+++ b/reference_scripts/EKkdyp51Wf4csw2B.js
@@ -0,0 +1 @@
+return this.actor.statuses.has("frenzy");
\ No newline at end of file
diff --git a/reference_scripts/ENGmwaItRXO5s0XY.js b/reference_scripts/ENGmwaItRXO5s0XY.js
new file mode 100644
index 0000000..0a79fa7
--- /dev/null
+++ b/reference_scripts/ENGmwaItRXO5s0XY.js
@@ -0,0 +1,5 @@
+await this.actor.modifyWounds(this.actor.system.characteristics.t.bonus * 3)
+this.script.scriptMessage(`Heals ${this.actor.system.characteristics.t.bonus * 3} Wounds`)
+
+this.actor.hasCondition("bleeding")?.delete()
+this.actor.hasCondition("fatigued")?.delete()
diff --git a/reference_scripts/EQ5dtGW5kQhtAb87.js b/reference_scripts/EQ5dtGW5kQhtAb87.js
new file mode 100644
index 0000000..767e730
--- /dev/null
+++ b/reference_scripts/EQ5dtGW5kQhtAb87.js
@@ -0,0 +1,7 @@
+await this.actor.addCondition("prone")
+let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields: {difficulty : "hard"}, skipTargets: true, appendTitle : " - " + this.effect.name})
+await test.roll();
+if (test.failed)
+{
+ await this.actor.addCondition("stunned")
+}
\ No newline at end of file
diff --git a/reference_scripts/ERxrWzSpw8qwxFVi.js b/reference_scripts/ERxrWzSpw8qwxFVi.js
new file mode 100644
index 0000000..e0eaff5
--- /dev/null
+++ b/reference_scripts/ERxrWzSpw8qwxFVi.js
@@ -0,0 +1 @@
+this.script.scriptNotification(`Cannot enter ${this.effect.name}!`); this.actor.addCondition("broken");
\ No newline at end of file
diff --git a/reference_scripts/EU5j0hnDTG9Z6d1e.js b/reference_scripts/EU5j0hnDTG9Z6d1e.js
new file mode 100644
index 0000000..82d6a1d
--- /dev/null
+++ b/reference_scripts/EU5j0hnDTG9Z6d1e.js
@@ -0,0 +1,6 @@
+let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: "hard"}})
+await test.roll();
+if(test.failed)
+{
+ this.actor.addCondition("stunned", 2)
+}
\ No newline at end of file
diff --git a/reference_scripts/EVBSHEC5nmmj2X41.js b/reference_scripts/EVBSHEC5nmmj2X41.js
new file mode 100644
index 0000000..c08a5ea
--- /dev/null
+++ b/reference_scripts/EVBSHEC5nmmj2X41.js
@@ -0,0 +1 @@
+return args.skill?.name != game.i18n.localize("NAME.Climb") && !args.skill?.name?.includes(game.i18n.localize("NAME.Stealth"));
\ No newline at end of file
diff --git a/reference_scripts/EYny6z5oTOhxGDfb.js b/reference_scripts/EYny6z5oTOhxGDfb.js
new file mode 100644
index 0000000..087904f
--- /dev/null
+++ b/reference_scripts/EYny6z5oTOhxGDfb.js
@@ -0,0 +1 @@
+args.fields.modifier -= 10;
diff --git a/reference_scripts/EaSNOmXUxAkUHnm5.js b/reference_scripts/EaSNOmXUxAkUHnm5.js
new file mode 100644
index 0000000..89a428d
--- /dev/null
+++ b/reference_scripts/EaSNOmXUxAkUHnm5.js
@@ -0,0 +1,2 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb")
+this.actor.createEmbeddedDocuments("Item", [item], {fromEffect: this.effect.id})
\ No newline at end of file
diff --git a/reference_scripts/Eay7GpDyfsEE40jT.js b/reference_scripts/Eay7GpDyfsEE40jT.js
new file mode 100644
index 0000000..14f4feb
--- /dev/null
+++ b/reference_scripts/Eay7GpDyfsEE40jT.js
@@ -0,0 +1,4 @@
+if (args.totalWoundLoss > 0)
+{
+ args.actor.addCondition("ablaze")
+}
\ No newline at end of file
diff --git a/reference_scripts/EdTChmSouS0MSmk5.js b/reference_scripts/EdTChmSouS0MSmk5.js
new file mode 100644
index 0000000..b5c9aed
--- /dev/null
+++ b/reference_scripts/EdTChmSouS0MSmk5.js
@@ -0,0 +1,10 @@
+let test = await this.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})
+await test.roll();
+if (test.succeeded)
+{
+ this.script.scriptMessage("Can perform an Action or Move (choose one)")
+}
+else
+{
+ this.script.scriptMessage("Cannot perform an Action or Move this round")
+}
\ No newline at end of file
diff --git a/reference_scripts/EiLaZW4b4ypw5sLV.js b/reference_scripts/EiLaZW4b4ypw5sLV.js
new file mode 100644
index 0000000..7761e61
--- /dev/null
+++ b/reference_scripts/EiLaZW4b4ypw5sLV.js
@@ -0,0 +1,2 @@
+// can't use Damage application type because that checks if wounds were dealt
+args.actor.applyEffect({effectUuids : this.item.effects.contents[0].uuid})
\ No newline at end of file
diff --git a/reference_scripts/EmXwcuycEH8slEn5.js b/reference_scripts/EmXwcuycEH8slEn5.js
new file mode 100644
index 0000000..4bd0b62
--- /dev/null
+++ b/reference_scripts/EmXwcuycEH8slEn5.js
@@ -0,0 +1,6 @@
+let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: "hard"}})
+await test.roll();
+if(test.failed)
+{
+ this.actor.addCondition("unconscious")
+}
\ No newline at end of file
diff --git a/reference_scripts/EmmG49pMOPHRwDzR.js b/reference_scripts/EmmG49pMOPHRwDzR.js
new file mode 100644
index 0000000..8c92354
--- /dev/null
+++ b/reference_scripts/EmmG49pMOPHRwDzR.js
@@ -0,0 +1,8 @@
+ let roll = Math.ceil(CONFIG.Dice.randomUniform() * 10)
+ if (args.test.isFumble && roll == 1 && !args.test.result.misfire)
+ {
+ args.test.result.misfire = game.i18n.localize("Misfire") + " (Rolled 1)"
+ args.test.result.misfireDamage = eval(parseInt(args.test.result.roll.toString().split('').pop()) + args.test.item.Damage)
+ }
+ else if (args.test.isFumble && roll != 1)
+ args.test.result.other.push("Misfire Roll: " + roll)
diff --git a/reference_scripts/EpdMj9d9SYPeP44q.js b/reference_scripts/EpdMj9d9SYPeP44q.js
new file mode 100644
index 0000000..ebf9773
--- /dev/null
+++ b/reference_scripts/EpdMj9d9SYPeP44q.js
@@ -0,0 +1 @@
+return args.characteristic != "ag" && args.item?.id != this.item?.id
\ No newline at end of file
diff --git a/reference_scripts/ErgOwSiVnm9VLVHN.js b/reference_scripts/ErgOwSiVnm9VLVHN.js
new file mode 100644
index 0000000..f81a403
--- /dev/null
+++ b/reference_scripts/ErgOwSiVnm9VLVHN.js
@@ -0,0 +1,2 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.Item.DrNUTPeodEgpWTnT")
+this.actor.createEmbeddedDocuments("Item", [item], {fromEffect : this.effect.id})
\ No newline at end of file
diff --git a/reference_scripts/Et4tPHlrkueLqP3T.js b/reference_scripts/Et4tPHlrkueLqP3T.js
new file mode 100644
index 0000000..46d8efd
--- /dev/null
+++ b/reference_scripts/Et4tPHlrkueLqP3T.js
@@ -0,0 +1 @@
+if (args.item.type == "skill") args.item.system.modifier.value -= 10
\ No newline at end of file
diff --git a/reference_scripts/Ew3C2WmLCtc1KT46.js b/reference_scripts/Ew3C2WmLCtc1KT46.js
new file mode 100644
index 0000000..9e8991b
--- /dev/null
+++ b/reference_scripts/Ew3C2WmLCtc1KT46.js
@@ -0,0 +1 @@
+return args.skill?.name.includes(game.i18n.localize("NAME.Stealth")) || args.item?.id == this.item?.id
\ No newline at end of file
diff --git a/reference_scripts/EwD053Fyy46b59ZI.js b/reference_scripts/EwD053Fyy46b59ZI.js
new file mode 100644
index 0000000..4512a9a
--- /dev/null
+++ b/reference_scripts/EwD053Fyy46b59ZI.js
@@ -0,0 +1,2 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.Item.6l3jvIAvrKxt0lA9");
+this.actor.createEmbeddedDocuments("Item", [item], {fromEffect: this.effect.id})
\ No newline at end of file
diff --git a/reference_scripts/Eye6dranWpNsILjm.js b/reference_scripts/Eye6dranWpNsILjm.js
new file mode 100644
index 0000000..917fad5
--- /dev/null
+++ b/reference_scripts/Eye6dranWpNsILjm.js
@@ -0,0 +1,4 @@
+if (this.actor.system.status.wounds.value <= 1)
+{
+ this.effect.delete();
+}
\ No newline at end of file
diff --git a/reference_scripts/F4aGsdzJ9SYcX57F.js b/reference_scripts/F4aGsdzJ9SYcX57F.js
new file mode 100644
index 0000000..57eb47b
--- /dev/null
+++ b/reference_scripts/F4aGsdzJ9SYcX57F.js
@@ -0,0 +1,10 @@
+if (args.equipped)
+{
+ let item = await fromUuid("Compendium.wfrp4e-core.items.HpFkVJ2lYPAWumUL")
+ let data = item.toObject();
+ this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id})
+}
+else
+{
+ this.effect.deleteCreatedItems();
+}
\ No newline at end of file
diff --git a/reference_scripts/FAB12eLcSCAOOQwk.js b/reference_scripts/FAB12eLcSCAOOQwk.js
new file mode 100644
index 0000000..4e92511
--- /dev/null
+++ b/reference_scripts/FAB12eLcSCAOOQwk.js
@@ -0,0 +1 @@
+this.script.scirptMessage(await this.actor.applyBasicDamage(20, {suppressMsg: true});
\ No newline at end of file
diff --git a/reference_scripts/FAf4iXj5LkdvukS2.js b/reference_scripts/FAf4iXj5LkdvukS2.js
new file mode 100644
index 0000000..a39a05c
--- /dev/null
+++ b/reference_scripts/FAf4iXj5LkdvukS2.js
@@ -0,0 +1 @@
+fromUuid("Compendium.wfrp4e-wom.items.0Xdm4r7l2EwC4fcg").then(item => Item.create(item.toObject(), {fromEffect : this.effect.id, parent : this.actor}))
\ No newline at end of file
diff --git a/reference_scripts/FMA16PvoObBV8vDl.js b/reference_scripts/FMA16PvoObBV8vDl.js
new file mode 100644
index 0000000..873a4f2
--- /dev/null
+++ b/reference_scripts/FMA16PvoObBV8vDl.js
@@ -0,0 +1,5 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.EO05HX7jql0g605A")
+item = item.toObject()
+item.system.specification.value = 20
+this.actor.createEmbeddedDocuments("Item", [item], {fromEffect : this.effect.id})
+this.script.scriptNotification(item.name + " added")
\ No newline at end of file
diff --git a/reference_scripts/FMSN5uRskkATexzB.js b/reference_scripts/FMSN5uRskkATexzB.js
new file mode 100644
index 0000000..913a79d
--- /dev/null
+++ b/reference_scripts/FMSN5uRskkATexzB.js
@@ -0,0 +1 @@
+game.wfrp4e.tables.rollToChat("crithead")
\ No newline at end of file
diff --git a/reference_scripts/FSqUqSByMiztYOQM.js b/reference_scripts/FSqUqSByMiztYOQM.js
new file mode 100644
index 0000000..5bf62e7
--- /dev/null
+++ b/reference_scripts/FSqUqSByMiztYOQM.js
@@ -0,0 +1,2 @@
+if (args.totalWoundLoss > 0)
+ this.script.scriptMessage(`Infected: ${args.actor.name} must pass an Easy (+40) Endurance Test or gain a @UUID[Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb]{Festering Wound}`, {whisper: ChatMessage.getWhisperRecipients("GM") })
\ No newline at end of file
diff --git a/reference_scripts/FUgCtIoj1Stgqxt7.js b/reference_scripts/FUgCtIoj1Stgqxt7.js
new file mode 100644
index 0000000..acd0a25
--- /dev/null
+++ b/reference_scripts/FUgCtIoj1Stgqxt7.js
@@ -0,0 +1 @@
+return !["ws", "bs", "s", "ag", "t", "dex"].includes(args.characteristic)
\ No newline at end of file
diff --git a/reference_scripts/FXuyiJoXdAh6WhRK.js b/reference_scripts/FXuyiJoXdAh6WhRK.js
new file mode 100644
index 0000000..6e7b684
--- /dev/null
+++ b/reference_scripts/FXuyiJoXdAh6WhRK.js
@@ -0,0 +1 @@
+return args.skill?.name == "Ride (Horse)" && game.combat?.active
\ No newline at end of file
diff --git a/reference_scripts/FXwfqF0jpXlBQ9Y3.js b/reference_scripts/FXwfqF0jpXlBQ9Y3.js
new file mode 100644
index 0000000..31fa389
--- /dev/null
+++ b/reference_scripts/FXwfqF0jpXlBQ9Y3.js
@@ -0,0 +1 @@
+return args.item?.system?.isMelee && this.actor.attacker
\ No newline at end of file
diff --git a/reference_scripts/FYUPfYyTYZkxRLFT.js b/reference_scripts/FYUPfYyTYZkxRLFT.js
new file mode 100644
index 0000000..35e86d3
--- /dev/null
+++ b/reference_scripts/FYUPfYyTYZkxRLFT.js
@@ -0,0 +1 @@
+return !["NAME.Endurance", "NAME.Cool"].map(i => game.i18n.localize(i)).includes(args.skill?.name)
\ No newline at end of file
diff --git a/reference_scripts/FZFOC7bip0oiWEzk.js b/reference_scripts/FZFOC7bip0oiWEzk.js
new file mode 100644
index 0000000..11e7cfd
--- /dev/null
+++ b/reference_scripts/FZFOC7bip0oiWEzk.js
@@ -0,0 +1,5 @@
+if (args.opposedTest.result.hitloc.value == this.item.system.location.key && args.totalWoundLoss > 0)
+{
+ args.actor.addCondition("bleeding", 2);
+ this.script.scriptNotification("Added Bleeding")
+}
\ No newline at end of file
diff --git a/reference_scripts/FciJSTq7dZsZIPgl.js b/reference_scripts/FciJSTq7dZsZIPgl.js
new file mode 100644
index 0000000..0da31e8
--- /dev/null
+++ b/reference_scripts/FciJSTq7dZsZIPgl.js
@@ -0,0 +1,10 @@
+if (args.equipped)
+{
+ let item = await fromUuid("Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR")
+ let data = item.toObject();
+ this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id})
+}
+else
+{
+ this.effect.deleteCreatedItems();
+}
\ No newline at end of file
diff --git a/reference_scripts/FfTqCPxCoxwGDTQs.js b/reference_scripts/FfTqCPxCoxwGDTQs.js
new file mode 100644
index 0000000..bc75552
--- /dev/null
+++ b/reference_scripts/FfTqCPxCoxwGDTQs.js
@@ -0,0 +1,3 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.wMwSRDmgiF2IdCJr")
+let data = item.toObject()
+this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id})
diff --git a/reference_scripts/FiD3mvWIBHNNIuO9.js b/reference_scripts/FiD3mvWIBHNNIuO9.js
new file mode 100644
index 0000000..f9fadbe
--- /dev/null
+++ b/reference_scripts/FiD3mvWIBHNNIuO9.js
@@ -0,0 +1,8 @@
+if (args.opposedTest.result.hitloc.value == "body")
+{
+ if ((await new Roll("1d2").roll()).total == 1)
+ {
+ args.opposedTest.result.hitloc.value = "head"
+ this.script.scriptMessage(`Hit location changed to Head`)
+ }
+}
\ No newline at end of file
diff --git a/reference_scripts/FkTwk8hfHpRLbAp2.js b/reference_scripts/FkTwk8hfHpRLbAp2.js
new file mode 100644
index 0000000..cd051cb
--- /dev/null
+++ b/reference_scripts/FkTwk8hfHpRLbAp2.js
@@ -0,0 +1,6 @@
+let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`});
+await test.roll();
+if (test.failed)
+{
+ this.actor.addCondition("prone")
+}
\ No newline at end of file
diff --git a/reference_scripts/FmLx9pwOkzqqU7Ph.js b/reference_scripts/FmLx9pwOkzqqU7Ph.js
new file mode 100644
index 0000000..c54d1df
--- /dev/null
+++ b/reference_scripts/FmLx9pwOkzqqU7Ph.js
@@ -0,0 +1 @@
+return args.skill?.name == game.i18n.localize("NAME.Track");
\ No newline at end of file
diff --git a/reference_scripts/FqevMs0ukQ9WuUHl.js b/reference_scripts/FqevMs0ukQ9WuUHl.js
new file mode 100644
index 0000000..d352c76
--- /dev/null
+++ b/reference_scripts/FqevMs0ukQ9WuUHl.js
@@ -0,0 +1,9 @@
+// Each time the blade is used, the GM should secretly roll a d10.
+// On a 1, its poison has run dry,
+// and the next time it is employed it will shatter.
+
+if (this.item.getFlag("wfrp4e", "brittle"))
+{
+ ChatMessage.create({content: `${this.item.name} shatters!`})
+ this.item.update({name : `${this.item.name} (Shattered)`})
+}
\ No newline at end of file
diff --git a/reference_scripts/Fvlc4RkeF4dHjW3m.js b/reference_scripts/Fvlc4RkeF4dHjW3m.js
new file mode 100644
index 0000000..1fc9418
--- /dev/null
+++ b/reference_scripts/Fvlc4RkeF4dHjW3m.js
@@ -0,0 +1,16 @@
+let caster = this.effect.sourceActor
+if (caster && (this.actor.has(game.i18n.localize("NAME.Undead")) || this.actor.has(game.i18n.localize("NAME.Daemonic")))) {
+ let wp = caster.system.characteristics.wp.value
+ if (wp > this.actor.system.characteristics.t.value) {
+ if (this.actor.has(game.i18n.localize("NAME.Unstable"))) {
+ this.actor.update({ "system.status.wounds.value": 0 })
+ this.actor.addCondition("dead")
+ }
+ else {
+ fromUuid("Compendium.wfrp4e-core.items.D0ImWEIMSDgElsnl").then(item => {
+ this.actor.createEmbeddedDocuments("Item", [item.toObject()], { fromEffect: this.effect.id })
+ ChatMessage.create({ content: `Added Unstable to ${this.actor.prototypeToken.name}`, speaker: { alias: caster.name } })
+ })
+ }
+ }
+}
\ No newline at end of file
diff --git a/reference_scripts/G1RletYc6BzigJrK.js b/reference_scripts/G1RletYc6BzigJrK.js
new file mode 100644
index 0000000..24f4082
--- /dev/null
+++ b/reference_scripts/G1RletYc6BzigJrK.js
@@ -0,0 +1,2 @@
+let ablaze = parseInt(this.effect.sourceTest.result.SL) + 5
+args.actor.addCondition("ablaze", ablaze)
\ No newline at end of file
diff --git a/reference_scripts/G7sFEnJlXZvfXL3V.js b/reference_scripts/G7sFEnJlXZvfXL3V.js
new file mode 100644
index 0000000..758b802
--- /dev/null
+++ b/reference_scripts/G7sFEnJlXZvfXL3V.js
@@ -0,0 +1,12 @@
+if (this.item.system.quantity.value)
+{
+ this.item.system.reduceQuantity();
+ let actor = Array.from(game.user.targets)[0]?.actor || this.actor;
+ let effectData = this.item.effects.contents[1].convertToApplied();
+ effectData.flags.wfrp4e.sourceItem = this.item.uuid
+ actor.applyEffect({effectData : [effectData]})
+}
+else
+{
+ this.script.scriptNotification("None left!", "error")
+}
\ No newline at end of file
diff --git a/reference_scripts/GAO8AozttWOyRkta.js b/reference_scripts/GAO8AozttWOyRkta.js
new file mode 100644
index 0000000..796ff24
--- /dev/null
+++ b/reference_scripts/GAO8AozttWOyRkta.js
@@ -0,0 +1,5 @@
+if (!args.flags.lostHand)
+{
+ args.fields.lostHand = true;
+ args.fields.modifier += -20;
+}
\ No newline at end of file
diff --git a/reference_scripts/GEfWIFBSrXt0ldBM.js b/reference_scripts/GEfWIFBSrXt0ldBM.js
new file mode 100644
index 0000000..b4de7ed
--- /dev/null
+++ b/reference_scripts/GEfWIFBSrXt0ldBM.js
@@ -0,0 +1,2 @@
+(await new Roll("1d10").roll()).toMessage(this.script.getChatData())
+await this.actor.addCondition("dead")
\ No newline at end of file
diff --git a/reference_scripts/GFaTz8f6PBNWrlad.js b/reference_scripts/GFaTz8f6PBNWrlad.js
new file mode 100644
index 0000000..509844b
--- /dev/null
+++ b/reference_scripts/GFaTz8f6PBNWrlad.js
@@ -0,0 +1,3 @@
+let test = await this.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure : `Confused: Determine behaviour by @Table[bewilder] Table.`}})
+await test.roll();
+return test.failed
\ No newline at end of file
diff --git a/reference_scripts/GFkVnx4m9OwYsKGH.js b/reference_scripts/GFkVnx4m9OwYsKGH.js
new file mode 100644
index 0000000..864fe17
--- /dev/null
+++ b/reference_scripts/GFkVnx4m9OwYsKGH.js
@@ -0,0 +1 @@
+args.actor.flags.ambi+= 1
\ No newline at end of file
diff --git a/reference_scripts/GNl5Zk7BZ2jhRV1I.js b/reference_scripts/GNl5Zk7BZ2jhRV1I.js
new file mode 100644
index 0000000..fca7f72
--- /dev/null
+++ b/reference_scripts/GNl5Zk7BZ2jhRV1I.js
@@ -0,0 +1,4 @@
+if (args.item.type == "armour")
+{
+ args.item.system.AP.head = 0;
+}
\ No newline at end of file
diff --git a/reference_scripts/GOq4TcnWbfyfCo2V.js b/reference_scripts/GOq4TcnWbfyfCo2V.js
new file mode 100644
index 0000000..3a51404
--- /dev/null
+++ b/reference_scripts/GOq4TcnWbfyfCo2V.js
@@ -0,0 +1,26 @@
+this.script.scriptNotification(`Healed ${this.actor.characteristics.t.bonus * 2} Wounds`)
+await this.actor.modifyWounds(this.actor.characteristics.t.bonus * 2)
+
+let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - Side Effects`,fields : {difficulty : "difficult"}})
+await test.roll();
+if (test.failed)
+{
+ let roll = await new Roll("1d10").roll();
+ await roll.toMessage(this.script.getChatData())
+ if (roll.total <= 3)
+ {
+ this.actor.addCondition("blinded", 3)
+ }
+ else if (roll.total <= 6)
+ {
+ this.actor.addCondition("broken");
+ }
+ else if (roll.total <= 9)
+ {
+ this.actor.addCondition("stunned");
+ }
+ else if (roll.total == 10)
+ {
+ this.actor.addConditon("unconscious")
+ }
+}
\ No newline at end of file
diff --git a/reference_scripts/GRfCxtYzmEx2LYU7.js b/reference_scripts/GRfCxtYzmEx2LYU7.js
new file mode 100644
index 0000000..dcc7340
--- /dev/null
+++ b/reference_scripts/GRfCxtYzmEx2LYU7.js
@@ -0,0 +1,9 @@
+if (args.totalWoundLoss >= 1)
+{
+ let roll = await new Roll("1d10").roll();
+ await roll.toMessage(this.script.getChatData());
+ if (roll.total == 9)
+ {
+ this.script.scriptMessage(`Two @UUID[Compendium.wfrp4e-eis.actors.iDy8SDTwJSlCzZMl]{Blue Horror of Tzeentch} claw their way out of ${this.actor.name}'s screaming flesh, killing them in the process.`, {whisper : ChatMessage.getWhisperRecipients("GM")})
+ }
+}
\ No newline at end of file
diff --git a/reference_scripts/GTZUO73pUJKpM1JB.js b/reference_scripts/GTZUO73pUJKpM1JB.js
new file mode 100644
index 0000000..3d99c30
--- /dev/null
+++ b/reference_scripts/GTZUO73pUJKpM1JB.js
@@ -0,0 +1,3 @@
+ let roll = await new Roll("1d10").roll();
+ game.dice3d?.showForRoll(roll);
+ this.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}))
diff --git a/reference_scripts/GUkpYdPwoC5pc9BT.js b/reference_scripts/GUkpYdPwoC5pc9BT.js
new file mode 100644
index 0000000..160e012
--- /dev/null
+++ b/reference_scripts/GUkpYdPwoC5pc9BT.js
@@ -0,0 +1 @@
+return !args.weapon?.system.properties.flaws.crewed
\ No newline at end of file
diff --git a/reference_scripts/GZFsuynUhgZqwTGo.js b/reference_scripts/GZFsuynUhgZqwTGo.js
new file mode 100644
index 0000000..bf5a7a7
--- /dev/null
+++ b/reference_scripts/GZFsuynUhgZqwTGo.js
@@ -0,0 +1,10 @@
+if (args.totalWoundLoss >= 1)
+{
+ let test = await args.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context: { failure: "Gained a Poisoned Condition", success: "Resisted the poison" }})
+ await test.roll();
+ if (test.failed)
+ {
+ args.actor.addCondition("poisoned");
+ }
+}
+
\ No newline at end of file
diff --git a/reference_scripts/GbPEy22VuCNzlNv2.js b/reference_scripts/GbPEy22VuCNzlNv2.js
new file mode 100644
index 0000000..be6b4de
--- /dev/null
+++ b/reference_scripts/GbPEy22VuCNzlNv2.js
@@ -0,0 +1 @@
+return !this.actor.isMounted || (!args.skill?.name?.includes(game.i18n.localize("NAME.Ride")) && !args.options.dodge)
\ No newline at end of file
diff --git a/reference_scripts/Gc8S5TYlVdV8NnOT.js b/reference_scripts/Gc8S5TYlVdV8NnOT.js
new file mode 100644
index 0000000..154ee3e
--- /dev/null
+++ b/reference_scripts/Gc8S5TYlVdV8NnOT.js
@@ -0,0 +1,8 @@
+let test = await args.actor.setupSkill(game.i18n.localize("NAME.Cool"), {skipTargets: true, appendTitle : " - " + this.effect.name, context: { failure: "Gained a Broken Condition", success: "Resisted the Broken Condition" } })
+
+ await test.roll();
+
+ if (!test.succeeded)
+ {
+ args.actor.addCondition("broken");
+ }
\ No newline at end of file
diff --git a/reference_scripts/GcIQtshex11AMmh2.js b/reference_scripts/GcIQtshex11AMmh2.js
new file mode 100644
index 0000000..793a7a8
--- /dev/null
+++ b/reference_scripts/GcIQtshex11AMmh2.js
@@ -0,0 +1,25 @@
+if (this.item.system.isEquipped)
+{
+ let removeRepeater = false
+ if(!this.item.system.offhand.value) // main
+ {
+ let offhandUsed = this.actor.itemTypes.weapon.find(i => i.system.isEquipped && i.system.offhand.value)
+ if (offhandUsed)
+ {
+ removeRepeater = true;
+ }
+ }
+ else // offhand
+ {
+ let mainhandUsed = this.actor.itemTypes.weapon.find(i => i.system.isEquipped && !i.system.offhand.value)
+ if (mainhandUsed)
+ {
+ removeRepeater = true;
+ }
+ }
+
+ if (removeRepeater)
+ {
+ this.item.system.qualities.value = this.item.system.qualities.value.filter(i => i.name != "repeater")
+ }
+}
\ No newline at end of file
diff --git a/reference_scripts/Gh7OidY6UdpWBS1g.js b/reference_scripts/Gh7OidY6UdpWBS1g.js
new file mode 100644
index 0000000..85ee2d0
--- /dev/null
+++ b/reference_scripts/Gh7OidY6UdpWBS1g.js
@@ -0,0 +1,3 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.KII1gWnxIZ8HzmU5")
+let data = item.toObject();
+this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id})
\ No newline at end of file
diff --git a/reference_scripts/GjkxWj9wCAclM9WA.js b/reference_scripts/GjkxWj9wCAclM9WA.js
new file mode 100644
index 0000000..6fefe6d
--- /dev/null
+++ b/reference_scripts/GjkxWj9wCAclM9WA.js
@@ -0,0 +1,17 @@
+let effects = foundry.utils.deepClone(this.item.effects.contents.filter(e => e.active));
+
+effects.splice(effects.length - 1);
+
+if (effects.length == 0)
+{
+ return this.script.scriptNotification("All Effects have been used. Reset to select them again")
+}
+let choice = await ItemDialog.create(effects, 1, "Choose Power to Gain");
+
+if (choice[0])
+{
+ choice[0].update({disabled : true})
+ let effect = choice[0].convertToApplied();
+ effect.name += ` (${this.effect.name})`
+ this.actor.createEmbeddedDocuments("ActiveEffect", [effect]);
+}
\ No newline at end of file
diff --git a/reference_scripts/GrF6tQ08jgKmUH4i.js b/reference_scripts/GrF6tQ08jgKmUH4i.js
new file mode 100644
index 0000000..356b70b
--- /dev/null
+++ b/reference_scripts/GrF6tQ08jgKmUH4i.js
@@ -0,0 +1 @@
+return !["ws", "bs", "s", "ag", "i"].includes(args.characteristic)
\ No newline at end of file
diff --git a/reference_scripts/GuUCErVbk5hrFzR3.js b/reference_scripts/GuUCErVbk5hrFzR3.js
new file mode 100644
index 0000000..85bf7f6
--- /dev/null
+++ b/reference_scripts/GuUCErVbk5hrFzR3.js
@@ -0,0 +1 @@
+args.multiplier.tb += 1
\ No newline at end of file
diff --git a/reference_scripts/GuxbvztcvzJz2oH1.js b/reference_scripts/GuxbvztcvzJz2oH1.js
new file mode 100644
index 0000000..fb1c17c
--- /dev/null
+++ b/reference_scripts/GuxbvztcvzJz2oH1.js
@@ -0,0 +1 @@
+args.item.system.qualities.value = [];
\ No newline at end of file
diff --git a/reference_scripts/GzSFlqL1YrIK1dxh.js b/reference_scripts/GzSFlqL1YrIK1dxh.js
new file mode 100644
index 0000000..1f5a252
--- /dev/null
+++ b/reference_scripts/GzSFlqL1YrIK1dxh.js
@@ -0,0 +1,16 @@
+let items = await Promise.all(["Compendium.wfrp4e-wom.items.Item.EjGYZ4CgX2jZW7Ot",
+"Compendium.wfrp4e-wom.items.Item.O2v9RQiFf0obskP5",
+"Compendium.wfrp4e-wom.items.Item.2cv6hhZ57iV6z5Il",
+"Compendium.wfrp4e-wom.items.Item.YgDEUO0G0XcqQJqg",
+"Compendium.wfrp4e-wom.items.Item.J6K5TPxI8qIGQKKH",
+"Compendium.wfrp4e-wom.items.Item.K9FPtiDLwTkC7FuO",
+"Compendium.wfrp4e-wom.items.Item.CkMYRYCLrkMnyVm5",
+"Compendium.wfrp4e-wom.items.Item.0Xdm4r7l2EwC4fcg"].map(fromUuid));
+
+let choice = await game.wfrp4e.apps.ItemDialog.create(items, 1, "Select Wind")
+//this.actor.createEmbeddedDocuments("Item", items);
+
+this.item.update(choice[0]?.toObject(), {diff: false, recursive : false});
+
+//this.actor.items.getName(this.effect.item.name).delete() // For some reason this.effect.item.delete() throws an error
+
diff --git a/reference_scripts/GzsuEg7gZy1f0ljy.js b/reference_scripts/GzsuEg7gZy1f0ljy.js
new file mode 100644
index 0000000..3220372
--- /dev/null
+++ b/reference_scripts/GzsuEg7gZy1f0ljy.js
@@ -0,0 +1,10 @@
+let bleeding = this.actor.hasCondition("bleeding")
+if (bleeding)
+{
+ this.script.scriptNotification(`Cleared ${bleeding.conditionValue} Bleeding Conditions`)
+ bleeding.delete();
+}
+else
+{
+ this.script.scriptNotification(`No Bleeding Conditions`)
+}
\ No newline at end of file
diff --git a/reference_scripts/H06Ysj7oPiemW7S6.js b/reference_scripts/H06Ysj7oPiemW7S6.js
new file mode 100644
index 0000000..8c3872b
--- /dev/null
+++ b/reference_scripts/H06Ysj7oPiemW7S6.js
@@ -0,0 +1,18 @@
+if (args.test.options.income && !args.test.options.criminal)
+{
+ args.test.options.criminal = true;
+ let currentCareer = args.test.actor.system.currentCareer;
+ let coin = {1 : "b", 2 : "s", 3 : "s", 4 : "g"}[currentCareer.system.level.value] // b, s, or g maps to 2d10, 1d10, or 1 respectively (takes the first letter)
+ let term = {1 : "bp", 2 : "ss", 3 : "ss", 4 : "gc"}[currentCareer.system.level.value] // b, s, or g maps to 2d10, 1d10, or 1 respectively (takes the first letter)
+ let dieAmount = {1 : "2d10", 2 : "1d10", 3 : "2d10", 4 : "1"}[currentCareer.system.level.value] // b, s, or g maps to 2d10, 1d10, or 1 respectively (takes the first letter)
+ dieAmount = parseInt(dieAmount[0]) * this.item.system.Advances; // Multilpy that first letter by your standing (Brass 4 = 8d10 pennies)
+ if (coin != "g") // Don't roll for gold, just use standing value
+ {
+ dieAmount = dieAmount + "d10";
+ }
+ let moneyEarned = (await new Roll(dieAmount.toString()).roll()).total;
+ let moneyString = `${moneyEarned}${coin}`
+ let transactionString = `${moneyEarned}${term}`
+
+ this.script.scriptMessage(`Earned an additional ${game.wfrp4e.market.amountToString(game.wfrp4e.market.parseMoneyTransactionString(transactionString))}`, {whisper : ChatMessage.getWhisperRecipients("GM")})
+}
\ No newline at end of file
diff --git a/reference_scripts/H1z3nWW7Rj3Oisxy.js b/reference_scripts/H1z3nWW7Rj3Oisxy.js
new file mode 100644
index 0000000..a7b8f33
--- /dev/null
+++ b/reference_scripts/H1z3nWW7Rj3Oisxy.js
@@ -0,0 +1 @@
+return args.type != "channelling"
\ No newline at end of file
diff --git a/reference_scripts/H2CJvApKMnfGNNoo.js b/reference_scripts/H2CJvApKMnfGNNoo.js
new file mode 100644
index 0000000..60892cb
--- /dev/null
+++ b/reference_scripts/H2CJvApKMnfGNNoo.js
@@ -0,0 +1,7 @@
+ if (args.test.item?.type == "skill" && args.test.item.name.includes(game.i18n.localize("NAME.Stealth")))
+{
+ args.test.result.description = "Astounding Failure";
+ args.test.result.outcome = "failure";
+ ChatMessage.create({content : "SQUEAK", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true})
+ AudioHelper.play({ src: `${game.settings.get("wfrp4e", "soundPath")}squeek.wav` }, true);
+}
\ No newline at end of file
diff --git a/reference_scripts/H3Wls12aVWAWTp9J.js b/reference_scripts/H3Wls12aVWAWTp9J.js
new file mode 100644
index 0000000..32f6ee1
--- /dev/null
+++ b/reference_scripts/H3Wls12aVWAWTp9J.js
@@ -0,0 +1,3 @@
+this.actor.setupCharacteristic("i", {skipTargets: true, appendTitle : " - " + this.effect.name}).then(test => {
+ test.roll();
+})
\ No newline at end of file
diff --git a/reference_scripts/H3pZ9UeIzIz3luKh.js b/reference_scripts/H3pZ9UeIzIz3luKh.js
new file mode 100644
index 0000000..c120317
--- /dev/null
+++ b/reference_scripts/H3pZ9UeIzIz3luKh.js
@@ -0,0 +1,5 @@
+args.actor.addCondition("bleeding")
+
+this.actor.setFlag("wfrp4e", "isAttached", args.actor.name)
+
+this.script.scriptMessage(`Attaches to ${args.actor.name}`)
\ No newline at end of file
diff --git a/reference_scripts/HASsi6wYHVALExWq.js b/reference_scripts/HASsi6wYHVALExWq.js
new file mode 100644
index 0000000..93a5c23
--- /dev/null
+++ b/reference_scripts/HASsi6wYHVALExWq.js
@@ -0,0 +1,14 @@
+let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context: { failure: "1 Corruption Point Gained" } })
+await test.roll();
+
+if (test.failed && args.actor.type == "character")
+{
+ let msg = ""
+ msg += `
${this.actor.prototypeToken.name} gained a Corruption point
` + if (test.result.roll % 11 == 0 || test.result.roll == 100) + { + msg += `${args.actor.prototypeToken.name} gains a mutation (@Table[expandedmutatephys]{Physical} or @Table[expandedmutatemental]{Mental}) and gains @UUID[Compendium.wfrp4e-core.items.hiU7vhBOVpVI8c7C]{Chaos Magic (Tzeentch)}` + } + this.script.scriptMessage(msg, {whisper : ChatMessage.getWhisperRecipients("GM")}) + await this.actor.update({ "system.status.corruption.value": parseInt(args.actor.status.corruption.value) + 1 }) +} \ No newline at end of file diff --git a/reference_scripts/HJ2X4ZtXei0BXbxf.js b/reference_scripts/HJ2X4ZtXei0BXbxf.js new file mode 100644 index 0000000..9042978 --- /dev/null +++ b/reference_scripts/HJ2X4ZtXei0BXbxf.js @@ -0,0 +1,19 @@ + let choices = await Promise.all([game.wfrp4e.utility.findItemId("PzimjNx9Ojq4g6mV"), game.wfrp4e.utility.findItemId("rOPmyLWa37e7s9v6")]) + let items = await game.wfrp4e.apps.ItemDialog.create(choices, 1, "Choose a Skill") + + items = items.map(i => i.toObject()) + items.forEach(i => i.system.advances.value = 20) + +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 +} \ No newline at end of file diff --git a/reference_scripts/HKhyn0kijKfzW6cw.js b/reference_scripts/HKhyn0kijKfzW6cw.js new file mode 100644 index 0000000..bb191fa --- /dev/null +++ b/reference_scripts/HKhyn0kijKfzW6cw.js @@ -0,0 +1,3 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: "hard"}}) +await test.roll(); +this.item.updateSource({"flags.wfrp4e.passed" : test.succeeded}) \ No newline at end of file diff --git a/reference_scripts/HMC6hPND9DWLFfZE.js b/reference_scripts/HMC6hPND9DWLFfZE.js new file mode 100644 index 0000000..b975613 --- /dev/null +++ b/reference_scripts/HMC6hPND9DWLFfZE.js @@ -0,0 +1,43 @@ +if (this.item.name.includes("(")) +{ + return; +} + +let index = game.packs +.filter(i => i.metadata.type == "Item") +.reduce((acc, pack) => acc.concat(pack.index.contents), []) +.filter(i => i.type == "skill" && i.name.includes(game.i18n.localize("NAME.Lore"))) +.map(i => { + i.id = i._id + return i +}) + +let choice = await ItemDialog.create(index, 1, "Choose a Lore") +let text; +if (!choice[0]) +{ + let custom = await Dialog.wait({ + title : "Enter Lore", + content : "", + buttons : { + confirm : { + label : game.i18n.localize("Confirm"), + callback : (dlg) => { + return dlg.find("input")[0].value + } + } + }, + default : "confirm", + close : () => { + return "" + } + }) + text = custom || "" +} +else +{ + text = game.wfrp4e.utility.extractParenthesesText(choice[0].name) +} + +await this.item.updateSource({name : this.item.name + ` (${text})`, "system.tests.value" : this.item.system.tests.value.replace("chosen Lore", text)}) +await this.effect.updateSource({name : this.effect.name + ` (${text})`}) \ No newline at end of file diff --git a/reference_scripts/HOt2hHOiHDZ7oBgW.js b/reference_scripts/HOt2hHOiHDZ7oBgW.js new file mode 100644 index 0000000..af34a62 --- /dev/null +++ b/reference_scripts/HOt2hHOiHDZ7oBgW.js @@ -0,0 +1,4 @@ +if (["rLeg", "lLeg"].includes(this.effect.getFlag("wfrp4e", "location"))) +{ + args.actor.details.move.value /= 2 +} diff --git a/reference_scripts/HX6CjNapYdC0VmQ8.js b/reference_scripts/HX6CjNapYdC0VmQ8.js new file mode 100644 index 0000000..36a39a6 --- /dev/null +++ b/reference_scripts/HX6CjNapYdC0VmQ8.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.epPBu7x6BRWp2PHG") +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/HXJKkmpfxQUOnWOS.js b/reference_scripts/HXJKkmpfxQUOnWOS.js new file mode 100644 index 0000000..34affd7 --- /dev/null +++ b/reference_scripts/HXJKkmpfxQUOnWOS.js @@ -0,0 +1,4 @@ +if (!this.item.system.twohanded.value) +{ + this.item.system.flaws.value = this.item.system.flaws.value.concat([{name : "tiring"}, {name : "slow"}]) +} \ No newline at end of file diff --git a/reference_scripts/Hcpn1gU58DIKIhty.js b/reference_scripts/Hcpn1gU58DIKIhty.js new file mode 100644 index 0000000..6d5917a --- /dev/null +++ b/reference_scripts/Hcpn1gU58DIKIhty.js @@ -0,0 +1,4 @@ +if (args.item.type == "skill" && args.item.name == "Melee (Flail)") +{ + args.item.system.modifier.value += 10; +} \ No newline at end of file diff --git a/reference_scripts/HfCxNd7mFGZH4s9Y.js b/reference_scripts/HfCxNd7mFGZH4s9Y.js new file mode 100644 index 0000000..07fcf28 --- /dev/null +++ b/reference_scripts/HfCxNd7mFGZH4s9Y.js @@ -0,0 +1,13 @@ +// An opponent that takes more than a single Wound from a Warp Blade strike +// in melee combat must make an Average (+20) Endurance Test +// or take a Stunned Condition + + +if (args.totalWoundLoss > 1) { + let test = await args.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields : {difficulty : "average"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`}) + await test.roll(); + if(test.failed) + { + await args.actor.addCondition("stunned"); + } +} \ No newline at end of file diff --git a/reference_scripts/HiMBS6GeOwEydWYN.js b/reference_scripts/HiMBS6GeOwEydWYN.js new file mode 100644 index 0000000..9ad95cd --- /dev/null +++ b/reference_scripts/HiMBS6GeOwEydWYN.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.Climb"); \ No newline at end of file diff --git a/reference_scripts/HmImVzvw6ecBy99l.js b/reference_scripts/HmImVzvw6ecBy99l.js new file mode 100644 index 0000000..1731116 --- /dev/null +++ b/reference_scripts/HmImVzvw6ecBy99l.js @@ -0,0 +1,5 @@ +if (args.opposedTest.result.hitloc.value == "body" && args.totalWoundLoss > 0) +{ + args.actor.addCondition("bleeding", 2) + this.script.scriptNotification("Added Bleeding") +} \ No newline at end of file diff --git a/reference_scripts/HoNTnPphrJISSQr1.js b/reference_scripts/HoNTnPphrJISSQr1.js new file mode 100644 index 0000000..ae73e8e --- /dev/null +++ b/reference_scripts/HoNTnPphrJISSQr1.js @@ -0,0 +1 @@ +ChatMessage.create({content : "Speak and be known to me", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true}) \ No newline at end of file diff --git a/reference_scripts/Hq1G30lhJYvtOSNb.js b/reference_scripts/Hq1G30lhJYvtOSNb.js new file mode 100644 index 0000000..5dce3bd --- /dev/null +++ b/reference_scripts/Hq1G30lhJYvtOSNb.js @@ -0,0 +1,9 @@ + + if (args.test.failed) + { + let applicableCharacteristics = ["ws", "bs", "s", "fel", "ag", "t", "dex"]; + if (applicableCharacteristics.includes(args.preData.characteristic)) + { + this.actor.addCondition("stunned"); + } + } \ No newline at end of file diff --git a/reference_scripts/HrOBAXsEX073ReKl.js b/reference_scripts/HrOBAXsEX073ReKl.js new file mode 100644 index 0000000..de65a28 --- /dev/null +++ b/reference_scripts/HrOBAXsEX073ReKl.js @@ -0,0 +1,18 @@ +let skill = `Entertain (Singing)` +let currentCareer = this.actor.system.currentCareer; +let existingSkill = this.actor.itemTypes.skill.find(i => i.name == skill); + +if (!currentCareer) return + + +let inCurrentCareer = currentCareer.system.skills.includes(skill); +if (existingSkill && inCurrentCareer) +{ + existingSkill.system.advances.costModifier = -5; +} +else +{ + currentCareer.system.skills.push(skill); +} + + diff --git a/reference_scripts/HrYchgkdZBiu1yPF.js b/reference_scripts/HrYchgkdZBiu1yPF.js new file mode 100644 index 0000000..959e502 --- /dev/null +++ b/reference_scripts/HrYchgkdZBiu1yPF.js @@ -0,0 +1 @@ +return args.skill?.name == game.i18n.localize("NAME.Climb"); \ No newline at end of file diff --git a/reference_scripts/HwbgUIbpX0D8JLOR.js b/reference_scripts/HwbgUIbpX0D8JLOR.js new file mode 100644 index 0000000..a9ddddc --- /dev/null +++ b/reference_scripts/HwbgUIbpX0D8JLOR.js @@ -0,0 +1,2 @@ +if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 2 && args.opposedTest.result.winner == "attacker") + this.actor.addCondition("bleeding") \ No newline at end of file diff --git a/reference_scripts/I0Jo6cbNAJtXUloc.js b/reference_scripts/I0Jo6cbNAJtXUloc.js new file mode 100644 index 0000000..6066d3a --- /dev/null +++ b/reference_scripts/I0Jo6cbNAJtXUloc.js @@ -0,0 +1,2 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.J9MK0AIaTbvd5oF6"); +this.actor.createEmbeddedDocuments("Item", [item.toObject()], {fromEffect : this.effect.id}); \ No newline at end of file diff --git a/reference_scripts/I0oRZ7AWde5KI5jw.js b/reference_scripts/I0oRZ7AWde5KI5jw.js new file mode 100644 index 0000000..57bbdb3 --- /dev/null +++ b/reference_scripts/I0oRZ7AWde5KI5jw.js @@ -0,0 +1 @@ +return !["t", "int"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/I1J2m5uud84N50Lk.js b/reference_scripts/I1J2m5uud84N50Lk.js new file mode 100644 index 0000000..5f22ef9 --- /dev/null +++ b/reference_scripts/I1J2m5uud84N50Lk.js @@ -0,0 +1,6 @@ +if (["cast", "channelling", "pray"].includes(args.type)) +{ + args.abort = true; + this.script.scriptNotification("Cannot cast Spells or use Prayers"); +} +else return true; \ No newline at end of file diff --git a/reference_scripts/I7ieW0hNYvvX0KFg.js b/reference_scripts/I7ieW0hNYvvX0KFg.js new file mode 100644 index 0000000..5327a98 --- /dev/null +++ b/reference_scripts/I7ieW0hNYvvX0KFg.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.Heal"); \ No newline at end of file diff --git a/reference_scripts/I93i49wI9ZrDHT4n.js b/reference_scripts/I93i49wI9ZrDHT4n.js new file mode 100644 index 0000000..54906f2 --- /dev/null +++ b/reference_scripts/I93i49wI9ZrDHT4n.js @@ -0,0 +1,2 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.Item.jt0DmVK9IiF6Sd2h"); +this.actor.createEmbeddedDocuments("Item", [item], {fromEffect: this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/I9QAPKbaXwMMMBT4.js b/reference_scripts/I9QAPKbaXwMMMBT4.js new file mode 100644 index 0000000..99b5ec4 --- /dev/null +++ b/reference_scripts/I9QAPKbaXwMMMBT4.js @@ -0,0 +1,17 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {fields : {difficulty: "average"}, skipTargets: true, appendTitle : " - " + this.effect.name}) +await test.roll(); +if(test.failed) +{ + await this.actor.addCondition("stunned"); + let secondTest = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {fields : {difficulty: "easy"}, skipTargets: true, appendTitle : " - Despair"}) + await secondTest.roll(); + if(secondTest.failed) + { + this.effect.updateSource({name : "Taste of Death"}) + await this.actor.addCondition("fatigued"); + } + else + { + return false; + } +} \ No newline at end of file diff --git a/reference_scripts/IAGla7HJlYN0wa4H.js b/reference_scripts/IAGla7HJlYN0wa4H.js new file mode 100644 index 0000000..5840592 --- /dev/null +++ b/reference_scripts/IAGla7HJlYN0wa4H.js @@ -0,0 +1,8 @@ +if (args.test.characteristicKey == "wp") +{ + if (args.test.failed) + { + this.actor.addSystemEffect("convulsions") + this.script.scriptMessage(`Willpower Test failed, ${this.actor.prototypeToken.name} gains @Symptom[Convulsions] for [[1d10]] hours`) + } +} \ No newline at end of file diff --git a/reference_scripts/ID8mCcjkl7PCQhDq.js b/reference_scripts/ID8mCcjkl7PCQhDq.js new file mode 100644 index 0000000..4691ac9 --- /dev/null +++ b/reference_scripts/ID8mCcjkl7PCQhDq.js @@ -0,0 +1,8 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Dodge"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); + +if(test.failed) +{ + let damage = this.effect.sourceItem.system.computeSpellDamage("3", true); + this.script.scriptMessage(await this.actor.applyBasicDamage(damage, {suppressMsg: true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP})) +} \ No newline at end of file diff --git a/reference_scripts/IG4zYqtN9fRSYE7q.js b/reference_scripts/IG4zYqtN9fRSYE7q.js new file mode 100644 index 0000000..6fb0958 --- /dev/null +++ b/reference_scripts/IG4zYqtN9fRSYE7q.js @@ -0,0 +1 @@ +args.actor.addCondition("ablaze"); \ No newline at end of file diff --git a/reference_scripts/IKiZv9YSFmKmHo6a.js b/reference_scripts/IKiZv9YSFmKmHo6a.js new file mode 100644 index 0000000..b0e3f02 --- /dev/null +++ b/reference_scripts/IKiZv9YSFmKmHo6a.js @@ -0,0 +1 @@ +return args.spell?.system.lore.value == "fire" \ No newline at end of file diff --git a/reference_scripts/ILqHxk7deotgI3KD.js b/reference_scripts/ILqHxk7deotgI3KD.js new file mode 100644 index 0000000..fdb8958 --- /dev/null +++ b/reference_scripts/ILqHxk7deotgI3KD.js @@ -0,0 +1,10 @@ +if (args.item.type != "weapon") + return + +let reach = args.item.reach.value +let reachNum = game.wfrp4e.config.reachNum[reach] +reachNum = Math.min(reachNum + 2, 7) + +let key = game.wfrp4e.utility.findKey(reachNum, game.wfrp4e.config.reachNum) + +args.item.reach.value = key \ No newline at end of file diff --git a/reference_scripts/IPPDvZdE8kn3H9z7.js b/reference_scripts/IPPDvZdE8kn3H9z7.js new file mode 100644 index 0000000..a78deea --- /dev/null +++ b/reference_scripts/IPPDvZdE8kn3H9z7.js @@ -0,0 +1,7 @@ +let test = await this.actor.setupSkill("Dodge", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}); +await test.roll(); + +if (test.failed) +{ + await this.actor.addCondition("grappling") +} \ No newline at end of file diff --git a/reference_scripts/IR5URcjnCuWBFMoN.js b/reference_scripts/IR5URcjnCuWBFMoN.js new file mode 100644 index 0000000..69ed22a --- /dev/null +++ b/reference_scripts/IR5URcjnCuWBFMoN.js @@ -0,0 +1,15 @@ +// If a full dose is imbibed, +// the victim must pass a Hard (-20) Endurance Test. + +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields: {difficulty: "hard"}}) +await test.roll() +if (test.failed) +{ + this.script.scriptMessage(`${this.actor.prototypeToken.name} notices nothing amiss save that they become tired a little earlier than usual. At this point it is still possible to save the victim via a powerful antidote or magical means.
+Once they fall asleep however, it is almost impossible. At this point the victim must make a Hard (-20) Endurance Test. If they fail, they never awaken.
`, + { + whisper: ChatMessage.getWhisperRecipients("GM"), + blind: true + }) +} +return test.failed; \ No newline at end of file diff --git a/reference_scripts/IR86DuMbVdbGOJYt.js b/reference_scripts/IR86DuMbVdbGOJYt.js new file mode 100644 index 0000000..4316d1c --- /dev/null +++ b/reference_scripts/IR86DuMbVdbGOJYt.js @@ -0,0 +1 @@ +this.actor.addCondition("blinded") \ No newline at end of file diff --git a/reference_scripts/IfEu1hO8sKEZBpvg.js b/reference_scripts/IfEu1hO8sKEZBpvg.js new file mode 100644 index 0000000..0b53314 --- /dev/null +++ b/reference_scripts/IfEu1hO8sKEZBpvg.js @@ -0,0 +1,14 @@ +let value = parseInt(this.item.specification.value) +let name = this.actor.prototypeToken.name + +if (game.user.isGM && game.user.targets.size) +{ + game.user.targets.forEach(t => { + t.actor.applyFear(value, name) + }) + game.user.updateTokenTargets([]); +} +else +{ + game.wfrp4e.utility.postFear(value, name) +} \ No newline at end of file diff --git a/reference_scripts/IkGegSuQwwVPhrjF.js b/reference_scripts/IkGegSuQwwVPhrjF.js new file mode 100644 index 0000000..97f7893 --- /dev/null +++ b/reference_scripts/IkGegSuQwwVPhrjF.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn") +let data = item.toObject(); +data.system.specification.value = 1 +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/Ip8sctF9SIE1Z2vF.js b/reference_scripts/Ip8sctF9SIE1Z2vF.js new file mode 100644 index 0000000..7cc82a8 --- /dev/null +++ b/reference_scripts/Ip8sctF9SIE1Z2vF.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.UnJ25lL8aUzem5JO") +let data = item.toObject(); +data.system.specification.value = 3 +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/IpoOOjYJs6RmVrpb.js b/reference_scripts/IpoOOjYJs6RmVrpb.js new file mode 100644 index 0000000..c6867fc --- /dev/null +++ b/reference_scripts/IpoOOjYJs6RmVrpb.js @@ -0,0 +1,4 @@ +if (args.totalWoundLoss > 0) +{ + args.attacker.applyEffect({effectUuids : this.effect.sourceItem.effects.contents[1].uuid}) +} \ No newline at end of file diff --git a/reference_scripts/IsLAvY9ikR1cOJWw.js b/reference_scripts/IsLAvY9ikR1cOJWw.js new file mode 100644 index 0000000..c5a06ce --- /dev/null +++ b/reference_scripts/IsLAvY9ikR1cOJWw.js @@ -0,0 +1 @@ +return !["NAME.Row", "NAME.Swim"].map(i => game.i18n.localize(i)).includes(args.skill?.name); \ No newline at end of file diff --git a/reference_scripts/IslMfFgpgQq2brpu.js b/reference_scripts/IslMfFgpgQq2brpu.js new file mode 100644 index 0000000..02c913e --- /dev/null +++ b/reference_scripts/IslMfFgpgQq2brpu.js @@ -0,0 +1,5 @@ +if (this.actor.hasCondition("broken")) +{ + this.actor.removeCondition("broken") + this.script.scriptNotification(`Cannot have Broken`); +} \ No newline at end of file diff --git a/reference_scripts/IukS0clr1yAleacc.js b/reference_scripts/IukS0clr1yAleacc.js new file mode 100644 index 0000000..d71d043 --- /dev/null +++ b/reference_scripts/IukS0clr1yAleacc.js @@ -0,0 +1,3 @@ +this.actor.system.characteristics.ag.modifier -= parseInt(this.item.system.location.value || 1) + +this.actor.system.characteristics.ws.modifier -= parseInt(this.item.system.location.value || 1) \ No newline at end of file diff --git a/reference_scripts/IupskvzvoGyD2H5o.js b/reference_scripts/IupskvzvoGyD2H5o.js new file mode 100644 index 0000000..87c4934 --- /dev/null +++ b/reference_scripts/IupskvzvoGyD2H5o.js @@ -0,0 +1,23 @@ +if (this.actor.type != "character") +{ + return; +} + +let god = await ValueDialog.create("Enter a Deity", "Blessed") + +if (god) +{ + let prayers = await game.wfrp4e.utility.findAll("prayer", "Loading Prayers") + let blessings = prayers.filter(p => p.system.god.value.split(",").map(i => i.trim().toLowerCase()).includes(god.toLowerCase()) && p.system.type.value == "blessing") + if (blessings.length) + { + this.script.scriptNotification("Adding " + blessings.map(i => i.name).join(", ")) + await this.actor.createEmbeddedDocuments("Item", blessings, {fromEffect : this.effect.id}) + } + else + { + this.script.scriptNotification(`Could not find any Blessings associated with ${god}.`) + } + this.item.updateSource({name : this.item.name.replace("Any", god)}) + await this.actor.update({"system.details.god.value": god}) +} \ No newline at end of file diff --git a/reference_scripts/IzZcsSngI8TZH4d8.js b/reference_scripts/IzZcsSngI8TZH4d8.js new file mode 100644 index 0000000..a63265f --- /dev/null +++ b/reference_scripts/IzZcsSngI8TZH4d8.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.fjd1u9VAgiYzhBRp"); +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/J0IWUhxada2ONowP.js b/reference_scripts/J0IWUhxada2ONowP.js new file mode 100644 index 0000000..aec5a9d --- /dev/null +++ b/reference_scripts/J0IWUhxada2ONowP.js @@ -0,0 +1 @@ + return args.skill?.name == "Entertain (Sing)" || args.skill?.name == "Entertain (Singing)" || (args.skill?.name.includes("Language") && (args.skill?.name.includes("Magick") || args.skill?.name.includes("Elthárin") || args.skill?.name.includes("Cathayan"))) \ No newline at end of file diff --git a/reference_scripts/J1FPDdrXGctKDTZz.js b/reference_scripts/J1FPDdrXGctKDTZz.js new file mode 100644 index 0000000..d72299d --- /dev/null +++ b/reference_scripts/J1FPDdrXGctKDTZz.js @@ -0,0 +1,16 @@ +if (args.equipped) +{ + let ward = await fromUuid("Compendium.wfrp4e-core.items.Bvd2aZ0gQUXHfCTh") + wardData = ward.toObject() + wardData.system.specification.value = "8" + + let mr = await fromUuid("Compendium.wfrp4e-core.items.yrkI7ATjqLPDTFmZ") + mrData = mr.toObject() + mrData.system.specification.value = 2 + + this.actor.createEmbeddedDocuments("Item", [wardData, mrData], {fromEffect : this.effect.id}) +} +else +{ + this.effect.deleteCreatedItems() +} \ No newline at end of file diff --git a/reference_scripts/J8aPichsl25t1QZ9.js b/reference_scripts/J8aPichsl25t1QZ9.js new file mode 100644 index 0000000..e0eef4f --- /dev/null +++ b/reference_scripts/J8aPichsl25t1QZ9.js @@ -0,0 +1 @@ +this.actor.addCondition("entangled", this.effect.sourceTest.result.SL) \ No newline at end of file diff --git a/reference_scripts/JEbs0WlqhKNDOo5A.js b/reference_scripts/JEbs0WlqhKNDOo5A.js new file mode 100644 index 0000000..83eb600 --- /dev/null +++ b/reference_scripts/JEbs0WlqhKNDOo5A.js @@ -0,0 +1,6 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: "hard"}}) +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("unconscious") +} diff --git a/reference_scripts/JFgXyb6bKjZJLmF8.js b/reference_scripts/JFgXyb6bKjZJLmF8.js new file mode 100644 index 0000000..996b184 --- /dev/null +++ b/reference_scripts/JFgXyb6bKjZJLmF8.js @@ -0,0 +1 @@ +return args.characteristic == "ag" \ No newline at end of file diff --git a/reference_scripts/JQruHprM5R5vZ9DA.js b/reference_scripts/JQruHprM5R5vZ9DA.js new file mode 100644 index 0000000..ae80286 --- /dev/null +++ b/reference_scripts/JQruHprM5R5vZ9DA.js @@ -0,0 +1,10 @@ +let caster = this.effect.sourceActor; +if (caster) +{ + let healed= caster.system.characteristics.wp.bonus + caster.system.characteristics.int.bonus + await this.actor.modifyWounds(healed); + this.script.scriptMessage(`${this.actor.prototypeToken.name} regains ${healed} Wounds`) +} + + let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields : {difficulty : "vhard"}, context : {success : "1 Corruption point that was gained within the last hour is removed.", failure: "Nothing happens"}}) + await test.roll(); \ No newline at end of file diff --git a/reference_scripts/JZIn1dsKHFE3smJU.js b/reference_scripts/JZIn1dsKHFE3smJU.js new file mode 100644 index 0000000..a07962a --- /dev/null +++ b/reference_scripts/JZIn1dsKHFE3smJU.js @@ -0,0 +1,2 @@ +let ablaze = parseInt(this.effect.sourceTest.result.SL) + 1 +args.actor.addCondition("ablaze", ablaze) \ No newline at end of file diff --git a/reference_scripts/JaiC5P6nIgctOacH.js b/reference_scripts/JaiC5P6nIgctOacH.js new file mode 100644 index 0000000..d3560ca --- /dev/null +++ b/reference_scripts/JaiC5P6nIgctOacH.js @@ -0,0 +1,4 @@ +if (args.actor.system.details.species?.value?.toLowerCase() == "dwarf") +{ + args.weaponProperties.flaws.undamaging = true; +} \ No newline at end of file diff --git a/reference_scripts/JavuFNZ9Pj5elVLc.js b/reference_scripts/JavuFNZ9Pj5elVLc.js new file mode 100644 index 0000000..9c9591a --- /dev/null +++ b/reference_scripts/JavuFNZ9Pj5elVLc.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv") +let data = item.toObject(); +data.system.specification.value = 4 - this.actor.characteristics.s.bonus +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/JeThJbOf6Xmbtgo1.js b/reference_scripts/JeThJbOf6Xmbtgo1.js new file mode 100644 index 0000000..8125581 --- /dev/null +++ b/reference_scripts/JeThJbOf6Xmbtgo1.js @@ -0,0 +1,8 @@ +this.script.scriptMessage(await this.actor.applyBasicDamage(8 + parseInt(this.effect.sourceTest.result.SL), {suppressMsg : true})) + +let test = await this.actor.setupSkill("Athletics", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("prone") +} \ No newline at end of file diff --git a/reference_scripts/JgCcgDVZX54slrWx.js b/reference_scripts/JgCcgDVZX54slrWx.js new file mode 100644 index 0000000..b758160 --- /dev/null +++ b/reference_scripts/JgCcgDVZX54slrWx.js @@ -0,0 +1 @@ +return args.skill?.name.includes(game.i18n.localize("NAME.Melee")) || args.item?.isMelee || args.options.corruption \ No newline at end of file diff --git a/reference_scripts/JibNjuQrJRnY0yf9.js b/reference_scripts/JibNjuQrJRnY0yf9.js new file mode 100644 index 0000000..03aff09 --- /dev/null +++ b/reference_scripts/JibNjuQrJRnY0yf9.js @@ -0,0 +1 @@ +return this.actor.flags.useless.rEye && this.actor.flags.useless.lEye && (["ws", "bs"].includes(args.characteristic) || args.skill?.name?.includes(game.i18n.localize("NAME.Ride")) || args.weapon || args.options.dodge) \ No newline at end of file diff --git a/reference_scripts/JjDzMnUxaWQePIYh.js b/reference_scripts/JjDzMnUxaWQePIYh.js new file mode 100644 index 0000000..70529bf --- /dev/null +++ b/reference_scripts/JjDzMnUxaWQePIYh.js @@ -0,0 +1 @@ +return args.characteristic != "int" \ No newline at end of file diff --git a/reference_scripts/JjiPprLSlSmmB5Ga.js b/reference_scripts/JjiPprLSlSmmB5Ga.js new file mode 100644 index 0000000..bfe3c8a --- /dev/null +++ b/reference_scripts/JjiPprLSlSmmB5Ga.js @@ -0,0 +1 @@ +args.item.system.damage.value += " + 1" \ No newline at end of file diff --git a/reference_scripts/Jjq3oPYbI26zjxME.js b/reference_scripts/Jjq3oPYbI26zjxME.js new file mode 100644 index 0000000..dcf1d23 --- /dev/null +++ b/reference_scripts/Jjq3oPYbI26zjxME.js @@ -0,0 +1,21 @@ +let location = this.item.system.location.key; + +if (location) +{ + let dropped = this.item.system.weaponsAtLocation; + + if (dropped.length) + { + this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(", ")}!`) + for(let weapon of dropped) + { + await weapon.system.toggleEquip(); + } + } +} + +let roll = await new Roll("1d10").roll() + +roll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Duration)`})); + +this.effect.updateSource({"duration.rounds" : roll.total}) \ No newline at end of file diff --git a/reference_scripts/Jk7OHqx06oCUVAzb.js b/reference_scripts/Jk7OHqx06oCUVAzb.js new file mode 100644 index 0000000..44fed7e --- /dev/null +++ b/reference_scripts/Jk7OHqx06oCUVAzb.js @@ -0,0 +1 @@ +return !["Language (Magick)", "Channelling (Hysh)"].includes(args.skill?.name) \ No newline at end of file diff --git a/reference_scripts/JmZQRvdWjm9ykYfn.js b/reference_scripts/JmZQRvdWjm9ykYfn.js new file mode 100644 index 0000000..90d6edc --- /dev/null +++ b/reference_scripts/JmZQRvdWjm9ykYfn.js @@ -0,0 +1,5 @@ +if (this.actor.hasCondition("surprised")) +{ + this.actor.removeCondition("surprised") + this.script.scriptMessage(`Cannot be Surprised`); +} \ No newline at end of file diff --git a/reference_scripts/Jnp5c09sPzDD61EK.js b/reference_scripts/Jnp5c09sPzDD61EK.js new file mode 100644 index 0000000..e9e5662 --- /dev/null +++ b/reference_scripts/Jnp5c09sPzDD61EK.js @@ -0,0 +1,3 @@ +this.script.scriptNotification(`${args.actor.prototypeToken.name} must pass an Average (+20) Willpower Test to attack this target!`) + +return true; // No need to show this in the dialog \ No newline at end of file diff --git a/reference_scripts/JstrA46EYSEuRSy5.js b/reference_scripts/JstrA46EYSEuRSy5.js new file mode 100644 index 0000000..f5e7f96 --- /dev/null +++ b/reference_scripts/JstrA46EYSEuRSy5.js @@ -0,0 +1,2 @@ +if (this.actor.has(game.i18n.localize("NAME.Undead")) && this.actor.has(game.i18n.localize("NAME.Construct"))) + this.actor.addCondition("dead") \ No newline at end of file diff --git a/reference_scripts/JwYZJGkZMSM2M3Si.js b/reference_scripts/JwYZJGkZMSM2M3Si.js new file mode 100644 index 0000000..23dc567 --- /dev/null +++ b/reference_scripts/JwYZJGkZMSM2M3Si.js @@ -0,0 +1,10 @@ +if (args.totalWoundLoss > 0) +{ + let test = await args.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "hard"}}) + await test.roll() + if (test.failed) + { + args.totalWoundLoss += this.effect.sourceActor.system.characteristics.wp.bonus + args.modifiers.other.push({label : this.effect.name, value : this.effect.sourceActor.system.characteristics.wp.bonus}) + } +} \ No newline at end of file diff --git a/reference_scripts/JwgFQmPQtXWAP94i.js b/reference_scripts/JwgFQmPQtXWAP94i.js new file mode 100644 index 0000000..7c989d6 --- /dev/null +++ b/reference_scripts/JwgFQmPQtXWAP94i.js @@ -0,0 +1 @@ +this.actor.addCondition("fatigued"); \ No newline at end of file diff --git a/reference_scripts/JyTxUG5dNW670Sf7.js b/reference_scripts/JyTxUG5dNW670Sf7.js new file mode 100644 index 0000000..9421a21 --- /dev/null +++ b/reference_scripts/JyTxUG5dNW670Sf7.js @@ -0,0 +1,11 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.7mCcI3q7hgWcmbBU") +let data = item.toObject(); +data.system.location.key= this.item.system.location.key +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id}) + +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: "hard"}}); +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("stunned") +} \ No newline at end of file diff --git a/reference_scripts/K06v93N4FXb70mB7.js b/reference_scripts/K06v93N4FXb70mB7.js new file mode 100644 index 0000000..051a245 --- /dev/null +++ b/reference_scripts/K06v93N4FXb70mB7.js @@ -0,0 +1 @@ +args.item.system.encumbrance.value = Math.max(0, args.item.system.encumbrance.value - 1); \ No newline at end of file diff --git a/reference_scripts/KD4nCSdSXJVJmk0R.js b/reference_scripts/KD4nCSdSXJVJmk0R.js new file mode 100644 index 0000000..7499473 --- /dev/null +++ b/reference_scripts/KD4nCSdSXJVJmk0R.js @@ -0,0 +1,2 @@ +this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {suppressMsg : true})) +await this.actor.addCondition("ablaze") \ No newline at end of file diff --git a/reference_scripts/KF69WqF4PSEtpdb2.js b/reference_scripts/KF69WqF4PSEtpdb2.js new file mode 100644 index 0000000..4f434e6 --- /dev/null +++ b/reference_scripts/KF69WqF4PSEtpdb2.js @@ -0,0 +1,2 @@ +args.fields.slBonus += 2; + \ No newline at end of file diff --git a/reference_scripts/KG4TxnXiLLpfWOQO.js b/reference_scripts/KG4TxnXiLLpfWOQO.js new file mode 100644 index 0000000..14697ad --- /dev/null +++ b/reference_scripts/KG4TxnXiLLpfWOQO.js @@ -0,0 +1 @@ +args.fields.difficulty = "average" \ No newline at end of file diff --git a/reference_scripts/KGK9vL1Yl0qmCeCN.js b/reference_scripts/KGK9vL1Yl0qmCeCN.js new file mode 100644 index 0000000..78b37da --- /dev/null +++ b/reference_scripts/KGK9vL1Yl0qmCeCN.js @@ -0,0 +1,88 @@ +let specification = this.item.system.specification.value; +let choice = []; + +if (!specification || specification == "Trained Skills") +{ + choice = await ItemDialog.create(ItemDialog.objectToArray({ + broken: "Broken", + drive: "Drive", + entertain: "Entertain", + fetch: "Fetch", + guard: "Guard", + home: "Home", + magic: "Magic", + mount: "Mount", + war: "War" + }, this.effect.img), "unlimited", "Choose Training"); +} +else +{ + choice = specification.split(", ").map(i => { + return { + id : i.toLowerCase(), + name : i + } + }); +} + +if (choice.length) +{ + let changes = foundry.utils.deepClone(this.effect.changes); + + for(let training of choice) + { + switch(training.id) + { + case "broken" : + let roll = await new Roll("2d10").roll(); + roll.toMessage(this.script.getChatData()); + changes.push({value : roll.total, mode : 2, key : "system.characteristics.fel.modifier"}) + + if (this.actor.type == "creature") + { + let bestial = this.actor.itemTypes.trait.find(i => i.name == "Bestial"); + if (bestial) + { + bestial.update({"system.disabled" : true}) + } + } + break; + + case "drive" : + + break; + + case "entertain" : + + break; + + case "fetch" : + + break; + + case "guard" : + let territorial = await fromUuid("Compendium.wfrp4e-core.items.Item.JIAe7i7dqTQBu4do"); + await this.actor.createEmbeddedDocuments("Item", [territorial], {fromEffect: this.effect.id}) + setProperty(args, "options.keepId", true); + break; + + case "home" : + + break; + + case "magic" : + + break; + + case "mount" : + + break; + + case "war" : + changes.push({value : 10, mode : 2, key : "system.characteristics.ws.modifier"}) + break; + } + } + this.effect.updateSource({name : `${this.effect.name} (${choice.map(i => i.name).join(", ")})`, changes, "flags.wfrp4e.trained" : choice.map(i => i.id)}) + this.item.updateSource({"system.specification.value" : `${choice.map(i => i.name).join(", ")}`}) +} \ No newline at end of file diff --git a/reference_scripts/KICZPwLvbUSxbDrE.js b/reference_scripts/KICZPwLvbUSxbDrE.js new file mode 100644 index 0000000..30a0d6f --- /dev/null +++ b/reference_scripts/KICZPwLvbUSxbDrE.js @@ -0,0 +1,18 @@ +let table = game.wfrp4e.tables.findTable("mutatemental"); +if (!table) +{ + ui.notifications.error("Cannot find table with key: mutatemental") +} +let result = (await table.roll()).results[0]; +let uuid = `Compendium.${result.documentCollection}.${result.documentId}` +let item = await fromUuid(uuid); + +if (item) +{ + this.script.scriptNotification(`${item.name} added`) + this.actor.createEmbeddedDocuments("Item", [item]) +} +else +{ + ui.notifications.error("Item could not be found: " + uuid) +} \ No newline at end of file diff --git a/reference_scripts/KIoVBinAZK8sMOqD.js b/reference_scripts/KIoVBinAZK8sMOqD.js new file mode 100644 index 0000000..072c254 --- /dev/null +++ b/reference_scripts/KIoVBinAZK8sMOqD.js @@ -0,0 +1,11 @@ + + let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields: {difficulty : "average"}, skipTargets: true, appendTitle : " - Wounded"}) + await test.roll(); + if (test.failed) + { + fromUuid("Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb").then(disease => { + this.actor.createEmbeddedDocuments("Item", [disease.toObject()]) + this.script.scriptNotification("Gained " + disease.name) + }) + } + \ No newline at end of file diff --git a/reference_scripts/KJLAan0glJlyOyqF.js b/reference_scripts/KJLAan0glJlyOyqF.js new file mode 100644 index 0000000..e9a31c5 --- /dev/null +++ b/reference_scripts/KJLAan0glJlyOyqF.js @@ -0,0 +1,11 @@ + this.actor.getActiveTokens().forEach(t => t.document.update({light : { + "dim": 10, + "bright": 5, + "alpha": 0.5, + "animation": { + "speed": 4, + "intensity": 4, + "type": "flame", + }, + "color": "#ac9e6c", + }})); \ No newline at end of file diff --git a/reference_scripts/KPQfupKuaf4LCv4R.js b/reference_scripts/KPQfupKuaf4LCv4R.js new file mode 100644 index 0000000..9dcc016 --- /dev/null +++ b/reference_scripts/KPQfupKuaf4LCv4R.js @@ -0,0 +1,2 @@ +const talents = await Promise.all(["Schemer", "Second Sight"].map(game.wfrp4e.utility.findTalent)) +this.actor.createEmbeddedDocuments("Item", talents, {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/KQmb5B27eJ1lkbVL.js b/reference_scripts/KQmb5B27eJ1lkbVL.js new file mode 100644 index 0000000..7adee1c --- /dev/null +++ b/reference_scripts/KQmb5B27eJ1lkbVL.js @@ -0,0 +1 @@ +return this.item.system.quantity.value > 0 && args.type != "channelling" \ No newline at end of file diff --git a/reference_scripts/KQzbrpb0T5a7it4k.js b/reference_scripts/KQzbrpb0T5a7it4k.js new file mode 100644 index 0000000..1620dd8 --- /dev/null +++ b/reference_scripts/KQzbrpb0T5a7it4k.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.Item.vMYEkrWj0ip6ZOdv"); +let data = item.toObject(); +data.name += ` (Disease)`; +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/KSjsDlsx3DD6cT16.js b/reference_scripts/KSjsDlsx3DD6cT16.js new file mode 100644 index 0000000..f00b8b8 --- /dev/null +++ b/reference_scripts/KSjsDlsx3DD6cT16.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.Bribery"); \ No newline at end of file diff --git a/reference_scripts/KT670CjGBEprx2fO.js b/reference_scripts/KT670CjGBEprx2fO.js new file mode 100644 index 0000000..bbf4c65 --- /dev/null +++ b/reference_scripts/KT670CjGBEprx2fO.js @@ -0,0 +1,2 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.Item.RWJrupj9seau0w31"); +this.actor.createEmbeddedDocuments("Item", [item], {fromEffect: this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/KTBVDHUndI3qDOXM.js b/reference_scripts/KTBVDHUndI3qDOXM.js new file mode 100644 index 0000000..b9aa611 --- /dev/null +++ b/reference_scripts/KTBVDHUndI3qDOXM.js @@ -0,0 +1,6 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance")) +await test.roll(); +if (!test.succeeded) +{ + args.actor.addCondition("stunned") +} \ No newline at end of file diff --git a/reference_scripts/KUx0deSF3xNzMucL.js b/reference_scripts/KUx0deSF3xNzMucL.js new file mode 100644 index 0000000..208679d --- /dev/null +++ b/reference_scripts/KUx0deSF3xNzMucL.js @@ -0,0 +1 @@ +return args.skill?.name.includes(game.i18n.localize("NAME.Art")); \ No newline at end of file diff --git a/reference_scripts/KVpDUEjHhd3nLa0f.js b/reference_scripts/KVpDUEjHhd3nLa0f.js new file mode 100644 index 0000000..a301dfb --- /dev/null +++ b/reference_scripts/KVpDUEjHhd3nLa0f.js @@ -0,0 +1,6 @@ +let test = await this.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); +if (test.failed) +{ + this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll("enrage-beast")) +} \ No newline at end of file diff --git a/reference_scripts/KVuPduDztyMZQNt9.js b/reference_scripts/KVuPduDztyMZQNt9.js new file mode 100644 index 0000000..c359f67 --- /dev/null +++ b/reference_scripts/KVuPduDztyMZQNt9.js @@ -0,0 +1 @@ +args.fields.slBonus += this.actor.system.characteristics.ag.bonus \ No newline at end of file diff --git a/reference_scripts/KXzDe7cN2vynHjJO.js b/reference_scripts/KXzDe7cN2vynHjJO.js new file mode 100644 index 0000000..41a9fa8 --- /dev/null +++ b/reference_scripts/KXzDe7cN2vynHjJO.js @@ -0,0 +1,3 @@ +this.actor.hasCondition("blinded")?.delete(); +this.actor.hasCondition("deafened")?.delete() +this.actor.hasCondition("unconscious")?.delete() \ No newline at end of file diff --git a/reference_scripts/KkjkYAGI9Em1NgiQ.js b/reference_scripts/KkjkYAGI9Em1NgiQ.js new file mode 100644 index 0000000..1790282 --- /dev/null +++ b/reference_scripts/KkjkYAGI9Em1NgiQ.js @@ -0,0 +1,19 @@ +if (this.item.system.quantity.value) +{ + this.item.system.reduceQuantity(); + let test = await this.actor.setupSkill(game.i18n.localize("NAME.Heal"), { appendTitle: ` - ${this.effect.name}`, skipTargets: true }) + await test.roll(); + if (test.succeeded) + { + let actor = Array.from(game.user.targets)[0]?.actor || this.actor; + actor.applyEffect({ effectData: [this.item.effects.contents[0].convertToApplied()] }) + } + else + { + this.script.scriptNotification("Heal Test failed!", "error") + } +} +else +{ + this.script.scriptNotification("None left!", "error") +} \ No newline at end of file diff --git a/reference_scripts/KmngDrPD72xn22kZ.js b/reference_scripts/KmngDrPD72xn22kZ.js new file mode 100644 index 0000000..331fdca --- /dev/null +++ b/reference_scripts/KmngDrPD72xn22kZ.js @@ -0,0 +1,11 @@ +if (this.actor.Species.toLowerCase() != "skaven") { + this.actor.setupCharacteristic("t", {skipTargets: true, appendTitle : ` - Used ${this.effect.name}`, fields: { difficulty: "difficult" } }).then(async test => { + await test.roll() + if (test.failed) + { + let toughnessLost = Math.ceil(CONFIG.Dice.randomUniform() * 10) + this.actor.update({ "system.characteristics.t.initial": this.actor.characteristics.t.initial - toughnessLost }) + this.script.scriptMessage(`${this.actor.prototypeToken.name} lost ${toughnessLost} Toughness`) + } + }) + } \ No newline at end of file diff --git a/reference_scripts/KnwYZbeRSBA94hfl.js b/reference_scripts/KnwYZbeRSBA94hfl.js new file mode 100644 index 0000000..11bc24c --- /dev/null +++ b/reference_scripts/KnwYZbeRSBA94hfl.js @@ -0,0 +1,5 @@ +if (!args.flags.lostFingers) +{ + args.flags.lostFingers = true; + args.fields.modifier -= 5 * this.actor.flags.useless[this.item.system.location.key] +} \ No newline at end of file diff --git a/reference_scripts/KuUkUmOOLf05I4Bp.js b/reference_scripts/KuUkUmOOLf05I4Bp.js new file mode 100644 index 0000000..b2e2144 --- /dev/null +++ b/reference_scripts/KuUkUmOOLf05I4Bp.js @@ -0,0 +1 @@ +this.actor.hasCondition("broken")?.delete(); diff --git a/reference_scripts/KuuWAhoSzk0rCxxw.js b/reference_scripts/KuuWAhoSzk0rCxxw.js new file mode 100644 index 0000000..2d3f461 --- /dev/null +++ b/reference_scripts/KuuWAhoSzk0rCxxw.js @@ -0,0 +1 @@ +args.fields.modifier += -20; \ No newline at end of file diff --git a/reference_scripts/KyUPYV1RXJxPOfyA.js b/reference_scripts/KyUPYV1RXJxPOfyA.js new file mode 100644 index 0000000..5e60157 --- /dev/null +++ b/reference_scripts/KyUPYV1RXJxPOfyA.js @@ -0,0 +1,6 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "veasy"}}) +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("fatigued"); +} \ No newline at end of file diff --git a/reference_scripts/KyswmGj1uG3QS3ng.js b/reference_scripts/KyswmGj1uG3QS3ng.js new file mode 100644 index 0000000..81a6df2 --- /dev/null +++ b/reference_scripts/KyswmGj1uG3QS3ng.js @@ -0,0 +1 @@ +args.applyAP = false; \ No newline at end of file diff --git a/reference_scripts/L1RMLvKtRPFtnczI.js b/reference_scripts/L1RMLvKtRPFtnczI.js new file mode 100644 index 0000000..9e11b96 --- /dev/null +++ b/reference_scripts/L1RMLvKtRPFtnczI.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.MGEPI4jNhymNIRVz"); +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/L2cdQppcPwxz24hN.js b/reference_scripts/L2cdQppcPwxz24hN.js new file mode 100644 index 0000000..8eabc28 --- /dev/null +++ b/reference_scripts/L2cdQppcPwxz24hN.js @@ -0,0 +1 @@ +return !args.weapon \ No newline at end of file diff --git a/reference_scripts/L89UcafRHqUfxoux.js b/reference_scripts/L89UcafRHqUfxoux.js new file mode 100644 index 0000000..092415c --- /dev/null +++ b/reference_scripts/L89UcafRHqUfxoux.js @@ -0,0 +1,3 @@ +let injury = await fromUuid("Compendium.wfrp4e-core.items.3S4OYOZLauXctmev") +injury.updateSource({"system.location.key" : this.item.system.location.key}) +this.actor.createEmbeddedDocuments("Item", [injury], {fromEffect: this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/L9eAtDyaoHvqryk4.js b/reference_scripts/L9eAtDyaoHvqryk4.js new file mode 100644 index 0000000..c5efbe5 --- /dev/null +++ b/reference_scripts/L9eAtDyaoHvqryk4.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.Intimidate"); \ No newline at end of file diff --git a/reference_scripts/LAyLbcC0lOPwZP3U.js b/reference_scripts/LAyLbcC0lOPwZP3U.js new file mode 100644 index 0000000..328bcfe --- /dev/null +++ b/reference_scripts/LAyLbcC0lOPwZP3U.js @@ -0,0 +1 @@ +this.actor.addCondition("ablaze", parseInt(this.effect.sourceTest.result.SL)) \ No newline at end of file diff --git a/reference_scripts/LHUUXfZVLBhWqRvb.js b/reference_scripts/LHUUXfZVLBhWqRvb.js new file mode 100644 index 0000000..9dae93e --- /dev/null +++ b/reference_scripts/LHUUXfZVLBhWqRvb.js @@ -0,0 +1 @@ +this.actor.status.addArmour(5, {magical: true, source : this.effect}) \ No newline at end of file diff --git a/reference_scripts/LLqAT9wEUGMLfDhU.js b/reference_scripts/LLqAT9wEUGMLfDhU.js new file mode 100644 index 0000000..4102c46 --- /dev/null +++ b/reference_scripts/LLqAT9wEUGMLfDhU.js @@ -0,0 +1 @@ +return !args.item?.system.isRanged \ No newline at end of file diff --git a/reference_scripts/LOL2TGf8p8KxP14D.js b/reference_scripts/LOL2TGf8p8KxP14D.js new file mode 100644 index 0000000..a462357 --- /dev/null +++ b/reference_scripts/LOL2TGf8p8KxP14D.js @@ -0,0 +1,2 @@ +let wind = this.effect.name.split(" ")[2] +return args.type != "cast" || game.wfrp4e.config.magicWind[args.item.system.lore.value] != wind; \ No newline at end of file diff --git a/reference_scripts/LQEWSN5KnHHATPsf.js b/reference_scripts/LQEWSN5KnHHATPsf.js new file mode 100644 index 0000000..bd8c028 --- /dev/null +++ b/reference_scripts/LQEWSN5KnHHATPsf.js @@ -0,0 +1,4 @@ +if (args.totalWoundLoss > 0) +{ + this.script.scriptMessage(`${args.actor.name} must pass an Easy (+40) Endurance Test or gain a @UUID[Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb]{Festering Wound}`, {whisper: ChatMessage.getWhisperRecipients("GM")}) +} \ No newline at end of file diff --git a/reference_scripts/LXEUhHuXe8keEPI9.js b/reference_scripts/LXEUhHuXe8keEPI9.js new file mode 100644 index 0000000..0683f16 --- /dev/null +++ b/reference_scripts/LXEUhHuXe8keEPI9.js @@ -0,0 +1,7 @@ +let test = await this.actor.setupCharacteristic("wp", {fields: {difficulty : "average"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); +if (test.failed) +{ + let stuns = Math.max(1, Math.abs(test.result.SL)) + this.actor.addCondition("stunned", stuns) +} \ No newline at end of file diff --git a/reference_scripts/LeKLtvEDrWh4yHsx.js b/reference_scripts/LeKLtvEDrWh4yHsx.js new file mode 100644 index 0000000..bfe04ec --- /dev/null +++ b/reference_scripts/LeKLtvEDrWh4yHsx.js @@ -0,0 +1 @@ +return args.skill?.name == game.i18n.localize("NAME.CharmAnimal") || args.skill?.name.includes(game.i18n.localize("NAME.AnimalTraining")); \ No newline at end of file diff --git a/reference_scripts/LedRsrVo2f7lm3Ix.js b/reference_scripts/LedRsrVo2f7lm3Ix.js new file mode 100644 index 0000000..647d323 --- /dev/null +++ b/reference_scripts/LedRsrVo2f7lm3Ix.js @@ -0,0 +1 @@ +return args.skill?.name == game.i18n.localize("NAME.Intimidate"); \ No newline at end of file diff --git a/reference_scripts/Lg1oRg4oNRvucsvi.js b/reference_scripts/Lg1oRg4oNRvucsvi.js new file mode 100644 index 0000000..42395c3 --- /dev/null +++ b/reference_scripts/Lg1oRg4oNRvucsvi.js @@ -0,0 +1 @@ +return !(args.skill?.name == game.i18n.localize("NAME.Climb") || args.skill?.name == game.i18n.localize("NAME.Athletics")) \ No newline at end of file diff --git a/reference_scripts/LjXPlgdXBdllnA3i.js b/reference_scripts/LjXPlgdXBdllnA3i.js new file mode 100644 index 0000000..402cd45 --- /dev/null +++ b/reference_scripts/LjXPlgdXBdllnA3i.js @@ -0,0 +1 @@ +return !["s", "t"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/LkPtgN9A36OI6Frh.js b/reference_scripts/LkPtgN9A36OI6Frh.js new file mode 100644 index 0000000..4bda5cb --- /dev/null +++ b/reference_scripts/LkPtgN9A36OI6Frh.js @@ -0,0 +1 @@ +return args.skill?.name == game.i18n.localize("NAME.Leadership"); \ No newline at end of file diff --git a/reference_scripts/LlRhPGorLl5qJCU8.js b/reference_scripts/LlRhPGorLl5qJCU8.js new file mode 100644 index 0000000..3393901 --- /dev/null +++ b/reference_scripts/LlRhPGorLl5qJCU8.js @@ -0,0 +1,8 @@ +if (this.actor.hasCondition("prone")) +{ + this.actor.addCondition("unconscious"); +} +else +{ + this.actor.addCondition("prone"); +} \ No newline at end of file diff --git a/reference_scripts/Lm9IBkc918Duw3US.js b/reference_scripts/Lm9IBkc918Duw3US.js new file mode 100644 index 0000000..c27cbaf --- /dev/null +++ b/reference_scripts/Lm9IBkc918Duw3US.js @@ -0,0 +1,6 @@ +let career = this.actor.itemTypes.career.find(c => c.getFlag("wfrp4e", "doubleLife")) + +if(career) +{ + career.system.current.value = true; +} \ No newline at end of file diff --git a/reference_scripts/Lp261O9fgEXmgPf3.js b/reference_scripts/Lp261O9fgEXmgPf3.js new file mode 100644 index 0000000..65d054e --- /dev/null +++ b/reference_scripts/Lp261O9fgEXmgPf3.js @@ -0,0 +1,5 @@ +// If this actor wins a defending test, swap the test +if (!args.opposedTest.result.swapped && args.opposedTest.result.winner == "defender" && args.opposedTest.attackerTest.result.damage) +{ + args.opposedTest.swap(this.effect.label); +} \ No newline at end of file diff --git a/reference_scripts/Lpv2N9LK9loeumiW.js b/reference_scripts/Lpv2N9LK9loeumiW.js new file mode 100644 index 0000000..ad3c30e --- /dev/null +++ b/reference_scripts/Lpv2N9LK9loeumiW.js @@ -0,0 +1,6 @@ +if (this.actor.uuid != this.effect.sourceActor.uuid) +{ + this.actor.setupSkill(game.i18n.localize("NAME.Athletics"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty: "hard"}, context : {failure : `${this.effect.name}: cannot move or take actions`}}).then(test => { + test.roll(); + }) +} \ No newline at end of file diff --git a/reference_scripts/Lrb1S2aK7SFVD0C7.js b/reference_scripts/Lrb1S2aK7SFVD0C7.js new file mode 100644 index 0000000..2f40127 --- /dev/null +++ b/reference_scripts/Lrb1S2aK7SFVD0C7.js @@ -0,0 +1,9 @@ +if (args.totalWoundLoss > 0) +{ + let test = await args.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) + await test.roll(); + if (test.failed) + { + await args.actor.addCondition("fatigued"); + } +} \ No newline at end of file diff --git a/reference_scripts/Lu27iXtJVkrJ8bOx.js b/reference_scripts/Lu27iXtJVkrJ8bOx.js new file mode 100644 index 0000000..73cb61d --- /dev/null +++ b/reference_scripts/Lu27iXtJVkrJ8bOx.js @@ -0,0 +1 @@ +return !args.skill?.name?.includes(game.i18n.localize("NAME.Stealth")) \ No newline at end of file diff --git a/reference_scripts/LxdLkPxH3SFvYrCJ.js b/reference_scripts/LxdLkPxH3SFvYrCJ.js new file mode 100644 index 0000000..8f8a38c --- /dev/null +++ b/reference_scripts/LxdLkPxH3SFvYrCJ.js @@ -0,0 +1,4 @@ +if (args.effect.conditionId == "ablaze") +{ + args.data.formula += ` - ${this.actor.system.characteristics.t.bonus}` +} \ No newline at end of file diff --git a/reference_scripts/LyAK0dVDS5L09yq2.js b/reference_scripts/LyAK0dVDS5L09yq2.js new file mode 100644 index 0000000..e8b817a --- /dev/null +++ b/reference_scripts/LyAK0dVDS5L09yq2.js @@ -0,0 +1,9 @@ +let caster = this.effect.sourceActor + +if (caster) +{ + let bonus = caster.system.characteristics.wp.bonus + this.actor.modifyWounds(bonus) + + this.script.scriptMessage(`${this.actor.prototypeToken.name} regains ${bonus} Wounds`) +} \ No newline at end of file diff --git a/reference_scripts/M0XhKnWjG14pk3iH.js b/reference_scripts/M0XhKnWjG14pk3iH.js new file mode 100644 index 0000000..1431d31 --- /dev/null +++ b/reference_scripts/M0XhKnWjG14pk3iH.js @@ -0,0 +1 @@ +return !args.skill?.name.includes("Channelling") && args.type != "channelling" && args.skill?.name != game.i18n.localize("NAME.Charm") && !args.skill?.name.includes("Language (Magick)") && args.type != "cast" \ No newline at end of file diff --git a/reference_scripts/M2FshTX4PjKFVU8y.js b/reference_scripts/M2FshTX4PjKFVU8y.js new file mode 100644 index 0000000..6aa49fc --- /dev/null +++ b/reference_scripts/M2FshTX4PjKFVU8y.js @@ -0,0 +1,9 @@ +args.flags.earCount = Number.isNumeric(args.flags.earCount) ? args.flags.earCount+1 : 1; +if (args.characteristic == "fel") +{ + args.fields.modifier -= 5; +} +if (args.flags.earCount == 2 && args.skill?.name == game.i18n.localize("NAME.Perception")) +{ + args.fields.modifier -= 20; +} diff --git a/reference_scripts/M5bh0heeafA2fQQ8.js b/reference_scripts/M5bh0heeafA2fQQ8.js new file mode 100644 index 0000000..3583c70 --- /dev/null +++ b/reference_scripts/M5bh0heeafA2fQQ8.js @@ -0,0 +1,8 @@ +if (args.test.spell?.getFlag("wfrp4e", "boonOfTzeentch")) +{ + if (args.test.result.minormis || args.test.result.majormis || args.test.result.catastrophicmis) + { + this.script.scriptMessage(`${this.effect.name} quits your mind in disgust and erases itself from your grimoire!`) + this.effect.sourceItem.delete(); + } +} \ No newline at end of file diff --git a/reference_scripts/M9VgeYGiUO97ZUW4.js b/reference_scripts/M9VgeYGiUO97ZUW4.js new file mode 100644 index 0000000..4cb39af --- /dev/null +++ b/reference_scripts/M9VgeYGiUO97ZUW4.js @@ -0,0 +1,12 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.hCadFsTRvLN9faaY") +let data = item.toObject(); +data.system.location.value = "Jaw" +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) + +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); +if (!test.succeeded) +{ + args.actor.addCondition("unconscious") +} + diff --git a/reference_scripts/MCK6WyjwYT28lsTN.js b/reference_scripts/MCK6WyjwYT28lsTN.js new file mode 100644 index 0000000..e13fea1 --- /dev/null +++ b/reference_scripts/MCK6WyjwYT28lsTN.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.u0CFf3xwiyidD9T5") +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/MDLttXplnNthncGr.js b/reference_scripts/MDLttXplnNthncGr.js new file mode 100644 index 0000000..b7a08ee --- /dev/null +++ b/reference_scripts/MDLttXplnNthncGr.js @@ -0,0 +1 @@ +return args.type == "cast" && ["death", "necromancy", "life", "light", "heavens"].includes(args.spell?.system.lore.value) \ No newline at end of file diff --git a/reference_scripts/MFKhU9vp8bQpHP3I.js b/reference_scripts/MFKhU9vp8bQpHP3I.js new file mode 100644 index 0000000..126a0b5 --- /dev/null +++ b/reference_scripts/MFKhU9vp8bQpHP3I.js @@ -0,0 +1,14 @@ +let value = parseInt(this.item.specification.value) +let name = this.actor.prototypeToken.name + +if (game.user.isGM && game.user.targets.size) +{ + game.user.targets.forEach(t => { + t.actor.applyTerror(value, name) + }) + game.user.updateTokenTargets([]); +} +else +{ + game.wfrp4e.utility.postTerror(value, name) +} \ No newline at end of file diff --git a/reference_scripts/MI2GgNi3fZtUCtQD.js b/reference_scripts/MI2GgNi3fZtUCtQD.js new file mode 100644 index 0000000..4a7e8fc --- /dev/null +++ b/reference_scripts/MI2GgNi3fZtUCtQD.js @@ -0,0 +1 @@ +return ["int", "wp"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/MJB6WbZSF6Briz30.js b/reference_scripts/MJB6WbZSF6Briz30.js new file mode 100644 index 0000000..13bb16c --- /dev/null +++ b/reference_scripts/MJB6WbZSF6Briz30.js @@ -0,0 +1 @@ +return args.item?.name == game.i18n.localize("NAME.Leadership") \ No newline at end of file diff --git a/reference_scripts/MSJWJEUrX7ZmMvAD.js b/reference_scripts/MSJWJEUrX7ZmMvAD.js new file mode 100644 index 0000000..ad91ce3 --- /dev/null +++ b/reference_scripts/MSJWJEUrX7ZmMvAD.js @@ -0,0 +1 @@ +return !(args.skill?.name.includes(game.i18n.localize("NAME.Ranged")) || args.item?.isRanged || args.item?.name == game.i18n.localize("NAME.Charm")) \ No newline at end of file diff --git a/reference_scripts/McLR9YcgVUG3MooC.js b/reference_scripts/McLR9YcgVUG3MooC.js new file mode 100644 index 0000000..38225fd --- /dev/null +++ b/reference_scripts/McLR9YcgVUG3MooC.js @@ -0,0 +1 @@ +args.applyTB = false; \ No newline at end of file diff --git a/reference_scripts/MfxWXZwaZUjGSBqw.js b/reference_scripts/MfxWXZwaZUjGSBqw.js new file mode 100644 index 0000000..4e012c4 --- /dev/null +++ b/reference_scripts/MfxWXZwaZUjGSBqw.js @@ -0,0 +1,5 @@ +if (this.actor.hasCondition("ablaze")) +{ + this.script.scriptNotification("Immune to Ablaze") + await this.actor.hasCondition("ablaze")?.delete() +} \ No newline at end of file diff --git a/reference_scripts/MfxzwJz2o9ho2hOM.js b/reference_scripts/MfxzwJz2o9ho2hOM.js new file mode 100644 index 0000000..664e6ec --- /dev/null +++ b/reference_scripts/MfxzwJz2o9ho2hOM.js @@ -0,0 +1 @@ +return args.skill?.name == "Lore (Apothecary)" \ No newline at end of file diff --git a/reference_scripts/MgMMoC4Umpg7fmNI.js b/reference_scripts/MgMMoC4Umpg7fmNI.js new file mode 100644 index 0000000..ef41566 --- /dev/null +++ b/reference_scripts/MgMMoC4Umpg7fmNI.js @@ -0,0 +1,24 @@ +// Apply changes when the mask is worn + +if (args.equipped) { + this.actor.createEmbeddedDocuments("ActiveEffect", [this.item.effects.contents[1]?.convertToApplied()]) + this.script.scriptMessage(`${this.actor.name} dons the ${this.item.name}.${this.actor.prototypeToken.name} has gained the Magic Resistance Trait. This effect lasts for one hour.
`, {whisper: ChatMessage.getWhisperRecipients("GM"), blind: true }) +} + +if (hasMagicResistance) { + // Multiple doses may be consumed at once, with each one adding an additional 1 to the Magic Resistance rating and increasing the duration by one hour. + let msg = `${this.actor.prototypeToken.name} has enhanced their Magic Resistance by 1 to Rating ${parseInt(hasMagicResistance.system.specification.value)}. This effect lasts for one hour.
` + + // Resist toxic effect + this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), { + fields: {difficulty: "challenging"} + }).then(async test => { + await test.roll() + + // If they fail ... + if (!test.succeeded) { + msg += `However, they begin to ooze the thick, poisonous slime that coats every Dreadmaw. They have gained 1 Poisoned Condition now and should continue to receive an additional @Condition[Poisoned] Condition at the end of each of the round.
+If they are still alive at the end of 10 rounds, the effect ends and all Poisoned Conditions gained from ${this.effect.name} are removed.
` + this.actor.addCondition("poisoned", 1) + } + this.script.scriptMessage(msg, {whisper: ChatMessage.getWhisperRecipients("GM"), blind: true }) + }) +} diff --git a/reference_scripts/PVjaKAHTKDA0rA9J.js b/reference_scripts/PVjaKAHTKDA0rA9J.js new file mode 100644 index 0000000..8942127 --- /dev/null +++ b/reference_scripts/PVjaKAHTKDA0rA9J.js @@ -0,0 +1,2 @@ +let test = await this.actor.setupSkill("Dodge", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}); +await test.roll(); \ No newline at end of file diff --git a/reference_scripts/PdClojv7yNgQpOUc.js b/reference_scripts/PdClojv7yNgQpOUc.js new file mode 100644 index 0000000..071f833 --- /dev/null +++ b/reference_scripts/PdClojv7yNgQpOUc.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.Endurance"); \ No newline at end of file diff --git a/reference_scripts/PeZYj8b0vedyJj00.js b/reference_scripts/PeZYj8b0vedyJj00.js new file mode 100644 index 0000000..51a0a44 --- /dev/null +++ b/reference_scripts/PeZYj8b0vedyJj00.js @@ -0,0 +1,14 @@ +// This script needs to be separate because equipTransfer is off on the other effect, and thus won't execute when added to an actor + +let mainEffect = this.item.effects.contents[0]; +if (mainEffect.name.includes("(Lore)")) +{ + let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, "Choose Lore"); + if (choice.length) + { + mainEffect.update({name : mainEffect.name.replace("Lore", choice[0].name)}) + this.item.update({name : this.item.name += ` (${choice[0].name})`}) + } +} + +this.effect.delete(); \ No newline at end of file diff --git a/reference_scripts/Pg9C6nJX5QHIdqa9.js b/reference_scripts/Pg9C6nJX5QHIdqa9.js new file mode 100644 index 0000000..f7d625b --- /dev/null +++ b/reference_scripts/Pg9C6nJX5QHIdqa9.js @@ -0,0 +1 @@ +return !args.item?.system.attackType diff --git a/reference_scripts/Ph3TdQw1lGiFr049.js b/reference_scripts/Ph3TdQw1lGiFr049.js new file mode 100644 index 0000000..f7e4852 --- /dev/null +++ b/reference_scripts/Ph3TdQw1lGiFr049.js @@ -0,0 +1,19 @@ + if (!args.test.context.phantasmal && + (this.actor.isOpposing || args.test.context.defending) && + args.test.result.roll % 11 == 0 && + args.test.succeeded && + ["Language (Magick)", "Dodge"].includes(args.test.item?.name)) + { + args.test.context.phantasmal = true; // Flag so items aren't readded if test is edited + let text = `${this.effect.name}: Adding Unstable and Ward` + args.test.result.other.push(text) + this.script.scriptNotification(text); + + let ward = await fromUuid("Compendium.wfrp4e-core.items.Bvd2aZ0gQUXHfCTh") + let wardData = ward.toObject(); + wardData.system.specification.value = 9; + + let unstable = await fromUuid("Compendium.wfrp4e-core.items.D0ImWEIMSDgElsnl") + let unstableData = unstable.toObject(); + this.actor.createEmbeddedDocuments("Item", [wardData, unstableData], {fromEffect: this.effect.id}) + } diff --git a/reference_scripts/PjRxGuUDKGmSmVDc.js b/reference_scripts/PjRxGuUDKGmSmVDc.js new file mode 100644 index 0000000..dd06719 --- /dev/null +++ b/reference_scripts/PjRxGuUDKGmSmVDc.js @@ -0,0 +1,5 @@ +fromUuid("Compendium.wfrp4e-core.items.EO05HX7jql0g605A").then(item => { + item = item.toObject() + item.system.specification.value = this.actor.characteristics.ag.value + this.actor.createEmbeddedDocuments("Item", [item], {fromEffect : this.effect.id}) +}) \ No newline at end of file diff --git a/reference_scripts/PmELrzD3RmF9qKkO.js b/reference_scripts/PmELrzD3RmF9qKkO.js new file mode 100644 index 0000000..3d5c0b3 --- /dev/null +++ b/reference_scripts/PmELrzD3RmF9qKkO.js @@ -0,0 +1,9 @@ +if (this.item.system.specification.value == "Size") +{ + let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.actorSizes, this.item.img), 1, "Choose Size"); + if (choice[0]) + { + this.item.updateSource({"system.specification.value" : choice[0].name}) + this.effect.updateSource({name : this.effect.name + ` (${choice[0].name})`}) + } +} \ No newline at end of file diff --git a/reference_scripts/PoNnT5EqvLj2r5yf.js b/reference_scripts/PoNnT5EqvLj2r5yf.js new file mode 100644 index 0000000..af693bc --- /dev/null +++ b/reference_scripts/PoNnT5EqvLj2r5yf.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.OutdoorSurvival") && args.skill?.name != game.i18n.localize("NAME.Track"); \ No newline at end of file diff --git a/reference_scripts/PwqTmw7rsG8hzqCS.js b/reference_scripts/PwqTmw7rsG8hzqCS.js new file mode 100644 index 0000000..6ce47bf --- /dev/null +++ b/reference_scripts/PwqTmw7rsG8hzqCS.js @@ -0,0 +1,10 @@ +if (args.test.result.critical && args.test.result.roll % 10 == 0) +{ + game.wfrp4e.tables.findTable("knuckleduster-diseases").roll().then(roll => { + let results = roll.results[0] + + this.script.scriptMessage(`${this.actor.name} contracts @UUID[Compendium.${results.documentCollection}.${results.documentId}]{${results.text}}`, {blind : true, whisper: ChatMessage.getWhisperRecipients("GM") }) + }) + + } + diff --git a/reference_scripts/Q1trEhtqjIiDvFPF.js b/reference_scripts/Q1trEhtqjIiDvFPF.js new file mode 100644 index 0000000..edff223 --- /dev/null +++ b/reference_scripts/Q1trEhtqjIiDvFPF.js @@ -0,0 +1 @@ +args.prefillModifiers.modifier -= 10 * getProperty(this.effect, 'flags.wfrp4e.value') \ No newline at end of file diff --git a/reference_scripts/Q4EQgP4gZR8TTm7S.js b/reference_scripts/Q4EQgP4gZR8TTm7S.js new file mode 100644 index 0000000..2ae696c --- /dev/null +++ b/reference_scripts/Q4EQgP4gZR8TTm7S.js @@ -0,0 +1,9 @@ +let penalty = 0 +if (args.item?.system.attackType) +{ + penalty -= 30 +} +if (args.actor.has("Second Sight", "talent")) + penalty += 10 + +args.prefillModifiers.modifier += penalty \ No newline at end of file diff --git a/reference_scripts/Q68WiUWY7GxiXBbT.js b/reference_scripts/Q68WiUWY7GxiXBbT.js new file mode 100644 index 0000000..536d1ae --- /dev/null +++ b/reference_scripts/Q68WiUWY7GxiXBbT.js @@ -0,0 +1,5 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.9GNpAqgsKzxZKJpp") +let data = item.toObject(); +data.system.specification.value = "When Alone"; +data.effects[0].disabled = true; +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/Q9EmlWmuDac83cJw.js b/reference_scripts/Q9EmlWmuDac83cJw.js new file mode 100644 index 0000000..65e9e2e --- /dev/null +++ b/reference_scripts/Q9EmlWmuDac83cJw.js @@ -0,0 +1 @@ +return args.skill?.name == game.i18n.localize("NAME.Climb") || args.skill?.name?.includes(game.i18n.localize("NAME.Stealth")); \ No newline at end of file diff --git a/reference_scripts/QF8LanKNoAlTkQG0.js b/reference_scripts/QF8LanKNoAlTkQG0.js new file mode 100644 index 0000000..bb333fb --- /dev/null +++ b/reference_scripts/QF8LanKNoAlTkQG0.js @@ -0,0 +1 @@ +this.actor.system.status.encumbrance.max += 2 \ No newline at end of file diff --git a/reference_scripts/QKTA2TqZ77pvHWSJ.js b/reference_scripts/QKTA2TqZ77pvHWSJ.js new file mode 100644 index 0000000..1a94aec --- /dev/null +++ b/reference_scripts/QKTA2TqZ77pvHWSJ.js @@ -0,0 +1,9 @@ + this.actor.getActiveTokens().forEach(t => t.document.update({light : { + "dim": 0, + "bright": 0, + "alpha": 0.5, + "animation": { + "type": "", + }, + "color": "#000000", + }})); \ No newline at end of file diff --git a/reference_scripts/QKjR6P1WEHXf4K77.js b/reference_scripts/QKjR6P1WEHXf4K77.js new file mode 100644 index 0000000..1fee3fb --- /dev/null +++ b/reference_scripts/QKjR6P1WEHXf4K77.js @@ -0,0 +1 @@ +args.fields.slBonus -= 2 diff --git a/reference_scripts/QPVVDPcJ4Xi5FmQl.js b/reference_scripts/QPVVDPcJ4Xi5FmQl.js new file mode 100644 index 0000000..340975c --- /dev/null +++ b/reference_scripts/QPVVDPcJ4Xi5FmQl.js @@ -0,0 +1,9 @@ +if(this.actor.hasCondition("fatigued") && args.opposedTest.result.hitloc.value == "head" && (args.opposedTest.attackerTest.result.critical || args.actor.status.wounds.value - args.totalWoundLoss < 0)) +{ + let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), { fields: { difficulty: "average" }, skipTargets: true, appendTitle : ` - ${this.effect.name}`}) + await test.roll(); + if (test.failed) + { + this.actor.addCondition("unconscious") + } +} \ No newline at end of file diff --git a/reference_scripts/QQ2gHThZHdO4yLLX.js b/reference_scripts/QQ2gHThZHdO4yLLX.js new file mode 100644 index 0000000..abb25c3 --- /dev/null +++ b/reference_scripts/QQ2gHThZHdO4yLLX.js @@ -0,0 +1 @@ +return args.skill?.name == game.i18n.localize("NAME.Swim"); \ No newline at end of file diff --git a/reference_scripts/QQPiREc50HT5W2Tr.js b/reference_scripts/QQPiREc50HT5W2Tr.js new file mode 100644 index 0000000..7190682 --- /dev/null +++ b/reference_scripts/QQPiREc50HT5W2Tr.js @@ -0,0 +1,2 @@ +if (args.item.type == "weapon" && args.item.weaponGroup.value == "brawling") + args.item.damage.value += " + 1" \ No newline at end of file diff --git a/reference_scripts/QRSACifDrvojIXHB.js b/reference_scripts/QRSACifDrvojIXHB.js new file mode 100644 index 0000000..0527702 --- /dev/null +++ b/reference_scripts/QRSACifDrvojIXHB.js @@ -0,0 +1,11 @@ +if (!this.actor.effects.find(e => e.isCondition)) +{ + return this.script.scriptNotification("No Conditions on this Actor") +} + +let choice = await ItemDialog.create(this.actor.effects.filter(i => i.isCondition), 1, "Choose a Condition") + +if (choice[0]) +{ + this.actor.removeCondition(choice[0].conditionId) +} diff --git a/reference_scripts/QaGNsqKm2Nf0zGVm.js b/reference_scripts/QaGNsqKm2Nf0zGVm.js new file mode 100644 index 0000000..3fc40b5 --- /dev/null +++ b/reference_scripts/QaGNsqKm2Nf0zGVm.js @@ -0,0 +1 @@ +return ["t", "int", "wp", "fel"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/QbIYnshWeP1U8SUy.js b/reference_scripts/QbIYnshWeP1U8SUy.js new file mode 100644 index 0000000..d6c5e61 --- /dev/null +++ b/reference_scripts/QbIYnshWeP1U8SUy.js @@ -0,0 +1,2 @@ +args.applyAP = false; +args.applyTB = false; \ No newline at end of file diff --git a/reference_scripts/Qgn92fZyc3Psn8QJ.js b/reference_scripts/Qgn92fZyc3Psn8QJ.js new file mode 100644 index 0000000..fcfd3fd --- /dev/null +++ b/reference_scripts/Qgn92fZyc3Psn8QJ.js @@ -0,0 +1,10 @@ +if (args.test.options.useOnesAttractive && (args.test.result.roll <= game.settings.get("wfrp4e", "automaticSuccess") || args.test.result.roll <= args.test.target)) +{ + +let SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10) +let ones = Number(args.test.result.roll.toString().split("").pop()) + +if (ones > SL) + args.test.data.result.SL = "+" + (ones + args.test.successBonus + args.test.slBonus) + args.test.result.other.push(`${this.effect.name}: Used unit dice as SL`) +} \ No newline at end of file diff --git a/reference_scripts/Qk7t2l5ep9RDVpgE.js b/reference_scripts/Qk7t2l5ep9RDVpgE.js new file mode 100644 index 0000000..80de579 --- /dev/null +++ b/reference_scripts/Qk7t2l5ep9RDVpgE.js @@ -0,0 +1 @@ +args.options.diceman= true; \ No newline at end of file diff --git a/reference_scripts/QoEOxRruQXYrZrv3.js b/reference_scripts/QoEOxRruQXYrZrv3.js new file mode 100644 index 0000000..c084829 --- /dev/null +++ b/reference_scripts/QoEOxRruQXYrZrv3.js @@ -0,0 +1,17 @@ +let filters = [ + { + property : "type", + value : "skill" + }, + { + property : "name", + value : /Melee/gm, + regex: true + } +] + +let items = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 2, "Choose 2 Skills to add +20") +items = items.map(i => i.toObject()) +items.forEach(i => i.system.advances.value = 20) + +this.actor.createEmbeddedDocuments("Item", items); \ No newline at end of file diff --git a/reference_scripts/QqkE7rlqhkeRohFD.js b/reference_scripts/QqkE7rlqhkeRohFD.js new file mode 100644 index 0000000..896b9a2 --- /dev/null +++ b/reference_scripts/QqkE7rlqhkeRohFD.js @@ -0,0 +1 @@ +return !(["cast", "channelling"].includes(args.type) && this.actor.hasCondition("fatigued")) \ No newline at end of file diff --git a/reference_scripts/QqybHxNCzPEzG1Qh.js b/reference_scripts/QqybHxNCzPEzG1Qh.js new file mode 100644 index 0000000..05952e9 --- /dev/null +++ b/reference_scripts/QqybHxNCzPEzG1Qh.js @@ -0,0 +1 @@ +return args.fields.dualWielding || args.options.dualWieldOffhand \ No newline at end of file diff --git a/reference_scripts/QwHoqu2oO8QO8Mad.js b/reference_scripts/QwHoqu2oO8QO8Mad.js new file mode 100644 index 0000000..a5972f6 --- /dev/null +++ b/reference_scripts/QwHoqu2oO8QO8Mad.js @@ -0,0 +1,3 @@ +let content = `${this.effect.name}: All targets engaged with ${this.actor.prototypeToken.name} take [[/r 1d10]] Damage, modified by TB and AP.` + +this.script.scriptMessage(content) \ No newline at end of file diff --git a/reference_scripts/R32U01LBjBrK1pns.js b/reference_scripts/R32U01LBjBrK1pns.js new file mode 100644 index 0000000..4816313 --- /dev/null +++ b/reference_scripts/R32U01LBjBrK1pns.js @@ -0,0 +1,33 @@ + const templateMap = { + 'P2e7Yx98bK3u110a' : "", + 'iuMp3KLaMT2WCmie' : "Xp4r2KUhqfjak8zq", + 'RBuYcT5tppwcmnC5' : "wYN19h3WVF1yOVq2", + 'vcGpNwNbhvfzVveQ' : "ac5ClOuaYtzOYyWp", + 'jmhKZy0w9TzkEK9c' : "IS3LTdTuay6uRHUq", + '9Byj6k7SmdTYis2V' : "LjMlx99gBGeRJUQu", + 'laJwc2l9tzJPgaaJ' : "x5wpMprsObuqMCYg", + } + let template = (await game.wfrp4e.tables.rollTable("hireling-templates", {hideDSN: true})).object; + let physicalQuirk = (await game.wfrp4e.tables.rollTable("physical-quirks", {hideDSN: true})).text; + let workEthic = (await game.wfrp4e.tables.rollTable("work-ethic", {hideDSN: true})).text; + let personalityQuirk = (await game.wfrp4e.tables.rollTable("personality-quirks", {hideDSN: true})).text; + + + let templateItem = await game.wfrp4e.utility.findItemId(templateMap[template._id]); + + let bio = + ` +Template: ${template.text}
+Phsyical Quirk: ${physicalQuirk}
+Work Ethic: ${workEthic}
+Personality Quirk: ${personalityQuirk}
+ ` + + this.script.scriptMessage(bio, {whisper : ChatMessage.getWhisperRecipients("GM")}) + + await this.actor.update({"system.details.gmnotes.value" : bio}) + + if (templateItem) + { + this.actor.createEmbeddedDocuments("Item", [templateItem.toObject()]) + } \ No newline at end of file diff --git a/reference_scripts/R5dOZWFxE2n6tooX.js b/reference_scripts/R5dOZWFxE2n6tooX.js new file mode 100644 index 0000000..d6c0f61 --- /dev/null +++ b/reference_scripts/R5dOZWFxE2n6tooX.js @@ -0,0 +1 @@ +return this.item.system.usesLocation(args.weapon) \ No newline at end of file diff --git a/reference_scripts/R6SnyF3y4Vsq6oga.js b/reference_scripts/R6SnyF3y4Vsq6oga.js new file mode 100644 index 0000000..9cb3f07 --- /dev/null +++ b/reference_scripts/R6SnyF3y4Vsq6oga.js @@ -0,0 +1,8 @@ +let lore = this.effect.name.split("(")[1].split(")")[0].toLowerCase(); + +// If channelling corresponding lore +if (args.type == "channelling" && args.spell.system.lore.value == lore) + args.prefillModifiers.slBonus += 1 +// If channelling or casting different lore +else if (args.spell.system.lore.value != lore && args.spell.system.lore.value != "petty") + args.prefillModifiers.slBonus -= 1 \ No newline at end of file diff --git a/reference_scripts/R95pDZMHnD9iHAl8.js b/reference_scripts/R95pDZMHnD9iHAl8.js new file mode 100644 index 0000000..903d7c3 --- /dev/null +++ b/reference_scripts/R95pDZMHnD9iHAl8.js @@ -0,0 +1 @@ +return args.skill?.name.includes(this.item.system.tests.value); \ No newline at end of file diff --git a/reference_scripts/RDtJXji3hgcKnEBk.js b/reference_scripts/RDtJXji3hgcKnEBk.js new file mode 100644 index 0000000..84cd8d9 --- /dev/null +++ b/reference_scripts/RDtJXji3hgcKnEBk.js @@ -0,0 +1,33 @@ +let as = (await fromUuid("Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS")).toObject(); +let hv = (await fromUuid("Compendium.wfrp4e-core.items.Item.Nj3tC8A5fZ3zEdMR")).toObject(); +let ms = (await fromUuid("Compendium.wfrp4e-core.items.Item.6w30u0VPsAicrqb5")).toObject(); +let ss = (await fromUuid("Compendium.wfrp4e-core.items.Item.OEjUvJKi0xmBwbS2")).toObject(); + +as.name += " (Sight)"; + +let roll = (await new Roll("1d10").roll()); +roll.toMessage(this.script.getChatData()) +let items = [] + +if (roll.total <= 2) +{ + items = items.concat([as]); +} +else if (roll.total <= 4) +{ + items = items.concat([hv]); +} +else if (roll.total <= 6) +{ + items = items.concat([ms]); +} +else if (roll.total <= 8) +{ + items = items.concat([ss]); +} +else if (roll.total <= 10) +{ + items = items.concat([as, hv, ms, ss]); +} + +this.actor.createEmbeddedDocuments("Item", items, {fromEffect: this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/RHyBLYT5oHf7EPnG.js b/reference_scripts/RHyBLYT5oHf7EPnG.js new file mode 100644 index 0000000..0eeaadd --- /dev/null +++ b/reference_scripts/RHyBLYT5oHf7EPnG.js @@ -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"); \ No newline at end of file diff --git a/reference_scripts/RI8crJxeD8JLDwMh.js b/reference_scripts/RI8crJxeD8JLDwMh.js new file mode 100644 index 0000000..0a98874 --- /dev/null +++ b/reference_scripts/RI8crJxeD8JLDwMh.js @@ -0,0 +1 @@ +return args.weapon?.system?.weaponGroup?.value != "fencing" \ No newline at end of file diff --git a/reference_scripts/RJpglw5eVRM1f9t0.js b/reference_scripts/RJpglw5eVRM1f9t0.js new file mode 100644 index 0000000..ab32d24 --- /dev/null +++ b/reference_scripts/RJpglw5eVRM1f9t0.js @@ -0,0 +1 @@ +args.wounds *= 5 \ No newline at end of file diff --git a/reference_scripts/RKIFGN583PQnqHGk.js b/reference_scripts/RKIFGN583PQnqHGk.js new file mode 100644 index 0000000..c0633f0 --- /dev/null +++ b/reference_scripts/RKIFGN583PQnqHGk.js @@ -0,0 +1,5 @@ +if (args.opposedTest.result.hitloc.value == "body" && args.totalWoundLoss > 0) +{ + args.actor.addCondition("bleeding", 2) + this.script.scriptMessage("Gained 2 Bleeding Conditions") +} \ No newline at end of file diff --git a/reference_scripts/RNHrSTfMLXm5sXkC.js b/reference_scripts/RNHrSTfMLXm5sXkC.js new file mode 100644 index 0000000..c5b8e70 --- /dev/null +++ b/reference_scripts/RNHrSTfMLXm5sXkC.js @@ -0,0 +1 @@ +return ["ws", "bs", "s", "ag"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/RNr9CwyvLhlnwD2h.js b/reference_scripts/RNr9CwyvLhlnwD2h.js new file mode 100644 index 0000000..2dbcde4 --- /dev/null +++ b/reference_scripts/RNr9CwyvLhlnwD2h.js @@ -0,0 +1 @@ +return !args.skill?.name.includes(game.i18n.localize("NAME.Sail")); \ No newline at end of file diff --git a/reference_scripts/ROXCqAFSTLouJniL.js b/reference_scripts/ROXCqAFSTLouJniL.js new file mode 100644 index 0000000..dcc969a --- /dev/null +++ b/reference_scripts/ROXCqAFSTLouJniL.js @@ -0,0 +1,7 @@ +if (args.test.spell.name == "Warp Lightning") +{ + if (args.test.result.minormis || args.test.result.majormis || args.test.result.catastrophicmis) + { + this.script.scriptMessage(`${this.item.name} Overloads!`) + } +} \ No newline at end of file diff --git a/reference_scripts/RSsGiDFibuqg3sHr.js b/reference_scripts/RSsGiDFibuqg3sHr.js new file mode 100644 index 0000000..9132550 --- /dev/null +++ b/reference_scripts/RSsGiDFibuqg3sHr.js @@ -0,0 +1,15 @@ +let diseaseIndex = game.packs +.filter(i => i.metadata.type == "Item") +.reduce((acc, pack) => acc.concat(pack.index.contents), []) +.filter(i => i.type == "disease") +.map(i => { + i.id = i._id + return i +}) + +let choice = await ItemDialog.create(diseaseIndex , 1, "Choose a Disease") + +if (choice[0]) +{ + await this.item.updateSource({"system.specification.value" : choice[0].name}) +} \ No newline at end of file diff --git a/reference_scripts/RZlMkxJz5apn0mUj.js b/reference_scripts/RZlMkxJz5apn0mUj.js new file mode 100644 index 0000000..74fe1bc --- /dev/null +++ b/reference_scripts/RZlMkxJz5apn0mUj.js @@ -0,0 +1 @@ +return args.item?.system.attackType != "ranged" \ No newline at end of file diff --git a/reference_scripts/RprZWlnopSqZt7KZ.js b/reference_scripts/RprZWlnopSqZt7KZ.js new file mode 100644 index 0000000..523491c --- /dev/null +++ b/reference_scripts/RprZWlnopSqZt7KZ.js @@ -0,0 +1 @@ +return !args.skill?.name.includes(game.i18n.localize("NAME.Stealth")); \ No newline at end of file diff --git a/reference_scripts/RqWnhnwFxaHubgiA.js b/reference_scripts/RqWnhnwFxaHubgiA.js new file mode 100644 index 0000000..a9b12cd --- /dev/null +++ b/reference_scripts/RqWnhnwFxaHubgiA.js @@ -0,0 +1,3 @@ +await args.actor.addCondition("blinded"); +await args.actor.addCondition("deafened"); +await args.actor.addCondition("stunned"); \ No newline at end of file diff --git a/reference_scripts/RrchOMpEdIvceJxl.js b/reference_scripts/RrchOMpEdIvceJxl.js new file mode 100644 index 0000000..300050b --- /dev/null +++ b/reference_scripts/RrchOMpEdIvceJxl.js @@ -0,0 +1 @@ +return args.skill?.name == "Stealth (Rural)" \ No newline at end of file diff --git a/reference_scripts/RuW1PWUFxIbbSlIm.js b/reference_scripts/RuW1PWUFxIbbSlIm.js new file mode 100644 index 0000000..c333e53 --- /dev/null +++ b/reference_scripts/RuW1PWUFxIbbSlIm.js @@ -0,0 +1 @@ +return !["t", "wp", "ag", "i", "int"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/RvipIYj9H7n4UDMe.js b/reference_scripts/RvipIYj9H7n4UDMe.js new file mode 100644 index 0000000..4ae90e5 --- /dev/null +++ b/reference_scripts/RvipIYj9H7n4UDMe.js @@ -0,0 +1,84 @@ + let characteristics = { + "ws" : -10, + "bs" : -10, + "s" : -5, + "t" : -5, + "i" : -10, + "ag" : -10, + "dex" : -10, + "int" : 0, + "wp" : 0, + "fel" : 0 + } + let skills = [] + let skillAdvancements = [] + let talents = [] + let trappings = [] + let items = [] + + let updateObj = this.actor.toObject(); + + for (let ch in characteristics) + { + updateObj.system.characteristics[ch].modifier += characteristics[ch]; + } + + for (let index = 0; index < skills.length; index++) + { + let skill = skills[index] + let skillItem; + skillItem = updateObj.items.find(i => i.name == skill && i.type == "skill") + if (skillItem) + skillItem.system.advances.value += skillAdvancements[index] + else + { + skillItem = await game.wfrp4e.utility.findSkill(skill) + skillItem = skillItem.toObject(); + skillItem.system.advances.value = skillAdvancements[index]; + items.push(skillItem); + } + } + + for (let talent of talents) + { + let talentItem = await game.wfrp4e.utility.findTalent(talent) + if (talentItem) + { + items.push(talentItem.toObject()); + } + else + { + ui.notifications.warn(`Could not find ${talent}`, {permanent : true}) + } + } + + for (let trapping of trappings) + { + let trappingItem = await game.wfrp4e.utility.findItem(trapping) + if (trappingItem) + { + trappingItem = trappingItem.toObject() + + equip(trappingItem) + + items.push(trappingItem); + } + else + { + ui.notifications.warn(`Could not find ${trapping}`, {permanent : true}) + } + } + + + await this.actor.update(updateObj) + this.actor.createEmbeddedDocuments("Item", items); + + function equip(item) + { + if (item.type == "armour") + item.system.worn.value = true + else if (item.type == "weapon") + item.system.equipped = true + else if (item.type == "trapping" && item.system.trappingType.value == "clothingAccessories") + item.system.worn = true + } \ No newline at end of file diff --git a/reference_scripts/S1QihXuvdEVzeRtB.js b/reference_scripts/S1QihXuvdEVzeRtB.js new file mode 100644 index 0000000..0194c09 --- /dev/null +++ b/reference_scripts/S1QihXuvdEVzeRtB.js @@ -0,0 +1,40 @@ +let dice = await new Roll("1d10").roll() +let roll = dice.total +let talent +let message +let modifier = 0 + +if (roll <= 3) +{ + item = await fromUuid("Compendium.wfrp4e-core.items.mNoCuaVbFBflfO6X") +} + +else if (roll <= 6) +{ + item = await fromUuid("Compendium.wfrp4e-core.items.OEjUvJKi0xmBwbS2") + modifier = -3 +} + +else if (roll <= 9) +{ + item = await fromUuid("Compendium.wfrp4e-core.items.mdPGZsn2396dEpOf") + modifier = -3 +} + +else if (roll = 10) +{ + item = await fromUuid("Compendium.wfrp4e-core.items.qdMbxW09FUoYBzmB") + modifier = -5 +} + +message = `${roll} Rolled, gain ${item.name}, ${modifier} Strength` +dice.toMessage(this.script.getChatData()) + +let changes = duplicate(this.effect.changes) +changes[0].value = modifier + +this.effect.updateSource({changes}) + +await this.actor.createEmbeddedDocuments("Item", [item.toObject()], {fromEffect : this.effect.id}) + +this.script.scriptNotification(message) \ No newline at end of file diff --git a/reference_scripts/S3DCTw4yJ85eSaKp.js b/reference_scripts/S3DCTw4yJ85eSaKp.js new file mode 100644 index 0000000..666ee45 --- /dev/null +++ b/reference_scripts/S3DCTw4yJ85eSaKp.js @@ -0,0 +1 @@ +this.actor.setupCharacteristic("s", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(test => test.roll()) \ No newline at end of file diff --git a/reference_scripts/S3Dev4hleOYqDNe9.js b/reference_scripts/S3Dev4hleOYqDNe9.js new file mode 100644 index 0000000..82a4f59 --- /dev/null +++ b/reference_scripts/S3Dev4hleOYqDNe9.js @@ -0,0 +1,16 @@ +if (args.test.options.healWounds) { + if (args.test.succeeded) + { + let wounds = this.actor.characteristics.int.bonus + Number(args.test.result.SL) + if (args.test.options.fieldDressing && args.test.result.reversed) + { + wounds = this.actor.characteristics.int.bonus + Math.min(1, Number(args.test.result.SL)) + } + args.test.result.woundsHealed = wounds + args.test.result.other.push(`${this.actor.name} healed ${wounds} wounds of the patient.`) + } + else if (this.actor.characteristics.int.bonus + Number(args.test.result.SL) < 0) + { + args.test.result.other.push(`The patient contracts a @UUID[Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg]{Minor Infection}.`) + } +} \ No newline at end of file diff --git a/reference_scripts/S4793DLFhjMxpM8x.js b/reference_scripts/S4793DLFhjMxpM8x.js new file mode 100644 index 0000000..4f2f739 --- /dev/null +++ b/reference_scripts/S4793DLFhjMxpM8x.js @@ -0,0 +1 @@ +return !["ws", "bs"].includes(args.characteristic) && !args.item?.system.attackType && !args.options.dodge \ No newline at end of file diff --git a/reference_scripts/S6tUyFJvGMV19mvP.js b/reference_scripts/S6tUyFJvGMV19mvP.js new file mode 100644 index 0000000..867c8d8 --- /dev/null +++ b/reference_scripts/S6tUyFJvGMV19mvP.js @@ -0,0 +1 @@ +this.actor.status.addArmour(2, {source: this.effect}) \ No newline at end of file diff --git a/reference_scripts/S95QqpX1cZyIVCPy.js b/reference_scripts/S95QqpX1cZyIVCPy.js new file mode 100644 index 0000000..3011ed7 --- /dev/null +++ b/reference_scripts/S95QqpX1cZyIVCPy.js @@ -0,0 +1,5 @@ +if (parseInt(this.item.system.specification.value) > 0) +{ + this.actor.system.status.ward.value = parseInt(this.item.system.specification.value); +} + diff --git a/reference_scripts/SGr50Hq1AHIEzIFN.js b/reference_scripts/SGr50Hq1AHIEzIFN.js new file mode 100644 index 0000000..324b7a2 --- /dev/null +++ b/reference_scripts/SGr50Hq1AHIEzIFN.js @@ -0,0 +1,6 @@ +let choice = await ItemDialog.create(ItemDialog.objectToArray({ + int : game.wfrp4e.config.characteristics.int, + fel : game.wfrp4e.config.characteristics.fel +}, this.effect.img), 1, "Choose Characteristic"); + +this.effect.updateSource({"flags.wfrp4e.characteristic" : choice[0].id}) \ No newline at end of file diff --git a/reference_scripts/SLy1Fs3oXcHgFgjK.js b/reference_scripts/SLy1Fs3oXcHgFgjK.js new file mode 100644 index 0000000..4add629 --- /dev/null +++ b/reference_scripts/SLy1Fs3oXcHgFgjK.js @@ -0,0 +1,5 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn") +let data = item.toObject(); +let value = getProperty(this.effect.sourceTest, "result.overcast.usage.other.current") || 1 +data.system.specification.value = value +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/SO4Aa9argKbuO9rQ.js b/reference_scripts/SO4Aa9argKbuO9rQ.js new file mode 100644 index 0000000..2af913b --- /dev/null +++ b/reference_scripts/SO4Aa9argKbuO9rQ.js @@ -0,0 +1 @@ +args.prefillModifiers.modifier -= 20 \ No newline at end of file diff --git a/reference_scripts/SPOkFWZWziZk5b7A.js b/reference_scripts/SPOkFWZWziZk5b7A.js new file mode 100644 index 0000000..d26b8cb --- /dev/null +++ b/reference_scripts/SPOkFWZWziZk5b7A.js @@ -0,0 +1 @@ +return args.item?.system?.attackType != "melee" \ No newline at end of file diff --git a/reference_scripts/SRmfstEs278bP9Pz.js b/reference_scripts/SRmfstEs278bP9Pz.js new file mode 100644 index 0000000..4831d32 --- /dev/null +++ b/reference_scripts/SRmfstEs278bP9Pz.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.yRhhOlt18COq4e1q") +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/SSqGxyN9hw0HDmED.js b/reference_scripts/SSqGxyN9hw0HDmED.js new file mode 100644 index 0000000..ea4faf2 --- /dev/null +++ b/reference_scripts/SSqGxyN9hw0HDmED.js @@ -0,0 +1 @@ +this.actor.addCondition("prone"); \ No newline at end of file diff --git a/reference_scripts/SWIJjM2RCmzfr64u.js b/reference_scripts/SWIJjM2RCmzfr64u.js new file mode 100644 index 0000000..5a07e2e --- /dev/null +++ b/reference_scripts/SWIJjM2RCmzfr64u.js @@ -0,0 +1,6 @@ +if (args.test.result.hitloc.result == "head") +{ + args.test.result.critModifier = args.test.result.critModifier ? args.test.result.critModifier + 40 : 40 + + args.test.result.critical += ` (+${args.test.result.critModifier})` +} diff --git a/reference_scripts/SrCHfOJFZwDickqa.js b/reference_scripts/SrCHfOJFZwDickqa.js new file mode 100644 index 0000000..28558bc --- /dev/null +++ b/reference_scripts/SrCHfOJFZwDickqa.js @@ -0,0 +1,6 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: "average"}}); +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("prone") +} \ No newline at end of file diff --git a/reference_scripts/StAderQaQQsxb6Rv.js b/reference_scripts/StAderQaQQsxb6Rv.js new file mode 100644 index 0000000..d361e9a --- /dev/null +++ b/reference_scripts/StAderQaQQsxb6Rv.js @@ -0,0 +1,10 @@ +let target = await game.wfrp4e.tables.rollTable("fixations") +if (target) +{ + this.script.scriptNotification(target.result); + let hatred = this.actor.items.find(i => i.getFlag("wfrp4e", "fromEffect") == this.effect.id) + if (hatred) + { + hatred.update({"system.specification.value" : target.result}) + } +} \ No newline at end of file diff --git a/reference_scripts/SvFKt9hMcFQjeILA.js b/reference_scripts/SvFKt9hMcFQjeILA.js new file mode 100644 index 0000000..52d528c --- /dev/null +++ b/reference_scripts/SvFKt9hMcFQjeILA.js @@ -0,0 +1 @@ +args.actor.addCondition("entangled", this.effect.sourceTest.result.overcast.usage.other.current) \ No newline at end of file diff --git a/reference_scripts/T5fiTzhXEQAv9Drf.js b/reference_scripts/T5fiTzhXEQAv9Drf.js new file mode 100644 index 0000000..536b32a --- /dev/null +++ b/reference_scripts/T5fiTzhXEQAv9Drf.js @@ -0,0 +1,20 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.rlDZZTj5PXjuRXa2") +let data = item.toObject(); +data.system.location.key = this.item.system.location.key; +await this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id}) + +let location = this.item.system.location.key; + +if (location) +{ + let dropped = this.item.system.weaponsAtLocation; + + if (dropped.length) + { + this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(", ")}!`) + for(let weapon of dropped) + { + await weapon.system.toggleEquip(); + } + } +} \ No newline at end of file diff --git a/reference_scripts/T74FEjfFrh3f6MKv.js b/reference_scripts/T74FEjfFrh3f6MKv.js new file mode 100644 index 0000000..1a4f658 --- /dev/null +++ b/reference_scripts/T74FEjfFrh3f6MKv.js @@ -0,0 +1 @@ +args.wpb = args.sb; \ No newline at end of file diff --git a/reference_scripts/TAw9vXnfyIAl5DGs.js b/reference_scripts/TAw9vXnfyIAl5DGs.js new file mode 100644 index 0000000..c6062cd --- /dev/null +++ b/reference_scripts/TAw9vXnfyIAl5DGs.js @@ -0,0 +1,11 @@ +if (this.item.system.quantity.value) +{ + game.wfrp4e.utility.postCorruptionTest("minor", this.script.getChatData()); + this.item.system.reduceQuantity(); + let actor = Array.from(game.user.targets)[0]?.actor || this.actor; + actor.applyEffect({effectData : [this.item.effects.contents[1].convertToApplied()]}) +} +else +{ + this.script.scriptNotification("None left!", "error") +} \ No newline at end of file diff --git a/reference_scripts/TBpNFRL5uehs0fze.js b/reference_scripts/TBpNFRL5uehs0fze.js new file mode 100644 index 0000000..be5a2fb --- /dev/null +++ b/reference_scripts/TBpNFRL5uehs0fze.js @@ -0,0 +1,10 @@ +if (this.item.system.quantity.value) +{ + this.item.system.reduceQuantity(); + let actor = Array.from(game.user.targets)[0]?.actor || this.actor; + actor.applyEffect({effectData : [this.item.effects.contents[0]]}) +} +else +{ + this.script.scriptNotification("None left!", "error") +} \ No newline at end of file diff --git a/reference_scripts/TEiNj5FgkoD3YbhS.js b/reference_scripts/TEiNj5FgkoD3YbhS.js new file mode 100644 index 0000000..bcac25e --- /dev/null +++ b/reference_scripts/TEiNj5FgkoD3YbhS.js @@ -0,0 +1 @@ +this.actor.hasCondition("bleeding")?.delete() \ No newline at end of file diff --git a/reference_scripts/TGN070HeJLl3gSMY.js b/reference_scripts/TGN070HeJLl3gSMY.js new file mode 100644 index 0000000..876f760 --- /dev/null +++ b/reference_scripts/TGN070HeJLl3gSMY.js @@ -0,0 +1,6 @@ +let test = await this.actor.setupCharacteristic("ag", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context: { failure: "Goes Prone" }}) +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("prone"); +} \ No newline at end of file diff --git a/reference_scripts/TNWmIkuubqBn38he.js b/reference_scripts/TNWmIkuubqBn38he.js new file mode 100644 index 0000000..8f318aa --- /dev/null +++ b/reference_scripts/TNWmIkuubqBn38he.js @@ -0,0 +1 @@ +this.effect.deleteCreatedItems(); \ No newline at end of file diff --git a/reference_scripts/TOyQLrugFGzwc5nY.js b/reference_scripts/TOyQLrugFGzwc5nY.js new file mode 100644 index 0000000..1e8b373 --- /dev/null +++ b/reference_scripts/TOyQLrugFGzwc5nY.js @@ -0,0 +1 @@ +return !(args.skill?.name.includes(game.i18n.localize("NAME.Melee")) || args.item?.isMelee || args.options.corruption); \ No newline at end of file diff --git a/reference_scripts/TQRL4mZhZohXg1Au.js b/reference_scripts/TQRL4mZhZohXg1Au.js new file mode 100644 index 0000000..2288bc8 --- /dev/null +++ b/reference_scripts/TQRL4mZhZohXg1Au.js @@ -0,0 +1,2 @@ +let test = await this.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +test.roll(); \ No newline at end of file diff --git a/reference_scripts/TU2xjbJ0zFtytF3J.js b/reference_scripts/TU2xjbJ0zFtytF3J.js new file mode 100644 index 0000000..9325462 --- /dev/null +++ b/reference_scripts/TU2xjbJ0zFtytF3J.js @@ -0,0 +1 @@ +return args.skill?.name == game.i18n.localize("NAME.CharmAnimal"); \ No newline at end of file diff --git a/reference_scripts/TY0xSQ00XXyEr49r.js b/reference_scripts/TY0xSQ00XXyEr49r.js new file mode 100644 index 0000000..7b1ab7b --- /dev/null +++ b/reference_scripts/TY0xSQ00XXyEr49r.js @@ -0,0 +1 @@ +args.fields.slBonus += 1; \ No newline at end of file diff --git a/reference_scripts/TcqumwUFAL6V0cty.js b/reference_scripts/TcqumwUFAL6V0cty.js new file mode 100644 index 0000000..e7a337e --- /dev/null +++ b/reference_scripts/TcqumwUFAL6V0cty.js @@ -0,0 +1,11 @@ +if (this.item.getFlag("wfrp4e", "failedCool")) +{ + this.item.system.AP = { + "head": 0, + "lArm": 0, + "rArm": 0, + "lLeg": 0, + "rLeg": 0, + "body": 0 + } +} \ No newline at end of file diff --git a/reference_scripts/TdjlJro0RRVSh8g8.js b/reference_scripts/TdjlJro0RRVSh8g8.js new file mode 100644 index 0000000..a893cc5 --- /dev/null +++ b/reference_scripts/TdjlJro0RRVSh8g8.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.Gamble") && args.skill?.name != game.i18n.localize("NAME.SleightOfHand"); \ No newline at end of file diff --git a/reference_scripts/TmaS8o33825QUMrx.js b/reference_scripts/TmaS8o33825QUMrx.js new file mode 100644 index 0000000..599ff1b --- /dev/null +++ b/reference_scripts/TmaS8o33825QUMrx.js @@ -0,0 +1,3 @@ +let stomp = game.wfrp4e.config.systemItems.stomp; +let test = await this.actor.setupTrait(stomp) +await test.roll(); \ No newline at end of file diff --git a/reference_scripts/TnFobCxG4pxlYmKr.js b/reference_scripts/TnFobCxG4pxlYmKr.js new file mode 100644 index 0000000..75668c8 --- /dev/null +++ b/reference_scripts/TnFobCxG4pxlYmKr.js @@ -0,0 +1,16 @@ +let gorCharacteristics = { + "ws": 45, + "bs": 30, + "s": 35, + "t": 45, + "i": 30, + "ag": 35, + "dex": 25, + "int": 25, + "wp": 30, + "fel": 25 +} +for (let char in this.actor.characteristics) { + if (this.actor.characteristics[char].initial < gorCharacteristics[char]) + this.actor.characteristics[char].initial = gorCharacteristics[char] +} \ No newline at end of file diff --git a/reference_scripts/ToKlHDAjJOsC51ag.js b/reference_scripts/ToKlHDAjJOsC51ag.js new file mode 100644 index 0000000..2ee3319 --- /dev/null +++ b/reference_scripts/ToKlHDAjJOsC51ag.js @@ -0,0 +1,11 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.GlShFJF2TpsNh1FX") +let data = item.toObject(); +data.system.location.key = this.item.system.location.key +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) + +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: "hard"}}); +await test.roll(); +if (test.failed) +{ + args.actor.addCondition("unconscious") +} \ No newline at end of file diff --git a/reference_scripts/TpZItJ5Ugbazaobd.js b/reference_scripts/TpZItJ5Ugbazaobd.js new file mode 100644 index 0000000..414537b --- /dev/null +++ b/reference_scripts/TpZItJ5Ugbazaobd.js @@ -0,0 +1,15 @@ +let locations = []; + +while (locations.length < 2) +{ + let loc = await game.wfrp4e.tables.rollTable("hitloc", {hideDSN : true}) + if (!locations.includes(loc.result)) + { + locations.push(loc.result); + } +} + +locationText = locations.map(i => game.wfrp4e.config.locations[i]).join(", ") + +this.item.updateSource({name : this.item.name += ` (${locationText})`, "flags.wfrp4e.locations" : locations}) +this.effect.updateSource({"flags.wfrp4e.locations" : locations}) \ No newline at end of file diff --git a/reference_scripts/Tq45Nd8J3eTvHT41.js b/reference_scripts/Tq45Nd8J3eTvHT41.js new file mode 100644 index 0000000..88ba249 --- /dev/null +++ b/reference_scripts/Tq45Nd8J3eTvHT41.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.Perception") && args.skill?.name != game.i18n.localize("NAME.SetTrap"); \ No newline at end of file diff --git a/reference_scripts/TrIYdcG3jDER4WgY.js b/reference_scripts/TrIYdcG3jDER4WgY.js new file mode 100644 index 0000000..5965a8c --- /dev/null +++ b/reference_scripts/TrIYdcG3jDER4WgY.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.xsGbDFqK2qh7lsIj") +let data = item.toObject(); +data.system.specification.value = "Minor" +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/TwgdEucxcHloc4cX.js b/reference_scripts/TwgdEucxcHloc4cX.js new file mode 100644 index 0000000..325d158 --- /dev/null +++ b/reference_scripts/TwgdEucxcHloc4cX.js @@ -0,0 +1,135 @@ +let choice1 = [ + { + type : "armour", + name : "Mail Chausses" + }, + { + type : "armour", + name : "Mail Coat" + }, + { + type : "armour", + name : "Mail Coif" + }, +] +let choice2 = [ + { + type : "armour", + name : "Mail Chausses" + }, + { + type : "armour", + name : "Mail Coat" + }, + { + type : "armour", + name : "Mail Coif" + }, + { + type : "armour", + name : "Leather Leggings" + }, + { + type : "armour", + name : "Leather Skullcap" + }, + { + type : "armour", + name : "Leather Jack" + }, +] +let choice3 = [ + { + type : "armour", + name : "Plate Breastplate" + }, + { + type : "armour", + name : "Plate Bracers" + }, + { + type : "armour", + name : "Plate Helm" + }, + { + type : "armour", + name : "Plate Leggings" + }, +] + +let choice = await new Promise((resolve, reject) => { + new Dialog({ + title : "Choice", + content : + `+ Select your choice +
++ Select your choice +
+${await this.actor.applyBasicDamage(3, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP})}
` +} + +this.script.scriptMessage(msg); \ No newline at end of file diff --git a/reference_scripts/ZrePyV2spv3v65Tg.js b/reference_scripts/ZrePyV2spv3v65Tg.js new file mode 100644 index 0000000..e7da169 --- /dev/null +++ b/reference_scripts/ZrePyV2spv3v65Tg.js @@ -0,0 +1 @@ +return args.type != "weapon" && !this.actor.statuses.has("infighting") \ No newline at end of file diff --git a/reference_scripts/ZsQR3AVKi0v5U593.js b/reference_scripts/ZsQR3AVKi0v5U593.js new file mode 100644 index 0000000..9ecf140 --- /dev/null +++ b/reference_scripts/ZsQR3AVKi0v5U593.js @@ -0,0 +1 @@ +args.actor.addCondition("ablaze", 2) \ No newline at end of file diff --git a/reference_scripts/ZvbBM4gTJHPdU8jU.js b/reference_scripts/ZvbBM4gTJHPdU8jU.js new file mode 100644 index 0000000..b8ce00a --- /dev/null +++ b/reference_scripts/ZvbBM4gTJHPdU8jU.js @@ -0,0 +1,3 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "hard"}}) +await test.roll(); +return test.failed \ No newline at end of file diff --git a/reference_scripts/Zxh4RAENoaAQAaNg.js b/reference_scripts/Zxh4RAENoaAQAaNg.js new file mode 100644 index 0000000..a16ea6f --- /dev/null +++ b/reference_scripts/Zxh4RAENoaAQAaNg.js @@ -0,0 +1 @@ +return !this.actor.flags.useless.rEye || !this.actor.flags.useless.lEye || ["wp", "t", "s"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/ZxtOdwsM2Sqj9Zam.js b/reference_scripts/ZxtOdwsM2Sqj9Zam.js new file mode 100644 index 0000000..e58661f --- /dev/null +++ b/reference_scripts/ZxtOdwsM2Sqj9Zam.js @@ -0,0 +1,5 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM") +let data = item.toObject(); +data.system.specification.value = 0 +data.name = this.effect.name; +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/a02tlRCXpaoaDjSN.js b/reference_scripts/a02tlRCXpaoaDjSN.js new file mode 100644 index 0000000..c70bd5f --- /dev/null +++ b/reference_scripts/a02tlRCXpaoaDjSN.js @@ -0,0 +1,16 @@ +let careers = await game.wfrp4e.utility.findAll("career", "", true); +careers.forEach(c => { + if (!c.id) + { + c.id = c._id; + } +}); +let choice = await ItemDialog.create(careers, 1, "Choose Double Life Career"); +if (choice[0]) +{ + let career = await fromUuid(choice[0].uuid); + let data = career.toObject(); + setProperty(data, "flags.wfrp4e.doubleLife", true); + this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id}) + this.effect.updateSource({name : this.effect.name + ` (${data.name})`}) +} diff --git a/reference_scripts/a0YU3whUm16wGBNu.js b/reference_scripts/a0YU3whUm16wGBNu.js new file mode 100644 index 0000000..ed24c51 --- /dev/null +++ b/reference_scripts/a0YU3whUm16wGBNu.js @@ -0,0 +1,7 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "average"}}) +await test.roll(); + +if (test.failed) +{ + this.actor.addCondition("fatigued"); +} \ No newline at end of file diff --git a/reference_scripts/a4Aza4a9v8JMU8dC.js b/reference_scripts/a4Aza4a9v8JMU8dC.js new file mode 100644 index 0000000..7ec136f --- /dev/null +++ b/reference_scripts/a4Aza4a9v8JMU8dC.js @@ -0,0 +1,2 @@ +const talents = await Promise.all(["Frenzy", "Magic Resistance"].map(game.wfrp4e.utility.findTalent)) +this.actor.createEmbeddedDocuments("Item", talents, {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/a6gacHsvgwtsIFSQ.js b/reference_scripts/a6gacHsvgwtsIFSQ.js new file mode 100644 index 0000000..735565f --- /dev/null +++ b/reference_scripts/a6gacHsvgwtsIFSQ.js @@ -0,0 +1,2 @@ +if (args.test.item && args.test.item.name == game.i18n.localize("NAME.Research")) + args.test.preData.canReverse = true \ No newline at end of file diff --git a/reference_scripts/a7pEvCycVnFBXGAQ.js b/reference_scripts/a7pEvCycVnFBXGAQ.js new file mode 100644 index 0000000..604c31c --- /dev/null +++ b/reference_scripts/a7pEvCycVnFBXGAQ.js @@ -0,0 +1,7 @@ +let test = await this.actor.setupCharacteristic("i", {skipTargets: true, appendTitle : " - Stunned", fields : {difficulty : "easy"}}) +await test.roll(); + +if (!test.succeeded) +{ + this.actor.addCondition("stunned"); +} \ No newline at end of file diff --git a/reference_scripts/a8RabrnJ08O07rDX.js b/reference_scripts/a8RabrnJ08O07rDX.js new file mode 100644 index 0000000..5ac0cfe --- /dev/null +++ b/reference_scripts/a8RabrnJ08O07rDX.js @@ -0,0 +1,5 @@ +if (args.totalWoundLoss > 0) +{ + // I'm assuming the endurance test specified is for the end-round check + await args.actor.addCondition("poisoned", 2); +} \ No newline at end of file diff --git a/reference_scripts/a8i0sA1RBnD8nHZt.js b/reference_scripts/a8i0sA1RBnD8nHZt.js new file mode 100644 index 0000000..b78fb2c --- /dev/null +++ b/reference_scripts/a8i0sA1RBnD8nHZt.js @@ -0,0 +1,42 @@ +let caster = this.effect.sourceActor +let targetedItem = this.actor.items.get(this.effect.flags.wfrp4e.itemTargets[0]) + +let qualities = foundry.utils.deepClone(game.wfrp4e.config.itemQualities); +let flaws = foundry.utils.deepClone(game.wfrp4e.config.itemFlaws); + +if (targetedItem.type == "weapon") +{ + mergeObject(qualities, game.wfrp4e.config.weaponQualities) + mergeObject(flaws, game.wfrp4e.config.weaponFlaws) +} +else if (targetedItem.type == "armour") +{ + mergeObject(qualities, game.wfrp4e.config.armorQualities) + mergeObject(flaws, game.wfrp4e.config.armorFlaws) +} + +for(let q in qualities) +{ + // If the weapon already has a flaw, don't put it in the dialog + if (targetedItem.system.properties.qualities[q]) + { + delete qualities[q] + } +} +for(let f in flaws) +{ + // If a weapon doesn't have a flaw, don't put it in the dialog + if (!targetedItem.system.properties.flaws[f]) + { + delete flaws[f] + } +} + +let added = await ItemDialog.create(ItemDialog.objectToArray(qualities), "unlimited", "Choose Qualities to add"); +let removed = [] +if (!foundry.utils.isEmpty(flaws)) +{ + removed = await ItemDialog.create(ItemDialog.objectToArray(flaws), "unlimited", "Choose Flaws to remove"); +} + +this.effect.updateSource({"flags.wfrp4e.propertiesChanged" : {added : added.map(i => i.id), removed : removed.map(i => i.id)}}) diff --git a/reference_scripts/aAvJrAKLzXhS9qN6.js b/reference_scripts/aAvJrAKLzXhS9qN6.js new file mode 100644 index 0000000..645c806 --- /dev/null +++ b/reference_scripts/aAvJrAKLzXhS9qN6.js @@ -0,0 +1 @@ +return args.item?.name == game.i18n.localize("NAME.Climb") \ No newline at end of file diff --git a/reference_scripts/aCVtaW8ag1WibcAr.js b/reference_scripts/aCVtaW8ag1WibcAr.js new file mode 100644 index 0000000..bf9b92d --- /dev/null +++ b/reference_scripts/aCVtaW8ag1WibcAr.js @@ -0,0 +1,2 @@ +args.attacker.modifyWounds(1) +this.script.scriptMessage(`${args.attacker.prototypeToken.name} recovers 1 Wound.`) \ No newline at end of file diff --git a/reference_scripts/aIYUsBIDKWJ3CEtj.js b/reference_scripts/aIYUsBIDKWJ3CEtj.js new file mode 100644 index 0000000..9779863 --- /dev/null +++ b/reference_scripts/aIYUsBIDKWJ3CEtj.js @@ -0,0 +1 @@ +this.script.scriptMessage(await this.actor.applyBasicDamage(20, {suppressMsg: true})); \ No newline at end of file diff --git a/reference_scripts/aMHGjWyn6BXCI4pw.js b/reference_scripts/aMHGjWyn6BXCI4pw.js new file mode 100644 index 0000000..0f73350 --- /dev/null +++ b/reference_scripts/aMHGjWyn6BXCI4pw.js @@ -0,0 +1,2 @@ +let frenzy = await fromUuid("Compendium.wfrp4e-core.items.Item.hXcfygzujgyMN1uI"); +this.actor.createEmbeddedDocuments("Item", [frenzy], {fromEffect: this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/abLWYtNTu1UVDQAs.js b/reference_scripts/abLWYtNTu1UVDQAs.js new file mode 100644 index 0000000..547de25 --- /dev/null +++ b/reference_scripts/abLWYtNTu1UVDQAs.js @@ -0,0 +1,5 @@ +if (args.opposedTest.result.hitloc.value == this.effect.flags.wfrp4e.location) // e.g. 'head', rLeg, 'lArm' +{ + this.scriptMessage(`Gains a @Condition[Blinded] condition as their ${this.item.name} was hit`); + this.actor.addCondition("blinded"); +} \ No newline at end of file diff --git a/reference_scripts/abVIvJBzuskNzCQv.js b/reference_scripts/abVIvJBzuskNzCQv.js new file mode 100644 index 0000000..2fd5bf8 --- /dev/null +++ b/reference_scripts/abVIvJBzuskNzCQv.js @@ -0,0 +1,8 @@ +let amount = this.effect.sourceTest.result.overcast.usage.other.current; + +let sss = await fromUuid("Compendium.wfrp4e-core.items.MGEPI4jNhymNIRVz"); +let strider = await fromUuid("Compendium.wfrp4e-core.items.1dUizIgLBgn4jICC"); + +let items = Array(amount).fill(sss).concat(Array(amount).fill(strider)) + +this.actor.createEmbeddedDocuments("Item", items, {fromEffect: this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/afdmOvPGMpEdZvCb.js b/reference_scripts/afdmOvPGMpEdZvCb.js new file mode 100644 index 0000000..20d9df6 --- /dev/null +++ b/reference_scripts/afdmOvPGMpEdZvCb.js @@ -0,0 +1 @@ +return (args.skill?.name == game.i18n.localize("NAME.Perception") || args.characteristic == "fel") \ No newline at end of file diff --git a/reference_scripts/agsm3NI1NDtHRG4y.js b/reference_scripts/agsm3NI1NDtHRG4y.js new file mode 100644 index 0000000..3391c51 --- /dev/null +++ b/reference_scripts/agsm3NI1NDtHRG4y.js @@ -0,0 +1 @@ +this.actor.getActiveTokens().forEach(t => t.document.update({texture : this.actor.prototypeToken.texture}, {animate : false})); \ No newline at end of file diff --git a/reference_scripts/ahbA7o5G9dzMFl76.js b/reference_scripts/ahbA7o5G9dzMFl76.js new file mode 100644 index 0000000..0937f98 --- /dev/null +++ b/reference_scripts/ahbA7o5G9dzMFl76.js @@ -0,0 +1,2 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.Item.SfUUdOGjdYpr3KSR") +this.actor.createEmbeddedDocuments("Item", [item], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/alJgj25l3239h2SW.js b/reference_scripts/alJgj25l3239h2SW.js new file mode 100644 index 0000000..edd4d2f --- /dev/null +++ b/reference_scripts/alJgj25l3239h2SW.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.hTgrGkWnmIR4xhVe") +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/ayIbw2Vw2t9xg33P.js b/reference_scripts/ayIbw2Vw2t9xg33P.js new file mode 100644 index 0000000..0af0e36 --- /dev/null +++ b/reference_scripts/ayIbw2Vw2t9xg33P.js @@ -0,0 +1,2 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.EaqlLRQigwnsEAXX") +this.actor.createEmbeddedDocuments("Item", [item], {fromEffect: this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/b1zMefdoZYtzCm7i.js b/reference_scripts/b1zMefdoZYtzCm7i.js new file mode 100644 index 0000000..d165c01 --- /dev/null +++ b/reference_scripts/b1zMefdoZYtzCm7i.js @@ -0,0 +1 @@ +return ["roll", "none"].includes(args.fields.hitLocation) || args.item?.attackType != "ranged" \ No newline at end of file diff --git a/reference_scripts/b2Kb4IuD22RhKhR0.js b/reference_scripts/b2Kb4IuD22RhKhR0.js new file mode 100644 index 0000000..fcbecf9 --- /dev/null +++ b/reference_scripts/b2Kb4IuD22RhKhR0.js @@ -0,0 +1,10 @@ +let actor = Array.from(game.user.targets)[0]?.actor; + +if (actor) +{ + actor.applyEffect({effectUuids : this.effect.sourceItem.effects.contents[0].uuid}) +} +else +{ + this.script.scriptNotification("No target!", "error") +} \ No newline at end of file diff --git a/reference_scripts/b2WaqRna5CFXmbDG.js b/reference_scripts/b2WaqRna5CFXmbDG.js new file mode 100644 index 0000000..8f874fd --- /dev/null +++ b/reference_scripts/b2WaqRna5CFXmbDG.js @@ -0,0 +1 @@ +args.options.stag = true; \ No newline at end of file diff --git a/reference_scripts/b5DfAWtpV1x2R8If.js b/reference_scripts/b5DfAWtpV1x2R8If.js new file mode 100644 index 0000000..c9f120e --- /dev/null +++ b/reference_scripts/b5DfAWtpV1x2R8If.js @@ -0,0 +1 @@ +this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {suppressMsg: true})) \ No newline at end of file diff --git a/reference_scripts/b5prg1FLjCAvBjLy.js b/reference_scripts/b5prg1FLjCAvBjLy.js new file mode 100644 index 0000000..705112f --- /dev/null +++ b/reference_scripts/b5prg1FLjCAvBjLy.js @@ -0,0 +1,13 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.zyocWSzEZEC826NS") +let data = item.toObject(); +data.system.location.key = this.item.system.location.key +this.actor.createEmbeddedDocuments("Item", [data]) + + +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields: {difficulty: "hard"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); +if (test.failed) +{ + await this.actor.addCondition("prone") + await this.actor.addCondition("stunned") +} \ No newline at end of file diff --git a/reference_scripts/bBdXzBmxgFFBwMMS.js b/reference_scripts/bBdXzBmxgFFBwMMS.js new file mode 100644 index 0000000..b0eea24 --- /dev/null +++ b/reference_scripts/bBdXzBmxgFFBwMMS.js @@ -0,0 +1,9 @@ +if(args.opposedTest.attackerTest.item?.isRanged && args.applyAP && !args.sureShot) +{ + if (args.modifiers.ap.value) + { + args.sureShot = true; + args.modifiers.ap.details.push(`${this.effect.name} (Ignore ${this.item.Advances})`) + args.modifiers.ap.ignored += this.item.Advances; + } +} \ No newline at end of file diff --git a/reference_scripts/bEVlJOOA1kLlzpWx.js b/reference_scripts/bEVlJOOA1kLlzpWx.js new file mode 100644 index 0000000..4a07c15 --- /dev/null +++ b/reference_scripts/bEVlJOOA1kLlzpWx.js @@ -0,0 +1,86 @@ +let characteristics = { + "ws" : 10, + "bs" : 0, + "s" : 5, + "t" : 15, + "i" : 20, + "ag" : 15, + "dex" : 20, + "int" : 35, + "wp" : 30, + "fel" : 10 +} +let skills = ["Channelling", "Cool", "Dodge", "Entertain (Storytelling)", "Intuition", "Language (Magick)", "Leadership", "Lore (Magic)", "Lore (Theology)", "Perception"] +let skillAdvancements = [20, 25, 20, 25, 30, 25, 15, 20, 10, 30] +let talents = ["Aethyric Attunement", "Arcane Magic", "Instinctive Diction", "Instinctive Diction", "Luck", "Magical Sense", "Menacing", "Petty Magic", "Second Sight", "Sixth Sense"] +let trappings = ["Hand Weapon", "Quarterstaff", "Ritual Dress incorporating many ingredients and fetishes"] +let items = []; + +let updateObj = this.actor.toObject(); + +for (let ch in characteristics) +{ + updateObj.system.characteristics[ch].modifier += characteristics[ch]; +} + +for (let index = 0; index < skills.length; index++) +{ + let skill = skills[index] + let skillItem; + skillItem = updateObj.items.find(i => i.name == skill && i.type == "skill") + if (skillItem) + skillItem.system.advances.value += skillAdvancements[index] + else + { + skillItem = await game.wfrp4e.utility.findSkill(skill) + skillItem = skillItem.toObject(); + skillItem.system.advances.value = skillAdvancements[index]; + items.push(skillItem); + } +} + +for (let talent of talents) +{ + let talentItem = await game.wfrp4e.utility.findTalent(talent) + if (talentItem) + { + items.push(talentItem.toObject()); + } + else + { + ui.notifications.warn(`Could not find ${talent}`, {permanent : true}) + } +} + +for (let trapping of trappings) +{ + let trappingItem = await game.wfrp4e.utility.findItem(trapping) + if (trappingItem) + { + trappingItem = trappingItem.toObject() + + equip(trappingItem) + + items.push(trappingItem); + } + else + { + items.push({name : trapping, type : "trapping", "system.trappingType.value" : "clothingAccessories"}) + //ui.notifications.warn(`Could not find ${trapping}`, {permanent : true}) + } +} + +updateObj.name = updateObj.name += " " + this.effect.name + +await this.actor.update(updateObj) +this.actor.createEmbeddedDocuments("Item", items); + +function equip(item) +{ + if (item.type == "armour") + item.system.worn.value = true + else if (item.type == "weapon") + item.system.equipped = true + else if (item.type == "trapping" && item.system.trappingType.value == "clothingAccessories") + item.system.worn = true +} \ No newline at end of file diff --git a/reference_scripts/bLkt8VpTTPoTxW0W.js b/reference_scripts/bLkt8VpTTPoTxW0W.js new file mode 100644 index 0000000..73567e8 --- /dev/null +++ b/reference_scripts/bLkt8VpTTPoTxW0W.js @@ -0,0 +1,5 @@ +if (args.opposedTest.result.hitloc.value == "body" && args.totalWoundLoss > 0) +{ + args.actor.addCondition("bleeding", 1); + this.script.scriptNotification("Added Bleeding") +} diff --git a/reference_scripts/bMEFHPCei2evnZZw.js b/reference_scripts/bMEFHPCei2evnZZw.js new file mode 100644 index 0000000..7eb94d5 --- /dev/null +++ b/reference_scripts/bMEFHPCei2evnZZw.js @@ -0,0 +1,14 @@ +// Victims that take at least 1 Wound from a Fell Dagger +// immediately take a Poisoned Condition +// resisted with a Difficult (-10) Endurance Test. + +// TODO: Add Venom strength to message + +if (args.totalWoundLoss > 0) +{ + args.actor.addCondition("poisoned") + this.script.scriptMessage(` + ${this.effect.name}:+ Add Option? +
+${this.actor.prototypeToken.name} has gained 2 @Condition[Poisoned] Conditions.
+Any being with the Bestial Creature Trait that bites them and takes damage will not bite them again during a hostile encounter, though the creature may still attack them in other ways.
`, + { + whisper: ChatMessage.getWhisperRecipients("GM"), + blind: true + }) +} + // If they succeed, for a number of rounds equal to 3+ their SL, they have the Corrosive Blood Creature Trait. +else if (test.succeeded) +{ + // Don't attempt to add Corrosive Blood if actor already has it + const hasCorrosiveBlood = this.actor.has("Corrosive Blood") + if (hasCorrosiveBlood !== undefined) return + + let item = await fromUuid("Compendium.wfrp4e-core.items.M5QSWOYt2Rbv2yxW") + let data = item.toObject() + this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id}) + + const duration = 3 + parseInt(test.result.SL) + this.script.scriptMessage(`${this.actor.prototypeToken.name} gains the Corrosive Blood Trait for ${duration} rounds.
`, + { whisper: ChatMessage.getWhisperRecipients("GM"), blind: true }) +} \ No newline at end of file diff --git a/reference_scripts/g0SzfsLyW7aD2F19.js b/reference_scripts/g0SzfsLyW7aD2F19.js new file mode 100644 index 0000000..e319818 --- /dev/null +++ b/reference_scripts/g0SzfsLyW7aD2F19.js @@ -0,0 +1,13 @@ +if (this.item.name.includes("(") && this.item.system.tests.value.includes("(Social Group)")) +{ + let tests = this.item.system.tests.value + let name = this.item.name + + // If name already specifies, make sure tests value reflects that + if (name.includes("(")) + { + let group = name.split("(")[1].split(")")[0] + tests = `${tests.split("(")[0].trim()} (${group})` + } + this.item.updateSource({name, "system.tests.value" : tests}) +} \ No newline at end of file diff --git a/reference_scripts/g1L8OYO9nCOhdKGL.js b/reference_scripts/g1L8OYO9nCOhdKGL.js new file mode 100644 index 0000000..94085c1 --- /dev/null +++ b/reference_scripts/g1L8OYO9nCOhdKGL.js @@ -0,0 +1,16 @@ +// Everything within Fellowship Bonus yards +// of the target point is splashed with mystic poison, +// suffering 1d10 + SL damage which ignores Armour Points + +let damage = (await new Roll(`1d10 + ${parseInt(this.effect.sourceTest.result.SL)}`).roll()) + +await damage.toMessage(this.script.getChatData()) + +this.script.scriptMessage(await args.actor.applyBasicDamage( + damage.total, + {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true} +)) + +// ... and gains the Poisoned Condition + +this.actor.addCondition("poisoned") \ No newline at end of file diff --git a/reference_scripts/g4t56A09yrpZaJQ2.js b/reference_scripts/g4t56A09yrpZaJQ2.js new file mode 100644 index 0000000..9d8a90b --- /dev/null +++ b/reference_scripts/g4t56A09yrpZaJQ2.js @@ -0,0 +1,23 @@ + let amberTalons = foundry.utils.deepClone(game.wfrp4e.config.systemItems.unarmed); + amberTalons.name = "Amber Talons"; + amberTalons.img = this.effect.img; + amberTalons.system.damage.value = "SB + WPB" + amberTalons.system.equipped = true; + amberTalons.system.qualities.value.push({name : "magical"}) + amberTalons.effects.push({ + label : "Amber Talons", + transfer: false, + icon : "modules/wfrp4e-core/icons/spells/amber-talons.png" , + flags : { + wfrp4e : { + applicationData : { + documentType : "Item" + }, + scriptData : [{ + trigger : "applyDamage", + script : "if (args.totalWoundLoss >= 1)\n{ \n args.actor.addCondition(\"bleeding\")\n}" + }] + } + } + }) + this.actor.createEmbeddedDocuments("Item", [amberTalons], {fromEffect: this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/gFUXBbTskQBKjxqm.js b/reference_scripts/gFUXBbTskQBKjxqm.js new file mode 100644 index 0000000..e8f675a --- /dev/null +++ b/reference_scripts/gFUXBbTskQBKjxqm.js @@ -0,0 +1,8 @@ +if (this.actor.hasCondition("entangled")) +{ + this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {fields : {difficulty : "average"}}).then(async test => { + await test.roll(); + if (test.failed) + this.actor.addCondition("fatigued") + }) +} \ No newline at end of file diff --git a/reference_scripts/gKIPujyuFSn0No9v.js b/reference_scripts/gKIPujyuFSn0No9v.js new file mode 100644 index 0000000..9359298 --- /dev/null +++ b/reference_scripts/gKIPujyuFSn0No9v.js @@ -0,0 +1,5 @@ +for(let e of this.item.effects.contents) +{ + e.update({disabled: false}) +} +this.script.scriptNotification("Reset Powers") \ No newline at end of file diff --git a/reference_scripts/gKPL3t4vlZAsvtGr.js b/reference_scripts/gKPL3t4vlZAsvtGr.js new file mode 100644 index 0000000..c2422ee --- /dev/null +++ b/reference_scripts/gKPL3t4vlZAsvtGr.js @@ -0,0 +1 @@ +return args.skill?.name == "Stealth (Underground)" \ No newline at end of file diff --git a/reference_scripts/gL0ftUnK5TNXBRRt.js b/reference_scripts/gL0ftUnK5TNXBRRt.js new file mode 100644 index 0000000..ccd81ab --- /dev/null +++ b/reference_scripts/gL0ftUnK5TNXBRRt.js @@ -0,0 +1 @@ +return this.effect.sourceActor.uuid == args.actor.uuid \ No newline at end of file diff --git a/reference_scripts/gPQrszvIgGlW9yM4.js b/reference_scripts/gPQrszvIgGlW9yM4.js new file mode 100644 index 0000000..61a3f69 --- /dev/null +++ b/reference_scripts/gPQrszvIgGlW9yM4.js @@ -0,0 +1,2 @@ +if (args.test.characteristicKey == "wp") + args.test.preData.canReverse = true \ No newline at end of file diff --git a/reference_scripts/gVpFUka7qfGiEC1v.js b/reference_scripts/gVpFUka7qfGiEC1v.js new file mode 100644 index 0000000..0306f05 --- /dev/null +++ b/reference_scripts/gVpFUka7qfGiEC1v.js @@ -0,0 +1 @@ + this.actor.getActiveTokens().forEach(t => t.document.update({texture : {tint : "#FFD700"}})); diff --git a/reference_scripts/ga6bQzPuoIiQQrKg.js b/reference_scripts/ga6bQzPuoIiQQrKg.js new file mode 100644 index 0000000..2d3c447 --- /dev/null +++ b/reference_scripts/ga6bQzPuoIiQQrKg.js @@ -0,0 +1,11 @@ +if (args.totalWoundLoss > 0) +{ + + let test = await args.actor.setupCharacteristic("t", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "hard"}}) + await test.roll() + if (test.failed) + { + args.totalWoundLoss += this.effect.sourceActor.system.characteristics.wp.bonus + args.modifiers.other.push({label : this.effect.name, value : this.effect.sourceActor.system.characteristics.wp.bonus}) + } +} \ No newline at end of file diff --git a/reference_scripts/gbhxWXboV9CytWNU.js b/reference_scripts/gbhxWXboV9CytWNU.js new file mode 100644 index 0000000..e186282 --- /dev/null +++ b/reference_scripts/gbhxWXboV9CytWNU.js @@ -0,0 +1 @@ +await this.actor.addCondition("blinded", 2) \ No newline at end of file diff --git a/reference_scripts/gh2KS1prBKcsSK6M.js b/reference_scripts/gh2KS1prBKcsSK6M.js new file mode 100644 index 0000000..9db9338 --- /dev/null +++ b/reference_scripts/gh2KS1prBKcsSK6M.js @@ -0,0 +1,2 @@ +if (args.opposedTest.attackerTest.result.critical) + args.actor.addCondition("ablaze") \ No newline at end of file diff --git a/reference_scripts/gnVpxOeBZpNF4HIF.js b/reference_scripts/gnVpxOeBZpNF4HIF.js new file mode 100644 index 0000000..ea6a793 --- /dev/null +++ b/reference_scripts/gnVpxOeBZpNF4HIF.js @@ -0,0 +1,4 @@ +if (args.test.result.roll.toString().includes("9") || args.test.result.roll.toString().includes("8")) +{ + args.test.result.fumble = game.i18n.localize("Fumble") +} \ No newline at end of file diff --git a/reference_scripts/gpPaCe6yER79l4u8.js b/reference_scripts/gpPaCe6yER79l4u8.js new file mode 100644 index 0000000..124a438 --- /dev/null +++ b/reference_scripts/gpPaCe6yER79l4u8.js @@ -0,0 +1,2 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR") +this.actor.createEmbeddedDocuments("Item", [item], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/gpuBg3y9rocJL7yT.js b/reference_scripts/gpuBg3y9rocJL7yT.js new file mode 100644 index 0000000..908e09d --- /dev/null +++ b/reference_scripts/gpuBg3y9rocJL7yT.js @@ -0,0 +1 @@ +this.actor.status.addArmour(1, {locations: ["head"], source: this.effect}) \ No newline at end of file diff --git a/reference_scripts/gqZLfIr6svrtdwdC.js b/reference_scripts/gqZLfIr6svrtdwdC.js new file mode 100644 index 0000000..191bf9e --- /dev/null +++ b/reference_scripts/gqZLfIr6svrtdwdC.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.SleightOfHand") && args.skill?.name != game.i18n.localize("NAME.MeleeBrawling") && args.weapon?.system?.weaponGroup?.value != "brawling" \ No newline at end of file diff --git a/reference_scripts/gsCnd3mf1vXFU2ei.js b/reference_scripts/gsCnd3mf1vXFU2ei.js new file mode 100644 index 0000000..e3c7fe1 --- /dev/null +++ b/reference_scripts/gsCnd3mf1vXFU2ei.js @@ -0,0 +1 @@ +this.actor.system.status.ward.value = 4; \ No newline at end of file diff --git a/reference_scripts/gu72JaTs9GrSiVTd.js b/reference_scripts/gu72JaTs9GrSiVTd.js new file mode 100644 index 0000000..8d0ad0f --- /dev/null +++ b/reference_scripts/gu72JaTs9GrSiVTd.js @@ -0,0 +1 @@ +return !(args.skill?.name == game.i18n.localize("NAME.Haggle") || args.skill?.name == game.i18n.localize("NAME.Gossip")) \ No newline at end of file diff --git a/reference_scripts/h0DfPwUUOBjyAHMZ.js b/reference_scripts/h0DfPwUUOBjyAHMZ.js new file mode 100644 index 0000000..124ecc4 --- /dev/null +++ b/reference_scripts/h0DfPwUUOBjyAHMZ.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.Perception"); \ No newline at end of file diff --git a/reference_scripts/h1XKoMuVnS0bagRO.js b/reference_scripts/h1XKoMuVnS0bagRO.js new file mode 100644 index 0000000..6b18992 --- /dev/null +++ b/reference_scripts/h1XKoMuVnS0bagRO.js @@ -0,0 +1 @@ +return args.item?.name != game.i18n.localize("NAME.Endurance"); \ No newline at end of file diff --git a/reference_scripts/h766UvswLCsxcMow.js b/reference_scripts/h766UvswLCsxcMow.js new file mode 100644 index 0000000..cc4d0c0 --- /dev/null +++ b/reference_scripts/h766UvswLCsxcMow.js @@ -0,0 +1,133 @@ +let characteristics = { + "ws" : 5, + "bs" : 0, + "s" : -15, + "t" : 0, + "i" : 20, + "ag" : 0, + "dex" : 0, + "int" : 5, + "wp" : 10, + "fel" : 10 +} +let skills = ["Charm", "Intimidate", "Melee (Basic)"] +let skillAdvancements = [7, 60, 7] +let talents = ["Menacing", "Shadow"] +let traits = ["Distracting"] +let trappings = [] +let items = []; +let spells = []; + +let updateObj = this.actor.toObject(); + +for (let ch in characteristics) +{ + updateObj.system.characteristics[ch].modifier += characteristics[ch]; +} + +for (let index = 0; index < skills.length; index++) +{ + let skill = skills[index] + let skillItem; + skillItem = updateObj.items.find(i => i.name == skill && i.type == "skill") + if (skillItem) + skillItem.system.advances.value += skillAdvancements[index] + else + { + skillItem = await game.wfrp4e.utility.findSkill(skill) + skillItem = skillItem.toObject(); + skillItem.system.advances.value = skillAdvancements[index]; + items.push(skillItem); + } +} + +for (let talent of talents) +{ + let talentItem = await game.wfrp4e.utility.findTalent(talent) + if (talentItem) + { + items.push(talentItem.toObject()); + } + else + { + ui.notifications.warn(`Could not find ${talent}`, {permanent : true}) + } +} + +const traitRegex = /(?:,?(.+?)(\+?\d{1,2}\+?)?\s*?(?:\((.+?)\)\s*(\+?\d{1,2})?|,|$))/gm +for (let trait of traits) +{ + let traitMatches = trait.matchAll(traitRegex).next().value + let traitName = traitMatches[1] + let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there's a specialization + let traitSpec = traitMatches[3] + + let traitItem; + try { + traitItem = await WFRP_Utility.findItem(traitName, "trait") + } + catch { } + if (!traitItem) { + ui.notifications.warn(`Could not find ${trait}`, {permanent : true}) + } + traitItem = traitItem.toObject() + + if (Number.isNumeric(traitVal)) + { + traitItem.system.specification.value = traitName.includes('Weapon','Horns','Tail','Tentacles','Bite') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal; + traitItem.name = (traitItem.name + ` ${traitSpec ? "("+ traitSpec + ")" : ""}`).trim() + } + else + traitItem.system.specification.value = traitSpec + + items.push(traitItem) + +} + +for (let trapping of trappings) +{ + let trappingItem = await game.wfrp4e.utility.findItem(trapping) + if (trappingItem) + { + trappingItem = trappingItem.toObject() + + equip(trappingItem) + + items.push(trappingItem); + } + else + { + ui.notifications.warn(`Could not find ${trapping}`, {permanent : true}) + } +} + +for (let spell of spells) +{ + let spellItem = await game.wfrp4e.utility.findItem(spell) + if (spellItem) + { + spellItem = spellItem.toObject() + + items.push(spellItem); + } + else + { + ui.notifications.warn(`Could not find ${spell}`, {permanent : true}) + } +} + +updateObj.name = updateObj.name += " " + this.effect.name + +await this.actor.update(updateObj) +this.actor.createEmbeddedDocuments("Item", items); + + +function equip(item) +{ + if (item.type == "armour") + item.worn = true + else if (item.type == "weapon") + item.equipped = true + else if (item.type == "trapping" && item.trappingType?.value == "clothingAccessories") + item.worn = true +} \ No newline at end of file diff --git a/reference_scripts/hA8PzeiCsHqqlUZm.js b/reference_scripts/hA8PzeiCsHqqlUZm.js new file mode 100644 index 0000000..c8e212a --- /dev/null +++ b/reference_scripts/hA8PzeiCsHqqlUZm.js @@ -0,0 +1,2 @@ +this.actor.createEmbeddedDocuments("ActiveEffect", [game.wfrp4e.config.symptomEffects["nausea"]]) +this.script.scriptMessage(`Gains @Condition[Nausea] for [[1d10]] hours`, {whisper: ChatMessage.getWhisperRecipients("GM")}) \ No newline at end of file diff --git a/reference_scripts/hCzxUyO6mjLNIpaM.js b/reference_scripts/hCzxUyO6mjLNIpaM.js new file mode 100644 index 0000000..1555cce --- /dev/null +++ b/reference_scripts/hCzxUyO6mjLNIpaM.js @@ -0,0 +1,7 @@ +let woundsGained = Math.min(args.totalWoundLoss, args.actor.status.wounds.value) + +woundsGained = Math.floor(woundsGained / 2) + +args.attacker.update({ "system.status.wounds.value": args.attacker.status.wounds.value + woundsGained }) + +this.script.scriptMessage(`Gains ${woundsGained} Wounds`) \ No newline at end of file diff --git a/reference_scripts/hDC6lroDEPVBituR.js b/reference_scripts/hDC6lroDEPVBituR.js new file mode 100644 index 0000000..02f66dc --- /dev/null +++ b/reference_scripts/hDC6lroDEPVBituR.js @@ -0,0 +1,12 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); + +if (test.failed) +{ + this.actor.update({"system.status.corruption.value" : parseInt(this.actor.status.corruption.value) + 1}) + this.script.scriptMessage("Gained a Corruption point", {whisper : ChatMessage.getWhisperRecipients("GM")}) + if (test.result.roll % 11 == 0 || test.result.roll == 100) + { + this.script.scriptMessage(`Fumble: immediately gain 1 @Table[mutatemental]{Mental Mutation}, and may not take a Short-term Ambition for the next [[1d10]] weeks.`, {whisper : ChatMessage.getWhisperRecipients("GM")}) + } +} \ No newline at end of file diff --git a/reference_scripts/hK0YMJfYbpbJZizO.js b/reference_scripts/hK0YMJfYbpbJZizO.js new file mode 100644 index 0000000..45b97af --- /dev/null +++ b/reference_scripts/hK0YMJfYbpbJZizO.js @@ -0,0 +1,12 @@ +this.actor.getActiveTokens().forEach(t => t.document.update({light : { + "dim": 0, + "bright": 0, + "angle": 360, + "alpha": 0.5, + "animation": { + "speed": 0, + "intensity": 0, + "type": "none", + }, + "color": "", + }})); \ No newline at end of file diff --git a/reference_scripts/hObTbWi4ZdwXimIW.js b/reference_scripts/hObTbWi4ZdwXimIW.js new file mode 100644 index 0000000..59c8d0c --- /dev/null +++ b/reference_scripts/hObTbWi4ZdwXimIW.js @@ -0,0 +1,4 @@ +if (args.item.type == "spell") +{ + args.item.system.cn.value = Math.floor(args.item.system.cn.value / 2); +} \ No newline at end of file diff --git a/reference_scripts/hR1qD2kpFHF8JT8h.js b/reference_scripts/hR1qD2kpFHF8JT8h.js new file mode 100644 index 0000000..1ee0b50 --- /dev/null +++ b/reference_scripts/hR1qD2kpFHF8JT8h.js @@ -0,0 +1 @@ +return args.skill?.name == "Language (Magick)" \ No newline at end of file diff --git a/reference_scripts/hSlEY2oh8quVmdXR.js b/reference_scripts/hSlEY2oh8quVmdXR.js new file mode 100644 index 0000000..f535336 --- /dev/null +++ b/reference_scripts/hSlEY2oh8quVmdXR.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn") +let data = item.toObject(); +data.system.specification.value = 2 +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/hZAax4emLahEEqcZ.js b/reference_scripts/hZAax4emLahEEqcZ.js new file mode 100644 index 0000000..4cf471f --- /dev/null +++ b/reference_scripts/hZAax4emLahEEqcZ.js @@ -0,0 +1,5 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW") +let data = item.toObject(); +data.system.specification.value = 7 - this.actor.characteristics.s.bonus +data.name = item.name.replace("(Feature)", "(Tusks)") +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/hfO4INH3EeETDTFt.js b/reference_scripts/hfO4INH3EeETDTFt.js new file mode 100644 index 0000000..5bb82c4 --- /dev/null +++ b/reference_scripts/hfO4INH3EeETDTFt.js @@ -0,0 +1 @@ +this.actor.status.addArmour(1, {locations: this.effect.flags.wfrp4e.locations, source: this.effect}) \ No newline at end of file diff --git a/reference_scripts/hhCs5VBKx50S5IsY.js b/reference_scripts/hhCs5VBKx50S5IsY.js new file mode 100644 index 0000000..d3aa69e --- /dev/null +++ b/reference_scripts/hhCs5VBKx50S5IsY.js @@ -0,0 +1 @@ +return !args.options.mutate \ No newline at end of file diff --git a/reference_scripts/hhv7PrRdlf9sfC82.js b/reference_scripts/hhv7PrRdlf9sfC82.js new file mode 100644 index 0000000..1941c02 --- /dev/null +++ b/reference_scripts/hhv7PrRdlf9sfC82.js @@ -0,0 +1,84 @@ +let characteristics = { + "ws" : 5, + "bs" : 0, + "s" : 5, + "t" : 5, + "i" : 10, + "ag" : 0, + "dex" : 0, + "int" : 0, + "wp" : 0, + "fel" : 0 + } + let skills = ["Cool", "Dodge"] + let skillAdvancements = [10, 10] + let talents = ["Combat Reflexes"] + let trappings = ["Leather Jack", "Leather Skullcap", "Leather Leggings", "Shield"] + let items = [] + + let updateObj = this.actor.toObject(); + + for (let ch in characteristics) + { + updateObj.system.characteristics[ch].modifier += characteristics[ch]; + } + + for (let index = 0; index < skills.length; index++) + { + let skill = skills[index] + let skillItem; + skillItem = updateObj.items.find(i => i.name == skill && i.type == "skill") + if (skillItem) + skillItem.system.advances.value += skillAdvancements[index] + else + { + skillItem = await game.wfrp4e.utility.findSkill(skill) + skillItem = skillItem.toObject(); + skillItem.system.advances.value = skillAdvancements[index]; + items.push(skillItem); + } + } + + for (let talent of talents) + { + let talentItem = await game.wfrp4e.utility.findTalent(talent) + if (talentItem) + { + items.push(talentItem.toObject()); + } + else + { + ui.notifications.warn(`Could not find ${talent}`, {permanent : true}) + } + } + + for (let trapping of trappings) + { + let trappingItem = await game.wfrp4e.utility.findItem(trapping) + if (trappingItem) + { + trappingItem = trappingItem.toObject() + + equip(trappingItem) + + items.push(trappingItem); + } + else + { + ui.notifications.warn(`Could not find ${trapping}`, {permanent : true}) + } + } + + + await this.actor.update(updateObj) + this.actor.createEmbeddedDocuments("Item", items); + + function equip(item) + { + if (item.type == "armour") + item.system.worn.value = true + else if (item.type == "weapon") + item.system.equipped = true + else if (item.type == "trapping" && item.system.trappingType.value == "clothingAccessories") + item.system.worn = true + } \ No newline at end of file diff --git a/reference_scripts/hlHKeFWrOA8CsLr9.js b/reference_scripts/hlHKeFWrOA8CsLr9.js new file mode 100644 index 0000000..25e12e8 --- /dev/null +++ b/reference_scripts/hlHKeFWrOA8CsLr9.js @@ -0,0 +1,2 @@ +args.data.canReverse = true; +args.options.pilot = true; \ No newline at end of file diff --git a/reference_scripts/hluehsCuBZYc1Ejt.js b/reference_scripts/hluehsCuBZYc1Ejt.js new file mode 100644 index 0000000..73d83dc --- /dev/null +++ b/reference_scripts/hluehsCuBZYc1Ejt.js @@ -0,0 +1 @@ +return args.characterisic != "fel" \ No newline at end of file diff --git a/reference_scripts/hmk8zV1LTElHUI8A.js b/reference_scripts/hmk8zV1LTElHUI8A.js new file mode 100644 index 0000000..00780d6 --- /dev/null +++ b/reference_scripts/hmk8zV1LTElHUI8A.js @@ -0,0 +1,8 @@ +let msg = `${this.actor.prototypeToken.name} loses 1 Wound.+ Select your choice +
+${this.actor.prototypeToken.name} has lost all alcohol related penalties and gains the Fatigued Condition for ${duration} hours.
`, +{ + whisper: ChatMessage.getWhisperRecipients("GM"), + blind: true +}) \ No newline at end of file diff --git a/reference_scripts/inPxRSx0CDj1nwAm.js b/reference_scripts/inPxRSx0CDj1nwAm.js new file mode 100644 index 0000000..6fda683 --- /dev/null +++ b/reference_scripts/inPxRSx0CDj1nwAm.js @@ -0,0 +1,4 @@ +if (args.test.result.fumble && !this.actor.itemTypes.talent.find(i => i.name == "Arcane Magic (Fire)")) +{ + this.actor.addCondition("ablaze"); +} \ No newline at end of file diff --git a/reference_scripts/ioeTj5mx8jlA5EX5.js b/reference_scripts/ioeTj5mx8jlA5EX5.js new file mode 100644 index 0000000..9605807 --- /dev/null +++ b/reference_scripts/ioeTj5mx8jlA5EX5.js @@ -0,0 +1 @@ +args.actor.addCondition("stunned") \ No newline at end of file diff --git a/reference_scripts/ipkkRffJh61WE7zR.js b/reference_scripts/ipkkRffJh61WE7zR.js new file mode 100644 index 0000000..fe706ac --- /dev/null +++ b/reference_scripts/ipkkRffJh61WE7zR.js @@ -0,0 +1,5 @@ +if (!args.flags.amputatedFootOrLeg) +{ + args.flags.amputatedFootOrLeg= true; + args.fields.modifier -= 20; +} \ No newline at end of file diff --git a/reference_scripts/iuSoKntfJ4eAPafQ.js b/reference_scripts/iuSoKntfJ4eAPafQ.js new file mode 100644 index 0000000..6f1b6d7 --- /dev/null +++ b/reference_scripts/iuSoKntfJ4eAPafQ.js @@ -0,0 +1,8 @@ +let spells = await game.wfrp4e.utility.findAll("spell", "Loading Spells"); +spells = spells.filter(s => ["fire", "heavens", "beasts", "shadow", "light", "life", "death", "metal"].includes(s.system.lore.value)).sort((a, b) => a.system.lore.value > b.system.lore.value ? 1 : -1) + +let choice = await ItemDialog.create(spells, 1, "Choose Spell"); +if (choice[0]) +{ + this.actor.createEmbeddedDocuments("Item", choice, {fromEffect: this.effect.id}) +} diff --git a/reference_scripts/iuYuf05BNuZ5fllI.js b/reference_scripts/iuYuf05BNuZ5fllI.js new file mode 100644 index 0000000..2e17e76 --- /dev/null +++ b/reference_scripts/iuYuf05BNuZ5fllI.js @@ -0,0 +1,4 @@ +if (args.test.isFumble) +{ + args.test.result.other.push("@Table[poisoned-wind-globe]") +} \ No newline at end of file diff --git a/reference_scripts/j1AmrY1SxFJQyapo.js b/reference_scripts/j1AmrY1SxFJQyapo.js new file mode 100644 index 0000000..843d5b1 --- /dev/null +++ b/reference_scripts/j1AmrY1SxFJQyapo.js @@ -0,0 +1,4 @@ +if (this.actor.status.advantage.value > 0 && args.item.system.attackType) +{ + args.item.system.qualities.value.push({name : "penetrating"}) +} \ No newline at end of file diff --git a/reference_scripts/j3zDMWkns32Yrxn3.js b/reference_scripts/j3zDMWkns32Yrxn3.js new file mode 100644 index 0000000..2e60b32 --- /dev/null +++ b/reference_scripts/j3zDMWkns32Yrxn3.js @@ -0,0 +1 @@ +this.effect.updateSource({"flags.wfrp4e.ward" : 9}) \ No newline at end of file diff --git a/reference_scripts/j6Bf1iivH8cqSnnK.js b/reference_scripts/j6Bf1iivH8cqSnnK.js new file mode 100644 index 0000000..f972bb4 --- /dev/null +++ b/reference_scripts/j6Bf1iivH8cqSnnK.js @@ -0,0 +1,2 @@ +let target = args.data.targets[0] +return target?.actor.hasCondition("prone") || target.hasCondition("surprised") \ No newline at end of file diff --git a/reference_scripts/j98hvy6r9G2Vjmid.js b/reference_scripts/j98hvy6r9G2Vjmid.js new file mode 100644 index 0000000..e02fdd6 --- /dev/null +++ b/reference_scripts/j98hvy6r9G2Vjmid.js @@ -0,0 +1,12 @@ +if (args.totalWoundLoss > 0) +{ + args.opposedTest.result.other.push( + `@Corruption[minor]{Minor Exposure to Corruption}` + ) + this.script.scriptMessage( + `${this.effect.name}: + @Corruption[minor]{Minor Exposure to Corruption}Damage all Items carried?
`}) + if (damageItems) + { + let msg = `` + let weapons = args.actor.itemTypes.weapon.filter(i => i.isEquipped); + let armour = args.actor.itemTypes.armour.filter(i => i.isEquipped); + let trappings = args.actor.itemTypes.trapping.filter(i => i.isEquipped); + for(let item of weapons) + { + if (item.system.properties.qualities.shield) + { + await item.system.damageItem(1, "shield"); + } + else + { + await item.system.damageItem(1); + } + msg += `${item.name} damage by 1
` + } + for(let item of armour) + { + await item.system.damageItem(1); + msg += `${item.name} damage by 1
` + } + for(let item of trappings) + { + await item.system.damageItem(1); + msg += `${item.name} damage by 1
` + } + if (msg) + { + this.script.scriptMessage(msg, {speaker : {alias : args.actor.name}}); + } + } +} + +if (type == "fire") +{ + await args.actor.addCondition("ablaze"); +} + +if (type == "electricity") +{ + await args.actor.addCondition("stunned"); +} + +if (type == "poison") +{ + await args.actor.addCondition("poisoned"); +} + diff --git a/reference_scripts/jfk5VDKMTIf4ee0v.js b/reference_scripts/jfk5VDKMTIf4ee0v.js new file mode 100644 index 0000000..bf86bc6 --- /dev/null +++ b/reference_scripts/jfk5VDKMTIf4ee0v.js @@ -0,0 +1,2 @@ +if (args.totalWoundLoss > 0) + args.actor.addCondition("poisoned") \ No newline at end of file diff --git a/reference_scripts/jgO1Kf60Ctt6R0qO.js b/reference_scripts/jgO1Kf60Ctt6R0qO.js new file mode 100644 index 0000000..5fb4283 --- /dev/null +++ b/reference_scripts/jgO1Kf60Ctt6R0qO.js @@ -0,0 +1 @@ +return args.item?.name != game.i18n.localize("NAME.Leadership") \ No newline at end of file diff --git a/reference_scripts/jmxlpyLrIuoxQtvU.js b/reference_scripts/jmxlpyLrIuoxQtvU.js new file mode 100644 index 0000000..097d4e0 --- /dev/null +++ b/reference_scripts/jmxlpyLrIuoxQtvU.js @@ -0,0 +1 @@ + this.actor.getActiveTokens().forEach(t => t.document.update({texture : {scaleX : 2, scaleY: 2, src: "modules/wfrp4e-core/tokens/popout/gor.webp"}})); diff --git a/reference_scripts/jpcU8FFWSlQ3gD0L.js b/reference_scripts/jpcU8FFWSlQ3gD0L.js new file mode 100644 index 0000000..dfb5b37 --- /dev/null +++ b/reference_scripts/jpcU8FFWSlQ3gD0L.js @@ -0,0 +1 @@ +return !args.skill?.name?.includes(game.i18n.localize("NAME.Trade")) \ No newline at end of file diff --git a/reference_scripts/jrvj7bRyMBB9LixP.js b/reference_scripts/jrvj7bRyMBB9LixP.js new file mode 100644 index 0000000..8c8d940 --- /dev/null +++ b/reference_scripts/jrvj7bRyMBB9LixP.js @@ -0,0 +1 @@ +this.actor.addCondition("fatigued", 3) \ No newline at end of file diff --git a/reference_scripts/jsgLEVYvMieyYT6L.js b/reference_scripts/jsgLEVYvMieyYT6L.js new file mode 100644 index 0000000..bfcf625 --- /dev/null +++ b/reference_scripts/jsgLEVYvMieyYT6L.js @@ -0,0 +1,18 @@ +let tokenImg = ""; // Put path to token image here, inbetween the quotation marks +if (tokenImg) +{ + if (this.effect.getFlag("wfrp4e", "transformed")) + { + await this.effect.setFlag("wfrp4e", "transformed", false); + this.actor.getActiveTokens().forEach(t => t.document.update({texture : {src: this.actor.prototypeToken.texture.src}})); + } + else + { + await this.effect.setFlag("wfrp4e", "transformed", true); + this.actor.getActiveTokens().forEach(t => t.document.update({texture : {src: tokenImg}})); + } +} +else +{ + this.script.scriptNotification("No Token Image path configured. The image path should be set in the first line of this script.", "error"); +} \ No newline at end of file diff --git a/reference_scripts/k3FqFgsF6a3TkxAD.js b/reference_scripts/k3FqFgsF6a3TkxAD.js new file mode 100644 index 0000000..b78e571 --- /dev/null +++ b/reference_scripts/k3FqFgsF6a3TkxAD.js @@ -0,0 +1,3 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +test.roll(); +return true; \ No newline at end of file diff --git a/reference_scripts/k8TC0yzp4xfOXD2n.js b/reference_scripts/k8TC0yzp4xfOXD2n.js new file mode 100644 index 0000000..26e00ae --- /dev/null +++ b/reference_scripts/k8TC0yzp4xfOXD2n.js @@ -0,0 +1,10 @@ +if (args.totalWoundLoss > 0) +{ + let test = await args.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}); + await test.roll(); + if (test.failed) + { + args.actor.addCondition("stunned"); + } + args.actor.hasCondition("bleeding")?.delete() +} \ No newline at end of file diff --git a/reference_scripts/k9SvH4Lm3ZuI8S1N.js b/reference_scripts/k9SvH4Lm3ZuI8S1N.js new file mode 100644 index 0000000..8315c45 --- /dev/null +++ b/reference_scripts/k9SvH4Lm3ZuI8S1N.js @@ -0,0 +1 @@ +return !["wp", "ag", "i", "int"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/kBXVEnSWzaQZLkJH.js b/reference_scripts/kBXVEnSWzaQZLkJH.js new file mode 100644 index 0000000..f8484c9 --- /dev/null +++ b/reference_scripts/kBXVEnSWzaQZLkJH.js @@ -0,0 +1,5 @@ +if(args.test.result.critical) +{ + args.test.result.damage +=1 + args.test.result.additionalDamage += 1 +} \ No newline at end of file diff --git a/reference_scripts/kIM4Fs1lFVV7TSnj.js b/reference_scripts/kIM4Fs1lFVV7TSnj.js new file mode 100644 index 0000000..176adc4 --- /dev/null +++ b/reference_scripts/kIM4Fs1lFVV7TSnj.js @@ -0,0 +1 @@ +this.actor.modifyAdvantage(1); \ No newline at end of file diff --git a/reference_scripts/kMSdRskYDI2J1gnp.js b/reference_scripts/kMSdRskYDI2J1gnp.js new file mode 100644 index 0000000..c06e3bc --- /dev/null +++ b/reference_scripts/kMSdRskYDI2J1gnp.js @@ -0,0 +1,7 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields : {difficulty : "average"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("prone"); +} + \ No newline at end of file diff --git a/reference_scripts/kWynO1lQzjiSs8RK.js b/reference_scripts/kWynO1lQzjiSs8RK.js new file mode 100644 index 0000000..0b3b7e8 --- /dev/null +++ b/reference_scripts/kWynO1lQzjiSs8RK.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.Haggle"); \ No newline at end of file diff --git a/reference_scripts/kYiDBPRKIokFkr4Z.js b/reference_scripts/kYiDBPRKIokFkr4Z.js new file mode 100644 index 0000000..10222a8 --- /dev/null +++ b/reference_scripts/kYiDBPRKIokFkr4Z.js @@ -0,0 +1,4 @@ +if (args.item.type == "skill" && args.item.name == "Ranged (Bow)") +{ + args.item.system.modifier.value += 20; +} \ No newline at end of file diff --git a/reference_scripts/kYmscP2HuXjDovBD.js b/reference_scripts/kYmscP2HuXjDovBD.js new file mode 100644 index 0000000..2e53be1 --- /dev/null +++ b/reference_scripts/kYmscP2HuXjDovBD.js @@ -0,0 +1 @@ +return args.skill?.name.includes(game.i18n.localize("NAME.Stealth")) diff --git a/reference_scripts/kiJ6AiaYVUjt6aV6.js b/reference_scripts/kiJ6AiaYVUjt6aV6.js new file mode 100644 index 0000000..2998e2c --- /dev/null +++ b/reference_scripts/kiJ6AiaYVUjt6aV6.js @@ -0,0 +1,7 @@ +teeth = await fromUuid("Compendium.wfrp4e-core.items.fBcZhOBn8IpoVqQ1") +teeth = teeth.toObject(); + +let roll = await new Roll("1d10").roll(); +roll.toMessage(this.script.getChatData({flavor : "Teeth Lost"})) +teeth.system.location.value = `${roll.total} ${teeth.system.location.value}` +this.actor.createEmbeddedDocuments("Item", [teeth]) \ No newline at end of file diff --git a/reference_scripts/kkC5EhqA05U6U0gU.js b/reference_scripts/kkC5EhqA05U6U0gU.js new file mode 100644 index 0000000..4116109 --- /dev/null +++ b/reference_scripts/kkC5EhqA05U6U0gU.js @@ -0,0 +1,17 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); + +// Kind of insane but whatever +let opposedResult = test.opposedMessages[0]?.getOppose()?.resultMessage?.getOpposedTest()?.result + +if (opposedResult?.winner == "attacker") +{ + if (opposedResult.differenceSL < 6) + { + this.actor.addCondition("fatigued", Math.floor(opposedResult.differenceSL / 2)) + } + else if (opposedResult.differenceSL >= 6) + { + this.actor.addCondition("broken"); + } +} \ No newline at end of file diff --git a/reference_scripts/kmsGLWGxCY8Z8jVG.js b/reference_scripts/kmsGLWGxCY8Z8jVG.js new file mode 100644 index 0000000..3077f61 --- /dev/null +++ b/reference_scripts/kmsGLWGxCY8Z8jVG.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.Intuition"); \ No newline at end of file diff --git a/reference_scripts/kvaN100w0nBUlLbj.js b/reference_scripts/kvaN100w0nBUlLbj.js new file mode 100644 index 0000000..cc524fa --- /dev/null +++ b/reference_scripts/kvaN100w0nBUlLbj.js @@ -0,0 +1,6 @@ +let poisoned = this.actor.hasCondition("poisoned") +if (poisoned) +{ + this.script.scriptMessage("Immune to Poisoned") + poisoned.delete() +} \ No newline at end of file diff --git a/reference_scripts/l8qFKSnMpy4P7XQR.js b/reference_scripts/l8qFKSnMpy4P7XQR.js new file mode 100644 index 0000000..523491c --- /dev/null +++ b/reference_scripts/l8qFKSnMpy4P7XQR.js @@ -0,0 +1 @@ +return !args.skill?.name.includes(game.i18n.localize("NAME.Stealth")); \ No newline at end of file diff --git a/reference_scripts/lCOdnKz8XpnkDs6Q.js b/reference_scripts/lCOdnKz8XpnkDs6Q.js new file mode 100644 index 0000000..51d5386 --- /dev/null +++ b/reference_scripts/lCOdnKz8XpnkDs6Q.js @@ -0,0 +1,2 @@ +let test = await this.actor.setupCharacteristic("t", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); \ No newline at end of file diff --git a/reference_scripts/lFO6XdfUODmFArqx.js b/reference_scripts/lFO6XdfUODmFArqx.js new file mode 100644 index 0000000..083ec87 --- /dev/null +++ b/reference_scripts/lFO6XdfUODmFArqx.js @@ -0,0 +1 @@ +args.actor.addCondition("bleeding") \ No newline at end of file diff --git a/reference_scripts/lII4KMRblqwFBlsV.js b/reference_scripts/lII4KMRblqwFBlsV.js new file mode 100644 index 0000000..49bd3a7 --- /dev/null +++ b/reference_scripts/lII4KMRblqwFBlsV.js @@ -0,0 +1,133 @@ +let characteristics = { + "ws" : 10, + "bs" : 0, + "s" : 0, + "t" : 0, + "i" : 10, + "ag" : 0, + "dex" : 0, + "int" : 20, + "wp" : 10, + "fel" : 15 +} +let skills = ["Channelling", "Charm", "Perform (Dancing)"] +let skillAdvancements = [0, 6, 3] +let talents = ["Attractive", "Distract", "Mimic"] +let traits = ["Distracting", "Flight (6)", "Spellcaster (Petty)"] +let trappings = [] +let items = []; +let spells = ["Marsh Lights", "Sleep"]; + +let updateObj = this.actor.toObject(); + +for (let ch in characteristics) +{ + updateObj.system.characteristics[ch].modifier += characteristics[ch]; +} + +for (let index = 0; index < skills.length; index++) +{ + let skill = skills[index] + let skillItem; + skillItem = updateObj.items.find(i => i.name == skill && i.type == "skill") + if (skillItem) + skillItem.system.advances.value += skillAdvancements[index] + else + { + skillItem = await game.wfrp4e.utility.findSkill(skill) + skillItem = skillItem.toObject(); + skillItem.system.advances.value = skillAdvancements[index]; + items.push(skillItem); + } +} + +for (let talent of talents) +{ + let talentItem = await game.wfrp4e.utility.findTalent(talent) + if (talentItem) + { + items.push(talentItem.toObject()); + } + else + { + ui.notifications.warn(`Could not find ${talent}`, {permanent : true}) + } +} + +const traitRegex = /(?:,?(.+?)(\+?\d{1,2}\+?)?\s*?(?:\((.+?)\)\s*(\+?\d{1,2})?|,|$))/gm +for (let trait of traits) +{ + let traitMatches = trait.matchAll(traitRegex).next().value + let traitName = traitMatches[1] + let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there's a specialization + let traitSpec = traitMatches[3] + + let traitItem; + try { + traitItem = await WFRP_Utility.findItem(traitName, "trait") + } + catch { } + if (!traitItem) { + ui.notifications.warn(`Could not find ${trait}`, {permanent : true}) + } + traitItem = traitItem.toObject() + + if (Number.isNumeric(traitVal)) + { + traitItem.system.specification.value = traitName.includes('Weapon','Horns','Tail','Tentacles','Bite') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal; + traitItem.name = (traitItem.name + ` ${traitSpec ? "("+ traitSpec + ")" : ""}`).trim() + } + else + traitItem.system.specification.value = traitSpec + + items.push(traitItem) + +} + +for (let trapping of trappings) +{ + let trappingItem = await game.wfrp4e.utility.findItem(trapping) + if (trappingItem) + { + trappingItem = trappingItem.toObject() + + equip(trappingItem) + + items.push(trappingItem); + } + else + { + ui.notifications.warn(`Could not find ${trapping}`, {permanent : true}) + } +} + +for (let spell of spells) +{ + let spellItem = await game.wfrp4e.utility.findItem(spell) + if (spellItem) + { + spellItem = spellItem.toObject() + + items.push(spellItem); + } + else + { + ui.notifications.warn(`Could not find ${spell}`, {permanent : true}) + } +} + +updateObj.name = updateObj.name += " " + this.effect.name + +await this.actor.update(updateObj) +this.actor.createEmbeddedDocuments("Item", items); + + +function equip(item) +{ + if (item.type == "armour") + item.worn = true + else if (item.type == "weapon") + item.equipped = true + else if (item.type == "trapping" && item.trappingType?.value == "clothingAccessories") + item.worn = true +} \ No newline at end of file diff --git a/reference_scripts/lOzkngzye4RmvALp.js b/reference_scripts/lOzkngzye4RmvALp.js new file mode 100644 index 0000000..4f261d3 --- /dev/null +++ b/reference_scripts/lOzkngzye4RmvALp.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.DrNUTPeodEgpWTnT") +this.actor.createEmbeddedDocuments("Item", [item], {fromEffect : this.effect.id}); +this.script.scriptNotification("Added " + item.name) \ No newline at end of file diff --git a/reference_scripts/lPudo1grrVp05i7a.js b/reference_scripts/lPudo1grrVp05i7a.js new file mode 100644 index 0000000..b96114f --- /dev/null +++ b/reference_scripts/lPudo1grrVp05i7a.js @@ -0,0 +1,11 @@ +let loc = Math.floor(CONFIG.Dice.randomUniform() * 2) == 0 ? "head" : "body" +let damage = this.actor.system.characteristics.s.bonus + 6 + + this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {skipTargets: true, appendTitle : " - " + this.effect.name}).then(async test => { + await test.roll(); + if(test.failed) + { + await this.actor.addCondition("stunned") + this.script.scriptMessage(await this.actor.applyBasicDamage(damage, {loc, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true})) + } + }) \ No newline at end of file diff --git a/reference_scripts/lQJ68n3y1xDyNicE.js b/reference_scripts/lQJ68n3y1xDyNicE.js new file mode 100644 index 0000000..0d61d6e --- /dev/null +++ b/reference_scripts/lQJ68n3y1xDyNicE.js @@ -0,0 +1 @@ +return !args.options.sizeModifier && args.item?.system?.attackType != "ranged" \ No newline at end of file diff --git a/reference_scripts/lSOAZ4FG44bT4jh1.js b/reference_scripts/lSOAZ4FG44bT4jh1.js new file mode 100644 index 0000000..fd544d6 --- /dev/null +++ b/reference_scripts/lSOAZ4FG44bT4jh1.js @@ -0,0 +1,7 @@ +let infected = await fromUuid("Compendium.wfrp4e-core.items.V0c3qBU1CMm8bmsW") +let fear = await fromUuid("Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn") + +let infectedData = infected.toObject(); +let fearData = fear.toObject(); +fearData.system.specification.value = 2; +this.actor.createEmbeddedDocuments("Item", [fearData, infectedData], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/lU4s3UTtBkU38djI.js b/reference_scripts/lU4s3UTtBkU38djI.js new file mode 100644 index 0000000..ba1cf91 --- /dev/null +++ b/reference_scripts/lU4s3UTtBkU38djI.js @@ -0,0 +1,4 @@ +this.actor.addCondition("entangled") +let msg = `${this.actor.prototypeToken.name} loses 1 Wound and gains 1 Entangled Condition.` +this.script.scriptMessage(msg) +this.actor.modifyWounds(-1) \ No newline at end of file diff --git a/reference_scripts/lYYkGzqNshiYc7WI.js b/reference_scripts/lYYkGzqNshiYc7WI.js new file mode 100644 index 0000000..d17b4c6 --- /dev/null +++ b/reference_scripts/lYYkGzqNshiYc7WI.js @@ -0,0 +1,6 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("poisoned") +} \ No newline at end of file diff --git a/reference_scripts/laptAldsT0Fm1rDt.js b/reference_scripts/laptAldsT0Fm1rDt.js new file mode 100644 index 0000000..861ea5e --- /dev/null +++ b/reference_scripts/laptAldsT0Fm1rDt.js @@ -0,0 +1,6 @@ +let blunt = await Dialog.confirm({label : "test", content :`Apply blunt damage reduction? (-3)
`}) + +if (blunt) +{ + args.modifiers.other.push({label : this.effect.name, details : "Blunt Damage Reduction", value : -3}) +} \ No newline at end of file diff --git a/reference_scripts/lhemR8EP5tGNKout.js b/reference_scripts/lhemR8EP5tGNKout.js new file mode 100644 index 0000000..a9d9356 --- /dev/null +++ b/reference_scripts/lhemR8EP5tGNKout.js @@ -0,0 +1,14 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {fields: {difficulty : "average"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure : "Suffer Creeping Irrationality"}}) +await test.roll(); +if (test.failed) +{ + msg = `@UUID[${this.effect.sourceItem.uuid}]{Creeping Irratitonality} Roll: ${Math.ceil(CONFIG.Dice.randomUniform() * 10)}
` + if (test.result.roll % 11 == 0 || test.result.roll == 100) + { + msg += `${this.actor.prototypeToken.name} also gained 1 Corruption Point. If mutating, this results in a @Table[mutatemental]{Mental Corruption}
` + let newCorruption = Number(this.actor.status.corruption.value) + 1 + this.actor.update({"system.status.corruption.value" : newCorruption}) + } + + this.script.scriptMessage(msg); +} diff --git a/reference_scripts/ljpM7muMyxGD04EX.js b/reference_scripts/ljpM7muMyxGD04EX.js new file mode 100644 index 0000000..50ba967 --- /dev/null +++ b/reference_scripts/ljpM7muMyxGD04EX.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.MVI0lXcg6vvtooAF") +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/lol5J6h0pErzM71s.js b/reference_scripts/lol5J6h0pErzM71s.js new file mode 100644 index 0000000..cc986ba --- /dev/null +++ b/reference_scripts/lol5J6h0pErzM71s.js @@ -0,0 +1 @@ +return args.weapon?.system.properties.flaws.crewed \ No newline at end of file diff --git a/reference_scripts/lvjcddwRiN9iGruy.js b/reference_scripts/lvjcddwRiN9iGruy.js new file mode 100644 index 0000000..1f4ca7b --- /dev/null +++ b/reference_scripts/lvjcddwRiN9iGruy.js @@ -0,0 +1,38 @@ +let test = await this.actor.setupCharacteristic("t", { appendTitle: ` - ${this.effect.name}`, fields: { difficulty: "challenging" } }) +await test.roll(); + +if (test.failed) +{ + let ageAdded = Math.ceil(CONFIG.Dice.randomUniform() * 10) + Math.ceil(CONFIG.Dice.randomUniform() * 10) + let ws = Math.ceil(CONFIG.Dice.randomUniform() * 10) + let bs = Math.ceil(CONFIG.Dice.randomUniform() * 10) + let s = Math.ceil(CONFIG.Dice.randomUniform() * 10) + let t = Math.ceil(CONFIG.Dice.randomUniform() * 10) + let ag = Math.ceil(CONFIG.Dice.randomUniform() * 10) + let dex = Math.ceil(CONFIG.Dice.randomUniform() * 10) + + let currentAge = parseInt(this.actor.system.details.age.value) + + let inline = `@ROLL` + let msg = + `${this.actor.prototypeToken.name} ages by ${inline.replace("@ROLL", ageAdded).replace("@TT", "2d10")} and loses
+${inline.replace("@ROLL", ws).replace("@TT", "1d10")} Weapon Skill
+${inline.replace("@ROLL", bs).replace("@TT", "1d10")} Ballistic Skill
+${inline.replace("@ROLL", s).replace("@TT", "1d10")} Strength
+${inline.replace("@ROLL", t).replace("@TT", "1d10")} Toughness
+${inline.replace("@ROLL", ag).replace("@TT", "1d10")} Agility
+${inline.replace("@ROLL", dex).replace("@TT", "1d10")} Dexterity
+ ` + this.script.scriptMessage(msg); + + let characteristics = duplicate(this.actor.system.characteristics) + + characteristics.ws.initial -= ws + characteristics.bs.initial -= bs + characteristics.s.initial -= s + characteristics.t.initial -= t + characteristics.ag.initial -= ag + characteristics.dex.initial -= dex + + this.actor.update({ "system.characteristics": characteristics, "data.details.age.value": ageAdded + currentAge }) +} \ No newline at end of file diff --git a/reference_scripts/lwVhn4bSXJ3eoT9q.js b/reference_scripts/lwVhn4bSXJ3eoT9q.js new file mode 100644 index 0000000..3a19740 --- /dev/null +++ b/reference_scripts/lwVhn4bSXJ3eoT9q.js @@ -0,0 +1,8 @@ +if (this.item.system.weaponGroup.value == "basic") +{ + let slash = this.item.system.qualities.value.find(i => i.name == "slash") + if (slash) + { + slash.value = "2A" + } +} \ No newline at end of file diff --git a/reference_scripts/m3qEVO5fseV6KHXa.js b/reference_scripts/m3qEVO5fseV6KHXa.js new file mode 100644 index 0000000..ebc6391 --- /dev/null +++ b/reference_scripts/m3qEVO5fseV6KHXa.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.qn4ZpvTQIX4rcJDl") +let data = item.toObject(); +data.system.location.key = this.item.system.location.key +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/m58MpMZBblpq5LJu.js b/reference_scripts/m58MpMZBblpq5LJu.js new file mode 100644 index 0000000..6f85774 --- /dev/null +++ b/reference_scripts/m58MpMZBblpq5LJu.js @@ -0,0 +1,2 @@ +args.prefillModifiers.slBonus++; +args.prefillModifiers.successBonus++; diff --git a/reference_scripts/m8qBlbH7ROoqa22o.js b/reference_scripts/m8qBlbH7ROoqa22o.js new file mode 100644 index 0000000..17577b3 --- /dev/null +++ b/reference_scripts/m8qBlbH7ROoqa22o.js @@ -0,0 +1 @@ +return args.options.reload \ No newline at end of file diff --git a/reference_scripts/mBcLf11upaHS8AQq.js b/reference_scripts/mBcLf11upaHS8AQq.js new file mode 100644 index 0000000..4234181 --- /dev/null +++ b/reference_scripts/mBcLf11upaHS8AQq.js @@ -0,0 +1 @@ +this.actor.status.addArmour(1, {source: this.effect}) \ No newline at end of file diff --git a/reference_scripts/mJ9eMPub4epJSf00.js b/reference_scripts/mJ9eMPub4epJSf00.js new file mode 100644 index 0000000..4144fbb --- /dev/null +++ b/reference_scripts/mJ9eMPub4epJSf00.js @@ -0,0 +1 @@ +return args.weapon?.system.qualities.value.find(i => i.name == "shield") && this.actor.attacker \ No newline at end of file diff --git a/reference_scripts/mPxmCsXYirAIT913.js b/reference_scripts/mPxmCsXYirAIT913.js new file mode 100644 index 0000000..84284a1 --- /dev/null +++ b/reference_scripts/mPxmCsXYirAIT913.js @@ -0,0 +1,3 @@ +let key = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.characteristics, this.effect.img), 1, "Choose Characteristic"); + +this.effect.updateSource({changes : [{key : `system.characteristics.${key[0].id}.modifier`, mode : 2, value : 10}]}) \ No newline at end of file diff --git a/reference_scripts/mRvLsSVxNyt8LVZb.js b/reference_scripts/mRvLsSVxNyt8LVZb.js new file mode 100644 index 0000000..f68402d --- /dev/null +++ b/reference_scripts/mRvLsSVxNyt8LVZb.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.GRRN3XAKIpEVCY7z") +let data = item.toObject(); +data.name += " (To Be Determined)" +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/mTnmPcjWmvScIBWY.js b/reference_scripts/mTnmPcjWmvScIBWY.js new file mode 100644 index 0000000..14c7aaf --- /dev/null +++ b/reference_scripts/mTnmPcjWmvScIBWY.js @@ -0,0 +1 @@ +return args.skill?.name.includes("Channelling") || args.type == "channelling" \ No newline at end of file diff --git a/reference_scripts/mV4Tmc0yfpL09KV7.js b/reference_scripts/mV4Tmc0yfpL09KV7.js new file mode 100644 index 0000000..3b9f40b --- /dev/null +++ b/reference_scripts/mV4Tmc0yfpL09KV7.js @@ -0,0 +1 @@ +args.actor.addCondition("entangled") \ No newline at end of file diff --git a/reference_scripts/mYL4i1vNlMl4vFYy.js b/reference_scripts/mYL4i1vNlMl4vFYy.js new file mode 100644 index 0000000..a5211a8 --- /dev/null +++ b/reference_scripts/mYL4i1vNlMl4vFYy.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.Perception") && args.skill?.name != game.i18n.localize("NAME.Track"); \ No newline at end of file diff --git a/reference_scripts/ma0sWhebqwdRHWvY.js b/reference_scripts/ma0sWhebqwdRHWvY.js new file mode 100644 index 0000000..c1779e5 --- /dev/null +++ b/reference_scripts/ma0sWhebqwdRHWvY.js @@ -0,0 +1,5 @@ +if (!args.flags.trained) +{ + args.flags.trained = true; + args.fields.modifier += 10; +} \ No newline at end of file diff --git a/reference_scripts/maKr58mvvyKxFyC3.js b/reference_scripts/maKr58mvvyKxFyC3.js new file mode 100644 index 0000000..f941ab6 --- /dev/null +++ b/reference_scripts/maKr58mvvyKxFyC3.js @@ -0,0 +1,2 @@ +if (args.item.type == "prayer" && (args.item.damage.value || args.item.damage.dice)) + args.item.damage.value += "+1" \ No newline at end of file diff --git a/reference_scripts/masOBNgSi5HYkf3m.js b/reference_scripts/masOBNgSi5HYkf3m.js new file mode 100644 index 0000000..ed60b79 --- /dev/null +++ b/reference_scripts/masOBNgSi5HYkf3m.js @@ -0,0 +1 @@ +return args.type != "cast" && args.type != "channelling" \ No newline at end of file diff --git a/reference_scripts/mgLGN1XPzPE4dReN.js b/reference_scripts/mgLGN1XPzPE4dReN.js new file mode 100644 index 0000000..0433903 --- /dev/null +++ b/reference_scripts/mgLGN1XPzPE4dReN.js @@ -0,0 +1 @@ +args.fields.slBonus--; \ No newline at end of file diff --git a/reference_scripts/mr8qm5Bg6k1idZ6Q.js b/reference_scripts/mr8qm5Bg6k1idZ6Q.js new file mode 100644 index 0000000..c28b926 --- /dev/null +++ b/reference_scripts/mr8qm5Bg6k1idZ6Q.js @@ -0,0 +1 @@ +return args.item?.name == "Play (Lute)" \ No newline at end of file diff --git a/reference_scripts/mziJBUYcsrhkdcCJ.js b/reference_scripts/mziJBUYcsrhkdcCJ.js new file mode 100644 index 0000000..0308dbf --- /dev/null +++ b/reference_scripts/mziJBUYcsrhkdcCJ.js @@ -0,0 +1,6 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("prone") +} \ No newline at end of file diff --git a/reference_scripts/n5RJqJL9fdRIxkuN.js b/reference_scripts/n5RJqJL9fdRIxkuN.js new file mode 100644 index 0000000..5fa0e06 --- /dev/null +++ b/reference_scripts/n5RJqJL9fdRIxkuN.js @@ -0,0 +1,12 @@ +if (this.actor.system.status.advantage.value > 0) +{ + await this.actor.modifyAdvantage(-1); + this.script.scriptNotification("Advantage Subtracted") +} +else +{ + return this.script.scriptNotification("Not enough Advantage!", "error") +} + +let test = await this.actor.setupTrait(this.item) +await test.roll(); \ No newline at end of file diff --git a/reference_scripts/nCWAflBj7Si2BI1Q.js b/reference_scripts/nCWAflBj7Si2BI1Q.js new file mode 100644 index 0000000..af67a69 --- /dev/null +++ b/reference_scripts/nCWAflBj7Si2BI1Q.js @@ -0,0 +1,4 @@ +if (args.item.type == "spell" && args.item.system.lore.value != "petty") +{ + args.item.cn.value = Math.max(4, args.item.cn.value * 2) +} \ No newline at end of file diff --git a/reference_scripts/nD2QVg3DrPK3foMf.js b/reference_scripts/nD2QVg3DrPK3foMf.js new file mode 100644 index 0000000..0101c82 --- /dev/null +++ b/reference_scripts/nD2QVg3DrPK3foMf.js @@ -0,0 +1,7 @@ +args.actor.setupSkill("Dodge", { fields: { difficulty: "average" } }).then(async test => { + await test.roll(); + if (test.failed) { + await args.actor.addCondition("bleeding") + await args.actor.addCondition("entangled") + } + }) \ No newline at end of file diff --git a/reference_scripts/nEaF3jbCiVYD8jia.js b/reference_scripts/nEaF3jbCiVYD8jia.js new file mode 100644 index 0000000..c39fb2f --- /dev/null +++ b/reference_scripts/nEaF3jbCiVYD8jia.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.Charm") && !args.skill?.name.includes(game.i18n.localize("NAME.Lore")); \ No newline at end of file diff --git a/reference_scripts/nGTxNWBUBgTr87wU.js b/reference_scripts/nGTxNWBUBgTr87wU.js new file mode 100644 index 0000000..c078cd8 --- /dev/null +++ b/reference_scripts/nGTxNWBUBgTr87wU.js @@ -0,0 +1,5 @@ +if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 2 && args.opposedTest.result.winner == "attacker") +{ + this.script.scriptMessage(`Becomes lodged in the armour or flesh of the opponent. See @UUID[${this.item.uuid}]{${this.item.name}}.`, speaker : {alias : this.item.name}, {blind: true, whisper : ChatMessage.getWhisperRecipients("GM")}) +} + \ No newline at end of file diff --git a/reference_scripts/nHJdlqbOP0ECgywb.js b/reference_scripts/nHJdlqbOP0ECgywb.js new file mode 100644 index 0000000..6bf5cf6 --- /dev/null +++ b/reference_scripts/nHJdlqbOP0ECgywb.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.CnydL8p3PVAuF98w") +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/nSXzktHyNjGUXjaw.js b/reference_scripts/nSXzktHyNjGUXjaw.js new file mode 100644 index 0000000..33216f3 --- /dev/null +++ b/reference_scripts/nSXzktHyNjGUXjaw.js @@ -0,0 +1 @@ +return args.item?.system.isRanged \ No newline at end of file diff --git a/reference_scripts/nYtAjSArsNbrU2ob.js b/reference_scripts/nYtAjSArsNbrU2ob.js new file mode 100644 index 0000000..f092926 --- /dev/null +++ b/reference_scripts/nYtAjSArsNbrU2ob.js @@ -0,0 +1,8 @@ +if (["ag", "i", "int"].includes(args.characteristic)) +{ + args.fields.modifier -= 10; +} +else if (["wp"].includes(args.characteristic)) +{ + args.fields.modifier += 10; +} \ No newline at end of file diff --git a/reference_scripts/naF5EWr1CBkYRZTK.js b/reference_scripts/naF5EWr1CBkYRZTK.js new file mode 100644 index 0000000..ecdafaa --- /dev/null +++ b/reference_scripts/naF5EWr1CBkYRZTK.js @@ -0,0 +1,26 @@ +if (args.opposedTest?.attackerTest?.item?.system?.isRanged) +{ + let choice = await Dialog.wait({ + title: this.effect.name, + content: `Abort damage with ${this.effect.name}?`,
+ buttons: {
+ yes: {
+ label: "Yes",
+ callback: () => {
+ return true;
+ }
+ },
+ no: {
+ label: "No",
+ callback: () => {
+ return false;
+ }
+ }
+ }
+ })
+
+ if (choice)
+ {
+ args.abort = `${this.effect.name}: Damage cancelled`
+ }
+}
\ No newline at end of file
diff --git a/reference_scripts/ncIjDE6TFx88IQA1.js b/reference_scripts/ncIjDE6TFx88IQA1.js
new file mode 100644
index 0000000..223a1a3
--- /dev/null
+++ b/reference_scripts/ncIjDE6TFx88IQA1.js
@@ -0,0 +1 @@
+return args.skill?.name == game.i18n.localize("NAME.Climb") || args.skill?.name == game.i18n.localize("NAME.Athletics");
\ No newline at end of file
diff --git a/reference_scripts/neaaVy6D6tfcst5P.js b/reference_scripts/neaaVy6D6tfcst5P.js
new file mode 100644
index 0000000..123137f
--- /dev/null
+++ b/reference_scripts/neaaVy6D6tfcst5P.js
@@ -0,0 +1 @@
+args.fields.slBonus += this.actor.characteristics.i.bonus;
diff --git a/reference_scripts/ngMm7SgtVqVovFJG.js b/reference_scripts/ngMm7SgtVqVovFJG.js
new file mode 100644
index 0000000..8d5af65
--- /dev/null
+++ b/reference_scripts/ngMm7SgtVqVovFJG.js
@@ -0,0 +1,4 @@
+if (args.test.result.critical && args.test.result.critical != "Total Power")
+{
+ args.test.result.other.push(` Bonecrusher Critical (+20) (only if Critical Cast selected)`)
+}
\ No newline at end of file
diff --git a/reference_scripts/njPP9wDAsdh4WHIj.js b/reference_scripts/njPP9wDAsdh4WHIj.js
new file mode 100644
index 0000000..be455e6
--- /dev/null
+++ b/reference_scripts/njPP9wDAsdh4WHIj.js
@@ -0,0 +1,4 @@
+if (args.totalWoundLoss > 0 && ["trait", "weapon"].includes(args.opposedTest.attackerTest.item?.type))
+{
+ this.script.scriptMessage(`Infected: ${args.actor.name} must pass an Easy (+40) Endurance Test or gain a @UUID[Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb]{Festering Wound}`, {whisper: ChatMessage.getWhisperRecipients("GM")})
+}
\ No newline at end of file
diff --git a/reference_scripts/nkbTnaeBpthyhw4J.js b/reference_scripts/nkbTnaeBpthyhw4J.js
new file mode 100644
index 0000000..da73508
--- /dev/null
+++ b/reference_scripts/nkbTnaeBpthyhw4J.js
@@ -0,0 +1,6 @@
+let fortunePoints = this.effect.sourceTest.result.overcast.usage.other.current
+let current = this.actor.status.fortune.value
+
+this.actor.update({"system.status.fortune.value" : fortunePoints + current})
+
+this.script.scriptMessage(`${this.actor.prototypeToken.name} fortune points increased from ${current} to ${fortunePoints + current}`)
\ No newline at end of file
diff --git a/reference_scripts/nkdKBJ8ItqWiRAWL.js b/reference_scripts/nkdKBJ8ItqWiRAWL.js
new file mode 100644
index 0000000..da8ed4c
--- /dev/null
+++ b/reference_scripts/nkdKBJ8ItqWiRAWL.js
@@ -0,0 +1,21 @@
+// Apply changes when the mask is worn
+
+if (args.equipped) {
+ this.actor.createEmbeddedDocuments("ActiveEffect", [this.item.effects.contents[1]?.convertToApplied()])
+ this.script.scriptMessage(`${this.actor.name} dons the ${this.item.name}.
+ They gain +50 to Swim Tests and can breathe underwater.
+ If they wear the mask for more than an hour or benefit from any of its effects, they are exposed to @Corruption[moderate]{Moderate Corruption}.
+ `,
+ {whisper: ChatMessage.getWhisperRecipients("GM")})
+}
+
+// Notify of lingering effects when mask is removed
+else if (!args.equipped)
+{
+ await this.item.effects.contents[0].delete();
+ await this.item.update({name : this.item.name += " (Used)"})
+ this.script.scriptMessage(`${this.item.name} on ${this.actor.name} has been taken off and loses its properties. However, the effects last for [[1d10+4]] days, after which they should be manually removed.`,
+ {whisper: ChatMessage.getWhisperRecipients("GM")}
+ )
+
+}
diff --git a/reference_scripts/nuIpPD4uaZRuJni8.js b/reference_scripts/nuIpPD4uaZRuJni8.js
new file mode 100644
index 0000000..43c5bf3
--- /dev/null
+++ b/reference_scripts/nuIpPD4uaZRuJni8.js
@@ -0,0 +1,3 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.qdMbxW09FUoYBzmB")
+let data = item.toObject();
+this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id})
\ No newline at end of file
diff --git a/reference_scripts/nvrFhHHVq3KzirlR.js b/reference_scripts/nvrFhHHVq3KzirlR.js
new file mode 100644
index 0000000..ba0fdde
--- /dev/null
+++ b/reference_scripts/nvrFhHHVq3KzirlR.js
@@ -0,0 +1 @@
+return !args.skill?.name.includes(game.i18n.localize("NAME.Stealth"))
diff --git a/reference_scripts/nxNqWmmF6mJTnrLo.js b/reference_scripts/nxNqWmmF6mJTnrLo.js
new file mode 100644
index 0000000..142e606
--- /dev/null
+++ b/reference_scripts/nxNqWmmF6mJTnrLo.js
@@ -0,0 +1 @@
+return args.weapon?.system.usesHands.includes(this.item.system.location.key);
\ No newline at end of file
diff --git a/reference_scripts/nzh8d46l1ikhkz8Q.js b/reference_scripts/nzh8d46l1ikhkz8Q.js
new file mode 100644
index 0000000..a11f1bf
--- /dev/null
+++ b/reference_scripts/nzh8d46l1ikhkz8Q.js
@@ -0,0 +1 @@
+return (args.type == "weapon" && (args.item.system.weaponGroup.value == "blackpowder" || args.item.system.weaponGroup.value == "engineering")) || (args.type == "cast" && args.item.system.lore.value == "fire")
\ No newline at end of file
diff --git a/reference_scripts/o1zD8mej9TWKNxUq.js b/reference_scripts/o1zD8mej9TWKNxUq.js
new file mode 100644
index 0000000..9cc92e5
--- /dev/null
+++ b/reference_scripts/o1zD8mej9TWKNxUq.js
@@ -0,0 +1 @@
+args.fields.slBonus -= 1;
\ No newline at end of file
diff --git a/reference_scripts/o3JUBKLvE6bBxK2n.js b/reference_scripts/o3JUBKLvE6bBxK2n.js
new file mode 100644
index 0000000..9ccae0a
--- /dev/null
+++ b/reference_scripts/o3JUBKLvE6bBxK2n.js
@@ -0,0 +1,20 @@
+let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), { fields: { difficulty: "average" } })
+await test.roll();
+if (test.failed)
+{
+ await this.actor.addCondition("prone")
+ let injury = await fromUuid("Compendium.wfrp4e-core.items.ZhMADOqoo0y8Q9bx");
+ injury = injury.toObject()
+ let toes = Math.clamped(Math.abs(test.result.SL) + 1, 1, 5)
+ injury.system.location.key = this.item.system.location.key[0] + injury.system.location.value
+ if (injury.system.location.key[0] == "r")
+ {
+ injury.system.location.value = `${toes} Right ${injury.system.location.value}s`
+ }
+ else if (injury.system.location.key[0] == "l")
+ {
+ injury.system.location.value = `${toes} Left ${injury.system.location.value}s`
+ }
+ setProperty(injury, "system.wfrp4e.count", toes)
+ this.actor.createEmbeddedDocuments("Item", [injury])
+}
\ No newline at end of file
diff --git a/reference_scripts/o88xuUConwt0vFLw.js b/reference_scripts/o88xuUConwt0vFLw.js
new file mode 100644
index 0000000..ae9e06f
--- /dev/null
+++ b/reference_scripts/o88xuUConwt0vFLw.js
@@ -0,0 +1,5 @@
+let points = this.effect.sourceTest.result.overcast.usage.other.current;
+
+this.actor.update({"system.status.fortune.value" : this.actor.system.status.fortune.value + points});
+
+this.script.scriptMessage(`Gained ${points} Fortune Points`)
\ No newline at end of file
diff --git a/reference_scripts/oDNfCNyt5KaUYmg2.js b/reference_scripts/oDNfCNyt5KaUYmg2.js
new file mode 100644
index 0000000..7efcdf8
--- /dev/null
+++ b/reference_scripts/oDNfCNyt5KaUYmg2.js
@@ -0,0 +1,10 @@
+if(args.opposedTest.result.winner == "defender")
+{
+ let roll = Math.ceil(CONFIG.Dice.randomUniform() * 10)
+ let msg = `Rolled ${roll}.`
+ if (roll >= 7)
+ {
+ msg = `Attack hits with an SL of ${roll - 6}.`
+ }
+ this.script.scriptMessage(msg, {blind: true, whisper : ChatMessage.getWhisperRecipients("GM")})
+}
\ No newline at end of file
diff --git a/reference_scripts/oEsUsI74yGTZ9CwU.js b/reference_scripts/oEsUsI74yGTZ9CwU.js
new file mode 100644
index 0000000..c57ed37
--- /dev/null
+++ b/reference_scripts/oEsUsI74yGTZ9CwU.js
@@ -0,0 +1 @@
+return args.item?.name == game.i18n.localize("NAME.CharmAnimal")
\ No newline at end of file
diff --git a/reference_scripts/oGdsGPgJWcyWkiWl.js b/reference_scripts/oGdsGPgJWcyWkiWl.js
new file mode 100644
index 0000000..b6511a1
--- /dev/null
+++ b/reference_scripts/oGdsGPgJWcyWkiWl.js
@@ -0,0 +1,6 @@
+this.actor.addCondition("broken")
+
+if (this.actor.has(game.i18n.localize("NAME.Undead")))
+{
+ this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true}))
+}
\ No newline at end of file
diff --git a/reference_scripts/oHenUKtaS3jT5xQn.js b/reference_scripts/oHenUKtaS3jT5xQn.js
new file mode 100644
index 0000000..c399b90
--- /dev/null
+++ b/reference_scripts/oHenUKtaS3jT5xQn.js
@@ -0,0 +1,4 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.4xF7M6ylIiGntekh")
+item = item.toObject()
+item.name = this.effect.name
+this.actor.createEmbeddedDocuments("Item", [item], {fromEffect : this.effect.id})
diff --git a/reference_scripts/oPg4se8iQRD14kmB.js b/reference_scripts/oPg4se8iQRD14kmB.js
new file mode 100644
index 0000000..a61008d
--- /dev/null
+++ b/reference_scripts/oPg4se8iQRD14kmB.js
@@ -0,0 +1,27 @@
+let filters = [
+ {
+ property : "type",
+ value : "weapon"
+ },
+ {
+ property : "system.weaponGroup.value",
+ value : ["twohanded", "polearm"]
+ }
+]
+
+let items = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 1, "Choose an appropriate Polearm or Two-Handed Weapon")
+items = items.map(i => i.toObject())
+
+items.forEach(i => equip(i))
+
+this.actor.createEmbeddedDocuments("Item", items);
+
+function equip(item)
+{
+ if (item.type == "armour")
+ item.system.worn.value = true
+ else if (item.type == "weapon")
+ item.system.equipped = true
+ else if (item.type == "trapping" && item.system.trappingType.value == "clothingAccessories")
+ item.system.worn = true
+}
\ No newline at end of file
diff --git a/reference_scripts/oV81zgbZsuTFG6L2.js b/reference_scripts/oV81zgbZsuTFG6L2.js
new file mode 100644
index 0000000..c49d598
--- /dev/null
+++ b/reference_scripts/oV81zgbZsuTFG6L2.js
@@ -0,0 +1,5 @@
+let caster = this.effect.sourceActor;
+
+this.actor.modifyWounds(caster.system.characteristics.fel.bonus);
+
+this.script.scriptMessage(`Healed ${caster.system.characteristics.fel.bonus} Wounds`);
\ No newline at end of file
diff --git a/reference_scripts/oW1gtYVT5nrxDjM7.js b/reference_scripts/oW1gtYVT5nrxDjM7.js
new file mode 100644
index 0000000..0f97f92
--- /dev/null
+++ b/reference_scripts/oW1gtYVT5nrxDjM7.js
@@ -0,0 +1 @@
+return args.characteristic != "ag"
\ No newline at end of file
diff --git a/reference_scripts/oWM43EdUiyHgUlfW.js b/reference_scripts/oWM43EdUiyHgUlfW.js
new file mode 100644
index 0000000..2c1af1d
--- /dev/null
+++ b/reference_scripts/oWM43EdUiyHgUlfW.js
@@ -0,0 +1,2 @@
+if (args.test.item && args.test.item.name == game.i18n.localize("NAME.ConsumeAlcohol"))
+ args.test.preData.canReverse = true
\ No newline at end of file
diff --git a/reference_scripts/oWa7RkScnl6lR5vd.js b/reference_scripts/oWa7RkScnl6lR5vd.js
new file mode 100644
index 0000000..cba5818
--- /dev/null
+++ b/reference_scripts/oWa7RkScnl6lR5vd.js
@@ -0,0 +1,11 @@
+if (args.test.characteristicKey == "wp")
+{
+ if (args.test.failed)
+ {
+ let item = await fromUuid("Compendium.wfrp4e-core.items.AGcJl5rHjkyIQBPP")
+ let data = item.toObject();
+ this.actor.createEmbeddedDocuments("Item", [data])
+
+ this.script.scriptMessage(`Willpower Test failed, ${this.actor.prototypeToken.name} gains @UUID[Compendium.wfrp4e-core.items.AGcJl5rHjkyIQBPP] for [[1d10]] hours`)
+ }
+}
\ No newline at end of file
diff --git a/reference_scripts/obIXhQXKFyyQoNNV.js b/reference_scripts/obIXhQXKFyyQoNNV.js
new file mode 100644
index 0000000..2df4ad3
--- /dev/null
+++ b/reference_scripts/obIXhQXKFyyQoNNV.js
@@ -0,0 +1,7 @@
+this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {appendTitle: ` - ${this.effect.name}`, fields: { difficulty: "average" } }).then(async test => {
+ await test.roll()
+ if (test.failed) {
+ this.actor.modifyWounds(-1);
+ this.script.scriptMessage("Takes 1 Damage")
+ }
+})
\ No newline at end of file
diff --git a/reference_scripts/ocBW3osTFnb5JCfe.js b/reference_scripts/ocBW3osTFnb5JCfe.js
new file mode 100644
index 0000000..59d46c5
--- /dev/null
+++ b/reference_scripts/ocBW3osTFnb5JCfe.js
@@ -0,0 +1,3 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.MVI0lXcg6vvtooAF")
+let data = item.toObject()
+this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id})
diff --git a/reference_scripts/ofddAHvzn1xUueSG.js b/reference_scripts/ofddAHvzn1xUueSG.js
new file mode 100644
index 0000000..1b43518
--- /dev/null
+++ b/reference_scripts/ofddAHvzn1xUueSG.js
@@ -0,0 +1,15 @@
+args.AP.head.value -= tinDifference(args.AP.head.layers)
+args.AP.body.value -= tinDifference(args.AP.body.layers)
+args.AP.lArm.value -= tinDifference(args.AP.lArm.layers)
+args.AP.rArm.value -= tinDifference(args.AP.rArm.layers)
+args.AP.rLeg.value -= tinDifference(args.AP.rLeg.layers)
+args.AP.lLeg.value -= tinDifference(args.AP.lLeg.layers)
+
+function tinDifference(layers)
+{
+ let metalAP = layers.filter(i => i.metal).reduce((prev, current) => prev + current.value, 0)
+
+ let tinAP = layers.filter(i => i.metal).reduce((prev, current) => prev + Math.max(0, current.value - 2), 0)
+
+ return metalAP - tinAP;
+}
\ No newline at end of file
diff --git a/reference_scripts/ogJBAXTXyhTqACPO.js b/reference_scripts/ogJBAXTXyhTqACPO.js
new file mode 100644
index 0000000..2b4b34e
--- /dev/null
+++ b/reference_scripts/ogJBAXTXyhTqACPO.js
@@ -0,0 +1 @@
+return args.item?.system.attackType != "melee"
\ No newline at end of file
diff --git a/reference_scripts/ohl803m0tUwNfKAk.js b/reference_scripts/ohl803m0tUwNfKAk.js
new file mode 100644
index 0000000..c503b57
--- /dev/null
+++ b/reference_scripts/ohl803m0tUwNfKAk.js
@@ -0,0 +1,4 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv")
+let data = item.toObject();
+data.system.specification.value = 5 - this.actor.characteristics.s.bonus
+this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id})
\ No newline at end of file
diff --git a/reference_scripts/okW06V9UiPC4Vcrn.js b/reference_scripts/okW06V9UiPC4Vcrn.js
new file mode 100644
index 0000000..f8d4264
--- /dev/null
+++ b/reference_scripts/okW06V9UiPC4Vcrn.js
@@ -0,0 +1,86 @@
+let characteristics = {
+ "ws" : 5,
+ "bs" : 0,
+ "s" : 5,
+ "t" : 5,
+ "i" : 10,
+ "ag" : 0,
+ "dex" : 0,
+ "int" : 0,
+ "wp" : 5,
+ "fel" : 5
+}
+let skills = ["Cool", "Dodge"]
+let skillAdvancements = [10, 10]
+let talents = ["Combat Reflexes", "Resolute"]
+let trappings = ["Leather Jack", "Leather Leggings", "Leather Skullcap", "Hand Weapon", "Spear", "Shield"]
+let items = [];
+
+let updateObj = this.actor.toObject();
+
+for (let ch in characteristics)
+{
+ updateObj.system.characteristics[ch].modifier += characteristics[ch];
+}
+
+for (let index = 0; index < skills.length; index++)
+{
+ let skill = skills[index]
+ let skillItem;
+ skillItem = updateObj.items.find(i => i.name == skill && i.type == "skill")
+ if (skillItem)
+ skillItem.system.advances.value += skillAdvancements[index]
+ else
+ {
+ skillItem = await game.wfrp4e.utility.findSkill(skill)
+ skillItem = skillItem.toObject();
+ skillItem.system.advances.value = skillAdvancements[index];
+ items.push(skillItem);
+ }
+}
+
+for (let talent of talents)
+{
+ let talentItem = await game.wfrp4e.utility.findTalent(talent)
+ if (talentItem)
+ {
+ items.push(talentItem.toObject());
+ }
+ else
+ {
+ ui.notifications.warn(`Could not find ${talent}`, {permanent : true})
+ }
+}
+
+for (let trapping of trappings)
+{
+ let trappingItem = await game.wfrp4e.utility.findItem(trapping)
+ if (trappingItem)
+ {
+ trappingItem = trappingItem.toObject()
+
+ equip(trappingItem)
+
+ items.push(trappingItem);
+ }
+ else
+ {
+ ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})
+ }
+}
+
+updateObj.name = updateObj.name += " " + this.effect.name
+
+await this.actor.update(updateObj)
+this.actor.createEmbeddedDocuments("Item", items);
+
+
+function equip(item)
+{
+ if (item.type == "armour")
+ item.system.worn.value = true
+ else if (item.type == "weapon")
+ item.system.equipped = true
+ else if (item.type == "trapping" && item.system.trappingType.value == "clothingAccessories")
+ item.system.worn = true
+}
\ No newline at end of file
diff --git a/reference_scripts/okr3TtzpFoefUuJS.js b/reference_scripts/okr3TtzpFoefUuJS.js
new file mode 100644
index 0000000..ef551e2
--- /dev/null
+++ b/reference_scripts/okr3TtzpFoefUuJS.js
@@ -0,0 +1,4 @@
+let item = await fromUuid('Compendium.wfrp4e-core.items.EaqlLRQigwnsEAXX')
+let data = item.toObject();
+data.system.location.value = "Collar Bone"
+this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id})
\ No newline at end of file
diff --git a/reference_scripts/oqgd9G6oI1ncPYLw.js b/reference_scripts/oqgd9G6oI1ncPYLw.js
new file mode 100644
index 0000000..067d1ec
--- /dev/null
+++ b/reference_scripts/oqgd9G6oI1ncPYLw.js
@@ -0,0 +1,2 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.CV9btQn09S9Fn8Jk");
+this.actor.createEmbeddedDocuments("Item", [item.toObject()], {fromEffect : this.effect.id});
\ No newline at end of file
diff --git a/reference_scripts/p222EiR8RRtlPm31.js b/reference_scripts/p222EiR8RRtlPm31.js
new file mode 100644
index 0000000..f757919
--- /dev/null
+++ b/reference_scripts/p222EiR8RRtlPm31.js
@@ -0,0 +1,3 @@
+let test = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "hard"}})
+await test.roll();
+return test.failed;
\ No newline at end of file
diff --git a/reference_scripts/pAgiAGyaLJY10894.js b/reference_scripts/pAgiAGyaLJY10894.js
new file mode 100644
index 0000000..13da9da
--- /dev/null
+++ b/reference_scripts/pAgiAGyaLJY10894.js
@@ -0,0 +1 @@
+return args.skill?.name == game.i18n.localize("NAME.Charm");
\ No newline at end of file
diff --git a/reference_scripts/pBMioPUtDn1mk9f5.js b/reference_scripts/pBMioPUtDn1mk9f5.js
new file mode 100644
index 0000000..a13d279
--- /dev/null
+++ b/reference_scripts/pBMioPUtDn1mk9f5.js
@@ -0,0 +1,3 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.5KP9sOoLSGvj9EXp")
+let data = item.toObject();
+this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id});
\ No newline at end of file
diff --git a/reference_scripts/pG5OVokZzCRHIrwz.js b/reference_scripts/pG5OVokZzCRHIrwz.js
new file mode 100644
index 0000000..cf36c5e
--- /dev/null
+++ b/reference_scripts/pG5OVokZzCRHIrwz.js
@@ -0,0 +1,3 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.mgeiaDZXei7JBEgo")
+let data = item.toObject();
+this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id})
\ No newline at end of file
diff --git a/reference_scripts/pHyXdPnWwoFrUA5n.js b/reference_scripts/pHyXdPnWwoFrUA5n.js
new file mode 100644
index 0000000..954e03e
--- /dev/null
+++ b/reference_scripts/pHyXdPnWwoFrUA5n.js
@@ -0,0 +1 @@
+return !args.skill?.name.includes(game.i18n.localize("NAME.Entertain"));
\ No newline at end of file
diff --git a/reference_scripts/pLKv4moua6XhNdmA.js b/reference_scripts/pLKv4moua6XhNdmA.js
new file mode 100644
index 0000000..edd666b
--- /dev/null
+++ b/reference_scripts/pLKv4moua6XhNdmA.js
@@ -0,0 +1,4 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.1dUizIgLBgn4jICC");
+let data = item.toObject();
+data.name += " (Woodlands)";
+this.actor.createEmbeddedDocuments("Item", Array(this.effect.sourceTest.result.overcast.usage.other.current).fill(data), {fromEffect : this.effect.id})
\ No newline at end of file
diff --git a/reference_scripts/pNPjXEoQGHLKzq0r.js b/reference_scripts/pNPjXEoQGHLKzq0r.js
new file mode 100644
index 0000000..26641f9
--- /dev/null
+++ b/reference_scripts/pNPjXEoQGHLKzq0r.js
@@ -0,0 +1,12 @@
+let talent = this.actor.has("Arcane Magic (Light)", "talent")
+let demon = this.actor.has(game.i18n.localize("NAME.Daemonic"))
+
+if (!talent)
+{
+ await this.actor.addCondition("blinded")
+}
+
+if (demon)
+{
+ await this.actor.addCondition("stunned")
+}
\ No newline at end of file
diff --git a/reference_scripts/pPV9oEydXb7oi6jX.js b/reference_scripts/pPV9oEydXb7oi6jX.js
new file mode 100644
index 0000000..fe3715e
--- /dev/null
+++ b/reference_scripts/pPV9oEydXb7oi6jX.js
@@ -0,0 +1,4 @@
+ if (args.totalWoundLoss > 0)
+ {
+ args.actor.addCondition('ablaze')
+ }
\ No newline at end of file
diff --git a/reference_scripts/pR4Q2OnPxXtwRVli.js b/reference_scripts/pR4Q2OnPxXtwRVli.js
new file mode 100644
index 0000000..31251d6
--- /dev/null
+++ b/reference_scripts/pR4Q2OnPxXtwRVli.js
@@ -0,0 +1,12 @@
+let criticals = this.actor.itemTypes.critical;
+
+if (criticals.length)
+{
+ this.script.scriptNotification("Cannot suffer Critical Wounds");
+ this.actor.deleteEmbeddedDocuments("Item", criticals.map(i => i.id))
+}
+
+if (getProperty(args.data, "system.status.wounds.value") == 0)
+{
+ this.script.scriptNotification(`Dormant for ${Math.ceil(CONFIG.Dice.randomUniform() * 10)} Rounds`)
+}
\ No newline at end of file
diff --git a/reference_scripts/pnB9TzSEytkxk3Rb.js b/reference_scripts/pnB9TzSEytkxk3Rb.js
new file mode 100644
index 0000000..33f3dcc
--- /dev/null
+++ b/reference_scripts/pnB9TzSEytkxk3Rb.js
@@ -0,0 +1 @@
+return this.actor.hasSystemEffect("infighting")
\ No newline at end of file
diff --git a/reference_scripts/pq1YQffxtOcqCRTn.js b/reference_scripts/pq1YQffxtOcqCRTn.js
new file mode 100644
index 0000000..b6f09a8
--- /dev/null
+++ b/reference_scripts/pq1YQffxtOcqCRTn.js
@@ -0,0 +1,6 @@
+let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {appendTitle: ` - ${this.effect.name}`})
+await test.roll();
+if (!test.succeeded)
+{
+ this.actor.addCondition("prone")
+}
\ No newline at end of file
diff --git a/reference_scripts/px7eEdhOEt7zOTrq.js b/reference_scripts/px7eEdhOEt7zOTrq.js
new file mode 100644
index 0000000..0e4b4f9
--- /dev/null
+++ b/reference_scripts/px7eEdhOEt7zOTrq.js
@@ -0,0 +1 @@
+return ["int", "t", "wp", "i"].includes(args.characteristic)
\ No newline at end of file
diff --git a/reference_scripts/pzimrxrqpv282Oqb.js b/reference_scripts/pzimrxrqpv282Oqb.js
new file mode 100644
index 0000000..6c30f0d
--- /dev/null
+++ b/reference_scripts/pzimrxrqpv282Oqb.js
@@ -0,0 +1,2 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.TaYriYcJkFuIdBKp")
+this.actor.createEmbeddedDocuments("Item", [item], {fromEffect : this.effect.id});
diff --git a/reference_scripts/pzknBcJtZWeliE27.js b/reference_scripts/pzknBcJtZWeliE27.js
new file mode 100644
index 0000000..1fcf80e
--- /dev/null
+++ b/reference_scripts/pzknBcJtZWeliE27.js
@@ -0,0 +1 @@
+return args.item?.name == game.i18n.localize("NAME.Leadership") || args.item?.name == game.i18n.localize("NAME.Cool")
\ No newline at end of file
diff --git a/reference_scripts/q0LvphC8RDSyR0oY.js b/reference_scripts/q0LvphC8RDSyR0oY.js
new file mode 100644
index 0000000..3e6ac9e
--- /dev/null
+++ b/reference_scripts/q0LvphC8RDSyR0oY.js
@@ -0,0 +1,8 @@
+let choice = await ItemDialog.create(ItemDialog.objectToArray({
+ ws : game.wfrp4e.config.characteristics.ws,
+ t : game.wfrp4e.config.characteristics.t,
+ ag : game.wfrp4e.config.characteristics.ag,
+ wp : game.wfrp4e.config.characteristics.wp
+}, this.effect.img), 1, "Choose Characteristic");
+
+this.effect.updateSource({"flags.wfrp4e.characteristic" : choice[0].id})
\ No newline at end of file
diff --git a/reference_scripts/q3nRyXaxksdCiLFM.js b/reference_scripts/q3nRyXaxksdCiLFM.js
new file mode 100644
index 0000000..49cee4f
--- /dev/null
+++ b/reference_scripts/q3nRyXaxksdCiLFM.js
@@ -0,0 +1,3 @@
+let item = await fromUuid("Compendium.wfrp4e-core.items.j6v78dnOOdCB6c3d")
+let data = item.toObject();
+this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id})
\ No newline at end of file
diff --git a/reference_scripts/qAEZgtu5CrfUkxhx.js b/reference_scripts/qAEZgtu5CrfUkxhx.js
new file mode 100644
index 0000000..c5c12b1
--- /dev/null
+++ b/reference_scripts/qAEZgtu5CrfUkxhx.js
@@ -0,0 +1,16 @@
+if (args.test.options.staunchBleeding)
+{
+ if (args.test.succeeded)
+ {
+ let staunch = Number(args.test.result.SL) + 1
+ if (args.test.options.fieldDressing && args.test.result.reversed)
+ {
+ staunch = Math.min(1, Number(args.test.result.SL)) + 1
+ }
+ args.test.result.other.push(`${this.actor.name} removed ${staunch} Bleeding conditions from the patient.`)
+ }
+ else if (this.actor.characteristics.int.bonus + Number(args.test.result.SL) < 0)
+ {
+ args.test.result.other.push(`The patient contracts a @UUID[Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg]{Minor Infection}.`)
+ }
+}
\ No newline at end of file
diff --git a/reference_scripts/qK4q4o6cQhcGzFX3.js b/reference_scripts/qK4q4o6cQhcGzFX3.js
new file mode 100644
index 0000000..e7c6e3b
--- /dev/null
+++ b/reference_scripts/qK4q4o6cQhcGzFX3.js
@@ -0,0 +1,7 @@
+let fear = await fromUuid("Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn")
+let leader = await fromUuid("Compendium.wfrp4e-core.items.Item.vCgEAetBMngR53aT")
+let fearData = fear.toObject();
+let leaderData = leader.toObject();
+fearData.system.specification.value = this.effect.sourceTest.result.overcast.usage.other.current;
+talents = new Array(1 + this.effect.sourceTest.result.overcast.available).fill(leaderData); // Assume any unused overcast is for war leader
+this.actor.createEmbeddedDocuments("Item", [fearData].concat(talents), {fromEffect : this.effect.id})
\ No newline at end of file
diff --git a/reference_scripts/qSwCYMMiIHmSV1X5.js b/reference_scripts/qSwCYMMiIHmSV1X5.js
new file mode 100644
index 0000000..1379278
--- /dev/null
+++ b/reference_scripts/qSwCYMMiIHmSV1X5.js
@@ -0,0 +1,13 @@
+if (this.item.system.quantity.value)
+{
+ this.item.system.reduceQuantity();
+ let actor = Array.from(game.user.targets)[0]?.actor || this.actor;
+ let effectData = this.item.effects.contents[0].convertToApplied();
+ effectData.flags.wfrp4e.sourceItem = this.item.uuid
+ effectData.duration.seconds = 10800
+ actor.applyEffect({effectData : [effectData]})
+}
+else
+{
+ this.script.scriptNotification("None left!", "error")
+}
\ No newline at end of file
diff --git a/reference_scripts/qT0WBPxLMMO9gvCd.js b/reference_scripts/qT0WBPxLMMO9gvCd.js
new file mode 100644
index 0000000..fd89c3b
--- /dev/null
+++ b/reference_scripts/qT0WBPxLMMO9gvCd.js
@@ -0,0 +1,4 @@
+if (!this.actor.has("Night Vision") && !this.actor.has("Night Vision", "talent") && !this.actor.hasCondition("blinded"))
+{
+ this.actor.addCondition("blinded", 1, {"flags.wfrp4e.nightshroud" : true})
+}
\ No newline at end of file
diff --git a/reference_scripts/qUwnVlWpsmDom3RK.js b/reference_scripts/qUwnVlWpsmDom3RK.js
new file mode 100644
index 0000000..e82109e
--- /dev/null
+++ b/reference_scripts/qUwnVlWpsmDom3RK.js
@@ -0,0 +1 @@
+args.fields.modifier -= 5;
\ No newline at end of file
diff --git a/reference_scripts/qZschZU0nee0kJlk.js b/reference_scripts/qZschZU0nee0kJlk.js
new file mode 100644
index 0000000..0064f3f
--- /dev/null
+++ b/reference_scripts/qZschZU0nee0kJlk.js
@@ -0,0 +1 @@
+args.fields.modifier -= 30;
\ No newline at end of file
diff --git a/reference_scripts/qaVde0sTuMBRi2nl.js b/reference_scripts/qaVde0sTuMBRi2nl.js
new file mode 100644
index 0000000..2bd32fd
--- /dev/null
+++ b/reference_scripts/qaVde0sTuMBRi2nl.js
@@ -0,0 +1 @@
+return ["NAME.Evaluate", "NAME.Gamble"].map(i => game.i18n.localize(i)).includes(args.skill?.name)
\ No newline at end of file
diff --git a/reference_scripts/qcyl98GYD55BkJsD.js b/reference_scripts/qcyl98GYD55BkJsD.js
new file mode 100644
index 0000000..510b62f
--- /dev/null
+++ b/reference_scripts/qcyl98GYD55BkJsD.js
@@ -0,0 +1,2 @@
+this.actor.status.encumbrance.state = 0;
+this.actor.status.encumbrance.pct = 0;
\ No newline at end of file
diff --git a/reference_scripts/qijgjcOBCDmhglRX.js b/reference_scripts/qijgjcOBCDmhglRX.js
new file mode 100644
index 0000000..49dfaeb
--- /dev/null
+++ b/reference_scripts/qijgjcOBCDmhglRX.js
@@ -0,0 +1 @@
+return args.skill?.name == game.i18n.localize("NAME.SleightOfHand");
\ No newline at end of file
diff --git a/reference_scripts/qjli5evn8UA9uTeZ.js b/reference_scripts/qjli5evn8UA9uTeZ.js
new file mode 100644
index 0000000..4f6fabe
--- /dev/null
+++ b/reference_scripts/qjli5evn8UA9uTeZ.js
@@ -0,0 +1 @@
+return args.actor.uuid == this.effect.sourceActor.uuid;
\ No newline at end of file
diff --git a/reference_scripts/qmOt7h17hGAKqQe0.js b/reference_scripts/qmOt7h17hGAKqQe0.js
new file mode 100644
index 0000000..cd2dd07
--- /dev/null
+++ b/reference_scripts/qmOt7h17hGAKqQe0.js
@@ -0,0 +1,24 @@
+
+let choice = await Dialog.wait({
+ title: this.effect.name,
+ content: `
${this.effect.name}: Is this a ranged or magical attack that orignates outside the Dome?
`, + buttons: { + yes: { + label: "Yes", + callback: () => { + return true; + } + }, + no: { + label: "No", + callback: () => { + return false; + } + } + } +}) + +if (choice) +{ + args.ward = 6; +} \ No newline at end of file diff --git a/reference_scripts/qu194dVXm9Vx1TGk.js b/reference_scripts/qu194dVXm9Vx1TGk.js new file mode 100644 index 0000000..c99393f --- /dev/null +++ b/reference_scripts/qu194dVXm9Vx1TGk.js @@ -0,0 +1,10 @@ +if (args.test.options.useOnesSupportive && (args.test.result.roll <= game.settings.get("wfrp4e", "automaticSuccess") || args.test.result.roll <= args.test.target)) +{ + +let SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10) +let ones = Number(args.test.result.roll.toString().split("").pop()) + +if (ones > SL) + args.test.data.result.SL = "+" + (ones + args.test.successBonus + args.test.slBonus) + args.test.result.other.push(`${this.effect.name}: Used unit dice as SL`) +} \ No newline at end of file diff --git a/reference_scripts/quPcuKsq2fcild4a.js b/reference_scripts/quPcuKsq2fcild4a.js new file mode 100644 index 0000000..3ebda0b --- /dev/null +++ b/reference_scripts/quPcuKsq2fcild4a.js @@ -0,0 +1,6 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: "easy"}, context: {failure : `${this.effect.name}: Vomit!`} }) +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("prone") +} \ No newline at end of file diff --git a/reference_scripts/qxzhPtysAjPWspKf.js b/reference_scripts/qxzhPtysAjPWspKf.js new file mode 100644 index 0000000..934561e --- /dev/null +++ b/reference_scripts/qxzhPtysAjPWspKf.js @@ -0,0 +1,4 @@ +if (this.actor.has("Undead") || this.actor.has("Daemonic")) +{ + this.script.scriptNotification(`Cannot enter ${this.effect.name}!`); +} \ No newline at end of file diff --git a/reference_scripts/r6hi5vMdLhTaaPfb.js b/reference_scripts/r6hi5vMdLhTaaPfb.js new file mode 100644 index 0000000..c37780d --- /dev/null +++ b/reference_scripts/r6hi5vMdLhTaaPfb.js @@ -0,0 +1 @@ +args.actor.details.move.value += this.effect.sourceTest.result.overcast.usage.other.current \ No newline at end of file diff --git a/reference_scripts/rCh3ltUrUMovd2Kc.js b/reference_scripts/rCh3ltUrUMovd2Kc.js new file mode 100644 index 0000000..4b1b1b1 --- /dev/null +++ b/reference_scripts/rCh3ltUrUMovd2Kc.js @@ -0,0 +1,5 @@ +if (this.actor.hasCondition("surprised")) +{ + this.script.scriptNotification("Cannot be surprised"); + this.actor.removeCondition("surprised"); +} \ No newline at end of file diff --git a/reference_scripts/rF0Z3hTUUnSxL3Mq.js b/reference_scripts/rF0Z3hTUUnSxL3Mq.js new file mode 100644 index 0000000..93d9ab0 --- /dev/null +++ b/reference_scripts/rF0Z3hTUUnSxL3Mq.js @@ -0,0 +1,37 @@ +let armour = (await fromUuid("Compendium.wfrp4e-core.items.VUJUZVN3VYhOaPjj")).toObject() +let bite = (await fromUuid("Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv")).toObject() +let fear = (await fromUuid("Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn")).toObject() +let nightVision = (await fromUuid("Compendium.wfrp4e-core.items.FmHDbCOy3pH8yKhm")).toObject() +let tracker = (await fromUuid("Compendium.wfrp4e-core.items.ClOlztW6hH8rslbp")).toObject() +let weapon = (await fromUuid("Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM")).toObject() + +armour.name = "Armour (Hide)" +armour.system.specification.value = 2 +bite.system.specification.value = 3 +fear.system.specification.value = 2 +weapon.system.specification.value = 4 +let items = [armour, bite, fear, nightVision, tracker, weapon] + + +let belligerent = (await fromUuid("Compendium.wfrp4e-core.items.GbDyBCu8ZjDp6dkj")).toObject()//{Belligerent} +let bestial = (await fromUuid("Compendium.wfrp4e-core.items.AGcJl5rHjkyIQBPP")).toObject()//{Bestial} +let big = (await fromUuid("Compendium.wfrp4e-core.items.a8MC97PLzl10WocT")).toObject()//{Big} +let blessed = (await fromUuid("Compendium.wfrp4e-core.items.5muSFXd6oc760uVj")).toObject()//{Blessed (Ulric)} +let champion = (await fromUuid("Compendium.wfrp4e-core.items.4mF5Sp3t09kZhBYc")).toObject()//{Champion} +let die = (await fromUuid("Compendium.wfrp4e-core.items.UsJ2uIOOtHA7JqD5")).toObject()//{Die Hard} +let fast = (await fromUuid("Compendium.wfrp4e-core.items.9MjH4xyVrd3Inzak")).toObject()//{Fast} +let frenzy = (await fromUuid("Compendium.wfrp4e-core.items.yRhhOlt18COq4e1q")).toObject()//{Frenzy} +let immunity = (await fromUuid("Compendium.wfrp4e-core.items.IAWyzDfC286a9MPz")).toObject()//{Immunity to Psychology} +let regenerate = (await fromUuid("Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR")).toObject()//{Regenerate} +let size = (await fromUuid("Compendium.wfrp4e-core.items.8slW8CJ2oVTxeQ6q")).toObject()//{Size (Large)} + +blessed.system.specification.value = "Ulric" +size.system.specification.value = "Large" + +let optional = [belligerent, bestial, big, blessed, champion, die, fast, frenzy, immunity, regenerate, size]; + +let chosen = await ItemDialog.create(optional, "unlimited", "Choose Optional Traits"); + +items = items.concat(chosen || []) +this.script.scriptNotification(`Adding ${items.map(i => i.name).join(", ")}`); +this.actor.createEmbeddedDocuments("Item", items, {fromEffect : this.effect.id}) diff --git a/reference_scripts/rIISfbCShejmJNKw.js b/reference_scripts/rIISfbCShejmJNKw.js new file mode 100644 index 0000000..d2d5e54 --- /dev/null +++ b/reference_scripts/rIISfbCShejmJNKw.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.oRx92ByVNEBN6YkK") +let data = item.toObject() +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) diff --git a/reference_scripts/rLMaVNEGdZ6xj5Au.js b/reference_scripts/rLMaVNEGdZ6xj5Au.js new file mode 100644 index 0000000..bf2dfbe --- /dev/null +++ b/reference_scripts/rLMaVNEGdZ6xj5Au.js @@ -0,0 +1 @@ +return !["i", "int", "fel"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/rRfff55c7elyvbCb.js b/reference_scripts/rRfff55c7elyvbCb.js new file mode 100644 index 0000000..9756192 --- /dev/null +++ b/reference_scripts/rRfff55c7elyvbCb.js @@ -0,0 +1 @@ +return this.actor.flags.useless[this.item.system.location.key] && args.weapon?.system.usesHands.includes(this.item.system.location.key[0] + "Arm") \ No newline at end of file diff --git a/reference_scripts/rUGSx06BuBvX9kgf.js b/reference_scripts/rUGSx06BuBvX9kgf.js new file mode 100644 index 0000000..8c3a76f --- /dev/null +++ b/reference_scripts/rUGSx06BuBvX9kgf.js @@ -0,0 +1,9 @@ +if (args.test.result.charging) +{ + args.test.result.damage += 1 + args.test.result.additionalDamage += 1 + if (!args.test.result.resolute) { + args.test.result.breakdown.damage.other.push({label : this.effect.name, value : this.item.Advances}); + args.test.result.resolute = true // Prevent duplicate messages + } +} diff --git a/reference_scripts/rVpPNILEzWL9lj6b.js b/reference_scripts/rVpPNILEzWL9lj6b.js new file mode 100644 index 0000000..6007696 --- /dev/null +++ b/reference_scripts/rVpPNILEzWL9lj6b.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.kJNAY1YRaCy9IgmT") +let terrorTraitItem = item.toObject() +terrorTraitItem.system.specification.value = Number(this.effect.item.system.specification.value) +this.actor.createEmbeddedDocuments("Item", [terrorTraitItem]); \ No newline at end of file diff --git a/reference_scripts/rXMylpnEtZpwou6x.js b/reference_scripts/rXMylpnEtZpwou6x.js new file mode 100644 index 0000000..d0c2d7f --- /dev/null +++ b/reference_scripts/rXMylpnEtZpwou6x.js @@ -0,0 +1,8 @@ +this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty : "average"}}).then(async test => +{ + await test.roll() + if (test.failed) + { + this.actor.addCondition("fatigued") + } +}) \ No newline at end of file diff --git a/reference_scripts/ramav4ymrDDkPKK4.js b/reference_scripts/ramav4ymrDDkPKK4.js new file mode 100644 index 0000000..639558d --- /dev/null +++ b/reference_scripts/ramav4ymrDDkPKK4.js @@ -0,0 +1,9 @@ +if (this.actor.hasCondition("bleeding")) +{ + this.actor.removeCondition("bleeding"); + this.script.scriptNotification("Removed 1 Bleeding Condition") +} +else +{ + this.script.scriptNotification("No Bleeding Conditions"); +} \ No newline at end of file diff --git a/reference_scripts/ratP9ByLjQPiLlFK.js b/reference_scripts/ratP9ByLjQPiLlFK.js new file mode 100644 index 0000000..5e33cd1 --- /dev/null +++ b/reference_scripts/ratP9ByLjQPiLlFK.js @@ -0,0 +1 @@ +args.data.canReverse = true \ No newline at end of file diff --git a/reference_scripts/rdaMhMyHrJjQ6vVC.js b/reference_scripts/rdaMhMyHrJjQ6vVC.js new file mode 100644 index 0000000..f5d1678 --- /dev/null +++ b/reference_scripts/rdaMhMyHrJjQ6vVC.js @@ -0,0 +1 @@ +game.wfrp4e.utility.postFear(this.item.Advances, this.actor.name) \ No newline at end of file diff --git a/reference_scripts/re1UFtxvRRjpPB7Z.js b/reference_scripts/re1UFtxvRRjpPB7Z.js new file mode 100644 index 0000000..332391e --- /dev/null +++ b/reference_scripts/re1UFtxvRRjpPB7Z.js @@ -0,0 +1,13 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.nF5z1OEhpi4t6a6S"); +let data = item.toObject(); +data.system.location.key = this.item.system.location.key +if (data.system.location.key[0] == "r") +{ + data.system.location.value = "Right Ankle" +} +else if (data.system.location.key[0] == "l") +{ + data.system.location.value = "Left Ankle" +} + +this.actor.createEmbeddedDocuments("Item", [data], {skipLocationValue : true, fromEffect: this.effect.id}) diff --git a/reference_scripts/red2bt4PGgIWAdTR.js b/reference_scripts/red2bt4PGgIWAdTR.js new file mode 100644 index 0000000..c4ba998 --- /dev/null +++ b/reference_scripts/red2bt4PGgIWAdTR.js @@ -0,0 +1,14 @@ +if (this.item.system.quantity.value) +{ + this.item.system.reduceQuantity(); + let actor = Array.from(game.user.targets)[0]?.actor || this.actor; + let effectData = this.item.effects.contents[0].convertToApplied(); + let minutes = Math.ceil(CONFIG.Dice.randomUniform() * 10) * 10; + effectData.duration.seconds = 60 * minutes + this.script.scriptMessage(`Duration: ${minutes} minutes`, {whisper : ChatMessage.getWhisperRecipients("GM")}) + actor.applyEffect({effectData : [effectData]}) +} +else +{ + this.script.scriptNotification("None left!", "error") +} \ No newline at end of file diff --git a/reference_scripts/rgSwSeB3shIMVMb6.js b/reference_scripts/rgSwSeB3shIMVMb6.js new file mode 100644 index 0000000..2532014 --- /dev/null +++ b/reference_scripts/rgSwSeB3shIMVMb6.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.x0WMGwuQzReXcQrs") +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}); \ No newline at end of file diff --git a/reference_scripts/rnioLwiJP7ps5Jwy.js b/reference_scripts/rnioLwiJP7ps5Jwy.js new file mode 100644 index 0000000..7163d7f --- /dev/null +++ b/reference_scripts/rnioLwiJP7ps5Jwy.js @@ -0,0 +1,4 @@ +if (args.item.type == "skill" && args.item.name == "Melee (Basic)") +{ + args.item.system.modifier.value += 30; +} \ No newline at end of file diff --git a/reference_scripts/roKvPHDSpX4IV11C.js b/reference_scripts/roKvPHDSpX4IV11C.js new file mode 100644 index 0000000..2210782 --- /dev/null +++ b/reference_scripts/roKvPHDSpX4IV11C.js @@ -0,0 +1 @@ +return !args.skill?.name.includes(game.i18n.localize("NAME.Perform")) && args.characteristic != "ag" \ No newline at end of file diff --git a/reference_scripts/rpxQU26BU7nwjtqY.js b/reference_scripts/rpxQU26BU7nwjtqY.js new file mode 100644 index 0000000..85e811c --- /dev/null +++ b/reference_scripts/rpxQU26BU7nwjtqY.js @@ -0,0 +1,20 @@ +let location = this.item.system.location.key +let test = await this.actor.setupCharacteristic("dex", {context : {failure : `${this.effect.name}: Drop the item!`}, skipTargets: true, appendTitle : " - " + this.effect.name, fields : {difficulty : "average"}}) +await test.roll(); + + +if (location && test.failed) +{ + let dropped = this.item.system.weaponsAtLocation; + + if (dropped.length) + { + this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(", ")}!`) + for(let weapon of dropped) + { + await weapon.system.toggleEquip(); + } + } +} + +return test.succeeded \ No newline at end of file diff --git a/reference_scripts/rr4htuVq45onXdRG.js b/reference_scripts/rr4htuVq45onXdRG.js new file mode 100644 index 0000000..e494852 --- /dev/null +++ b/reference_scripts/rr4htuVq45onXdRG.js @@ -0,0 +1,2 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {appendTitle: ` - ${this.effect.name}`, fields : {difficulty : "average"}}) +test.roll(); \ No newline at end of file diff --git a/reference_scripts/rxB1AqfVMDqTRieE.js b/reference_scripts/rxB1AqfVMDqTRieE.js new file mode 100644 index 0000000..132e672 --- /dev/null +++ b/reference_scripts/rxB1AqfVMDqTRieE.js @@ -0,0 +1 @@ +return !["ws", "bs", "ag"].includes(args.characteristic) && args.skill?.name != game.i18n.localize("NAME.Perception") \ No newline at end of file diff --git a/reference_scripts/s0kTuDE0qv68V2KI.js b/reference_scripts/s0kTuDE0qv68V2KI.js new file mode 100644 index 0000000..3f54ebc --- /dev/null +++ b/reference_scripts/s0kTuDE0qv68V2KI.js @@ -0,0 +1 @@ + this.actor.getActiveTokens().forEach(t => t.document.update({texture : {tint : "#FFBF00"}})); diff --git a/reference_scripts/s5bO0Sf0qpS27Tve.js b/reference_scripts/s5bO0Sf0qpS27Tve.js new file mode 100644 index 0000000..81a8160 --- /dev/null +++ b/reference_scripts/s5bO0Sf0qpS27Tve.js @@ -0,0 +1,2 @@ +await args.actor.addCondition("ablaze", 3) +await args.actor.addCondition("prone"); \ No newline at end of file diff --git a/reference_scripts/s6eZXfZkC1My6EXl.js b/reference_scripts/s6eZXfZkC1My6EXl.js new file mode 100644 index 0000000..79d1abc --- /dev/null +++ b/reference_scripts/s6eZXfZkC1My6EXl.js @@ -0,0 +1,5 @@ +let lore = this.effect.name.split(" ")[2].toLowerCase(); +if (args.item.type == "spell" && args.item.system.lore.value == lore) +{ + args.item.system.cn.value -= 1 +} diff --git a/reference_scripts/s7gJQdzuM3fz2zQK.js b/reference_scripts/s7gJQdzuM3fz2zQK.js new file mode 100644 index 0000000..86e431a --- /dev/null +++ b/reference_scripts/s7gJQdzuM3fz2zQK.js @@ -0,0 +1,11 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.QluSTTTq3viHJJUh") +let data = item.toObject(); +data.system.location.value = "Hip" +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id}) + +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("prone") +} \ No newline at end of file diff --git a/reference_scripts/s8idWt9YdMTRfnjV.js b/reference_scripts/s8idWt9YdMTRfnjV.js new file mode 100644 index 0000000..ffe18b2 --- /dev/null +++ b/reference_scripts/s8idWt9YdMTRfnjV.js @@ -0,0 +1,5 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW") +let data = item.toObject(); +data.system.specification.value = 4 - this.actor.characteristics.s.bonus +data.name = item.name.replace("(Feature)", ""); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/s8xU6OOZbbfo6VIw.js b/reference_scripts/s8xU6OOZbbfo6VIw.js new file mode 100644 index 0000000..4574772 --- /dev/null +++ b/reference_scripts/s8xU6OOZbbfo6VIw.js @@ -0,0 +1 @@ +args.fields.slBonus += this.actor.system.characteristics.ag.bonus diff --git a/reference_scripts/s94yKZ4o5XN4JWM1.js b/reference_scripts/s94yKZ4o5XN4JWM1.js new file mode 100644 index 0000000..28925d7 --- /dev/null +++ b/reference_scripts/s94yKZ4o5XN4JWM1.js @@ -0,0 +1,6 @@ +// Any attack with such ammunition which inflicts at least one Wound, +// also inflicts one Bleeding Condition. + +if (args.totalWoundLoss > 0) { + args.actor.addCondition("bleeding") +} diff --git a/reference_scripts/sAVpm7hFRHpbCLXm.js b/reference_scripts/sAVpm7hFRHpbCLXm.js new file mode 100644 index 0000000..88f9ad9 --- /dev/null +++ b/reference_scripts/sAVpm7hFRHpbCLXm.js @@ -0,0 +1 @@ +return ["ws", "bs", "s", "t", "ag", "i"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/sB4KB9bT3nQhAoqG.js b/reference_scripts/sB4KB9bT3nQhAoqG.js new file mode 100644 index 0000000..4401b71 --- /dev/null +++ b/reference_scripts/sB4KB9bT3nQhAoqG.js @@ -0,0 +1,14 @@ +// This script needs to be separate because equipTransfer is off on the other effect, and thus won't execute when added to an actor + +let mainEffect = this.item.effects.contents[0]; +if (mainEffect.name.includes("By imbibing this potion, ${this.actor.prototypeToken.name} has becomes subject to Frenzy. This Frenzy lasts [[1d10]] Rounds, and may not be ended sooner.
`, + {whisper: ChatMessage.getWhisperRecipients("GM"), blind: true }) \ No newline at end of file diff --git a/reference_scripts/sYlGRLApZ3Ub24ea.js b/reference_scripts/sYlGRLApZ3Ub24ea.js new file mode 100644 index 0000000..ee66235 --- /dev/null +++ b/reference_scripts/sYlGRLApZ3Ub24ea.js @@ -0,0 +1 @@ +this.actor.system.status.addArmour(3, {source: this.effect.name, magical: true}) \ No newline at end of file diff --git a/reference_scripts/sZwLitzwKBTaFca3.js b/reference_scripts/sZwLitzwKBTaFca3.js new file mode 100644 index 0000000..4d00d6e --- /dev/null +++ b/reference_scripts/sZwLitzwKBTaFca3.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.Item.5hH73j2NgPdsLCZN") +let data = item.toObject(); +data.name = data.name.replace("Target", "Greenskins, Undead, Chaos") +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/sagKJM6oDFlw4ED2.js b/reference_scripts/sagKJM6oDFlw4ED2.js new file mode 100644 index 0000000..4392e3b --- /dev/null +++ b/reference_scripts/sagKJM6oDFlw4ED2.js @@ -0,0 +1,3 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}); +await test.roll(); +return test.failed; \ No newline at end of file diff --git a/reference_scripts/sbK1a7txpSoXFzyB.js b/reference_scripts/sbK1a7txpSoXFzyB.js new file mode 100644 index 0000000..079b4dc --- /dev/null +++ b/reference_scripts/sbK1a7txpSoXFzyB.js @@ -0,0 +1,10 @@ +if (args.test.options.useOnesArgumentative && (args.test.result.roll <= game.settings.get("wfrp4e", "automaticSuccess") || args.test.result.roll <= args.test.target)) +{ + +let SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10) +let ones = Number(args.test.result.roll.toString().split("").pop()) + +if (ones > SL) + args.test.data.result.SL = "+" + (ones + args.test.successBonus + args.test.slBonus) + args.test.result.other.push(`${this.effect.name}: Used unit dice as SL`) +} \ No newline at end of file diff --git a/reference_scripts/scfm5iWWBxWI6QaK.js b/reference_scripts/scfm5iWWBxWI6QaK.js new file mode 100644 index 0000000..117c336 --- /dev/null +++ b/reference_scripts/scfm5iWWBxWI6QaK.js @@ -0,0 +1,6 @@ +let darkvision = await fromUuid("Compendium.wfrp4e-core.items.Item.JQa5DLnTs2SEzRrc") +let fear = await fromUuid("Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn") +let acutesense = await fromUuid("Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS") +fear = fear.toObject(); +fear.system.specification.value = 1; +this.actor.createEmbeddedDocuments("Item", [darkvision, fear, acutesense], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/sgS9rblPkQB36C8S.js b/reference_scripts/sgS9rblPkQB36C8S.js new file mode 100644 index 0000000..49348b1 --- /dev/null +++ b/reference_scripts/sgS9rblPkQB36C8S.js @@ -0,0 +1,29 @@ +if (this.item.name.includes("(")) +{ + let trade = this.item.parenthesesText; + if (trade?.toLowerCase() != "any") + return this.item.updateSource({"system.tests.value" : this.item.system.tests.value.replace("any one", trade)}) +} + +let index = game.packs +.filter(i => i.metadata.type == "Item") +.reduce((acc, pack) => acc.concat(pack.index.contents), []) +.filter(i => i.type == "skill" && i.name.includes(game.i18n.localize("NAME.Trade"))) +.map(i => { + i.id = i._id + return i +}) + +let choice = await ItemDialog.create(index, 1, "Choose a Trade Skill") +let text; +if (!choice[0]) +{ + let custom = await ValueDialog.create("Enter Custom Trade Skill", "Custom Trade"); + text = custom || "" +} +else +{ + text = game.wfrp4e.utility.extractParenthesesText(choice[0].name) +} + +await this.item.updateSource({name : this.item.name.replace("(Any)", "").replace("(any)", "").trim() + ` (${text})`, "system.tests.value" : this.item.system.tests.value.replace("any one", text)}); \ No newline at end of file diff --git a/reference_scripts/shkBUtUuMPDKvFm7.js b/reference_scripts/shkBUtUuMPDKvFm7.js new file mode 100644 index 0000000..641a6b6 --- /dev/null +++ b/reference_scripts/shkBUtUuMPDKvFm7.js @@ -0,0 +1,10 @@ +let test = await this.actor.setupSkill("Dodge", {fields : {difficulty : "average"}}) +let caster = this.effect.sourceActor + +let fallen = this.effect.sourceTest.result.SL + caster.characteristics.wp.bonus +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("prone") + this.script.scriptMessage(`${this.actor.prototypeToken.name} falls ${fallen} yards`) +} \ No newline at end of file diff --git a/reference_scripts/skVq3eDEYKFF2iZp.js b/reference_scripts/skVq3eDEYKFF2iZp.js new file mode 100644 index 0000000..312dc79 --- /dev/null +++ b/reference_scripts/skVq3eDEYKFF2iZp.js @@ -0,0 +1,2 @@ +// I'm assuming the endurance test specified is for the end-round check +await this.actor.addCondition("poisoned", 4); diff --git a/reference_scripts/sm9d5lk6cM0OuUkf.js b/reference_scripts/sm9d5lk6cM0OuUkf.js new file mode 100644 index 0000000..97c8f33 --- /dev/null +++ b/reference_scripts/sm9d5lk6cM0OuUkf.js @@ -0,0 +1 @@ +this.actor.applyFear(Math.min(4, this.effect.sourceTest.result.overcast.usage.other.current)) \ No newline at end of file diff --git a/reference_scripts/sx7Ikn8WW00gBFb4.js b/reference_scripts/sx7Ikn8WW00gBFb4.js new file mode 100644 index 0000000..d413850 --- /dev/null +++ b/reference_scripts/sx7Ikn8WW00gBFb4.js @@ -0,0 +1,32 @@ +let location = (Math.ceil(CONFIG.Dice.randomUniform() * 2) == 2 ? "r" : "l") + "Arm" + +if (location == "lArm") +{ + this.script.scriptNotification("Rolled Left") +} +else if (location == "rArm") +{ + this.script.scriptNotification("Rolled Right") +} + +this.effect.updateSource({"flags.wfrp4e.location" : location}); + +if (location) +{ + let dropped = this.actor.itemTypes.weapon.filter(i => i.isEquipped & i.system.usesHands.includes(location)); + + if (dropped.length) + { + this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(", ")}!`) + for(let weapon of dropped) + { + await weapon.system.toggleEquip(); + } + } +} + +let roll = await new Roll("1d10").roll() + +roll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Duration)`})); + +this.effect.updateSource({"duration.rounds" : roll.total}) \ No newline at end of file diff --git a/reference_scripts/syBgPp7rOymCZejX.js b/reference_scripts/syBgPp7rOymCZejX.js new file mode 100644 index 0000000..3007947 --- /dev/null +++ b/reference_scripts/syBgPp7rOymCZejX.js @@ -0,0 +1,6 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("stunned") +} \ No newline at end of file diff --git a/reference_scripts/syqqBkyP5tGqZ78t.js b/reference_scripts/syqqBkyP5tGqZ78t.js new file mode 100644 index 0000000..265c5fd --- /dev/null +++ b/reference_scripts/syqqBkyP5tGqZ78t.js @@ -0,0 +1,8 @@ +this.actor.has("Immunity to Psychology")?.delete(); + +let roll = await new Roll("1d10").roll(); + +roll.toMessage(this.script.getChatData()); + +this.script.scriptNotification(`Removed Immunity to Psychology, Adding ${roll.total} Broken Conditions`) +this.actor.addCondition("broken", roll.total, {"flags.wfrp4e.blasted-mind" : true}) \ No newline at end of file diff --git a/reference_scripts/t48hkacYdOpzWvK9.js b/reference_scripts/t48hkacYdOpzWvK9.js new file mode 100644 index 0000000..6e8c53a --- /dev/null +++ b/reference_scripts/t48hkacYdOpzWvK9.js @@ -0,0 +1 @@ +args.options.beatBlade = true; \ No newline at end of file diff --git a/reference_scripts/t56mnblo1kv3gM1M.js b/reference_scripts/t56mnblo1kv3gM1M.js new file mode 100644 index 0000000..ce5fba9 --- /dev/null +++ b/reference_scripts/t56mnblo1kv3gM1M.js @@ -0,0 +1 @@ +return args.skill?.name.includes("Melee (Basic)") || (args.type == "weapon" && args.item?.system.weaponGroup.value == "basic"); \ No newline at end of file diff --git a/reference_scripts/t8LYOuN5peEdWeXP.js b/reference_scripts/t8LYOuN5peEdWeXP.js new file mode 100644 index 0000000..4aeed96 --- /dev/null +++ b/reference_scripts/t8LYOuN5peEdWeXP.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.mNoCuaVbFBflfO6X") +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/tCIT1a12Gt6k2ohA.js b/reference_scripts/tCIT1a12Gt6k2ohA.js new file mode 100644 index 0000000..e054b71 --- /dev/null +++ b/reference_scripts/tCIT1a12Gt6k2ohA.js @@ -0,0 +1,21 @@ +let resistance +if (this.item.name.includes("(")) +{ + resistance = this.item.parenthesesText +} +else +{ + resistance = await ValueDialog.create("Enter Resistance", "Resistance") + + if (resistance) + { + this.item.updateSource({name : this.item.name + ` (${resistance})`}) + this.effect.updateSource({name : this.effect.name + ` (${resistance})`}) + } +} +this.item.updateSource({"system.tests.value" : this.item.system.tests.value.replace("the associated Threat", resistance)}) + +if (resistance && !this.effect.name.includes("(")) +{ + this.effect.updateSource({name : this.effect.name += ` (${resistance})`}) +} \ No newline at end of file diff --git a/reference_scripts/tDrs0aNIYmZPsOoS.js b/reference_scripts/tDrs0aNIYmZPsOoS.js new file mode 100644 index 0000000..51bdf06 --- /dev/null +++ b/reference_scripts/tDrs0aNIYmZPsOoS.js @@ -0,0 +1,6 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}); +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("prone") +} diff --git a/reference_scripts/tFAKRRRfTjQfdQz3.js b/reference_scripts/tFAKRRRfTjQfdQz3.js new file mode 100644 index 0000000..566dcbb --- /dev/null +++ b/reference_scripts/tFAKRRRfTjQfdQz3.js @@ -0,0 +1 @@ +this.actor.getActiveTokens().forEach(t => t.document.update({"texture.tint" : ""})); \ No newline at end of file diff --git a/reference_scripts/tG1qGqzBLmAR3WHm.js b/reference_scripts/tG1qGqzBLmAR3WHm.js new file mode 100644 index 0000000..64fa199 --- /dev/null +++ b/reference_scripts/tG1qGqzBLmAR3WHm.js @@ -0,0 +1,15 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); +if (test.failed) +{ + let add = 0 + + if (test.result.roll % 11 == 0 || test.result.roll == 100) + { + add = 1 // can't use isFumble if no hit location + } + + await this.actor.addCondition("stunned", Math.max(1, Math.abs(test.result.SL)) + add) + await this.actor.addCondition("blinded", Math.max(1, Math.abs(test.result.SL))) + +} \ No newline at end of file diff --git a/reference_scripts/tGVEV6TLl310mFLP.js b/reference_scripts/tGVEV6TLl310mFLP.js new file mode 100644 index 0000000..686b84a --- /dev/null +++ b/reference_scripts/tGVEV6TLl310mFLP.js @@ -0,0 +1,7 @@ +let nonmagical = args.modifiers.ap.value - args.modifiers.ap.magical +if (args.applyAP && nonmagical) +{ + let nonmagical = args.modifiers.ap.value - args.modifiers.ap.magical + args.modifiers.ap.ignored += nonmagical + args.modifiers.ap.details.push("" + this.effect.name + ": Ignore Non-Magical AP (" + nonmagical + ")"); +} \ No newline at end of file diff --git a/reference_scripts/tKBq1nGZo8t6vvQ6.js b/reference_scripts/tKBq1nGZo8t6vvQ6.js new file mode 100644 index 0000000..acbf367 --- /dev/null +++ b/reference_scripts/tKBq1nGZo8t6vvQ6.js @@ -0,0 +1,2 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.5hH73j2NgPdsLCZN"); +this.actor.createEmbeddedDocuments("Item", [item.toObject()], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/tNTO1LVN7JqHf4YN.js b/reference_scripts/tNTO1LVN7JqHf4YN.js new file mode 100644 index 0000000..f35b126 --- /dev/null +++ b/reference_scripts/tNTO1LVN7JqHf4YN.js @@ -0,0 +1,8 @@ +if (args.test.characteristicKey == "wp") +{ + if (args.test.failed) + { + this.actor.createEmbeddedDocuments("ActiveEffect", [game.wfrp4e.config.symptomEffects["malaise"]]) + this.script.scriptMessage(`Willpower Test failed, ${this.actor.prototypeToken.name} gains @Condition[Malaise] for [[1d10]] hours`, {whisper: ChatMessage.getWhisperRecipients("GM")}) + } +} \ No newline at end of file diff --git a/reference_scripts/tUwP7TjrOOOnaCYJ.js b/reference_scripts/tUwP7TjrOOOnaCYJ.js new file mode 100644 index 0000000..c502cf0 --- /dev/null +++ b/reference_scripts/tUwP7TjrOOOnaCYJ.js @@ -0,0 +1,10 @@ +let fatigued = this.actor.hasCondition("fatigued") +if (fatigued) +{ + this.script.scriptNotification(`Cleared ${fatigued.conditionValue} Fatigued Conditions`) + fatigued.delete(); +} +else +{ + this.script.scriptNotification(`No Fatigued Conditions`) +} \ No newline at end of file diff --git a/reference_scripts/tcZug8ehU6lyYBd9.js b/reference_scripts/tcZug8ehU6lyYBd9.js new file mode 100644 index 0000000..3ac13c4 --- /dev/null +++ b/reference_scripts/tcZug8ehU6lyYBd9.js @@ -0,0 +1 @@ +return args.skill?.name != "Ranged (Blackpowder)" \ No newline at end of file diff --git a/reference_scripts/tdICiJ26rJrDbxT6.js b/reference_scripts/tdICiJ26rJrDbxT6.js new file mode 100644 index 0000000..233b805 --- /dev/null +++ b/reference_scripts/tdICiJ26rJrDbxT6.js @@ -0,0 +1 @@ +return args.characteristic != "i" \ No newline at end of file diff --git a/reference_scripts/tn6SwmjAuNzqE6dx.js b/reference_scripts/tn6SwmjAuNzqE6dx.js new file mode 100644 index 0000000..a7bacb4 --- /dev/null +++ b/reference_scripts/tn6SwmjAuNzqE6dx.js @@ -0,0 +1,14 @@ +let damage = 0 +let test = await this.actor.setupSkill("Dodge", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}); +await test.roll(); + +if (test.succeeded) +{ + damage = 10; +} +else if (test.failed) +{ + damage = 20; +} + +this.script.scriptMessage(await this.actor.applyBasicDamage(damage, {loc : "roll", hideDSN: true, suppressMsg : true})) \ No newline at end of file diff --git a/reference_scripts/tnE8LF6E3svIlLca.js b/reference_scripts/tnE8LF6E3svIlLca.js new file mode 100644 index 0000000..4058efe --- /dev/null +++ b/reference_scripts/tnE8LF6E3svIlLca.js @@ -0,0 +1 @@ +return args.skill?.name == game.i18n.localize("NAME.Research"); \ No newline at end of file diff --git a/reference_scripts/tnilBagajWM8UGQt.js b/reference_scripts/tnilBagajWM8UGQt.js new file mode 100644 index 0000000..1b8e882 --- /dev/null +++ b/reference_scripts/tnilBagajWM8UGQt.js @@ -0,0 +1 @@ +return args.item?.name != game.i18n.localize("NAME.ConsumeAlcohol") \ No newline at end of file diff --git a/reference_scripts/toSrgcvWq9b5eN0K.js b/reference_scripts/toSrgcvWq9b5eN0K.js new file mode 100644 index 0000000..f3fabed --- /dev/null +++ b/reference_scripts/toSrgcvWq9b5eN0K.js @@ -0,0 +1,4 @@ +let location = await game.wfrp4e.tables.rollTable("hitloc", {hideDSN: true}) + +this.item.updateSource({name : `${this.item.name} (${location.description})`}) +this.script.scriptMessage(`Location: ${location.description}`, { whisper: ChatMessage.getWhisperRecipients("GM") }) \ No newline at end of file diff --git a/reference_scripts/tolkNN5P7oOC8GKZ.js b/reference_scripts/tolkNN5P7oOC8GKZ.js new file mode 100644 index 0000000..e030d9d --- /dev/null +++ b/reference_scripts/tolkNN5P7oOC8GKZ.js @@ -0,0 +1,11 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "difficult"}}) +await test.roll(); + +if (test.failed) +{ + let sourceActor = this.effect.sourceActor; + if (sourceActor) + { + this.script.scriptMessage(await this.actor.applyBasicDamage(sourceActor.system.characteristics.wp.bonus, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL})) + } +} \ No newline at end of file diff --git a/reference_scripts/u3olS2p7Ls1JXfAH.js b/reference_scripts/u3olS2p7Ls1JXfAH.js new file mode 100644 index 0000000..5ee90b2 --- /dev/null +++ b/reference_scripts/u3olS2p7Ls1JXfAH.js @@ -0,0 +1 @@ +this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll("mutatephys", {}, "Tzeentch")); \ No newline at end of file diff --git a/reference_scripts/u5dNZ0s3lWfL8KFb.js b/reference_scripts/u5dNZ0s3lWfL8KFb.js new file mode 100644 index 0000000..3d18bb7 --- /dev/null +++ b/reference_scripts/u5dNZ0s3lWfL8KFb.js @@ -0,0 +1 @@ +return args.fields.charging \ No newline at end of file diff --git a/reference_scripts/u6CYMSZADrfXd48Q.js b/reference_scripts/u6CYMSZADrfXd48Q.js new file mode 100644 index 0000000..ad9447a --- /dev/null +++ b/reference_scripts/u6CYMSZADrfXd48Q.js @@ -0,0 +1 @@ +args.fields.modifier += 20; \ No newline at end of file diff --git a/reference_scripts/uACa6u4JLNMRgFlr.js b/reference_scripts/uACa6u4JLNMRgFlr.js new file mode 100644 index 0000000..b4b0244 --- /dev/null +++ b/reference_scripts/uACa6u4JLNMRgFlr.js @@ -0,0 +1,2 @@ +const talents = await Promise.all(["Furious Assault", "Sea Legs"].map(game.wfrp4e.utility.findTalent)) +this.actor.createEmbeddedDocuments("Item", talents, {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/uAy4w7y8Uu9POF8C.js b/reference_scripts/uAy4w7y8Uu9POF8C.js new file mode 100644 index 0000000..c07db00 --- /dev/null +++ b/reference_scripts/uAy4w7y8Uu9POF8C.js @@ -0,0 +1 @@ +args.item.system.qualities.value.push({name : "impact"}) \ No newline at end of file diff --git a/reference_scripts/uLBDnWC3S0lRitbj.js b/reference_scripts/uLBDnWC3S0lRitbj.js new file mode 100644 index 0000000..e858a83 --- /dev/null +++ b/reference_scripts/uLBDnWC3S0lRitbj.js @@ -0,0 +1,22 @@ +let test = await this.actor.setupCharacteristic("int", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}) +await test.roll(); + +let opposedResult = test.opposedMessages[0]?.getOppose()?.resultMessage?.getOpposedTest()?.result + +if (opposedResult?.winner == "attacker") +{ + if (test.failed && (test.result.roll % 11 == 0 || test.result.roll == 100)) + { + this.actor.addCondition("unconscious") + await this.actor.update({"system.status.corruption.value" : parseInt(this.actor.status.corruption.value) + 1}) + this.script.scriptMessage("Gained a Corruption point", {whisper : ChatMessage.getWhisperRecipients("GM")}) + } + else + { + await this.actor.addCondition("stunned", 1 + opposedResult.differenceSL); + } +} +else +{ + return false; +} \ No newline at end of file diff --git a/reference_scripts/uNYstk3eXmWamhzs.js b/reference_scripts/uNYstk3eXmWamhzs.js new file mode 100644 index 0000000..4a76cd7 --- /dev/null +++ b/reference_scripts/uNYstk3eXmWamhzs.js @@ -0,0 +1 @@ +args.actor.addCondition("blinded") \ No newline at end of file diff --git a/reference_scripts/uOHAsKlkFuIaAmjb.js b/reference_scripts/uOHAsKlkFuIaAmjb.js new file mode 100644 index 0000000..85f570c --- /dev/null +++ b/reference_scripts/uOHAsKlkFuIaAmjb.js @@ -0,0 +1 @@ +args.actor.modifyWounds(1) \ No newline at end of file diff --git a/reference_scripts/uSwkYENTOcnfRrqA.js b/reference_scripts/uSwkYENTOcnfRrqA.js new file mode 100644 index 0000000..05d9ada --- /dev/null +++ b/reference_scripts/uSwkYENTOcnfRrqA.js @@ -0,0 +1 @@ +return !args.skill?.name.includes(game.i18n.localize("NAME.Melee")) && args.weapon?.system?.attackType != "melee" \ No newline at end of file diff --git a/reference_scripts/ucF4aiJ1gpDB333G.js b/reference_scripts/ucF4aiJ1gpDB333G.js new file mode 100644 index 0000000..7d00add --- /dev/null +++ b/reference_scripts/ucF4aiJ1gpDB333G.js @@ -0,0 +1,5 @@ +if (args.test.options.catfall && (args.test.result.roll <= game.settings.get("wfrp4e", "automaticSuccess") || args.test.result.roll <= args.test.target) && !args.test.result.catfall) +{ + args.test.result.other.push(`${this.effect.name}: Fall distance damage reduced by ${Number(args.test.result.SL) + 1} yards`) + args.test.result.catfall = true; // Prevent duplicate messages +} \ No newline at end of file diff --git a/reference_scripts/ugL5IBB6R2yWyMWd.js b/reference_scripts/ugL5IBB6R2yWyMWd.js new file mode 100644 index 0000000..1616e69 --- /dev/null +++ b/reference_scripts/ugL5IBB6R2yWyMWd.js @@ -0,0 +1,23 @@ +if (args.totalWoundLoss > 0) +{ + let apply = await Dialog.confirm({title : this.effect.name, content : `Appy ${this.effect.name} Damage? Attacker must have used bare hands or a melee weapon made of metal.`}) + if (apply) + { + + let damage = 5 + this.actor.characteristics.wp.bonus; + + let loc = args.opposedTest.attackerTest.weapon?.system.usesHands[0] || "rArm"; + + let APatLoc = args.opposedTest.attacker.system.status.armour[loc]; + + let metalAP = APatLoc.layers.reduce((metal, layer) => metal += (layer.metal ? layer.value : 0), 0) + + let APused = Math.max(0, APatLoc.value - metalAP); // remove metal AP at location; + + damage -= (APused + args.opposedTest.attacker.system.characteristics.t.bonus) + + let msg = await args.opposedTest.attacker.applyBasicDamage(damage, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL}); + msg += ` (ignored ${metalAP} metal AP on ${game.wfrp4e.config.locations[loc]})` + this.script.scriptMessage(msg) + } +} \ No newline at end of file diff --git a/reference_scripts/upfK6GM33qZCZjll.js b/reference_scripts/upfK6GM33qZCZjll.js new file mode 100644 index 0000000..91935c0 --- /dev/null +++ b/reference_scripts/upfK6GM33qZCZjll.js @@ -0,0 +1 @@ +return args.item?.name != "Play (Lute)" \ No newline at end of file diff --git a/reference_scripts/uwdQvZtzy2HVeEzx.js b/reference_scripts/uwdQvZtzy2HVeEzx.js new file mode 100644 index 0000000..685fa84 --- /dev/null +++ b/reference_scripts/uwdQvZtzy2HVeEzx.js @@ -0,0 +1,14 @@ +if (args.totalWoundLoss > 0) +{ + let roll = await new Roll("1d10").roll(); + roll.toMessage(this.script.getChatData()); + args.modifiers.other.push({label : this.effect.name, value : roll.total}) + + args.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields : {difficulty : "hard"}, skipTargets: true, appendTitle : " - " + this.effect.name}).then(async test => { + await test.roll(); + if (test.failed) + { + this.script.scriptMessage("" + args.actor.name + " takes a @Table[critbody]{Critical Hit} to the torse", {whisper: ChatMessage.getWhisperRecipients("GM")}) + } + }) +} diff --git a/reference_scripts/ux3jaLpAUhZ5YqA6.js b/reference_scripts/ux3jaLpAUhZ5YqA6.js new file mode 100644 index 0000000..66cae1b --- /dev/null +++ b/reference_scripts/ux3jaLpAUhZ5YqA6.js @@ -0,0 +1 @@ +return args.item?.name != game.i18n.localize("NAME.Leadership") && args.item?.name != game.i18n.localize("NAME.Cool") \ No newline at end of file diff --git a/reference_scripts/v00nVCRKqqRvY28t.js b/reference_scripts/v00nVCRKqqRvY28t.js new file mode 100644 index 0000000..7d632a2 --- /dev/null +++ b/reference_scripts/v00nVCRKqqRvY28t.js @@ -0,0 +1,6 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: "hard"}}); +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("stunned", 3) +} diff --git a/reference_scripts/v4CCxVaVGf9i8U7X.js b/reference_scripts/v4CCxVaVGf9i8U7X.js new file mode 100644 index 0000000..abab0d3 --- /dev/null +++ b/reference_scripts/v4CCxVaVGf9i8U7X.js @@ -0,0 +1,24 @@ +let cured = await Dialog.wait({ + title : this.effect.name, + content : "
Enter the number of diseases/poisons cured
", + buttons : { + confirm : { + label : "Confirm", + callback : (dlg) => { + let input = dlg.find("input"); + value = parseInt(input[0].value); + return value; + } + } + } +}) + + +let damage = 0; + +let rolls = new Array(cured).fill("").map(i => `max(0, 1d10 - ${this.actor.system.characteristics.fel.bonus})`) + +let test = new Roll(`${rolls.join(" + ")}`); +await test.roll(); +test.toMessage({speaker : {alias : this.actor.name}, flavor : this.effect.name}); +this.script.scriptMessage(await this.actor.applyBasicDamage(test.total, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true })) \ No newline at end of file diff --git a/reference_scripts/v4ITTsSY9EvCbhZP.js b/reference_scripts/v4ITTsSY9EvCbhZP.js new file mode 100644 index 0000000..b42194c --- /dev/null +++ b/reference_scripts/v4ITTsSY9EvCbhZP.js @@ -0,0 +1,2 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS") +this.actor.createEmbeddedDocuments("Item", [item], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/v5xrDWcrTNFJkyQB.js b/reference_scripts/v5xrDWcrTNFJkyQB.js new file mode 100644 index 0000000..da60300 --- /dev/null +++ b/reference_scripts/v5xrDWcrTNFJkyQB.js @@ -0,0 +1,90 @@ +let choice1 = [ + { + type : "skill", + name : "Ranged (Bow)", + diff : { + system : { + advances : { + value : 10 + } + } + } + }, + { + type : "weapon", + name : "Longbow", + }, + { + type : "ammunition", + name : "Arrow", + } +] +let choice2 = [ +] + +let choice = await Dialog.wait({ + title : "Option", + content : + `+ Add Option? +
+${item.name} loses all Qualities
` + } + else + { + msg += `${item.name} crumbles into dust!
` + await item.update({name : item.name + " (Dust)"}) + } +} +if(msg) +{ + this.script.scriptMessage(msg); +} \ No newline at end of file diff --git a/reference_scripts/whUSkaR1yem21bXp.js b/reference_scripts/whUSkaR1yem21bXp.js new file mode 100644 index 0000000..c2c2f1b --- /dev/null +++ b/reference_scripts/whUSkaR1yem21bXp.js @@ -0,0 +1,133 @@ +let characteristics = { + "ws" : 10, + "bs" : 5, + "s" : 0, + "t" : 5, + "i" : 10, + "ag" : 0, + "dex" : 6, + "int" : -5, + "wp" : 0, + "fel" : 10 +} +let skills = ["Melee (Basic)", "Track"] +let skillAdvancements = [8, 7] +let talents = ["Berserk Charge", "Careful Strike", "Strike to Injure"] +let traits = ["Flight (8)", "Fury", "Swarm", "Tracker"] +let trappings = [] +let items = []; +let spells = []; + +let updateObj = this.actor.toObject(); + +for (let ch in characteristics) +{ + updateObj.system.characteristics[ch].modifier += characteristics[ch]; +} + +for (let index = 0; index < skills.length; index++) +{ + let skill = skills[index] + let skillItem; + skillItem = updateObj.items.find(i => i.name == skill && i.type == "skill") + if (skillItem) + skillItem.system.advances.value += skillAdvancements[index] + else + { + skillItem = await game.wfrp4e.utility.findSkill(skill) + skillItem = skillItem.toObject(); + skillItem.system.advances.value = skillAdvancements[index]; + items.push(skillItem); + } +} + +for (let talent of talents) +{ + let talentItem = await game.wfrp4e.utility.findTalent(talent) + if (talentItem) + { + items.push(talentItem.toObject()); + } + else + { + ui.notifications.warn(`Could not find ${talent}`, {permanent : true}) + } +} + +const traitRegex = /(?:,?(.+?)(\+?\d{1,2}\+?)?\s*?(?:\((.+?)\)\s*(\+?\d{1,2})?|,|$))/gm +for (let trait of traits) +{ + let traitMatches = trait.matchAll(traitRegex).next().value + let traitName = traitMatches[1] + let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there's a specialization + let traitSpec = traitMatches[3] + + let traitItem; + try { + traitItem = await WFRP_Utility.findItem(traitName, "trait") + } + catch { } + if (!traitItem) { + ui.notifications.warn(`Could not find ${trait}`, {permanent : true}) + } + traitItem = traitItem.toObject() + + if (Number.isNumeric(traitVal)) + { + traitItem.system.specification.value = traitName.includes('Weapon','Horns','Tail','Tentacles','Bite') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal; + traitItem.name = (traitItem.name + ` ${traitSpec ? "("+ traitSpec + ")" : ""}`).trim() + } + else + traitItem.system.specification.value = traitSpec + + items.push(traitItem) + +} + +for (let trapping of trappings) +{ + let trappingItem = await game.wfrp4e.utility.findItem(trapping) + if (trappingItem) + { + trappingItem = trappingItem.toObject() + + equip(trappingItem) + + items.push(trappingItem); + } + else + { + ui.notifications.warn(`Could not find ${trapping}`, {permanent : true}) + } +} + +for (let spell of spells) +{ + let spellItem = await game.wfrp4e.utility.findItem(spell) + if (spellItem) + { + spellItem = spellItem.toObject() + + items.push(spellItem); + } + else + { + ui.notifications.warn(`Could not find ${spell}`, {permanent : true}) + } +} + +updateObj.name = updateObj.name += " " + this.effect.name + +await this.actor.update(updateObj) +this.actor.createEmbeddedDocuments("Item", items); + + +function equip(item) +{ + if (item.type == "armour") + item.worn = true + else if (item.type == "weapon") + item.equipped = true + else if (item.type == "trapping" && item.trappingType?.value == "clothingAccessories") + item.worn = true +} \ No newline at end of file diff --git a/reference_scripts/wsqNM4NHnwaAAQym.js b/reference_scripts/wsqNM4NHnwaAAQym.js new file mode 100644 index 0000000..a07f054 --- /dev/null +++ b/reference_scripts/wsqNM4NHnwaAAQym.js @@ -0,0 +1,11 @@ + args.applyAP = false; + + this.script.scriptNotification("This test only applies to criminals, otherwise close the dialog."); + this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields : {difficulty : "average"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => + { + await test.roll(); + if (test.failed) + { + args.actor.addCondition("unconscious"); + } + }); \ No newline at end of file diff --git a/reference_scripts/wyTCozh9qGTx6yK0.js b/reference_scripts/wyTCozh9qGTx6yK0.js new file mode 100644 index 0000000..c2afa63 --- /dev/null +++ b/reference_scripts/wyTCozh9qGTx6yK0.js @@ -0,0 +1,5 @@ +if (args.options.terror || args.extendedTest?.getFlag("wfrp4e", "fear")) +{ + args.abort = true; + this.script.scriptNotification("Does not need to make Fear or Terror tests"); +} \ No newline at end of file diff --git a/reference_scripts/wzkxiKjxVEeNS1di.js b/reference_scripts/wzkxiKjxVEeNS1di.js new file mode 100644 index 0000000..7625d68 --- /dev/null +++ b/reference_scripts/wzkxiKjxVEeNS1di.js @@ -0,0 +1,11 @@ +let roll = await new Roll("1d10").roll(); +this.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true})) + +await this.actor.addCondition("deafened", 3) + +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields : {difficulty: "average" }, skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure: "Gain a Broken Condition", success : "Avoided Broken Condition"}}) +await test.roll(); +if (test.failed) +{ + this.actor.addCondition("broken") +} \ No newline at end of file diff --git a/reference_scripts/x2RLUUNB7BiIDYCP.js b/reference_scripts/x2RLUUNB7BiIDYCP.js new file mode 100644 index 0000000..0ab5fe7 --- /dev/null +++ b/reference_scripts/x2RLUUNB7BiIDYCP.js @@ -0,0 +1,16 @@ + + let difficulty = "" + if (this.effect.name.includes("Moderate")) + difficulty = "easy" + else if (this.effect.name.includes("Severe")) + difficulty = "average" + else + difficulty = "veasy" + + let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {context : {failure : this.actor.name + " dies from Blight"}, fields: {difficulty}, skipTargets: true, appendTitle : " - Blight"}) + await test.roll(); + if (test.failed) + { + this.actor.addCondition("dead"); + } + \ No newline at end of file diff --git a/reference_scripts/x76tKw4L8dX00ikE.js b/reference_scripts/x76tKw4L8dX00ikE.js new file mode 100644 index 0000000..c98eddb --- /dev/null +++ b/reference_scripts/x76tKw4L8dX00ikE.js @@ -0,0 +1,5 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.uqGxFOEqeurwkAO3") +let data = item.toObject(); +setProperty(data, "flags.wfrp4e.breath", "fire") +data.system.specification.value = 5 +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/x8XK2fzzXCnSwfjt.js b/reference_scripts/x8XK2fzzXCnSwfjt.js new file mode 100644 index 0000000..d42e514 --- /dev/null +++ b/reference_scripts/x8XK2fzzXCnSwfjt.js @@ -0,0 +1,7 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Athletics")) +await test.roll(); + +if (test.succeeded) +{ + this.actor.removeCondition("prone"); +} \ No newline at end of file diff --git a/reference_scripts/x9G6Du5EWV6byf4C.js b/reference_scripts/x9G6Du5EWV6byf4C.js new file mode 100644 index 0000000..79042f3 --- /dev/null +++ b/reference_scripts/x9G6Du5EWV6byf4C.js @@ -0,0 +1,8 @@ +if (parseInt(this.effect.sourceTest.result.SL) >= 3) +{ + this.actor.modifyWounds(this.actor.system.characteristics.t.bonus * 2) +} +else +{ + this.actor.modifyWounds(this.actor.system.characteristics.t.bonus) +} \ No newline at end of file diff --git a/reference_scripts/x9iKFYYc4Ocy8PTS.js b/reference_scripts/x9iKFYYc4Ocy8PTS.js new file mode 100644 index 0000000..9f078b6 --- /dev/null +++ b/reference_scripts/x9iKFYYc4Ocy8PTS.js @@ -0,0 +1,30 @@ +let item = this.effect.getCreatedItems()?.[0]; +ChatMessage.create({content : "Grace is beyond style", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true}) + +let choice = await ItemDialog.create(ItemDialog.objectToArray({ + "nobles" : "Nobles", + "guilders" : "Guilders", + "servants" : "Servants" +}), 1, "Choose Group") + +let name = choice[0]?.name + +if (!name) +{ + return; +} + +if (item) +{ + item.update({ + name : item.name.split("(")[0] + ` (${name})`, + "system.tests.value" : item.system.tests.value.split("(")[0] + ` (${name}` + }) +} +else +{ + item = await fromUuid("Compendium.wfrp4e-core.items.Item.sYbgpSnRqSZWgwFP"); + let data = item.toObject(); + data.name += ` (${name})` + this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id}) +} \ No newline at end of file diff --git a/reference_scripts/xBpLQa7yBPczDMY8.js b/reference_scripts/xBpLQa7yBPczDMY8.js new file mode 100644 index 0000000..dd7547f --- /dev/null +++ b/reference_scripts/xBpLQa7yBPczDMY8.js @@ -0,0 +1,7 @@ + let scythe = (await fromUuid("Compendium.wfrp4e-core.items.CXg7XOFJwu4LZ9LM")).toObject(); + scythe.name = "Scythe of Shyish"; + scythe.system.damage.value = "WPB + 3" + scythe.system.equipped = true; + scythe.img = this.effect.icon; + scythe.system.qualities.value.push({name : "magical"}) + this.actor.createEmbeddedDocuments("Item", [scythe], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/xIRU2SaqLeWmqGDI.js b/reference_scripts/xIRU2SaqLeWmqGDI.js new file mode 100644 index 0000000..01cabd4 --- /dev/null +++ b/reference_scripts/xIRU2SaqLeWmqGDI.js @@ -0,0 +1,4 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.vMYEkrWj0ip6ZOdv") +let data = item.toObject(); +data.name += " (Disease)" +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/xL4S0H1RP8hhXW7c.js b/reference_scripts/xL4S0H1RP8hhXW7c.js new file mode 100644 index 0000000..7aa1d03 --- /dev/null +++ b/reference_scripts/xL4S0H1RP8hhXW7c.js @@ -0,0 +1,3 @@ +let item = await fromUuid("Compendium.wfrp4e-core.items.xneBqGOs1QS7kfUr") +let data = item.toObject(); +this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/reference_scripts/xLKAuD6yzwjAL6tJ.js b/reference_scripts/xLKAuD6yzwjAL6tJ.js new file mode 100644 index 0000000..15ad6a7 --- /dev/null +++ b/reference_scripts/xLKAuD6yzwjAL6tJ.js @@ -0,0 +1 @@ +return !args.weapon || args.weapon?.system.properties?.qualities.shield || !this.item.system.usesLocation(args.weapon) \ No newline at end of file diff --git a/reference_scripts/xMhhVol8Is3DJ3gb.js b/reference_scripts/xMhhVol8Is3DJ3gb.js new file mode 100644 index 0000000..bd75d66 --- /dev/null +++ b/reference_scripts/xMhhVol8Is3DJ3gb.js @@ -0,0 +1,5 @@ +if (this.effect.sourceTest.succeeded) +{ + let blinded = 1 + this.effect.sourceTest.result.overcast.usage.other.count + this.actor.addCondition("blinded", blinded) +} \ No newline at end of file diff --git a/reference_scripts/xPDMpOvC1ZBVxrNg.js b/reference_scripts/xPDMpOvC1ZBVxrNg.js new file mode 100644 index 0000000..40f6360 --- /dev/null +++ b/reference_scripts/xPDMpOvC1ZBVxrNg.js @@ -0,0 +1 @@ +args.fields.modifier += 10; \ No newline at end of file diff --git a/reference_scripts/xPwa3NftkpMBc2AO.js b/reference_scripts/xPwa3NftkpMBc2AO.js new file mode 100644 index 0000000..0b6eef8 --- /dev/null +++ b/reference_scripts/xPwa3NftkpMBc2AO.js @@ -0,0 +1 @@ +return !["ws", "s", "ag"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/xQ3xR2Wf0wHFa76H.js b/reference_scripts/xQ3xR2Wf0wHFa76H.js new file mode 100644 index 0000000..99df4ab --- /dev/null +++ b/reference_scripts/xQ3xR2Wf0wHFa76H.js @@ -0,0 +1 @@ +return ["ws", "bs", "fel", "dex"].includes(args.characteristic) || args.weapon \ No newline at end of file diff --git a/reference_scripts/xQnoRTHotZKrwPrx.js b/reference_scripts/xQnoRTHotZKrwPrx.js new file mode 100644 index 0000000..036d4f5 --- /dev/null +++ b/reference_scripts/xQnoRTHotZKrwPrx.js @@ -0,0 +1 @@ +return args.type == "cast" && args.item?.system.lore?.value == "shadow" \ No newline at end of file diff --git a/reference_scripts/xRTmMwNfdirjsi8X.js b/reference_scripts/xRTmMwNfdirjsi8X.js new file mode 100644 index 0000000..4a8886f --- /dev/null +++ b/reference_scripts/xRTmMwNfdirjsi8X.js @@ -0,0 +1,3 @@ +this.actor.addCondition("ablaze"); + +this.actor.applyBasicDamage(this.effect.sourceTest.result.damage) \ No newline at end of file diff --git a/reference_scripts/xRd6oA1QWLVpfoBm.js b/reference_scripts/xRd6oA1QWLVpfoBm.js new file mode 100644 index 0000000..db785fb --- /dev/null +++ b/reference_scripts/xRd6oA1QWLVpfoBm.js @@ -0,0 +1,6 @@ +if (!this.actor.has("Night Vision")) +{ + let item = await fromUuid("Compendium.wfrp4e-core.items.FmHDbCOy3pH8yKhm"); + let data = item.toObject(); + this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) +} \ No newline at end of file diff --git a/reference_scripts/xS2su09zcza9du09.js b/reference_scripts/xS2su09zcza9du09.js new file mode 100644 index 0000000..592e0c2 --- /dev/null +++ b/reference_scripts/xS2su09zcza9du09.js @@ -0,0 +1,8 @@ +if (["Minor", "Moderate", "Major"].includes(this.item.system.specification.value)) +{ + return +} + +let choice = await ItemDialog.create(ItemDialog.objectToArray({minor : "Minor", moderate : "Moderate", major : "Major"}, this.item.img), 1, "Choose Corruption Severity"); + +this.item.updateSource({"system.specification.value" : choice[0]?.name || ""}) \ No newline at end of file diff --git a/reference_scripts/xUpKYT7BZCSmAfUy.js b/reference_scripts/xUpKYT7BZCSmAfUy.js new file mode 100644 index 0000000..6e013b0 --- /dev/null +++ b/reference_scripts/xUpKYT7BZCSmAfUy.js @@ -0,0 +1,10 @@ +if (this.item.system.quantity.value) +{ + this.item.system.reduceQuantity(); + let actor = Array.from(game.user.targets)[0]?.actor || this.actor; + actor.applyEffect({effectData : [this.item.effects.contents[0].convertToApplied()]}) +} +else +{ + this.script.scriptNotification("None left!", "error") +} \ No newline at end of file diff --git a/reference_scripts/xYTkj8jhSVOSoLbC.js b/reference_scripts/xYTkj8jhSVOSoLbC.js new file mode 100644 index 0000000..f319a92 --- /dev/null +++ b/reference_scripts/xYTkj8jhSVOSoLbC.js @@ -0,0 +1 @@ +this.actor.flags.useless[this.item.system.location.key[0] + "Arm"] = true; \ No newline at end of file diff --git a/reference_scripts/xcy5GOUSZ0meIejZ.js b/reference_scripts/xcy5GOUSZ0meIejZ.js new file mode 100644 index 0000000..9d4ae4a --- /dev/null +++ b/reference_scripts/xcy5GOUSZ0meIejZ.js @@ -0,0 +1,4 @@ +if (args.test.isFumble) +{ + args.test.result.other.push("@Table[warp-grinder-fumble]") +} \ No newline at end of file diff --git a/reference_scripts/xgdhf0wlNP2cHIQx.js b/reference_scripts/xgdhf0wlNP2cHIQx.js new file mode 100644 index 0000000..af39144 --- /dev/null +++ b/reference_scripts/xgdhf0wlNP2cHIQx.js @@ -0,0 +1 @@ +await this.actor.addCondition("entangled", this.effect.sourceTest.result.overcast.usage.other.current) \ No newline at end of file diff --git a/reference_scripts/xgplXZMs459X7XXM.js b/reference_scripts/xgplXZMs459X7XXM.js new file mode 100644 index 0000000..af8f73d --- /dev/null +++ b/reference_scripts/xgplXZMs459X7XXM.js @@ -0,0 +1,21 @@ +// Apply changes when the mask is worn + +if (args.equipped) { + this.actor.createEmbeddedDocuments("ActiveEffect", [this.item.effects.contents[1]?.convertToApplied()]) + this.script.scriptMessage(`${this.actor.name} dons the ${this.item.name}.${await this.actor.applyBasicDamage(8, {loc : "roll", suppressMsg: true, hideDSN: true})}
` +msg += `${await this.actor.applyBasicDamage(8, {loc : "roll", suppressMsg: true, hideDSN: true})}
` +msg += `${await this.actor.applyBasicDamage(8, {loc : "roll", suppressMsg: true, hideDSN: true})}
` + +this.script.scriptMessage(msg); \ No newline at end of file diff --git a/reference_scripts/ynoHNXXCGRS6fTqF.js b/reference_scripts/ynoHNXXCGRS6fTqF.js new file mode 100644 index 0000000..9c5e860 --- /dev/null +++ b/reference_scripts/ynoHNXXCGRS6fTqF.js @@ -0,0 +1,26 @@ +let msg = "" + +let i_gain = (await new Roll("1d10").roll()).total + +if (args.actor.characteristics.i.value <= 0) +{ + i_gain += (await new Roll("2d10").roll()).total +} + +msg = `${this.actor.prototypeToken.name} gains ${i_gain} Initiative` + +let newValue = i_gain + args.actor.characteristics.i.modifier + +this.actor.update({"system.characteristics.i.modifier" : newValue}) + + +let hitloc = await game.wfrp4e.tables.rollTable("hitloc") + +let value = hitloc.result +let desc = hitloc.description + +this.effect.updateSource({"flags.wfrp4e.location" : value}) + +msg += ` as eyes push out of their ${desc}` + +this.script.scriptMessage(msg) \ No newline at end of file diff --git a/reference_scripts/yzN7ZNlgCiSVJqsU.js b/reference_scripts/yzN7ZNlgCiSVJqsU.js new file mode 100644 index 0000000..ac583fa --- /dev/null +++ b/reference_scripts/yzN7ZNlgCiSVJqsU.js @@ -0,0 +1,7 @@ +let sourceItem = this.effect.sourceItem; + +if (sourceItem) +{ + this.actor.applyEffect({effectUuids : [sourceItem.effects.contents[1].uuid]}) + this.script.scriptNotification("Applied after effects"); +} \ No newline at end of file diff --git a/reference_scripts/z5HfNUrHy5MS3K7a.js b/reference_scripts/z5HfNUrHy5MS3K7a.js new file mode 100644 index 0000000..e635110 --- /dev/null +++ b/reference_scripts/z5HfNUrHy5MS3K7a.js @@ -0,0 +1,7 @@ +let test = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure: "1 Corruption Point Gained"}}) +await test.roll(); +if (test.failed && this.actor.type == "character") +{ + this.actor.update({"system.status.corruption.value" : parseInt(this.actor.status.corruption.value) + 1}) + this.script.scriptMessage("Gained a Corruption point", {whisper : ChatMessage.getWhisperRecipients("GM")}) +} \ No newline at end of file diff --git a/reference_scripts/z926Cl2vxUfyLY0V.js b/reference_scripts/z926Cl2vxUfyLY0V.js new file mode 100644 index 0000000..accff96 --- /dev/null +++ b/reference_scripts/z926Cl2vxUfyLY0V.js @@ -0,0 +1,4 @@ +if (!["rArm", "lArm"].includes(this.effect.getFlag("wfrp4e", "location"))) + return true + +return ["fel", "wp", "int", "t"].includes(args.characteristic) \ No newline at end of file diff --git a/reference_scripts/z9NEbIUBsKMaTuCz.js b/reference_scripts/z9NEbIUBsKMaTuCz.js new file mode 100644 index 0000000..144e2e4 --- /dev/null +++ b/reference_scripts/z9NEbIUBsKMaTuCz.js @@ -0,0 +1,4 @@ +if (args.opposedTest.result.hitloc && args.opposedTest.result.hitloc.value == "head") +{ + args.actor.addCondition("entangled") +} \ No newline at end of file diff --git a/reference_scripts/zA6TDttpwMSMl7D8.js b/reference_scripts/zA6TDttpwMSMl7D8.js new file mode 100644 index 0000000..898b642 --- /dev/null +++ b/reference_scripts/zA6TDttpwMSMl7D8.js @@ -0,0 +1,14 @@ +// An imbiber must take a Consume Alcohol Test. +this.actor.setupSkill(game.i18n.localize("NAME.ConsumeAlcohol"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => { + await test.roll() + // If they succeed, + // as a result of whatever potential futures they glimpse, + // they can spend a Fortune Point within the next hour to reverse the dice of any failed Test. + if (test.succeeded) { + this.script.scriptMessage(`As a result of whatever potential futures they glimpse, ${this.actor.prototypeToken.name} can spend a Fortune Point within the next hour to reverse the dice of any failed Test.`, + { + whisper: ChatMessage.getWhisperRecipients("GM"), + blind: true + }) + } +}) \ No newline at end of file diff --git a/reference_scripts/zBHTIBU8OlYj1YIO.js b/reference_scripts/zBHTIBU8OlYj1YIO.js new file mode 100644 index 0000000..36139f8 --- /dev/null +++ b/reference_scripts/zBHTIBU8OlYj1YIO.js @@ -0,0 +1 @@ +args.fields.modifier += this.effect.sourceActor?.system.characteristics.wp.value; \ No newline at end of file diff --git a/reference_scripts/zFYCaGR0wbFWjl4T.js b/reference_scripts/zFYCaGR0wbFWjl4T.js new file mode 100644 index 0000000..fbb0202 --- /dev/null +++ b/reference_scripts/zFYCaGR0wbFWjl4T.js @@ -0,0 +1 @@ +return args.skill?.name != game.i18n.localize("NAME.OutdoorSurvival"); \ No newline at end of file diff --git a/reference_scripts/zK38Rl5t9zbFi4Se.js b/reference_scripts/zK38Rl5t9zbFi4Se.js new file mode 100644 index 0000000..029af27 --- /dev/null +++ b/reference_scripts/zK38Rl5t9zbFi4Se.js @@ -0,0 +1,5 @@ +if (args.opposedTest.result.hitloc.value == this.item.system.location.key && args.totalWoundLoss > 0) +{ + args.actor.addCondition("bleeding", 1); + this.script.scriptNotification("Added Bleeding") +} \ No newline at end of file diff --git a/reference_scripts/zR4WAjzXHTZuiu5G.js b/reference_scripts/zR4WAjzXHTZuiu5G.js new file mode 100644 index 0000000..a366058 --- /dev/null +++ b/reference_scripts/zR4WAjzXHTZuiu5G.js @@ -0,0 +1,52 @@ +let actor = this.actor; + let effect = this.effect; + let bleedingAmt; + let bleedingRoll; + let msg = "" + + let damage = effect.conditionValue; + let scriptArgs = {msg, damage}; + await Promise.all(actor.runScripts("preApplyCondition", {effect, data : scriptArgs})) + msg = scriptArgs.msg; + damage = scriptArgs.damage; + msg += await actor.applyBasicDamage(damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, minimumOne : false, suppressMsg : true}) + + if (actor.status.wounds.value == 0 && !actor.hasCondition("unconscious")) + { + await actor.addCondition("unconscious") + msg += "${this.actor.prototypeToken.name} has gained the Magic Resistance Trait. This effect lasts for one hour.
`, {whisper: ChatMessage.getWhisperRecipients("GM"), blind: true }) + this.script.scriptMessage(`${this.actor.prototypeToken.name} bénéficie du Trait Résistance à la Magie. Cet effet dure 1 heure.
`, {whisper: ChatMessage.getWhisperRecipients("GM"), blind: true }) } if (hasMagicResistance) { // Multiple doses may be consumed at once, with each one adding an additional 1 to the Magic Resistance rating and increasing the duration by one hour. - let msg = `${this.actor.prototypeToken.name} has enhanced their Magic Resistance by 1 to Rating ${parseInt(hasMagicResistance.system.specification.value)}. This effect lasts for one hour.
` + let msg = `${this.actor.prototypeToken.name} a amélioré sa Résistance à la Magie de 1 pour atteindre ${parseInt(hasMagicResistance.system.specification.value)}. Cette effte dure 1 heure.
` // Resist toxic effect this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), { @@ -24,8 +24,8 @@ if (hasMagicResistance) { // If they fail ... if (!test.succeeded) { - msg += `However, they begin to ooze the thick, poisonous slime that coats every Dreadmaw. They have gained 1 Poisoned Condition now and should continue to receive an additional @Condition[Poisoned] Condition at the end of each of the round.
-If they are still alive at the end of 10 rounds, the effect ends and all Poisoned Conditions gained from ${this.effect.name} are removed.
` + msg += `Cependant, il commence à suinter la bave épaisse et venimeuse qui recouvre chaque Dreadmaw. Il reçoit 1 état Empoisonné et doit continuer à recevoir 1 état @Condition[Empoisonné] andà la fin de chaque round.
+Si le personnage est toujours vivant à la fin de 10 rounds, les effets cessent et tout les états Empoisonnés dues à ${this.effect.name} sont supprimés.
` this.actor.addCondition("poisoned", 1) } this.script.scriptMessage(msg, {whisper: ChatMessage.getWhisperRecipients("GM"), blind: true }) diff --git a/scripts/PVjaKAHTKDA0rA9J.js b/scripts/PVjaKAHTKDA0rA9J.js index 8942127..3406d92 100644 --- a/scripts/PVjaKAHTKDA0rA9J.js +++ b/scripts/PVjaKAHTKDA0rA9J.js @@ -1,2 +1,2 @@ -let test = await this.actor.setupSkill("Dodge", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}); +let test = await this.actor.setupSkill("Esquive", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}); await test.roll(); \ No newline at end of file diff --git a/scripts/PeZYj8b0vedyJj00.js b/scripts/PeZYj8b0vedyJj00.js index 51a0a44..a176c19 100644 --- a/scripts/PeZYj8b0vedyJj00.js +++ b/scripts/PeZYj8b0vedyJj00.js @@ -1,12 +1,12 @@ // This script needs to be separate because equipTransfer is off on the other effect, and thus won't execute when added to an actor let mainEffect = this.item.effects.contents[0]; -if (mainEffect.name.includes("(Lore)")) +if (mainEffect.name.includes("(Savoir)")) { - let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, "Choose Lore"); + let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, "Choisissez le Savoir"); if (choice.length) { - mainEffect.update({name : mainEffect.name.replace("Lore", choice[0].name)}) + mainEffect.update({name : mainEffect.name.replace("Savoir", choice[0].name)}) this.item.update({name : this.item.name += ` (${choice[0].name})`}) } } diff --git a/scripts/Ph3TdQw1lGiFr049.js b/scripts/Ph3TdQw1lGiFr049.js index f7e4852..a75ea45 100644 --- a/scripts/Ph3TdQw1lGiFr049.js +++ b/scripts/Ph3TdQw1lGiFr049.js @@ -2,10 +2,10 @@ (this.actor.isOpposing || args.test.context.defending) && args.test.result.roll % 11 == 0 && args.test.succeeded && - ["Language (Magick)", "Dodge"].includes(args.test.item?.name)) + ["Langue (Magick)", "Esquive"].includes(args.test.item?.name)) { args.test.context.phantasmal = true; // Flag so items aren't readded if test is edited - let text = `${this.effect.name}: Adding Unstable and Ward` + let text = `${this.effect.name}: Ajout de Instable et Protection` args.test.result.other.push(text) this.script.scriptNotification(text); diff --git a/scripts/PwqTmw7rsG8hzqCS.js b/scripts/PwqTmw7rsG8hzqCS.js index 6ce47bf..a4d2b43 100644 --- a/scripts/PwqTmw7rsG8hzqCS.js +++ b/scripts/PwqTmw7rsG8hzqCS.js @@ -3,7 +3,7 @@ if (args.test.result.critical && args.test.result.roll % 10 == 0) game.wfrp4e.tables.findTable("knuckleduster-diseases").roll().then(roll => { let results = roll.results[0] - this.script.scriptMessage(`${this.actor.name} contracts @UUID[Compendium.${results.documentCollection}.${results.documentId}]{${results.text}}`, {blind : true, whisper: ChatMessage.getWhisperRecipients("GM") }) + this.script.scriptMessage(`${this.actor.name} subit @UUID[Compendium.${results.documentCollection}.${results.documentId}]{${results.text}}`, {blind : true, whisper: ChatMessage.getWhisperRecipients("GM") }) }) } diff --git a/scripts/Q4EQgP4gZR8TTm7S.js b/scripts/Q4EQgP4gZR8TTm7S.js index 2ae696c..b38c7fa 100644 --- a/scripts/Q4EQgP4gZR8TTm7S.js +++ b/scripts/Q4EQgP4gZR8TTm7S.js @@ -3,7 +3,7 @@ if (args.item?.system.attackType) { penalty -= 30 } -if (args.actor.has("Second Sight", "talent")) +if (args.actor.has("Seconde Vue", "talent")) penalty += 10 args.prefillModifiers.modifier += penalty \ No newline at end of file diff --git a/scripts/Q68WiUWY7GxiXBbT.js b/scripts/Q68WiUWY7GxiXBbT.js index 536d1ae..9883f8c 100644 --- a/scripts/Q68WiUWY7GxiXBbT.js +++ b/scripts/Q68WiUWY7GxiXBbT.js @@ -1,5 +1,5 @@ let item = await fromUuid("Compendium.wfrp4e-core.items.9GNpAqgsKzxZKJpp") let data = item.toObject(); -data.system.specification.value = "When Alone"; +data.system.specification.value = "Lorsque seul"; data.effects[0].disabled = true; this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/scripts/QRSACifDrvojIXHB.js b/scripts/QRSACifDrvojIXHB.js index 0527702..e475e62 100644 --- a/scripts/QRSACifDrvojIXHB.js +++ b/scripts/QRSACifDrvojIXHB.js @@ -1,9 +1,9 @@ if (!this.actor.effects.find(e => e.isCondition)) { - return this.script.scriptNotification("No Conditions on this Actor") + return this.script.scriptNotification("Aucun état sur cet Acteur") } -let choice = await ItemDialog.create(this.actor.effects.filter(i => i.isCondition), 1, "Choose a Condition") +let choice = await ItemDialog.create(this.actor.effects.filter(i => i.isCondition), 1, "Choisissez un état") if (choice[0]) { diff --git a/scripts/Qgn92fZyc3Psn8QJ.js b/scripts/Qgn92fZyc3Psn8QJ.js index fcfd3fd..315a269 100644 --- a/scripts/Qgn92fZyc3Psn8QJ.js +++ b/scripts/Qgn92fZyc3Psn8QJ.js @@ -4,7 +4,8 @@ if (args.test.options.useOnesAttractive && (args.test.result.roll <= game.settin let SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10) let ones = Number(args.test.result.roll.toString().split("").pop()) -if (ones > SL) - args.test.data.result.SL = "+" + (ones + args.test.successBonus + args.test.slBonus) - args.test.result.other.push(`${this.effect.name}: Used unit dice as SL`) +if (ones > SL) { + args.test.data.result.SL = "+" + (ones + args.test.successBonus + args.test.slBonus) + args.test.result.other.push(`${this.effect.name}: Utilise le dé d'unité comme DR`) + } } \ No newline at end of file diff --git a/scripts/QoEOxRruQXYrZrv3.js b/scripts/QoEOxRruQXYrZrv3.js index c084829..fca8751 100644 --- a/scripts/QoEOxRruQXYrZrv3.js +++ b/scripts/QoEOxRruQXYrZrv3.js @@ -10,7 +10,7 @@ let filters = [ } ] -let items = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 2, "Choose 2 Skills to add +20") +let items = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 2, "Choisissez 2 Compétences pour y ajouter +20") items = items.map(i => i.toObject()) items.forEach(i => i.system.advances.value = 20) diff --git a/scripts/QwHoqu2oO8QO8Mad.js b/scripts/QwHoqu2oO8QO8Mad.js index a5972f6..084a8f6 100644 --- a/scripts/QwHoqu2oO8QO8Mad.js +++ b/scripts/QwHoqu2oO8QO8Mad.js @@ -1,3 +1,3 @@ -let content = `${this.effect.name}: All targets engaged with ${this.actor.prototypeToken.name} take [[/r 1d10]] Damage, modified by TB and AP.` +let content = `${this.effect.name}: Toute les cibles au contact abec ${this.actor.prototypeToken.name} subissent [[/r 1d10]] dégats, modifiés par le BE et les PA.` this.script.scriptMessage(content) \ No newline at end of file diff --git a/scripts/R32U01LBjBrK1pns.js b/scripts/R32U01LBjBrK1pns.js index 4816313..793479c 100644 --- a/scripts/R32U01LBjBrK1pns.js +++ b/scripts/R32U01LBjBrK1pns.js @@ -18,9 +18,9 @@ let bio = `Template: ${template.text}
-Phsyical Quirk: ${physicalQuirk}
-Work Ethic: ${workEthic}
-Personality Quirk: ${personalityQuirk}
+Bizarrerie Physique: ${physicalQuirk}
+Etique de travail: ${workEthic}
+Bizarrerie de personnalité: ${personalityQuirk}
` this.script.scriptMessage(bio, {whisper : ChatMessage.getWhisperRecipients("GM")}) diff --git a/scripts/RDtJXji3hgcKnEBk.js b/scripts/RDtJXji3hgcKnEBk.js index 84cd8d9..e557c94 100644 --- a/scripts/RDtJXji3hgcKnEBk.js +++ b/scripts/RDtJXji3hgcKnEBk.js @@ -3,7 +3,7 @@ let hv = (await fromUuid("Compendium.wfrp4e-core.items.Item.Nj3tC8A5fZ3zEdMR")). let ms = (await fromUuid("Compendium.wfrp4e-core.items.Item.6w30u0VPsAicrqb5")).toObject(); let ss = (await fromUuid("Compendium.wfrp4e-core.items.Item.OEjUvJKi0xmBwbS2")).toObject(); -as.name += " (Sight)"; +as.name += " (Vue)"; let roll = (await new Roll("1d10").roll()); roll.toMessage(this.script.getChatData()) diff --git a/scripts/RHyBLYT5oHf7EPnG.js b/scripts/RHyBLYT5oHf7EPnG.js index 0eeaadd..99ec6ac 100644 --- a/scripts/RHyBLYT5oHf7EPnG.js +++ b/scripts/RHyBLYT5oHf7EPnG.js @@ -1,6 +1,6 @@ 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 skill = await ItemDialog.create(skills, 1, "Sélectionnez la compétence à utiliser avec l'arme") let group = game.wfrp4e.utility.extractParenthesesText(skill[0]?.name) let groupKey = game.wfrp4e.utility.findKey(group, game.wfrp4e.config.weaponGroups) @@ -18,4 +18,4 @@ let weapon = { } 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"); \ No newline at end of file +this.script.scriptNotification("Item créé. Les modifications supplémentaires doivent être réalisées manuellement sur la fiche de l'objet."); \ No newline at end of file diff --git a/scripts/RKIFGN583PQnqHGk.js b/scripts/RKIFGN583PQnqHGk.js index c0633f0..223f490 100644 --- a/scripts/RKIFGN583PQnqHGk.js +++ b/scripts/RKIFGN583PQnqHGk.js @@ -1,5 +1,5 @@ if (args.opposedTest.result.hitloc.value == "body" && args.totalWoundLoss > 0) { args.actor.addCondition("bleeding", 2) - this.script.scriptMessage("Gained 2 Bleeding Conditions") + this.script.scriptMessage("Ajout de 2 état Hémorragiques") } \ No newline at end of file diff --git a/scripts/ROXCqAFSTLouJniL.js b/scripts/ROXCqAFSTLouJniL.js index dcc969a..979b433 100644 --- a/scripts/ROXCqAFSTLouJniL.js +++ b/scripts/ROXCqAFSTLouJniL.js @@ -2,6 +2,6 @@ if (args.test.spell.name == "Warp Lightning") { if (args.test.result.minormis || args.test.result.majormis || args.test.result.catastrophicmis) { - this.script.scriptMessage(`${this.item.name} Overloads!`) + this.script.scriptMessage(`${this.item.name} Surcharge!`) } } \ No newline at end of file diff --git a/scripts/RSsGiDFibuqg3sHr.js b/scripts/RSsGiDFibuqg3sHr.js index 9132550..af0157e 100644 --- a/scripts/RSsGiDFibuqg3sHr.js +++ b/scripts/RSsGiDFibuqg3sHr.js @@ -7,7 +7,7 @@ let diseaseIndex = game.packs return i }) -let choice = await ItemDialog.create(diseaseIndex , 1, "Choose a Disease") +let choice = await ItemDialog.create(diseaseIndex , 1, "Choisissez une maladie") if (choice[0]) { diff --git a/scripts/RrchOMpEdIvceJxl.js b/scripts/RrchOMpEdIvceJxl.js index 300050b..b1d1cc8 100644 --- a/scripts/RrchOMpEdIvceJxl.js +++ b/scripts/RrchOMpEdIvceJxl.js @@ -1 +1 @@ -return args.skill?.name == "Stealth (Rural)" \ No newline at end of file +return args.skill?.name == "Discrétion (Rurale)" \ No newline at end of file diff --git a/scripts/RvipIYj9H7n4UDMe.js b/scripts/RvipIYj9H7n4UDMe.js index 4ae90e5..1beaef4 100644 --- a/scripts/RvipIYj9H7n4UDMe.js +++ b/scripts/RvipIYj9H7n4UDMe.js @@ -48,7 +48,7 @@ } else { - ui.notifications.warn(`Could not find ${talent}`, {permanent : true}) + ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true}) } } @@ -65,7 +65,7 @@ } else { - ui.notifications.warn(`Could not find ${trapping}`, {permanent : true}) + ui.notifications.warn(`Impossible de trouver ${trapping}`, {permanent : true}) } } diff --git a/scripts/S1QihXuvdEVzeRtB.js b/scripts/S1QihXuvdEVzeRtB.js index 0194c09..dd7235c 100644 --- a/scripts/S1QihXuvdEVzeRtB.js +++ b/scripts/S1QihXuvdEVzeRtB.js @@ -27,7 +27,7 @@ else if (roll = 10) modifier = -5 } -message = `${roll} Rolled, gain ${item.name}, ${modifier} Strength` +message = `Résultat de ${roll}, gagnez ${item.name}, ${modifier} en Force` dice.toMessage(this.script.getChatData()) let changes = duplicate(this.effect.changes) diff --git a/scripts/S3Dev4hleOYqDNe9.js b/scripts/S3Dev4hleOYqDNe9.js index 82a4f59..c014e56 100644 --- a/scripts/S3Dev4hleOYqDNe9.js +++ b/scripts/S3Dev4hleOYqDNe9.js @@ -7,10 +7,10 @@ if (args.test.options.healWounds) { wounds = this.actor.characteristics.int.bonus + Math.min(1, Number(args.test.result.SL)) } args.test.result.woundsHealed = wounds - args.test.result.other.push(`${this.actor.name} healed ${wounds} wounds of the patient.`) + args.test.result.other.push(`${this.actor.name} guérit ${wounds} Points de Blessures du patient.`) } else if (this.actor.characteristics.int.bonus + Number(args.test.result.SL) < 0) { - args.test.result.other.push(`The patient contracts a @UUID[Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg]{Minor Infection}.`) + args.test.result.other.push(`Le patient subit une @UUID[Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg]{Infection Mineure}.`) } } \ No newline at end of file diff --git a/scripts/SGr50Hq1AHIEzIFN.js b/scripts/SGr50Hq1AHIEzIFN.js index 324b7a2..0b6d374 100644 --- a/scripts/SGr50Hq1AHIEzIFN.js +++ b/scripts/SGr50Hq1AHIEzIFN.js @@ -1,6 +1,6 @@ let choice = await ItemDialog.create(ItemDialog.objectToArray({ int : game.wfrp4e.config.characteristics.int, fel : game.wfrp4e.config.characteristics.fel -}, this.effect.img), 1, "Choose Characteristic"); +}, this.effect.img), 1, "Choisissez une caractéristique"); this.effect.updateSource({"flags.wfrp4e.characteristic" : choice[0].id}) \ No newline at end of file diff --git a/scripts/T5fiTzhXEQAv9Drf.js b/scripts/T5fiTzhXEQAv9Drf.js index 536b32a..b4d5c21 100644 --- a/scripts/T5fiTzhXEQAv9Drf.js +++ b/scripts/T5fiTzhXEQAv9Drf.js @@ -11,7 +11,7 @@ if (location) if (dropped.length) { - this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(", ")}!`) + this.script.scriptNotification(`Laché ${dropped.map(i => i.name).join(", ")}!`) for(let weapon of dropped) { await weapon.system.toggleEquip(); diff --git a/scripts/TAw9vXnfyIAl5DGs.js b/scripts/TAw9vXnfyIAl5DGs.js index c6062cd..587a05a 100644 --- a/scripts/TAw9vXnfyIAl5DGs.js +++ b/scripts/TAw9vXnfyIAl5DGs.js @@ -7,5 +7,5 @@ if (this.item.system.quantity.value) } else { - this.script.scriptNotification("None left!", "error") + this.script.scriptNotification("Quantité insuffisante!", "error") } \ No newline at end of file diff --git a/scripts/TBpNFRL5uehs0fze.js b/scripts/TBpNFRL5uehs0fze.js index be5a2fb..974d619 100644 --- a/scripts/TBpNFRL5uehs0fze.js +++ b/scripts/TBpNFRL5uehs0fze.js @@ -6,5 +6,5 @@ if (this.item.system.quantity.value) } else { - this.script.scriptNotification("None left!", "error") + this.script.scriptNotification("Quantité insuffisante!", "error") } \ No newline at end of file diff --git a/scripts/TwgdEucxcHloc4cX.js b/scripts/TwgdEucxcHloc4cX.js index 325d158..08c7bb0 100644 --- a/scripts/TwgdEucxcHloc4cX.js +++ b/scripts/TwgdEucxcHloc4cX.js @@ -1,135 +1,129 @@ let choice1 = [ - { - type : "armour", - name : "Mail Chausses" - }, - { - type : "armour", - name : "Mail Coat" - }, - { - type : "armour", - name : "Mail Coif" - }, + { + type: "armour", + name: "Chausses de Mailles" + }, + { + type: "armour", + name: "Cotte de Mailles" + }, + { + type: "armour", + name: "Coiffe de Mailles" + }, ] let choice2 = [ - { - type : "armour", - name : "Mail Chausses" - }, - { - type : "armour", - name : "Mail Coat" - }, - { - type : "armour", - name : "Mail Coif" - }, - { - type : "armour", - name : "Leather Leggings" - }, - { - type : "armour", - name : "Leather Skullcap" - }, - { - type : "armour", - name : "Leather Jack" - }, + { + type: "armour", + name: "Chausses de Mailles" + }, + { + type: "armour", + name: "Cotte de Mailles" + }, + { + type: "armour", + name: "Coiffe de Mailles" + }, + { + type: "armour", + name: "Jambières de Cuir" + }, + { + type: "armour", + name: "Calotte de Cuir" + }, + { + type: "armour", + name: "Veste de Cuir" + }, ] let choice3 = [ - { - type : "armour", - name : "Plate Breastplate" - }, - { - type : "armour", - name : "Plate Bracers" - }, - { - type : "armour", - name : "Plate Helm" - }, - { - type : "armour", - name : "Plate Leggings" - }, + { + type: "armour", + name: "Plastron d'acier" + }, + { + type: "armour", + name: "Brassards" + }, + { + type: "armour", + name: "Heaume" + }, + { + type: "armour", + name: "Jambières d'acier" + }, ] let choice = await new Promise((resolve, reject) => { - new Dialog({ - title : "Choice", - content : - `- Select your choice + new Dialog({ + title: "Choix", + content: + `
+ Selectionnez votre choix
- Select your choice + Sélectionnez votre choix
${this.effect.name}: Is this a ranged or magical attack that orignates outside the Dome?
`, + content: `${this.effect.name}: Est-ce que l'attaque magique ou à distance provient de l'extérieur du Dome?
`, buttons: { yes: { - label: "Yes", + label: "Oui", callback: () => { return true; } }, no: { - label: "No", + label: "Non", callback: () => { return false; } diff --git a/scripts/qu194dVXm9Vx1TGk.js b/scripts/qu194dVXm9Vx1TGk.js index c99393f..756fd99 100644 --- a/scripts/qu194dVXm9Vx1TGk.js +++ b/scripts/qu194dVXm9Vx1TGk.js @@ -1,10 +1,10 @@ -if (args.test.options.useOnesSupportive && (args.test.result.roll <= game.settings.get("wfrp4e", "automaticSuccess") || args.test.result.roll <= args.test.target)) -{ +if (args.test.options.useOnesSupportive && (args.test.result.roll <= game.settings.get("wfrp4e", "automaticSuccess") || args.test.result.roll <= args.test.target)) { -let SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10) -let ones = Number(args.test.result.roll.toString().split("").pop()) + let SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10) + let ones = Number(args.test.result.roll.toString().split("").pop()) -if (ones > SL) - args.test.data.result.SL = "+" + (ones + args.test.successBonus + args.test.slBonus) - args.test.result.other.push(`${this.effect.name}: Used unit dice as SL`) + if (ones > SL) { + args.test.data.result.SL = "+" + (ones + args.test.successBonus + args.test.slBonus) + args.test.result.other.push(`${this.effect.name}: Utilise le dé d'unité comme DR`) + } } \ No newline at end of file diff --git a/scripts/qxzhPtysAjPWspKf.js b/scripts/qxzhPtysAjPWspKf.js index 934561e..90bcbd0 100644 --- a/scripts/qxzhPtysAjPWspKf.js +++ b/scripts/qxzhPtysAjPWspKf.js @@ -1,4 +1,4 @@ -if (this.actor.has("Undead") || this.actor.has("Daemonic")) +if (this.actor.has("Mort-vivant") || this.actor.has("Démoniaque")) { - this.script.scriptNotification(`Cannot enter ${this.effect.name}!`); + this.script.scriptNotification(`Ne peut entrer ${this.effect.name}!`); } \ No newline at end of file diff --git a/scripts/rCh3ltUrUMovd2Kc.js b/scripts/rCh3ltUrUMovd2Kc.js index 4b1b1b1..5145c61 100644 --- a/scripts/rCh3ltUrUMovd2Kc.js +++ b/scripts/rCh3ltUrUMovd2Kc.js @@ -1,5 +1,5 @@ if (this.actor.hasCondition("surprised")) { - this.script.scriptNotification("Cannot be surprised"); + this.script.scriptNotification("Ne peut être surpris"); this.actor.removeCondition("surprised"); } \ No newline at end of file diff --git a/scripts/rF0Z3hTUUnSxL3Mq.js b/scripts/rF0Z3hTUUnSxL3Mq.js index 93d9ab0..38216c0 100644 --- a/scripts/rF0Z3hTUUnSxL3Mq.js +++ b/scripts/rF0Z3hTUUnSxL3Mq.js @@ -5,7 +5,7 @@ let nightVision = (await fromUuid("Compendium.wfrp4e-core.items.FmHDbCOy3pH8yKhm let tracker = (await fromUuid("Compendium.wfrp4e-core.items.ClOlztW6hH8rslbp")).toObject() let weapon = (await fromUuid("Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM")).toObject() -armour.name = "Armour (Hide)" +armour.name = "Armure (Caché)" armour.system.specification.value = 2 bite.system.specification.value = 3 fear.system.specification.value = 2 @@ -26,12 +26,12 @@ let regenerate = (await fromUuid("Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR" let size = (await fromUuid("Compendium.wfrp4e-core.items.8slW8CJ2oVTxeQ6q")).toObject()//{Size (Large)} blessed.system.specification.value = "Ulric" -size.system.specification.value = "Large" +size.system.specification.value = "Grande" let optional = [belligerent, bestial, big, blessed, champion, die, fast, frenzy, immunity, regenerate, size]; -let chosen = await ItemDialog.create(optional, "unlimited", "Choose Optional Traits"); +let chosen = await ItemDialog.create(optional, "unlimited", "Choisissez un Trai optionnel"); items = items.concat(chosen || []) -this.script.scriptNotification(`Adding ${items.map(i => i.name).join(", ")}`); +this.script.scriptNotification(`Ajout de ${items.map(i => i.name).join(", ")}`); this.actor.createEmbeddedDocuments("Item", items, {fromEffect : this.effect.id}) diff --git a/scripts/ramav4ymrDDkPKK4.js b/scripts/ramav4ymrDDkPKK4.js index 639558d..f15a01f 100644 --- a/scripts/ramav4ymrDDkPKK4.js +++ b/scripts/ramav4ymrDDkPKK4.js @@ -1,9 +1,9 @@ if (this.actor.hasCondition("bleeding")) { this.actor.removeCondition("bleeding"); - this.script.scriptNotification("Removed 1 Bleeding Condition") + this.script.scriptNotification("Suppression d'1 état Hémmoragique") } else { - this.script.scriptNotification("No Bleeding Conditions"); + this.script.scriptNotification("Aucun état Hémorragique"); } \ No newline at end of file diff --git a/scripts/red2bt4PGgIWAdTR.js b/scripts/red2bt4PGgIWAdTR.js index c4ba998..3abf986 100644 --- a/scripts/red2bt4PGgIWAdTR.js +++ b/scripts/red2bt4PGgIWAdTR.js @@ -5,10 +5,10 @@ if (this.item.system.quantity.value) let effectData = this.item.effects.contents[0].convertToApplied(); let minutes = Math.ceil(CONFIG.Dice.randomUniform() * 10) * 10; effectData.duration.seconds = 60 * minutes - this.script.scriptMessage(`Duration: ${minutes} minutes`, {whisper : ChatMessage.getWhisperRecipients("GM")}) + this.script.scriptMessage(`Durée: ${minutes} minutes`, {whisper : ChatMessage.getWhisperRecipients("GM")}) actor.applyEffect({effectData : [effectData]}) } else { - this.script.scriptNotification("None left!", "error") + this.script.scriptNotification("Aucun disponible!", "error") } \ No newline at end of file diff --git a/scripts/rnioLwiJP7ps5Jwy.js b/scripts/rnioLwiJP7ps5Jwy.js index 7163d7f..2a24ede 100644 --- a/scripts/rnioLwiJP7ps5Jwy.js +++ b/scripts/rnioLwiJP7ps5Jwy.js @@ -1,4 +1,4 @@ -if (args.item.type == "skill" && args.item.name == "Melee (Basic)") +if (args.item.type == "skill" && args.item.name == "Corps à corps (Base)") { args.item.system.modifier.value += 30; } \ No newline at end of file diff --git a/scripts/rpxQU26BU7nwjtqY.js b/scripts/rpxQU26BU7nwjtqY.js index 85e811c..3ed305a 100644 --- a/scripts/rpxQU26BU7nwjtqY.js +++ b/scripts/rpxQU26BU7nwjtqY.js @@ -1,5 +1,5 @@ let location = this.item.system.location.key -let test = await this.actor.setupCharacteristic("dex", {context : {failure : `${this.effect.name}: Drop the item!`}, skipTargets: true, appendTitle : " - " + this.effect.name, fields : {difficulty : "average"}}) +let test = await this.actor.setupCharacteristic("dex", {context : {failure : `${this.effect.name}: Lâche l'objet!`}, skipTargets: true, appendTitle : " - " + this.effect.name, fields : {difficulty : "average"}}) await test.roll(); @@ -9,7 +9,7 @@ if (location && test.failed) if (dropped.length) { - this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(", ")}!`) + this.script.scriptNotification(`Laché ${dropped.map(i => i.name).join(", ")}!`) for(let weapon of dropped) { await weapon.system.toggleEquip(); diff --git a/scripts/sB4KB9bT3nQhAoqG.js b/scripts/sB4KB9bT3nQhAoqG.js index 4401b71..2b55ef5 100644 --- a/scripts/sB4KB9bT3nQhAoqG.js +++ b/scripts/sB4KB9bT3nQhAoqG.js @@ -1,12 +1,12 @@ // This script needs to be separate because equipTransfer is off on the other effect, and thus won't execute when added to an actor let mainEffect = this.item.effects.contents[0]; -if (mainEffect.name.includes("By imbibing this potion, ${this.actor.prototypeToken.name} has becomes subject to Frenzy. This Frenzy lasts [[1d10]] Rounds, and may not be ended sooner.
`, +this.script.scriptMessage(`En buvant cette potion, ${this.actor.prototypeToken.name} est devenu sujet à la Frénesie. Cette Frénésie dure [[1d10]] Rounds, et ne peut pas se terminer avant.
`, {whisper: ChatMessage.getWhisperRecipients("GM"), blind: true }) \ No newline at end of file diff --git a/scripts/sZwLitzwKBTaFca3.js b/scripts/sZwLitzwKBTaFca3.js index 4d00d6e..34341d3 100644 --- a/scripts/sZwLitzwKBTaFca3.js +++ b/scripts/sZwLitzwKBTaFca3.js @@ -1,4 +1,4 @@ let item = await fromUuid("Compendium.wfrp4e-core.items.Item.5hH73j2NgPdsLCZN") let data = item.toObject(); -data.name = data.name.replace("Target", "Greenskins, Undead, Chaos") +data.name = data.name.replace("Cible", "Peaux vertes, Mort-vivant, Chaos") this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/scripts/sbK1a7txpSoXFzyB.js b/scripts/sbK1a7txpSoXFzyB.js index 079b4dc..2396c93 100644 --- a/scripts/sbK1a7txpSoXFzyB.js +++ b/scripts/sbK1a7txpSoXFzyB.js @@ -1,10 +1,10 @@ -if (args.test.options.useOnesArgumentative && (args.test.result.roll <= game.settings.get("wfrp4e", "automaticSuccess") || args.test.result.roll <= args.test.target)) -{ +if (args.test.options.useOnesArgumentative && (args.test.result.roll <= game.settings.get("wfrp4e", "automaticSuccess") || args.test.result.roll <= args.test.target)) { -let SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10) -let ones = Number(args.test.result.roll.toString().split("").pop()) + let SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10) + let ones = Number(args.test.result.roll.toString().split("").pop()) -if (ones > SL) - args.test.data.result.SL = "+" + (ones + args.test.successBonus + args.test.slBonus) - args.test.result.other.push(`${this.effect.name}: Used unit dice as SL`) + if (ones > SL) { + args.test.data.result.SL = "+" + (ones + args.test.successBonus + args.test.slBonus) + args.test.result.other.push(`${this.effect.name}: Utilise le dé d'unité comme DR`) + } } \ No newline at end of file diff --git a/scripts/sgS9rblPkQB36C8S.js b/scripts/sgS9rblPkQB36C8S.js index 49348b1..78a09ae 100644 --- a/scripts/sgS9rblPkQB36C8S.js +++ b/scripts/sgS9rblPkQB36C8S.js @@ -14,11 +14,11 @@ let index = game.packs return i }) -let choice = await ItemDialog.create(index, 1, "Choose a Trade Skill") +let choice = await ItemDialog.create(index, 1, "Choisissez une compétence Métier") let text; if (!choice[0]) { - let custom = await ValueDialog.create("Enter Custom Trade Skill", "Custom Trade"); + let custom = await ValueDialog.create("Saisissez une spécialisation de Métier", "Custom Trade"); text = custom || "" } else diff --git a/scripts/shkBUtUuMPDKvFm7.js b/scripts/shkBUtUuMPDKvFm7.js index 641a6b6..601e774 100644 --- a/scripts/shkBUtUuMPDKvFm7.js +++ b/scripts/shkBUtUuMPDKvFm7.js @@ -1,4 +1,4 @@ -let test = await this.actor.setupSkill("Dodge", {fields : {difficulty : "average"}}) +let test = await this.actor.setupSkill("Esquive", {fields : {difficulty : "average"}}) let caster = this.effect.sourceActor let fallen = this.effect.sourceTest.result.SL + caster.characteristics.wp.bonus @@ -6,5 +6,5 @@ await test.roll(); if (test.failed) { this.actor.addCondition("prone") - this.script.scriptMessage(`${this.actor.prototypeToken.name} falls ${fallen} yards`) + this.script.scriptMessage(`${this.actor.prototypeToken.name} tombe de ${fallen} mètres`) } \ No newline at end of file diff --git a/scripts/sx7Ikn8WW00gBFb4.js b/scripts/sx7Ikn8WW00gBFb4.js index d413850..72ec0cd 100644 --- a/scripts/sx7Ikn8WW00gBFb4.js +++ b/scripts/sx7Ikn8WW00gBFb4.js @@ -2,11 +2,11 @@ let location = (Math.ceil(CONFIG.Dice.randomUniform() * 2) == 2 ? "r" : "l") + " if (location == "lArm") { - this.script.scriptNotification("Rolled Left") + this.script.scriptNotification("Résultat : gauche") } else if (location == "rArm") { - this.script.scriptNotification("Rolled Right") + this.script.scriptNotification("Résultat : Droite") } this.effect.updateSource({"flags.wfrp4e.location" : location}); @@ -17,7 +17,7 @@ if (location) if (dropped.length) { - this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(", ")}!`) + this.script.scriptNotification(`Laché ${dropped.map(i => i.name).join(", ")}!`) for(let weapon of dropped) { await weapon.system.toggleEquip(); @@ -27,6 +27,6 @@ if (location) let roll = await new Roll("1d10").roll() -roll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Duration)`})); +roll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Durée)`})); this.effect.updateSource({"duration.rounds" : roll.total}) \ No newline at end of file diff --git a/scripts/syqqBkyP5tGqZ78t.js b/scripts/syqqBkyP5tGqZ78t.js index 265c5fd..1aa106f 100644 --- a/scripts/syqqBkyP5tGqZ78t.js +++ b/scripts/syqqBkyP5tGqZ78t.js @@ -1,8 +1,8 @@ -this.actor.has("Immunity to Psychology")?.delete(); +this.actor.has("Immunité Psychologique")?.delete(); let roll = await new Roll("1d10").roll(); roll.toMessage(this.script.getChatData()); -this.script.scriptNotification(`Removed Immunity to Psychology, Adding ${roll.total} Broken Conditions`) +this.script.scriptNotification(`Immunité Psychologique a été supprimé de l'acteur, ajout de ${roll.total} états Brisé`) this.actor.addCondition("broken", roll.total, {"flags.wfrp4e.blasted-mind" : true}) \ No newline at end of file diff --git a/scripts/t56mnblo1kv3gM1M.js b/scripts/t56mnblo1kv3gM1M.js index ce5fba9..906ab3a 100644 --- a/scripts/t56mnblo1kv3gM1M.js +++ b/scripts/t56mnblo1kv3gM1M.js @@ -1 +1 @@ -return args.skill?.name.includes("Melee (Basic)") || (args.type == "weapon" && args.item?.system.weaponGroup.value == "basic"); \ No newline at end of file +return args.skill?.name.includes("Corps à corps (Base)") || (args.type == "weapon" && args.item?.system.weaponGroup.value == "basic"); \ No newline at end of file diff --git a/scripts/tCIT1a12Gt6k2ohA.js b/scripts/tCIT1a12Gt6k2ohA.js index e054b71..47daae0 100644 --- a/scripts/tCIT1a12Gt6k2ohA.js +++ b/scripts/tCIT1a12Gt6k2ohA.js @@ -5,7 +5,7 @@ if (this.item.name.includes("(")) } else { - resistance = await ValueDialog.create("Enter Resistance", "Resistance") + resistance = await ValueDialog.create("Entrez la Résistance", "Résistance") if (resistance) { @@ -13,7 +13,7 @@ else this.effect.updateSource({name : this.effect.name + ` (${resistance})`}) } } -this.item.updateSource({"system.tests.value" : this.item.system.tests.value.replace("the associated Threat", resistance)}) +this.item.updateSource({"system.tests.value" : this.item.system.tests.value.replace("menace associée", resistance)}) if (resistance && !this.effect.name.includes("(")) { diff --git a/scripts/tGVEV6TLl310mFLP.js b/scripts/tGVEV6TLl310mFLP.js index 686b84a..8ca630f 100644 --- a/scripts/tGVEV6TLl310mFLP.js +++ b/scripts/tGVEV6TLl310mFLP.js @@ -3,5 +3,5 @@ if (args.applyAP && nonmagical) { let nonmagical = args.modifiers.ap.value - args.modifiers.ap.magical args.modifiers.ap.ignored += nonmagical - args.modifiers.ap.details.push("" + this.effect.name + ": Ignore Non-Magical AP (" + nonmagical + ")"); + args.modifiers.ap.details.push("" + this.effect.name + ": Ignore les PA non-magiques (" + nonmagical + ")"); } \ No newline at end of file diff --git a/scripts/tNTO1LVN7JqHf4YN.js b/scripts/tNTO1LVN7JqHf4YN.js index f35b126..b3c20cc 100644 --- a/scripts/tNTO1LVN7JqHf4YN.js +++ b/scripts/tNTO1LVN7JqHf4YN.js @@ -3,6 +3,6 @@ if (args.test.characteristicKey == "wp") if (args.test.failed) { this.actor.createEmbeddedDocuments("ActiveEffect", [game.wfrp4e.config.symptomEffects["malaise"]]) - this.script.scriptMessage(`Willpower Test failed, ${this.actor.prototypeToken.name} gains @Condition[Malaise] for [[1d10]] hours`, {whisper: ChatMessage.getWhisperRecipients("GM")}) + this.script.scriptMessage(`Test de Force Mentale échoué, ${this.actor.prototypeToken.name} subit @Condition[Malaise] pour [[1d10]] heures`, {whisper: ChatMessage.getWhisperRecipients("GM")}) } } \ No newline at end of file diff --git a/scripts/tUwP7TjrOOOnaCYJ.js b/scripts/tUwP7TjrOOOnaCYJ.js index c502cf0..847aba0 100644 --- a/scripts/tUwP7TjrOOOnaCYJ.js +++ b/scripts/tUwP7TjrOOOnaCYJ.js @@ -1,10 +1,10 @@ let fatigued = this.actor.hasCondition("fatigued") if (fatigued) { - this.script.scriptNotification(`Cleared ${fatigued.conditionValue} Fatigued Conditions`) + this.script.scriptNotification(`Suppression de ${fatigued.conditionValue} états Fatigué`) fatigued.delete(); } else { - this.script.scriptNotification(`No Fatigued Conditions`) + this.script.scriptNotification(`Aucun état Fatigué`) } \ No newline at end of file diff --git a/scripts/tcZug8ehU6lyYBd9.js b/scripts/tcZug8ehU6lyYBd9.js index 3ac13c4..1b51877 100644 --- a/scripts/tcZug8ehU6lyYBd9.js +++ b/scripts/tcZug8ehU6lyYBd9.js @@ -1 +1 @@ -return args.skill?.name != "Ranged (Blackpowder)" \ No newline at end of file +return args.skill?.name != "Projectiles (Poudre noire)" \ No newline at end of file diff --git a/scripts/tn6SwmjAuNzqE6dx.js b/scripts/tn6SwmjAuNzqE6dx.js index a7bacb4..e3cc68b 100644 --- a/scripts/tn6SwmjAuNzqE6dx.js +++ b/scripts/tn6SwmjAuNzqE6dx.js @@ -1,5 +1,5 @@ let damage = 0 -let test = await this.actor.setupSkill("Dodge", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}); +let test = await this.actor.setupSkill("Esquive", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}); await test.roll(); if (test.succeeded) diff --git a/scripts/toSrgcvWq9b5eN0K.js b/scripts/toSrgcvWq9b5eN0K.js index f3fabed..01c486e 100644 --- a/scripts/toSrgcvWq9b5eN0K.js +++ b/scripts/toSrgcvWq9b5eN0K.js @@ -1,4 +1,4 @@ let location = await game.wfrp4e.tables.rollTable("hitloc", {hideDSN: true}) this.item.updateSource({name : `${this.item.name} (${location.description})`}) -this.script.scriptMessage(`Location: ${location.description}`, { whisper: ChatMessage.getWhisperRecipients("GM") }) \ No newline at end of file +this.script.scriptMessage(`Localisation: ${location.description}`, { whisper: ChatMessage.getWhisperRecipients("GM") }) \ No newline at end of file diff --git a/scripts/uACa6u4JLNMRgFlr.js b/scripts/uACa6u4JLNMRgFlr.js index b4b0244..187f0c5 100644 --- a/scripts/uACa6u4JLNMRgFlr.js +++ b/scripts/uACa6u4JLNMRgFlr.js @@ -1,2 +1,2 @@ -const talents = await Promise.all(["Furious Assault", "Sea Legs"].map(game.wfrp4e.utility.findTalent)) +const talents = await Promise.all(["Assaut féroce", "Pied marin"].map(game.wfrp4e.utility.findTalent)) this.actor.createEmbeddedDocuments("Item", talents, {fromEffect : this.effect.id}) \ No newline at end of file diff --git a/scripts/uLBDnWC3S0lRitbj.js b/scripts/uLBDnWC3S0lRitbj.js index e858a83..7bf367c 100644 --- a/scripts/uLBDnWC3S0lRitbj.js +++ b/scripts/uLBDnWC3S0lRitbj.js @@ -9,7 +9,7 @@ if (opposedResult?.winner == "attacker") { this.actor.addCondition("unconscious") await this.actor.update({"system.status.corruption.value" : parseInt(this.actor.status.corruption.value) + 1}) - this.script.scriptMessage("Gained a Corruption point", {whisper : ChatMessage.getWhisperRecipients("GM")}) + this.script.scriptMessage("Reçoit un Point de Corruption", {whisper : ChatMessage.getWhisperRecipients("GM")}) } else { diff --git a/scripts/ucF4aiJ1gpDB333G.js b/scripts/ucF4aiJ1gpDB333G.js index 7d00add..6c8bb05 100644 --- a/scripts/ucF4aiJ1gpDB333G.js +++ b/scripts/ucF4aiJ1gpDB333G.js @@ -1,5 +1,5 @@ if (args.test.options.catfall && (args.test.result.roll <= game.settings.get("wfrp4e", "automaticSuccess") || args.test.result.roll <= args.test.target) && !args.test.result.catfall) { - args.test.result.other.push(`${this.effect.name}: Fall distance damage reduced by ${Number(args.test.result.SL) + 1} yards`) + args.test.result.other.push(`${this.effect.name}: Dommages de chutes réduit de ${Number(args.test.result.SL) + 1} mètres`) args.test.result.catfall = true; // Prevent duplicate messages } \ No newline at end of file diff --git a/scripts/ugL5IBB6R2yWyMWd.js b/scripts/ugL5IBB6R2yWyMWd.js index 1616e69..97340d8 100644 --- a/scripts/ugL5IBB6R2yWyMWd.js +++ b/scripts/ugL5IBB6R2yWyMWd.js @@ -1,6 +1,6 @@ if (args.totalWoundLoss > 0) { - let apply = await Dialog.confirm({title : this.effect.name, content : `Appy ${this.effect.name} Damage? Attacker must have used bare hands or a melee weapon made of metal.`}) + let apply = await Dialog.confirm({title : this.effect.name, content : `
Appliquer les dégats de ${this.effect.name}? L'attaquant doit avoir utilisé ses mains nues ou une arme de mêlée faite de métal.`}) if (apply) { @@ -17,7 +17,7 @@ if (args.totalWoundLoss > 0) damage -= (APused + args.opposedTest.attacker.system.characteristics.t.bonus) let msg = await args.opposedTest.attacker.applyBasicDamage(damage, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL}); - msg += ` (ignored ${metalAP} metal AP on ${game.wfrp4e.config.locations[loc]})` + msg += ` (${metalAP} PA métalliques ignorés sur ${game.wfrp4e.config.locations[loc]})` this.script.scriptMessage(msg) } } \ No newline at end of file diff --git a/scripts/upfK6GM33qZCZjll.js b/scripts/upfK6GM33qZCZjll.js index 91935c0..f2e0c11 100644 --- a/scripts/upfK6GM33qZCZjll.js +++ b/scripts/upfK6GM33qZCZjll.js @@ -1 +1 @@ -return args.item?.name != "Play (Lute)" \ No newline at end of file +return args.item?.name != "Musicien (Luth)" \ No newline at end of file diff --git a/scripts/uwdQvZtzy2HVeEzx.js b/scripts/uwdQvZtzy2HVeEzx.js index 685fa84..f181413 100644 --- a/scripts/uwdQvZtzy2HVeEzx.js +++ b/scripts/uwdQvZtzy2HVeEzx.js @@ -8,7 +8,7 @@ if (args.totalWoundLoss > 0) await test.roll(); if (test.failed) { - this.script.scriptMessage("" + args.actor.name + " takes a @Table[critbody]{Critical Hit} to the torse", {whisper: ChatMessage.getWhisperRecipients("GM")}) + this.script.scriptMessage("" + args.actor.name + " subit un @Table[critbody]{Blessure Critique} au torse", {whisper: ChatMessage.getWhisperRecipients("GM")}) } }) } diff --git a/scripts/v4CCxVaVGf9i8U7X.js b/scripts/v4CCxVaVGf9i8U7X.js index abab0d3..cd216b9 100644 --- a/scripts/v4CCxVaVGf9i8U7X.js +++ b/scripts/v4CCxVaVGf9i8U7X.js @@ -1,9 +1,9 @@ let cured = await Dialog.wait({ title : this.effect.name, - content : "
Enter the number of diseases/poisons cured
", + content : "Entrez le nombre de Poisons/Maladies soignés
", buttons : { confirm : { - label : "Confirm", + label : "Confirmer", callback : (dlg) => { let input = dlg.find("input"); value = parseInt(input[0].value); diff --git a/scripts/v5xrDWcrTNFJkyQB.js b/scripts/v5xrDWcrTNFJkyQB.js index da60300..c2c9e3d 100644 --- a/scripts/v5xrDWcrTNFJkyQB.js +++ b/scripts/v5xrDWcrTNFJkyQB.js @@ -1,7 +1,7 @@ let choice1 = [ { type : "skill", - name : "Ranged (Bow)", + name : "Projectiles (Arc)", diff : { system : { advances : { @@ -12,11 +12,11 @@ let choice1 = [ }, { type : "weapon", - name : "Longbow", + name : "Arc long", }, { type : "ammunition", - name : "Arrow", + name : "Flèche", } ] let choice2 = [ @@ -26,7 +26,7 @@ let choice = await Dialog.wait({ title : "Option", content : `- Add Option? + Ajouter l'ption?
${item.name} loses all Qualities
` + msg += `${item.name} per toutes ses Qualités
` } else { - msg += `${item.name} crumbles into dust!
` - await item.update({name : item.name + " (Dust)"}) + msg += `${item.name} tombe en poussière!
` + await item.update({name : item.name + " (Poussières)"}) } } if(msg) diff --git a/scripts/whUSkaR1yem21bXp.js b/scripts/whUSkaR1yem21bXp.js index c2c2f1b..37a1864 100644 --- a/scripts/whUSkaR1yem21bXp.js +++ b/scripts/whUSkaR1yem21bXp.js @@ -10,10 +10,10 @@ let characteristics = { "wp" : 0, "fel" : 10 } -let skills = ["Melee (Basic)", "Track"] +let skills = ["Corps à corps (Base)", "Pistage"] let skillAdvancements = [8, 7] -let talents = ["Berserk Charge", "Careful Strike", "Strike to Injure"] -let traits = ["Flight (8)", "Fury", "Swarm", "Tracker"] +let talents = ["Charge Berserk", "Frappe précise", "Frappe blessante"] +let traits = ["Vol (8)", "Rage", "Essaim", "Pisteur"] let trappings = [] let items = []; let spells = []; @@ -50,7 +50,7 @@ for (let talent of talents) } else { - ui.notifications.warn(`Could not find ${talent}`, {permanent : true}) + ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true}) } } @@ -68,13 +68,13 @@ for (let trait of traits) } catch { } if (!traitItem) { - ui.notifications.warn(`Could not find ${trait}`, {permanent : true}) + ui.notifications.warn(`Impossible de trouver ${trait}`, {permanent : true}) } traitItem = traitItem.toObject() if (Number.isNumeric(traitVal)) { - traitItem.system.specification.value = traitName.includes('Weapon','Horns','Tail','Tentacles','Bite') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal; + traitItem.system.specification.value = traitName.includes('Arme','Cornes','Queue','Tentacules','Morsure') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal; traitItem.name = (traitItem.name + ` ${traitSpec ? "("+ traitSpec + ")" : ""}`).trim() } else diff --git a/scripts/wsqNM4NHnwaAAQym.js b/scripts/wsqNM4NHnwaAAQym.js index a07f054..a58738b 100644 --- a/scripts/wsqNM4NHnwaAAQym.js +++ b/scripts/wsqNM4NHnwaAAQym.js @@ -1,6 +1,6 @@ args.applyAP = false; - this.script.scriptNotification("This test only applies to criminals, otherwise close the dialog."); + this.script.scriptNotification("Ce test ne s'applique seulement qu'aux criminels. Fermez cette fenêtre si ce n'est pas le cas."); this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields : {difficulty : "average"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => { await test.roll(); diff --git a/scripts/wyTCozh9qGTx6yK0.js b/scripts/wyTCozh9qGTx6yK0.js index c2afa63..2bf2400 100644 --- a/scripts/wyTCozh9qGTx6yK0.js +++ b/scripts/wyTCozh9qGTx6yK0.js @@ -1,5 +1,5 @@ if (args.options.terror || args.extendedTest?.getFlag("wfrp4e", "fear")) { args.abort = true; - this.script.scriptNotification("Does not need to make Fear or Terror tests"); + this.script.scriptNotification("N'a pas besoin de faire de test de Peur ou de Terreur"); } \ No newline at end of file diff --git a/scripts/x2RLUUNB7BiIDYCP.js b/scripts/x2RLUUNB7BiIDYCP.js index 0ab5fe7..1f2d040 100644 --- a/scripts/x2RLUUNB7BiIDYCP.js +++ b/scripts/x2RLUUNB7BiIDYCP.js @@ -1,8 +1,8 @@ let difficulty = "" - if (this.effect.name.includes("Moderate")) + if (this.effect.name.includes("Modéré")) difficulty = "easy" - else if (this.effect.name.includes("Severe")) + else if (this.effect.name.includes("Sévère")) difficulty = "average" else difficulty = "veasy" diff --git a/scripts/x9iKFYYc4Ocy8PTS.js b/scripts/x9iKFYYc4Ocy8PTS.js index 9f078b6..88ca8b1 100644 --- a/scripts/x9iKFYYc4Ocy8PTS.js +++ b/scripts/x9iKFYYc4Ocy8PTS.js @@ -1,11 +1,11 @@ let item = this.effect.getCreatedItems()?.[0]; -ChatMessage.create({content : "Grace is beyond style", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true}) +ChatMessage.create({content : "La grâce est au delà du style", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true}) let choice = await ItemDialog.create(ItemDialog.objectToArray({ "nobles" : "Nobles", - "guilders" : "Guilders", - "servants" : "Servants" -}), 1, "Choose Group") + "guilders" : "Maitres de Guildes", + "servants" : "Serviteurs" +}), 1, "Choisissez un groupes") let name = choice[0]?.name diff --git a/scripts/xRd6oA1QWLVpfoBm.js b/scripts/xRd6oA1QWLVpfoBm.js index db785fb..9b5f8dd 100644 --- a/scripts/xRd6oA1QWLVpfoBm.js +++ b/scripts/xRd6oA1QWLVpfoBm.js @@ -1,4 +1,4 @@ -if (!this.actor.has("Night Vision")) +if (!this.actor.has("Vision Nocturne")) { let item = await fromUuid("Compendium.wfrp4e-core.items.FmHDbCOy3pH8yKhm"); let data = item.toObject(); diff --git a/scripts/xS2su09zcza9du09.js b/scripts/xS2su09zcza9du09.js index 592e0c2..0f65f3f 100644 --- a/scripts/xS2su09zcza9du09.js +++ b/scripts/xS2su09zcza9du09.js @@ -1,8 +1,8 @@ -if (["Minor", "Moderate", "Major"].includes(this.item.system.specification.value)) +if (["Mineure", "Modérée", "Majeure"].includes(this.item.system.specification.value)) { return } -let choice = await ItemDialog.create(ItemDialog.objectToArray({minor : "Minor", moderate : "Moderate", major : "Major"}, this.item.img), 1, "Choose Corruption Severity"); +let choice = await ItemDialog.create(ItemDialog.objectToArray({minor : "Mineure", moderate : "Modérée", major : "Majeure"}, this.item.img), 1, "Choisissez la sévérite de la corruption"); this.item.updateSource({"system.specification.value" : choice[0]?.name || ""}) \ No newline at end of file diff --git a/scripts/xUpKYT7BZCSmAfUy.js b/scripts/xUpKYT7BZCSmAfUy.js index 6e013b0..02c1ec7 100644 --- a/scripts/xUpKYT7BZCSmAfUy.js +++ b/scripts/xUpKYT7BZCSmAfUy.js @@ -6,5 +6,5 @@ if (this.item.system.quantity.value) } else { - this.script.scriptNotification("None left!", "error") + this.script.scriptNotification("Quantité insuffisante!", "error") } \ No newline at end of file diff --git a/scripts/xgplXZMs459X7XXM.js b/scripts/xgplXZMs459X7XXM.js index af8f73d..92309e0 100644 --- a/scripts/xgplXZMs459X7XXM.js +++ b/scripts/xgplXZMs459X7XXM.js @@ -2,10 +2,9 @@ if (args.equipped) { this.actor.createEmbeddedDocuments("ActiveEffect", [this.item.effects.contents[1]?.convertToApplied()]) - this.script.scriptMessage(`${this.actor.name} dons the ${this.item.name}.