1CeYp5MlPcH68UIw.js mixed English and French skill/talent/trapping names (Intimidate, Commandement, Menaçant, Arme simple...) in an NPC statblock-building script. Replaced with the actual German names used in the core compendium, matching the lookup-by-exact-name convention used throughout scripts/. Note: the earlier "1 file left" estimate was right; a follow-up grep across all of scripts/ that showed ~95 hits was a false alarm caused by bash's grep doing byte-wise matching against the accented-character class in this shell's locale, flagging German umlauts/en-dashes as false positives. Verified with Node's proper Unicode regex instead. Rebuilt modules/loadScripts.js; all 2114 scripts still parse cleanly.
4 lines
713 KiB
JavaScript
4 lines
713 KiB
JavaScript
export default function()
|
||
{
|
||
mergeObject(game.wfrp4e.config.effectScripts, {"00ZCnahnTGvzG9KA":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.weczkAMPlTjX7lqU\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item])","01VFjGVxkjb5P1ve":"return args.item?.system?.isRanged && args.data.targets[0]?.actor?.sizeNum < 3","03mJu59V4iByWlsO":"// The imbiber immediately\r\n// takes 3 Poisoned Conditions that cannot be resisted at first,\r\nawait this.actor.addCondition(\"poisoned\", 3)\r\n\r\n// recovers a number of Wounds equal to their Toughness Bonus, \r\nawait this.actor.modifyWounds(this.actor.system.characteristics.t.bonus)\r\n\r\n// and acquires the Regenerate Creature Trait.\r\nconst hasRegenerate = this.actor.has(\"Regenerieren\")\r\nif (hasRegenerate === undefined) {\r\n fromUuid(\"Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR\").then(trait => {\r\n let traitItem = trait.toObject()\r\n this.actor.createEmbeddedDocuments(\"Item\", [traitItem], {fromEffect: this.effect.id})\r\n })\r\n}\r\n\r\nthis.script.scriptMessage(`<p><strong>${this.actor.prototypeToken.name}</strong> hat:\r\n <ul>\r\n <li>3 Vergiftet Zustände, denen nicht widerstanden werden kann</li>\r\n <li>Bekommt ${this.actor.system.characteristics.t.bonus} Wunden wieder</li>\r\n <li>Erhält die Kreatur-Eigenschaft Regenerieren.</li>\r\n </ul>\r\n Es ist Ranalds Wahl, ob die Regenerieren die Vergiftung heilen kann.</p>\r\n <p>Wenn alle Vergifteten Zustände beendet sind, geht auch die Eigenschaft Regenerieren verloren.</p>`,\r\n\r\n { whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true }) \r\n","04bAiHISSW53w94Y":"this.actor.addCondition(\"blinded\", 3)","06IaVCOC0RCJbxEf":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.8piWcBKFlQ2J1E3A\")\r\nlet data = item.toObject();\r\ndata.system.location.key= this.item.system.location.key\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data])","07tvKnPT8ICtv2us":"if (args.test.result.misfire && args.test.result.roll !== 100) {\n delete args.test.result.misfire\n}","08S8Ozi5b4EdwZp5":"args.fields.slBonus += this.actor.system.characteristics.wp.bonus;","09sSpnW8z2zcVEdf":"if (!args.flags.quietenedApplied)\r\n{\r\n args.fields.modifier += 10;\r\n args.flags.quietenedApplied = true\r\n}","0abwNjpzo3SbEOeO":"if (args.applyAP && args.modifiers.ap.metal) \r\n{\r\n args.modifiers.ap.ignored += args.modifiers.ap.metal\r\n args.modifiers.ap.details.push(\"<strong>\" + this.effect.name + \"</strong>: Ignore Metal (\" + args.modifiers.ap.metal + \")\");\r\n args.modifiers.ap.metal = 0\r\n}","0amHqfjTRp5ff6Op":"let wounds = this.effect.sourceActor.system.characteristics.wp.bonus;\nthis.actor.modifyWounds(wounds);\nthis.script.message(`Soigne ${wounds} Blessures`);","0BP5l7bIkf744G1k":"return !args.options.terror && !args.extendedTest?.flags.wfrp4e?.fear","0cNnOYQnj7nFL0mD":"this.item.system.encumbrance.value = Math.max(0, this.item.system.encumbrance.value - 1)","0e0UZT2FodOJDdgW":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.GbDyBCu8ZjDp6dkj\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","0e7OkamNAaAk4Oit":"let item1 = await fromUuid(\"Compendium.wfrp4e-core.items.3S4OYOZLauXctmev\")\r\nlet item2 = await fromUuid(\"Compendium.wfrp4e-core.items.7mCcI3q7hgWcmbBU\")\r\n\r\nlet data1 = item1.toObject();\r\ndata1.system.location.key = this.item.system.location.key\r\n\r\nlet data2 = item2.toObject();\r\ndata2.system.location.key = this.item.system.location.key\r\n\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data1, data2], {fromEffect: this.effect.id})\r\n","0FNOq4J1AdPd2A0q":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Row\")) && !args.skill?.name.includes(game.i18n.localize(\"NAME.Sail\"));","0FWto1oEr3jbWggw":"let spells = await warhammer.utility.findAllItems(\"spell\", \"Loading Spells\")\n\nlet text = (await game.wfrp4e.tables.rollTable(\"random-caster\", {hideDSN: true})).result\n\nlore = Array.from(text.matchAll(/{(.+?)}/gm))[0][1]\n\nif (text == \"GM's Choice\")\n{\n return this.script.scriptNotification(text)\n}\n\nif (spellsWithLore.length > 0)\n{\n let spellsWithLore = spells.filter(i => game.wfrp4e.config.magicLores[i.system.lore.value] == lore)\n let selectedSpell = spellsWithLore[Math.floor(CONFIG.Dice.randomUniform() * spellsWithLore.length)]\n this.script.scriptNotification(selectedSpell.name);\n this.actor.createEmbeddedDocuments(\"Item\", [selectedSpell])\n}\nelse\n{\n ui.notifications.notify(`${lore} nicht gefunden spell. Try Again`)\n}","0H2syk6qc0sCY0pj":"if ( args.actor.has(game.i18n.localize(\"NAME.AA\"), \"talent\") ||\nargs.actor.has(game.i18n.localize(\"NAME.SecondSight\"), \"talent\") ) {\n\targs.modifiers.other.push({label : this.effect.name, value : 5, details : \"Das Ziel besitzt Ätherharmonisierung oder Zweites Gesicht\"});\n}","0hAbiNR1nFkpFMRz":"if (!this.actor.has(game.i18n.localize(\"NAME.SecondSight\"),\"talent\")) this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.OEjUvJKi0xmBwbS2\", this.effect)","0hgTyeaEhMBLwzUn":"let fearCounter = this.item.effects.filter(i => i.name == this.effect.name).length;\n\nfearCounter += Number(this.actor.has(\"Peur\")?.system.specification.value) || 0\n\ngame.wfrp4e.utility.postPeur(fearCounter || 1, this.effect.name)","0IAc5VFR2ogXOaGE":"return args.characteristic != \"int\" || args.type != \"characteristic\"","0iTLDgFHO9Rgc010":"args.fields.modifier -= 20;","0J1yHP1jkGR9y89H":"if (!this.item.system.properties.qualities.fast) \n this.item.system.qualities.value.push({name : 'fast'});\nif (!this.item.system.properties.qualities.magical) \n this.item.system.qualities.value.push({name : 'magical'});","0jTqyz0wRlK6XPF7":"if (args.test.spell)\r\n{\r\n\targs.test.result.other.push(`<strong>${this.effect.name}</strong>: Automatic Failure`)\r\n}","0KG3HoTNoZhaINIj":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.4CMKeDTDrRQZbPIJ\")\r\nlet fixation = (await game.wfrp4e.tables.rollTable(\"fixations\"))\r\nlet data = item.toObject();\r\ndata.system.specification.value = fixation.result;\r\nthis.item.updateSource({name : this.item.name += ` (${fixation.result})`});\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","0kUalAsb4OhtYbaJ":"return args.item?.system?.attackType == \"ranged\" && !this.actor.system.canFly.effects.filter(e => e.name == \"Flying\")[0].disabled","0LCQtsiK2aUfYRmD":"return ![\"t\", \"wp\"].includes(args.characteristic)","0mrUnxzufYgsR0Ph":"this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => {\r\n await test.roll()\r\n if (test.failed)\r\n {\r\n this.actor.addCondition(\"stunned\")\r\n }\r\n})\r\n","0NAD1LNcVyAZ1fC7":"return args.skill?.name !== game.i18n.localize(\"NAME.Cool\") && args.skill?.name !== game.i18n.localize(\"NAME.Endurance\");","0PzfGjGhHQbxEwlb":"this.item.update({\"system.AP\" : {lArm : 0, rArm : 0, lLeg : 0, rLeg: 0}});","0R0QAr3D024kWPfo":"let table = game.wfrp4e.tables.findTable(\"mutatephys\");\r\nif (!table)\r\n{\r\n\treturn ui.notifications.error(\"Mutation table not found, please ensure a table with the `mutatephys` key is imported in the world.\")\r\n}\r\nlet result = (await table.roll()).results[0];\r\nlet uuid = `Compendium.${result.documentCollection}.${result.documentId}`\r\nlet item = await fromUuid(uuid);\r\n\r\nif (item)\r\n{\r\n this.script.scriptNotification(`${item.name} added`)\r\n this.actor.createEmbeddedDocuments(\"Item\", [item])\r\n}\r\nelse \r\n{\r\n ui.notifications.error(\"Item could not be found: \" + uuid)\r\n}","0Uly7OmkH0zqYbxQ":"let location = this.item.system.location.key;\r\n\r\nif (location)\r\n{\r\n let dropped = this.item.system.weaponsAtLocation;\r\n\r\n if (dropped.length)\r\n {\r\n this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(\", \")}!`)\r\n for(let weapon of dropped)\r\n {\r\n await weapon.system.toggleEquip();\r\n }\r\n }\r\n}\r\n\r\nlet roll = await new Roll(\"max(1, 1d10 - @system.characteristics.t.bonus)\", this.actor).roll()\r\n\r\nroll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Duration)`}));\r\n\r\nthis.effect.updateSource({\"duration.rounds\" : roll.total})","0uUxvBLJC76WIIBC":"let species = await ValueDialog.create({text : \"Zielspezies eingeben (Singular)\", title : this.effect.name})\n\nthis.effect.updateSource({name : this.effect.setSpecifier(species)});","0vaYwAlMWTmOBl8k":"if (!args.flags.strikeToStun)\r\n{\r\n args.flags.strikeToStun = true\r\n args.fields.modifier += 20;\r\n args.fields.hitLocation = \"head\";\r\n}\r\nargs.fields.successBonus++;","0wmIC2MssUX6LW3N":"if (args.test.options.doomboltRolled)\n{\n\targs.test.result.damage += 4;\n}","0wR0LWpfhLFA240I":"let value = await ValueDialog.create({\n title : this.script.label, \n text: \"Sieges-Notizen für das Erfahrungs-Journal\"\n});\nvalue \n ? this.actor.system.awardExp(50, value) \n : this.actor.system.awardExp(50, this.script.label)","0YKQGbsKdHSmYGE7":"if (args.skill?.name != game.i18n.localize(\"NAME.Gossip\"))\r\n{\r\n\treturn true;\r\n}\r\nelse \r\n{\r\n\targs.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\r\n}\r\n ","0yyofYHeDRQlFliO":"return args.options.terror || args.extendedTest?.flags.wfrp4e?.fear","11ir8nibM5HD69na":"const balanced = game.i18n.localize(\"WFRP4E.YenluiBalanced\");\nconst light = game.i18n.localize(\"WFRP4E.YenluiLight\");\nconst dark = game.i18n.localize(\"WFRP4E.YenluiDark\");\n\nlet newName, newDescription;\n\nif (this.effect.name === game.i18n.localize(\"WFRP4E.YenluiDark\")) {\n newName = game.i18n.localize(\"WFRP4E.YenluiBalanced\");\n newDescription = game.i18n.localize(\"WFRP4E.YenluiBalancedDesc\");\n} else if (this.effect.name === game.i18n.localize(\"WFRP4E.YenluiBalanced\")) {\n newName = game.i18n.localize(\"WFRP4E.YenluiLight\");\n newDescription = game.i18n.localize(\"WFRP4E.YenluiLightDesc\");\n}\n\nif (newName) {\n await this.effect.update({name: newName});\n await this.item.update({name: newName, \"system.description.value\": newDescription});\n}","11QMAT1KYGJJmPlD":"let melee = [\"Compendium.wfrp4e-core.items.Item.4MJJCiOKPkBByYwW\", \"Compendium.wfrp4e-core.items.Item.RWJrupj9seau0w31\", \"Compendium.wfrp4e-core.items.Item.jt0DmVK9IiF6Sd2h\"];\nlet ranged = [\"Compendium.wfrp4e-core.items.Item.5eDd6iFeR9G6cCfz\", \"Compendium.wfrp4e-core.items.Item.jrYW2OyDHd1Md2my\", \"Compendium.wfrp4e-core.items.Item.cygaI9gq4BQJvbB5\"];\n\nif (args.equipped)\n{\n if (this.item.system.isMelee)\n {\n this.actor.addEffectItems(melee, this.effect);\n }\n else\n {\n this.actor.addEffectItems(ranged, this.effect);\n }\n}\nelse \n{\n this.effect.deleteCreatedItems();\n}","11uCC0mK2uL783al":"let type = this.item.getFlag(\"wfrp4e\", \"breath\");\r\n\r\nif ([\"fire\", \"electricity\", \"poison\"].includes(type))\r\n{\r\n args.applyAP = false;\r\n}","15C6LbCUmQgPEoDM":"await args.actor.addCondition(\"ablaze\");","16c0m6PsDXWh86uN":"let property = this.effect.getFlag(\"wfrp4e\", \"property\");\nif (property && !this.item.system.flaws.value.find(i => i.name == property));\n{\n this.item.system.flaws.value.push({name : property});\n}","16nCOByUaSFDym1V":"args.fields.modifier -= 20\r\n","18MeEQ0As3JvER71":"let state = !this.effect.disabled;\r\nthis.effect.update({\"disabled\": state});\r\n\r\nif (state)\r\n return ui.notifications.info(\"EFFECT.CreatureBackInWater\", {localize: true})\r\n\r\nreturn ui.notifications.info(\"EFFECT.CreatureOutOfWater\", {localize: true});","190PHSHKGaJ74wsR":"if (!this.item.name.includes(\"(\") || this.item.system.tests.value.includes(\"Terrain\"))\r\n{\r\n let tests = this.item.system.tests.value\r\n let name = this.item.name\r\n\r\n // If name already specifies, make sure tests value reflects that\r\n if (name.includes(\"(\"))\r\n {\r\n let terrain = name.split(\"(\")[1].split(\")\")[0]\r\n tests = tests.replace(\"the Terrain\", terrain)\r\n }\r\n else // If no sense specified, provide dialog choice\r\n {\r\n let choice = await ItemDialog.create(ItemDialog.objectToArray({\r\n coastal : \"Coastal\",\r\n deserts : \"Deserts\",\r\n marshes : \"Marshes\",\r\n rocky : \"Rocky\",\r\n tundra : \"Tundra\",\r\n woodlands : \"Woodlands\"\r\n }, this.item.img), 1, \"Choose Terrain\");\r\n if (choice[0])\r\n {\r\n name = `${name.split(\"(\")[0].trim()} (${choice[0].name})`\r\n tests = tests.replace(\"the Terrain\", choice[0].name + \" Terrain\")\r\n }\r\n }\r\n\r\n this.effect.updateSource({name})\r\n this.item.updateSource({name, \"system.tests.value\" : tests})\r\n}","19LL1oevrjmpD8DX":"let damage = await new Roll(\"1d10\").roll();\ndamage.toMessage(this.script.getChatData());\nthis.actor.applyDamage(damage.total, {\n damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL,\n createMessage: this.script.getChatData()\n});\n\nconst test = await this.actor.setupSkill(\n game.i18n.localize(\"NAME.Endurance\"),\n {\n fields: {difficulty: \"average\"},\n skipTargets: true,\n appendTitle: ` — ${this.effect.name}`,\n },\n);\n\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"stunned\");\n}","1A87vGLh2PXH0rG0":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Language\"));","1BT0MWM2cbhlEnrn":" let characteristics = {\n \"ws\" : 5,\n \"bs\" : 5,\n \"s\" : 5,\n \"t\" : 0,\n \"i\" : 5,\n \"ag\" : 5,\n \"dex\" : 5,\n \"int\" : 0,\n \"wp\" : 5,\n \"fel\" : 5\n }\n let items = []\n\n let updateObj = this.actor.toObject();\n\n let talents = (await Promise.all([game.wfrp4e.tables.rollTable(\"talents\"), game.wfrp4e.tables.rollTable(\"talents\"), game.wfrp4e.tables.rollTable(\"talents\")])).map(i => i.text)\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n","1CeYp5MlPcH68UIw":"let characteristics = {\n \"ws\" : 15,\n \"bs\" : 10,\n \"s\" : 10,\n \"t\" : 15,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 10,\n \"wp\" : 10,\n \"fel\" : 10\n}\nlet skills = [\"Einschüchtern\", \"Anführen\" , \"Wahrnehmung\"]\nlet skillAdvancements = [10, 10, 10]\nlet talents = [\"Kampfsinn\", \"Gedrillt\", \"Bedrohlich\", \"Hart im Nehmen\"]\nlet trappings = [\"Waffe\", \"Kettenbrünne\", \"Kettenbeinlinge\"]\nlet specialItems = [ \n] \nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let item of specialItems) {\n let newItem\n if (item.type == \"weapon\") {\n newItem = new ItemWfrp4e({ name: item.name, type: item.type, system: { equipped: true, damage: {value: item.damage}} })\n } else if (item.type == \"trapping\") {\n newItem = new ItemWfrp4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type, system: { worn: true, trappingType: { value: item.trappingType} } } )\n } else {\n newItem = new ItemWfrp4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type })\n }\n items.push(newItem.toObject())\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n trappingItem.system.equipped.value = true;\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);","1Du4e27M8WgP2iui":"if (args.equipped === true && this.actor.name !== \"Kurgorn Three-eyes\")\n{\n this.actor.addCondition(\"blinded\", 1, {\"statuses\" : [\"blinded\", \"blind\"]})\n this.script.notification(`Geblendet durch das Tragen von ${this.item.name}`);\n}\n\nif (args.equipped === false && this.actor.name !== \"Kurgorn Three-eyes\")\n{\n this.actor.removeCondition(\"blinded\")\n}","1E47r2ba6IGe8uFK":"return args.characteristic != \"t\"","1exiWlVUHsXDLLAH":"this.script.scriptNotification(`Cannot enter ${this.effect.name}!`);","1fQr1Dg7DX0vfz3r":"let healed = parseInt(this.effect.sourceTest.result.SL)\r\nthis.actor.modifyWounds(healed)\r\nthis.script.scriptMessage(`Healed ${healed} Wounds`)","1IodsW9ImamYoEYz":"args.actor.details.move.run += 4","1jQq9v8fXK8zuEBU":"let damage = this.effect.sourceActor.hasCondition(\"fatigued\") ? 6 : 10;\r\n\r\nlet loc = \"body\"\r\n\r\nlet APatLoc = this.actor.system.status.armour[loc];\r\n\r\nlet metalAP = APatLoc.layers.reduce((metal, layer) => metal += ((layer.metal && !layer.magical) ? layer.value : 0), 0)\r\n\r\nlet APused = Math.max(0, APatLoc.value - metalAP); // remove metal AP at location;\r\n\r\ndamage -= (APused + this.actor.system.characteristics.t.bonus)\r\n\r\nlet msg = await this.actor.applyBasicDamage(damage, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL});\r\nmsg += ` (ignored ${metalAP} metal AP on ${game.wfrp4e.config.locations[loc]})`\r\nthis.script.scriptMessage(msg)\r\n\r\nlet test = await this.actor.setupSkill(\"Endurance\", {fields : {difficulty : \"difficult\"}, appendTitle : ` - ${this.effect.name}`});\r\nawait test.roll();\r\nif (test.failed)\r\n\tthis.actor.addCondition(\"stunned\");","1JwxZujbDcueLWBL":"await this.actor.addCondition(\"ablaze\", 2)\r\nawait this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {suppressMsg: true}))","1kB2su7hLRYDhZ2H":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name})\r\nawait test.roll();\r\nif (!test.succeeded)\r\n{\r\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.ZhMADOqoo0y8Q9bx\")\r\n let data = item.toObject();\r\n if (this.item.system.location.key == \"rLeg\")\r\n {\r\n data.system.location.value = \"Right Toe\"\r\n\tdata.system.location.key = \"rToe\";\r\n }\r\n else if (this.item.system.location.key == \"lLeg\")\r\n {\r\n data.system.location.value = \"Left Toe\"\r\n\tdata.system.location.key = \"lToe\";\r\n }\r\n this.actor.createEmbeddedDocuments(\"Item\", [data])\r\n}\r\nthis.effect.delete();","1l7Jz2ZHbAWko7Vm":"args.options.ballockKnife = true;","1LDm3OB32skZe6Xv":"return args.characteristic != \"wp\"","1LDSzXeO5CzXgTOc":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Channelling\")) || args.skill?.name == `${game.i18n.localize(\"NAME.Language\")} (${game.i18n.localize(\"SPEC.Magick\")})`","1MDOKny7IirJPoI6":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` ${this.effect.name}`})\r\nawait test.roll()\r\nif (test.succeeded)\r\n{\r\n this.effect.delete();\r\n}\r\n","1mNkLj9JYNr3ofC6":"this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => {\r\n await test.roll();\r\n if (test.failed)\r\n {\r\n this.actor.addCondition(\"stunned\", 3)\r\n }\r\n})","1OpT3CXs07XFWWCT":"args.options.cardsharp = true;","1PPh4vHd5sPKtudZ":"this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.eowbsW6oHGSNJmxV\", this.effect)","1PQPxFjmRlulHHzo":"if (args.opposedTest.result.hitloc.value == this.item.system.location.key && args.totalWoundLoss > 0)\r\n{\r\n args.actor.addCondition(\"bleeding\", 2);\r\n}\r\n ","1UalUmNzjB4rp3SZ":"return [\"ws\", \"bs\", \"s\", \"ag\", \"t\", \"dex\"].includes(args.characteristic)","1UvL0XA1EpQtjDNn":"let effects = this.item.effects.contents.filter(i => i.id != this.effect.id);\n\nlet choice = await ItemDialog.create(effects, 1, {title : this.effect.name, text: \"Choisissez une Rune\"});\n\nif (choice[0])\n{\n choice[0].performEffectApplication();\n}","1wEjrgff7ASxKVmy":"if (args.effect.conditionId == \"bleeding\")\r\n args.data.damage -= 1","1wKVvxRTHOyV4Qdv":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Sail\"))","1wrPvP6lJwIAfmsl":"let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.locations), 1, \"Choose Location\");\r\n\r\nlet location = choice[0].id;\r\n\r\nlet itemTargeted = this.actor.items.get(this.effect.getFlag(\"wfrp4e\", \"itemTargets\")[0])\r\n\r\nif (itemTargeted)\r\n{\r\n itemTargeted.update({[`system.APdamage.${location}`] : itemTargeted.system.APdamage[location] + 1})\r\n}","1XAilPQEyMWVPA5z":"const qualities = foundry.utils.deepClone(args.item.system.qualities.value);\nqualities.push({name:\"fine\", value: 1});\nargs.item?.update({\"system.qualities.value\": qualities});","1yOvw74jzFfaI87b":"return args.options.reload\r\n","1ZArMNUI8qqH6zkX":"let test = await args.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : \" - \" + this.effect.name, context : {failure: \"Gained a Stunned Condition\"}})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n args.actor.addCondition(\"stunned\")\r\n}\r\n\r\n","1ZrzpfVwPJHdwp23":"this.actor.status.addArmour(1, {source: this.effect, magical : true})","20fvE9nJmcfGYVzw":"if ( args.totalWoundLoss > 0 ) {\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {difficulty: \"average\"})\n await test.roll();\n if (!test.succeeded)\n { \n this.actor.addSystemEffect(\"gangrene\");\n }\n}","22bW97lkvCqisfHX":"return args.type != \"channelling\" && !args.skill?.name.includes(game.i18n.localize(\"NAME.Channelling\"))","22PMOW0G5MWiBQmg":"let fear = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\nfear = fear.toObject();\nfear.system.specification.value = 1;\nawait this.actor.createEmbeddedDocuments(\"Item\", [fear], {fromEffect : this.effect.id})","23HgjCB1oecxANvA":"if (args.item.range && args.item.range.bands)\r\n{\r\nargs.item.range.bands[game.i18n.localize(\"Long Range\")].modifier = 0\r\nargs.item.range.bands[game.i18n.localize(\"Extreme\")].modifier /= 2\r\n}","23PDHNZEnihcEvdK":"if (args.test.result.castOutcome == \"success\" && args.test.spell.system.lore.value.includes(\"high\"))\n{\n this.effect.update({name: this.effect.setSpecifier(parseInt(this.effect.specifier - 1))})\n\n this.script.message(\"La valeur de Protection est maintenant de \" + (this.effect.specifier - 1), {flavor: this.effect.sourceItem.name})\n}","23vWiHUjxtRQ3Efz":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.eWPN3CV2Eddwz8aM\")\r\nlet data = item.toObject();\r\ndata.system.location.value = \"Back\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","24Zp9hEvULQsR3lN":"if (!this.item.system.properties.qualities.pummel) this.item.system.qualities.value.push({name : 'pummel'});if (!this.item.system.properties.qualities.hack) this.item.system.qualities.value.push({name : 'hack'})","29wHhLMnuoVjfQtN":"const sl = this.effect.getFlag(\"wfrp4e-archives3\", \"sl\");\r\nargs.item.system.damage.value += `+${sl}`;","2AdSBXw7IwCiqawQ":"return args.skill?.name == game.i18n.localize(\"NAME.Bribery\") || args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"));","2AOo7KUyzMrgIlgM":"game.wfrp4e.utility.postCorruptionTest(this.item.system.specification.value, {speaker : {alias: this.actor.prototypeToken.name}})","2C6UtWujISe4jqgS":"return game.messages.get(args.context.dispel)?.system.test.spell.system.magicMissile.value;","2cKarG9ToyW2ptCd":"if (this.item.system.quantity.value)\r\n{\r\n\tthis.item.update({\"system.quantity.value\" : this.item.system.quantity.value - 0.25})\r\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\r\n\tactor.applyEffect({effectData : [this.item.effects.contents[1].convertToApplied()]})\r\n}\r\nelse\r\n{\r\n\tthis.script.scriptNotification(\"None left!\", \"error\")\r\n}","2Cw5j0iGAnFNegWr":"return args.item?.system.attackType\r\n","2EAYX5G9Fh3HJwiP":"let broken = this.actor.hasCondition(\"broken\");\n\nif (broken) {\n broken.delete();\n this.script.notification(\"Zustand Gebrochen entfernt.\");\n}","2Ej6LUqn8frTRURo":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {difficulty: \"hard\"})\nawait test.roll();\nif (!test.succeeded)\n{\n await this.actor.addCondition(\"unconscious\");\n}","2GYAd4OC888oQFBp":"return ![\"fel\"].includes(args.characteristic)","2hzDv8ROulOe1elK":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Lore\"));","2IPTF0akWw9y48br":"return !this.item.equipped.value \n || !args?.weapon\n || !([\"goblin\"].includes(args.target.Species.toLowerCase()))","2kRwCc31fuZgrsy8":"CorruptionMessageModel.createCorruptionMessage(\"major\", this.script.getChatData());","2mFNelLOAQ6iJsZl":"if (args.test.isFumble)\r\n{\r\n args.test.result.other.push(\"@Table[doomrocket-fumble]\")\r\n}","2miWWeRrEpq1beG4":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.qn4ZpvTQIX4rcJDl\");\r\nlet data = item.toObject();\r\ndata.system.location.key = this.item.system.location.key\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\r\n","2NLINicPQWbuvp2n":"return args.item?.name != game.i18n.localize(\"NAME.Navigation\")","2OqLHRqEBEjBm2LW":"args.fields.slBonus += this.actor.system.characteristics.wp.bonus","2p9IK6Y5Z4NQD6FY":"args.prefillModifiers.difficulty = \"hard\"","2QB0LjueuJcIaHaC":"if (isNaN(parseInt(this.item.system.specification.value)))\r\n{\r\n let value = await ValueDialog.create(\"Enter Armour value\", this.effect.name);\r\n if (value)\r\n {\r\n this.item.updateSource({\"system.specification.value\" : value});\r\n }\r\n}","2Qi1hwLYhdE6v6Hs":"if (![\"rLeg\", \"lLeg\"].includes(this.effect.getFlag(\"wfrp4e\", \"location\")))\r\n\treturn true;\r\n\r\nif (args.options.dodge)\r\n{\r\n\targs.abort = true;\r\n\tthis.script.scriptNotification(\"Cannot Dodge!\")\r\n}\r\nreturn [\"t\", \"int\", \"wp\", \"fel\"].includes(args.characteristic)","2rzxQlL7A9ujZ9uK":"if (args.opposedTest.result.winner == \"attacker\") {\r\n if (args.opposedTest.defenderTest.weapon && args.opposedTest.defenderTest.item.properties.qualities.shield) {\r\n ui.notifications.notify(`<b>${this.effect.name}</b>: Gained ${this.item.Advances} Advantage`)\r\n this.actor.setAdvantage(this.item.Advances)\r\n }\r\n}","2S6XlGCdRlXuaaVw":"this.actor.system.status.corruption.value += 1","2sDH6RvoOAR40oqH":"\r\n\r\nif (![\"Goblin\", \"Orc\"].includes(this.actor.system.details.species.value)) {\r\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), { appendTitle: ` - ${this.effect.name}` })\r\n await test.roll();\r\n if (test.failed) {\r\n let infection = await fromUuid(\"Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg\")\r\n this.actor.createEmbeddedDocuments(\"Item\", [infection])\r\n }\r\n}\r\n\r\n// Since wounds change when the effect is deleted, need to wait until after \r\n// the max wounds have been recalculated to apply damage\r\ngame.wfrp4e.utility.sleep(1000).then(async () => {\r\n let roll = await new Roll(\"1d10\").roll();\r\n\r\n roll.toMessage(this.script.getChatData());\r\n this.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true }))\r\n\r\n})","2sN4VHAs4bo4pOjD":"let damage = await new Roll(\"1d10 + 1\").roll();\ndamage.toMessage(this.script.getChatData());\nthis.actor.applyDamage(damage.total, {\n damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP,\n createMessage: this.script.getChatData()\n});","2uyajbon5QX1CewS":"return args.skill?.name == \"Segeln (Luftschiff)\"","2VNnVrtktdGUqXEV":"if (args.totalWoundLoss > 0)\r\n{\r\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\n await test.roll();\r\n if (test.failed && parseInt(args.opposedTest.attackerTest.result.SL) > 0)\r\n {\r\n args.actor.addCondition(\"stunned\", parseInt(args.opposedTest.attackerTest.result.SL))\r\n }\r\n} ","2vTVR0quRZQtjNfQ":"let currentCareer = this.actor.system.currentCareer;\r\nif (!currentCareer)\r\n{\r\n return;\r\n}\r\n\r\nlet talents = [\"Aethyric Attunement\",\r\n\"Arcane Magic (Any)\",\r\n\"Chaos Magic (Tzeentch)\",\r\n\"Fast Hands\",\r\n\"Instinctive Diction\",\r\n\"Magical Sense\",\r\n\"Petty Magic\",\r\n\"Second Sight\",\r\n\"War Wizard\",\r\n\"Witch!\"].filter(t => !currentCareer.system.talents.includes(t))\r\n\r\ncurrentCareer.system.talents = currentCareer.system.talents.concat(talents)","2W9uMTT6iJhfQ044":"let skill = `Trade (${this.item.parenthesesText})`\r\nlet currentCareer = this.actor.system.currentCareer;\r\nlet existingSkill = this.actor.itemTypes.skill.find(i => i.name == skill);\r\n\r\nif (!currentCareer) return\r\n\r\n\r\nlet inCurrentCareer = currentCareer.system.skills.includes(skill);\r\nlet craftsmanAdded = this.actor.getFlag(\"wfrp4e\", \"craftsmanAdded\") || {};\r\nif (existingSkill && inCurrentCareer && !craftsmanAdded[existingSkill.name])\r\n{\r\n\texistingSkill.system.advances.costModifier = -5;\r\n}\r\nelse \r\n{\r\n\tcraftsmanAdded[skill] = true;\r\n\tcurrentCareer.system.skills.push(skill);\r\n\tsetProperty(this.actor, \"flags.wfrp4e.craftsmanAdded\", craftsmanAdded)\r\n}","2WBq5gW780C6zfCp":"if (args.weapon && this.item.system.usesLocation(args.weapon))\r\n{\r\n args.bleedingHand = true;\r\n let success = await this.effect.manualScripts[0].execute({actor: this.actor})\r\n if (!success)\r\n {\r\n args.abort = true;\r\n }\r\n}","2wk0yrRPlPsdqr3L":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9GNpAqgsKzxZKJpp\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","2WSN306tL4apjRtD":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9h82z72XGo9tfgQS\")\r\nlet data = item.toObject();\r\ndata.name = data.name += \" (Hearing)\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","2XaJNYUMQAmSOsqi":"const {targetUuid} = this.effect.flags.wfrp4e;\n\nif (args.attacker.uuid !== targetUuid) return;\n\nlet recordedWounds = this.effect.getFlag(\"wfrp4e\", \"damageToReturn\") ?? 0;\n\nrecordedWounds += args.totalWoundLoss;\n\nthis.effect.setFlag(\"wfrp4e\", \"damageToReturn\", recordedWounds);","2XXqxAF5s5Sws6qj":"this.actor.system.status.corruption.value += 2","2yctEihGmdCfTTVx":"args.data.canReverse = true;\r\nargs.options.fieldDressing = true;","2Yh4vQm0ZJukRH1x":"return !args.skill?.name.includes(\"Focalisation\");","2yW0kuwLfgRzJR2S":"const duration = 3600 * (1 + Number(this.effect.sourceTest.result.SL));\nthis.effect.update({\"duration.seconds\": duration});","2z6DazIpsfiRZHdl":"const qualities = foundry.utils.deepClone(args.item.system.qualities.value);\nqualities.push({name:\"lightweight\"});\nargs.item?.update({\"system.qualities.value\": qualities});","2zeP2nMSURjxrqYz":"let wounds = this.actor.system.status.wounds\r\nif (wounds.value == 0)\r\n return this.script.scriptNotification(\"No effect at 0 Wounds\", \"error\")\r\n\r\nthis.script.scriptNotification(`Healed ${this.actor.characteristics.t.bonus} Wounds`)\r\nawait this.actor.modifyWounds(this.actor.characteristics.t.bonus)","2zpYzKVDNE5y9RLL":"return !args.actor?.has(game.i18n.localize(\"NAME.Swarm\")) ||\n ![game.wfrp4e.config.actorSizeNums.tiny, game.wfrp4e.config.actorSizeNums.ltl]\n .includes(args.actor?.sizeNum)","32EPIAz7Qm71ut3m":"if (Number(this.actor.system.details.age.value) > 870) {\n if ([\"t\", \"wp\", \"fel\"].includes(args.characteristic))\n args.fields.slBonus -= 3;\n if ([\"ag\", \"dex\", \"int\"].includes(args.characteristic))\n args.fields.slBonus -= 2;\n} else if (Number(this.actor.system.details.age.value) > 350) {\n if ([\"t\", \"wp\"].includes(args.characteristic))\n args.fields.slBonus -= 2;\n if ([\"fel\"].includes(args.characteristic))\n args.fields.slBonus -= 1;\n} else {\n if ([\"t\", \"wp\"].includes(args.characteristic))\n args.fields.slBonus -= 1;\n}","33PWizq5F7pkKnQT":"if (args.item.type == \"spell\")\r\n{\r\n args.item.cn.value = Math.floor(args.item.cn.value / 2)\r\n}","33US8YRgaMqYu2We":"return !args.options.handling","37UN17gb8suFeZIW":"this.script.scriptMessage(await this.actor.applyBasicDamage(8, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}))","39mmD9wOsHWas3cl":"if (args.type == \"effect\" && args.options.action == \"delete\" && [\"prone\"].some(i => args.document.statuses.has(i)))\n{\n this.script.notification(\"Impossible de retirer \" + args.document.name);\n let resist = await this.effect.resistEffect();\n if (resist)\n {\n this.effect.delete();\n }\n return resist;\n}","3AbonnSVfoSlGye8":"this.effect.updateSource({name: this.effect.setSpecifier(\"9\")});","3aEzK0DehSHtVykd":"this.effect.manualScripts[0].execute({actor : this.actor});","3CdYFcInQVCIBUiE":"args.actor.system.details.move.value += 2;\r\nargs.actor.system.status.carries.max = Math.floor(args.actor.system.status.carries.max * 0.5);\r\nargs.actor.system.details.price.gc *= 1.1;","3CeKfDcMEVgQlcXm":"await this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.5hH73j2NgPdsLCZN\", this.effect, {name: \"Haine (Tous les ennemis)\"});","3Cn2TlRahlm5LkSj":"args.fields.successBonus += 1;","3D5ImpMgpOTPucvv":"if (args.test.options.cardsharp && args.test.succeeded)\r\n{\r\n\r\nlet SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10)\r\nlet ones = Number(args.test.result.roll.toString().split(\"\").pop())\r\n\r\nif (ones > SL)\r\n args.test.result.other.push(`<span class=\"hide-option\"><b>${this.effect.name}</b>: ${ones + args.test.successBonus + args.test.slBonus} SL</span>`)\r\n}","3eSaX0BeaUalNkEP":"return args.options.mutate","3fdCQ3h3iVuhdDs9":"args.fields.slBonus += this.actor.characteristics.ag.bonus;","3hfMQkUKYI4rCuBy":"return args.skill?.name != game.i18n.localize(\"NAME.CharmAnimal\") && !args.skill?.name.includes(game.i18n.localize(\"NAME.AnimalTraining\"));","3IGO7xEjRjat937X":"let fatigue = this.actor.hasCondition(\"fatigued\")\r\nif (fatigue)\r\n{\r\n this.script.scriptNotification(\"Removing Fatigued Condition, disabled effect\")\r\n this.effect.update({disabled : true})\r\n await this.actor.removeCondition(\"fatigued\")\r\n}","3ixqbsEMfSSTzAXU":"const test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {\n difficulty: \"challenging\",\n context: {\n failure: \"Erhält den Zustand @Condition[Fatigued] wegen Albträumen.\",\n success: \"Hatte Albträume, aber ausreichend geschlafen.\"\n }\n});\nawait test.roll();\n\nif (test.failed) {\n await this.actor.addCondition(\"fatigued\");\n}","3j8yybMaAZSwzxIE":"let weaponData = await this.effect.setFlag(\"wfrp4e\", \"weaponData\", this.item.system.toObject());\n\ntry {\n\n\n await this.item.update({\n system: {\n \"weaponGroup.value\": \"throwing\",\n \"qualities.value\": this.item.system.qualities.value.concat([{ name: \"accurate\" }]),\n \"range.value\": \"SB * 3\",\n \"consumesAmmo.value\" : false\n }\n })\n\n let test = await this.actor.setupWeapon(this.item, {}, {resolveClose : true});\n await test?.roll();\n this.item.update({ system: this.effect.getFlag(\"wfrp4e\", \"weaponData\") })\n}\ncatch (e) {\n this.item.update({ system: this.effect.getFlag(\"wfrp4e\", \"weaponData\") })\n}","3JEzEzF1SeYA9lsV":"let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.locations, this.effect.img), 1, \"Choose Location\");\r\nif (choice[0])\r\n{\r\n this.effect.updateSource({name : `${this.effect.name} (${choice[0].name})`})\r\nthis.effect.updateSource({\"flags.wfrp4e.location\" : choice[0].id})\r\n}\r\n\r\nlet location = choice[0].id;\r\n\r\nif ([\"lArm\", \"rArm\"].includes(location))\r\n{\r\n let dropped = this.actor.itemTypes.weapon.filter(i => i.isEquipped & i.system.usesHands.includes(location));\r\n\r\n if (dropped.length)\r\n {\r\n this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(\", \")}!`)\r\n for(let weapon of dropped)\r\n {\r\n await weapon.system.toggleEquip();\r\n }\r\n }\r\n}\r\n\r\nif (location == \"body\")\r\n{\r\n await this.actor.addCondition(\"fatigued\");\r\n test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"hard\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\n await test.roll();\r\n if (test.failed)\r\n {\r\n this.actor.addCondition(\"prone\");\r\n }\r\n}\r\n\r\nif (location == \"head\")\r\n{\r\n await this.actor.addCondition(\"stunned\");\r\n test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\n await test.roll();\r\n if (test.failed)\r\n {\r\n this.actor.addCondition(\"unconscious\");\r\n }\r\n}","3jm0NoYpgB6ZuUSl":"args.options.useOnesAttractive = true;","3KH6OE7L7uJESI2Z":"if ([\"dragon\"].includes(args.opposedTest.defender.details.species.value.toLowerCase()))\n {\n args.applyTB = false;\n args.opposedTest.result.other.push(\"<b>Wyrmslayer</b>: Ignore le BE contre les Dragons\")\n }","3l7MQSa10Kve2K3P":"this.script.scriptMessage(await this.actor.applyBasicDamage(Math.ceil(CONFIG.Dice.randomUniform() * 10) + 6, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}))\r\nthis.actor.addCondition(\"ablaze\");","3LLiSgj6KGtgqcmo":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Language\"));","3na3lnAt3bfysvcD":"const blinded = this.actor.hasCondition(\"blinded\");\nif (!blinded)\n this.actor.addCondition(\"blinded\");","3nTSOcCmNZpQWK8b":"this.actor.addCondition(\"blinded\", 3);","3plV9WFqs2prfAdp":"return ![\"NAME.Evaluate\", \"NAME.Gamble\"].map(i => game.i18n.localize(i)).includes(args.skill?.name)","3R6Y4NpNTqPc83wh":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.IPKRMGry6WotuS1G\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","3sfD1nedXLzuYoXJ":"if (this.actor.hasCondition(\"surprised\"))\r\n{\r\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty : \"average\"}, skipTargets: true, appendTitle : \" - \" + this.effect.name}).then(test => test.roll())\r\n}\r\n","3SuLF6SImYWEHMo2":"args.context.doombolt = true;","3tE8gFSl28EhCmo5":"await args.actor.addCondition(\"ablaze\")\r\nawait args.actor.addCondition(\"prone\")","3TesBGh8HnlGuafu":"let modifier = this.effect.sourceTest?.result.overcast.usage.other.current || 0\r\n\r\nlet test = await this.actor.setupCharacteristic(\"dex\", {fields: {modifier}, skipTargets: true, appendTitle : \" - \" + this.script.label});\r\n\r\ntest.roll();","3uIkDVzxNjzm5qIH":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Pray\"), {appendTitle: ` - ${this.effect.name}`});\nawait test.roll();\n\nif (test.succeeded)\n{\n this.actor.removeCondition(\"blinded\", 1 + parseInt(test.result.SL));\n}","3Vbe6gdW8N0bIvXJ":"if (args.item.type == \"weapon\" || args.item.type == \"trait\")\r\n{\r\n args.item.qualities.value.push({name : \"penetrating\"})\r\n args.item.qualities.value.push({name : \"impale\"})\r\n}","3VhUyqNY18PzeMKG":"args.abort = true;\nthis.script.notification(\"Impossible d'attaquer cette cible !\");","3z3m1pmw03DbQzcb":"return this.effect.name !== game.i18n.localize(\"WFRP4E.YenluiLight\")","42UATqzohYML6a9t":"if ( !this.actor.hasCondition(\"poisoned\") ) {\n\tthis.effect.delete();\n}","43W725G6C7QZ8rr6":"args.options.terror","454x3Q95pLvZm0Kx":"return args.skill?.name == game.i18n.localize(\"NAME.ConsumeAlcohol\");","49smPAj5J0INSFPI":"return args.item?.system.isRanged;","4AO7Fowek5sSmE4g":"const venomUUID = \"Compendium.wfrp4e-core.items.gFkRm9wS65qe18Xv\";\nconst venom = this.actor.itemTags.trait.find(t => t.name === \"Venin\");\n\nif (venom) {\n await this.effect.setFlag(\"wfrp4e-tribes\", \"venom\", {\n _id: venom.id,\n \"system.specification.value\": venom.system.specification.value\n });\n await venom.update({\"system.specification.value\": \"Difficult\"});\n} else {\n await this.actor.addEffectItems(venomUUID, this.effect, {\n \"system.specification.value\": \"Challenging\"\n });\n}","4cOZzUvu1nytcqNn":"args.initiative = \"-10\"","4cumLUlcuJ7m8C6t":"let item = args.actor.items.find(i => i.name.includes(\"Smoothing\"));\r\nlet smoothing = item?.effects.find(e => e.name === \"Smoothing\");\r\nif (smoothing)\r\n smoothing.disabled = true;","4drWKXjMgasxY7Jy":"args.actor.system.details.price.gc += Math.floor(args.actor.system.details.price.gc * 0.1);","4FGKZk2f0xrmIDnp":"return args.skill?.name != game.i18n.localize(\"NAME.Research\") && !args.skill?.name?.includes(game.i18n.localize(\"NAME.Language\"));","4fnTKgl0HW9ZrWyJ":"this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty : \"average\"}}).then(async test =>\r\n{\r\n await test.roll()\r\n if (test.failed)\r\n {\r\n let char = Math.ceil(CONFIG.Dice.randomUniform() * 2) == 2 ? \"s\" : \"t\";\r\n this.script.scriptMessage(`<strong>${this.actor.name}</strong> lost 1 point of ${game.wfrp4e.config.characteristics[char]}`)\r\n this.actor.update({[`system.characteristics.${char}.initial`] : this.actor.system.characteristics[char].initial - 1})\r\n }\r\n})","4gkz3LR7CK1b8ulK":"return args.item?.system.attackType != \"ranged\" || this.actor.uuid != this.effect.sourceActor.uuid","4HN98hMdQJxM35pA":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.gz2xy41OSVZ8YBgI\");\r\nlet data = item.toObject();\r\ndata.system.location.key = this.item.system.location.key\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data])\r\n","4iu3CmOI19soOYuA":"let characteristics = {\n \"ws\" : -10,\n \"bs\" : -10,\n \"s\" : 0,\n \"t\" : 0,\n \"i\" : -10,\n \"ag\" : -10,\n \"dex\" : 0,\n \"int\" : -200,\n \"wp\" : -200,\n \"fel\" : -200\n}\nlet traits = [ {name:\"Rüstung\", value: 2}, {name:\"Konstrukt\"}, {name:\"Dunkelsicht\"}, {name:\"Angst\", value: 2}, {name:\"Schmerzfrei\"},{name:\"Untot\"},{name:\"Instabil\"} ];\nlet items = [];\n\nlet updateObj = this.actor.toObject();\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nupdateObj.system.characteristics.int.initial = 0;\nupdateObj.system.characteristics.wp.initial = 0;\nupdateObj.system.characteristics.fel.initial = 0;\n\nfor (let trait of traits)\n{\n let traitItem = await game.wfrp4e.utility.find(trait.name, \"trait\")\n if (traitItem)\n {\n let t = traitItem.toObject();\n t.system.specification.value = trait.value;\n if (trait.disabled)\n {\n t.system.disabled = true;\n }\n items.push(t);\n }\n else\n {\n ui.notifications.warn(`${trait.name} nicht gefunden`, {permanent : true})\n }\n}\n\n\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n","4iuTz0uInAfMaoGl":"return args.skill?.name?.includes(game.i18n.localize(\"NAME.Language\")) || args.type == \"cast\"","4jLe2XZQVUB8LztP":"args.fields.slBonus += this.effect.getFlag(\"wfrp4e\", \"slBonus\") || 0;","4JVIy5xtVwvadoqv":"this.actor.details.move.run *= 2","4KYraZSHAEYmL6xx":"if (this.item.equipped.value && args.totalWoundLoss > 10) {\n args.totalWoundLoss = Math.min(10, args.totalWoundLoss)\n args.extraMessages.push(`<strong>${this.effect.name}</strong>: Blessed-Verlust auf 10 begrenzt`)\n}","4MQ7u4INxp51oyyR":"let characteristics = {\n \"ws\" : 25,\n \"bs\" : 10,\n \"s\" : 15,\n \"t\" : 15,\n \"i\" : 25,\n \"ag\" : 20,\n \"dex\" : 0,\n \"int\" : 10,\n \"wp\" : 25,\n \"fel\" : 10\n}\nlet skills = [\"Cool\", \"Dodge\", \"Intimidate\", \"Intuition\", \"Leadership\", \"Lore (Warfare)\", \"Perception\"]\nlet skillAdvancements = [15, 15, 15, 15, 15, 10, 10]\nlet talents = [\"Combat Aware\", \"Combat Reflexes\", \"Feint\", \"Inspiring\", \"Resolute\", \"War Leader\"]\nlet trappings = [\"Hand Weapon\", \"Shield\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","4OlwxU60UqKg81yb":"const target = args.actor;\r\n\r\nif (target.has(\"Ethereal\") || target.has(\"Corruption\")) {\r\n args.totalWoundLoss += 6;\r\n args.modifiers.other.push({label: this.effect.name, value: 6})\r\n}","4otpLq2TnDdgzpvc":"args.actor.system.details.man -= 3;","4pQW4WLyhjbZR85k":"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\"}})\r\nawait test.roll();\r\nif (test.failed && this.actor.type == \"character\")\r\n{\r\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\r\n this.script.scriptMessage(\"Gained a Corruption point\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n}","4Q3Mp04O2sMgKv9x":"return !args.title.includes(\"Spellbreaking\")","4QoxhoekgVeZcQA7":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.M5QSWOYt2Rbv2yxW\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","4rb7LfMq9CTnlrpn":"if (args.totalWoundLoss > 0)\r\n{\r\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name})\r\n await test.roll();\r\n if (test.failed)\r\n {\r\n args.totalWoundLoss += 5;\r\n args.modifiers.other.push({label : this.effect.name, value : 5})\r\n }\r\n}","4rhxLzau7jZ4SDxg":"await args.actor.addCondition(\"grappling\")\r\nawait args.actor.addCondition(\"entangled\")","4rTmV3TNxctUe0ly":"let test = await this.actor.setupCharacteristic(\"ag\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"bleeding\");\r\n}\r\n","4uAUUZmLgxBKSmXA":"if (args.totalWoundLoss > 0) \r\n this.effect.delete();","4WQ25VsJSUZ2DeRB":"this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.EO05HX7jql0g605A\", this.effect, {\"system.specification.value\": this.actor.system.characteristics.ag.value});","4xqtTqMyOcrwVh63":"let roll = await new Roll(\"2d10 + @sin\", {sin: this.actor.system.status.sin.value || 0}).roll();\nroll.toMessage(this.script.getChatData());\nthis.effect.updateSource({duration: {\n value: roll.total,\n units: \"days\"\n}});","4XrAeL2DitxE8OaK":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.0hn6UaKq8CoZP2zD\")\r\nlet data = item.toObject(); \r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});","4ylzjgUdHY5D0yVh":"let characteristics = {\n \"ws\" : 25,\n \"bs\" : 10,\n \"s\" : 15,\n \"t\" : 15,\n \"i\" : 25,\n \"ag\" : 20,\n \"dex\" : 0,\n \"int\" : 10,\n \"wp\" : 25,\n \"fel\" : 10\n}\nlet skills = [\"Besonnenheit\", \"Ausweichen\", \"Einschüchtern\", \"Intuition\", \"Sprache (Schlachtenzunge)\", \"Anführen\", \"Wissen (Kriegsführung)\", \"Wahrnehmung\"]\nlet skillAdvancements = [15, 15, 15, 15, 10, 15, 10, 10]\n\nlet talents = [\"Kampfsinn\", \"Meisterkämpfer\", \"Kampfreflexe\", \"Inspirierend\", \"Entschlossen\", \"Mitreißender Anführer\"]\nlet trappings = [\"Waffe\", \"Schild\", \"Kürass\", \"Plattenarme\", \"Helm\", \"Plattenbeine\"]\nlet specialItems = []\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let item of specialItems) {\n let newItem\n if (item.type == \"weapon\") {\n newItem = new ItemWFRP4e({ name: item.name, type: item.type, system: { equipped: true, damage: {value: item.damage}} })\n } else if (item.type == \"trapping\") {\n newItem = new ItemWFRP4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type, system: { worn: true, trappingType: { value: item.trappingType} } } )\n } else {\n newItem = new ItemWFRP4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type })\n }\n items.push(newItem.toObject())\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else\n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else\n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings)\n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n trappingItem.system.equipped.value = true;\n\n items.push(trappingItem);\n }\n else\n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nlet filters = [\n {\n property : \"type\",\n value : \"weapon\"\n },\n {\n property : \"system.weaponGroup.value\",\n value : [\"twohanded\", \"polearm\"]\n }\n]\n\nitems = items.concat(await ItemDialog.createFromFilters(filters, 1, {text : \"Wähle eine passende Stangenwaffe oder zweihändige Waffe\"}))\n\nlet ride = await foundry.applications.api.DialogV2.confirm({title : \"Fähigkeit\", content : \"Chaos Steed und +20 auf Reiten (Pferd) hinzufügen?\", window : {title : this.effect.name}})\n\nif (ride)\n{\n let skill = await game.wfrp4e.utility.findSkill(\"Reiten (Pferd)\")\n skill = skill.toObject();\n skill.system.advances.value = 20;\n items = items.concat({name : \"Chaos Steed\", type: \"trapping\", \"system.trappingType.value\" : \"misc\"}, skill)\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);","4ZR7p8G3OzOBWx0L":"return args.skill?.name !== game.i18n.localize(\"NAME.Endurance\");","52kbfuWrOh6dsTtd":"if (!this.actor.hasCondition(\"blinded\"))\r\n\tthis.actor.addCondition(\"blinded\", 1, {\"flags.wfrp4e.flockOfDoom\" : true})","52mwb33mGrQjq89B":"return args.skill?.name != game.i18n.localize(\"NAME.Research\");","53HFDNuMnX1Aw1a4":"return [\"ws\", \"bs\", \"s\", \"ag\", \"dex\", \"int\", \"wp\", \"fel\"].includes(args.characteristic)","55eYGvSXetDMK80S":"const diseaseIds = this.actor.items.filter(i => i.type == \"disease\").map(i => i.id)\nthis.actor.deleteEmbeddedDocuments(\"Item\", diseaseIds)","58rFc9HiBoX66J6p":"let sourceActor = this.effect.sourceActor;\r\nlet damage = args.totalWoundLoss;\r\nlet tb = sourceActor.system.characteristics.t.bonus\r\nargs.abort = `<strong>${this.effect.name}</strong>: Damage applied to ${sourceActor.name}`;\r\n\r\nlet message = await sourceActor.applyBasicDamage(damage - tb, {damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true})\r\n\r\nthis.script.scriptMessage(message.replace(`${tb} TB`, `${tb} × 2 TB`))\r\nargs.abort = true;","5DI6cHAg1LHo54Yv":"if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 2 && args.opposedTest.result.winner == \"attacker\")\r\n{ \r\n this.actor.update({\"system.status.fortune.value\" : Math.max(0, (this.actor.system.status.fortune?.value - 1) || 0)})\r\n this.script.scriptMessage(`Fortune point stolen from <strong>${this.actor.name}</strong>`, {blind : true, whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n\r\n}","5dR7Erj3nwsxLAV7":"let characteristics = {\n \"ws\" : 35,\n \"bs\" : 10,\n \"s\" : 25,\n \"t\" : 30,\n \"i\" : 30,\n \"ag\" : 25,\n \"dex\" : 0,\n \"int\" : 15,\n \"wp\" : 35,\n \"fel\" : 15\n}\nlet skills = [\"Cool\", \"Dodge\", \"Intimidate\", \"Intuition\", \"Leadership\", \"Lore (Warfare)\", \"Perception\"]\nlet skillAdvancements = [25, 15, 25, 25, 30, 20, 20]\nlet talents = [\"Combat Aware\", \"Combat Reflexes\", \"Feint\", \"Inspiring\", \"Luck\", \"Resolute\", \"Unshakable\", \"War Leader\"]\nlet trappings = [\"Hand Weapon\", \"Shield\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","5Fe1ELaS6Gnvy0Cj":"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\"","5GHQxfxlmjyt1fNq":"let item1 = await fromUuid(\"Compendium.wfrp4e-core.items.Item.EO05HX7jql0g605A\")\nlet item2 = await fromUuid(\"Compendium.wfrp4e-core.items.Item.Bvd2aZ0gQUXHfCTh\")\nlet ids = await this.actor.createEmbeddedDocuments(\"Item\", [item1, item2], {fromEffect : this.effect.id})\nthis.actor.updateEmbeddedDocuments('Item', [ {_id: ids[0].id, 'system.specification.value': 16} ] )","5GP9UJMvBZv6kWtI":"this.script.message(await this.actor.applyBasicDamage(8, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}))\n\n\nlet msg = ``\nlet weapons = args.actor.itemTypes.weapon.filter(i => !i.system.location.value);\nlet armour = args.actor.itemTags.armour.filter(i => !i.system.location.value);\nfor(let item of weapons)\n{\n\tif (item.system.properties.qualities.shield)\n\t{\n\t\tawait item.system.damageItem(1, \"shield\");\n\t}\n\telse\n\t{\n\t\tawait item.system.damageItem(1);\n\t}\n\tmsg += `<p><strong>${item.name}</strong> um 1 beschädigt</p>`\n}\nfor(let item of armour)\n{\n\tawait item.system.damageItem(1);\n\tmsg += `<p><strong>${item.name}</strong> um 1 beschädigt</p>`\n}\nif (msg)\n{\n\tthis.script.message(msg, {speaker : {alias : args.actor.name}});\n}","5gPAT5Bb2FvQwYNQ":"args.test.preData.reversal = {allowed : true, if: \"better\"};\nthis.effect.delete();","5IoYTyedCMYwt3ys":"args.fields.slBonus += 2;","5JvKJZPcd6Hz5zvn":"let characteristics = {\n \"ws\" : 10,\n \"bs\" : 0,\n \"s\" : 10,\n \"t\" : 10,\n \"i\" : 20,\n \"ag\" : 10,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 15,\n \"fel\" : 0\n}\nlet skills = [\"Cool\", \"Dodge\", \"Intimidate\", \"Leadership\"]\nlet skillAdvancements = [15, 15, 10, 5]\nlet talents = [\"Combat Aware\", \"Combat Reflexes\", \"Feint\", \"Resolute\"]\nlet trappings = [\"Mail Coat\", \"Mail Chausses\", \"Mail Coif\", \"Hand Weapon\", \"Shield\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nupdateObj.name = this.effect.name + \" \" + updateObj.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","5JWC0l3JEpOsqbR9":"let characteristics = {\n \"ws\" : 0,\n \"bs\" : 5,\n \"s\" : 0,\n \"t\" : 0,\n \"i\" : 10,\n \"ag\" : 10,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 5,\n \"fel\" : 0\n}\nlet skills = [\"Dodge\", \"Perception\"]\nlet skillAdvancements = [10, 10]\nlet talents = [\"Flee!\", \"Marksman\"]\nlet trappings = [\"Hand Weapon\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","5KIozV7HxyGvskeD":"args.data.reversal = {allowed : true, if: \"worse\"};","5KVslRqhqzuFLyk4":"if (!this.actor.has(\"Gesegnet (Taal)\", \"talent\")) return;\n\nthis.actor.system.characteristics.wp.modifier += 15;","5lc1eHIYQNpSRWip":"if ([\"death\", \"necromancy\"].includes(args.spell?.system.lore.value))\r\n{\r\n args.fields.successBonus += 1\r\n}\r\nelse if([\"life\", \"light\", \"heavens\"].includes(args.spell?.system.lore.value))\r\n{\r\n args.fields.modifier -= 10;\r\n}","5LdJCKfQem1AQK24":"\r\nif (!args.flags.howlingWarpGale)\r\n{\r\n args.fields.modifier -= 10;\r\n args.flags.howlingWarpGale = true; // prevent double application\r\n}","5lpR78CLhYH6Mjnu":"if (this.actor.has(\"Arboricole\",\"trait\")) return\n\nthis.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.rOV2s6PQBBrhpMOv\", this.effect)","5M6IgCUncCwyxHok":"let etiquette = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.sYbgpSnRqSZWgwFP\")).toObject();\r\netiquette.name += ` (Followers of Tzeentch)`;\r\n\r\nlet animosity = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.0VpT5yubw4UL7j6f\")).toObject();\r\nanimosity.system.specification.value = \"Followers of Nurgle\";\r\n\r\nlet roll = await new Roll(\"ceil(1d10 / 3)\").roll();\r\n\r\nroll.toMessage(this.script.getChatData());\r\n\r\nlet mutations = [];\r\nlet msg = `<p><strong>Mutations Gained</strong></p>`\r\nfor(let i = 0; i < roll.total; i++)\r\n{\r\n let item;\r\n let uuid;\r\n let result;\r\n if (i % 2 == 0)\r\n {\r\n result = await game.wfrp4e.tables.rollTable(\"mutatemental\", {hideDSN: true}, \"Tzeentch\")\r\n }\r\n else \r\n {\r\n result = await game.wfrp4e.tables.rollTable(\"mutatephys\", {hideDSN: true}, \"Tzeentch\")\r\n }\r\n uuid = `Compendium.${result.object.documentCollection}.${result.object.documentId}`;\r\n item = await fromUuid(uuid);\r\n if (item)\r\n {\r\n msg += `<p>@UUID[${uuid}]{${item.name}}</p>`\r\n mutations.push(item.toObject());\r\n }\r\n}\r\nthis.actor.createEmbeddedDocuments(\"Item\", mutations.concat([etiquette, animosity]), {fromEffect : this.effect.id})\r\nthis.script.scriptMessage(msg);","5MxRDXzUBPfp2KKD":"args.options.useOnesSupportive = true;","5NE3teXZInHQXZ1K":"let roll = await new Roll(\"2d10 + @sin\", {sin: this.actor.system.status.sin.value || 0}).roll();\nroll.toMessage(this.script.getChatData());\nthis.effect.updateSource({duration: {\n value: roll.total,\n units: \"rounds\"\n}});","5o1XiceC4rutjMms":"return !args.item?.name.includes(game.i18n.localize(\"NAME.Stealth\"))","5QjaPBFbv5rIYpla":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"average\"}, appendTitle : \" - Wounded\"})\n await test.roll();\n if (test.failed)\n {\n fromUuid(\"Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb\").then(disease => {\n this.actor.createEmbeddedDocuments(\"Item\", [disease.toObject()])\n this.script.scriptNotification(\"Gain de \" + disease.name)\n })\n }","5QR83whGk4ZyuJcA":"await this.effect.update({duration:{rounds: this.actor.system.characteristics.ws.bonus}});","5rlneScoI5feQ3Di":"const traits = this.actor.itemTypes.trait.filter(t => [\"bestial\", \"skittish\"].includes(s.name.toLowerCase()));\ntrait.system.disabled = true;","5ScjIdRUOxblHdWS":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Carpenter)';\r\nconst difficulty = 'challenging';\r\nconst target = 40;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","5sI9iYh5j2nx2XyT":"return !([\"Animal Care\", \"Charm Animal\"].includes(args.item?.name) || args.item?.name.includes(\"Ride\") || args.item?.name.includes(\"Animal Training\"))","5sYpJkT2WXIe0gIZ":"const rating = parseInt(this.effect.name.match(/\\d+/)?.[0]) || 1;\r\n\r\nlet crewList = foundry.utils.duplicate(this.actor.system.passengers.list);\r\nlet selectedCrew = [];\r\n\r\nwhile (selectedCrew.length < rating && crewList.length) {\r\n selectedCrew.push(crewList.splice(crewList.length * Math.random() | 0, 1)[0]);\r\n} \r\n\r\nfor (let member of selectedCrew) {\r\n let actor = game.actors.get(member.id);\r\n actor.applyBasicDamage(9, {\r\n damageType: game.wfrp4e.config.DAMAGE_TYPE.NORMAL, \r\n minimumOne: true, \r\n loc: \"roll\", \r\n suppressMsg: false, \r\n hideDSN: false \r\n });\r\n}","5uokSqQsjgMapnCi":"if (\n this.item == args.defenderTest.item\n && args.defenderTest.succeeded\n && args.defenderTest.item?.system?.attackType == 'melee'\n && (args.attackerTest.item.properties.qualities?.magical || args.attackerTest.item.properties.unusedQualities?.magical)\n)\n{\n args.opposedTest.result.other.push(`<strong>${this.effect.name}:</strong> zerstört magische ${args.attackerTest.item.name}.`)\n}","5X8GbReUxUPWwXMT":"this.actor.modifyWounds(-1);","5XAYjiq1i4M7Ky7j":"const trait = this.actor.itemTags.trait.find(t => t.name === \"Regenerieren\");\nconst name = \"Fäulnisregeneration\";\n\nif (!trait) return;\n\nconst effect = trait.effects.find(e => e.name === \"Regenerieren\");\nconst scriptData = effect.system.scriptData;\n\nscriptData[0].script = `\n let chatData = {whisper: ChatMessage.getWhisperRecipients(\"GM\")};\n let message = \"\";\n\n let wounds = foundry.utils.duplicate(this.actor.status.wounds);\n let regenRoll = await new Roll(\"1d10\").roll({allowInteractive : false});\n let regen = regenRoll.total;\n\n if (wounds.value >= wounds.max)\n return;\n\n if (wounds.value > 0) {\n wounds.value += Math.floor(regen / 2);\n if (wounds.value > wounds.max) {\n wounds.value = wounds.max;\n }\n message += \\`<b>\\${this.actor.name}</b> regeneriert \\${regen} Wunden.\\`;\n\n if (regen === 10) {\n message += \"<br>Außerdem regeneriert er eine Kritische Verletzung.\";\n }\n } else if (regen >= 8) {\n message += \\`<b>\\${this.actor.name}</b> hat eine \\${regen} erzielt und regeneriert 1 Wunde.\\`;\n wounds.value += 1;\n if (regen === 10) {\n message += \"<br>Außerdem regeneriert er eine Kritische Verletzung.\";\n }\n } else {\n message += \\`<b>\\${this.actor.name}</b> Regenerationsergebnis von \\${regen} - Kein Effekt.\\`;\n }\n\n await this.actor.update({\"system.status.wounds\": wounds});\n this.script.message(message, {whisper: ChatMessage.getWhisperRecipients(\"GM\")});\n`\n\nawait effect.update({\n name,\n \"system.scriptData\": scriptData\n});\n\nawait trait.update({ name });","5z5nGwZC5RIwokev":"this.script.message(await this.actor.applyBasicDamage(12, {suppressMsg: true, loc: \"roll\"}))","5Zxc13GBaJaxCf48":"const visor = this.item.getFlag('wfrp4e', 'visor');\r\n\r\nif (!visor)\r\n args.fields.modifier -= 10;\r\nelse\r\n args.fields.modifier -= 20;","6136BMmiGLwZ16H1":"return !!args.skill","62Ky6bC1EnTllSJA":"if (this.effect.sourceActor.uuid != args.actor.uuid)\r\n{\r\n 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}));\r\n}","63Yh0nrhCLLfzd14":"let damage = await new Roll(\"1d10 + @sin\", {sin: this.actor.system.status.sin.value || 0}).roll();\ndamage.toMessage(this.script.getChatData());\nthis.actor.applyDamage(damage.total, {\n damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL,\n createMessage: this.script.getChatData()\n});\n\nconst test = await this.actor.setupSkill(\n game.i18n.localize(\"NAME.Endurance\"),\n {\n fields: {difficulty: \"difficult\"},\n skipTargets: true,\n appendTitle: ` — ${this.effect.name}`,\n },\n);\n\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"stunned\");\n}","64aJznxPMUHAuf7F":"if (this.item.flags.runeOfLuck || this.actor.type != \"character\") return\n\nconst currentFortune = this.actor.status.fortune.value\nconst runesOfLuck = this.item.effects.contents.filter(e => e.name == this.effect.name)\nconst runeFortune = parseInt(runesOfLuck.length)\n\nif (args.equipped) {\n this.item.flags.runeOfLuck = true\n await this.actor.update({\"system.status.fortune.value\" : runeFortune + currentFortune})\n this.script.message(`Glückspunkte von ${currentFortune} auf ${runeFortune + currentFortune} erhöht.`)\n}\nelse\n{\n this.item.flags.runeOfLuck = true\n await this.actor.update({\"system.status.fortune.value\" : Math.max(0, currentFortune - runeFortune)})\n this.script.message(`Glückspunkte auf ${Math.max(0, currentFortune - runeFortune)} reduziert.`)\n}","65o8pQj6oGNnXce6":"let ch = this.effect.getFlag(\"wfrp4e\", \"characteristic\")\r\nthis.actor.system.characteristics[ch].modifier += 10;","65xE9OV5sA1ZWT7j":"if (args.test.options.diceman && args.test.succeeded)\r\n{\r\n\r\nlet SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10)\r\nlet ones = Number(args.test.result.roll.toString().split(\"\").pop())\r\n\r\nif (ones > SL)\r\n args.test.result.other.push(`<span class=\"hide-option\"><b>${this.effect.name}</b>: ${ones + args.test.successBonus + args.test.slBonus} SL</span>`)\r\n}","6a5nBENmfxy93vGY":"const deduct = this.effect.setFlag(\"wfrp4e\", \"failed\");\n\nif (!deduct) return;\n\nthis.actor.system.characteristics.ws.modifier -= 20;\nthis.actor.system.characteristics.bs.modifier -= 20;","6A6ddQDJo23oOWtK":"const SL = this.effect.getFlag(\"wfrp4e\", \"SL\") ?? 0;\n\nargs.fields.slBonus += SL;","6Aqq4F4Xui923sc6":"// Imbibing this substance grants the user the Painless Creature Trait.\r\nconst hasColdBlooded = this.actor.has(\"Cold Blooded\")\r\nif (hasColdBlooded === undefined) \r\n{\r\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.mCh1KK9jomwFZcLB\")\r\n let data = item.toObject()\r\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\r\n \r\n this.script.scriptMessage(`<p><strong>${this.actor.prototypeToken.name}</strong> has gained the Cold Blooded Creature Trait and may reverse any failed Willpower based Tests.</p>\r\n <p>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).</p>`, \r\n {whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true }) \r\n}","6AsCMHZ4IYPq7Uxf":"return args.skill?.name.includes(\"Focalisation\");","6BmvV9c03FkfisnE":"// Apply changes when the mask is worn\r\n\r\nif (args.equipped) { \r\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [this.item.effects.contents[1]?.convertToApplied()]) \r\n this.script.scriptMessage(`${this.actor.name} dons the <strong>${this.item.name}</strong>. <br>\r\n They gain +1 Corruption point if an exposure Test is failed, which will need to be manually applied.<br>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} \r\n `,\r\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \r\n}\r\n\r\n// Notify of lingering effects when mask is removed\r\nelse if (!args.equipped)\r\n{\r\n await this.item.effects.contents[0].delete();\r\n await this.item.update({name : this.item.name += \" (Used)\"})\r\n this.script.scriptMessage(`<strong>${this.item.name}</strong> 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.`, \r\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\r\n )\r\n \r\n}","6crZPdNEWptukssg":"let roll = await new Roll(\"1d10\").roll();\n\nroll.toMessage(this.script.getChatData());\n\nif (roll.total == 1)\n{\n this.item.updateSource({\"system.description.value\" : this.item.system.description.value += `<p><strong>${this.effect.name}</strong>: The weapon counts as a @Corruption[minor]{minor source of Corruption}.</p>`});\n}\nelse if (roll.total <= 5)\n{\n let quirks = await fromUuid(\"Compendium.wfrp4e-archives2.tables.RollTable.LbNZOF6Ov7xKHS5Z\");\n if (quirks)\n {\n let quirkRoll = await new Roll(\"1d100 + 40\").roll();\n quirkRoll.toMessage(this.script.getChatData());\n let quirkResult = (await quirks.roll({roll: quirkRoll})).results[0].text;\n this.item.updateSource({\"system.description.value\" : this.item.system.description.value += `<p><strong>${this.effect.name}</strong>: ${quirkResult.replace(\"<p>\", \"\")}</p>`});\n }\n else \n {\n this.item.updateSource({\"system.description.value\" : this.item.system.description.value += `<p><strong>${this.effect.name}</strong>: Generate an additional Quirk or Curse by rolling on the @UUID[Compendium.wfrp4e-archives2.tables.RollTable.LbNZOF6Ov7xKHS5Z]{Quirks and Curses} Table and adding +40 to the result.</p>`});\n }\n}\nelse\n{\n this.item.updateSource({\"system.description.value\" : this.item.system.description.value += `<p><strong>${this.effect.name}</strong>: People who recognise the weapon are subject to @UUID[Compendium.wfrp4e-core.items.Item.0VpT5yubw4UL7j6f]{Animosity} towards the bearer.</p>`});\n}","6elUNF58TaiYjxcx":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : \" - \" + this.effect.name, context : {failure: \"Gained a Stunned Condition\"}})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"stunned\");\r\n}","6EXkbVTRBhKTEu81":"if (!args.flags.bothEyes)\r\n{\r\n\targs.flags.bothEyes = true;\r\n\targs.fields.modifier -= 30\r\n}","6Fe8M5MdklKS2olx":"return args.characteristic != \"fel\"","6fElmBxTjdAaubbK":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"average\"}});\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"prone\")\r\n}\r\n","6frithfMs7Nbv0IZ":"args.fields.slBonus += this.effect.sourceActor.system.characteristics.fel.bonus;","6gRixT3zIOAberJb":"const disease = await fromUuid(\"Compendium.wfrp4e-soc.items.Item.8Q9JYtR1y3B5J6UH\");\r\nconst data = disease.toObject();\r\ndata.system.incubation.value = 0;\r\ndata.system.duration.active = true;\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id});","6H6vNjzvMGl2ZqCR":"if (args.totalWoundLoss > 0)\r\n this.script.scriptMessage(`<b>Blade of Nurglitch: ${args.actor.name}</b> must pass an <b>Difficult (-10) Endurance</b> Test or gain a @UUID[Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb]{Festering Wound}`, {whisper: ChatMessage.getWhisperRecipients(\"GM\") })","6hAgggYpNR3r4QWC":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Q2MCUrG2HppMcvN0\")\r\nitem = item.toObject()\r\nlet species = args.actor.Species || \" of your species\"\r\nitem.name = `Animosity (all not ${species})`\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","6HfCvw24X6oEe2vn":"if ([\"t\", \"s\"].includes(args.characteristic))\n{\n\targs.fields.modifier += 10;\n}","6jcTzK1XEuWqAacN":"args.abort = true;\r\nthis.script.scriptNotification(`Cannot use ${game.wfrp4e.config.locations[this.effect.getFlag(\"wfrp4e\", \"location\")]}!`, \"error\")","6jp8slPU33oBQe1V":"return args.options.crewTest?.system.handling !== true;","6JrUjs3g5x6bFnj3":"let bite = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\r\nlet sense = await fromUuid(\"Compendium.wfrp4e-core.items.9h82z72XGo9tfgQS\")\r\nlet biteData = bite.toObject();\r\nlet senseData = sense.toObject();\r\n\r\nbiteData.system.specification.value = 6 - this.actor.characteristics.s.bonus;\r\nsenseData.name = senseData.name += \" (Smell)\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [biteData, senseData], {fromEffect : this.effect.id})","6kifXp2jXEaQVJsg":"let useWard = await Dialog.wait({\r\n\ttitle : this.effect.name,\r\n\tcontent : `<p>Use Ward provided by <strong>${this.effect.name}</strong>?`,\r\n\tbuttons : {\r\n\t\tyes : {\r\n\t\t\tlabel : \"Yes\",\r\n\t\t\tcallback: () => {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t},\r\n\t\tno : {\r\n\t\t\tlabel: \"No\",\r\n\t\t\tcallback: () => {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n})\r\n\r\nif (useWard)\r\n\targs.ward = 9;","6LMzIdmCSYctgmGx":"const stupid = this.actor.items.find(i => i.name === \"Stupidee\");\n\nif (!stupid) return;\n\nawait stupid.update({\"system.disabled\": true});","6maNAmREdataXmo4":"if (this.actor.system.status?.ward?.value) {\n this.actor.system.status.ward.value = Math.max(7, this.actor.system.status.ward.value-1);\n} else {\n this.actor.system.status.ward.value = 9;\n}","6Mjy0jDqczA8BxhS":"return ![\"roll\", \"none\"].includes(args.fields.hitLocation)","6mpw9cGseG4W4eyd":"if (this.actor.system.status.advantage.value >= 2)\r\n{\r\n await this.actor.modifyAdvantage(-2);\r\n this.script.scriptNotification(\"Advantage Subtracted\")\r\n}\r\nelse \r\n{\r\n return this.script.scriptNotification(\"Not enough Advantage!\", \"error\")\r\n}\r\n\r\nlet test = await this.actor.setupTrait(this.item)\r\nawait test.roll();","6MSodMuZ5xk2JJJ9":"if (!this.actor.hasCondition(\"ablaze\"))\r\n{\r\n this.effect.delete();\r\n}","6nA5LPXneAahHX2W":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Dodge\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n\tlet sourceActor = this.effect.sourceActor;\n\tthis.script.message(await this.actor.applyBasicDamage(4 + sourceActor.system.characteristics.s.bonus, {suppressMsg : true}))\n}","6oSs8qKFNFz2lSmh":"if (args.actorsystem.details.move.sail.value > 0)\r\n args.actor.system.details.move.sail.value = 0;\r\n","6P2QNPKfwQ1xwxZT":"args.fields.slBonus ++","6qJP0hpShEM43ohx":"const actor = args.actor;\r\n\r\nif (actor.itemTypes.skill.find(s => s.name === \"Lore (Oceans)\")) {\r\n const loreTest = await actor.setupSkill('Lore (Oceans)', {\r\n appendTitle: ` – ${this.effect.name}`,\r\n skipTargets: true,\r\n fields: {difficulty: 'hard'},\r\n characteristic: 'int',\r\n });\r\n await loreTest.roll();\r\n\r\n if (loreTest.succeeded) {\r\n loreTest.result.other.push(`<b>${actor.name}</b> recognizes lure of the Leviathan.`);\r\n loreTest.renderRollCard();\r\n return;\r\n } \r\n}\r\n\r\nlet test = await actor.setupSkill('Cool', {\r\n appendTitle: ` – ${this.effect.name}`,\r\n skipTargets: true,\r\n fields: {difficulty: 'easy'},\r\n characteristic: 'wp',\r\n});\r\nawait test.roll();\r\n\r\nif (!test.succeeded) {\r\n test.result.other.push(`<b>${actor.name}</b> became @Condition[Stunned] by the sight.`);\r\n test.renderRollCard();\r\n actor.addCondition(\"stunned\");\r\n}","6qUKKep5vhFYmo1J":"return args.type == \"channelling\" || args.skill?.name.includes(game.i18n.localize(\"NAME.Channelling\"))","6QZUX7ZrFxOzqI0b":"let regenerate = this.actor.items.getName('Regenerate')\r\n\r\nif (regenerate)\r\n{\r\n let effect = regenerate.effects.contents[0]\r\n let scriptData = effect.getFlag(\"wfrp4e\", \"scriptData\");\r\n \r\n scriptData[0].script = scriptData[0].script.replace(\"1d10\", \"1d10 * 2\")\r\n}","6tjn0RH4VyOPFneS":"return [\"NAME.Row\", \"NAME.Swim\"].map(i => game.i18n.localize(i)).includes(args.skill?.name);","6U8xox4mBrn5eYIp":"if (args.totalWoundLoss > 0)\r\n args.actor.addCondition(\"ablaze\")","6ubojp9zwbfJnosT":"args.actor.system.details.move.value += 1;","6uldpFvKOCoW92cC":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.uqGxFOEqeurwkAO3\")\r\nitem = item.toObject()\r\n\r\nitem.system.specification.value = 10;\r\nitem.name += \" (Fire)\"\r\nsetProperty(item, \"flags.wfrp4e.breath\", \"fire\")\r\n\r\nItem.create(item, {parent : this.actor, fromEffect: this.effect.id})","6V3qHON3mcerlBlB":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"prone\");\r\n}","6Ws3ieQ7pG5poUyT":"if (isNaN(parseInt(this.item.system.specification.value)))\r\n{\r\n let value = await ValueDialog.create(\"Enter Spellcasting Lore\", this.effect.name, \"\", Object.values(game.wfrp4e.config.magicLores));\r\n if (value)\r\n {\r\n this.item.updateSource({\"system.specification.value\" : value});\r\n }\r\n}","6xTtJEhRc4OjcDTf":"if (getProperty(args.data, \"system.status.fortune.value\"))\r\n{\r\n\tthis.script.scriptNotification(\"Cannot update Fortune\");\r\n\tdelete args.data.system.status.wounds.value;\r\n}","6XWJWOUQPgKMsFul":"return args.item?.system.attackType != \"ranged\" || args.flags.howlingWarpGale","6ZS1rQLkNvMDO0Fp":"let roll = Math.ceil(CONFIG.Dice.randomUniform() * 10)\r\nif (args.test.isFumble && roll == 1 && !args.test.result.misfire)\r\n{\r\n args.test.result.misfire = game.i18n.localize(\"Misfire\") + \" (Rolled 1)\"\r\n args.test.result.misfireDamage = eval(parseInt(args.test.result.roll.toString().split('').pop()) + args.test.item.Damage)\r\n}\r\nelse if (args.test.isFumble && roll != 1)\r\n{\r\n args.test.result.other.push(\"Misfire Roll: \" + roll)\r\n}\r\n\r\n","713v1T8HNste94pr":"args.context.grudge = true;","715G1Bf0haOHvmYQ":"return !(args.skill?.name == game.i18n.localize(\"NAME.Bribery\") || args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\")))","71DmrxCTKGYL4Z7X":"return [\"fel\"].includes(args.characteristic)","7ateEtT5HXg1vObY":"const uuids = [\r\n \"Compendium.wfrp4e-core.items.Item.AcnFuDKRemLI9ey7\", // Nose for Trouble\r\n \"Compendium.wfrp4e-core.items.Item.WoXShzaYkV5F6c48\", // Master of Disguise\r\n];\r\n\r\nconst items = await Promise.all(uuids.map(uuid => fromUuid(uuid)));\r\nawait this.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect: this.effect.id});","7BgJe9YkbHTh3ucm":"if (args.totalWoundLoss <= 0) return;\n\nconst test = await this.actor.setupSkill(\n game.i18n.localize(\"NAME.Endurance\"),\n {\n fields: {difficulty: \"difficult\"},\n skipTargets: true,\n appendTitle: ` — ${this.effect.name}`,\n },\n);\n\nawait test.roll();\n\nif (test.failed) {\n const item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.kKccDTGzWzSXCBOb\");\n const data = item.toObject();\n\n data.system.duration.active = true;\n\n args.actor.createEmbeddedDocuments(\"Item\", [data]);\n}","7Ck0fkzE4WQ62qVe":"if (args.item.type == \"skill\" && args.item.name == \"Melee (Basic)\")\r\n{\r\n args.item.system.modifier.value += 20;\r\n}","7e8FgQUF2oANANmx":"return args.skill?.name == \"Melee (Brawling)\" || args.item?.weaponGroup?.value == \"brawling\"","7F3miqRA0ceMUBIu":"return args.characteristic != \"int\" || args.skill","7F6aGxZJjwxm5e5P":"if (args.test.result.castOutcome == \"failure\")\r\n{\r\n ValueDialog.create(\"Enter Wounds Lost to gain SL\", this.effect.name, \"0\").then(async value => {\r\n value = Math.clamped(value, 0, 3)\r\n if (value == 0)\r\n {\r\n return; \r\n }\r\n else if (Number.isNumeric(value))\r\n {\r\n this.script.scriptNotification(`Lost ${value} Wounds`)\r\n this.actor.modifyWounds(-1 * value)\r\n await this.item.system.toggleEquip();\r\n args.test.addSL(value);\r\n args.test.preData.other.push(`<strong>${this.effect.name}</strong>: +${value} SL`)\r\n }\r\n })\r\n}","7f6OsttTzE7Hvzfk":"if (this.actor.statuses.has(\"infighting\")) // Only add +10 if already infighting\r\n args.prefillModifiers.modifier += 10; \r\n\r\n\r\nargs.prefillModifiers.successBonus += 1; \r\n","7H6wYyJ6cpaoc2QQ":"return args.skill?.name == game.i18n.localize(\"NAME.Cool\");","7IuX8wytm33iRGC3":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed && this.actor.type == \"character\")\n{\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\n this.script.message(\"1 Korrumpierungspunkt erhalten\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}","7JW9t8AYSDkkzG2V":"// Apply changes when the mask is worn\r\n\r\nif (args.equipped) \r\n{ \r\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [this.item.effects.contents[1]?.convertToApplied()]) \r\n this.script.scriptMessage(`${this.actor.name} dons the <strong>${this.item.name}</strong>. <br>\r\n 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}. \r\n `,\r\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \r\n}\r\n\r\n// Notify of lingering effects when mask is removed\r\nelse if (!args.equipped)\r\n{\r\n await this.item.effects.contents[0].delete();\r\n await this.item.update({name : this.item.name += \" (Used)\"})\r\n this.script.scriptMessage(`<strong>${this.item.name}</strong> 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.`, \r\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\r\n )\r\n \r\n}","7n3SEAGRA5ESK8gV":"args.options.disarm = true;","7OmrMjaU48o2FEZi":"\r\nthis.actor.characteristics.t.bonus = 10\r\n\r\nthis.actor.details.move.value = 0;\r\nthis.actor.details.move.walk= 0;\r\nthis.actor.details.move.run = 0;","7ScfB4o1QhXnNUfq":"return ![\"int\", \"wp\"].includes(args.characteristic)","7szLG4VALuuy1cPm":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"easy\"}})\r\nawait test.roll();\r\nif (test.failed)\r\n{ \r\n await this.actor.addCondition(\"fatigued\")\r\n} ","7T3iXgrL72fea67C":"const bloodyFluxUUID = \"Compendium.wfrp4e-core.items.Item.herUmN51D9TiL2Vn\";\n\nconst test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {\n skipTargets: true,\n appendTitle: ` — ${this.effect.name}`,\n fields: {difficulty: \"easy\"},\n context: {\n success: `Butcher wird geheilt.`,\n failure: `Butcher contracte @UUID[${bloodyFluxUUID}].`\n }\n});\n\nawait test.roll();\n\nif (test.failed) {\n await this.actor.addEffectItems(bloodyFluxUUID, this.effect);\n} else {\n const SL = test.result.SL;\n const heal = 1 + SL;\n await this.actor.modifyWounds(heal);\n this.script.message(`Butcher heilt ${heal} Wunden.`);\n}","7UUS0gX2Pbi0HHiz":"return args.skill?.name !== game.i18n.localize(\"NAME.Swim\");","7VAhXHov6pR1SkgD":"return args.item?.name == game.i18n.localize(\"NAME.Endurance\");","7w7QA7GBhzZ98OS0":"const sin = this.effect.sourceActor.system.status.sin.value;\r\nconst result = await WFRP_Tables.rollTable(\"manann-mood-made-meaningless\", sin);\r\nlet match = result.text.match(/b>([^<]+)/i);\r\nlet key = match[1];\r\nlet roll = new Roll(\"5d10\");\r\nlet value = undefined;\r\n\r\nawait this.script.scriptMessage(result.text, {flavor: result.title});\r\n\r\nswitch (key) {\r\n case 'Stromfels Triumphant!':\r\n value = 0;\r\n break;\r\n case 'Stromfels Ascends!':\r\n await roll.evaluate();\r\n if (this.actor.system.status.mood.value > 0)\r\n value = -roll.total;\r\n else if (this.actor.system.status.mood.value < 0)\r\n value = roll.total;\r\n break;\r\n case 'No effect.':\r\n break;\r\n case 'Manann Provoked!':\r\n await roll.evaluate();\r\n value = -roll.total;\r\n break;\r\n}\r\n\r\nif (roll._evaluated)\r\n await roll.toMessage();\r\n\r\nawait this.effect.setFlag(\"wfrp4e-soc\", \"m4result\", {result: key, value});","7wBWUw05q0igh508":"// Imbibing this substance grants the user the Painless Creature Trait.\r\nconst hasPainless = this.actor.has(\"Painless\");\r\nif (hasPainless === undefined) \r\n{\r\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.wMwSRDmgiF2IdCJr\");\r\n let data = item.toObject()\r\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\r\n \r\n this.script.scriptMessage(\r\n `<p><strong>${this.actor.prototypeToken.name}</strong> has gained the Painless Creature Trait. This\r\n effect lasts for one hour, after which it dissipates and the full effect\r\n of all the imbiber's wounds come crashing down at once.</p>\r\n <p>Note that this does not prevent the user from acquiring a Critical\r\n Wound or dying from one. It merely allows them to ignore most\r\n of their effects.</p>`, \r\n { whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true})\r\n}","7WR2hJjHPhHhHxAq":"let poisoned = args.actor.hasCondition(\"poisoned\")\r\nif (poisoned)\r\n{\r\n this.script.scriptNotification(`Removed ${poisoned.conditionValue} Poisoned Conditions`)\r\n poisoned.delete(); \r\n}\r\nelse\r\n this.script.scriptNotification(`No Poisoned Conditions`)","7y89OcMmGbjRMgTg":"return !this.item.equipped.value \n || !args?.skill\n || !([game.i18n.localize(\"NAME.Charm\"), \n game.i18n.localize(\"NAME.Intimidate\"), \n game.i18n.localize(\"NAME.Leadership\")].includes(args.skill.name))","7ykah8fvh2Y0o2Hi":"this.actor.addCondition(\"blinded\");\nlet roll = await new Roll(\"1d10\").roll();\nroll.toMessage(this.script.getChatData());\nthis.effect.updateSource({duration: {value: roll.total, units: \"hours\"}});","7ZoFUMDG2WJd8RMg":"this.script.scriptMessage(`Claimed <strong>${this.effect.name}</strong> Bonus`);","84IB8CWa55XzoAkv":"return ([\"Animal Care\", \"Charm Animal\"].includes(args.item?.name) || args.item?.name.includes(\"Ride\") || args.item?.name.includes(\"Animal Training\"))","86ivOsBQAuu0UmFg":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"hard\"}, appendTitle : ` - ${this.effect.name}`, skipTargets: true});\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"poisoned\");\r\n}","873KaarAnJ2qf1r2":"args.modifiers.other.push({label : this.effect.name, details : \"Schadenserhöhung\", value : 1})","87rrZ3ojHrXa3lCn":"this.actor.modifyWounds(1)","8AoA4bnstBtglRGZ":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.wMwSRDmgiF2IdCJr\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","8araLuwmBq8GKEw3":"let APIgnored = args.AP.layers.reduce((prev, current) => prev + ((current.weakpoints && !current.ignored) ? current.value : 0), 0)\r\n\r\nif (APIgnored)\r\n{\r\n args.modifiers.ap.ignored += APIgnored\r\n args.modifiers.ap.details.push(`<strong>${this.effect.name}</strong>: Ignore AP with Weakpoints (${APIgnored})`)\r\n}","8BCzpjFU0GeA17Wp":"args.fields.modifier +=20;","8ByuHnUZ4RNTdGVv":"let strLoss = Math.ceil(CONFIG.Dice.randomUniform() * 10)\r\nlet tghLoss = Math.ceil(CONFIG.Dice.randomUniform() * 10)\r\n\r\nif (!this.actor.has(\"Undead\") && !this.actor.has(\"Daemonic\")) \r\n{\r\n 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 => {\r\n await test.roll();\r\n if (test.failed) {\r\n 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 })\r\n }\r\n })\r\n\r\n}\r\nelse {\r\n this.script.scriptNotification(`<strong>${this.actor.name}</strong> is immune to ${this.effect.name}`)\r\n}\r\n","8fefDfiYKFOWdPER":"args.update({texture : {scaleX : 2, scaleY: 2, src: \"modules/wfrp4e-core/tokens/popout/gor.webp\"}});","8g2iitsgaJarKQpr":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.V0c3qBU1CMm8bmsW\")\r\nlet data = item.toObject()\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\r\n","8Gan2EeGExBFSxmp":"let damage = this.effect.sourceTest.result.damage;\n\nif (this.actor.sizeNum >= game.wfrp4e.config.actorSizeNums.lrg)\n damage += 7; // goes from +8 to +15;\n\nif (this.actor.has(game.i18n.localize(\"NAME.Unstable\"))) \n damage *= 2;\n\nthis.actor.applyDamage(damage, {\n loc: \"roll\",\n createMessage: this.script.getChatData()\n});","8gCja0mfKt4nYVZc":"args.fields.slBonus += 2 ","8GyJgdHVBaLrHCY8":"let type = this.item.getFlag(\"wfrp4e\", \"breath\")\r\nlet types = {\r\n none : \"None\",\r\n cold : \"Cold\",\r\n corrosion : \"Corrosion\",\r\n fire : \"Fire\",\r\n electricity : \"Electricity\",\r\n poison : \"Poison\",\r\n smoke : \"Smoke\",\r\n various : \"Various\"\r\n}\r\nif (!type)\r\n{\r\n type = (await ItemDialog.create(ItemDialog.objectToArray(types, this.item.img), 1, \"Choose Breath\"))[0]?.id;\r\n this.item.updateSource({\"flags.wfrp4e.breath\" : type})\r\n}\r\n\r\nif (!this.item.name.includes(\"(\") && types[type] && type != \"none\")\r\n{\r\n this.item.updateSource({name : this.item.name += ` (${types[type]})`, \"system.specification.value\" : this.item.system.specification.value.replace(\"(Type)\", \"\").trim()})\r\n}","8hCdSTjZqeuVyBGV":"if (args.sourceTest.options.doubleDamage)\n{ \n args.modifiers.other.push({label: this.effect.name, value: args.totalWoundLoss});\n args.totalWoundLoss *= 2;\n}","8hIyWDyfbgGAig65":"return [\"ws\", \"bs\", \"s\", \"t\", \"ag\", \"dex\"].includes(args.characteristic)","8jvEVPUCg3rKG48Y":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9fq6p9Q6H02LjaSi\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","8K9tpCwvFC9INk5V":"if ([\"t\", \"wp\"].includes(args.characteristic))\r\n{\r\n\targs.fields.modifier += 10;\r\n}\r\nelse if ([\"ag\", \"i\", \"int\"].includes(args.characteristic))\r\n{\r\n\targs.fields.modifier -= 10;\r\n}","8LmUVQxOwTLSeabg":"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","8N3Uqjq1ZxPxo4pk":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Lore\"))","8noxHUQKR55Kx1YN":"this.actor.system.status.corruption.max += 1","8oE0DTzz0krOfFlV":"args.item.system.qualities.value.push({name : \"magical\"})\r\nargs.item.system.qualities.value.push({name : \"impact\"})\r\n","8OwUgwZI8hOJt2hG":"args.fields.modifier += ((this.effect.sourceTest?.result.slOver * 10) || 10)","8pbVGsVFlDebu2Ac":"args.wounds += 2;","8qOGotfGFA0HYQ6W":"let resistances = this.actor.itemTags.talent.filter(i => i.name == game.i18n.localize(\"NAME.MagicResistanceTalent\"));\n\nfor(let talent of resistances)\n{\n talent.system.max.value = \"custom\";\n talent.system.max.formula = \"@characteristics.t.bonus + 2\"\n}","8R7O63iC0yANtkJ9":"if (this.item.equipped.value && this.actor.hasCondition(\"ablaze\"))\n{\n await this.actor.removeCondition(\"ablaze\")\n this.script.notification(`Kann den Zustand Brennend nicht erhalten`,\"info\");\n}","8RNziYGGb4sp3BGQ":"if (!args.test.weapon?.name.includes(\"Drakefire\"))\r\n{\r\n args.test.result.misfire = game.i18n.localize(\"Misfire\");\r\n args.test.result.misfireDamage = (0, eval)(parseInt(args.test.result.roll.toString().split('').pop()) + args.test.weapon.system.Damage);\r\n}","8rq4GL5d5nCn4kO7":"let caster = this.effect.sourceActor\r\nif (caster)\r\n{\r\n let healed= caster.characteristics.wp.bonus\r\n this.actor.modifyWounds(healed);\r\n this.script.scriptMessage(`<strong>${this.actor.prototypeToken.name}</strong> regains ${healed} Wounds`)\r\n}","8ShLVT0bK1eQpinj":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.k00PimCWkff11IA0\")\r\nlet data = item.toObject();\r\ndata.system.location.key = this.item.system.location.key\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data])","8sJSsjq6wx4IxXWn":"let test = args.test\nif (test && test.spell?.system.magicMissile.value)\n{\n let roll = await new Roll(\"1d100\").roll();\n roll.toMessage(this.script.getChatData());\n if (roll.total <= 30)\n {\n this.script.message(`<strong>${this.item.name}</strong> : Der Zauber schlägt fehl!`)\n }\n}","8ThudCYRqkjQIwJH":"if (args.opposedTest.attackerTest.result.critical)\r\n{\r\n args.actor.addCondition(\"ablaze\")\r\n}","8TRiAJ8thIKE4IoL":"\r\nlet SL = Number(getProperty(this.item, \"flags.wfrp4e.sourceTest.result.SL\") || 1)\r\n\r\nargs.actor.characteristics.i.modifier += 10 * SL\r\nargs.actor.characteristics.ag.modifier += 10 * SL","8tyMXDfHR8AJBdDu":"let weakpointsAP = args.AP.layers.filter(i => !i.ignored && i.weakpoints).reduce((ap, layer) => ap + layer.value, 0);\r\n\r\nif (weakpointsAP > 0)\r\n{\r\n args.modifiers.ap.ignored += weakpointsAP;\r\n args.modifiers.ap.details.push(`${this.effect.name} - Ignore Weakpoints (${weakpointsAP})`);\r\n}","8vpAtJ93GIeye1qj":"return args.type == \"cast\"","8WeYU5e5LN9UeWFs":"if (args.item.type == \"spell\")\r\n{\r\n let range = parseInt(args.item.Range)\r\n if (Number.isNumeric(range))\r\n {\r\n args.item.system.range.value = \"2 * \" + args.item.system.range.value\r\n }\r\n}","8wG9l4T9fc1bM0TN":"let item = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.kJNAY1YRaCy9IgmT\")).toObject();\r\nitem.system.specification.value = 1;\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","8WJsecxdndaHRxxS":"this.actor.status.addArmour(this.actor.characteristics.wp.bonus, {source: this.effect, magical : true})","8xqYrBIf1Zhlwizg":"const repaired_message = `<p>Finished raisint <em>the anchor</em>.</p>`;\r\nconst test = 'Strength';\r\nconst difficulty = 'vhard';\r\nconst target = 20;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","8yBr6VbdKcrWUuqw":"this.actor.characteristics.i.value= \"-\"\r\nthis.actor.characteristics.int.value= \"-\"\r\nthis.actor.characteristics.wp.value= \"-\"\r\nthis.actor.characteristics.fel.value = \"-\"","8ZAUBSH9CM9OTpTL":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Perception\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"easy\"}});\r\nawait test.roll();\r\n\r\nif (test.succeeded)\r\n{\r\n this.actor.addCondition(\"stunned\") \r\n}\r\nelse if (test.failed)\r\n{\r\n this.actor.addCondition(\"poisoned\", 2);\r\n}","8zTkDVziBPaNbMQX":"let filters = [\r\n {\r\n property : \"type\",\r\n value : \"spell\"\r\n },\r\n {\r\n property : \"system.lore.value\",\r\n value : \"petty\"\r\n }\r\n]\r\n\r\nlet petty = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 6, \"Choose 6 Petty Spells\")\r\n\r\n\r\nfilters = [\r\n {\r\n property : \"type\",\r\n value : \"spell\"\r\n },\r\n {\r\n property : \"system.lore.value\",\r\n value : \"\"\r\n }\r\n]\r\n\r\nlet arcane = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 9, \"Choose 9 Arcane Spells\")\r\n\r\nlet items = petty.concat(arcane).map(i => i.toObject())\r\n\r\nthis.actor.createEmbeddedDocuments(\"Item\", items);","91S2GnBFYFbxmOCK":"this.actor.characteristics.s.bonus += 1\r\nthis.actor.characteristics.s.calculationBonusModifier -= 1","93K85NnVwjVNXlZq":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Trade\"));","94eDAi6pkMhG3Ex9":"this.actor.deleteEmbeddedDocuments(\"ActiveEffect\", [this.effect.id]);","956dUb5sd6OtbWZR":"args.fields.successBonus++;","96Y1yIH1lRjTs5hL":"if (args.test.succeeded)\r\n return\r\n\r\nif (args.test.characteristicKey == \"wp\")\r\n this.actor.addCondition(\"broken\")","97yDvwmUqkwHktQj":"let data = this.effect.getFlag(\"wfrp4e\", \"handOfGlory\");\nlet changes = [];\n\nif (!data)\n{\n return;\n}\n\nif (data.characteristic == \"movement\")\n{\n changes = [{key: \"system.details.move.value\", mode: 2, value: 2}]\n}\nelse \n{\n let currentTotal = this.actor.system.characteristics[data.characteristic].value;\n let newTotal = this.actor.system.characteristics[data.characteristic].value + data.roll;\n let bonusOffset = Math.floor(currentTotal / 10) - Math.floor(newTotal / 10); // e.g. 37 + 15 bonus = 52, calculation bonus modifier should be -2\n\n changes = changes.concat({\n key: `system.characteristics.${data.characteristic}.modifier`,\n mode: 2,\n value: data.roll\n }, \n {\n key: `system.characteristics.${data.characteristic}.calculationBonusModifier`,\n mode: 2,\n value: bonusOffset\n })\n}\n \nthis.effect.updateSource({changes});","98nKfcimlaPeM9h5":"await this.actor.addCondition(\"bleeding\")\r\nawait this.script.scriptMessage(await this.actor.applyBasicDamage(10, {suppressMsg : true}));","9A7rYY3FKi5XLihG":"fromUuid(\"Compendium.wfrp4e-core.items.5QcrpLQWWrsbKR79\").then(item => {\r\n let data = item.toObject();\r\n data.system.tests.value = data.system.tests.value.replace(\"coins\", \"metal objects\");\r\n data.system.description.value += \"<p>This Talent also extends to any metal object because of <strong>Metallic Affinity</strong></p>\"\r\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\r\n})","9AMoFRATTAfdKlKN":"const test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {\n skipTargets: true,\n appendTitle: ` — ${this.effect.name}`,\n fields: {difficulty: \"challenging\"},\n context: {\n failure: `Erhält 1 Zustand @Condition[Poisoned].`\n }\n});\n\nawait test.roll();\n\nif (test.failed) {\n args.actor.addCondition(\"poisoned\");\n const speaker = ChatMessage.getSpeaker({actor: args.actor});\n this.script.message(`<p>${speaker.alias} erhält 1 Zustand @Condition[Poisoned] durch Spinnengift.</p><p>Opfer, die auf 0 Wunden reduziert werden und unter einem @Condition[Poisoned]-Zustand dieser Pfeile leiden, werden @Condition[Unconcious], riskieren aber nicht den Tod durch verbleibende @Condition[Poisoned]-Zustände, wie es normalerweise der Fall wäre.</p>`);\n}","9bJGJrLqslV5lBya":" return args.characteristic == \"bs\"","9eL5JbQQmCY030ba":"this.actor.addCondition(\"poisoned\");","9EVj4bmZJex45Mt7":"return args.skill?.name != game.i18n.localize(\"NAME.Athletics\");","9eWR4mdaoCSQawDT":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.GlShFJF2TpsNh1FX\");\r\nlet data = item.toObject();\r\ndata.system.location.key = this.item.system.location.key\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\r\n","9fK07tqqZyPg7dpx":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty: \"veasy\"}})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.script.scriptNotification(\"Gained a <strong>Festering Wound</strong>\")\r\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb\")\r\n this.actor.createEmbeddedDocuments(\"Item\", [item.toObject()])\r\n}\r\nelse \r\n{\r\n this.script.scriptNotification(\"Avoided a <strong>Festering Wound</strong>\")\r\n}\r\n","9fNHye2N2DORR0A3":"return !args.item.name.includes(\"Arme\")","9HWEDsnNxSykqbF5":"args.actor.system.details.move.value += 3;\r\nargs.actor.system.status.carries.max = Math.floor(args.actor.system.status.carries.max * 0.25);\r\nargs.actor.system.details.price.gc *= 1.1;","9JnPK1jNUEso7Pv8":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9h82z72XGo9tfgQS\")\r\nlet data = item.toObject();\r\ndata.name += ` (Smell)`\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","9MDi3ok9gPwtbALf":"args.actor.details.move.value /= 2","9MwRUzRinhq1IjhG":"args.actor.addCondition(\"grappling\");","9nroaZDkW3WXNkB7":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.4MJJCiOKPkBByYwW\");\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","9ob2lPnk3PDot9Tx":"this.actor.addCondition(\"blinded\", this.effect.sourceTest.result.SL)","9qWUuEF8F5nehF1y":"args.item.system.qualities.value = args.item.system.qualities.value.concat([{name : \"magical\"}, {name : \"unbreakable\"}])\r\nargs.item.system.damage.value += ` + ${this.effect.sourceActor.system.characteristics.wp.bonus}`","9RFoasDcFnYZ1txR":"return args.skill?.name == game.i18n.localize(\"NAME.Perception\");","9VfeubiCV83LN9iY":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")\r\nlet data = item.toObject();\r\ndata.name += ` (When Charging)`\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","9WZa63lr0K3SsP4G":"let sourceItem = this.effect.sourceItem;\r\n\r\nif (sourceItem)\r\n{\r\n\tthis.actor.applyEffect({effectUuids : [sourceItem.effects.contents[2].uuid]})\r\n\tthis.script.scriptNotification(\"Applied after effects\");\r\n}","9Yn9uViEjcuaESJ2":"if (this.item.getFlag(\"wfrp4e\", \"failedCool\"))\r\n{\r\n this.item.name += \" (No AP)\"\r\n this.item.system.AP = {\r\n \"head\": 0,\r\n \"lArm\": 0,\r\n \"rArm\": 0,\r\n \"lLeg\": 0,\r\n \"rLeg\": 0,\r\n \"body\": 0\r\n }\r\n}","9ZFPDCk8M2TQxh7x":"args.fields.modifier += 20\r\n","a02tlRCXpaoaDjSN":"let careers = await warhammer.utility.findAllItems(\"career\", \"\", true);\r\ncareers.forEach(c => {\r\n if (!c.id)\r\n {\r\n c.id = c._id;\r\n }\r\n});\r\nlet choice = await ItemDialog.create(careers, 1, \"Choose Double Life Career\");\r\nif (choice[0])\r\n{\r\n let career = await fromUuid(choice[0].uuid);\r\n let data = career.toObject();\r\n setProperty(data, \"flags.wfrp4e.doubleLife\", true);\r\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\r\n this.effect.updateSource({name : this.effect.name + ` (${data.name})`})\r\n}\r\n","A0OK0qAMmnf8iNJf":"if (args.test.result.SL < 0)\r\n{\r\n this.script.scriptMessage(`Gained ${Math.abs(args.test.result.SL)} Corruption points`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n if (args.test.failed && this.actor.type == \"character\")\r\n {\r\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + Math.abs(args.test.result.SL)})\r\n }\r\n}","a0YU3whUm16wGBNu":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"average\"}})\r\nawait test.roll();\r\n\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"fatigued\");\r\n}","A1odAcuRbq9797ZB":"let choice1 = [\n {\n type : \"skill\",\n name : \"Melee (Basic)\",\n diff : {\n system : {\n advances : {\n value : 10\n }\n }\n }\n }\n]\nlet choice2 = [\n {\n type : \"skill\",\n name : \"Melee (Polearm)\",\n diff : {\n system : {\n advances : {\n value : 10\n }\n }\n }\n }\n]\n\nlet choice = await Dialog.wait({\n title : \"Choice\",\n content : \n `<p>\n Select your choice\n </p>\n <ol>\n <li>Melee (Basic)</li>\n <li>Melee (Polearm)</li>\n </ol> \n `,\n buttons : {\n 1 : {\n label : \"Basic\",\n callback : () => {\n return choice1;\n }\n },\n 2 : {\n label : \"Polearm\",\n callback : () => {\n return choice2;\n }\n }\n }\n})\n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","A3fvV69RS1lYgma0":"if (this.actor.type == \"character\") \r\n this.actor.corruptionDialog(\"minor\")\r\n\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name})\r\nawait test.roll();\r\nif(test.failed)\r\n{\r\n await this.actor.addCondition(\"unconscious\");\r\n let secondTest = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty : \"easy\"}, skipTargets: true, appendTitle : \" - Despair\"})\r\n await secondTest.roll();\r\n if(secondTest.failed)\r\n {\r\n await this.actor.addCondition(\"fatigued\");\r\n }\r\n}","A3MW0UksYrHGa0Qw":"return [\"fel\", \"wp\", \"int\", \"t\"].includes(args.characteristic);","A3XrFB7SvV2vcg1a":"if (args.applyAP) \n{\n args.applyAP = false;\n}","a4Aza4a9v8JMU8dC":"const talents = await Promise.all([\"Frenzy\", \"Magic Resistance\"].map(game.wfrp4e.utility.findTalent))\r\nthis.actor.createEmbeddedDocuments(\"Item\", talents, {fromEffect : this.effect.id})","a4Q7RJpW0sqvfATw":"let fatigued = this.actor.hasCondition(\"fatigued\")\n if (!fatigued)\n {\n this.actor.addCondition(\"fatigued\")\n ui.notifications.notify(\"Erschöpft zu \" + this.actor.name + \" hinzugefügt; kann nicht entfernt werden, solange das Symptom Unwohlsein vorhanden ist.\")\n }","a5WEJ2oxlcdOFWlL":"args.actor.system.characteristics.t.initial += 20;","A6DcKPzAGntzSCil":"let roll = await new Roll(\"1d10\").roll()\r\n\r\nroll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Duration)`}));\r\n\r\nthis.effect.updateSource({\"duration.rounds\" : roll.total})","a6gacHsvgwtsIFSQ":"if (args.test.item && args.test.item.name == game.i18n.localize(\"NAME.Research\"))\r\n args.test.preData.canReverse = true","a7pEvCycVnFBXGAQ":"let test = await this.actor.setupCharacteristic(\"i\", {skipTargets: true, appendTitle : \" - Stunned\", fields : {difficulty : \"easy\"}})\r\nawait test.roll();\r\n\r\nif (!test.succeeded)\r\n{\r\n\tthis.actor.addCondition(\"stunned\");\r\n}","a81IMxqmMtHgYnIF":"return !args.weapon?.system.isMelee;","a8i0sA1RBnD8nHZt":"let caster = this.effect.sourceActor\r\nlet targetedItem = this.actor.items.get(this.effect.flags.wfrp4e.itemTargets[0])\r\n\r\nlet qualities = foundry.utils.deepClone(game.wfrp4e.config.itemQualities);\r\nlet flaws = foundry.utils.deepClone(game.wfrp4e.config.itemFlaws);\r\n\r\nif (targetedItem.type == \"weapon\")\r\n{\r\n mergeObject(qualities, game.wfrp4e.config.weaponQualities)\r\n mergeObject(flaws, game.wfrp4e.config.weaponFlaws)\r\n}\r\nelse if (targetedItem.type == \"armour\")\r\n{\r\n mergeObject(qualities, game.wfrp4e.config.armorQualities)\r\n mergeObject(flaws, game.wfrp4e.config.armorFlaws)\r\n}\r\n\r\nfor(let q in qualities)\r\n{\r\n // If the weapon already has a flaw, don't put it in the dialog\r\n if (targetedItem.system.properties.qualities[q])\r\n {\r\n delete qualities[q]\r\n }\r\n}\r\nfor(let f in flaws)\r\n{\r\n // If a weapon doesn't have a flaw, don't put it in the dialog\r\n if (!targetedItem.system.properties.flaws[f])\r\n {\r\n delete flaws[f]\r\n }\r\n}\r\n \r\nlet added = await ItemDialog.create(ItemDialog.objectToArray(qualities), \"unlimited\", \"Choose Qualities to add\");\r\nlet removed = []\r\nif (!foundry.utils.isEmpty(flaws))\r\n{\r\n removed = await ItemDialog.create(ItemDialog.objectToArray(flaws), \"unlimited\", \"Choose Flaws to remove\");\r\n}\r\n\r\nthis.effect.updateSource({\"flags.wfrp4e.propertiesChanged\" : {added : added.map(i => i.id), removed : removed.map(i => i.id)}})\r\n","a8RabrnJ08O07rDX":"if (args.totalWoundLoss > 0)\r\n{\r\n // I'm assuming the endurance test specified is for the end-round check\r\n await args.actor.addCondition(\"poisoned\", 2);\r\n}","A97EV1Yju3aT7Sng":"if (args.test.skill?.name == game.i18n.localize(\"NAME.Pray\") || args.test.prayer)\n{\n if (parseInt(args.test.result.SL) > 0)\n {\n args.test.result.SL = \"+0\";\n args.test.result.description = game.i18n.localize(\"ROLL.MarginalSuccess\");\n args.test.result.other.push(`<strong>${this.effect.name}</strong>: Maximum +0 SL`)\n }\n}","AaPPmnv7AtxsRVUs":"args.actor.details.move.value = 1;","aAvJrAKLzXhS9qN6":"return args.item?.name == game.i18n.localize(\"NAME.Climb\")","abcQMF1LW27qA98R":"return args.skill?.name === game.i18n.localize(\"NAME.Dodge\");","abLWYtNTu1UVDQAs":"if (args.opposedTest.result.hitloc.value == this.effect.flags.wfrp4e.location) // e.g. 'head', rLeg, 'lArm'\r\n{\r\n this.scriptMessage(`Gains a @Condition[Blinded] condition as their <strong>${this.item.name}</strong> was hit`);\r\n this.actor.addCondition(\"blinded\");\r\n}","abVIvJBzuskNzCQv":"let amount = this.effect.sourceTest.result.overcast.usage.other.current;\r\n\r\nlet sss = await fromUuid(\"Compendium.wfrp4e-core.items.MGEPI4jNhymNIRVz\");\r\nlet strider = await fromUuid(\"Compendium.wfrp4e-core.items.1dUizIgLBgn4jICC\");\r\n\r\nlet items = Array(amount).fill(sss).concat(Array(amount).fill(strider))\r\n\r\nthis.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect: this.effect.id})","ACgKpKrEEHoNGG0h":"return !args.skill?.name.includes(\"Channelling\") && args.type != \"channelling\"","ACtDCTLZXmd5uXjX":"let halve;\r\nif (args.opposedTest.attackerTest.item?.type != \"spell\")\r\n{\r\n halve = await Dialog.confirm({title : this.effect.name, content : \"Halve Damage? (Halves all damage other than fire, cold, and magic)\"})\r\n}\r\nelse\r\n{\r\n halve = false;\r\n}\r\n\r\nif (halve)\r\n{\r\n args.totalWoundLoss /= 2;\r\n args.modifiers.other.push({label : this.effect.name, details : \"Halved\", value : \"× 0.5\"})\r\n}","aCVtaW8ag1WibcAr":"args.attacker.modifyWounds(1)\r\nthis.script.scriptMessage(`<strong>${args.attacker.prototypeToken.name}</strong> recovers 1 Wound.`)","AdawSWiB45Vu40rQ":"let colors = {\n fire : \"#b22222\",\n heavens : \"#87ceeb\",\n metal : \"#ee9b3a\",\n shadow : \"#808080\",\n life : \"#008000\",\n beasts : \"#a52a2a\",\n light : \"#f0ffff\",\n death : \"#800080\",\n necromancy : \"#800080\",\n daemonology : \"#8b0000\"\n};\n\nlet spell = this.actor.itemTypes.spell.find(i => Object.keys(colors).includes(i.system.lore.value[0]));\n\nlet color;\nif (spell)\n{\n color = colors[spell.system.lore.value[0]];\n}\nelse \n{\n color = Object.values(colors)[Math.ceil(CONFIG.Dice.randomUniform() * 10)];\n}\n\nthis.effect.updateSource({changes: this.effect.changes.concat({key: \"token.light.color\", type: \"override\", value: color})});","Adgs6Zs0FdefO6qx":"if (args.test.options.pilot && args.test.result.reversed)\r\n{\r\n\targs.test.data.result.SL = \"+\" + Math.min(1, Number(args.test.data.result.SL))\r\n\targs.test.result.other.push(`<b>${this.effect.name}</b>: SL limited to 1`)\r\n}","aeBetniKqq5SD9Ou":"let characteristics = {\n \"ws\" : 30,\n \"bs\" : 20,\n \"s\" : 20,\n \"t\" : 25,\n \"i\" : 20,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 30,\n \"wp\" : 40,\n \"fel\" : 30\n}\nlet skills = [\"Einschüchtern\", \"Sprache (Klassisch)\", \"Anführen\", \"Wissen (Kriegsführung)\", \"Wissen (Geschichte)\", \"Wahrnehmung\"]\nlet skillAdvancements = [20, 30, 20, 30, 20, 20]\nlet talents = [\"Kampfsinn\", \"Kampfreflexe\", \"Gedrillt\", \"Bedrohlich\", \"Hart im Nehmen\", \"Mächtiger Schlag\", \"Mächtiger Schlag\", \"Mitreißender Anführer\"]\nlet trappings = [\"Waffe\", \"Kürass\", \"Helm\", \"Plattenbeine\"]\nlet specialItems = [\n]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let item of specialItems) {\n let newItem\n if (item.type == \"weapon\") {\n newItem = new ItemWFRP4e({ name: item.name, type: item.type, system: { equipped: true, damage: {value: item.damage}} })\n } else if (item.type == \"trapping\") {\n newItem = new ItemWFRP4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type, system: { worn: true, trappingType: { value: item.trappingType} } } )\n } else {\n newItem = new ItemWFRP4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type })\n }\n items.push(newItem.toObject())\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else\n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else\n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings)\n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n trappingItem.system.equipped.value = true;\n\n items.push(trappingItem);\n }\n else\n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nconsole.log(\">>>>>>><\", items)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n","aedzdFyjI80Ah3qC":"return !this.item.equipped.value \n || !args?.weapon\n || !([\"giant\"].includes(args.target.Species.toLowerCase()))","afdmOvPGMpEdZvCb":"return (args.skill?.name == game.i18n.localize(\"NAME.Perception\") || args.characteristic == \"fel\")","AFiB20FaOBmBv2Kz":"if (args.actorsystem.details.move.sail.value > 0)\r\n args.actor.system.details.move.sail.value = Math.floor(args.actor.system.details.move.sail.value * .5);\r\n","aFwNs7TMVF90i9JF":"let tireless = this.item.Advances + 1\nlet fatigued = this.actor.hasCondition(\"fatigued\").conditionValue\nif (args.flags?.tireless == undefined) {\n args.fields.modifier += 10 * (Math.min(tireless, fatigued));\n args.flags.tireless = true\n}","AGD7zCyV4zruvnWu":"return args.type != \"cast\" || ![\"death\", \"necromancy\", \"life\", \"light\", \"heavens\"].includes(args.spell?.system.lore.value)","agsm3NI1NDtHRG4y":"this.actor.getActiveTokens().forEach(t => t.document.update({texture : this.actor.prototypeToken.texture}, {animate : false}));","Ah2wyywkL8hjJNXM":"args.options.healWounds = true;","ahbA7o5G9dzMFl76":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.SfUUdOGjdYpr3KSR\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","AHt3D7EHKWBcL3vu":"if (this.item.system.protects[args.loc] && (args.sourceItem?.system.isMagical || args.sourceItem?.type == \"trait\"))\n{\n const heatBased = await foundry.applications.api.DialogV2.confirm({window : {title : this.effect.name}, content : \"Apply protection from heat-based attacks?\"})\n\n if (heatBased) \n {\n args.applyAP = true;\n args.modifiers.other.push({label : this.effect.name, value : -1 * this.item.system.currentAP[args.loc], details : this.item.name});\n }\n}","AhV9QfteQNqqXVjv":"let qualities = {\n fast : \"Schnell\",\n hack : \"Hackend\",\n impale : \"Aufspießend\",\n penetrating : \"Durchdringend\",\n precise : \"Präzise\"\n}\n\nlet choice = await ItemDialog.create(ItemDialog.objectToArray(qualities, this.item.img), 1, {text: \"Wähle eine Qualität\", title: this.effect.name});\n\nif (choice[0])\n{\n this.script.message(choice[0].name);\n this.effect.setFlag(\"wfrp4e\", \"quality\", choice[0].id);\n}","AHZ8f7dfN8jNsYk6":"let token = this.actor.getActiveTokens()[0];\r\nlet target = args.data.targets[0];\r\nlet weapon = args.weapon;\r\n\r\nif(!target || !token)\r\n{\r\n return;\r\n}\r\n\r\nlet distance = canvas.grid.measureDistances([{ ray: new Ray({ x: token.center.x, y: token.center.y }, { x: target.center.x, y: target.center.y }) }], { gridSpaces: true })[0]\r\nlet currentBand\r\n\r\nfor (let band in weapon.range.bands) \r\n{\r\n if (distance >= weapon.range.bands[band].range[0] && distance <= weapon.range.bands[band].range[1]) \r\n {\r\n currentBand = band;\r\n break;\r\n }\r\n}\r\n\r\nreturn [game.i18n.localize(\"Long Range\"), game.i18n.localize(\"Extreme\")].includes(currentBand)","AI6bFrjWk4NH9FBd":"this.actor.addCondition(\"entangled\", this.effect.sourceTest.result.overcast.usage.other.current)","AI7iVbQMPzXMP5on":"const hours = new Roll(\"2d10\");\nawait hours.toMessage({flavor: this.effect.name + \" (heures)\"});\n\nconst bonus = new Roll(\"2d10\");\nawait bonus.toMessage({flavor: this.effect.name + \" (heures)\"});\n\n\nawait this.effect.update({\n \"duration.seconds\": hours.total * 3600\n});\nawait this.effect.setFlag(\"wfrp4e-tribes\", \"bonus\", bonus.total);","aIYUsBIDKWJ3CEtj":"this.script.scriptMessage(await this.actor.applyBasicDamage(20, {suppressMsg: true}));","AjC4dsiuhVCOnRGI":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MVI0lXcg6vvtooAF\")\r\nlet data = item.toObject(); \r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});","alJgj25l3239h2SW":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.hTgrGkWnmIR4xhVe\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","ALuPRzf85dmkEfLo":"return args.skill?.name == game.i18n.localize(\"NAME.Intuition\");","aMHGjWyn6BXCI4pw":"let frenzy = await fromUuid(\"Compendium.wfrp4e-core.items.Item.hXcfygzujgyMN1uI\");\r\nthis.actor.createEmbeddedDocuments(\"Item\", [frenzy], {fromEffect: this.effect.id})","AMI2wDJqsIZsoq1e":"if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 2 && args.opposedTest.result.winner == \"attacker\")\r\n{ \r\n this.script.scriptMessage(`Emits a cloud of foul-smelling blackpowder. Enable the <strong>Fellowship Penalty</strong> Active Effect on @UUID[${this.actor.uuid}].`, {blind : true, whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n}","AmOMCUaWLJ2iJAt5":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.IFKWu98qmWpaSfUi\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","AmpDbT0BkDHeaRzf":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\");\r\nlet data = item.toObject();\r\ndata.system.specification.value = 1;\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","AMxezwtYnWCF6Oza":"return args.skill?.name == \"Ranged (Blackpowder)\"","ApaLcUhuty3EzJoP":"let fortunePoints = this.effect.sourceTest.result.overcast.usage.other.current\r\nlet current = this.actor.status.fortune.value\r\n\r\nthis.actor.update({\"system.status.fortune.value\" : fortunePoints + current})\r\n\r\nthis.script.scriptMessage(`<b>${this.actor.prototypeToken.name}</b> fortune points increased from ${current} to ${fortunePoints + current}`)","aPZiVhgwR0Xql6AM":"let effectsToEnable = this.actor.items.filter(i => i.type == \"disease\").reduce((effects, item) => effects.concat(item.effects.contents), []).concat(this.actor.effects.contents.filter(i => i.isCondition)).filter(i => i.disabled);\n\nif (effectsToEnable.length)\n{\n this.script.notification(`Re-enabling ${effectsToEnable.map(i => i.name).join(\", \")}.`);\n effectsToEnable.forEach(i => i.update({disabled : false}))\n}","AqHLHp4kH6KULk3e":"if (this.item.system.quantity.value)\r\n{\r\n\tthis.item.system.reduceQuantity();\r\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\r\n let effectData = this.item.effects.contents[0].convertToApplied();\r\n\teffectData.flags.wfrp4e.sourceItem = this.item.uuid\r\n\tactor.applyEffect({effectData : [effectData]})\r\n}\r\nelse\r\n{\r\n\tthis.script.scriptNotification(\"None left!\", \"error\")\r\n}","araS9qYWOAVrV8F7":"args.actor.system.details.man -= 3;\r\nargs.actor.system.details.move.value -= 2;","ARQbVHKYK39d8vKJ":"let properties = {\n fine : \"Fine\",\n durable : \"Durable\",\n lightweight : \"Lightweight\",\n practical : \"Practical\"\n};\n\n\nlet choice = await ItemDialog.create(ItemDialog.objectToArray(properties), 1, {title: this.effect.name, text: \"Select Property\"});\n\nif (choice[0])\n{\n this.effect.updateSource({\"flags.wfrp4e.property\" : choice[0].id, name : this.effect.setSpecifier(choice[0].name)});\n}","aRvJUcgYqhRmmWYC":"this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.e3McIND4Rrsn5cE6\", this.effect, {\"system.advances.value\" : 1}, {skipExperienceChecks : true})","AS7CstSosuCrwZ19":"this.actor.getActiveTokens().forEach(t => t.document.update({light : {\r\n \"dim\": 20,\r\n \"bright\": 10,\r\n \"angle\": 360,\r\n \"alpha\": 0.4,\r\n \"animation\": {\r\n \"speed\": 3,\r\n \"intensity\": 3,\r\n \"type\": \"torch\",\r\n },\r\n \"color\": \"#ffcc66\",\r\n }}));","aSFPODz31zynXho3":"let char = this.item.attackType == \"melee\" ? \"ws\" : \"bs\"; args.actor.system.characteristics[char].modifier += 20","AV2Kj6jgmIc45zKi":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"));","AvRbjpBfTX3mn3bz":"if (this.actor.effects.contents.filter(e => e.name === \"Liquid Fortification\").length === 0) {\n let effectData = this.item.effects.contents[0].convertToApplied();\n effectData.duration.seconds = 3600\n this.actor.applyEffect({effectData : [effectData]});\n this.script.notification(\"Dauer des Effekts Liquid Fortification auf 1 Stunde gesetzt.\");\n}\nelse {\n let effect = this.actor.effects.contents.filter(e => e.name === \"Liquid Fortification\")[0];\n effect.update({duration: {seconds: 3600}});\n this.script.notification(\"Dauer des Effekts Liquid Fortification auf 1 Stunde zurückgesetzt.\");\n}","AVROqafFhKjN6TPR":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.DrNUTPeodEgpWTnT\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","AWgZnm9xLyIWCDnp":"let robust = args.modifiers.other.find(i => i.key == \"robust\")\r\nif (robust)\r\n{\r\n\trobust.value--;\r\n}\r\nelse \r\n{\r\n\targs.modifiers.other.push({key: \"robust\", label : this.effect.name, value : -1})\r\n}\r\n","AYEiCx2Es3QtMY28":"let choice1 = [\n {\n type: \"trait\",\n name: \"Bestial\",\n },\n {\n type: \"trait\",\n name: \"Regeneration\",\n },\n {\n type: \"trait\",\n name: \"Taille (Large)\",\n },\n {\n type: \"trait\",\n name: \"Territorial\",\n }\n]\n\nlet updateObj;\nlet actor;\n\nasync function addTrait(c) {\n let items = [];\n let existing;\n if (c.type == \"trait\") {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type);\n }\n if (!existing) {\n let item = await game.wfrp4e.utility.find(c.name, c.type);\n if (item) {\n item = item.toObject();\n items.push(item);\n }\n else\n ui.notifications.warn(`${c} nicht gefunden`, { permanent: true });\n }\n console.log(\"WISH LIST2\", choice1, items);\n actor.createEmbeddedDocuments(\"Item\", items);\n}\n\nasync function dialogChoice() {\n for (let c of choice1)\n {\n if (await foundry.applications.api.DialogV2.confirm({window : {title: \"Option\"}, content:`<p>Add Option?</p><ol><li>${c.name}</li></ol>`}))\n {\n addTrait(c)\n c.valid = true;\n }\n }\n}\n\nupdateObj = this.actor.toObject();\nactor = this.actor\nawait dialogChoice();\n","ayIbw2Vw2t9xg33P":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.EaqlLRQigwnsEAXX\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","AyNb5sj6FD2Z3Q5T":"this.actor.addCondition(\"dead\")\r\nthis.actor.setWounds(0);\r\nthis.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"scatter\"))","AyS3iLljxHRKsHg4":"let broken = this.actor.hasCondition(\"broken\");\r\nlet fatigued = this.actor.hasCondition(\"fatigued\");\r\nawait broken?.delete();\r\nawait fatigued?.delete()\r\nlet drilled = await fromUuid(\"Compendium.wfrp4e-core.items.Item.J9MK0AIaTbvd5oF6\")\r\nlet fearless = await fromUuid(\"Compendium.wfrp4e-core.items.Item.8pVzgPkgWpTJvfhG\")\r\nlet stout = await fromUuid(\"Compendium.wfrp4e-core.items.Item.IogM5gnsoOX63w7j\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [drilled, fearless, stout], {fromEffect : this.effect.id})","AZGXrZOQ4EzjxRL9":"return true;","B063u4vrbvzMaCQt":"args.item.system.flaws.value = args.item.system.flaws.value.concat([{name : \"bulky\"}, {name : \"unreliable\"}])","B08DMbt9gcj8uCTc":"if (args.totalWoundLoss > 0) args.actor.addCondition('ablaze')","B1xgRS00RcTIZLnO":"return [\"cast\", \"channelling\"].includes(args.type) && this.actor.hasCondition(\"fatigued\")","b1zMefdoZYtzCm7i":"return [\"roll\", \"none\"].includes(args.fields.hitLocation) || args.item?.attackType != \"ranged\"","b2Kb4IuD22RhKhR0":"let actor = Array.from(game.user.targets)[0]?.actor;\r\n\r\nif (actor)\r\n{\r\n actor.applyEffect({effectUuids : this.effect.sourceItem.effects.contents[0].uuid})\r\n}\r\nelse\r\n{\r\n this.script.scriptNotification(\"No target!\", \"error\")\r\n}","b2WaqRna5CFXmbDG":"args.options.stag = true;","b44tTtRjmI5jdihB":"let shield = this.item.system.qualities.value.find(q => q.name == 'shield'); shield.value++","b4CIeJF2L4E1qikC":"return !args.skill","b5DfAWtpV1x2R8If":"this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {suppressMsg: true}))","b5prg1FLjCAvBjLy":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.zyocWSzEZEC826NS\")\r\nlet data = item.toObject();\r\ndata.system.location.key = this.item.system.location.key\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data])\r\n\r\n\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"hard\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n await this.actor.addCondition(\"prone\")\r\n await this.actor.addCondition(\"stunned\")\r\n}","B6ZbY3bxTPg6nCng":"return args.skill?.name == game.i18n.localize(\"NAME.Bribery\");","b787rIfyHF5LnALd":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.HbrwGhUl0ZXz4kLA\")\nlet hardy = item.toObject();\n\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.Item.VUJUZVN3VYhOaPjj\")\nlet armour = item.toObject();\narmour.system.specification.value = 1;\nthis.actor.createEmbeddedDocuments(\"Item\", [armour, hardy], {fromEffect : this.effect.id});","B87v1twc65qyvUWi":"args.fields.modifier += 10 * this.effect.conditionValue","b8G4cjfn3RG2tEYX":"this.actor.addCondition(\"ablaze\", 3);","b8XFmEUu1d2YNQ7F":"const {targetUuid, characteristicsToSwap} = this.effect.flags.wfrp4e;\n\nif (!characteristicsToSwap) return;\n\nconst target = fromUuidSync(targetUuid);\n\nif (!target) return;\n\nfor (const char of characteristicsToSwap) {\n args.actor.system.characteristics[char].advances = target.system.characteristics[char].advances;\n args.actor.system.characteristics[char].bonus = target.system.characteristics[char].bonus;\n args.actor.system.characteristics[char].bonusMod = target.system.characteristics[char].bonusMod;\n args.actor.system.characteristics[char].calculationBonusModifier = target.system.characteristics[char].calculationBonusModifier;\n args.actor.system.characteristics[char].initial = target.system.characteristics[char].initial;\n args.actor.system.characteristics[char].modifier = target.system.characteristics[char].modifier;\n args.actor.system.characteristics[char].value = target.system.characteristics[char].value;\n}","B950b0XnIUYCdVwu":"let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name})\r\nawait test.roll();\r\n\r\nif (test.succeeded)\r\n{\r\n if (args.totalWoundLoss <= parseInt(test.result.SL))\r\n {\r\n args.abort = `<strong>${this.effect.name}</strong>: Attack deflected and reflected`\r\n }\r\n args.modifiers.other.push({label : this.effect.name, value : -1 * parseInt(test.result.SL)})\r\n}","BAOv7moTxsKlT3JS":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty : \"easy\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"broken\")\r\n}","bBdXzBmxgFFBwMMS":"if(args.opposedTest.attackerTest.item?.isRanged && args.applyAP && !args.sureShot)\r\n{\r\n if (args.modifiers.ap.value)\r\n {\r\n args.sureShot = true;\r\n args.modifiers.ap.details.push(`${this.effect.name} (Ignore ${this.item.Advances})`)\r\n args.modifiers.ap.ignored += this.item.Advances;\r\n }\r\n}","BcXTujburrHpjpwa":"args.fields.slBonus -= 3;","BD7bVTU2pVoRSRBe":"let symptoms = {\r\n convulsions : \"Convulsions\",\r\n coughsandsneezes : \"Coughs and Sneezes\",\r\n fever : \"Fever\",\r\n flux : \"Flux\",\r\n nausea : \"Nausea\"\r\n}\r\n\r\nlet roll = await (new Roll(`max(0, 1d10 - ${this.actor.characteristics.wp.bonus})`).roll())\r\nroll.toMessage(this.script.getChatData());\r\n\r\nlet choices = await ItemDialog.create(ItemDialog.objectToArray(symptoms), roll.total, \"Choose Symptoms\");\r\n\r\nif (choices.length)\r\n{\r\n let symptomEffects = duplicate(game.wfrp4e.config.symptomEffects)\r\n let added = []\r\n for(let choice of choices)\r\n {\r\n let symptom = symptomEffects[choice.id];\r\n symptom.origin = this.effect.uuid;\r\n added.push(symptom);\r\n }\r\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", added)\r\n}\r\nelse \r\n{\r\n this.effect.delete();\r\n}\r\n\r\n","bDS62ctjfnTU4xIu":"return args.skill.name !== game.i18n.localize(\"NAME.Leadership\")","Be5rdfnZorbILhpC":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = 3 - this.actor.characteristics.s.bonus\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","BEEvU2hE5ymcNOH9":"let fatigued = this.actor.hasCondition(\"fatigued\")\n if (!fatigued)\n {\n this.actor.addCondition(\"fatigued\")\n ui.notifications.notify(\"Zustand Erschöpft zu \" + this.actor.name + \" hinzugefügt; kann nicht entfernt werden, solange das Symptom Unwohlsein vorhanden ist.\")\n }","bEVlJOOA1kLlzpWx":"let characteristics = {\n \"ws\" : 10,\n \"bs\" : 0,\n \"s\" : 5,\n \"t\" : 15,\n \"i\" : 20,\n \"ag\" : 15,\n \"dex\" : 20,\n \"int\" : 35,\n \"wp\" : 30,\n \"fel\" : 10\n}\nlet skills = [\"Channelling\", \"Cool\", \"Dodge\", \"Entertain (Storytelling)\", \"Intuition\", \"Language (Magick)\", \"Leadership\", \"Lore (Magic)\", \"Lore (Theology)\", \"Perception\"]\nlet skillAdvancements = [20, 25, 20, 25, 30, 25, 15, 20, 10, 30]\nlet talents = [\"Aethyric Attunement\", \"Arcane Magic\", \"Instinctive Diction\", \"Instinctive Diction\", \"Luck\", \"Magical Sense\", \"Menacing\", \"Petty Magic\", \"Second Sight\", \"Sixth Sense\"]\nlet trappings = [\"Hand Weapon\", \"Quarterstaff\", \"Ritual Dress incorporating many ingredients and fetishes\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n items.push({name : trapping, type : \"trapping\", \"system.trappingType.value\" : \"clothingAccessories\"})\n //ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","Bexspr5viPhHiFmU":"let fatigued = this.actor.hasCondition(\"fatigued\");\r\nlet value = fatigued?.conditionValue || 0;\r\nargs.fields.modifier += value * 10;","bgLeMqihLya2iobP":"const river = this.actor.itemTags.template.find(t => t.name === \"River Troll\");\n\nif (!river) {\n args.options.abortItemCreation = true;\n this.script.notification(\"Kann nur auf einen Flusstroll angewendet werden.\", 'warning');\n}","bh2qDCKiAIWM0UPi":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"))","BHbFqhJPzZI2txLs":"let lore = this.effect.name.split(\"(\")[1].split(\")\")[0].toLowerCase();\r\n\r\n// If channelling corresponding lore\r\nif (args.type == \"channelling\" && args.spell.system.lore.value == lore)\r\n args.prefillModifiers.slBonus += 2\r\n// If channelling or casting different lore\r\nelse if (args.spell.system.lore.value != lore && args.spell.system.lore.value != \"petty\")\r\n args.prefillModifiers.slBonus -= 1","bHxGutf5lZy0kciK":"if (!(await this.script.dialog(\"Dieser Vorgang ist unumkehrbar, fortfahren?\")))\n{\n return;\n}\n\nlet items = [this.actor.itemTypes.talent.find(i => i.baseName == \"Bless\"), this.actor.itemTypes.talent.find(i => i.baseName == \"Invoke\")].filter(i => i);\nlet skill = this.actor.itemTypes.skill.find(i => i.name == game.i18n.localize(\"NAME.Pray\"));\n\nthis.script.notification(\"Entferne \" + items.map(i => i.name).join(\", \"));\nawait Promise.all(items.map(i => i.delete()));\n\nif (skill)\n{\n this.script.notification(`Steigerungen von Beten entfernt (${skill.system.advances.value})`)\n skill.update({\"system.advances.value\" : 0}, {skipExperienceChecks : true})\n}\n\nfor(let i of this.actor.itemTypes.prayer)\n{\n i.delete();\n}","bhXUW7IJtEaUGAoV":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll(); \r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"prone\");\r\n}\r\n ","bidoOQSAofp4NPf6":"return args?.skill?.name !== game.i18n.localize(\"NAME.Cool\")","Bj6bxItlgtI2sXVN":"let roll = await new Roll(\"1d10\").roll();\r\nroll.toMessage(this.script.getChatData());\r\nargs.totalWoundLoss = Math.max(0, args.totalWoundLoss - roll.total)\r\nargs.modifiers.other.push({label: this.effect.name, value : -1 * roll.total})\r\nthis.effect.update({disabled : true})","bkbWgG9COvZWZbAX":"args.context.addChargingDice = true;","bL98Sr1TRLMPEdlk":"if (args.test.failed)\r\n{\r\n\tthis.actor.addCondition(\"fatigued\");\r\n}","bLkt8VpTTPoTxW0W":"if (args.opposedTest.result.hitloc.value == \"body\" && args.totalWoundLoss > 0)\r\n{\r\n args.actor.addCondition(\"bleeding\", 1);\r\n this.script.scriptNotification(\"Added Bleeding\")\r\n}\r\n","bMEFHPCei2evnZZw":"// Victims that take at least 1 Wound from a Fell Dagger\r\n// immediately take a Poisoned Condition \r\n// resisted with a Difficult (-10) Endurance Test. \r\n\r\n// TODO: Add Venom strength to message\r\n\r\nif (args.totalWoundLoss > 0) \r\n{\r\n args.actor.addCondition(\"poisoned\")\r\n this.script.scriptMessage(`\r\n <strong>${this.effect.name}</strong>:<br>\r\n <strong>${args.actor.name}</strong> has been given a @Condition[Poisoned] Condition, which can be resisted with a <strong>Difficult (-10) Endurance</strong> Test.`, \r\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")})\r\n}\r\n","bNhpJPWwoHLq68zD":"let actor = await DragDialog.create({title : this.effect.name, text : \"Gib einen Tätowierer-Akteur an (schließen, um Proben zu überspringen)\"})\n\nif (!actor)\n{\n this.script.notification(\"Proben zum Anbringen der Tätowierungen übersprungen\");\n if (await foundry.applications.api.Dialog.confirm({\n window: {title: this.effect.name},\n content : \"<p>Effekt des Grimnirschutzes anwenden?</p>\"\n }))\n {\n return;\n }\n else\n {\n return false;\n }\n}\n\n\nlet failed = false;\nif (this.actor.itemTags.skill.find(i => i.name == \"Wissen (Theologie)\"))\n{\n let test = await this.actor.setupSkill(\"Wissen (Theologie)\", {appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"vhard\"}})\n await test.roll();\n if (test.failed)\n {\n failed = true;\n }\n}\nelse\n{\n this.script.notification(\"Fähigkeit Wissen (Theologie) nicht gefunden, kann nicht fortfahren.\")\n failed = true;\n}\n\nif (this.actor.itemTags.skill.find(i => i.name == \"Wissen (Runen)\"))\n {\n let test = await this.actor.setupSkill(\"Wissen (Runen)\", {appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\n await test.roll();\n if (test.failed)\n {\n failed = true;\n }\n }\n else\n {\n this.script.notification(\"Fähigkeit Wissen (Runen) nicht gefunden, kann nicht fortfahren.\")\n failed = true;\n }\n\n\n let test = await this.actor.setupSkill(\"Kunst (Tätowierungen)\", {appendTitle : ` - ${this.effect.name}`})\n await test.roll();\n if (test.failed)\n {\n failed = true;\n }\n\n if (failed)\n {\n this.script.message(\"Eine oder mehrere Proben zum Anbringen der Tätowierungen sind fehlgeschlagen.\")\n return false;\n }\n else\n {\n return true;\n }","BNJRV66jlrp51qZK":"args.abort = true;\r\nthis.script.notification(game.i18n.localize(\"SCRIPT.Sightstep\"));","bQyVajMN1ETwlzvM":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.aE3pyW20Orvdjzj0\")\r\nlet data = item.toObject();\r\nlet target = await game.wfrp4e.tables.rollTable(\"fixations\")\r\nif (target)\r\n{\r\n data.system.specification.value = target.result\r\n this.script.scriptNotification(target.result);\r\n}\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","bRiFHPC1StKxqNIC":"if (isNaN(parseInt(this.item.system.specification.value))) {\r\n let value = await ValueDialog.create(\"Sturdy Value\", \"Enter the Sturdy value\");\r\n if (value) {\r\n this.item.updateSource({\"system.specification.value\" : value});\r\n }\r\n}","brNRqfpPqD2Ki0cM":"args.prefillModifiers.modifier -= 10","bRtZH0xRh8dgqMeW":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = 7 - this.actor.characteristics.s.bonus\r\ndata.name = item.name.replace(\"(Feature)\", \"\");\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","bT4gLrE3W36DIP4k":"if (args.applyAP && args.modifiers.ap.metal && args.alreadyPenetrating)\n {\n args.modifiers.ap.ignored += 1\n args.modifiers.ap.details.push(\"<strong>\" + this.effect.name + \"</strong>: Ignoriert +1 RP an Metallrüstung\");\n args.modifiers.ap.metal--;\n }","btPrQkGRKUkhNe3N":"return args.skill?.name == \"Trade (Apothecary)\"","BtyFhdGMKiMamGhM":"let test = await args.actor.setupSkill(\"Dodge\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nlet damage = parseInt(this.effect.sourceTest.result.SL)\r\n\r\nif (test.succeded)\r\n{\r\n damage = damage + 8 - parseInt(test.result.SL)\r\n}\r\n\r\nelse \r\n{\r\n damage = damage + 10\r\n this.actor.addCondition(\"entangled\", 3)\r\n}\r\nthis.script.scriptMessage(await this.actor.applyBasicDamage(damage, {loc : \"roll\", suppressMsg: true}))\r\n","Bu0KUpGvfmFF7LJs":"let test = await this.actor.setupCharacteristic(\"s\", {appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"difficult\"}});\n\nawait test.roll();\n\nif (test.failed)\n{\n\n if (test.isCriticalFumble == \"fumble\")\n {\n\t return this.script.message(`<strong>${this.actor.name}</strong> stirbt, während er in den Äther gezogen wird (es sei denn, er gibt einen Schicksalspunkt aus, um dies zu verhindern).`);\n }\n\n await this.script.message(await this.actor.applyBasicDamage(3, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true }))\n\n}","Bv3431tnG3VKaTJr":"if (args.test.result.castOutcome == \"success\")\r\n{\r\n args.test.result.other.push(`@Fear[2,${this.actor.name}]`);\r\n}","BVNKF9omCppWPLys":"let actor = game.user.character ?? canvas.tokens.controlled[0]?.actor;\r\nif (!actor || !(actor.system instanceof StandardActorModel))\r\n return ui.notifications.warn(\"You must control an Actor capable of performing a Strength Test\");\r\n\r\nlet test = await actor.setupCharacteristic(\"s\", {\r\n skipTargets: true, \r\n appendTitle: \" - Bailing Out\", \r\n fields: {\r\n difficulty: \"challenging\"\r\n },\r\n context: {\r\n success: \"Reduced the Holed rating!\"\r\n }\r\n});\r\n\r\nawait test.roll();\r\nif (test.succeeded) {\r\n let SL = parseInt(test.result.SL);\r\n let name = this.effect.name.replace(/\\d+/, rating => parseInt(rating) - SL);\r\n await this.effect.update({name});\r\n}\r\n\r\nlet rating = parseInt(this.effect.name.match(/\\d+/)?.[0]);\r\nif (rating <= 1) {\r\n const scriptData = this.effect.flags.wfrp4e.scriptData;\r\n scriptData[2].trigger = '';\r\n await this.effect.update({disabled: true, \"flags.wfrp4e.scriptData\": scriptData});\r\n}","bWr8leucbWslBCYG":"return args.characteristic != \"s\"","bwtQOSWn120NICkf":"let test = await this.actor.setupCharacteristic(\"ag\", {fields : {difficulty : \"hard\"}});\r\nawait test.roll();\r\n\r\nif (test.failed)\r\n{\r\n await this.actor.addCondition(\"bleeding\")\r\n await this.actor.addCondition(\"entangled\")\r\n}","bwx9wuEOJPF7btD1":"return args.skill?.name != game.i18n.localize(\"NAME.Navigation\");","BY4feKp244bQOWlB":"args.test.result.canDualWield = true;","ByhEa1BxQOyrOmqg":"return args.item?.attackType == 'melee'","bYXlyiRXtdRGYlm0":"let quality = this.effect.getFlag(\"wfrp4e\", \"quality\");\n\nif (quality)\n{\n this.item.system.qualities.value.push({name : quality})\n}","bzaoWcieMFaU5B5l":"return !this.actor.flags.useless[this.item.system.location.key] || [\"fel\", \"wp\", \"int\", \"t\"].includes(args.characteristic)","BzDLuxBNw1QNIacg":"if (args.item.type == \"skill\")\r\n args.item.system.advances.value = 0\r\n\r\nif (args.item.type == \"talent\")\r\n args.item.system.tests.value = \"\"\r\n\r\nif (args.item.type == \"weapon\") \r\n args.item.system.qualities.value = []","BZETMpgrI5k1ol5b":"// If the creature currently has a Surprised, Unconscious, or Entangled Condition, it does not gain this Advantage.\r\nconst surprised = this.actor.hasCondition(\"surprised\")\r\nconst unconscious = this.actor.hasCondition(\"unconscious\")\r\nconst entangled = this.actor.hasCondition(\"entangled\")\r\nif (entangled || unconscious || surprised) return\r\n\r\n// If, at the beginning of its turn, this creature does not have at least Rating Advantage points, its Advantage pool immediately increases to Rating.\r\nconst grimRating = parseInt(this.item.specification.value) || 1\r\nif (grimRating > this.actor.status.advantage.value) {\r\n this.actor.setAdvantage(grimRating)\r\n}\r\n","c31hjp7k0hlpdGBC":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.yRhhOlt18COq4e1q\");\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","c3KA1knL2NYNUEww":"return args.skill?.name != game.i18n.localize(\"NAME.Evaluate\");","C4LZnaX0MYgwrszj":"return args.type !== \"channelling\" && !args.skill?.name.includes(game.i18n.localize(\"NAME.Channelling\")) && args.skill?.name !== `${game.i18n.localize(\"NAME.Language\")} (${game.i18n.localize(\"SPEC.Magick\")})` && args.skill?.name !== game.i18n.localize(\"NAME.OutdoorSurvival\");","C5NIkJwXL85Qbpe7":"args.weaponProperties.impale = true;","C69xngEMghfwUx13":"let easier = ['challenging', 'average', 'easy', 'veasy'];\r\nif (easier.includes(args.fields.difficulty))\r\n args.fields.difficulty = \"difficult\";","c7HTWfg3CbjN9e1M":"this.actor.name = this.actor.name.replace(\"Common Troll\", \"Troll\");","C8Q4jf6LSyA3lQHS":"let damage = this.effect.sourceTest.result.damage;\n\ndamage += 7; // goes from +8 to +15;\n\nif (this.actor.sizeNum >= game.wfrp4e.config.actorSizeNums.lrg)\n damage += 22; // goes from +15 to +30;\n\nif (this.actor.has(game.i18n.localize(\"NAME.Unstable\"))) \n damage *= 2;\n\nthis.actor.applyDamage(damage, {\n loc: \"roll\",\n createMessage: this.script.getChatData()\n});","C9ARvMauPNwIHj6o":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}, context : {failure: \"Gain Broken\"}});\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"broken\");\n}","c9xxdOCaQSwooK8n":"if (!this.actor.has(\"Segnung der Schlacht\",\"prayer\")) this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.ElmLfnrXliStS9CP\", this.effect)","Ca1fXHTA1e2QLx0D":"args.fields.modifier += 50;","cAioHYtlxuOCwRLh":"let ablaze = Number(args.opposedTest.attackerTest.result.SL) + 1\r\nargs.actor.addCondition(\"ablaze\", ablaze)","cAKqUBuJBsU85erO":"return args.skill?.name !== game.i18n.localize(\"NAME.Stealth\");","cApfxL7Ic0NKdoSr":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.rOV2s6PQBBrhpMOv\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","CbfUDhUr5R4UnPPq":"if (this.actor && this.actor?.name !== \"Kurgorn Three-eyes\" && !this.actor.hasCondition(\"blinded\") && !args.itemUpdated)\n{\n this.script.notification(`Der Zustand Geblendet kann nicht entfernt werden.`);\n await this.actor.addCondition(\"blinded\", 1, {statuses : [\"blinded\", \"blind\"]})\n}","cBSy9CR5NZvcLRg8":"\r\n args.prefillModifiers.modifier += 0;\r\n args.prefillModifiers.slBonus += 0;\r\n args.prefillModifiers.successBonus += 0;\r\n ","cC7jjJDSVPi5BJUq":"if (this.item.equipped.value) {\n this.actor.system.status.addArmour(1, {source: this.effect})\n}","CCK1iIfPmB398ziT":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Athletics\"), {fields : {difficulty : \"difficult\"}, skipTargets: true, appendTitle : \" - Walking\"})\r\ntest.roll();","CcR9i3UzUXx7ieep":"args.fields.modifier +=10;","CCwuu3bPLCpVGAmb":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\n\r\n\r\n","CD4RnDpXZ9hnqVPQ":"if (!this.actor.hasCondition(\"entangled\"))\r\n this.actor.addCondition(\"entangled\");","CDASLC4fWKSGQKf9":"let blinded = this.actor.hasCondition(\"blinded\");\r\nif (blinded?.getFlag(\"wfrp4e\", \"flockOfDoom\"))\r\n{\r\n blinded.delete();\r\n}","cDBhmHn5kjgWBAlT":"let num = (this.effect.sourceTest.result.overcast.usage.other.current || 1)\r\n\r\nthis.actor.addCondition(\"entangled\", num)","cEg09bnvZD6Ysnpc":"let item = await fromUuid(\"Compendium.wfrp4e-archives2.items.anIlqJXFOIEzIOo1\")\r\nlet data = item.toObject();\r\ndata.name = this.item.name;\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","cgmA2N0MkjA7qIZy":"return args.type != \"cast\" || args.item?.system.lore?.value != \"shadow\"","ch5SD2XOQfcYo0X5":"if (args.sizeDiff <= -2 && args.opposedTest.attackerTest.result.critical)\r\n args.damageMultiplier = Math.abs(args.sizeDiff)\r\n\r\n let sBonusDiff = args.opposedTest.defenderTest.actor.characteristics.t.bonus - args.opposedTest.attackerTest.actor.characteristics.s.bonus\r\n let weapon = args.opposedTest.attackerTest.item\r\n if (sBonusDiff > 0 && weapon && weapon.damage.value.includes(\"SB\"))\r\n {\r\n args.damage += sBonusDiff\r\n args.breakdown.other.push({label : this.effect.name, value : sBonusDiff});\r\n }","chDtEQZoRMOrm2eE":"this.actor.addCondition(\"bleeding\");","chiUvs66IHiKTOcN":"if (args.totalWoundLoss > 0)\n {\n this.script.scriptMessage(\"All wounds caused by this weapon are @UUID[Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb]{Festering Wounds}\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n }","CHnaBPHk6HdFS512":"let arm = await fromUuid(\"Compendium.wfrp4e-core.items.MnMZv7ZXoRqoH9dS\");\r\nlet leg = await fromUuid(\"Compendium.wfrp4e-core.items.k00PimCWkff11IA0\");\r\n\r\nlet choice = await ItemDialog.create([arm, leg], 1, \"Choose Limb\")\r\n\r\nthis.actor.createEmbeddedDocuments(\"Item\", choice, {fromEffect: this.effect.id})","chUpiI3el8IO8MSs":"if (args.opposedTest.attackerTest.item?.name.includes(\"Bite\"))\r\n{\r\n let woundsGained = args.totalWoundLoss;\r\n this.script.scriptMessage(`Gains ${woundsGained} Wounds`, { whisper: ChatMessage.getWhisperRecipients(\"GM\") })\r\n this.actor.modifyWounds(woundsGained)\r\n}","CicQ5REu9tbsc8wW":"const locations = [];\r\n\r\nfor (let [key, loc] of Object.entries(args.AP)) {\r\n if (loc.layers?.some(i => !i.metal && i.source?.system.tags?.has(\"armour\")))\r\n locations.push(key);\r\n}\r\n\r\nthis.actor.status.addArmour(1, {source: this.effect, magical: true, locations})","CiFeduksZJ6PRulx":"return args.skill?.name == \"Ride (Horse)\" || (args.options.dodge && this.actor.isMounted);","cipTp0OS2bfKLjZS":"if (args.totalWoundLoss > 0) {\n await args.actor.addCondition(\"bleeding\")\n await args.actor.addCondition(\"poisoned\")\n}","CIxZYkHggBQ6EsHP":"this.script.scriptNotification(\"Effect Used\");\r\nthis.effect.delete();","cJFDnq1HI4gXWcJo":"if (isNaN(parseInt(this.item.system.specification.value)))\r\n{\r\n let value = await ValueDialog.create(\"Enter Ward value\", this.effect.name);\r\n if (value)\r\n {\r\n this.item.updateSource({\"system.specification.value\" : value});\r\n }\r\n}","Cjj4iLkdY1NaZRCi":"if ((args.opposedTest.attackerTest.item && args.opposedTest.attackerTest.item.isMelee) || (args.opposedTest.attackerTest.item && !args.opposedTest.attackerTest.item.name.includes(\"Ranged\")))\r\n{\r\n let choice = await Dialog.wait({\r\n title: this.effect.name,\r\n content: `<p>Apply damage with <strong>${this.effect.name}</strong> to attacker?`,\r\n buttons: {\r\n yes: {\r\n label: \"Yes\",\r\n callback: () => {\r\n return true;\r\n }\r\n },\r\n no: {\r\n label: \"No\",\r\n callback: () => {\r\n return false;\r\n }\r\n }\r\n }\r\n })\r\n\r\n if (choice)\r\n {\r\n this.script.scriptMessage(await args.attacker.applyBasicDamage(this.actor.system.characteristics.wp.bonus, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}));\r\n }\r\n}","cK1Jysfu5IMUUH0C":"if (!args.ward)\r\n{\r\n\targs.ward = (this.effect.getFlag(\"wfrp4e\", \"ward\") || 0);\r\n\tif (args.wardRoll >= args.ward && args.ward > 3)\r\n {\r\n let newWard = Math.max(3, args.ward - 1)\r\n this.script.scriptMessage(\"<strong>Ward</strong> improved to \" + newWard)\r\n this.effect.setFlag(\"wfrp4e\", \"ward\", newWard)\r\n }\r\n\r\n}","CkE8NZOhzPkuRrKJ":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MnMZv7ZXoRqoH9dS\")\r\nlet data = item.toObject();\r\ndata.system.location.key = this.item.system.location.key\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data])\r\n\r\n\r\n\r\n\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"hard\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n\tthis.actor.addCondition(\"unconscious\")\r\n}","ckKbPfaTiQ2qBZdR":"console.log(\"DAMAGE\", this)","ClkT2WG2UjVwQ97T":"if (args.actor.has(\"Dämonisch\")) {\n args.totalWoundLoss += 3;\n args.modifiers.other.push({label: this.effect.name, value: 3});\n}\n\nlet test = await args.actor.setupSkill(\"Ausdauer\", {\n appendTitle: ` – ${this.effect.name}`,\n skipTargets: true,\n characteristic: 't',\n context: {\n failure: \"Erhält 1 Zustand Geblendet\"\n }\n});\nawait test.roll();\n\nif (test.failed) {\n args.actor.addCondition(\"blinded\");\n}","clO7l82UYMJ4XVks":"args.context.giantbane = true","CM43kvw5mIIE1OsB":"let key = this.item.system.location.key\r\n\r\nlet lostFingers = this.actor.flags.useless[key] || 0;\r\n\r\nlostFingers += 1\r\n\r\nthis.actor.flags.useless[key] = lostFingers;\r\n\r\nif (lostFingers >= 4)\r\n{\r\n\tthis.actor.flags.useless[key[0] + \"Arm\"] = true;\r\n}","CMUFtmNA1kkD1ay7":"this.actor.getActiveTokens().forEach(t => t.document.update({light : {\r\n \"dim\": 30,\r\n \"bright\": 20,\r\n \"angle\": 90,\r\n \"alpha\": 0.6,\r\n \"animation\": {\r\n \"speed\": 3,\r\n \"intensity\": 3,\r\n \"type\": \"torch\",\r\n },\r\n \"color\": \"#ffcc66\",\r\n }}));","CoImIH9OCMx9DfQZ":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.nbhn2wX35b7Jrcbg\")\r\nlet data = item.toObject();\r\ndata.system.location.value = \"Jaw\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","cOuukVo8WakDZIUj":"args.prefillModifiers.slBonus += 1","cPdtoRmvRC8PqH3x":"if (!this.item.system.properties.qualities.fast) this.item.system.qualities.value.push({name : 'fast'})","CPQoK7NjzOwVTFXS":"for(let effect of this.actor.effects.filter(e => e.isCondition))\r\n{\r\n if (effect.isCondition)\r\n {\r\n effect.delete();\r\n }\r\n}","cqYgZQk1C3kMARy5":"return args.skill?.name !== game.i18n.localize(\"NAME.Haggle\");","Cri5Q7ux6ni7zNVS":"// Cannot be Surprised in combat.\n\nif (this.actor.hasCondition(\"surprised\"))\n{\n this.actor.removeCondition(\"surprised\")\n ui.notifications.notify(`<strong>${this.effect.name}</strong>: Cannot be surprised`);\n}","CS6O7UUjQcUJoOUP":"if (args.test.failed)\r\n {\r\n let SL = Number(args.test.result.SL)\r\n if (SL <= -2 && SL > -4)\r\n this.actor.addCondition(\"stunned\")\r\n else if (SL <= -4 && SL > -6)\r\n this.script.scriptMessage(this.actor.prototypeToken.name + \" must make a <b>Willpower</b> Test or fall @Condition[Prone].\")\r\n else if (SL <= -6)\r\n this.actor.addCondition(\"unconscious\")\r\n }","csLKDJKZaUK9vwLT":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.7rBhIRo96Mydo0Cv\")\r\nlet data = item.toObject();\r\ndata.system.location.value = \"Back\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\r\n","ct6WGaRMfrcnHhyv":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = 2;\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","cTYNaKbepMwqYsZ8":"\r\n let difficulty = \"\"\r\n if (this.effect.name.includes(\"Moderate\"))\r\n difficulty = \"easy\"\r\n else if (this.effect.name.includes(\"Severe\"))\r\n difficulty = \"average\"\r\n else\r\n difficulty = \"veasy\"\r\n \r\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {context : {failure : this.actor.name + \" dies from Blight\"}, fields: {difficulty}, appendTitle : \" - Blight\"})\r\n await test.roll();\r\n if (test.failed)\r\n {\r\n this.actor.addCondition(\"dead\");\r\n }\r\n ","CUBpU1imu2eRS06C":"if (args.sourceItem?.system.properties?.qualities.hack && !args.hackReminder)\n{\n args.hackReminder = true;\n if (args.opposedTest)\n {\n args.opposedTest.result.other.push(`<strong>${this.effect.name}</strong>: Hackend verursacht ${this.item.Advances} zusätzlichen Schaden`)\n }\n}\n","cUFCL02JoaZObRcX":"let sl = this.effect.sourceTest.result.slOver;\r\n\r\nthis.actor.system.characteristics.s.modifier += sl * 10;\r\nthis.actor.system.characteristics.s.calculationBonusModifier -= sl;","cUnbADgOQ4fMKgrH":"let group\r\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.5hH73j2NgPdsLCZN\");\r\nlet data = item.toObject();\r\n\r\nif (this.item.name.includes(\"(\"))\r\n{\r\n\tgroup = this.item.parenthesesText\r\n}\r\n\r\nelse \r\n{\r\n\tgroup = await ValueDialog.create(\"Enter Hatred Group\", \"Hatred Group\")\r\n\r\n\tthis.item.updateSource({name : this.item.name + ` (${group})`, \"system.tests.value\" : this.item.system.tests.value.replace(\"Group\", group)})\r\n\tthis.effect.updateSource({name : this.effect.name + ` (${group})`})\r\n}\r\n\r\n\r\ndata.name = data.name.replace(\"Target\", group);\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id});","cuqCtQsfLBBAGjnu":"args.fields.slBonus -= (Number(this.item.specification.value) || 0)","cV9JiAgUPOeUHKnS":"args.fields.successBonus++;\r\nif (args.skill?.name != game.i18n.localize(\"NAME.SleightOfHand\"))\r\n{\r\n args.fields.modifier += 10;\r\n}","CW5Vlr57OaMkKJ8Q":"if (this.actor.system.status.advantage.value >= 3)\r\n{\r\n this.actor.modifyAdvantage(-3);\r\n this.script.scriptNotification(\"Advantage Subtracted\")\r\n}\r\nelse \r\n{\r\n return this.script.scriptNotification(\"Not enough Advantage!\", \"error\")\r\n}\r\n\r\nlet test = await this.actor.setupTrait(this.item)\r\nawait test.roll();","cW8ZuQ9YIUG5uvhf":"return args.characteristic != \"t\";","CWNGrg7se91RC95g":"if (args.totalWoundLoss > 0) {\r\n args.opposedTest.result.other.push(\r\n `@Corruption[minor]{Moderate Exposure to Corruption}`\r\n )\r\n this.script.scriptMessage(`<strong>${this.effect.name}</strong>: \r\n @Corruption[moderate]{Moderate Exposure to Corruption} <br/>\r\n <strong>${args.actor.prototypeToken.name}</strong> must take an \r\n <strong>Corruption (Moderate) Test</strong>`, \r\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\r\n )\r\n}","cxgGYbuiXM3NxIOI":"if (args.test.options.flags.skewering)\n{\n args.test.preData.roll = 1;\n}","CxsKWGwQqtAaQdzX":"return args.characteristic === \"fel\";","CynUM4ZEiB9QbNQq":"const bonus = game.settings.get(\"wfrp4e\", \"homebrew\").advantageBonus;\n\nargs.fields.modifier += 2 * bonus;","cYPIXzl86a3LFsTE":"if (args.item.type == \"spell\")\r\n{\r\n args.item.cn.value -=2\r\n if (args.item.cn.value < 0)\r\n args.item.cn.value = 0\r\n}","cysQDjlDzT8HdNeo":" args.prefillModifiers.slBonus += 1","cZVrzR4fxV86lxNW":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.yrkI7ATjqLPDTFmZ\")\nlet res = item.toObject();\nres.system.specification.value = 1;\n\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.Item.mNoCuaVbFBflfO6X\")\nlet ss = item.toObject();\nawait this.actor.createEmbeddedDocuments(\"Item\", [res, ss], {fromEffect : this.effect.id})","czZI8S09By0Mqlsr":"return (args.skill?.name == undefined || args.item?.skillToUse?.name != args.skill?.name)","d29mu8vRt9AQUm0L":"this.actor.characteristics.i.value = Math.min(this.actor.characteristics.i.value, 10);\r\nthis.actor.characteristics.i.bonus = 1;\r\n\r\nfor(let skill of this.actor.itemTypes.skill.filter(i => i.system.characteristic.value == \"i\"))\r\n{\r\n skill.system.total.value= Math.min(skill.system.total.value, 10)\r\n}","D5XmzrUGFa1JN0cl":"args.prefillModifiers.modifier += 10\r\n\r\n","d6mVm08o8SeklAcW":"this.actor.system.status.ward.value = 9;","d90GpOWwleOgTbOS":"this.actor.system.status.addArmour(5, {source: this.effect})","d9iU08yvqcffF026":"return args.weapon.system.usesHands.includes(this.effect.getFlag(\"wfrp4e\", \"location\"))","dAMtbn3uQwF8KpKU":"return args.skill?.name != game.i18n.localize(\"NAME.Charm\") && args.skill?.name != game.i18n.localize(\"NAME.Gossip\");","DANLE5HxrkTNelhl":"args.wounds += 4;","DBafsY1HrclJRTtA":"return args.type != \"cast\"","DBelNjOULhhAADVJ":"let properties = {\n ugly : \"Ugly\",\n shoddy : \"Shoddy\",\n unreliable : \"Unreliable\"\n};\n\nlet choice = await ItemDialog.create(ItemDialog.objectToArray(properties), 1, {title: this.effect.name, text: \"Select Property\"});\n\nif (choice[0])\n{\n this.effect.updateSource({\"flags.wfrp4e.property\" : choice[0].id, name : this.effect.setSpecifier(choice[0].name)});\n}","dbHv7dAXgB2Oy1Fg":"let nbBleeding = 1 + Number(this.effect.sourceTest.result.SL);\r\nthis.actor.removeCondition(\"bleeding\", nbBleeding);\r\nconsole.log(this.actor);\r\n","dbOSvpgcPjsc2uvq":"let menacing = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.0hn6UaKq8CoZP2zD\")).toObject();\r\nlet sense = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS\")).toObject();\r\n\r\nsense.name += \" (Sight)\";\r\nsense.system.tests.value = sense.system.tests.value.replace(\"Sense\", \"Sight\")\r\n\r\nthis.actor.createEmbeddedDocuments(\"Item\", [menacing, sense], {fromEffect : this.effect.id})","dbYjr4oG67Z880To":"if (args.test.isFumble)\r\n{\r\n args.test.result.other.push(\"@Table[warpfire-thrower-fumble]\")\r\n}","DcSJNRBXE9ZBBY7T":"this.actor.addCondition(\"blinded\", Math.max(0, this.effect.sourceTest.result.SL))","dcwY8dCd3PNCEzk6":"let current = this.actor.status.fate.value\r\n\r\nthis.actor.update({\"system.status.fate.value\" : current + 1})\r\n\r\nthis.script.scriptMessage(`<b>${this.actor.prototypeToken.name}</b> fate points increased from ${current} to ${current + 1}`)","Dew3Ks9yC4DynSMi":"return args.characteristic === \"s\" || args.characteristic === \"t\" || args.weapon?.system?.attackType === \"melee\";","dEx8xfG7VLbN69Ha":"if (!this.item.system.properties.flaws.reload) return;\n\nconst minReload = this.item.system.properties.qualities?.salvo ? 1 : 0;\nconst originalReload = this.item.system.properties.flaws.reload.value;\nconst runesOfReloading = Number(this.item.effects.contents.filter(e => e.name == this.effect.name).length);\nconst newReload = Math.max(originalReload - (2 * runesOfReloading), minReload);\n\nif (newReload) {\n this.item.system.properties.flaws.reload.value = newReload;\n this.item.system.properties.flaws.reload.display = `${game.i18n.localize(\"PROPERTY.Reload\")} ${newReload}`;\n}\nelse {\n delete this.item.system.properties.flaws.reload\n}","dfEgat3jz4EtWszH":"return args.skill?.name == \"Stealth (Urban)\"","dfnCK8jCPXNLM7Gh":"let aoeDamage = this.effect.sourceTest.result.damage - 5 // Easily handle magic missile damage by just subtracting 5 from the item's (which has +10 base)\r\n\r\nthis.script.scriptMessage(await this.actor.applyBasicDamage(aoeDamage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}))\r\n\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Dodge\"), {skipTargets: true, appendTitle : ` - Ablaze`})\r\n\r\nawait test.roll();\r\n\r\nif (!test.succeeded)\r\n{\r\n this.actor.addCondition(\"ablaze\");\r\n}","dh5mAlaOOLCBC0YQ":"args.actor.system.details.length.value += args.actor.system.details.length.value * 0.1;","DHxUKY9LMyifFgCi":"return args.skill?.name == \"Trade (Apothecary)\" || args.skill?.name == \"Trade (Alchemist)\"","DHzODnNNdZ24FNSg":"let skills = this.actor.itemTypes.skill.filter(s => (this.effect.getFlag(\"wfrp4e\", \"skills\") || []).includes(s.name));\nskills.forEach(s => {\n s.system.modifier.value -= 10;\n})","DhZqJso1JWYtGrKk":"this.actor.addCondition(\"ablaze\")\r\nlet damage = this.effect.sourceTest.result.damage + this.effect.sourceTest.result.additionalDamage\r\nthis.script.scriptMessage(await this.actor.applyBasicDamage(damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}))","dIxYt421K010eogY":"\r\n let modifier = 0\r\n if (this.effect.name.includes(\"Moderate\"))\r\n modifier = -20\r\n else\r\n modifier = -10\r\n args.fields.modifier += modifier\r\n ","dk02qSJfJaIo3Geh":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.EO05HX7jql0g605A\");\r\nlet data = item.toObject();\r\ndata.system.specification.value = this.actor.characteristics.ag.value\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","Dk4VF4UXSMK5SaVP":"this.script.message(\"Aktiviert, um Kritische Fehlschläge / Fehlschläge zu annullieren\")\nthis.effect.update({disabled: true})","dkiNmwFXztIVbuxg":"let currentCareer = this.actor.system.currentCareer;\r\n\r\nif (!currentCareer || currentCareer.system.talents.includes(game.i18n.localize(\"NAME.Frenzy\")))\r\n{\r\n return\r\n}\r\n\r\ncurrentCareer.system.talents.push(game.i18n.localize(\"NAME.Frenzy\"));","dkY7WRYjFVh8GB0m":"return ['ws', 'bs', 'ag'].includes(args.characteristic)","DL9vYNft9aXdV2aW":"let tooth = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\r\ntooth = tooth.toObject()\r\ntooth.system.specification.value = 3\r\ntooth.system.qualities.value = [{name : \"magical\"}]\r\n \r\nlet claw = await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")\r\nclaw = claw.toObject()\r\nclaw.system.specification.value = 4\r\nclaw.system.qualities.value = [{name : \"magical\"}]\r\nclaw.name = \"Claw\"\r\n\r\nthis.actor.createEmbeddedDocuments(\"Item\", [tooth, claw], {fromEffect : this.effect.id})","dLlcg8m8eiaVBmTg":"if (this.effect.sourceActor)\n{\n this.effect.updateSource({\"system.changes\": null});\n return;\n}\n\nlet colors = {\n fire : \"#b22222\",\n heavens : \"#87ceeb\",\n metal : \"#ee9b3a\",\n shadow : \"#808080\",\n life : \"#008000\",\n beasts : \"#a52a2a\",\n light : \"#f0ffff\",\n death : \"#800080\",\n necromancy : \"#800080\",\n daemonology : \"#8b0000\"\n};\n\nlet spell = this.actor.itemTypes.spell.find(i => Object.keys(colors).includes(i.system.lore.value[0]));\n\nlet color;\nif (spell)\n{\n color = colors[spell.system.lore.value[0]];\n}\nelse \n{\n color = Object.values(colors)[Math.ceil(CONFIG.Dice.randomUniform() * 10)];\n}\n\nthis.effect.updateSource({\"system.changes\": [\n {key: \"token.light.animation.type\", type: \"override\", value: \"flame\"}, \n {key: \"token.light.dim\", type: \"override\", value: 30}, \n {key: \"token.light.bright\", type: \"override\", value: this.actor.system.characteristics.wp.bonus}, \n {key: \"token.light.color\", type: \"override\", value: color}\n]});","dM449AU0FQRnOc3l":"if (args.opposedTest.result.hitloc.value == \"head\")\r\n{\r\n args.abort = \"Missed - Headless\"\r\n}","dM8FbRH2V8CpOkXw":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.QluSTTTq3viHJJUh\")\r\nlet data = item.toObject();\r\ndata.system.location.value = \"Ribs\";\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","DmbWR9s5I8LHBwxB":"let column = await ValueDialog.create(\"Select the column to roll on to determine Beast Head\", \"Select Column\", \"\", [\"Undivided\", \"Khorne\", \"Nurgle\", \"Slaanesh\", \"Tzeentch\"]);\r\n\r\nif (column)\r\n{\r\n let result = await game.wfrp4e.tables.rollTable(\"beasthead\", {}, column);\r\n this.script.scriptMessage(`<strong>${result.title}</strong><br>${result.result}`);\r\n let uuid = `Compendium.${result.object.documentCollection}.${result.object.documentId}`;\r\n let item = await fromUuid(uuid);\r\n if (item)\r\n {\r\n this.actor.createEmbeddedDocuments(\"Item\", [item])\r\n this.item.delete();\r\n }\r\n}","dMeSZGdvw7zlnUKh":"return args.characteristic != \"wp\" && !args.context.terror && !args.extendedTest?.flags.wfrp4e?.fear","DMQ0taEpBUJU5njV":"args.actor.status.fortune.value = 0","DpdSEHM6NMN1ey6h":"if (parseInt(this.item.system.specification.value) > 0)\r\n{\r\n\tthis.actor.system.status.ward.value = parseInt(this.item.system.specification.value);\r\n}","DqJFo74trI916qXN":"let fatigued = args.actor.hasCondition(\"fatigued\")\r\nif (fatigued)\r\n setProperty(fatigued, \"flags.wfrp4e.scriptData\", getProperty(fatigued, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))","dqvHDMlcitLx1pUx":"this.actor.system.details.move.value /= 2;","dr9VJKGY3TeGuzXj":"this.script.message(`Allies of ${this.actor.name} gain +20 Initiative for the first round.`)","drolLZoNuAXQFuPH":"if (args.totalWoundLoss > 0 && this.item.protects[args.loc])\n{\n let roll = await new Roll(\"1d10\").roll();\n roll.toMessage(this.script.getChatData())\n if (roll.total >= 9)\n {\n args.abort = this.effect.name\n }\n}","DsE6rTSzxEn6uWMz":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"average\"}})\r\nawait test.roll();\r\nif (test.failed)\r\n{ \r\n await this.actor.addCondition(\"blinded\");\r\n await this.actor.addCondition(\"fatigued\")\r\n} ","dSie82gBJoln1V2i":"await this.actor.hasCondition(\"broken\")?.delete();\nawait this.actor.hasCondition(\"fatigued\")?.delete();\n\nlet healed = this.effect.getFlag(\"wfrp4e\", \"handOfGlory\")?.roll || 0;\nthis.actor.modifyWounds(healed)\nthis.script.message(`Healed ${healed} Wounds`)","dSmRhZ6o1bUcOSF9":"return args.skill?.name != game.i18n.localize(\"NAME.Leadership\");","dsXGavzXLerXR8Xg":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Sail\")) && !args.skill?.name.includes(game.i18n.localize(\"NAME.Row\"))","dt85W8pzZ09w1QLi":"if (this.actor.sameSideAs(this.effect.sourceActor))\r\n args.fields.slBonus += 2;\r\nelse\r\n args.fields.slBonus -= 2;","dtFvpY96RPzNnphq":"return !(args.skill?.name.includes(\"Melee (Basic)\") || (args.type == \"weapon\" && args.item?.system.weaponGroup.value == \"basic\"))","dtHJFFp2mmVsfil3":"if (args.test.failed)\n {\n let applicableCharacteristics = [\"ws\", \"bs\", \"s\", \"fel\", \"ag\", \"t\", \"dex\"];\n if (applicableCharacteristics.includes(args.test.characteristicKey))\n {\n this.actor.addCondition(\"stunned\");\n }\n }","DTiHS6RfwhF4THbf":"return args.skill?.name != game.i18n.localize(\"NAME.Drive\") && !args.skill?.name.includes(game.i18n.localize(\"NAME.Ride\"));","dtQH7ZBKfzewtTsq":"let damage = await new Roll(\"1d10 + 4\").roll();\ndamage.toMessage(this.script.getChatData());\nthis.actor.applyDamage(damage.total, {\n damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP,\n createMessage: this.script.getChatData()\n});","DUFSlDO38fQWclBE":"// Characters wounded by the ravens gain the ability to read, understand and speak rudimentary Classical. \n// This ability does not last beyond this adventure.\n\nthis.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.61L9aX2z164cjm7K\", this.effect)\n\nthis.script.message(`<b>${args.actor.name}</b> gains the ability to read, understand and speak rudimentary @UUID[Compendium.wfrp4e-core.items.Item.61L9aX2z164cjm7K]{Classical}. This ability does not last beyond this adventure.`)","dULCkRxtisuzQyuK":"if (args.options.condition) \r\n this.effect.delete();","DuM5l2Yb4bdvDeaG":"return args.skill?.name != \"Athletics\"","dVF5ywnzeiZQx9ke":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"hard\"}, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed) \n{\n\tthis.script.scriptMessage(await this.actor.applyBasicDamage(15, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}))\n}","DvJvHsjgkzIfFaks":"if (!args.test.preData.options?.runeOfParrying) return\nif (!this.item.equipped.value || !args.test.item) return;\nargs.test.preData.canReverse = true","DVlZGbiuMIHEQOnM":"if (this.actor.getFlag(\"wfrp4e\", \"isAttached\")) \r\n{\r\n\tlet roll = await new Roll(\"1d10\").roll()\r\n\tawait roll.toMessage(this.script.getChatData());\r\n\tif (roll.total == 9 || roll.total == 10)\r\n\t{\r\n\t this.script.scriptMessage(`<strong>${this.actor.name}</strong> attached to <strong>${this.actor.getFlag(\"wfrp4e\", \"isAttached\")}</strong> gorges and falls off.`)\r\n\t await this.actor.unsetFlag(\"wfrp4e\", \"isAttached\") \r\n\t}\r\n }","DWBxvzfWGcG7PVNP":"let letter = this.item.system.location.key[0]; // \"l\" or \"r\";\r\n\r\nthis.item.updateSource({\"system.location.key\" : letter + \"Finger\"})\r\n\r\n// We want the location to be Right or Left Hand, but the key to be rFinger or lFinger","dWr3tkFoIzsAgelu":"let injury = this.effect.itemTargets[0]\r\nif (injury && this.effect.sourceTest.result.outcome == \"success\") {\r\n let days = new Roll(injury.system.duration.value).roll( {async: false} ).total\r\n let num = 1 + Number(this.effect.sourceTest.result.SL);\r\n let roll = await new Roll(num+'d10').roll({async: false})\r\n await roll.toMessage(this.script.getChatData())\r\n let newDays = Math.max(days - roll.total, 1)\r\n this.actor.updateEmbeddedDocuments(\"Item\", [{_id: injury.id, 'system.duration.value': newDays} ])\r\n let message = \"Injury reduces to \"+newDays+\" (-\" + roll.total + \") instead of \"+days\r\n this.script.scriptMessage(message)\r\n}\r\n","dwSgcFxKN3S0hLJL":"return args.skill?.name != \"Melee (Brawling)\" && args.item?.weaponGroup?.value != \"brawling\"","dXGosSxdoYbET2O8":"await this.actor.addCondition(\"fatigued\");\r\n\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"))\r\n\r\nawait test.roll();\r\n\r\nif (!test.succeeded)\r\n{\r\n await this.actor.addCondition(\"fatigued\");\r\n await this.actor.addCondition(\"broken\");\r\n}","DxM3NRgQYc7moMPc":"this.actor.reset()","DxQnamsb2AuW0p2e":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Lore\"));","dxt3p07po06J9fO1":"const metal = () => {\n for (const [key, loc] of Object.entries(this.actor.armour)) {\n if (!loc.layers) continue;\n\n for (const layer of loc.layers) {\n if (layer.metal)\n return true;\n }\n }\n\n return false;\n};\n\nargs.fields.slBonus -= metal() ? 2 : 1;","dxxDFXNNqUsuMyUD":"args.fields.slBonus += 1","Dy67jQmeGwHwV9NY":"args.fields.modifier -=10;","DyZ1jH88EAp1ueOK":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.GlShFJF2TpsNh1FX\")\r\nlet data = item.toObject();\r\ndata.system.location.key = this.item.system.location.key\r\ndata.system.location.value = data.system.location.value.replace(\"Arm\", \"Wrist\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\r\n","dZ4c5pKDqQV02aIK":"if (args.effect.conditionId == \"ablaze\")\r\n{\r\n args.data.formula += ` + parseInt(this.effect.sourceTest.result.SL)`\r\n}","Dzi2CKpYapRGwNVr":"if (args.actor.system instanceof StandardActorModel) {\r\n args.actor.addCondition(\"unconscious\");\r\n}","e0eKVlOSk3Vw1HiD":"return args.characteristic != \"wp\" || args.type != \"characteristic\"","E0HHBSdQR3oH8KaL":"if (args.totalWoundLoss > 0) {\n let frenzy = await fromUuid(\"Compendium.wfrp4e-core.items.Item.DrNUTPeodEgpWTnT\");\n frenzy = frenzy.toObject(); \n frenzy.effects[0].disabled = false;\n this.actor.createEmbeddedDocuments(\"Item\", [frenzy], {fromEffect : this.effect.id}); \n this.script.scriptMessage(\"Carnosaur gains Frenzy\");\n}","E0OhL9ZO8vb8A4qq":"args.actor.system.characteristics.t.initial += 30;","e0TuMgYuI7ZtGoQr":"args.applyAP = false;\r\n\r\nawait args.actor.addCondition(\"ablaze\", 2);\r\nawait args.actor.addCondition(\"prone\");","E1vUepgop09FF5wy":"if (this.actor.system.status.advantage.value == 0)\r\n{\r\n return this.script.scriptNotification(\"Not enough Advantage!\", \"error\")\r\n}\r\n\r\nlet hatred = await fromUuid(\"Compendium.wfrp4e-core.items.Item.aE3pyW20Orvdjzj0\")\r\nlet frenzy = await fromUuid(\"Compendium.wfrp4e-core.items.Item.yRhhOlt18COq4e1q\");\r\n\r\nif (this.actor.system.status.advantage.value >= 3)\r\n{\r\n this.script.scriptNotification(`Adding ${frenzy.name}`)\r\n this.actor.setAdvantage(0)\r\n this.actor.createEmbeddedDocuments(\"Item\", [frenzy])\r\n}\r\nelse if (this.actor.system.status.advantage.value >= 1)\r\n{\r\n let data = hatred.toObject();\r\n data.system.specification.value = \"Close Combat opponents\"\r\n this.script.scriptNotification(`Adding ${hatred.name}`)\r\n this.actor.setAdvantage(0)\r\n this.actor.createEmbeddedDocuments(\"Item\", [data])\r\n}","E1Xo4RVuN1YRRxg7":"return args.item?.attackType != \"ranged\"","E2FhOfZzu2CqTSeA":"let damage = this.effect.sourceTest.result.damage;\n\nawait this.actor.applyDamage(damage - 3, {\n loc: \"roll\",\n damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP,\n createMessage: this.script.getChatData(),\n});\n\nawait this.actor.addCondition(\"ablaze\", 1);","e2JlsKoW8oaFjn6Y":"const roll = new Roll(\"1d10\");\n\nawait roll.evaluate();\nroll.toMessage();\n\nconst slBonus = Number(this.effect.sourceTest.result.SL) + roll.total;\n\nthis.effect.setFlag(\"wfrp4e\", \"slBonus\", slBonus);","E2VfOVuju67qO3VL":"let blinded = this.actor.hasCondition(\"blinded\");\r\nif (blinded.getFlag(\"wfrp4e\", \"nightshroud\"))\r\n{\r\n blinded.delete()\r\n}","E33J9JixYVGxaktQ":"if (this.effect.getFlag(\"wfrp4e\", \"fistsOfGork\") && args.item.type == \"skill\" && args.item.name == \"Nahkampf (Waffenlos)\") {\n\targs.item.system.modifier.value += this.effect.getFlag(\"wfrp4e\", \"fistsOfGork\")\n}","e34s1XxHckAWfwHt":"if (args.test.options.beatBlade && (args.test.result.roll <= game.settings.get(\"wfrp4e\", \"automaticSuccess\") || args.test.result.roll <= args.test.target))\r\n{\r\n args.test.result.other.push(`<b>${this.effect.name}</b>: Opponent loses ${Number(args.test.result.SL) + 1} Advantage`)\r\n}","e3dBud1keWyhw6nw":"const stupid = this.actor.items.find(i => i.name === \"Stupidee\");\n\nif (!stupid) return;\n\n\nif (this.item.system.disabled) {\n await stupid.update({\"system.disabled\": false});\n} else {\n await stupid.update({\"system.disabled\": true});\n}","E3om295BMQojnM2F":"let fatigued = this.actor.hasCondition(\"fatigued\")\r\nif (fatigued)\r\n{\r\n fatigued.delete();\r\n this.script.scriptNotification(\"Removed Fatigued\")\r\n}","E4CHDe1xfmcV3oGv":"return args.skill?.name == game.i18n.localize(\"NAME.Navigation\");","e4HotRnEiyXR0pIu":"this.actor.applyEffect({effectUuids : this.item.effects.contents[1].uuid})","E6DMqfDeczqmVMFV":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"average\"}})\r\n\r\nawait test.roll();","E6v4YZrvFikbdXoO":"const locations = [];\r\n\r\nfor (let [key, loc] of Object.entries(args.AP)) {\r\n if (loc.layers?.some(i => i.metal))\r\n locations.push(key);\r\n}\r\n\r\nthis.actor.status.addArmour(1, {source: this.effect, magical: true, locations})","E7D4bxz8gy4e1wL7":"return [\"Schleichen (Land)\", \"Spurenlesen\", \"Überleben\", \"Schwimmen\", \"Wahrnehmung\", \"Intuition\"].includes(args.item?.name);","e7IxnxePdXSy6L4E":"if (args.opposedTest.result.hitloc.value == \"head\")\r\n{\r\n this.script.scriptMessage(`<b>${this.actor.prototypeToken.name}</b> receives a @Table[crithead]{Critical Wound} if one was not caused already.`)\r\n}","E7ksDLhihkJN4Vpt":"return args.characteristic != \"s\" || args.type != \"characteristic\"","EaSNOmXUxAkUHnm5":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","eAtqyBd1HsDWuBuI":"this.actor.system.characteristics.fel.modifier -= parseInt(this.item.system.location.value) || 1","Eay7GpDyfsEE40jT":"if (args.totalWoundLoss > 0)\r\n{\r\n args.actor.addCondition(\"ablaze\")\r\n}","eb69QPmNQEJXtk4l":" return args.characteristic != \"bs\"","ebDQH0MdGAG02CHl":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.SYjWiKDzMS6CtROJ\")\r\nlet data = item.toObject();\r\ndata.system.location.key = this.item.system.location.key\r\nif (this.item.system.location.key == \"rArm\")\r\n{\r\n\tdata.system.location.value = \"Right Hand\"\r\n\tdata.system.location.key = \"rHand\"\r\n}\r\nelse if (this.item.system.location.key == \"lArm\")\r\n{\r\n\tdata.system.location.value = \"Left Hand\"\r\n\tdata.system.location.key = \"lHand\"\r\n}\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data])","EBNrA6FNX4d05EUx":"return !args.options.crewTest;","eC61buStv62b3sN9":"args.fields.slBonus += 8;","EC8cZmqrE095cDc2":"const actor = args.actor;\r\n\r\nif (actor.itemTypes.skill.find(s => s.name === \"Lore (Riverways)\")) {\r\n const loreTest = await actor.setupSkill('Lore (Riverways)', {\r\n appendTitle: ` – ${this.effect.name}`,\r\n skipTargets: true,\r\n fields: {difficulty: 'hard'},\r\n characteristic: 'int',\r\n });\r\n await loreTest.roll();\r\n\r\n if (loreTest.succeeded) {\r\n loreTest.result.other.push(`<b>${actor.name}</b> recognizes lures of Lurkerfish.`);\r\n loreTest.renderRollCard();\r\n return;\r\n } \r\n}\r\n\r\nlet test = await actor.setupSkill('Cool', {\r\n appendTitle: ` – ${this.effect.name}`,\r\n skipTargets: true,\r\n fields: {difficulty: 'easy'},\r\n characteristic: 'wp',\r\n});\r\nawait test.roll();\r\n\r\nif (!test.succeeded) {\r\n test.result.other.push(`<b>${actor.name}</b> became beguiled by the sight and unable to perform any action except moving towards the light.`);\r\n test.renderRollCard();\r\n actor.addCondition(\"unconscious\");\r\n}","ecpD6KWtNjMCvuyn":"if (args.test.isCritical || args.test.isFumble)\n args.test.result.tables.miscast = {\n label : game.i18n.localize(\"ROLL.MajorMis\"),\n class : \"fumble-roll\",\n key : \"majormis\",\n }\ndelete args.test.result.critical;\ndelete args.test.result.tables.critical;","ECUIJLcKt2TCSFS3":"return !args.weapon?.system?.attackType || game.settings.get(\"wfrp4e\", \"useGroupAdvantage\")","ed7Sud9HM3uB2j6b":"ChatMessage.create({content : \"<em>Yield or die!</em>\", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true})\r\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = 2;\r\nthis.script.scriptNotification(\"Adding \" + data.name);\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id});\r\ngame.wfrp4e.utility.postFear(2, this.actor.prototypeToken.name)","EDAMEOzdBfkoKHxP":"return args.skill?.name !== game.i18n.localize(\"NAME.Navigation\");","EdTChmSouS0MSmk5":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (test.succeeded)\r\n{\r\n this.script.scriptMessage(\"Can perform an Action or Move (choose one)\")\r\n}\r\nelse \r\n{\r\n this.script.scriptMessage(\"Cannot perform an Action or Move this round\") \r\n}","eFVDAqG80veYmhpi":"if (Number(this.actor.system.details.age.value) > 870) {\n if ([\"t\", \"i\", \"fel\"].includes(args.characteristic))\n args.fields.slBonus -= 3;\n if ([\"ws\", \"bs\", \"s\"].includes(args.characteristic))\n args.fields.slBonus -= 2;\n} else if (Number(this.actor.system.details.age.value) > 350) {\n if ([\"t\", \"i\"].includes(args.characteristic))\n args.fields.slBonus -= 2;\n if ([\"fel\"].includes(args.characteristic))\n args.fields.slBonus -= 1;\n} else {\n if ([\"t\", \"i\"].includes(args.characteristic))\n args.fields.slBonus -= 1;\n}","egc02UIueJgEQMqx":"args.context.kingship = true","egDtqMxe3iekc6hv":"let trait = args.opposedTest.attackerTest.item\r\nlet woundLossEffect = this.item.effects.get(\"7Amhi75wLv0PvGjd\")\r\nif (trait && trait.name.includes(\"Bite\") && woundLossEffect)\r\n{\r\n args.actor.applyEffect({effectUuids : woundLossEffect.uuid})\r\n}","eGQAyzCFZAEQhyJl":"const roll = new Roll(\"2d10\");\r\nawait roll.evaluate();\r\nconst money = game.wfrp4e.market.addMoneyTo(this.actor, `${roll.total}b`);\r\nawait this.actor.updateEmbeddedDocuments(\"Item\", money);\r\nthis.script.message(game.i18n.format(\"SCRIPT.Silvertide\", {name: this.actor.name, pennies: roll.total}));","EGWF3LHav3e2zFL4":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Ranged\")) || args.item?.isRanged || args.item?.name == game.i18n.localize(\"NAME.Charm\");","eh1J3s0s4A2AxoFp":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.8pVzgPkgWpTJvfhG\");\r\nlet data = item.toObject();\r\ndata.name += \" (Enemy)\";\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","EHfOyVwYhFGWNjw1":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {difficulty: \"difficult\"})\n await test.roll();\n if (!test.succeeded)\n {\n await this.actor.addCondition(\"poisoned\");\n }","eHgk3HZ6eyLFTZ9o":"return !args.item?.system.magicMissile?.value && !args.item?.system.attackType","eHRv7f2BTtle6Y1K":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.sJ3yX1kvzu2hgNq5\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","eieFcF4BxIvDTN3C":"args.abort = `Cannot perform Projectiles Attacks within ${this.effect.name}`;","eIiiDhJohYez26qY":"const {targetUuid} = this.effect.flags.wfrp4e;\n\nif (args.actor.uuid !== targetUuid) return;\n\nconst recordedWounds = this.effect.getFlag(\"wfrp4e\", \"damageToReturn\");\n\nif (!recordedWounds) return;\n\nargs.modifiers.other.push({label: this.effect.name, value: recordedWounds});\nargs.totalWoundLoss += recordedWounds\n\nthis.effect.unsetFlag(\"wfrp4e\", \"damageToReturn\");","EiLaZW4b4ypw5sLV":"// can't use Damage application type because that checks if wounds were dealt\r\nargs.actor.applyEffect({effectUuids : this.item.effects.contents[0].uuid})","EJaBfqADqlo92Fx6":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.oGbDwnLOn3isPJpO\")\r\nlet data = item.toObject();\r\ndata.name += \" (To Be Determined)\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","EJObiSth3WdcJOXN":"if (args.test.characteristicKey == \"wp\" && args.test.failed && args.test.result.SL <= -3)\r\n{\r\n this.script.scriptNotification(\"Adding Prone\");\r\n this.actor.addCondition(\"prone\")\r\n}","ekjJQHyMbZT2vqdc":"let uses = this.item.getFlag(\"wfrp4e\", \"uses\") || 0;\r\nuses++;\r\nthis.script.scriptNotification(`Used ${uses} times`)\r\nthis.item.setFlag(\"wfrp4e\", \"uses\", uses);\r\nif (uses >= 3)\r\n{\r\n\tthis.effect.update({\"flags.wfrp4e.applicationData.type\" : \"other\"})\r\n\tthis.script.scriptNotification(`Used up`);\r\n}\r\n","EKkdyp51Wf4csw2B":"return this.actor.statuses.has(\"frenzy\");","ElHBPMMx37SZMvOC":"this.actor.addCondition(\"ablaze\");\nthis.script.scriptMessage(`${this.actor.name} has a received a @Condition[Ablaze]`)","eLxdRg8LX3AdYSEq":"let sumArmour = 0;\nfor (let key in this.actor.system.status.armour) {\n let armour = this.actor.system.status.armour[key];\n sumArmour += Number(armour?.value || 0);\n}\nlet damage = Math.floor(Number(sumArmour)/2);\nif (damage > 0 ) { \n\tthis.script.scriptMessage(await this.actor.applyBasicDamage(damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}))\n}","EmmG49pMOPHRwDzR":" let roll = Math.ceil(CONFIG.Dice.randomUniform() * 10)\r\n if (args.test.isFumble && roll == 1 && !args.test.result.misfire)\r\n {\r\n args.test.result.misfire = game.i18n.localize(\"Misfire\") + \" (Rolled 1)\"\r\n args.test.result.misfireDamage = eval(parseInt(args.test.result.roll.toString().split('').pop()) + args.test.item.Damage)\r\n }\r\n else if (args.test.isFumble && roll != 1)\r\n args.test.result.other.push(\"Misfire Roll: \" + roll)\r\n","EmXwcuycEH8slEn5":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}})\r\nawait test.roll();\r\nif(test.failed)\r\n{\r\n this.actor.addCondition(\"unconscious\")\r\n}","ENGmwaItRXO5s0XY":"await this.actor.modifyWounds(this.actor.system.characteristics.t.bonus * 3)\r\nthis.script.scriptMessage(`Heals ${this.actor.system.characteristics.t.bonus * 3} Wounds`)\r\n\r\nthis.actor.hasCondition(\"bleeding\")?.delete()\r\nthis.actor.hasCondition(\"fatigued\")?.delete()\r\n","EpdMj9d9SYPeP44q":"return args.characteristic != \"ag\" && args.item?.id != this.item?.id","ePPgxQOqL1Uhz2k9":"let choice1 = [\n {\n type : \"skill\",\n name : \"Ranged (Bow)\",\n diff : {\n system : {\n advances : {\n value : 10\n }\n }\n }\n },\n {\n type : \"weapon\",\n name : \"Bow\",\n },\n {\n type : \"ammunition\",\n name : \"Arrow\",\n }\n]\nlet choice2 = [\n]\n\nlet choice = await Dialog.wait({\n title : \"Option\",\n content : \n `<p>\n Add Option?\n </p>\n <ol>\n <li>Ranged (Bow) +10 and a Bow with 12 Arrows</li>\n </ol> \n `,\n buttons : {\n 1 : {\n label : \"Yes\",\n callback : () => {\n return choice1\n }\n },\n 2 : {\n label : \"No\",\n callback : () => {\n choice2\n }\n }\n }\n })\n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","ePv2YYcr4lz3AkGu":"args.item.range.bands[game.i18n.localize(\"Long Range\")].modifier = 0\nargs.item.range.bands[game.i18n.localize(\"Extreme\")].modifier = 0","eq32dKXeTAbKhhLf":"if (args.totalWoundLoss > 0)\n{\n args.actor.addCondition(\"ablaze\", Math.max(1, parseInt(args.opposedTest.attackerTest.result.SL) + 1))\n}","EQ5dtGW5kQhtAb87":"await this.actor.addCondition(\"prone\")\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"hard\"}, skipTargets: true, appendTitle : \" - \" + this.effect.name})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n\tawait this.actor.addCondition(\"stunned\")\r\n}","eqxE7nBO13yJS7hc":"let roll = (await new Roll(\"1d10\").roll())\r\nroll.toMessage({flavor: \"Wounds Healed\", speaker : {alias : this.actor.name}})\r\n\r\nthis.actor.modifyWounds(roll.total)\r\n\r\nthis.actor.hasCondition(\"bleeding\")?.delete();","ErgOwSiVnm9VLVHN":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.DrNUTPeodEgpWTnT\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","eRVVn8YtU8nnOW2q":"await this.actor.addCondition(\"prone\");\n\nconst test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Dodge\"), {\n skipTargets: true,\n appendTitle: ` - ${this.effect.name}`,\n fields: {difficulty: \"difficult\"},\n context: {\n failure: `Erleidet 8 Schaden.`,\n success: `Erleidet 4 Schaden.`\n }\n})\n\nawait test.roll();\nconst damage = test.failed ? 8 : 4;\n\nawait this.actor.applyBasicDamage(damage, {damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, loc: \"roll\"});","ERxrWzSpw8qwxFVi":"this.script.scriptNotification(`Cannot enter ${this.effect.name}!`); this.actor.addCondition(\"broken\");","esuLwq4g5T8k1kLT":"await args.actor.addCondition(\"ablaze\"); await args.actor.addCondition(\"prone\");","EsZx8cY34quYG4MQ":"let runes = this.actor.itemTypes[\"wfrp4e-dwarfs.rune\"]\nif (runes.length === 0) return ui.notifications.error(\"Dieser Akteur kennt keine Rune.\")\n\nlet rune = await ItemDialog.create(this.actor.itemTypes[\"wfrp4e-dwarfs.rune\"], 1, {text: \"Wähle eine Rune\", title: this.effect.name})\nrune[0].system.use({initialTooltip: \"Bonus Amboss des Schicksals\", fields: {modifier: 20}})","Et4tPHlrkueLqP3T":"if (args.item.type == \"skill\") args.item.system.modifier.value -= 10","ETfmit2Cx0Py77ai":"let characteristics = {\n \"ws\" : -10,\n \"bs\" : 0,\n \"s\" : 0,\n \"t\" : 0,\n \"i\" : -25,\n \"ag\" : -20,\n \"dex\" : 0,\n \"int\" : -200,\n \"wp\" : -200,\n \"fel\" : -200\n}\nlet traits = [ {name:\"Konstrukt\"}, {name:\"Dunkelsicht\"}, {name:\"Angst\", value: 2}, {name:\"Schmerzfrei\"},{name:\"Untot\"},{name:\"Instabil\"} ];\nlet items = [];\n\nlet updateObj = this.actor.toObject();\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nupdateObj.system.characteristics.int.initial = 0;\nupdateObj.system.characteristics.wp.initial = 0;\nupdateObj.system.characteristics.fel.initial = 0;\n\nfor (let trait of traits)\n{\n let traitItem = await game.wfrp4e.utility.find(trait.name, \"trait\")\n if (traitItem)\n { \n let t = traitItem.toObject();\n t.system.specification.value = trait.value;\n items.push(t);\n }\n else \n {\n ui.notifications.warn(`${trait.name} nicht gefunden`, {permanent : true})\n }\n}\n\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n","eTHJSRutCEpuyPkR":"return args.weapon?.system?.attackType !== \"melee\" || game.settings.get(\"wfrp4e\", \"useGroupAdvantage\")","ETrfkHI0B9YjJqM2":"return this.item.equipped.value && this.actor.isOpposing && this.actor.attacker.test.item.attackType == \"melee\"","eu4mHsdZukvUEAGJ":"let token = this.actor.getActiveTokens()[0]?.document;\nif (!token) {\n token = this.actor.prototypeToken\n}\nif (args.equipped) {\n this.effect.setFlag(\"wfrp4e\", \"lightData\", token.light);\n token.update({\n light: {\n \"alpha\": 0.8,\n \"angle\": 360,\n \"bright\": 5,\n \"color\": \"#a33c0f\",\n \"coloration\": 1,\n \"dim\": 20,\n \"attenuation\": 0.5,\n \"luminosity\": 0.5,\n \"saturation\": 0,\n \"contrast\": 0,\n \"shadows\": 0,\n \"animation\": {\n \"type\": \"torch\",\n \"speed\": 8,\n \"intensity\": 4,\n \"reverse\": false\n }\n }\n })\n}\nelse {\n token.update({light: this.effect.getFlag(\"wfrp4e\", \"lightData\")});\n}","EU5j0hnDTG9Z6d1e":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}})\r\nawait test.roll();\r\nif(test.failed)\r\n{\r\n this.actor.addCondition(\"stunned\", 2)\r\n}","EVBSHEC5nmmj2X41":"return args.skill?.name != game.i18n.localize(\"NAME.Climb\") && !args.skill?.name?.includes(game.i18n.localize(\"NAME.Stealth\"));","eViKAYOtuaOqo6c7":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.ConsumeAlcohol\"))","Ew3C2WmLCtc1KT46":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\")) || args.item?.id == this.item?.id","EwD053Fyy46b59ZI":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.6l3jvIAvrKxt0lA9\");\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","eWvHTkxsjKuH2IKm":"const luck = Number(this.item.qualities.value.filter(v => v.key == \"luck\")[0].description)\n\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.u0CFf3xwiyidD9T5\")\n\nfor (let i = 0; i < luck; i++) {\n let data = item.toObject();\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n}","eWWLmA2xINR321aK":"args.item.system.qualities.value.push({name : \"magical\"})","EXiqepAIXmbqMiKa":"if (args.opposedTest?.attackerTest?.weapon?.name.toLowerCase().includes(\"unarmed\")) {\r\n const sl = this.effect.getFlag(\"wfrp4e-archives3\", \"sl\");\r\n args.totalWoundLoss += sl;\r\n args.modifiers.other.push({label: this.effect.name, value: sl});\r\n}","Eye6dranWpNsILjm":"if (this.actor.system.status.wounds.value <= 1)\r\n{\r\n this.effect.delete();\r\n}","EYny6z5oTOhxGDfb":"args.fields.modifier -= 10;\r\n","eyrUJQAuHvdllCwi":"args.context.flags.skewering = true;\nthis.effect.update({disabled: true});","ezGqDoC9hNRBnFTB":" let choices = await Promise.all([game.wfrp4e.utility.findItemId(\"1zaqojk0Oq1m8vYv\"), game.wfrp4e.utility.findItemId(\"zIuarD5mB0EF0ji0\")])\r\n let items = await game.wfrp4e.apps.ItemDialog.create(choices, 1, \"Choose a Weapon\")\r\n items = items.map(i => i.toObject())\r\n \r\n items.forEach(i => equip(i))\r\n \r\n this.actor.createEmbeddedDocuments(\"Item\", items);\r\n \r\n function equip(item)\r\n {\r\n if (item.type == \"armour\")\r\n item.data.worn.value = true\r\n else if (item.type == \"weapon\")\r\n item.data.equipped = true\r\n else if (item.type == \"trapping\" && item.data.trappingType.value == \"clothingAccessories\")\r\n item.data.worn = true\r\n }","f062aa2BNClx08D6":"let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\n await test.roll();\r\n if (test.failed) \r\n {\r\n let toughnessLost = parseInt(this.effect.sourceTest.result.SL)\r\n\r\n let currentModifier = this.actor.characteristics.t.modifier\r\n\r\n await this.actor.update({ \"system.characteristics.t.modifier\": currentModifier - toughnessLost })\r\n this.script.scriptMessage(`<b>${this.actor.prototypeToken.name}</b> lost ${toughnessLost} Toughness`)\r\n if (this.actor.system.characteristics.t.value <= 0)\r\n {\r\n this.actor.addCondition(\"dead\");\r\n }\r\n\r\n }","f29Pv6TQtgILxt1h":"if (args.test.options.healWounds) {\r\n if (args.test.result.roll <= game.settings.get(\"wfrp4e\", \"automaticSuccess\") || args.test.result.roll <= args.test.target) {\r\n let wounds = this.actor.characteristics.int.bonus + ~~args.test.result.SL\r\n if (args.test.options.fieldDressing && args.test.result.reversed)\r\n wounds = this.actor.characteristics.int.bonus + Math.min(1, Number(args.test.result.SL))\r\n\targs.test.result.woundsHealed = wounds\r\n\targs.test.result.other.push(`<b>${this.actor.name}</b> healed <b>${wounds}</b> wounds of the patient.`)\r\n }\r\n else if (this.actor.characteristics.int.bonus + args.test.result.SL < 0)\r\n args.test.result.other.push(`The patient contracts a @UUID[Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg]{Minor Infection}.`)\r\n}","F2u4L4o0r1LTWeWK":"if (isNaN(parseInt(this.item.system.specification.value)))\r\n{\r\n let value = await ValueDialog.create(\"Enter Terror value\", this.effect.name);\r\n if (value)\r\n {\r\n this.item.updateSource({\"system.specification.value\" : value});\r\n }\r\n}","f3rXusHh6VIpVPUl":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Language\")) && args.type != \"cast\"","F4aGsdzJ9SYcX57F":"if (args.equipped)\r\n{\r\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.HpFkVJ2lYPAWumUL\")\r\n let data = item.toObject();\r\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\r\n}\r\nelse \r\n{\r\n this.effect.deleteCreatedItems(); \r\n}","f4vvAGQ8OGoEbrgy":"let SL = args.opposedTest.attackerTest.result.SL - args.opposedTest.attackerTest.item.cn.value\r\nlet difficulty = \"challenging\"\r\nif (SL >= 1)\r\n difficulty = \"difficult\"\r\nif (SL >= 2)\r\n difficulty = \"hard\"\r\nif (SL >= 3)\r\n difficulty = \"vhard\"\r\n \r\n\r\nlet test = await args.actor.setupCharacteristic(\"wp\", {fields: {difficulty}, skipTargets: true, appendTitle : \" - \" + this.effect.name, context : {failure: \"Gain a Stunned Condition\"}})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n args.actor.addCondition(\"stunned\");\r\n}","f5Mp3kXwCFdPkW6N":"return args.skill?.name != \"Entertain (Sing)\" && args.skill?.name != \"Entertain (Singing)\" && !args.skill?.name.includes(\"Language\");","f6WnrJvoNkfoNN9Y":"return args.item?.attackType != 'melee'","F7BHb4a7fqWMnYxH":"args.test.data.result.other.push(`You may not use Fortune Points because of ${this.effect.name}`);","F7E0Dr3sT7kkc2p7":"return this.actor.hasCondition(\"fatigued\")","f7WZvYle9iqefRsh":"return args.weapon?.system?.attackType != \"melee\"","F8Bmh6w01YvKsBIO":"for (const weapon of args.actor.itemTags.weapon) {\n weapon.system.qualities.value.push(\n {name: \"impale\", value: null},\n {name: \"penetrating\", value: null},\n );\n}","f8cnfvGKJH3bYVGN":"return [\"s\", \"t\"].includes(args.characteristic)","F9P8Nh4AKnqSGg8C":"const uuids = [\r\n \"Compendium.wfrp4e-core.items.Item.bxbTiLzbaz4vdukT\", // Hunter's Eye\r\n \"Compendium.wfrp4e-core.items.Item.XSb3QVB9ipPBFt56\", // Shadow\r\n];\r\n\r\nconst items = await Promise.all(uuids.map(uuid => fromUuid(uuid)));\r\nawait this.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect: this.effect.id});","fA1dIV1ANo4RVEqy":"if (args.equipped) \n{\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.4mF5Sp3t09kZhBYc\");\n let champion = item.toObject();\n this.actor.createEmbeddedDocuments(\"Item\", [champion], {fromEffect : this.effect.id})\n} \nelse \n{\n this.effect.deleteCreatedItems();\n}","FAB12eLcSCAOOQwk":"this.script.scriptMessage(await this.actor.applyBasicDamage(20, {suppressMsg: true}));","FAf4iXj5LkdvukS2":"fromUuid(\"Compendium.wfrp4e-wom.items.0Xdm4r7l2EwC4fcg\").then(item => Item.create(item.toObject(), {fromEffect : this.effect.id, parent : this.actor}))","faRFSsrQylQRZFLk":"return args.bleedingHand || !args.weapon || !this.actor.hasCondition(\"bleeding\")","FbfJjYUyp0ArtZMb":"args.fields.modifier += 15","fC4KcY9S6V30IJyX":"args.context.supercharge = true;","FceC4TNNBvRnA7JM":"this.actor.system.characteristics.s.modifier += 60;\nthis.actor.system.characteristics.s.calculationBonusModifier -= 6;","FciJSTq7dZsZIPgl":"if (args.equipped)\r\n{\r\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR\")\r\n let data = item.toObject();\r\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\r\n}\r\nelse \r\n{\r\n this.effect.deleteCreatedItems(); \r\n}","fcY3pa72dELnOFXV":"return !args.options.reload\r\n","fEFfHFeJxkR0aIJK":"if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 3 && args.opposedTest.result.winner == \"attacker\")\r\n{ \r\n this.script.scriptMessage(`Everyone within 20 feet loses 1 Wound and makes a <strong>Difficult (-10) Endurance</strong> or gains @Condition[Deafened]`, {blind : true, whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n}\r\n ","feMPZhhFeXRtKdKY":"if (this.item.system.quantity.value)\r\n{\r\n\tthis.item.system.reduceQuantity();\r\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\r\n\tactor.applyEffect({effectUuids : this.item.effects.contents[0]?.uuid})\r\n}\r\nelse\r\n{\r\n\tthis.script.scriptNotification(\"None left!\", \"error\")\r\n}","fEyKQqCjDwml3DXO":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.M8XyRs9DN12XsFTQ\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","fFGuTi0HLjwneMcJ":"return args.item?.system.isRanged","fFi9JD4uCY9DPC5B":"let specification = Number(this.item.specification.value) || 1;\r\nargs.actor.system.characteristics.t.initial += 10 * specification;\r\nargs.actor.system.status.carries.max -= Math.floor(args.actor.system.status.carries.max * 0.1 * specification);\r\nargs.actor.system.details.price.gc += Math.floor(args.actor.system.details.price.gc * 0.1 * specification);","FfTqCPxCoxwGDTQs":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.wMwSRDmgiF2IdCJr\")\r\nlet data = item.toObject()\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\r\n","ffvcCEazZBinHlUX":"args.update({texture : {tint : \"#FFD700\"}});\r\n","FGIHAkNdYXbTnewG":"if (!game.settings.get(\"wfrp4e\", \"useGroupAdvantage\"))\n return;\n\n\nawait this.actor.modifyAdvantage(1);\nthis.effect.delete();","FiD3mvWIBHNNIuO9":"if (args.opposedTest.result.hitloc.value == \"body\")\r\n{\r\n if ((await new Roll(\"1d2\").roll()).total == 1)\r\n {\r\n args.opposedTest.result.hitloc.value = \"head\"\r\n this.script.scriptMessage(`Hit location changed to Head`)\r\n }\r\n}","fiF9sM5UpcHMYa33":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.vMYEkrWj0ip6ZOdv\");\r\nlet data = item.toObject();\r\ndata.name += \" (Poison, Disease, Chaos)\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", Array(this.effect.sourceTest.result.overcast.usage.other.current).fill(data), {fromEffect: this.effect.id})","fIUxKZMWJ8HMPmH9":"return [\"wp\", \"ag\", \"i\", \"int\"].includes(args.characteristic)","FjmtA9s13s75DTAY":"let locs = Object.keys(this.actor.system.status.armour);\n\nlet location = locs[Math.floor(CONFIG.Dice.randomUniform() * (locs.length))];\n\ngame.wfrp4e.tables.formatChatRoll(`crit${location}`, {criticalLocation: location, showRoll: true});","Fk14eUaTRvIoCBB1":"return !args.context.dispel","FKEH7DeqU0FH4dkk":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Dodge\"), {fields : {difficulty : \"hard\"}, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\n\nif (test.failed) {\n \tthis.script.scriptMessage(await this.actor.applyBasicDamage(20, {suppressMsg: true}));\n this.script.scriptMessage(`${this.actor.name} est victime de @UUID[Compendium.wfrp4e-core.journals.JournalEntry.NS3YGlJQxwTggjRX.JournalEntryPage.WCivInLZrqEtZzF4#drowning-and-suffocation]{Suffocation}`);\n}","fkFmNcesqqNTMhVn":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.2iult41Jehz0F1O8\")\r\nlet data = item.toObject();\r\ndata.system.location.key = this.item.system.location.key;\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","FkTwk8hfHpRLbAp2":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"prone\")\r\n}","fKzlu6fFE2th9uIJ":"return args.item?.name == game.i18n.localize(\"NAME.ConsumeAlcohol\")","fl762icfKrt9ear2":"this.actor.removeCondition(\"broken\", parseInt(this.effect.sourceTest.result.SL)+1)","fLg90csmdOOKmEE6":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.EO05HX7jql0g605A\")\nlet data = item.toObject();\ndata.system.specification.value = 16\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\n\nlet item2 = await fromUuid(\"Compendium.wfrp4e-core.items.Item.Bvd2aZ0gQUXHfCTh\")\nlet data2 = item2.toObject();\ndata2.system.specification.value = 8\nthis.actor.createEmbeddedDocuments(\"Item\", [data2], {fromEffect : this.effect.id})","FMA16PvoObBV8vDl":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.EO05HX7jql0g605A\")\r\nitem = item.toObject()\r\nitem.system.specification.value = 20\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})\r\nthis.script.scriptNotification(item.name + \" added\")","FmLx9pwOkzqqU7Ph":"return args.skill?.name == game.i18n.localize(\"NAME.Track\");","FMSN5uRskkATexzB":"game.wfrp4e.tables.rollToChat(\"crithead\")","fNUiKELi9e1vg7KY":"args.actor.removeCondition(\"fatigued\", 99);\r\nargs.actor.removeCondition(\"bleeding\", 99);","fP2edYbj6QjPPAjL":"return [\"Charm Animal\", \"Endurance\", \"Outdoor Survival\"].includes(args.skill?.name)","fPKYkBllp7Et62lX":"if (args.test.spell.name == \"Warp Lightning\")\r\n{\r\n args.test.preData.canReverse = true;\r\n}","FPQp6XfbUH1BMafj":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Athletics\"), {fields : {difficulty : \"vhard\"}, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n\tthis.actor.addCondition(\"prone\");\n this.script.scriptMessage(\"Kann sich in diesem Zug nicht bewegen oder handeln\");\n}","FPYNcxm21678boLT":"if (args.attackerTest.data.preData.rollClass !== \"CharacteristicTest\") return;\r\nif (args.attackerTest.data.preData.characteristic !== \"s\") return;\r\n\r\nconst SL = args.opposedTest.data.opposeResult.differenceSL;\r\n\r\nconst targetId = this.effect.getFlag(\"wfrp4e\", \"target\");\r\nconst target = canvas.scene.tokens.get(targetId);\r\n\r\nif (SL > 4) {\r\n args.opposedTest.data.opposeResult.other.push(`<b>${args.defenderTest.actor.name}</b> was forced to let go of <b>${target.name}</b>.`);\r\n return await this.effect.delete();\r\n}\r\n\r\nif (SL > 0) {\r\n args.opposedTest.data.opposeResult.other.push(`<b>${args.defenderTest.actor.name}</b> was prevented from squeezing <b>${target.name}</b> for one turn.`);\r\n let turns = this.effect.getFlag(\"wfrp4e\", \"turns\");\r\n this.effect.setFlag(\"wfrp4e\", \"turns\", turns + 1);\r\n}","fq2fqlWlrVfitkcB":"let characteristics = {\n \"ws\" : 0,\n \"bs\" : -200,\n \"s\" : 20,\n \"t\" : 20,\n \"i\" : 0,\n \"ag\" : -5,\n \"dex\" : -5,\n \"int\" : 0,\n \"wp\" : 0,\n \"fel\" : 0\n}\nlet traits = [ {name:\"Korrumpierend\"}, {name:\"Schmerzfrei\"}, {name:\"Blödheit\"}, {name:\"Schwarm\"}, {name:\"Tierhaft\", disabled : true}, {name:\"Regenerieren\", disabled : true}, {name:\"Größe\", value: \"Large\", disabled : true}, {name:\"Territorial\", disabled: true} ];\nlet items = [];\n\nlet updateObj = this.actor.toObject();\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let trait of traits)\n{\n let traitItem = await game.wfrp4e.utility.find(trait.name, \"trait\")\n if (traitItem)\n { \n let t = traitItem.toObject();\n t.system.specification.value = trait.value;\n if (trait.disabled)\n {\n t.system.disabled = true;\n }\n items.push(t);\n }\n else \n {\n ui.notifications.warn(`${trait.name} nicht gefunden`, {permanent : true})\n }\n}\n\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n","FqevMs0ukQ9WuUHl":"// Each time the blade is used, the GM should secretly roll a d10.\r\n// On a 1, its poison has run dry, \r\n// and the next time it is employed it will shatter.\r\n\r\nif (this.item.getFlag(\"wfrp4e\", \"brittle\"))\r\n{\r\n ChatMessage.create({content: `<strong>${this.item.name}</strong> shatters!`})\r\n this.item.update({name : `${this.item.name} (Shattered)`})\r\n}","fSDFCHAo97RLpwGU":"const hitLocation = args.test.hitloc.result\nconst hitLocationArmour = args.test.targets[0]?.armour[hitLocation]\n\nif (hitLocationArmour)\n{\n let qualities = [];\n for (let layer of hitLocationArmour.layers) \n {\n qualities = qualities.concat(layer.source.system.qualities.value);\n }\n\n qualities = new Set(qualities); // supprimer les doublons\n\n this.script.message(`Ignore ${Array.from(qualities).map(i => game.wfrp4e.config.armorQualities[i.name]).join(\", \")}`);\n}\n","FSqUqSByMiztYOQM":"if (args.totalWoundLoss > 0)\r\n this.script.scriptMessage(`<b>Infected: ${args.actor.name}</b> must pass an <b>Easy (+40) Endurance</b> Test or gain a @UUID[Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb]{Festering Wound}`, {whisper: ChatMessage.getWhisperRecipients(\"GM\") })","fSTjJIqg5tvbwxKt":"const uuid = \"Compendium.wfrp4e-core.items.Item.ahlxlfIl8xUhBkic\";\r\nconst item = await fromUuid(uuid);\r\nconst data = item.toObject();\r\ndata.name = this.effect.name;\r\ndata.system.equipped.value = true;\r\n\r\nconst effectData = this.effect.sourceItem.effects.find(e => e.disabled).toObject();\r\neffectData.disabled = false;\r\ndata.effects = [effectData];\r\n\r\nconst dagger = await this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id});","fsvXI7tuL69Ukmec":"if (args.item.type == \"skill\" && (args.item.name == \"Language (Magick)\" || args.item.name.includes(\"Channelling\")))\n{\n args.item.system.modifier.value -= Math.floor(args.item.system.advances.value / 2)\n}","ft0LaRWZT5WtnptP":"let advantage = this.actor.system.status.advantage.value;\r\nif (advantage > 0)\r\n{\r\n await this.actor.setAdvantage(0);\r\n this.script.scriptNotification(\"Advantage Subtracted\")\r\n}\r\nelse \r\n{\r\n return this.script.scriptNotification(\"Not enough Advantage!\", \"error\")\r\n}\r\n\r\nlet test = await this.actor.setupTrait(this.item, {fields : {slBonus : advantage}})\r\nawait test.roll();","FtSG8J2s95hhjUMn":"let roll = await new Roll(\"1d10\").roll();\nroll.toMessage(this.script.getChatData());\nthis.effect.updateSource({duration: {value: roll.total, units: \"hours\"}});","FttdVBQiNssDAARh":"return args.data.targets[0]?.actor?.hasCondition(\"entangled\")","fTw3mpSUOlkqVVUC":"this.actor.applyEffect({effectUuids : this.item.effects.contents[0].uuid})","FtZf56VI6Qsspu0D":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Carpenter)';\r\nconst difficulty = 'difficult';\r\nconst target = 20;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","Fu8DTvSgLufcB5mr":"async function rollTable(characteristics, formula, name) {\n const roll = new Roll(formula);\n await roll.toMessage({flavor: name});\n\n const values = roll.dice[0].values;\n\n for (const value of values) {\n let characteristic;\n switch (value) {\n case 1: case 2: characteristic = \"ws\"; break;\n case 3: case 4: characteristic = \"i\"; break;\n case 5: case 6: characteristic = \"int\"; break;\n case 7: case 8: characteristic = \"fel\"; break;\n case 9: case 10: characteristic = \"*\"; break;\n default: continue;\n }\n\n if (characteristics.has(characteristic)) {\n await rollTable(characteristics, \"1d10\", name);\n } else {\n characteristics.add(characteristic);\n }\n }\n}\n\nconst characteristics = new Set();\nawait rollTable(characteristics, \"2d10\", this.effect.name)\n\nif (characteristics.has(\"*\")) {\n characteristics.delete(\"*\");\n const availableChoices = foundry.utils.duplicate(game.wfrp4e.config.characteristics);\n\n for (const ch of characteristics) delete availableChoices[ch];\n\n const result = warhammer.apps.ValueDialog.create({\n text: \"Wähle ein Attribut\",\n }, \"\", availableChoices);\n\n if (!result) return;\n\n characteristics.add(result);\n}\n\nthis.effect.setFlag(\"wfrp4e\", \"characteristicsToSwap\", Array.from(characteristics));","fUD4gMdKe6P3sFdJ":"this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.Zh68gzYMLW8vZgVo\", this.effect)","FUgCtIoj1Stgqxt7":"return ![\"ws\", \"bs\", \"s\", \"ag\", \"t\", \"dex\"].includes(args.characteristic)","fve7tiyF5X9B7mHJ":"args.fields.slBonus -= 2;","Fvlc4RkeF4dHjW3m":"let caster = this.effect.sourceActor\r\nif (caster && (this.actor.has(game.i18n.localize(\"NAME.Undead\")) || this.actor.has(game.i18n.localize(\"NAME.Daemonic\")))) {\r\n let wp = caster.system.characteristics.wp.value\r\n if (wp > this.actor.system.characteristics.t.value) {\r\n if (this.actor.has(game.i18n.localize(\"NAME.Unstable\"))) {\r\n this.actor.update({ \"system.status.wounds.value\": 0 })\r\n this.actor.addCondition(\"dead\")\r\n }\r\n else {\r\n fromUuid(\"Compendium.wfrp4e-core.items.D0ImWEIMSDgElsnl\").then(item => {\r\n this.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], { fromEffect: this.effect.id })\r\n ChatMessage.create({ content: `Added Unstable to ${this.actor.prototypeToken.name}`, speaker: { alias: caster.name } })\r\n })\r\n }\r\n }\r\n}","fwiBeetIsvpXKtUc":"scatter = await game.wfrp4e.tables.rollTable(\"scatter\");\n\nif (scatter.roll == 9 || scatter.roll == 10)\n{\n this.script.message(`<strong>${scatter.roll}</strong>: Failed to Scatter`);\n}\nelse \n{\n this.script.message(scatter.result);\n}","Fwk8WA8NfRivLFWJ":"return args.skill?.name === \"Entertain (Singing)\";","fWNVINMVhEwf8k5b":"this.actor.addCondition(\"stunned\");\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {appendTitle: ` - ${this.effect.name}`, skipTargets: true, fields: {difficulty: \"vhard\"}});\n\nawait test.roll();\n\nif (test.failed)\n{\n this.actor.addCondition(\"prone\");\n}","FX8ILw0VgbNxkObA":"const uuid = \"Compendium.wfrp4e-core.items.Item.mCvZAj5F6hfUZhzR\";\r\nconst item = await fromUuid(uuid);\r\nconst data = item.toObject();\r\ndata.name = this.effect.name;\r\ndata.type = 'trapping';\r\ndata.system.trappingType = {value: 'clothingAccessories'};\r\ndata.system.equipped = {value: true};\r\n\r\nconst effectData = this.effect.sourceItem.effects.find(e => e.disabled).toObject();\r\neffectData.disabled = false;\r\neffectData.system.transferData.equipTransfer = true;\r\ndata.effects = [effectData];\r\n\r\nconst dagger = await this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id});","FXuyiJoXdAh6WhRK":"return args.skill?.name == \"Ride (Horse)\" && game.combat?.active","FXwfqF0jpXlBQ9Y3":"return args.item?.system?.isMelee && this.actor.attacker","fY0TsQwnU14fdPl2":"args.fields.modifier += 30;","fyjYWg7ekj8JJcmq":"if (args.test.result.misfire || args.test.result.fumble)\n{\n args.test.result.other.push(`<strong>${this.effect.name}</strong>: kann verwendet werden, um Patzer-/Fehlschlag-Effekte aufzuheben`)\n}","fYLSe6CrYciap5y8":" let characteristics = {\n \"ws\" : 0,\n \"bs\" : 0,\n \"s\" : 10,\n \"t\" : 10,\n \"i\" : 0,\n \"ag\" : 10,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 0,\n \"fel\" : 0\n }\n let skills = [\"Consume Alcohol\", \"Row\", \"Sail\", \"Swim\"]\n let skillAdvancements = [10, 10, 10, 10]\n let talents = []\n let trappings = []\n let items = []\n\n let updateObj = this.actor.toObject();\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let index = 0; index < skills.length; index++)\n {\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n }\n \n for (let trapping of trappings) \n {\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n \n equip(trappingItem)\n \n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n }","FYMLsxxg63nHNGAe":"this.actor.system.characteristics.int.modifier += 20;\nthis.actor.system.characteristics.int.calculationBonusModifier -= 2;\nthis.actor.system.characteristics.wp.modifier += 20;\nthis.actor.system.characteristics.wp.calculationBonusModifier -= 2;","FYUPfYyTYZkxRLFT":"return ![\"NAME.Endurance\", \"NAME.Cool\"].map(i => game.i18n.localize(i)).includes(args.skill?.name)","FZFOC7bip0oiWEzk":"if (args.opposedTest.result.hitloc.value == this.item.system.location.key && args.totalWoundLoss > 0)\r\n{\r\n args.actor.addCondition(\"bleeding\", 2);\r\n this.script.scriptNotification(\"Added Bleeding\")\r\n}","fzTB7t3x4bLmAXji":"let roll = await new Roll(\"1d10 + 1\").roll()\r\nawait roll.toMessage(this.script.getChatData());\r\nthis.script.scriptNotification(`Healed ${roll.total} Wounds`)\r\nthis.actor.corruptionDialog(\"moderate\")\r\nawait this.actor.modifyWounds(roll.total)","g07HI7vyqiFXPB0o":"// A Drinker must take a Difficult (-10) Endurance Test.\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"difficult\"}})\r\nawait test.roll()\r\n// If they fail, they acquire 2 Poisoned Conditions. \r\nif (test.failed) \r\n{\r\n this.actor.addCondition(\"poisoned\", 2)\r\n this.script.scriptMessage(`<p><strong>${this.actor.prototypeToken.name}</strong> has gained 2 @Condition[Poisoned] Conditions.</p>\r\n <p>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.</p>`, \r\n {\r\n whisper: ChatMessage.getWhisperRecipients(\"GM\"), \r\n blind: true \r\n })\r\n}\r\n // If they succeed, for a number of rounds equal to 3+ their SL, they have the Corrosive Blood Creature Trait.\r\nelse if (test.succeeded) \r\n{\r\n // Don't attempt to add Corrosive Blood if actor already has it\r\n const hasCorrosiveBlood = this.actor.has(\"Corrosive Blood\")\r\n if (hasCorrosiveBlood !== undefined) return \r\n\r\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.M5QSWOYt2Rbv2yxW\")\r\n let data = item.toObject()\r\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\r\n \r\n const duration = 3 + parseInt(test.result.SL)\r\n this.script.scriptMessage(`<p><strong>${this.actor.prototypeToken.name}</strong> gains the Corrosive Blood Trait for ${duration} rounds.</p>`, \r\n { whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true }) \r\n}","g0SzfsLyW7aD2F19":"if (this.item.system.tests.value.includes(\"(Social Group)\"))\r\n{\r\n let tests = this.item.system.tests.value\r\n let name = this.item.name\r\n\r\n // If name already specifies, make sure tests value reflects that\r\n if (name.includes(\"(\"))\r\n {\r\n let group = name.split(\"(\")[1].split(\")\")[0]\r\n tests = `${tests.split(\"(\")[0].trim()} (${group})`\r\n }\r\n else if (!name.includes(\"(\"))\r\n {\r\n let value = await ValueDialog.create(\"Enter Etiquette Group\", this.effect.name);\r\n if (value)\r\n {\r\n name = this.item.name + ` (${value})`;\r\n tests = this.item.system.tests.value.replace(\"Social Group\", value);\r\n }\r\n }\r\n this.item.updateSource({name, \"system.tests.value\" : tests})\r\n}","g1L8OYO9nCOhdKGL":"// Everything within Fellowship Bonus yards \r\n// of the target point is splashed with mystic poison, \r\n// suffering 1d10 + SL damage which ignores Armour Points\r\n\r\nlet damage = (await new Roll(`1d10 + ${parseInt(this.effect.sourceTest.result.SL)}`).roll())\r\n\r\nawait damage.toMessage(this.script.getChatData())\r\n\r\nthis.script.scriptMessage(await args.actor.applyBasicDamage(\r\n damage.total,\r\n {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}\r\n))\r\n\r\n// ... and gains the Poisoned Condition\r\n\r\nthis.actor.addCondition(\"poisoned\")","G1RletYc6BzigJrK":"let ablaze = parseInt(this.effect.sourceTest.result.SL) + 5\r\nargs.actor.addCondition(\"ablaze\", ablaze)","g4t56A09yrpZaJQ2":" let amberTalons = foundry.utils.deepClone(game.wfrp4e.config.systemItems.unarmed);\r\n amberTalons.name = \"Amber Talons\";\r\n amberTalons.img = this.effect.img;\r\n amberTalons.system.damage.value = \"SB + WPB\"\r\n amberTalons.system.equipped = true;\r\n amberTalons.system.qualities.value.push({name : \"magical\"})\r\n amberTalons.effects.push({\r\n label : \"Amber Talons\",\r\n transfer: false,\r\n icon : \"modules/wfrp4e-core/icons/spells/amber-talons.png\" ,\r\n flags : {\r\n wfrp4e : {\r\n applicationData : {\r\n documentType : \"Item\"\r\n },\r\n scriptData : [{\r\n trigger : \"applyDamage\",\r\n script : \"if (args.totalWoundLoss >= 1)\\n{ \\n args.actor.addCondition(\\\"bleeding\\\")\\n}\"\r\n }]\r\n }\r\n }\r\n })\r\n this.actor.createEmbeddedDocuments(\"Item\", [amberTalons], {fromEffect: this.effect.id})","g5y0tdoHCDs7cBy7":"return ![\"NAME.Endurance\", \"NAME.Cool\"].map(i => game.i18n.localize(i)).includes(args.skill?.name) \n || !this.actor.sameSideAs(this.effect.sourceActor)\n || this.actor.system.details.status.tier !== \"b\"","G7sFEnJlXZvfXL3V":"if (this.item.system.quantity.value)\r\n{\r\n\tthis.item.system.reduceQuantity();\r\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\r\n let effectData = this.item.effects.contents[1].convertToApplied();\r\n\teffectData.flags.wfrp4e.sourceItem = this.item.uuid\r\n\tactor.applyEffect({effectData : [effectData]})\r\n}\r\nelse\r\n{\r\n\tthis.script.scriptNotification(\"None left!\", \"error\")\r\n}","g8Tmet9Ii3NvFqvf":"this.actor.addCondition(\"bleeding\", 1 + this.actor.system.status.sin?.value || 0)","G9ZPojp8qdjiXKZ5":"if (!args.test.preData.options?.masterslayer) return\nif (!this.item.equipped.value || !args.test.item) return;\nargs.test.preData.canReverse = true","ga6bQzPuoIiQQrKg":"if (args.totalWoundLoss > 0)\r\n{\r\n \r\n let test = await args.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\r\n await test.roll()\r\n if (test.failed)\r\n {\r\n args.totalWoundLoss += this.effect.sourceActor.system.characteristics.wp.bonus\r\n args.modifiers.other.push({label : this.effect.name, value : this.effect.sourceActor.system.characteristics.wp.bonus})\r\n }\r\n}","GAO8AozttWOyRkta":"if (!args.flags.lostHand)\r\n{\r\n\targs.fields.lostHand = true;\r\n\targs.fields.modifier += -20;\r\n}","gbhxWXboV9CytWNU":"await this.actor.addCondition(\"blinded\", 2)","GbPEy22VuCNzlNv2":"return !this.actor.isMounted || (!args.skill?.name?.includes(game.i18n.localize(\"NAME.Ride\")) && !args.options.dodge)","Gc8S5TYlVdV8NnOT":"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\" } })\r\n\r\n await test.roll();\r\n\r\n if (!test.succeeded)\r\n {\r\n args.actor.addCondition(\"broken\");\r\n }","GcIQtshex11AMmh2":"if (this.item.system.isEquipped)\r\n{\r\n let removeRepeater = false\r\n if(!this.item.system.offhand.value) // main\r\n {\r\n let offhandUsed = this.actor.itemTypes.weapon.find(i => i.system.isEquipped && i.system.offhand.value)\r\n if (offhandUsed)\r\n {\r\n removeRepeater = true;\r\n }\r\n }\r\n else // offhand\r\n {\r\n let mainhandUsed = this.actor.itemTypes.weapon.find(i => i.system.isEquipped && !i.system.offhand.value)\r\n if (mainhandUsed)\r\n {\r\n removeRepeater = true;\r\n }\r\n }\r\n \r\n if (removeRepeater)\r\n {\r\n this.item.system.qualities.value = this.item.system.qualities.value.filter(i => i.name != \"repeater\")\r\n }\r\n}","GEfWIFBSrXt0ldBM":"(await new Roll(\"1d10\").roll()).toMessage(this.script.getChatData())\r\nawait this.actor.addCondition(\"dead\")","GePFbu5kp2ymGYEQ":"await this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.IAWyzDfC286a9MPz\", this.effect);","GFaTz8f6PBNWrlad":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure : `<strong>Confused</strong>: Determine behaviour by @Table[bewilder] Table.`}})\r\nawait test.roll();\r\nreturn test.failed","GFkVnx4m9OwYsKGH":"args.actor.flags.ambi+= 1","gFUXBbTskQBKjxqm":"if (this.actor.hasCondition(\"entangled\"))\r\n{\r\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty : \"average\"}}).then(async test => {\r\n await test.roll();\r\n if (test.failed)\r\n this.actor.addCondition(\"fatigued\") \r\n })\r\n}","gh2KS1prBKcsSK6M":"if (args.opposedTest.attackerTest.result.critical)\r\n args.actor.addCondition(\"ablaze\")","Gh7OidY6UdpWBS1g":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.KII1gWnxIZ8HzmU5\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","GjkxWj9wCAclM9WA":"let effects = foundry.utils.deepClone(this.item.effects.contents.filter(e => e.active));\r\n\r\neffects.splice(effects.length - 1);\r\n\r\nif (effects.length == 0)\r\n{\r\n return this.script.scriptNotification(\"All Effects have been used. Reset to select them again\")\r\n}\r\nlet choice = await ItemDialog.create(effects, 1, \"Choose Power to Gain\");\r\n\r\nif (choice[0])\r\n{\r\n choice[0].update({disabled : true})\r\n let effect = choice[0].convertToApplied();\r\n effect.name += ` (${this.effect.name})`\r\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [effect]);\r\n}","GjUD5L4h8FXGVgGQ":"args.initiative += \"+30\";","gKIPujyuFSn0No9v":"for(let e of this.item.effects.contents)\r\n{\r\n e.update({disabled: false})\r\n}\r\nthis.script.scriptNotification(\"Reset Powers\")","gKPL3t4vlZAsvtGr":"return args.skill?.name == \"Stealth (Underground)\"","gL0ftUnK5TNXBRRt":"return this.effect.sourceActor.uuid == args.actor.uuid","gMIenSmLklAkB2Zm":"if (isNaN(parseInt(this.item.system.specification.value)))\r\n{\r\n let value = await ValueDialog.create(\"Enter Venom Strength\", this.effect.name, \"\", Object.values(game.wfrp4e.config.difficultyNames));\r\n if (value)\r\n {\r\n this.item.updateSource({\"system.specification.value\" : value});\r\n }\r\n}","GNgMG95jfabBeIwy":"if (!this.item.system.qualities.value.find(i => i.name == \"fast\"))\n{\n this.item.system.qualities.value.push({name : \"fast\"}) \n}","GNl5Zk7BZ2jhRV1I":"if (args.item.type == \"armour\")\r\n{\r\n args.item.system.AP.head = 0;\r\n}","gnVpxOeBZpNF4HIF":"if (args.test.result.roll.toString().includes(\"9\") || args.test.result.roll.toString().includes(\"8\"))\r\n{\r\n args.test.result.fumble = game.i18n.localize(\"Fumble\")\r\n}","gOm8utR3HLQBT5hA":"let {value} = this.effect.getFlag(\"wfrp4e-soc\", \"m4result\") || {};\r\n\r\nif (value === 0)\r\n args.actor.system.status.mood.value = 0;\r\nelse if (value !== undefined)\r\n args.actor.system.status.mood.value += value;","GOq4TcnWbfyfCo2V":"this.script.scriptNotification(`Healed ${this.actor.characteristics.t.bonus * 2} Wounds`)\r\nawait this.actor.modifyWounds(this.actor.characteristics.t.bonus * 2)\r\n\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - Side Effects`,fields : {difficulty : \"difficult\"}})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n let roll = await new Roll(\"1d10\").roll();\r\n await roll.toMessage(this.script.getChatData())\r\n if (roll.total <= 3)\r\n {\r\n this.actor.addCondition(\"blinded\", 3)\r\n }\r\n else if (roll.total <= 6)\r\n {\r\n this.actor.addCondition(\"broken\");\r\n }\r\n else if (roll.total <= 9)\r\n {\r\n this.actor.addCondition(\"stunned\");\r\n }\r\n else if (roll.total == 10)\r\n {\r\n this.actor.addConditon(\"unconscious\")\r\n }\r\n}","goz8yTlMozlsz3uY":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Strength';\r\nconst difficulty = 'easy';\r\nconst target = 10;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","gpPaCe6yER79l4u8":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","gPQrszvIgGlW9yM4":"if (args.test.characteristicKey == \"wp\")\r\n args.test.preData.canReverse = true","gPt4hUnaNqE5rVYF":"if (args.test.isCriticalFumble && !args.test.spell)\n{\n\tif (parseInt(args.test.result.SL) > 0 || args.test.succeeded)\n\t{\n\t\tif (parseInt(args.test.result.SL) > 0)\n\t\t{\n\t\t\targs.test.result.SL = \"-0\";\n\t\t\targs.test.result.description = game.i18n.localize(\"ROLL.MarginalFailure\");\n\t\t}\n\t\targs.test.result.outcome = \"failure\"\n args.test.result.other.push(`<strong>${this.effect.name}</strong>: Automatic Failure`)\n\t}\n\n}","gpuBg3y9rocJL7yT":"this.actor.status.addArmour(1, {locations: [\"head\"], source: this.effect})","gQ610vjGKmowl0rj":"let data = this.effect.getFlag(\"wfrp4e\", \"handOfGlory\");\nlet changes = [];\n\nif (!data)\n{\n return;\n}\n\nfor(let characteristic of [\"ws\", \"bs\", \"s\", \"t\", \"i\", \"ag\"])\n{\n\n let currentTotal = this.actor.system.characteristics[characteristic].value;\n let newTotal = this.actor.system.characteristics[characteristic].value + data.roll;\n let bonusOffset = Math.floor(currentTotal / 10) - Math.floor(newTotal / 10); // e.g. 37 + 15 bonus = 52, calculation bonus modifier should be -2\n\n changes = changes.concat({\n key: `system.characteristics.${characteristic}.modifier`,\n mode: 2,\n value: data.roll\n }, \n {\n key: `system.characteristics.${characteristic}.calculationBonusModifier`,\n mode: 2,\n value: bonusOffset\n })\n}\n\nchanges.push({key: \"system.details.move.value\", mode: 2, value: 2});\n\n \nthis.effect.updateSource({changes});","gQJJaxbN83KSgi36":"if (!args.totalWoundLoss) return\n\nconst roll = await new Roll(\"2d10\").roll();\nroll.toMessage(this.script.getChatData());\n\nargs.attacker.applyBasicDamage(Number(roll.total), { loc: \"roll\" })","gqZLfIr6svrtdwdC":"return args.skill?.name != game.i18n.localize(\"NAME.SleightOfHand\") && args.skill?.name != game.i18n.localize(\"NAME.MeleeBrawling\") && args.weapon?.system?.weaponGroup?.value != \"brawling\"","GrF6tQ08jgKmUH4i":"return ![\"ws\", \"bs\", \"s\", \"ag\", \"i\"].includes(args.characteristic)","GRfCxtYzmEx2LYU7":"if (args.totalWoundLoss >= 1)\r\n{\r\n let roll = await new Roll(\"1d10\").roll();\r\n await roll.toMessage(this.script.getChatData());\r\n if (roll.total == 9)\r\n {\r\n 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\")})\r\n }\r\n}","groEX1wJ9l00PkDF":"let turns = this.effect.getFlag(\"wfrp4e\", \"turns\");\r\nif (turns <= 0) return;\r\nturns--;\r\n\r\nconst speaker = ChatMessage.getSpeaker({actor: this.actor});\r\nconst targetId = this.effect.getFlag(\"wfrp4e\", \"target\");\r\nconst target = canvas.scene.tokens.get(targetId);\r\n\r\nif (turns > 0) {\r\n this.effect.setFlag(\"wfrp4e\", \"turns\", turns);\r\n\r\n return this.script.scriptMessage(`<p><b>${speaker.alias}</b> continues wrapping itself around <b>${target.name}</b>. It will be able to start crushin in ${turns} turns.</p>`);\r\n}\r\n\r\nif (this.actor.items.find(i => i.type === \"extendedTest\" && i.name === this.effect.name)) {\r\n this.script.scriptMessage(`<p><b>${speaker.alias}</b> can resume crushing <b>${target.name}</b> with the Extended Test.</p>`);\r\n\r\n return;\r\n}\r\n\r\nconst extendedTestData = {\r\n name: this.effect.name,\r\n type: \"extendedTest\",\r\n img: this.effect.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target.actor.system.status.wounds.value\r\n },\r\n test: {\r\n value: 'Strength'\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: \"challenging\"\r\n }\r\n }\r\n};\r\n\r\nconst extendedTests = await this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\nconst extendedTest = extendedTests[0];\r\n\r\nthis.script.scriptMessage(`<p><b>${speaker.alias}</b> finished wrapping itself around <b>${target.name}</b>. It can now begin crushing via the @UUID[${extendedTest.uuid}] Extended Test.</p>`);\r\n\r\nlet effect = {\r\n name: extendedTest.name,\r\n icon: extendedTest.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: extendedTest.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.effects.find(e => e.id === id);\r\n const speaker = ChatMessage.getSpeaker({actor: this.actor});\r\n const targetId = effect.getFlag(\"wfrp4e\", \"target\");\r\n const target = canvas.scene.tokens.get(targetId);\r\n this.script.scriptMessage(\\`<p><b>${speaker.alias}</b> crushed the <b>${target.name}</b>. Boat shatters, reduced to a mass of flotsam.</p>\\`);\r\n await effect.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n}\r\n\r\nawait extendedTests[0].createEmbeddedDocuments(\"ActiveEffect\", [effect]);","GsAyB5xnK3ASeoah":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Carpentry)';\r\nconst difficulty = 'easy';\r\nconst target = 20;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","gsCnd3mf1vXFU2ei":"this.actor.system.status.ward.value = 4;","gSDhsSB8573joL64":"if (args.equipped) {\n const spell = await game.wfrp4e.utility.findItem(\"Vindictive Glare\", \"spell\");\n const skillUUID = \"Compendium.wfrp4e-core.items.Item.e3McIND4Rrsn5cE6\";\n\n await this.actor.addEffectItems([skillUUID, spell.uuid], this.effect, [{\n \"system.advances.value\": 75 - this.actor.system.characteristics.int.value\n}, {}]);\n} else {\n this.effect.deleteCreatedItems();\n}","Gsilp71BmIyHHce6":"args.context.masterslayer = true","GtfHQA9T1ip463le":"return ![\"ws\", \"bs\"].includes(args.characteristic)","GTZUO73pUJKpM1JB":" let roll = await new Roll(\"1d10\").roll();\r\n game.dice3d?.showForRoll(roll);\r\n this.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}))\r\n","gu72JaTs9GrSiVTd":"return !(args.skill?.name == game.i18n.localize(\"NAME.Haggle\") || args.skill?.name == game.i18n.localize(\"NAME.Gossip\"))","GUkpYdPwoC5pc9BT":"return !args.weapon?.system.properties.flaws.crewed","gull3qgCahzk2xYu":"this.actor.addCondition(\"fatigued\", parseInt(this.effect.sourceTest.result.SL))\n\nlet test = await this.actor.setupSkill(\"Calme\", {fields : {difficulty: \"challenging\"}, appendTitle : ` - ${this.effect.name}`});\n\nawait test.roll();\n\nif (test.failed)\n{\n\tthis.actor.addCondition(\"broken\");\n}","GuSIY4Zqhc68qVEH":"if (!args.messageSent)\n{ \n args.messageSent = true;\n let runes = this.item.effects.contents.filter(i => i.name == this.effect.name);\n this.script.message(`<strong>${args.attacker.speaker.alias}</strong> reduce Run speed by ${runes.length * 4} yds.`)\n}","GuUCErVbk5hrFzR3":"args.multiplier.tb += 1","GuxbvztcvzJz2oH1":"args.item.system.qualities.value = [];","gVpFUka7qfGiEC1v":" this.actor.getActiveTokens().forEach(t => t.document.update({texture : {tint : \"#FFD700\"}}));\r\n","gxuBeGHwjZ7WfPeu":"let specification = Number(this.item.specification.value) || 1;\r\nargs.fields.slBonus -= specification;","GYhPhHIVrhx4pkgF":"if (args.combat.combatant.actor.uuid === this.effect.sourceItem.parent.uuid) \n{\n this.effect.delete();\n}","GZFsuynUhgZqwTGo":"if (args.totalWoundLoss >= 1)\r\n{\r\n 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\" }})\r\n await test.roll();\r\n if (test.failed)\r\n {\r\n args.actor.addCondition(\"poisoned\");\r\n }\r\n}\r\n ","GzSFlqL1YrIK1dxh":"let items = await Promise.all([\"Compendium.wfrp4e-wom.items.Item.EjGYZ4CgX2jZW7Ot\",\r\n\"Compendium.wfrp4e-wom.items.Item.O2v9RQiFf0obskP5\",\r\n\"Compendium.wfrp4e-wom.items.Item.2cv6hhZ57iV6z5Il\",\r\n\"Compendium.wfrp4e-wom.items.Item.YgDEUO0G0XcqQJqg\",\r\n\"Compendium.wfrp4e-wom.items.Item.J6K5TPxI8qIGQKKH\",\r\n\"Compendium.wfrp4e-wom.items.Item.K9FPtiDLwTkC7FuO\",\r\n\"Compendium.wfrp4e-wom.items.Item.CkMYRYCLrkMnyVm5\",\r\n\"Compendium.wfrp4e-wom.items.Item.0Xdm4r7l2EwC4fcg\"].map(fromUuid));\r\n\r\nlet choice = await game.wfrp4e.apps.ItemDialog.create(items, 1, \"Select Wind\")\r\n//this.actor.createEmbeddedDocuments(\"Item\", items);\r\n\r\nthis.item.update(choice[0]?.toObject(), {diff: false, recursive : false});\r\n\r\n//this.actor.items.getName(this.effect.item.name).delete() // For some reason this.effect.item.delete() throws an error\r\n\r\n","GzsuEg7gZy1f0ljy":"let bleeding = this.actor.hasCondition(\"bleeding\")\r\nif (bleeding)\r\n{\r\n this.script.scriptNotification(`Cleared ${bleeding.conditionValue} Bleeding Conditions`)\r\n bleeding.delete(); \r\n}\r\nelse \r\n{\r\n this.script.scriptNotification(`No Bleeding Conditions`)\r\n}","H06Ysj7oPiemW7S6":"if (args.test.options.income && !args.test.options.criminal)\r\n{\r\n args.test.options.criminal = true;\r\n let currentCareer = args.test.actor.system.currentCareer;\r\n 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)\r\n 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)\r\n 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)\r\n dieAmount = parseInt(dieAmount[0]) * this.item.system.Advances; // Multilpy that first letter by your standing (Brass 4 = 8d10 pennies)\r\n if (coin != \"g\") // Don't roll for gold, just use standing value\r\n {\r\n dieAmount = dieAmount + \"d10\";\r\n }\r\n let moneyEarned = (await new Roll(dieAmount.toString()).roll()).total;\r\n let moneyString = `${moneyEarned}${coin}`\r\n let transactionString = `${moneyEarned}${term}`\r\n\r\n this.script.scriptMessage(`<a class=\"money-drag\" data-amt=\"${moneyString}\"><strong>Earned an additional ${game.wfrp4e.market.amountToString(game.wfrp4e.market.parseMoneyTransactionString(transactionString))}</strong></a>`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n}","h0DfPwUUOBjyAHMZ":"return args.skill?.name != game.i18n.localize(\"NAME.Perception\");","h1XKoMuVnS0bagRO":"return args.item?.name != game.i18n.localize(\"NAME.Endurance\");","H1z3nWW7Rj3Oisxy":"return args.type != \"channelling\"","H2CJvApKMnfGNNoo":" if (args.test.item?.type == \"skill\" && args.test.item.name.includes(game.i18n.localize(\"NAME.Stealth\")))\r\n{ \r\n args.test.result.description = \"Astounding Failure\";\r\n args.test.result.outcome = \"failure\";\r\n ChatMessage.create({content : \"<em>SQUEAK</em>\", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true})\r\n AudioHelper.play({ src: `${game.settings.get(\"wfrp4e\", \"soundPath\")}squeek.wav` }, true);\r\n}","h2GSoiCQ2ZSlTjf7":"const uuid = \"Compendium.wfrp4e-core.items.Item.JQa5DLnTs2SEzRrc\";\r\nconst item = await fromUuid(uuid);\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id});","H3pZ9UeIzIz3luKh":"args.actor.addCondition(\"bleeding\")\r\n\r\nthis.actor.setFlag(\"wfrp4e\", \"isAttached\", args.actor.name)\r\n\r\nthis.script.scriptMessage(`Attaches to <strong>${args.actor.name}</strong>`)","H3Wls12aVWAWTp9J":"this.actor.setupCharacteristic(\"i\", {skipTargets: true, appendTitle : \" - \" + this.effect.name}).then(test => {\r\n test.roll();\r\n})","h4lnexDYAhyQuiR5":"if (args.test.isCritical && args.test.weapon.properties?.qualities?.impale) {\n let targets = args.test.targets.filter(t => t.system.details.move.value > 1);\n if (targets.length > 0) {\n targets.forEach(target => {\n target.applyEffect({effectData : [this.item.effects.contents[1].convertToApplied()]})\n });\n args.test.result.other.push (`<strong>${this.effect.name}:</strong> Target Move Reduced by 1`)\n }\n}","h766UvswLCsxcMow":"let characteristics = {\n \"ws\" : 5,\n \"bs\" : 0,\n \"s\" : -15,\n \"t\" : 0,\n \"i\" : 20,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 5,\n \"wp\" : 10,\n \"fel\" : 10\n}\nlet skills = [\"Charm\", \"Intimidate\", \"Melee (Basic)\"]\nlet skillAdvancements = [7, 60, 7]\nlet talents = [\"Menacing\", \"Shadow\"]\nlet traits = [\"Distracting\"]\nlet trappings = []\nlet items = [];\nlet spells = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nconst traitRegex = /(?:,?(.+?)(\\+?\\d{1,2}\\+?)?\\s*?(?:\\((.+?)\\)\\s*(\\+?\\d{1,2})?|,|$))/gm\nfor (let trait of traits)\n{\n let traitMatches = trait.matchAll(traitRegex).next().value\n let traitName = traitMatches[1]\n let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there's a specialization\n let traitSpec = traitMatches[3]\n\n let traitItem;\n try {\n traitItem = await WFRP_Utility.findItem(traitName, \"trait\")\n }\n catch { }\n if (!traitItem) {\n ui.notifications.warn(`${trait} nicht gefunden`, {permanent : true})\n }\n traitItem = traitItem.toObject()\n\n if (Number.isNumeric(traitVal))\n {\n traitItem.system.specification.value = traitName.includes('Weapon','Horns','Tail','Tentacles','Bite') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal;\n traitItem.name = (traitItem.name + ` ${traitSpec ? \"(\"+ traitSpec + \")\" : \"\"}`).trim()\n }\n else \n traitItem.system.specification.value = traitSpec\n\n items.push(traitItem)\n\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let spell of spells) \n{\n let spellItem = await game.wfrp4e.utility.findItem(spell)\n if (spellItem)\n {\n spellItem = spellItem.toObject()\n\n items.push(spellItem);\n }\n else \n {\n ui.notifications.warn(`${spell} nicht gefunden`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.worn = true\n else if (item.type == \"weapon\")\n item.equipped = true\n else if (item.type == \"trapping\" && item.trappingType?.value == \"clothingAccessories\")\n item.worn = true\n}","H7BFq8m8vnkm4Yux":"let skill = this.actor.itemTypes.skill.find(s => s.name === game.i18n.localize(\"NAME.Pray\"));\nskill.system.modifier.value -= 10;","H7lcCU24gFDp7zK7":"let amount = this.effect.sourceTest.result.baseSL;\r\nargs.fields.successBonus += amount;","H85k4L3yICm7cfIk":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Sail';\r\nconst difficulty = 'easy';\r\nconst target = 10;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","H8jDtK1Ewn4hL3A1":"args.fields.slBonus += 4;","h8JqPMh2mM2uhpxk":"if (args.item.system.tags.has(\"armour\"))\n{\n \nfor(let key in args.item.system.AP)\n{\n if (args.item.system.AP[key])\n {\n args.item.system.AP[key] += 2;\n }\n }\n}","hA8PzeiCsHqqlUZm":"this.actor.createEmbeddedDocuments(\"ActiveEffect\", [game.wfrp4e.config.symptomEffects[\"nausea\"]])\r\nthis.script.scriptMessage(`Gains @Condition[Nausea] for [[1d10]] hours`, {whisper: ChatMessage.getWhisperRecipients(\"GM\")})","hadXFC43VKyrE9jC":"this.actor.addEffectItems([\"Compendium.wfrp4e-core.items.Item.eowbsW6oHGSNJmxV\", \"Compendium.wfrp4e-core.items.Item.eowbsW6oHGSNJmxV\"], this.effect);","HASsi6wYHVALExWq":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context: { failure: \"1 Corruption Point Gained\" } })\r\nawait test.roll();\r\n\r\nif (test.failed && args.actor.type == \"character\") \r\n{\r\n let msg = \"\"\r\n msg += `<p><b>${this.actor.prototypeToken.name}</b> gained a Corruption point</p>`\r\n if (test.result.roll % 11 == 0 || test.result.roll == 100)\r\n {\r\n msg += `<b>${args.actor.prototypeToken.name}</b> gains a mutation (@Table[expandedmutatephys]{Physical} or @Table[expandedmutatemental]{Mental}) and gains @UUID[Compendium.wfrp4e-core.items.hiU7vhBOVpVI8c7C]{Chaos Magic (Tzeentch)}`\r\n }\r\n this.script.scriptMessage(msg, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n await this.actor.update({ \"system.status.corruption.value\": parseInt(args.actor.status.corruption.value) + 1 })\r\n}","Hcpn1gU58DIKIhty":"if (args.item.type == \"skill\" && args.item.name == \"Melee (Flail)\")\r\n{\r\n args.item.system.modifier.value += 10;\r\n}","hcUCeoIFwWPKa5K1":"let fatigued = this.actor.hasCondition(\"fatigued\");\n if (fatigued)\n {\n foundry.utils.setProperty(fatigued, \"flags.wfrp4e.scriptData\", foundry.utils.getProperty(fatigued, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\n }\n \n if (!this.item.system.properties.qualities.unbreakable) this.item.system.qualities.value.push({name : 'unbreakable'})","hCzxUyO6mjLNIpaM":"let woundsGained = Math.min(args.totalWoundLoss, args.actor.status.wounds.value)\r\n\r\nwoundsGained = Math.floor(woundsGained / 2)\r\n\r\nargs.attacker.update({ \"system.status.wounds.value\": args.attacker.status.wounds.value + woundsGained })\r\n\r\nthis.script.scriptMessage(`Gains ${woundsGained} Wounds`)","hDC6lroDEPVBituR":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\n\r\nif (test.failed)\r\n{\r\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\r\n this.script.scriptMessage(\"Gained a Corruption point\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n if (test.result.roll % 11 == 0 || test.result.roll == 100)\r\n {\r\n this.script.scriptMessage(`<strong>Fumble</strong>: immediately gain 1 @Table[mutatemental]{Mental Mutation}, and may not take a Short-term Ambition for the next [[1d10]] weeks.`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n }\r\n}","HdTuY2IGhdlMDOy3":"if (this.actor.system.details.experience.current < 100) {\r\n return this.script.notification(game.i18n.localize(\"SCRIPT.NotEnoughXP\"))\r\n}\r\n\r\nlet item = await game.wfrp4e.utility.findItem(\"Animal Telepathy\", \"trait\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item]);\r\nlet expLog = foundry.utils.duplicate(this.actor.details.experience.log || []);\r\nexpLog.push({amount : 100, reason: item.name, spent: this.actor.details.experience.spent + 100, total: this.actor.details.experience.total, type: \"spent\"});\r\nthis.actor.update({\r\n \"system.details.experience.spent\": this.actor.details.experience.spent + 100,\r\n \"system.details.experience.log\": expLog\r\n });","hEDuYAgc1O1zG3Rr":"return args.targets[0].actor.appliedEffects.filter(e => e.name == game.i18n.localize(\"Flying\")).length > 0","HfCxNd7mFGZH4s9Y":"// An opponent that takes more than a single Wound from a Warp Blade strike \r\n// in melee combat must make an Average (+20) Endurance Test \r\n// or take a Stunned Condition\r\n\r\n\r\nif (args.totalWoundLoss > 1) {\r\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\n await test.roll();\r\n if(test.failed)\r\n {\r\n await args.actor.addCondition(\"stunned\");\r\n }\r\n}","hfFGFWEKFZXtMKWo":"let corruption = await new Roll(\"1d10\").roll();\ncorruption.toMessage(this.script.getChatData());\n\nthis.actor.addCondition(\"stunned\", corruption.total);\n\nthis.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.system.status.corruption.value) + corruption.total});\nthis.script.notification(\"Korruption hinzugefügt\");","hfO4INH3EeETDTFt":"this.actor.status.addArmour(1, {locations: this.effect.flags.wfrp4e.locations, source: this.effect})","HfZAQWoY8n3clLlo":"if (!args.itemCreated) return;\r\nif (args.itemCreated.type !== \"critical\") return;\r\nif (args.itemCreated.system.location.value.toLowerCase() !== \"head\") return;\r\nif (Number(args.itemCreated.system.wounds.value) > 0) {\r\n this.script.message(game.i18n.format(\"SCRIPT.Sallet\", {name: args.itemCreated.parent.name, wounds: args.itemCreated.system.wounds.value}))\r\n}","HG2fKOfruT5QV3A4":"let lore = await ValueDialog.create({text : \"Choisissez un Savoir\", title : \"Savoir\"}, \"\", {\"fire\" : \"Fire\", \"death\" : \"Death\", \"metal\" : \"Metal\", \"shadow\" : \"Discret\"});\n\nlet filters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"system.lore.value\",\n value : \"petty\"\n }\n]\n\nlet petty = await ItemDialog.createFromFilters(filters, 3, {text: \"Choisissez 3 Sorts Mineurs\"})\n\n\nfilters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"system.lore.value\",\n value : [\"\"]\n }\n]\n\nlet arcane = await ItemDialog.createFromFilters(filters, 6, {text: \"Choisissez 6 Sorts d'Arcane\"})\n\nlet items = petty.map(i => i.toObject()).concat(arcane.map(i => {\n let spell = i.toObject();\n spell.img = `modules/wfrp4e-core/icons/spells/${lore}.png`\n spell.system.lore.value = lore;\n return spell;\n}));\n\nthis.actor.createEmbeddedDocuments(\"Item\", items);","hg89FU1NAp8tIsgO":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Trade\"))","HGVGO217uW1k5YDh":"args.fields.slBonus -= 4;","HgzIi6m6dkXbVWHp":"if (args.test.skill?.name == \"Calme\")\n{\n args.test.preData.roll = 1;\n args.test.preData.other.push(this.effect.name)\n}","hhCs5VBKx50S5IsY":"return !args.options.mutate","hhv7PrRdlf9sfC82":"let characteristics = {\n \"ws\" : 5,\n \"bs\" : 0,\n \"s\" : 5,\n \"t\" : 5,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 0,\n \"fel\" : 0\n }\n let skills = [\"Cool\", \"Dodge\"]\n let skillAdvancements = [10, 10]\n let talents = [\"Combat Reflexes\"]\n let trappings = [\"Leather Jack\", \"Leather Skullcap\", \"Leather Leggings\", \"Shield\"]\n let items = []\n\n let updateObj = this.actor.toObject();\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let index = 0; index < skills.length; index++)\n {\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n }\n \n for (let trapping of trappings) \n {\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n \n equip(trappingItem)\n \n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n }","Hi005w1Ul17Q8Uty":"let test = this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty : \"average\"}, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.succeeded)\n{\n\tthis.effect.delete()\n}","HiDcm1jhG3sU39ME":"this.actor.addCondition(\"ablaze\");\nlet colors = {\n fire : \"#b22222\",\n heavens : \"#87ceeb\",\n metal : \"#ee9b3a\",\n shadow : \"#808080\",\n life : \"#008000\",\n beasts : \"#a52a2a\",\n light : \"#f0ffff\",\n death : \"#800080\",\n necromancy : \"#800080\",\n daemonology : \"#8b0000\"\n};\n\nlet spell = this.actor.itemTypes.spell.find(i => Object.keys(colors).includes(i.system.lore.value[0]));\n\nlet color;\nif (spell)\n{\n color = colors[spell.system.lore.value[0]];\n}\nelse \n{\n color = Object.values(colors)[Math.ceil(CONFIG.Dice.randomUniform() * 10)];\n}\n\nthis.effect.updateSource({changes: this.effect.changes.concat({key: \"token.light.color\", type: \"override\", value: color})});","HiMBS6GeOwEydWYN":"return args.skill?.name != game.i18n.localize(\"NAME.Climb\");","HJ2X4ZtXei0BXbxf":" let choices = await Promise.all([game.wfrp4e.utility.findItemId(\"PzimjNx9Ojq4g6mV\"), game.wfrp4e.utility.findItemId(\"rOPmyLWa37e7s9v6\")])\r\n let items = await game.wfrp4e.apps.ItemDialog.create(choices, 1, \"Choose a Skill\")\r\n\r\n items = items.map(i => i.toObject())\r\n items.forEach(i => i.system.advances.value = 20)\r\n\r\nitems.forEach(i => equip(i))\r\n\r\nthis.actor.createEmbeddedDocuments(\"Item\", items);\r\n\r\nfunction equip(item)\r\n{\r\n if (item.type == \"armour\")\r\n item.data.worn.value = true\r\n else if (item.type == \"weapon\")\r\n item.data.equipped = true\r\n else if (item.type == \"trapping\" && item.data.trappingType.value == \"clothingAccessories\")\r\n item.data.worn = true\r\n}","hj7tI212neKIu9dh":"this.actor.system.status.ward.value = 7;","hK0YMJfYbpbJZizO":"this.actor.getActiveTokens().forEach(t => t.document.update({light : {\r\n \"dim\": 0,\r\n \"bright\": 0,\r\n \"angle\": 360,\r\n \"alpha\": 0.5,\r\n \"animation\": {\r\n \"speed\": 0,\r\n \"intensity\": 0,\r\n \"type\": \"none\",\r\n },\r\n \"color\": \"\",\r\n }}));","HKhyn0kijKfzW6cw":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}})\r\nawait test.roll();\r\nthis.item.updateSource({\"flags.wfrp4e.passed\" : test.succeeded})","hL3JUSY3xMA4zj2Q":"if (this.sourceActor.uuid === this.actor.uuid) return;\n\nconst test = await this.actor.setupCharacteristic(\"t\", {\n skipTargets: true,\n appendTitle: ` — ${this.effect.name}`,\n fields: {\n difficulty: \"difficult\"\n },\n context: {\n success: \"Ist in der Lage, wieder aufzustehen!\",\n failure: \"Ist zu Boden gefallen!\",\n }\n});\n\nawait test.roll();\nif (test.failure) {\n await this.actor.addCondition(\"prone\");\n}","hlHKeFWrOA8CsLr9":"args.data.canReverse = true;\r\nargs.options.pilot = true;","hluehsCuBZYc1Ejt":"return args.characterisic != \"fel\"","HMC6hPND9DWLFfZE":"if (this.item.name.includes(\"(\"))\r\n{\r\n\treturn;\r\n}\r\n\r\nlet index = game.packs\r\n.filter(i => i.metadata.type == \"Item\")\r\n.reduce((acc, pack) => acc.concat(pack.index.contents), [])\r\n.filter(i => i.type == \"skill\" && i.name.includes(game.i18n.localize(\"NAME.Lore\")))\r\n.map(i => {\r\n\ti.id = i._id\r\n\treturn i\r\n})\r\n\r\nlet choice = await ItemDialog.create(index, 1, \"Choose a Lore\")\r\nlet text;\r\nif (!choice[0])\r\n{\r\n let custom = await Dialog.wait({\r\n title : \"Enter Lore\",\r\n content : \"<input type='text'>\",\r\n buttons : {\r\n confirm : {\r\n label : game.i18n.localize(\"Confirm\"),\r\n callback : (dlg) => {\r\n return dlg.find(\"input\")[0].value\r\n }\r\n }\r\n },\r\n default : \"confirm\",\r\n close : () => {\r\n return \"\"\r\n }\r\n }) \r\n text = custom || \"\"\r\n}\r\nelse \r\n{\r\n text = game.wfrp4e.utility.extractParenthesesText(choice[0].name)\r\n}\r\n\r\nawait this.item.updateSource({name : this.item.name + ` (${text})`, \"system.tests.value\" : this.item.system.tests.value.replace(\"chosen Lore\", text)})\r\nawait this.effect.updateSource({name : this.effect.name + ` (${text})`})","HmImVzvw6ecBy99l":"if (args.opposedTest.result.hitloc.value == \"body\" && args.totalWoundLoss > 0) \r\n{\r\n args.actor.addCondition(\"bleeding\", 2)\r\n this.script.scriptNotification(\"Added Bleeding\")\r\n}","hmk8zV1LTElHUI8A":"let msg = `<b>${this.actor.prototypeToken.name}</b> loses 1 Wound.<br>`\r\n if (this.actor.status.wounds.value <= 1)\r\n {\r\n msg += `<b>${this.actor.prototypeToken.name}</b> goes unconscious.<br>`\r\n await this.actor.addCondition(\"unconscious\")\r\n }\r\n this.script.scriptMessage(msg)\r\n this.actor.modifyWounds(-1)","hnsmzvcuiUYB065I":"this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {appendTitle: ` - ${this.effect.name}`, context: { failure : \"May not flee Combat\"}}).then(test => test.roll())","hO2CFW9hygGSYuJ2":"return args.target?.Species == this.effect.specifier;","hObTbWi4ZdwXimIW":"if (args.item.type == \"spell\")\r\n{\r\n args.item.system.cn.value = Math.floor(args.item.system.cn.value / 2);\r\n}","hOgha3ir8K9TVphO":"return args.characteristic !== \"fel\";","HoNTnPphrJISSQr1":"ChatMessage.create({content : \"<em>Speak and be known to me</em>\", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true})","HOt2hHOiHDZ7oBgW":"if ([\"rLeg\", \"lLeg\"].includes(this.effect.getFlag(\"wfrp4e\", \"location\")))\r\n{\r\n\targs.actor.details.move.value /= 2\r\n}\r\n","hpBjbxWg0qLlwX2K":"let lores = [\n {id: \"beasts\", name: \"Ghur\", table: \"ghur-marks\", img: \"modules/wfrp4e-core/icons/spells/beasts.png\"},\n {id: \"death\", name: \"Shyish\", table: \"shyish-marks\", img: \"modules/wfrp4e-core/icons/spells/death.png\"},\n {id: \"fire\", name: \"Aqshy\", table: \"aqshy-marks\", img: \"modules/wfrp4e-core/icons/spells/fire.png\"},\n {id: \"heavens\", name: \"Azyr\", table: \"azyr-marks\", img: \"modules/wfrp4e-core/icons/spells/heavens.png\"},\n {id: \"life\", name: \"Ghyran\", table: \"ghyran-marks\", img: \"modules/wfrp4e-core/icons/spells/life.png\"},\n {id: \"light\", name: \"Hysh\", table: \"hysh-marks\", img: \"modules/wfrp4e-core/icons/spells/light.png\"},\n {id: \"metal\", name: \"Chamon\", table: \"chamon-marks\", img: \"modules/wfrp4e-core/icons/spells/metal.png\"},\n {id: \"shadow\", name: \"Ulgu\", table: \"ulgu-marks\", img: \"modules/wfrp4e-core/icons/spells/shadow.png\"},\n];\n\nlet ownedLores = this.actor.itemTypes.spell.reduce((owned, spell) => owned.concat(spell.system.lore.value.filter(l => lores.map(i => i.id).includes(l))), []);\n\nif (ownedLores.length != 0)\n{\n lores = lores.filter(i => ownedLores.includes(i.id));\n}\n\nlet chosen = await ItemDialog.create(lores, 1, {text: \"Select Arcane Mark Table\", title: this.effect.name})\n\nif (chosen[0])\n{\n game.wfrp4e.tables.formatChatRoll(chosen[0].table, {showRoll: true});\n}","hpbraeEbjkXnmD75":"args.fields.hitLocation = \"lLeg\"\nargs.fields.modifier += 20;","hpwJRAhCsXTp9bd9":"let choice1 = [\n {\n type : \"skill\",\n name : \"Melee (Basic)\",\n diff : {\n system : {\n advances : {\n value : 20\n }\n }\n }\n }\n]\nlet choice2 = [\n {\n type : \"skill\",\n name : \"Melee (Polearm)\",\n diff : {\n system : {\n advances : {\n value : 20\n }\n }\n }\n }\n]\n\nlet choice3 = [\n {\n type : \"skill\",\n name : \"Melee (Two-Handed)\",\n diff : {\n system : {\n advances : {\n value : 20\n }\n }\n }\n }\n]\n\nlet choice = await Dialog.wait({\n title : \"Choice\",\n content : \n `<p>\n Select your choice\n </p>\n <ol>\n <li>Melee (Basic)</li>\n <li>Melee (Polearm)</li>\n <li>Melee (Two-Handed)</li>\n </ol> \n `,\n buttons : {\n 1 : {\n label : \"Basic\",\n callback : () => {\n return choice1\n }\n },\n 2 : {\n label : \"Polearm\",\n callback : () => {\n return choice2\n }\n },\n 3 : {\n label : \"Two-Handed\",\n callback : () => {\n return choice3\n }\n }\n }\n})\n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","Hq1G30lhJYvtOSNb":" \r\n if (args.test.failed)\r\n {\r\n let applicableCharacteristics = [\"ws\", \"bs\", \"s\", \"fel\", \"ag\", \"t\", \"dex\"];\r\n if (applicableCharacteristics.includes(args.preData.characteristic))\r\n {\r\n this.actor.addCondition(\"stunned\");\r\n }\r\n }","hqMwzPozAVTzoCxa":"if ((args.test.result.roll % 11 == 0 || args.test.result.roll == 100) && args.test.failed)\n{\n delete args.test.result.misfire;\n args.test.result.tables.misfire = {\n label : \"Fehlzündung\",\n class : \"fumble-roll\",\n modifier : 0,\n key : \"torpedo\"\n }\n}","hR1qD2kpFHF8JT8h":"return args.skill?.name == \"Language (Magick)\"","HrOBAXsEX073ReKl":"let skill = `Entertain (Singing)`\r\nlet currentCareer = this.actor.system.currentCareer;\r\nlet existingSkill = this.actor.itemTypes.skill.find(i => i.name == skill);\r\n\r\nif (!currentCareer) return\r\n\r\n\r\nlet inCurrentCareer = currentCareer.system.skills.includes(skill);\r\nlet perfectPitchAdded = this.actor.getFlag(\"wfrp4e\", \"perfectPitchAdded\") || {};\r\nif (existingSkill && inCurrentCareer && !perfectPitchAdded[existingSkill.name])\r\n{\r\n\texistingSkill.system.advances.costModifier = -5;\r\n}\r\nelse \r\n{\r\n\tperfectPitchAdded[skill] = true;\r\n\tcurrentCareer.system.skills.push(skill);\r\n\tsetProperty(this.actor, \"flags.wfrp4e.perfectPitchAdded\", perfectPitchAdded)\r\n}\r\n\r\n\r\n","HrYchgkdZBiu1yPF":"return args.skill?.name == game.i18n.localize(\"NAME.Climb\");","hSImyYjL0CENTvXf":"let test = await this.actor.setupSkill(\"Endurance\", {fields : {difficulty : \"difficult\", appendTitle : ` - ${this.effect.name}`}});\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n\tawait this.actor.addCondition(\"blinded\");\r\n}\r\n\r\nlet msg = ``\r\nlet armour = args.actor.itemTypes.armour.filter(i => i.system.isMetal && i.system.isEquipped);\r\nfor(let item of armour)\r\n{\r\n\tfor(let key in item.system.AP)\r\n\t{\r\n\t\tlet AP = item.system.AP[key]\r\n\t\tlet damage = Math.floor(AP / 2);\r\n\t\tawait item.system.damageItem(damage, [key]);\r\n\t}\r\n\tmsg += `<p><strong>${item.name}</strong> AP reduced by half</p>`\r\n}\r\nif (msg)\r\n{\r\n\tthis.script.scriptMessage(msg, {speaker : {alias : args.actor.name}});\r\n}","hSlEY2oh8quVmdXR":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = 2\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","ht7csu1KImHzpzL5":"return args.item?.actor?.type !== \"vehicle\" || args.item?.type !== \"weapon\" || !args.item.name.includes(\"Cannon\");","hTsnYKgw0kK10PiC":"args.fields.modifier += 5","huJcVpVn6Q7sQkFC":"if (args.actorsystem.details.move.sail.value > 0)\r\n args.actor.system.details.move.sail.value -= 1;\r\n","HUKzssLxeQo1wbx9":"\r\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"average\"}, appendTitle : \" - Wounded\"})\r\n await test.roll();\r\n if (test.failed)\r\n {\r\n fromUuid(\"Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb\").then(disease => {\r\n this.actor.createEmbeddedDocuments(\"Item\", [disease.toObject()])\r\n this.script.scriptNotification(\"Gained \" + disease.name)\r\n })\r\n }\r\n ","HwbgUIbpX0D8JLOR":"if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 2 && args.opposedTest.result.winner == \"attacker\")\r\n this.actor.addCondition(\"bleeding\")","hwHpIunCq3ifk2QU":"if (args.item.type == \"spell\")\r\n{\r\n let range = parseInt(args.item.Duration)\r\n if (Number.isNumeric(range))\r\n {\r\n args.item.system.duration.value = \"2 * \" + args.item.system.duration.value\r\n }\r\n}","hwOZxgt7e65iWvYz":"let test = await this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n let damage = this.effect.sourceTest.result.damage\r\n\r\n this.script.scriptMessage(await this.actor.applyBasicDamage(damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}))\r\n}","hWWvkPbgIN3lxz1u":"return args.item?.system?.attackType !== \"melee\";","HX6CjNapYdC0VmQ8":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.epPBu7x6BRWp2PHG\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","HXJKkmpfxQUOnWOS":"if (!this.item.system.twohanded.value)\r\n{\r\n this.item.system.flaws.value = this.item.system.flaws.value.concat([{name : \"tiring\"}, {name : \"slow\"}])\r\n}","hxmwtw5zAHyS2upG":"this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"giftofthebeast\"))","hYNWp75ggWSTht55":"if (args.test.result.hitloc.value != \"head\" && args.test.result.critical)\r\n{\r\n\tgame.wfrp4e.utility.sleep(200).then(() => {\r\n\t\tthis.script.scriptMessage(\"Can roll on the @Table[crithead]{Head Critical Hits} instead of the normal hit location\")\r\n\r\n\t})\r\n}","HYrl5aNMm8BAdqH7":"\r\n let modifier = 0\r\n if (this.effect.name.includes(\"Moderate\"))\r\n modifier = -20\r\n else\r\n modifier = -10\r\n args.fields.modifier += modifier\r\n ","hZAax4emLahEEqcZ":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = 7 - this.actor.characteristics.s.bonus\r\ndata.name = item.name.replace(\"(Feature)\", \"(Tusks)\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","I0Jo6cbNAJtXUloc":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.J9MK0AIaTbvd5oF6\");\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id});","I0oRZ7AWde5KI5jw":"return ![\"t\", \"int\"].includes(args.characteristic)","I1J2m5uud84N50Lk":"if ([\"cast\", \"channelling\", \"pray\"].includes(args.type))\r\n{\r\n\targs.abort = true;\r\n\tthis.script.scriptNotification(\"Cannot cast Spells or use Prayers\");\r\n}\r\nelse return true;","I2I4ZJjN3EUSow0t":"return args.item?.system?.attackType != \"ranged\"\n || this.item != args.item\n || this.actor.isOpposing","i59IpmZNLJEPWZ3L":"return args.spell","i5AN97A7IOeygEFA":"if (args.applyAP && args.modifiers.ap.metal) \r\n{\r\n args.modifiers.ap.ignored += args.modifiers.ap.metal\r\n args.modifiers.other.push({value : args.modifiers.ap.metal, label : this.effect.name, details : \"Add Metal AP to Damage\" })\r\n args.modifiers.ap.details.push(\"<strong>\" + this.effect.name + \"</strong>: Ignore Metal (\" + args.modifiers.ap.metal + \")\");\r\n args.modifiers.ap.metal = 0\r\n}","I5DqzmfuTGwyFWLY":"return ![game.i18n.localize(\"NAME.Intimidate\"), game.i18n.localize(\"NAME.Leadership\")].includes(args.skill?.name);","I67tdJctEqXSQPE0":"this.effect.update({\"disabled\": false})","I79D8V8OFzMCtL40":"const target = await ValueDialog.create({title: \"Ziel auswählen\", text: \"Wähle ein Ziel für den Hass\"}, \"Target\");\nawait this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.5hH73j2NgPdsLCZN\", this.effect, {name: `Hatred (${target})`});","I7ieW0hNYvvX0KFg":"return args.skill?.name != game.i18n.localize(\"NAME.Heal\");","i7xl0jNpLnBT2h2l":"args.actor.characteristics.dex.value = 0","I8JS4z90PtWIG2nb":"return this.actor.hasCondition(\"prone\")","I93i49wI9ZrDHT4n":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.jt0DmVK9IiF6Sd2h\");\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","i93PGV1lDSdi3BJu":"let effectsToDisable = this.actor.items.filter(i => i.type == \"disease\").reduce((effects, item) => effects.concat(item.effects.contents), []).concat(this.actor.effects.contents.filter(i => i.isCondition)).filter(i => i.active);\n\nif (effectsToDisable.length)\n{\n this.script.notification(`Disabling ${effectsToDisable.map(i => i.name).join(\", \")}.`);\n effectsToDisable.forEach(i => i.update({disabled : true}))\n}","I9QAPKbaXwMMMBT4":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty: \"average\"}, skipTargets: true, appendTitle : \" - \" + this.effect.name})\r\nawait test.roll();\r\nif(test.failed)\r\n{\r\n await this.actor.addCondition(\"stunned\");\r\n let secondTest = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty: \"easy\"}, skipTargets: true, appendTitle : \" - Despair\"})\r\n await secondTest.roll();\r\n if(secondTest.failed)\r\n {\r\n this.effect.updateSource({name : \"Taste of Death\"})\r\n await this.actor.addCondition(\"fatigued\");\r\n }\r\n else \r\n {\r\n return false;\r\n }\r\n}","IAGla7HJlYN0wa4H":"if (args.test.characteristicKey == \"wp\") \r\n{\r\n if (args.test.failed)\r\n {\r\n this.actor.addSystemEffect(\"convulsions\")\r\n this.script.scriptMessage(`Willpower Test failed, <b>${this.actor.prototypeToken.name}</b> gains @Symptom[Convulsions] for [[1d10]] hours`)\r\n }\r\n}","iAo3wxMLA64rsKjj":"this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"skavenbrew\"))","iBEPQ3NwtI9DfkEy":"let locations = [];\r\n\r\nwhile (locations.length < 2)\r\n{\r\n let loc = await game.wfrp4e.tables.rollTable(\"hitloc\", {hideDSN : true})\r\n if (!locations.includes(loc.result))\r\n {\r\n locations.push(loc.result);\r\n }\r\n}\r\n\r\nlocationText = locations.map(i => game.wfrp4e.config.locations[i]).join(\", \")\r\n\r\nthis.item.updateSource({name : this.item.name += ` (${locationText})`})","ID8mCcjkl7PCQhDq":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Dodge\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\n\r\nif(test.failed)\r\n{\r\n let damage = this.effect.sourceItem.system.computeSpellDamage(\"3\", true);\r\n this.script.scriptMessage(await this.actor.applyBasicDamage(damage, {suppressMsg: true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP}))\r\n}","id9ZdkERMZnZTWXt":"if (args.extendedTest?.getFlag(\"wfrp4e\", \"fear\"))\r\n{\r\n\tthis.script.scriptNotification(\"Immune to Fear\");\r\n\targs.extendedTest.delete();\r\n\targs.abort = true;\r\n}\r\nreturn args.options.terror || args.extendedTest?.getFlag(\"wfrp4e\", \"fear\")","idiZBzbALb5fXIbz":"let test = this.actor.attacker?.test\nif (test && this.item.system.protects[test.result.hitloc.result] && test.result.critical)\n{\n this.script.message(`<strong>${this.item.name}</strong>: Kritischer Treffer blockiert`)\n}","IdTjIw1yduvCdwdR":"if (args.type == \"effect\" && args.options.action == \"delete\" && [\"blinded\"].some(i => args.document.statuses.has(i)))\n{\n this.script.notification(\"Impossible de retirer \" + args.document.name);\n return false;\n}","IDvpVMkR2HXoNpPp":"return args.skill?.name !== \"Esquive\";","IEDJHIYaZLhmrK4X":"return ![\"weapon\", \"cast\"].includes(args.type) || (!this.item.equipped.value)","IfEu1hO8sKEZBpvg":"let value = parseInt(this.item.specification.value)\r\nlet name = this.actor.prototypeToken.name\r\n\r\nif (game.user.isGM && game.user.targets.size)\r\n{\r\n game.user.targets.forEach(t => {\r\n t.actor.applyFear(value, name)\r\n })\r\n game.user.updateTokenTargets([]);\r\n}\r\nelse \r\n{\r\n game.wfrp4e.utility.postFear(value, name)\r\n}","IFXsTRAVDUeVvcRc":"let roll = await new Roll(\"1d100\")\nawait roll.evaluate()\nawait roll.toMessage({\"flavor\": `Wyssan's Dice Reversal`})\n\nif (roll.result % 11 === 0 || roll.result === 100) {\n await this.item.setFlag(\"world\", \"inert\", true)\n}","IG4zYqtN9fRSYE7q":"args.actor.addCondition(\"ablaze\");","igVAVU7DOuzhNG14":"return args.item?.system.isMelee","iH9o7t8vGDn6pm1d":"if (args.test.result.misfire && args.test.result.roll % 2 == 1 && args.test.result.roll % 11 == 0) {\n delete args.test.result.misfire\n}\nelse if (args.test.result.misfire)\n{\n delete args.test.result.misfire;\n args.test.result.tables.misfire = {\n label : \"Fehlzündung\",\n class : \"fumble-roll\",\n modifier : 0,\n key : \"artillery-misfires\"\n }\n}","iHn3YzvqNfbwzjZz":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = this.actor.characteristics.s.bonus\r\ndata.system.description.value = \"\"\r\ndata.name = this.effect.name;\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","IhoCoul5okDx0jBa":"if (args.test.weapon.properties.qualities?.blast) {\n args.test.weapon.properties.qualities.blast.value ++;\n if (args.test.options.shortfuse) {\n args.test.result.other.push (`<strong>${this.effect.name}:</strong> Blast Rating increased`)\n }\n args.test.options.shortfuse = true\n}","ij3BLXzNk7eZ3V95":"return ![\"s\",\"t\",\"wp\",\"fel\"].includes(args.fields.characteristic)","ikaQXTvTWI5nAmUV":"const excessSL = this.effect.sourceTest.result.baseSL - this.effect.sourceItem.system.sl;\nlet slToSpend = excessSL;\n\nlet levels = 0;\nlet duration = 0;\n\nwhile (slToSpend > 0) {\n let content = `<p>You achieved ${excessSL} and you still have ${slToSpend} SL to spend on enhancing your Sword Dance.</p>`;\n content += `<p>So far you selected ${levels} additional levels in War Leader and +${duration} Rounds of duration.</p>`;\n await foundry.applications.api.DialogV2.confirm({\n yes: {label: \"Additional War Leader\", icon: \"fas fa-person\", callback: () => levels++},\n no: {label: \"+1 Round Duration\", icon: \"fas fa-clock\", callback: () => duration++},\n content,\n });\n\n slToSpend--;\n}\n\nawait this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.vCgEAetBMngR53aT\", this.effect, {\"system.advances.value\": 1 + levels});\nawait this.effect.update({duration:{rounds: this.actor.system.characteristics.wp.bonus + duration}});","IkGegSuQwwVPhrjF":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = 1\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","IKiZv9YSFmKmHo6a":"return args.spell?.system.lore.value == \"fire\"","IkVcIRmmgQjsBUUf":"let roll = await new Roll(\"1d100\")\nawait roll.evaluate()\nawait roll.toMessage({\"flavor\": `Wyssan's Dice Reversal`})\n\nif (roll.result % 11 === 0 || roll.result === 100) {\n await this.item.setFlag(\"world\", \"inert\", true)\n this.script.message(`${this.item.name} loses its magical properties`, {blind: true, whisper: ChatMessage.getWhisperRecipients(\"GM\")})\n}","iLpq4yCFN6YACrYA":"if (args.test.result.castOutcome == \"success\")\r\n{\r\n this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"demonic-mien\"))\r\n}","ILqHxk7deotgI3KD":"if (args.item.type != \"weapon\")\r\n return\r\n\r\nlet reach = args.item.reach.value\r\nlet reachNum = game.wfrp4e.config.reachNum[reach]\r\nreachNum = Math.min(reachNum + 2, 7)\r\n\r\nlet key = game.wfrp4e.utility.findKey(reachNum, game.wfrp4e.config.reachNum)\r\n\r\nargs.item.reach.value = key","iM4B3IZ4VtpZsl09":"args.size = \"sml\"","iM6JLF8jDXMViReZ":"return ![\"Pick Lock\", \"Sleight of Hand\", \"Channelling (Ulgu)\"].includes(args.skill?.name)","IM8nRo6Jx2I8RJ0L":"return (args.item?.skillToUse?.name == args.skill?.name)","iMDZLr7ueJWBnilj":"args.actor.flags.rangedDamageIncrease += 1","imKVsCy8rya2gkwO":"// Any Characteristic penalties due to failed Consume Alcohol Tests\r\n// or the state of being Stinking Drunk are eliminated. \r\nawait this.actor.removeSystemEffect(\"consumealcohol1\")\r\nawait this.actor.removeSystemEffect(\"consumealcohol2\")\r\nawait this.actor.removeSystemEffect(\"consumealcohol3\")\r\nawait this.actor.removeSystemEffect(\"stinkingdrunk1\")\r\n\r\n// The drinker is thereafter Fatigued \r\n// for a number of hours equal to 10 minus their Toughness Bonus — \r\n// nothing but time and rest can eliminate this penalty.\r\nawait this.actor.addCondition(\"fatigued\")\r\nconst duration = 10 - parseInt(this.actor.system.characteristics.t.bonus)\r\nthis.effect.updateSource({\"duration.rounds\" : duration});\r\nthis.script.scriptMessage(`<p><strong>${this.actor.prototypeToken.name}</strong> has lost all alcohol related penalties and gains the Fatigued Condition for ${duration} hours.</p>`, \r\n{\r\n whisper: ChatMessage.getWhisperRecipients(\"GM\"), \r\n blind: true \r\n}) ","iMu8BZ7eHMAbPEO1":"let healed = args.totalWoundLoss\r\n\r\nthis.script.scriptMessage(`<b>this.actor.prototypeToken.name</b> healed ${healed} Wounds`);\r\n\r\nthis.actor.modifyWounds(healed)","IN4ZFOPooqJtNuIQ":"return args.characteristic !== \"s\" && args.characteristic !== \"t\" && args.weapon?.system?.attackType !== \"melee\";","iNAQJa5HyaEckknX":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\n\r\n\r\nlet opposedResult = test.opposedMessages[0]?.getOppose()?.resultMessage?.getOpposedTest()?.result\r\n\r\nif (opposedResult?.winner == \"attacker\")\r\n{\r\n let spells = this.actor.itemTypes.spell;\r\n if (spells.length)\r\n {\r\n let chosen = spells[Math.floor(CONFIG.Dice.randomUniform() * spells.length)]\r\n this.script.scriptMessage(`Loses access to <strong>${chosen.name}</strong>`)\r\n chosen.update({name : chosen.name += \" (LOST)\"})\r\n }\r\n}\r\n\r\n\r\n","inPxRSx0CDj1nwAm":"if (args.test.result.fumble && !this.actor.itemTypes.talent.find(i => i.name == \"Arcane Magic (Fire)\"))\r\n{\r\n this.actor.addCondition(\"ablaze\");\r\n}","iO2hCDwyQ7v4qrOI":"if (args.test.options.staunchBleeding) {\r\n if (args.test.result.roll <= game.settings.get(\"wfrp4e\", \"automaticSuccess\") || args.test.result.roll <= args.test.target) {\r\n let staunch = ~~args.test.result.SL + 1\r\n if (args.test.options.fieldDressing && args.test.result.reversed)\r\n staunch = Math.min(1, Number(args.test.result.SL)) + 1\r\n args.test.result.other.push(`<b>${this.actor.name}</b> removed <b>${staunch}</b> Bleeding conditions from the patient.`)\r\n }\r\n else if (this.actor.characteristics.int.bonus + args.test.result.SL < 0)\r\n args.test.result.other.push(`The patient contracts a @UUID[Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg]{Minor Infection}.`)\r\n}","ioeTj5mx8jlA5EX5":"args.actor.addCondition(\"stunned\")","IOroJBqTsWvoakJN":"if (args.actorsystem.details.move.oars.value > 0)\r\n args.actor.system.details.move.oars.value -= 2;\r\n","Ip8sctF9SIE1Z2vF":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.UnJ25lL8aUzem5JO\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = 3\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","iphjuYnLhMMNXpGG":"this.actor.setWounds(0);\nthis.actor.addCondition(\"unconscious\");","ipkkRffJh61WE7zR":"if (!args.flags.amputatedFootOrLeg)\r\n{\r\n\targs.flags.amputatedFootOrLeg= true;\r\n\targs.fields.modifier -= 20;\r\n}","IpoOOjYJs6RmVrpb":"if (args.totalWoundLoss > 0)\r\n{\r\n args.attacker.applyEffect({effectUuids : this.effect.sourceItem.effects.contents[1].uuid})\r\n}","IPPDvZdE8kn3H9z7":"let test = await this.actor.setupSkill(\"Dodge\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\r\nawait test.roll();\r\n\r\nif (test.failed)\r\n{\r\n await this.actor.addCondition(\"grappling\")\r\n}","iqUvV1Vu81M3WyZ4":"let SL = Number(this.effect.sourceTest.result.SL);\r\nfor (let i=0; i<SL; i++) {\r\n\t\r\n}","iqwojL5Ku26wsgnI":"if (this.actor.system.status.fate?.value > 0 && (await this.script.dialog(\"Einen Schicksalspunkt ausgeben?\")))\n{\n await this.actor.spend(\"system.status.fate.value\");\n this.script.message(\"Schicksalspunkt ausgegeben\");\n await this.actor.addCondition(\"stunned\");\n this.actor.update({\"system.status.corruption.value\" : this.actor.system.status.corruption.value + 1});\n}\nelse \n{\n this.actor.addCondition(\"dead\");\n}","IR5URcjnCuWBFMoN":"// If a full dose is imbibed, \r\n// the victim must pass a Hard (-20) Endurance Test.\r\n\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"hard\"}})\r\nawait test.roll()\r\nif (test.failed)\r\n{\r\n this.script.scriptMessage(`<p><strong>${this.actor.prototypeToken.name}</strong> 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.</p>\r\n <p>Once they fall asleep however, it is almost impossible. At this point the victim must make a <strong>Hard (-20) Endurance</strong> Test. If they fail, they never awaken.</p>`, \r\n {\r\n whisper: ChatMessage.getWhisperRecipients(\"GM\"), \r\n blind: true \r\n })\r\n}\r\nreturn test.failed;","IR86DuMbVdbGOJYt":"this.actor.addCondition(\"blinded\")","IrkWq7IiFS65bTvC":"if (this.actor.flags.holed.half !== true) return;\r\nif (this.actor.flags.holed.reminded === true) return;\r\n\r\nconst speaker = ChatMessage.getSpeaker({actor: this.actor});\r\nthis.script.scriptMessage(`<p><b>${speaker.alias}</b> sits heavily in the water. Unless the cargo is waterproof, it loses [[d10]]% of its value.</p>`);\r\n\r\nthis.actor.flags.holed.reminded = true;","IsLAvY9ikR1cOJWw":"return ![\"NAME.Row\", \"NAME.Swim\"].map(i => game.i18n.localize(i)).includes(args.skill?.name);","IslMfFgpgQq2brpu":"if (this.actor.hasCondition(\"broken\"))\r\n{\r\n this.actor.removeCondition(\"broken\")\r\n this.script.scriptNotification(`Cannot have Broken`);\r\n}","iT0h3VZLEBQnn5Bx":"return args.skill?.name != game.i18n.localize(\"NAME.Charm\") && args.skill?.name != game.i18n.localize(\"NAME.Gossip\") && args.skill?.name != game.i18n.localize(\"NAME.ConsumeAlcohol\");","iT3C15fMyQrj1RmG":"if (this.actor.has(\"Undead\") && this.actor.has(\"Ethereal\"))\r\n{\r\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name}).then(async test => {\r\n await test.roll();\r\n if(test.failed)\r\n this.actor.addCondition(\"stunned\")\r\n })\r\n}","IukS0clr1yAleacc":"this.actor.system.characteristics.ag.modifier -= parseInt(this.item.system.location.value) || 1\r\n\r\nthis.actor.system.characteristics.ws.modifier -= parseInt(this.item.system.location.value) || 1","iuoVkjFdL1rHdbqR":"return this.item.equipped.value && [\"weapon\", \"cast\"].includes(args.type)","IupskvzvoGyD2H5o":"if (this.actor.type != \"character\")\r\n{\r\n return;\r\n}\r\n\r\nlet god = await ValueDialog.create(\"Enter a Deity\", \"Blessed\")\r\n\r\nif (god)\r\n{\r\n let prayers = await warhammer.utility.findAllItems(\"prayer\", \"Loading Prayers\")\r\n let blessings = prayers.filter(p => p.system.god.value.split(\",\").map(i => i.trim().toLowerCase()).includes(god.toLowerCase()) && p.system.type.value == \"blessing\")\r\n if (blessings.length)\r\n {\r\n this.script.scriptNotification(\"Adding \" + blessings.map(i => i.name).join(\", \"))\r\n await this.actor.createEmbeddedDocuments(\"Item\", blessings, {fromEffect : this.effect.id})\r\n }\r\n else \r\n {\r\n this.script.scriptNotification(`Could not find any Blessings associated with ${god}.`)\r\n }\r\n this.item.updateSource({name : this.item.name.replace(\"Any\", god)})\r\n await this.actor.update({\"system.details.god.value\": god})\r\n}","IurWrdbjsmMtTWuq":"return !this.actor.hasCondition(\"prone\")","iuSoKntfJ4eAPafQ":"let spells = await warhammer.utility.findAllItems(\"spell\", \"Loading Spells\");\r\nspells = 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)\r\n\r\nlet choice = await ItemDialog.create(spells, 1, \"Choose Spell\");\r\nif (choice[0])\r\n{\r\n this.actor.createEmbeddedDocuments(\"Item\", choice, {fromEffect: this.effect.id})\r\n}\r\n","IuxMr6SFdJhqFtVD":"this.actor.system.status.corruption.value += 3","iuYuf05BNuZ5fllI":"if (args.test.isFumble)\r\n{\r\n args.test.result.other.push(\"@Table[poisoned-wind-globe]\")\r\n}","iVhi3Z6zPaf1bf8g":"return [\"t\", \"i\", \"ag\", \"dex\", \"int\", \"wp\"].includes(args.characteristic)","ivxpmCKu3pEMG05c":"if (this.actor.inCombat)\n{\n\tthis.actor.characteristics.s.bonus += 2\t\t\n\tthis.actor.characteristics.s.calculationBonusModifier -= 2\n}","iWqn1fVeQ8IwZorj":"let roll = await new Roll(\"1d10\").roll();\nroll.toMessage(this.script.getChatData());\nthis.effect.updateSource({duration: {value: roll.total, units: \"rounds\"}});","iX0ctHYHg12pjaCU":"let result = await game.wfrp4e.tables.rollTable(\"gift-of-slaanesh\")\r\n\r\nif (result.object.documentId && result.object.documentCollection)\r\n{\r\n let item = await fromUuid(`Compendium.${result.object.documentCollection}.${result.object.documentId}`);\r\n if (item)\r\n { \r\n let data = item.toObject();\r\n // Some items need sourceTest for their effects\r\n setProperty(data, \"flags.wfrp4e.sourceTest\", this.effect.sourceTest);\r\n await this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});\r\n }\r\n}\r\n\r\nthis.script.scriptMessage(game.wfrp4e.tables.formatChatRoll(\"gift-of-slaanesh\", {lookup : result.roll, hideDSN: true}));","IXXrxNSLqXEqtuDU":"if (args.actor.details.move.value > 1) {\n args.actor.details.move.value -= 1 \n}","IzoOmDywGLqLNljN":"let skill = `Language (Magick)`\r\nlet currentCareer = this.actor.system.currentCareer;\r\nlet existingSkill = this.actor.itemTypes.skill.find(i => i.name == skill);\r\n\r\nif (!currentCareer) return\r\n\r\n\r\nlet inCurrentCareer = currentCareer.system.skills.includes(skill);\r\nlet witchAdded = actor.getFlag(\"wfrp4e\", \"witchAdded\") || {};\r\nif (existingSkill && inCurrentCareer && !witchAdded[existingSkill.name])\r\n{\r\n\texistingSkill.system.advances.costModifier = -5;\r\n}\r\nelse \r\n{\r\n\twitchAdded[skill] = true;\r\n\tcurrentCareer.system.skills.push(skill);\r\n\tsetProperty(this.actor, \"flags.wfrp4e.witchAdded\", witchAdded)\r\n}","IzZcsSngI8TZH4d8":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.fjd1u9VAgiYzhBRp\");\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","J0IWUhxada2ONowP":" 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\")))","j1AmrY1SxFJQyapo":"if (this.actor.status.advantage.value > 0 && args.item.system.attackType)\r\n{\r\n args.item.system.qualities.value.push({name : \"penetrating\"})\r\n}","J1FPDdrXGctKDTZz":"if (args.equipped)\r\n{\r\n let ward = await fromUuid(\"Compendium.wfrp4e-core.items.Bvd2aZ0gQUXHfCTh\")\r\n wardData = ward.toObject()\r\n wardData.system.specification.value = \"8\"\r\n \r\n let mr = await fromUuid(\"Compendium.wfrp4e-core.items.yrkI7ATjqLPDTFmZ\")\r\n mrData = mr.toObject()\r\n mrData.system.specification.value = 2\r\n \r\n this.actor.createEmbeddedDocuments(\"Item\", [wardData, mrData], {fromEffect : this.effect.id})\r\n}\r\nelse\r\n{\r\n this.effect.deleteCreatedItems()\r\n}","j3c6Y5aeA7nlFr9F":"const uuids = [\r\n \"Compendium.wfrp4e-core.items.Item.wBhPFggGqIXwbx1r\", // Alley Cat\r\n \"Compendium.wfrp4e-core.items.Item.q58lK4kULJZB5GjE\", // Rover\r\n];\r\n\r\nconst items = await Promise.all(uuids.map(uuid => fromUuid(uuid)));\r\nawait this.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect: this.effect.id});","j3zDMWkns32Yrxn3":"this.effect.updateSource({\"flags.wfrp4e.ward\" : 9})","J5XafRL0FyZnBPl2":"this.actor.addCondition(\"deafened\");","J60gMzmsNau8j53K":"const excessSL = this.effect.sourceTest.result.baseSL - this.effect.sourceItem.system.sl;\nawait this.effect.update({duration:{rounds: this.actor.system.characteristics.ag.bonus + excessSL}});","j6Bf1iivH8cqSnnK":"let target = args.data.targets[0]\r\nreturn target?.actor.hasCondition(\"prone\") || target.hasCondition(\"surprised\")","J8aPichsl25t1QZ9":"this.actor.addCondition(\"entangled\", this.effect.sourceTest.result.SL)","J8k4ahQdZhXDfU1l":"return args.skill?.name == \"Runesmithing\"","j98hvy6r9G2Vjmid":"if (args.totalWoundLoss > 0) \r\n{\r\n args.opposedTest.result.other.push(\r\n `@Corruption[minor]{Minor Exposure to Corruption}`\r\n )\r\n this.script.scriptMessage(\r\n `<strong>${this.effect.name}</strong>: \r\n @Corruption[minor]{Minor Exposure to Corruption} <br/>\r\n <strong>${args.actor.prototypeToken.name}</strong> must take an \r\n <strong>Average (+20%) Corruption (Minor) Test</strong>`, \r\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")})\r\n}","JaiC5P6nIgctOacH":"if (args.actor.system.details.species?.value?.toLowerCase() == \"dwarf\")\r\n{\r\n args.weaponProperties.flaws.undamaging = true;\r\n}","JavuFNZ9Pj5elVLc":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = 4 - this.actor.characteristics.s.bonus\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","jb1ouw0eIBVy3Wwg":"if (\n this.item == args.attackerTest.item\n && args.attackerTest.succeeded \n && args.defenderTest.item?.system?.attackType == 'melee'\n && (args.defenderTest.item.properties.qualities?.magical || args.defenderTest.item.properties.unusedQualities?.magical)\n) \n{\n args.opposedTest.result.other.push(`<strong>${this.effect.name}:</strong> destroys magical ${args.defenderTest.item.name}.`)\n}","JBoKPBr27C3PMoSD":"return args.skill?.name === game.i18n.localize(\"NAME.Navigation\");","jbZPLb4wuqJpHLUx":"this.item.system.flaws.value.push({name : \"dangerous\"})","jC8o5PbnqEvOoZ9N":"this.actor.addCondition(\"poisoned\", 2)","jdS2u1tQPYeO55WI":"let type = this.item.getFlag(\"wfrp4e\", \"breath\");\r\n\r\nif (type == \"cold\")\r\n{\r\n\tlet stunned = Math.max(1, Math.trunc(args.totalWoundLoss / 5))\r\n\tawait args.actor.addCondition(\"stunned\", stunned);\r\n}\r\n\r\nif (type == \"corrosion\")\r\n{\r\n let damageItems = await Dialog.confirm({title : this.item.name, content : `<p>Damage all Items carried?</p>`})\r\n\tif (damageItems)\r\n\t{\r\n\t\tlet msg = ``\r\n\t\tlet weapons = args.actor.itemTypes.weapon.filter(i => i.isEquipped);\r\n\t\tlet armour = args.actor.itemTypes.armour.filter(i => i.isEquipped);\r\n\t\tlet trappings = args.actor.itemTypes.trapping.filter(i => i.isEquipped);\r\n\t\tfor(let item of weapons)\r\n\t\t{\r\n\t\t\tif (item.system.properties.qualities.shield)\r\n\t\t\t{\r\n\t\t\t\tawait item.system.damageItem(1, \"shield\");\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tawait item.system.damageItem(1);\r\n\t\t\t}\r\n\t\t\tmsg += `<p><strong>${item.name}</strong> damage by 1</p>`\r\n\t\t}\r\n\t\tfor(let item of armour)\r\n\t\t{\r\n\t\t\tawait item.system.damageItem(1);\r\n\t\t\tmsg += `<p><strong>${item.name}</strong> damage by 1</p>`\r\n\t\t}\r\n\t\tfor(let item of trappings)\r\n\t\t{\r\n\t\t\tawait item.system.damageItem(1);\r\n\t\t\tmsg += `<p><strong>${item.name}</strong> damage by 1</p>`\r\n\t\t}\r\n\t\tif (msg)\r\n\t\t{\r\n\t\t\tthis.script.scriptMessage(msg, {speaker : {alias : args.actor.name}});\r\n\t\t}\r\n\t}\r\n}\r\n\r\nif (type == \"fire\")\r\n{\r\n\tawait args.actor.addCondition(\"ablaze\");\r\n}\r\n\r\nif (type == \"electricity\")\r\n{\r\n\tawait args.actor.addCondition(\"stunned\");\r\n}\r\n\r\nif (type == \"poison\")\r\n{\r\n\tawait args.actor.addCondition(\"poisoned\");\r\n}\r\n\r\n","JEbs0WlqhKNDOo5A":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"unconscious\")\r\n}\r\n","JeThJbOf6Xmbtgo1":"this.script.scriptMessage(await this.actor.applyBasicDamage(8 + parseInt(this.effect.sourceTest.result.SL), {suppressMsg : true}))\r\n\r\nlet test = await this.actor.setupSkill(\"Athletics\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"prone\")\r\n}","JFgXyb6bKjZJLmF8":"return args.characteristic == \"ag\"","jfk5VDKMTIf4ee0v":"if (args.totalWoundLoss > 0)\r\n args.actor.addCondition(\"poisoned\")","jFKnf2UdoxAQx76R":"if (args.equipped)\n{ \n this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.URwIDtInCsxOoGqM\", this.effect);\n}\nelse \n{\n this.effect.deleteCreatedItems();\n}","JfOodll9a2Lw0fWg":"let blinded = args.actor.hasCondition(\"blinded\")\r\nif (blinded)\r\n{\r\n blinded.system.scriptData = blinded.system.scriptData.filter(s => s.trigger != \"dialog\")\r\n blinded.system._scripts = null;\r\n}","jFwema0iwzBphxie":"let woundsGained = Math.min(args.actor.status.wounds.value, args.totalWoundLoss)\r\nwoundsGained = Math.ceil(woundsGained / 2)\r\n\r\nargs.attacker.update({\"system.status.wounds.value\" : args.attacker.system.status.wounds.value + woundsGained})\r\n\r\nargs.actor.addCondition(\"fatigued\")\r\nargs.attacker.hasCondition(\"fatigued\")?.delete();\r\n\r\nthis.script.scriptMessage(`<b>${args.attacker.prototypeToken.name}</b> gains ${woundsGained} Wounds`);","JgCcgDVZX54slrWx":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Melee\")) || args.item?.isMelee || args.options.corruption","jGDk7avWFSnyFoql":"let broken = this.actor.hasCondition(\"broken\");\r\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.IAWyzDfC286a9MPz\");\r\n\r\nif (broken && !broken.getFlag(\"wfrp4e\", \"blasted-mind\") && !this.actor.has(item.name))\r\n{\r\n await broken.delete();\r\n this.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})\r\n this.script.scriptNotification(`Removed ${broken.name}, added ${item.name} (${Math.ceil(CONFIG.Dice.randomUniform() * 10)} Rounds)`)\r\n}","jgO1Kf60Ctt6R0qO":"return args.item?.name != game.i18n.localize(\"NAME.Leadership\")","JhbZWZhOJ23yOBmG":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Carpentry)';\r\nconst difficulty = 'hard';\r\nconst target = 30;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","JhCMYHHYA860Kka8":"return !this.actor.attacker || args.item?.system?.attackType !== \"melee\" || args.skill?.name !== game.i18n.localize(\"NAME.Dodge\");","jHgxpe6TJDlP3oTn":"let spells = await warhammer.utility.findAllItems(\"spell\", \"Loading Spells\");\r\nspells = spells.filter(s => [\"slaanesh\"].includes(s.system.lore.value))\r\n\r\nlet choice = await ItemDialog.create(spells, 1, \"Choose Spell\");\r\nif (choice[0])\r\n{\r\n this.item.updateSource({name : this.item.name + ` (${choice[0].name})`})\r\n this.actor.createEmbeddedDocuments(\"Item\", choice, {fromEffect: this.effect.id})\r\n}\r\n","JibNjuQrJRnY0yf9":"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)","JjDzMnUxaWQePIYh":"return args.characteristic != \"int\"","JjiPprLSlSmmB5Ga":"args.item.system.damage.value += \" + 1\"","Jjq3oPYbI26zjxME":"let location = this.item.system.location.key;\r\n\r\nif (location)\r\n{\r\n let dropped = this.item.system.weaponsAtLocation;\r\n\r\n if (dropped.length)\r\n {\r\n this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(\", \")}!`)\r\n for(let weapon of dropped)\r\n {\r\n await weapon.system.toggleEquip();\r\n }\r\n }\r\n}\r\n\r\nlet roll = await new Roll(\"1d10\").roll()\r\n\r\nroll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Duration)`}));\r\n\r\nthis.effect.updateSource({\"duration.rounds\" : roll.total})","Jk7OHqx06oCUVAzb":"return ![\"Language (Magick)\", \"Channelling (Hysh)\"].includes(args.skill?.name) ","JKpC9pVATysq8k4G":"let damage = this.effect.sourceItem.system.Damage;\nconst flying = this.actor.has(game.i18n.localize(\"NAME.Flight\"));\n\nif (flying) damage++;\n\nawait this.actor.applyDamage(damage, {\n loc: \"roll\",\n createMessage: this.script.getChatData(),\n});\n\nconst test = await this.actor.setupSkill(\n game.i18n.localize(\"NAME.Athletics\"),\n {\n fields: {\n slBonus: flying ? -1 : 0,\n difficulty: \"average\"\n },\n skipTargets: true,\n appendTitle: ` — ${this.effect.name}`,\n },\n);\n\nawait test.roll();\n\nthis.effect.setFlag(\"wfrp4e\", \"failed\", !!test.failed);","JLn1B9eL53nSUq88":"if (args.test.isCritical || args.test.isFumble)\n args.test.result.tables.miscast = {\n label : game.i18n.localize(\"ROLL.MinorMis\"),\n class : \"fumble-roll\",\n key : \"minormis\",\n }\ndelete args.test.result.critical;\ndelete args.test.result.tables.critical;","jLsL4KRI6LEG9Ii2":"if (args.test.result.critical && ['rLeg', 'lLeg'].includes(args.test.result.hitloc.result))\r\n{\r\n args.test.result.critModifier = args.test.result.critModifier ? args.test.result.critModifier + 20 : 20\r\n args.test.result.critical += ` (+${args.test.result.critModifier})`\r\n}","jmxlpyLrIuoxQtvU":" this.actor.getActiveTokens().forEach(t => t.document.update({texture : {scaleX : 2, scaleY: 2, src: \"modules/wfrp4e-core/tokens/popout/gor.webp\"}}));\r\n","JmZQRvdWjm9ykYfn":"if (this.actor.hasCondition(\"surprised\"))\r\n{\r\n this.actor.removeCondition(\"surprised\")\r\n this.script.scriptMessage(`Cannot be Surprised`);\r\n}","Jnp5c09sPzDD61EK":"this.script.scriptNotification(`${args.actor.prototypeToken.name} must pass an <b>Average (+20) Willpower</b> Test to attack this target!`)\r\n\r\nreturn true; // No need to show this in the dialog","jObJanFoev4N6ZRv":"if (!args.opposedTest.attackerTest.item?.system?.isMagical)\r\n\targs.abort = `<strong>${this.effect.name}</strong>: Ignored`","jOCLEsjNzERyVLsP":"if(args.test.result.majormis)\n{\n args.test.result.nullmajormis = game.i18n.localize(\"ROLL.MajorMis\")\n args.test.minormis = game.i18n.localize(\"ROLL.MinorMis\")\n}","jOm7RxGFm1y6mCpN":"return args.options.crewTest.name.includes(\"Batten Down\");","jOSCsBRUO117spv8":"args.abort = `Only gunpowder or artillery weapons can attack targets within the ${this.effect.name}`;","jpcU8FFWSlQ3gD0L":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Trade\"))","JQruHprM5R5vZ9DA":"let caster = this.effect.sourceActor;\r\nif (caster)\r\n{\r\n let healed= caster.system.characteristics.wp.bonus + caster.system.characteristics.int.bonus\r\n await this.actor.modifyWounds(healed);\r\n this.script.scriptMessage(`<strong>${this.actor.prototypeToken.name}</strong> regains ${healed} Wounds`)\r\n}\r\n \r\n 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\"}})\r\n await test.roll();","jRSgPhpfN7MH7TTp":"if (args.totalWoundLoss > 0)\r\n{\r\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context: { failure: \"1 Poisoned Condition Gained\", success: \"Resisted Poisoned Condition\" } })\r\n await test.roll();\r\n if (test.failed)\r\n { \r\n args.actor.addCondition(\"poisoned\");\r\n if (args.actor.system.status.wounds.value - args.totalWoundLoss <= 0)\r\n {\r\n args.actor.addCondition(\"unconscious\")\r\n }\r\n }\r\n}\r\n\r\n // else\r\n // this.actor.setupCharacteristic(\"t\", { context: { failure: \"1 @Condition[Poisoned] Condition Gained\", success: \"Resisted @Condition[Poisoned] Condition\" } }).then(testCallback)\r\n","jrvj7bRyMBB9LixP":"this.actor.addCondition(\"fatigued\", 3)","jsgLEVYvMieyYT6L":"let tokenImg = \"\"; // Put path to token image here, inbetween the quotation marks\r\nif (tokenImg)\r\n{\r\n if (this.effect.getFlag(\"wfrp4e\", \"transformed\"))\r\n {\r\n await this.effect.setFlag(\"wfrp4e\", \"transformed\", false);\r\n this.actor.getActiveTokens().forEach(t => t.document.update({texture : {src: this.actor.prototypeToken.texture.src}})); \r\n }\r\n else \r\n {\r\n await this.effect.setFlag(\"wfrp4e\", \"transformed\", true);\r\n this.actor.getActiveTokens().forEach(t => t.document.update({texture : {src: tokenImg}}));\r\n }\r\n}\r\nelse \r\n{\r\n this.script.scriptNotification(\"No Token Image path configured. The image path should be set in the first line of this script.\", \"error\");\r\n}","JstrA46EYSEuRSy5":"if (this.actor.has(game.i18n.localize(\"NAME.Undead\")) && this.actor.has(game.i18n.localize(\"NAME.Construct\")))\r\n this.actor.addCondition(\"dead\")","jt8vTQBoMOMUccEt":"const excessSL = this.effect.sourceTest.result.baseSL - this.effect.sourceItem.system.sl;\nawait this.effect.update({duration:{rounds: this.actor.system.characteristics.i.bonus + excessSL}});","jTgzivraRKrrCOjH":"let roll = await new Roll(\"1d10\").roll();\nroll.toMessage(this.script.getChatData());\nthis.effect.updateSource({duration: {value: roll.total, units: \"minutes\"}});","JToUa1mDQ2h3ILKF":"const test = await actor.setupSkill('Cool', {\n appendTitle: ` – ${this.effect.name}`,\n skipTargets: true,\n fields: {difficulty: 'difficult'},\n characteristic: 'wp',\n context: {\n failure: \"You became beguiled by the eerie singing and unable to perform any action except moving towards the Oceanid. You count as Helpless.\"\n }\n});\nawait test.roll();","JTW6557K8nI5p9mL":"game.wfrp4e.tables.formatChatRoll(`mutatephys`, {showRoll: true});","jvNuIbOtB46p0esq":"if (args.test.item?.system?.attackType == \"melee\")\n{\n\tif (parseInt(args.test.result.SL) < 0 || args.test.failed)\n\t{\n\t\tif (parseInt(args.test.result.SL) < 0)\n\t\t{\n\t\t\targs.test.result.SL = \"+0\";\n\t\t\targs.test.result.description = \"Knapper Erfolg\";\n\t\t}\n\t\targs.test.result.outcome = \"success\"\n args.test.result.other.push(`<strong>${this.effect.name}</strong>: Minimum +0 SL`)\n\t}\n}","JVQK6VW73KxfeJJi":"if (args.totalWoundLoss > 0)\n {\n args.modifiers.other.push({label : this.effect.name, value : args.totalWoundLoss + 4})\n args.totalWoundLoss = (args.totalWoundLoss * 2) + 4\n }","jW87rmQLtROdVEhW":" if ([\"orc\", \"ork\", \"goblin\", \"hobgoblin\", \"snotling\", \"greenskin\"].includes(args.opposedTest.defender.details.species.value.toLowerCase()))\r\n {\r\n args.addImpact = true\r\n args.opposedTest.result.other.push(\"<b>Rune of Goblin Bane</b>: Impact Added\")\r\n }","JWEY8OS0ns1fNsQV":"let extra = this.effect.getFlag(\"wfrp4e\", \"extra\")\nif (!this.item.system.properties.qualities[extra]) \n{ \n this.item.system.qualities.value.push({name : extra});\n}","JwgFQmPQtXWAP94i":"this.actor.addCondition(\"fatigued\");","jWkfoVpHLiRaHTza":"if (args.test.succeeded)\r\n{\r\n args.test.result.other.push(`<strong>${this.effect.name}</strong>: @Terror[1,${this.actor.prototypeToken.name}]`)\r\n}","JwYZJGkZMSM2M3Si":"if (args.totalWoundLoss > 0)\r\n{\r\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\r\n await test.roll()\r\n if (test.failed)\r\n {\r\n args.totalWoundLoss += this.effect.sourceActor.system.characteristics.wp.bonus\r\n args.modifiers.other.push({label : this.effect.name, value : this.effect.sourceActor.system.characteristics.wp.bonus})\r\n }\r\n}","jXbrIGxznqf1SNxZ":"const speaker = ChatMessage.getSpeaker({actor: this.actor});\r\n\r\nthis.script.scriptMessage(`<p><b>${speaker.alias}</b> is Immersed within a Sea Elemental and suffers from @UUID[Compendium.wfrp4e-core.journals.JournalEntry.NS3YGlJQxwTggjRX.JournalEntryPage.WCivInLZrqEtZzF4#drowning-and-suffocation]{Suffocation}</p><p>They may attempt to escape by freeing themselves from the @Condition[Entangled} Condition as if they were @UUID[Compendium.wfrp4e-core.journals.JournalEntry.NS3YGlJQxwTggjRX.JournalEntryPage.wmA76Q2zJJ9HrkvA#grappling]{Grappled} by the Sea Elemental, making an <b>Opposed Strength Test</b> against its Strength of 59.</p>`);","JXBUE0XuJOJNG7zE":"if (args.totalWoundLoss <= 7) return;\r\n\r\nlet options = {\r\n appendTitle : \" – \" + this.effect.name,\r\n skipTargets: true,\r\n fields: {difficulty: 'average'},\r\n characteristic: 'wp',\r\n}\r\n\r\nlet test = await args.actor.setupSkill('Cool', options);\r\nawait test.roll();\r\n\r\nif (!test.succeeded) {\r\n const targetId = this.effect.getFlag(\"wfrp4e\", \"target\");\r\n const target = canvas.scene.tokens.get(targetId);\r\n await this.effect.delete();\r\n args.extraMessages.push(`<b>${args.actor.name}</b> lost ${args.totalWoundLoss} Wounds to an attack, which caused it to let go of <b>${target.name}</b>.`);\r\n}","jYJRO5XPyG7y6fih":"await this.actor.addCondition(\"blinded\")\r\nawait this.actor.addCondition(\"deafened\")\r\nawait this.actor.addCondition(\"fatigued\")","JyTxUG5dNW670Sf7":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.7mCcI3q7hgWcmbBU\")\r\nlet data = item.toObject();\r\ndata.system.location.key= this.item.system.location.key\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\r\n \r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}});\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"stunned\")\r\n}","JZIn1dsKHFE3smJU":"let ablaze = parseInt(this.effect.sourceTest.result.SL) + 1\r\nargs.actor.addCondition(\"ablaze\", ablaze)","K06v93N4FXb70mB7":"args.item.system.encumbrance.value = Math.max(0, args.item.system.encumbrance.value - 1);","k0AkkBLtE8oZhBwn":"if (isNaN(parseInt(this.item.system.specification.value))) {\r\n let value = await ValueDialog.create(\"Armoured Value\", \"Enter the Armoured value\");\r\n if (value) {\r\n this.item.updateSource({\"system.specification.value\" : value});\r\n }\r\n}","k1Wdehpgdc0hP63E":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.aE3pyW20Orvdjzj0\")\nlet hatred = item.toObject();\nhatred.system.specification.value = \"Skaven\"\n\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.Item.3wCtgMDNnu8MFmyk\")\nlet immunity = item.toObject();\nimmunity.system.specification.value = \"Poison\"\n\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.Item.oRx92ByVNEBN6YkK\")\nlet berserk = item.toObject();\nawait this.actor.createEmbeddedDocuments(\"Item\", [hatred, immunity, berserk], {fromEffect : this.effect.id})","k3FqFgsF6a3TkxAD":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\ntest.roll();\r\nreturn true;","k465TgRelwcSUdS2":"if (this.actor.has(\"Beruf (Technicus)\", \"skill\"))\n{\n let aim = await this.actor.setupSkill(\"Beruf (Technicus)\", {appendTitle : ` - Zielen ${this.item.name}`});\n await aim.roll();\n let SL = Number(aim.result.SL);\n let context = {}\n if (SL < 0)\n {\n context.fields = {modifier : 10 * SL};\n context.initialTooltip = \"Beruf (Technicus) fehlgeschlagen\";\n }\n\n let fire = await this.actor.setupWeapon(this.item, context)\n fire.roll();\n}\nelse\n{\n this.script.notification(\"Dieser Akteur hat nicht Beruf (Technicus)!\", \"error\");\n}","K54XxyNJa5PIWDEH":"args.modifiers.other.push({label : this.effect.name, details : \"Wunden verdoppelt + 4\", value : args.totalWoundLoss + 4 });\nargs.totalWoundLoss = args.totalWoundLoss * 2 +4;","k5792iKWEqKmVZMk":"return args.weapon || args.skill?.name === \"Esquive\";","k7J96MkvfX2GO6JS":"this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.system.status.corruption.value) + 1});\nthis.script.notification(\"Korruption hinzugefügt\");\nawait this.actor.addCondition(\"prone\");\nawait this.actor.addCondition(\"fatigued\");","k7ldJfyW201HgRFh":"args.item.system.qualities.value.push({name : \"magical\"});","k8TC0yzp4xfOXD2n":"if (args.totalWoundLoss > 0)\r\n{\r\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\r\n await test.roll();\r\n if (test.failed)\r\n {\r\n\t args.actor.addCondition(\"stunned\");\r\n }\r\n\targs.actor.hasCondition(\"bleeding\")?.delete()\r\n}","k9SvH4Lm3ZuI8S1N":"return ![\"wp\", \"ag\", \"i\", \"int\"].includes(args.characteristic)","kb2pwRZAjbUbZwcz":"if (args.actor.has(\"Tierhaft\"))\n{\n this.script.notification(`${args.actor.prototypeToken.name} muss einen <b>Willenskraft-Test (Schwierig, -10)</b> bestehen, um dieses Ziel anzugreifen!`);\n}\n\nreturn true; // No need to show this in the dialog","kbh9urTsUcLiwMLH":"return !this.actor.attacker || !this.item.properties.qualities.defensive","kbXDGAmWWD4CZJHB":"const sin = this.effect.sourceActor.system.status.sin.value;\r\nconst roll = new Roll(`2d10 - ${sin}`);\r\nawait roll.evaluate();\r\nawait roll.toMessage({flavor: `${this.effect.name}`});\r\nthis.actor.system.status.mood.addEntry(`${this.effect.name} (${this.effect.sourceActor.name})`, roll.total);","kBXVEnSWzaQZLkJH":"if(args.test.result.critical)\r\n{\r\n args.test.result.damage +=1 \r\n args.test.result.additionalDamage += 1\r\n}","KD4nCSdSXJVJmk0R":"this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {suppressMsg : true}))\r\nawait this.actor.addCondition(\"ablaze\")","kEaBLoIHt1FpQVKq":"if (this.actor.system.details.experience.current < 100) {\r\n return this.script.notification(game.i18n.localize(\"SCRIPT.NotEnoughXP\"))\r\n}\r\n\r\nlet item = await game.wfrp4e.utility.findItem(\"Invisibility\", \"trait\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item]);\r\nlet expLog = foundry.utils.duplicate(this.actor.details.experience.log || []);\r\nexpLog.push({amount : 100, reason: item.name, spent: this.actor.details.experience.spent + 100, total: this.actor.details.experience.total, type: \"spent\"});\r\nthis.actor.update({\r\n \"system.details.experience.spent\": this.actor.details.experience.spent + 100,\r\n \"system.details.experience.log\": expLog\r\n });","KF69WqF4PSEtpdb2":"args.fields.slBonus += 2;\r\n ","KG4TxnXiLLpfWOQO":"args.fields.difficulty = \"average\"","KGK9vL1Yl0qmCeCN":"let specification = this.item.system.specification.value;\r\nlet choice = [];\r\n\r\nif (!specification || specification == \"Trained Skills\")\r\n{\r\n choice = await ItemDialog.create(ItemDialog.objectToArray({\r\n broken: \"Broken\",\r\n drive: \"Drive\",\r\n entertain: \"Entertain\",\r\n fetch: \"Fetch\",\r\n guard: \"Guard\",\r\n home: \"Home\",\r\n magic: \"Magic\",\r\n mount: \"Mount\",\r\n war: \"War\"\r\n }, this.effect.img), \"unlimited\", \"Choose Training\");\r\n}\r\nelse \r\n{\r\n choice = specification.split(\", \").map(i => {\r\n return {\r\n id : i.toLowerCase(),\r\n name : i\r\n }\r\n });\r\n}\r\n\r\nif (choice.length)\r\n{\r\n let changes = foundry.utils.deepClone(this.effect.changes);\r\n\r\n for(let training of choice)\r\n {\r\n switch(training.id)\r\n {\r\n case \"broken\" : \r\n let roll = await new Roll(\"2d10\").roll(); \r\n roll.toMessage(this.script.getChatData());\r\n changes.push({value : roll.total, mode : 2, key : \"system.characteristics.fel.modifier\"})\r\n\r\n if (this.actor.type == \"creature\")\r\n {\r\n let bestial = this.actor.itemTypes.trait.find(i => i.name == \"Bestial\");\r\n if (bestial)\r\n {\r\n bestial.update({\"system.disabled\" : true})\r\n }\r\n }\r\n break;\r\n\r\n case \"drive\" : \r\n\r\n break;\r\n\r\n case \"entertain\" : \r\n\r\n break;\r\n\r\n case \"fetch\" : \r\n\r\n break;\r\n\r\n case \"guard\" : \r\n let territorial = await fromUuid(\"Compendium.wfrp4e-core.items.Item.JIAe7i7dqTQBu4do\");\r\n await this.actor.createEmbeddedDocuments(\"Item\", [territorial], {fromEffect: this.effect.id})\r\n setProperty(args, \"options.keepId\", true);\r\n break;\r\n\r\n case \"home\" : \r\n\r\n break;\r\n\r\n case \"magic\" : \r\n\r\n break;\r\n\r\n case \"mount\" : \r\n\r\n break;\r\n\r\n case \"war\" : \r\n changes.push({value : 10, mode : 2, key : \"system.characteristics.ws.modifier\"})\r\n break;\r\n }\r\n }\r\n this.effect.updateSource({name : `${this.effect.name} (${choice.map(i => i.name).join(\", \")})`, changes, \"flags.wfrp4e.trained\" : choice.map(i => i.id)})\r\n this.item.updateSource({\"system.specification.value\" : `${choice.map(i => i.name).join(\", \")}`})\r\n}","KICZPwLvbUSxbDrE":"let table = game.wfrp4e.tables.findTable(\"mutatemental\");\r\nif (!table)\r\n{\r\n\tui.notifications.error(\"Cannot find table with key: mutatemental\")\r\n}\r\nlet result = (await table.roll()).results[0];\r\nlet uuid = `Compendium.${result.documentCollection}.${result.documentId}`\r\nlet item = await fromUuid(uuid);\r\n\r\nif (item)\r\n{\r\n this.script.scriptNotification(`${item.name} added`)\r\n this.actor.createEmbeddedDocuments(\"Item\", [item])\r\n}\r\nelse \r\n{\r\n ui.notifications.error(\"Item could not be found: \" + uuid)\r\n}","kiJ6AiaYVUjt6aV6":"teeth = await fromUuid(\"Compendium.wfrp4e-core.items.fBcZhOBn8IpoVqQ1\")\r\nteeth = teeth.toObject();\r\n\r\nlet roll = await new Roll(\"1d10\").roll();\r\nroll.toMessage(this.script.getChatData({flavor : \"Teeth Lost\"}))\r\nteeth.system.location.value = `${roll.total} ${teeth.system.location.value}`\r\nthis.actor.createEmbeddedDocuments(\"Item\", [teeth])","kIM4Fs1lFVV7TSnj":"this.actor.modifyAdvantage(1);","kiolpXGbkmxfPiuI":"let test = this.actor.attacker?.test\nif (test && this.item.system.protects[test.result.hitloc.result] && test.result.critical)\n{\n this.script.message(`<strong>${this.item.name}</strong>: Blocked Critical Hit`)\n}","KIoVBinAZK8sMOqD":"\r\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"average\"}, skipTargets: true, appendTitle : \" - Wounded\"})\r\n await test.roll();\r\n if (test.failed)\r\n {\r\n fromUuid(\"Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb\").then(disease => {\r\n this.actor.createEmbeddedDocuments(\"Item\", [disease.toObject()])\r\n this.script.scriptNotification(\"Gained \" + disease.name)\r\n })\r\n }\r\n ","KJLAan0glJlyOyqF":" this.actor.getActiveTokens().forEach(t => t.document.update({light : {\r\n \"dim\": 10,\r\n \"bright\": 5,\r\n \"alpha\": 0.5,\r\n \"animation\": {\r\n \"speed\": 4,\r\n \"intensity\": 4,\r\n \"type\": \"flame\",\r\n },\r\n \"color\": \"#ac9e6c\",\r\n }}));","kkC5EhqA05U6U0gU":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\n\r\n// Kind of insane but whatever\r\nlet opposedResult = test.opposedMessages[0]?.getOppose()?.resultMessage?.getOpposedTest()?.result\r\n\r\nif (opposedResult?.winner == \"attacker\")\r\n{\r\n if (opposedResult.differenceSL < 6)\r\n {\r\n this.actor.addCondition(\"fatigued\", Math.floor(opposedResult.differenceSL / 2))\r\n }\r\n else if (opposedResult.differenceSL >= 6)\r\n {\r\n this.actor.addCondition(\"broken\");\r\n }\r\n}","KkE8DtsTDYDyk1gN":"args.data.reversal = {allowed : true, if: \"better\"};","KkjkYAGI9Em1NgiQ":"if (this.item.system.quantity.value) \r\n{\r\n this.item.system.reduceQuantity();\r\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Heal\"), { appendTitle: ` - ${this.effect.name}`, skipTargets: true })\r\n await test.roll();\r\n if (test.succeeded) \r\n {\r\n let actor = Array.from(game.user.targets)[0]?.actor || this.actor;\r\n actor.applyEffect({ effectData: [this.item.effects.contents[0].convertToApplied()] })\r\n }\r\n else \r\n {\r\n this.script.scriptNotification(\"Heal Test failed!\", \"error\")\r\n }\r\n}\r\nelse \r\n{\r\n this.script.scriptNotification(\"None left!\", \"error\")\r\n}","KmngDrPD72xn22kZ":"if (this.actor.Species.toLowerCase() != \"skaven\") {\r\n this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - Used ${this.effect.name}`, fields: { difficulty: \"difficult\" } }).then(async test => {\r\n await test.roll()\r\n if (test.failed) \r\n {\r\n let toughnessLost = Math.ceil(CONFIG.Dice.randomUniform() * 10)\r\n this.actor.update({ \"system.characteristics.t.initial\": this.actor.characteristics.t.initial - toughnessLost })\r\n this.script.scriptMessage(`<b>${this.actor.prototypeToken.name}</b> lost ${toughnessLost} Toughness`)\r\n }\r\n })\r\n }","kMSdRskYDI2J1gnp":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll(); \r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"prone\");\r\n}\r\n ","kmsGLWGxCY8Z8jVG":"return args.skill?.name != game.i18n.localize(\"NAME.Intuition\");","knq8lNYLw0v757dQ":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.9fq6p9Q6H02LjaSi\")\nlet data = item.toObject();\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});","KnwYZbeRSBA94hfl":"if (!args.flags.lostFingers)\r\n{\r\n\targs.flags.lostFingers = true;\r\n\targs.fields.modifier -= 5 * this.actor.flags.useless[this.item.system.location.key]\r\n}","knxDGP1YLbnPk03o":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Athletics\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"prone\");\n}","KoQJTwqoC7foST6v":"return args.type === \"cast\" && args.spell?.system.lore.value === \"high\";","KOR8aafB3D4FLoh6":"return args.item?.name !== game.i18n.localize(\"NAME.Stealth\")","KPQfupKuaf4LCv4R":"const talents = await Promise.all([\"Schemer\", \"Second Sight\"].map(game.wfrp4e.utility.findTalent))\r\nthis.actor.createEmbeddedDocuments(\"Item\", talents, {fromEffect : this.effect.id})","KQmb5B27eJ1lkbVL":"return this.item.system.quantity.value > 0 && args.type != \"channelling\"","KQzbrpb0T5a7it4k":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.vMYEkrWj0ip6ZOdv\");\r\nlet data = item.toObject();\r\ndata.name += ` (Disease)`;\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","KSGIwJxR0qn10RLX":"this.actor.itemTags.template.find(t => t.name === \"Hungry Troll\").delete();","KSjsDlsx3DD6cT16":"return args.skill?.name != game.i18n.localize(\"NAME.Bribery\");","KT670CjGBEprx2fO":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.RWJrupj9seau0w31\");\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id})","KTBVDHUndI3qDOXM":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"))\r\nawait test.roll();\r\nif (!test.succeeded)\r\n{\r\n args.actor.addCondition(\"stunned\")\r\n}","KuUkUmOOLf05I4Bp":"this.actor.hasCondition(\"broken\")?.delete();\r\n","KuuWAhoSzk0rCxxw":"args.fields.modifier += -20;","KUx0deSF3xNzMucL":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Art\"));","kUyVy3bfEZAGTeru":"args.modifiers.ap.ignored += 1\nargs.modifiers.ap.details.push(\"<strong>\" + this.effect.name + \"</strong>: Ignore AP (1)\");","kvaN100w0nBUlLbj":"let poisoned = this.actor.hasCondition(\"poisoned\")\r\nif (poisoned)\r\n{\r\n this.script.scriptMessage(\"Immune to Poisoned\")\r\n poisoned.delete()\r\n}","kvnZz8yqdTZbErkr":"args.actor.system.details.move.value -= 2;\r\nargs.actor.system.details.man -= 1;\r\nargs.actor.system.status.carries.max *= 1.5;","KVpDUEjHhd3nLa0f":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"enrage-beast\"))\r\n}","kvqJbHBvFr6iGLcI":"this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.3wCtgMDNnu8MFmyk\",null,[{\"system.specification.value\":\"Poison\"}])","KVuPduDztyMZQNt9":"args.fields.slBonus += this.actor.system.characteristics.ag.bonus","kWHKp2tw3HzkgWCy":"let duration = await new Roll(\"1d10\").roll();\nduration.toMessage(this.script.getChatData());\nthis.effect.updateSource({duration: {value: duration.total, units: \"hours\"}});","kWynO1lQzjiSs8RK":"return args.skill?.name != game.i18n.localize(\"NAME.Haggle\");","KxIRA51YA0rktcSP":"return args.characteristic === \"fel\"","KxM4zmhQRDHaRybM":"await this.actor.addCondition(\"blinded\");\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {appendTitle: ` - ${this.effect.name}`, skipTargets: true});\nawait test.roll();\n\nif (test.failed)\n{\n await this.actor.addCondition(\"blinded\");\n}","KXzDe7cN2vynHjJO":"this.actor.hasCondition(\"blinded\")?.delete();\r\nthis.actor.hasCondition(\"deafened\")?.delete()\r\nthis.actor.hasCondition(\"unconscious\")?.delete()","kY50G53IXdNXX9Sc":"for(let e of this.item.effects)\n{\n if (e.name.toLowerCase().includes(\"rune\") && e.system.transferData.type == \"aura\" && e.system.transferData.area.radius == \"6\")\n {\n e.system.transferData.area.radius = \"12\"\n }\n}","kYiDBPRKIokFkr4Z":"if (args.item.type == \"skill\" && args.item.name == \"Ranged (Bow)\")\r\n{\r\n args.item.system.modifier.value += 20;\r\n}","kYmscP2HuXjDovBD":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"))\r\n","KyswmGj1uG3QS3ng":"args.applyAP = false;","kYTEqcs8JpO2OmB9":"if (args.equipped)\n await this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.Bvd2aZ0gQUXHfCTh\", this.effect, {\"system.specification.value\": \"10\"});\nelse\n await this.effect.deleteCreatedItems()","KyUPYV1RXJxPOfyA":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"veasy\"}})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"fatigued\");\r\n}","l1ntrpa8RE3Lg5xE":"return args.skill?.name === game.i18n.localize(\"NAME.Perception\");","L1RMLvKtRPFtnczI":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MGEPI4jNhymNIRVz\");\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","L2cdQppcPwxz24hN":"return !args.weapon","L3ehj3ud1OgjcgSv":"if (!this.item.system.properties.qualities.fast) this.item.system.qualities.value.push({name : 'fast'});\n if (!this.item.system.properties.qualities.precise) this.item.system.qualities.value.push({name : 'precise'})\n if (!this.item.system.properties.qualities.penetrating) this.item.system.qualities.value.push({name : 'penetrating'})","L41ao2Mw1miE0yri":"let roll = await new Roll(\"15\").roll();\nroll.toMessage(this.script.getChatData());","L89UcafRHqUfxoux":"let injury = await fromUuid(\"Compendium.wfrp4e-core.items.3S4OYOZLauXctmev\")\r\ninjury.updateSource({\"system.location.key\" : this.item.system.location.key})\r\nthis.actor.createEmbeddedDocuments(\"Item\", [injury], {fromEffect: this.effect.id})","l8qFKSnMpy4P7XQR":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"));","L9eAtDyaoHvqryk4":"return args.skill?.name != game.i18n.localize(\"NAME.Intimidate\");","L9pUSX8Z4y2zIAn7":"this.actor.system.characteristics.int.value = 50","laptAldsT0Fm1rDt":"let blunt = await Dialog.confirm({label : \"test\", content :`<p>Apply blunt damage reduction? (-3)</p>`})\r\n\r\nif (blunt)\r\n{\r\n args.modifiers.other.push({label : this.effect.name, details : \"Blunt Damage Reduction\", value : -3})\r\n}","laWHBP2jLrVxcgp9":"this.script.message(await this.actor.applyBasicDamage(2, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}))","LAyLbcC0lOPwZP3U":"this.actor.addCondition(\"ablaze\", parseInt(this.effect.sourceTest.result.SL))","lbcIoWiXgY07OJpi":"let wounds = this.effect.sourceActor.system.characteristics.wp.bonus * (1 + (Math.floor(this.effect.sourceTest?.result.slOver / 3) || 0));\nthis.actor.modifyWounds(wounds);\nthis.script.message(`Healed ${wounds} Wounds`);","lCOdnKz8XpnkDs6Q":"let test = await this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();","lDfPgVtZf3ULFPjU":"let locs = Object.keys(this.actor.system.status.armour);\n\nlet location = locs[Math.floor(CONFIG.Dice.randomUniform() * (locs.length))];\n\nlet roll = await new Roll(\"1d10 * 5\").roll();\nroll.toMessage(this.script.getChatData({flavor: \"Modifier\"}));\n\ngame.wfrp4e.tables.formatChatRoll(`crit${location}`, {criticalLocation: location, modifier: roll.total, showRoll: true});","lDIWlQvD6MGyP3QP":"return this.effect.sourceActor.effects.filter(i => i.isCondition).length > 0","LedRsrVo2f7lm3Ix":"return args.skill?.name == game.i18n.localize(\"NAME.Intimidate\");","LeKLtvEDrWh4yHsx":"return args.skill?.name == game.i18n.localize(\"NAME.CharmAnimal\") || args.skill?.name.includes(game.i18n.localize(\"NAME.AnimalTraining\"));","lFO6XdfUODmFArqx":"args.actor.addCondition(\"bleeding\")","Lg1oRg4oNRvucsvi":"return !(args.skill?.name == game.i18n.localize(\"NAME.Climb\") || args.skill?.name == game.i18n.localize(\"NAME.Athletics\"))","lG5lfAzNuM4t0rpM":"return args.skill?.name === \"Esquive\";","LgYyLg0Y2AQ1SKcS":"let amount = this.effect.sourceTest.result.overcast.usage.other.current ?? 0;\r\n\r\nargs.fields.successBonus += 2 + amount;","Lh3Ccqx3utIu6w0d":"if (!args.ablazeApplied)\n{\n args.ablazeApplied = true;\n await args.actor.addCondition(\"ablaze\");\n}","lhemR8EP5tGNKout":"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\"}})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n msg = `<p>@UUID[${this.effect.sourceItem.uuid}]{Creeping Irratitonality} Roll: <a class=\"inline-roll\"><i class=\"fas fa-dice-d20\"></i>${Math.ceil(CONFIG.Dice.randomUniform() * 10)}</a></p>`\r\n if (test.result.roll % 11 == 0 || test.result.roll == 100)\r\n {\r\n msg += `<p><b>${this.actor.prototypeToken.name}</b> also gained 1 Corruption Point. If mutating, this results in a @Table[mutatemental]{Mental Corruption}</p>`\r\n let newCorruption = Number(this.actor.status.corruption.value) + 1\r\n this.actor.update({\"system.status.corruption.value\" : newCorruption})\r\n }\r\n\r\n this.script.scriptMessage(msg);\r\n}\r\n","LHUUXfZVLBhWqRvb":"this.actor.status.addArmour(5, {magical: true, source : this.effect})","lII4KMRblqwFBlsV":"let characteristics = {\n \"ws\" : 10,\n \"bs\" : 0,\n \"s\" : 0,\n \"t\" : 0,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 20,\n \"wp\" : 10,\n \"fel\" : 15\n}\nlet skills = [\"Channelling\", \"Charm\", \"Perform (Dancing)\"]\nlet skillAdvancements = [0, 6, 3]\nlet talents = [\"Attractive\", \"Distract\", \"Mimic\"]\nlet traits = [\"Distracting\", \"Flight (6)\", \"Spellcaster (Petty)\"]\nlet trappings = []\nlet items = [];\nlet spells = [\"Marsh Lights\", \"Sleep\"];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nconst traitRegex = /(?:,?(.+?)(\\+?\\d{1,2}\\+?)?\\s*?(?:\\((.+?)\\)\\s*(\\+?\\d{1,2})?|,|$))/gm\nfor (let trait of traits)\n{\n let traitMatches = trait.matchAll(traitRegex).next().value\n let traitName = traitMatches[1]\n let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there's a specialization\n let traitSpec = traitMatches[3]\n\n let traitItem;\n try {\n traitItem = await WFRP_Utility.findItem(traitName, \"trait\")\n }\n catch { }\n if (!traitItem) {\n ui.notifications.warn(`${trait} nicht gefunden`, {permanent : true})\n }\n traitItem = traitItem.toObject()\n\n if (Number.isNumeric(traitVal))\n {\n traitItem.system.specification.value = traitName.includes('Weapon','Horns','Tail','Tentacles','Bite') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal;\n traitItem.name = (traitItem.name + ` ${traitSpec ? \"(\"+ traitSpec + \")\" : \"\"}`).trim()\n }\n else \n traitItem.system.specification.value = traitSpec\n\n items.push(traitItem)\n\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let spell of spells) \n{\n let spellItem = await game.wfrp4e.utility.findItem(spell)\n if (spellItem)\n {\n spellItem = spellItem.toObject()\n\n items.push(spellItem);\n }\n else \n {\n ui.notifications.warn(`${spell} nicht gefunden`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.worn = true\n else if (item.type == \"weapon\")\n item.equipped = true\n else if (item.type == \"trapping\" && item.trappingType?.value == \"clothingAccessories\")\n item.worn = true\n}","lj7vOpa6tHHZ9bBB":"return this.actor.attacker","Lj9H0O9XUk830CBt":"scatter = await game.wfrp4e.tables.rollTable(\"scatter\");\nthis.script.message(scatter.result);\n\nlet distance = await new Roll(\"1d10\").roll();\n\ndistance.toMessage(this.script.getChatData({flavor: \"Distance (yds.)\"}));\n\nlet damage = await new Roll(\"1d10\").roll();\ndamage.toMessage(this.script.getChatData({flavor: \"Schaden\"}));\nthis.actor.applyDamage(damage.total, {\n damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP,\n createMessage: this.script.getChatData()\n});\n\n\nthis.actor.addCondition(\"prone\");","LjfScVGBf0Egr70E":"let animalCare = this.actor.itemTypes.skill.find(s => s.name === game.i18n.localize(\"NAME.AnimalCare\"));\r\nlet animalTrainings = this.actor.itemTypes.skill.filter(s => s.name.includes(game.i18n.localize(\"NAME.AnimalTraining\")));\r\n\r\nif (animalCare) \r\n animalCare.system.modifier.value += 20;\r\n\r\nfor (let training of animalTrainings) {\r\n training.system.modifier.value += 30;\r\n}","ljGX2w8hCTyLAjRp":"let specification = Number(this.item.specification.value) || 1;\r\nargs.actor.system.details.price.gc -= Math.floor(args.actor.system.details.price.gc * 0.1 * specification);","ljpM7muMyxGD04EX":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MVI0lXcg6vvtooAF\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","LjpuZam0IYIbOhFs":"const test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Navigation\"), {\n skipTargets: true,\n appendTitle: ` — ${this.effect.name}`,\n fields: {difficulty: \"vhard\"},\n context: {\n failure: \"Can't perform an action other than wander in a random direction at normal walking pace.\",\n success: \"Can act normally.\"\n }\n});\n\nawait test.roll();","LjXPlgdXBdllnA3i":"return ![\"s\", \"t\"].includes(args.characteristic)","LkPtgN9A36OI6Frh":"return args.skill?.name == game.i18n.localize(\"NAME.Leadership\");","LLqAT9wEUGMLfDhU":"return !args.item?.system.isRanged","LlRhPGorLl5qJCU8":"if (this.actor.hasCondition(\"prone\")) \r\n{\r\n this.actor.addCondition(\"unconscious\");\r\n}\r\nelse \r\n{\r\n this.actor.addCondition(\"prone\");\r\n}","Lm9IBkc918Duw3US":"let career = this.actor.itemTypes.career.find(c => c.getFlag(\"wfrp4e\", \"doubleLife\"))\r\n\r\nif(career)\r\n{\r\n career.system.current.value = true;\r\n}","lmBAZCtofsC8hHHG":"let SL = 1;\n\ndo {\n const signedSL = SL >= 0 ? `+${SL}` : \"SL\";\n const content = `\n <div>\n <p style=\"font-weight: bold;\">Du hast ${signedSL} ${SL > 1 ? \"EGs\" : \"EG\"} erzielt. Möchtest du einen W10 würfeln?</p>\n <p>1–6: +1 EG hinzufügen</p>\n <p>7–10: alle angesammelten EG verlieren und den nächsten Test mit –1 EG durchführen</p>\n </div>\n`;\n const choice = await foundry.applications.api.DialogV2.confirm({\n yes: {label: \"Würfeln\", icon: \"fas fa-dice\"},\n no: {label: `${signedSL} EG behalten`, icon: \"fas fa-check\"},\n content,\n });\n\n if (!choice) break;\n\n const roll = new Roll(\"1d10\");\n await roll.toMessage({flavor: this.effect.name});\n\n if (roll.total >= 7) {\n SL = -1;\n break;\n }\n\n SL++;\n} while (true);\n\nthis.effect.setFlag(\"wfrp4e\", \"SL\", SL);","lMRsQRgjMexY9dxE":"return [\"NAME.Endurance\", \"NAME.Cool\"].map(i => game.i18n.localize(i)).includes(args.skill?.name)","LNxKkPI37im0bSjy":"const ablaze = Number(args.opposedTest.result.differenceSL) + 1\nargs.actor.addCondition(\"ablaze\", ablaze)\nargs.extraMessages.push(\n \"<strong>\" + this.effect.name + \"</strong>: \"\n + ablaze + \" @Condition[Ablaze] Conditions\")","lOIHiAIDtj91kllN":"const chanties = await WFRP_Utility.findAll('wfrp4e-soc.chanty');\r\nlet choice = await ItemDialog.create(chanties, 1, \"Choose Chanty\");\r\nif (choice.length) {\r\n console.log(choice);\r\n this.actor.createEmbeddedDocuments(\"Item\", choice, {fromEffect: this.effect.id});\r\n}","LOL2TGf8p8KxP14D":"let wind = this.effect.name.split(\" \")[2]\r\nreturn args.type != \"cast\" || game.wfrp4e.config.magicWind[args.item.system.lore.value] != wind;","lol5J6h0pErzM71s":"return args.weapon?.system.properties.flaws.crewed","lOzkngzye4RmvALp":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.DrNUTPeodEgpWTnT\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id});\r\nthis.script.scriptNotification(\"Added \" + item.name)","Lp261O9fgEXmgPf3":"// If this actor wins a defending test, swap the test\r\nif (!args.opposedTest.result.swapped && args.opposedTest.result.winner == \"defender\" && args.opposedTest.attackerTest.result.damage)\r\n{\r\n args.opposedTest.swap(this.effect.label);\r\n}","lPudo1grrVp05i7a":"let loc = Math.floor(CONFIG.Dice.randomUniform() * 2) == 0 ? \"head\" : \"body\"\r\nlet damage = this.actor.system.characteristics.s.bonus + 6\r\n\r\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name}).then(async test => {\r\n await test.roll();\r\n if(test.failed)\r\n {\r\n await this.actor.addCondition(\"stunned\")\r\n this.script.scriptMessage(await this.actor.applyBasicDamage(damage, {loc, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}))\r\n }\r\n })","Lpv2N9LK9loeumiW":"if (this.actor.uuid != this.effect.sourceActor.uuid)\r\n{\r\n this.actor.setupSkill(game.i18n.localize(\"NAME.Athletics\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty: \"hard\"}, context : {failure : `<strong>${this.effect.name}</strong>: cannot move or take actions`}}).then(test => {\r\n test.roll();\r\n })\r\n}","LQEWSN5KnHHATPsf":"if (args.totalWoundLoss > 0)\r\n{\r\n this.script.scriptMessage(`<b>${args.actor.name}</b> must pass an <b>Easy (+40) Endurance</b> Test or gain a @UUID[Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb]{Festering Wound}`, {whisper: ChatMessage.getWhisperRecipients(\"GM\")})\r\n}","lQJ68n3y1xDyNicE":"return !args.options.sizeModifier && args.item?.system?.attackType != \"ranged\"","lQOu46YmOiQNhCZR":"const balanced = game.i18n.localize(\"WFRP4E.YenluiBalanced\");\nconst light = game.i18n.localize(\"WFRP4E.YenluiLight\");\nconst dark = game.i18n.localize(\"WFRP4E.YenluiDark\");\n\nlet newName;\n\nif (this.effect.name === game.i18n.localize(\"WFRP4E.YenluiBalanced\")) {\n newName = game.i18n.localize(\"WFRP4E.YenluiDark\");\n newDescription = game.i18n.localize(\"WFRP4E.YenluiDarkDesc\");\n} else if (this.effect.name === game.i18n.localize(\"WFRP4E.YenluiLight\")) {\n newName = game.i18n.localize(\"WFRP4E.YenluiBalanced\");\n newDescription = game.i18n.localize(\"WFRP4E.YenluiBalancedDesc\");\n}\n\nif (newName) {\n await this.effect.update({name: newName});\n await this.item.update({name: newName, \"system.description.value\": newDescription});\n}","Lrb1S2aK7SFVD0C7":"if (args.totalWoundLoss > 0)\r\n{\r\n let test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\n await test.roll();\r\n if (test.failed)\r\n {\r\n await args.actor.addCondition(\"fatigued\");\r\n }\r\n}","lRZhkh8pcu93QTKz":"if (args.test.spell)\r\n{\r\n\targs.test.preData.SL = -10\r\n}","lSOAZ4FG44bT4jh1":"let infected = await fromUuid(\"Compendium.wfrp4e-core.items.V0c3qBU1CMm8bmsW\")\r\nlet fear = await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")\r\n\r\nlet infectedData = infected.toObject();\r\nlet fearData = fear.toObject();\r\nfearData.system.specification.value = 2;\r\nthis.actor.createEmbeddedDocuments(\"Item\", [fearData, infectedData], {fromEffect : this.effect.id})","Lu27iXtJVkrJ8bOx":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Stealth\"))","lU4s3UTtBkU38djI":"this.actor.addCondition(\"entangled\")\r\nlet msg = `<b>${this.actor.prototypeToken.name}</b> loses 1 Wound and gains 1 <strong>Entangled</strong> Condition.`\r\nthis.script.scriptMessage(msg)\r\nthis.actor.modifyWounds(-1)","lUcx8NUadgq3oFTY":"if (this.item.attackType == \"melee\" && !this.item.system.properties.qualities.fast) this.item.system.qualities.value.push({name : 'fast'})","luEuwzYCUrch58Bp":"if (args.opposedTest.attackerTest.options?.grudge) {\n args.modifiers.other.push({label : this.effect.name, details : \"Schadenserhöhung\", value : 1})\n}","lvjcddwRiN9iGruy":"let test = await this.actor.setupCharacteristic(\"t\", { appendTitle: ` - ${this.effect.name}`, fields: { difficulty: \"challenging\" } })\r\nawait test.roll();\r\n\r\nif (test.failed) \r\n{\r\n let ageAdded = Math.ceil(CONFIG.Dice.randomUniform() * 10) + Math.ceil(CONFIG.Dice.randomUniform() * 10)\r\n let ws = Math.ceil(CONFIG.Dice.randomUniform() * 10)\r\n let bs = Math.ceil(CONFIG.Dice.randomUniform() * 10)\r\n let s = Math.ceil(CONFIG.Dice.randomUniform() * 10)\r\n let t = Math.ceil(CONFIG.Dice.randomUniform() * 10)\r\n let ag = Math.ceil(CONFIG.Dice.randomUniform() * 10)\r\n let dex = Math.ceil(CONFIG.Dice.randomUniform() * 10)\r\n\r\n let currentAge = parseInt(this.actor.system.details.age.value)\r\n\r\n let inline = `<a class=\"inline-roll\" data-tooltip=\"@TT\"><i class=\"fas fa-dice-d20\"></i>@ROLL</a>`\r\n let msg =\r\n `<p><b>${this.actor.prototypeToken.name}</b> ages by ${inline.replace(\"@ROLL\", ageAdded).replace(\"@TT\", \"2d10\")} and loses</p>\r\n <p>${inline.replace(\"@ROLL\", ws).replace(\"@TT\", \"1d10\")} <b>Weapon Skill</b></p>\r\n <p>${inline.replace(\"@ROLL\", bs).replace(\"@TT\", \"1d10\")} <b>Ballistic Skill</b></p>\r\n <p>${inline.replace(\"@ROLL\", s).replace(\"@TT\", \"1d10\")} <b>Strength</b></p>\r\n <p>${inline.replace(\"@ROLL\", t).replace(\"@TT\", \"1d10\")} <b>Toughness</b></p>\r\n <p>${inline.replace(\"@ROLL\", ag).replace(\"@TT\", \"1d10\")} <b>Agility</b></p>\r\n <p>${inline.replace(\"@ROLL\", dex).replace(\"@TT\", \"1d10\")} <b>Dexterity</b></p>\r\n `\r\n this.script.scriptMessage(msg);\r\n\r\n let characteristics = duplicate(this.actor.system.characteristics)\r\n\r\n characteristics.ws.initial -= ws\r\n characteristics.bs.initial -= bs\r\n characteristics.s.initial -= s\r\n characteristics.t.initial -= t\r\n characteristics.ag.initial -= ag\r\n characteristics.dex.initial -= dex\r\n\r\n this.actor.update({ \"system.characteristics\": characteristics, \"data.details.age.value\": ageAdded + currentAge })\r\n}","lwVhn4bSXJ3eoT9q":"if (this.item.system.weaponGroup.value == \"basic\")\r\n{\r\n let slash = this.item.system.qualities.value.find(i => i.name == \"slash\")\r\n if (slash)\r\n {\r\n slash.value = \"2A\"\r\n }\r\n}","LxdLkPxH3SFvYrCJ":"if (args.effect.conditionId == \"ablaze\")\r\n{\r\n args.data.formula += ` - ${this.actor.system.characteristics.t.bonus}`\r\n}","LxEhkvdSEQic8VZ6":"let ingredients = this.actor.itemTypes.trapping.filter(i => i.system.trappingType.value == \"ingredient\");\n\nif (ingredients.length == 0)\n{\n return this.script.notification(\"Keine Zutaten!\");\n}\nthis.script.notification(\"Betroffen: \" + ingredients.map(i => i.name).join(\", \"));\n\nfor(let i of ingredients)\n{\n await i.update({\n name: i.setSpecifier(\"Verdorben\"),\n effects: [{\n name: \"Verdorben\",\n img: i.img,\n system: {\n transferData :{\n documentType: \"Item\"\n },\n scriptData: [\n {\n label: \"Böser Einfluss\",\n script: \"args.fields.malignantInfluence = true;\",\n trigger: \"dialog\",\n options: {\n activateScript: \"return true;\"\n }\n }\n ]\n }\n }] \n });\n}","LXEUhHuXe8keEPI9":"let test = await this.actor.setupCharacteristic(\"wp\", {fields: {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n\tlet stuns = Math.max(1, Math.abs(test.result.SL))\r\n\tthis.actor.addCondition(\"stunned\", stuns)\r\n}","LyAK0dVDS5L09yq2":"let caster = this.effect.sourceActor\r\n\r\nif (caster)\r\n{\r\n let bonus = caster.system.characteristics.wp.bonus\r\n this.actor.modifyWounds(bonus)\r\n\r\n this.script.scriptMessage(`<strong>${this.actor.prototypeToken.name}</strong> regains ${bonus} Wounds`)\r\n}","LYwio2f6xTiKg9dN":"if (args.test.failed)\n {\n let applicableCharacteristics = [\"ws\", \"bs\", \"s\", \"fel\", \"ag\", \"t\", \"dex\"];\n if (applicableCharacteristics.includes(args.test.characteristicKey))\n {\n this.actor.addCondition(\"stunned\");\n }\n }","lYYkGzqNshiYc7WI":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"poisoned\")\r\n}","lZuavewrJzOehrJQ":"let test = await this.actor.setupSkill('Endurance', {\r\n appendTitle: ` – ${this.effect.name}`,\r\n skipTargets: true,\r\n fields: {difficulty: 'easy'},\r\n characteristic: 't',\r\n context: {failure: \"Mast shattered!\"}\r\n});\r\nawait test.roll();\r\n\r\nif (test.failed) {\r\n let crit = await fromUuid(\"Item.d4bCnR1zINTNF9VC\");\r\n await this.actor.createEmbeddedDocuments(\"Item\", [crit]);\r\n this.effect.update({disabled: true});\r\n}","M0eOB2Jg9KzcN1gz":"const uuids = [\r\n \"Compendium.wfrp4e-core.items.Item.Nj3tC8A5fZ3zEdMR\", // Holy Visions\r\n \"Compendium.wfrp4e-core.items.Item.mNoCuaVbFBflfO6X\", // Sixth Sense\r\n];\r\n\r\nconst items = await Promise.all(uuids.map(uuid => fromUuid(uuid)));\r\nawait this.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect: this.effect.id});","M0XhKnWjG14pk3iH":"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\"","M2FshTX4PjKFVU8y":"args.flags.earCount = Number.isNumeric(args.flags.earCount) ? args.flags.earCount+1 : 1;\r\nif (args.characteristic == \"fel\")\r\n{\r\n\targs.fields.modifier -= 5;\r\n}\r\nif (args.flags.earCount == 2 && args.skill?.name == game.i18n.localize(\"NAME.Perception\"))\r\n{\r\n\targs.fields.modifier -= 20;\r\n}\r\n","m3qEVO5fseV6KHXa":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.qn4ZpvTQIX4rcJDl\")\r\nlet data = item.toObject();\r\ndata.system.location.key = this.item.system.location.key\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","m4eagTrVOXtotonR":"// Get the size\nlet size = this.actor.sizeNum \nlet diff = \"difficult\";\nif (size < 5) { // 5 = Monstrous\n diff = \"hard\";\n}\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty : diff}, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed) {\n this.actor.addSystemEffect(\"fear\")\n}","m58MpMZBblpq5LJu":"args.prefillModifiers.slBonus++;\r\nargs.prefillModifiers.successBonus++;\r\n","M5bh0heeafA2fQQ8":"if (args.test.spell?.getFlag(\"wfrp4e\", \"boonOfTzeentch\"))\r\n{\r\n if (args.test.result.minormis || args.test.result.majormis || args.test.result.catastrophicmis)\r\n {\r\n this.script.scriptMessage(`<strong>${this.effect.name}</strong> quits your mind in disgust and erases itself from your grimoire!`)\r\n this.effect.sourceItem.delete();\r\n }\r\n}","M6sb1yAdEAMlIvac":"return args.item?.system?.attackType == \"ranged\" && this.item.equipped.value","m84kG5cEPEByqHdd":"const uuid = \"Compendium.wfrp4e-core.items.Item.SfUUdOGjdYpr3KSR\";\r\nconst item = await fromUuid(uuid);\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id});","m8qBlbH7ROoqa22o":"return args.options.reload","M9VgeYGiUO97ZUW4":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.hCadFsTRvLN9faaY\")\r\nlet data = item.toObject();\r\ndata.system.location.value = \"Jaw\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\r\n\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (!test.succeeded)\r\n{\r\n\targs.actor.addCondition(\"unconscious\")\r\n}\r\n\r\n","ma0sWhebqwdRHWvY":"if (!args.flags.trained)\r\n{\r\n args.flags.trained = true;\r\n args.fields.modifier += 10;\r\n}","maKr58mvvyKxFyC3":"if (args.item.type == \"prayer\" && (args.item.damage.value || args.item.damage.dice))\r\n args.item.damage.value += \"+1\"","masOBNgSi5HYkf3m":"return args.type != \"cast\" && args.type != \"channelling\"","MB058H6OslhfBmxR":"console.log(args)\nreturn args.item?.system?.attackType == \"melee\"","mBcLf11upaHS8AQq":"this.actor.status.addArmour(1, {source: this.effect})","MCK6WyjwYT28lsTN":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.u0CFf3xwiyidD9T5\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","McLR9YcgVUG3MooC":"args.applyTB = false;","MDLttXplnNthncGr":"return args.type == \"cast\" && [\"death\", \"necromancy\", \"life\", \"light\", \"heavens\"].includes(args.spell?.system.lore.value)","Me1wS5XdqUEy7OGt":"let loc = (await game.wfrp4e.tables.rollTable(\"hitloc\")).result;\r\nlet critTable = `crit${this.generalizeTable(loc)}`;\r\nlet crit = (await game.wfrp4e.tables.rollTable(critTable)).result;\r\n\r\nthis.script.message(`${this.actor.name} suffers a ${crit} (location : ${loc}). Do not apply bleeding or any additonnal wounds.`);","MECRxo8X0cfZh1rx":"return args.skill?.name !== game.i18n.localize(\"NAME.Dodge\");","MeHXlZ66R3X8luFT":"let modifier = 0\n if (this.effect.name.includes(\"Moderate\"))\n modifier = -20\n else\n modifier = -10\n args.fields.modifier += modifier","MFKhU9vp8bQpHP3I":"let value = parseInt(this.item.specification.value)\r\nlet name = this.actor.prototypeToken.name\r\n\r\nif (game.user.isGM && game.user.targets.size)\r\n{\r\n game.user.targets.forEach(t => {\r\n t.actor.applyTerror(value, name)\r\n })\r\n game.user.updateTokenTargets([]);\r\n}\r\nelse \r\n{\r\n game.wfrp4e.utility.postTerror(value, name)\r\n}","MfxWXZwaZUjGSBqw":"if (this.actor.hasCondition(\"ablaze\"))\r\n{\r\n this.script.scriptNotification(\"Immune to Ablaze\")\r\n await this.actor.hasCondition(\"ablaze\")?.delete()\r\n}","MfxzwJz2o9ho2hOM":"return args.skill?.name == \"Lore (Apothecary)\"","mGHKBkDp4omSaBlD":"this.actor.getActiveTokens().forEach(t => t.document.update({light : {\r\n \"dim\": 20,\r\n \"bright\": 10,\r\n \"angle\": 360,\r\n \"alpha\": 0.4,\r\n \"animation\": {\r\n \"speed\": 3,\r\n \"intensity\": 3,\r\n \"type\": \"torch\",\r\n },\r\n \"color\": \"#ffcc66\",\r\n }}));","mgLGN1XPzPE4dReN":"args.fields.slBonus--;","MgMMoC4Umpg7fmNI":"// Apply changes when the mask is worn\r\n\r\nif (args.equipped) { \r\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [this.item.effects.contents[1]?.convertToApplied()]) \r\n this.script.scriptMessage(`${this.actor.name} dons the <strong>${this.item.name}</strong>. <br>\r\n They cannot cast Spells or pray for Blessings and Miracles.<br>\r\n 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}. \r\n `,\r\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \r\n}\r\n\r\n// Notify of lingering effects when mask is removed\r\nelse if (!args.equipped)\r\n{\r\n await this.item.effects.contents[0].delete();\r\n await this.item.update({name : this.item.name += \" (Used)\"})\r\n this.script.scriptMessage(`<strong>${this.item.name}</strong> 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.`, \r\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\r\n )\r\n \r\n}\r\n\r\n\r\n\r\n","MgTqCMRjxhezT73T":"return args.fields.hitLocation == \"head\" && args.weapon?.system.properties.qualities.pummel","MgZreqq3Jua10c8s":"return ![\"ws\", \"bs\", \"s\", \"fel\", \"ag\", \"t\", \"dex\"].includes(args.characteristic)","Mhb67xufvA9uWO21":"let actorSize = game.wfrp4e.config.actorSizeNums[args.actor.details.size.value]\r\nlet attackerSize = game.wfrp4e.config.actorSizeNums[args.attacker.details.size.value]\r\n\r\nif (attackerSize > actorSize)\r\n{\r\n args.actor.addCondition(\"prone\")\r\n this.script.scriptMessage(`<strong>Tail Attack</strong>: ${args.actor.prototypeToken.name} is now <strong>Prone</strong>`)\r\n}","MI2GgNi3fZtUCtQD":"return [\"int\", \"wp\"].includes(args.characteristic)","MIhYSuJ6MI9B65UT":"let specification = Number(this.item.specification.value) || 1;\r\nargs.actor.system.status.wounds.max += Math.floor(args.actor.system.status.wounds.max * 0.3 * specification);\r\nargs.actor.system.status.carries.max -= Math.floor(args.actor.system.status.carries.max * 0.1 * specification);\r\nargs.actor.system.details.price.gc += Math.floor(args.actor.system.details.price.gc * 0.2 * specification);","Mir4FMHQRdVqazAF":"let actorSize = game.wfrp4e.config.actorSizeNums[args.actor.details.size.value]\r\nlet attackerSize = game.wfrp4e.config.actorSizeNums[args.attacker.details.size.value]\r\n\r\nif (attackerSize > actorSize)\r\n{\r\n let msg = `<b>Tongue Attack</b>: ${args.actor.prototypeToken.name} is now @Condition[Entangled]`;\r\n await args.actor.addCondition(\"entangled\");\r\n if (actorSize <= 2)\r\n {\r\n msg += `and @Condition[Engaged]`\r\n }\r\n this.script.scriptMessage(msg, {speaker : {alias: args.attacker.prototypeToken.name}})\r\n}","mJ9eMPub4epJSf00":"return args.weapon?.system.qualities.value.find(i => i.name == \"shield\") && this.actor.attacker","MJB6WbZSF6Briz30":"return args.item?.name == game.i18n.localize(\"NAME.Leadership\")","MkEcdViivk7abf1x":"args.actor.flags.meleeDamageIncrease += 1","MKxYbHOrv0UuA7JB":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"average\"}, appendTitle : \" - Verwundet\"})\n await test.roll();\n if (test.failed)\n {\n fromUuid(\"Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb\").then(disease => {\n this.actor.createEmbeddedDocuments(\"Item\", [disease.toObject()])\n this.script.scriptNotification(\"Ansteckung mit \" + disease.name)\n })\n }","mlulnXQo8XU8vKLD":"if (isNaN(parseInt(this.item.system.specification.value)))\r\n{\r\n let value = await ValueDialog.create(\"Enter Grim value\", this.effect.name);\r\n if (value)\r\n {\r\n this.item.updateSource({\"system.specification.value\" : value});\r\n }\r\n}","MMv2B8TH7jxNCtdl":"let actor = this.actor;\r\n let effect = this.effect;\r\n let bleedingAmt;\r\n let bleedingRoll;\r\n let msg = \"\"\r\n\r\n let damage = effect.conditionValue;\r\n let scriptArgs = {msg, damage};\r\n await Promise.all(actor.runScripts(\"preApplyCondition\", {effect, data : scriptArgs}))\r\n msg = scriptArgs.msg;\r\n damage = scriptArgs.damage;\r\n msg += await actor.applyBasicDamage(damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, minimumOne : false, suppressMsg : true})\r\n\r\n if (actor.status.wounds.value == 0 && !actor.hasCondition(\"unconscious\"))\r\n {\r\n await actor.addCondition(\"unconscious\")\r\n msg += \"<br>\" + game.i18n.format(\"BleedUnc\", {name: actor.prototypeToken.name })\r\n }\r\n\r\n if (actor.hasCondition(\"unconscious\"))\r\n {\r\n bleedingAmt = effect.conditionValue;\r\n bleedingRoll = (await new Roll(\"1d100\").roll()).total;\r\n if (bleedingRoll <= bleedingAmt * 10)\r\n {\r\n msg += \"<br>\" + game.i18n.format(\"BleedFail\", {name: actor.prototypeToken.name}) + \" (\" + game.i18n.localize(\"Rolled\") + \" \" + bleedingRoll + \")\";\r\n await actor.addCondition(\"dead\")\r\n }\r\n else if (bleedingRoll % 11 == 0)\r\n {\r\n msg += \"<br>\" + game.i18n.format(\"BleedCrit\", { name: actor.prototypeToken.name } ) + \" (\" + game.i18n.localize(\"Rolled\") + bleedingRoll + \")\"\r\n await actor.removeCondition(\"bleeding\")\r\n }\r\n else\r\n {\r\n msg += \"<br>\" + game.i18n.localize(\"BleedRoll\") + \": \" + bleedingRoll;\r\n }\r\n }\r\n\r\n await Promise.all(actor.runScripts(\"applyCondition\", {effect, data : {bleedingRoll}}))\r\n if (args.suppressMessage)\r\n {\r\n let messageData = game.wfrp4e.utility.chatDataSetup(msg);\r\n messageData.speaker = {alias: this.effect.name}\r\n messageData.flavor = this.effect.name;\r\n return messageData\r\n }\r\n else\r\n {\r\n return this.script.scriptMessage(msg)\r\n }\r\n ","MMx8f5uJ15XOgJGg":"return args.skill?.name !== game.i18n.localize(\"NAME.Row\") && args.skill?.name !== game.i18n.localize(\"NAME.Swim\") && !args.skill?.name.includes(game.i18n.localize(\"NAME.Sail\"));","MnqQkXVp20Lw84I1":"let test = await this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"difficult\"}})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.script.scriptMessage(await this.actor.applyBasicDamage(3, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}))\r\n}","mnvczEiu7gUSWvuV":"if (args.test.options.flags.skewering)\n{\n args.test.result.tables.critical = {\n label : \"Kritisch (bei erfolgreichem Angriff)\",\n class : \"critical-roll\",\n modifier : args.test.result.critModifier || 0,\n key: `crit${args.test.result.hitloc.result}`\n\n }\n}","MnXny8SCh6OceJc9":"return args.characteristic == \"int\"","MOZn375tGD2060cC":"const diff = foundry.utils.diffObject(this.item.toObject(), args.data);\r\nif (args.data?.system?.APdamage?.head > this.item.system.APdamage.head) {\r\n const result = await game.wfrp4e.tables.rollTable('armet-damage');\r\n this.script.message(result.result);\r\n if (result.total > 5) \r\n delete args.data.system.APdamage.head;\r\n}","Mp8UjuCLa9jdzhBS":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\n\r\nif (test.failed)\r\n{\r\n if (!this.actor.hasCondition(\"fatigued\"))\r\n {\r\n await this.actor.addCondition(\"fatigued\");\r\n }\r\n else\r\n {\r\n await this.actor.addCondition(\"blinded\");\r\n await this.actor.addCondition(\"deafened\");\r\n }\r\n \r\n if (((this.actor.hasCondition(\"blinded\").conditionValue || 0) + (this.actor.hasCondition(\"deafened\").conditionValue || 0)) > this.actor.system.characteristics.i.bonus)\r\n {\r\n await this.actor.addCondition(\"unconscious\"); \r\n }\r\n}","MPK7U4HLmIAsjdqs":"if (args.applyAP)\n{\n args.modifiers.ap.ignored += 2\n args.modifiers.ap.details.push(\"<strong>\" + this.effect.name + \"</strong>: Ignore 2 PA\");\n}","mPxmCsXYirAIT913":"let key = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.characteristics, this.effect.img), 1, \"Choose Characteristic\");\r\n\r\nthis.effect.updateSource({changes : [{key : `system.characteristics.${key[0].id}.modifier`, mode : 2, value : 10}]})","MQAMuPF4QqXl76SZ":"this.actor.addCondition(\"surprised\");","Mqbjr3t7IXwFnfCv":"if (this.item.flags.runeOfIron) return\n\n\nconst runesOfIron = this.item.effects.contents.filter(e => e.name == this.effect.name)\nconst ironWounds = parseInt(runesOfIron.length * 2)\nconst currentWounds = this.actor.system.status.wounds.value\n\nif (args.equipped) {\n this.item.flags.runeOfIron = true\n this.actor.modifyWounds(ironWounds)\n}\nelse\n{\n this.item.flags.runeOfIron = true\n this.actor.modifyWounds(-ironWounds)\n if (ironWounds > currentWounds) {\n this.script.message(`You have removed ${ironWounds} Wounds by unequipping Runic Armoour, but you only had ${currentWounds} Wounds remaining. This may trigger a critical injury.`)\n }\n}","mr8qm5Bg6k1idZ6Q":"return args.item?.name == \"Play (Lute)\"","MRH5rTTgUPdqo7SO":"return !args.item?.system.isRanged;","mRvLsSVxNyt8LVZb":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.GRRN3XAKIpEVCY7z\")\r\nlet data = item.toObject();\r\ndata.name += \" (To Be Determined)\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","MSJWJEUrX7ZmMvAD":"return !(args.skill?.name.includes(game.i18n.localize(\"NAME.Ranged\")) || args.item?.isRanged || args.item?.name == game.i18n.localize(\"NAME.Charm\"))","Msygc7oQQPB5fw0b":"let test = this.effect.sourceTest;\r\nif (test.failed && (test.result.roll % 11 == 0 || test.result.roll == 100))\r\n{\r\n\tlet points = await new Roll(\"1d10\").roll();\r\n\tgame.dice3d?.showForRoll(points)\r\n\tthis.actor.update({\"system.status.corruption.value\" : this.actor.system.status.corruption.value + points.total})\r\n\tthis.script.scriptMessage(`Gains ${points.total} Corruption`)\r\n}\r\nelse \r\n{\r\n\tlet points = this.effect.sourceTest.result.overcast.usage.other.current;\r\n\tthis.actor.update({\"system.status.corruption.value\" : this.actor.system.status.corruption.value - points})\r\n\tthis.script.scriptMessage(`Loses ${points} Corruption`)\r\n}","mT7PDcjF3cJTDbjR":"args.actor.system.details.move.value -= 1;\r\nargs.actor.system.status.carries.max *= 1.25;","mTnmPcjWmvScIBWY":"return args.skill?.name.includes(\"Channelling\") || args.type == \"channelling\"","mujAsg7US4R7eXhv":"if (args.skill?.name == game.i18n.localize(\"NAME.Pray\") || args.prayer)\n{\n args.abort = true;\n this.script.notification(\"Gebets-Proben können nicht durchgeführt werden!\")\n}\n\nreturn true;","mV4Tmc0yfpL09KV7":"args.actor.addCondition(\"entangled\")","MWtT4Mhf7F1hqemx":"let damage = this.effect.sourceTest.result.damage;\n\nawait this.actor.applyDamage(damage, {\n loc: \"roll\",\n damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP,\n createMessage: this.script.getChatData(),\n});\n\nawait this.actor.addCondition(\"ablaze\", 2);\n\nconst test = await this.actor.setupSkill(\n game.i18n.localize(\"NAME.Dodge\"),\n {\n skipTargets: true,\n appendTitle: ` — ${this.effect.name}`,\n },\n);\n\nawait test.roll();\n\nif (test.failed) {\n await this.actor.addCondition(\"prone\");\n await this.actor.addCondition(\"stunned\");\n}","MwUzyAgd0yPnmZCH":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.klCJX0mNpXYH5AIx\")\r\nlet data = item.toObject(); \r\ndata.name = data.name.replace(\"Target\", \"Strangers\");\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});","mXvtf3qhJjshpopX":"return [\"weapon\", \"cast\", \"channelling\"].includes(args.type)","Myl1Ishu9GBraYUZ":"this.actor.removeCondition(\"bleeding\")","mYL4i1vNlMl4vFYy":"return args.skill?.name != game.i18n.localize(\"NAME.Perception\") && args.skill?.name != game.i18n.localize(\"NAME.Track\");","mziJBUYcsrhkdcCJ":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (test.failed)\r\n{ \r\n this.actor.addCondition(\"prone\")\r\n}","N0h848GEkBbRDK2x":"this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.MVI0lXcg6vvtooAF\", this.effect);","N2MeOlf0GjPiRcSb":"let test = await this.actor.setupCharacteristic(\"dex\", {context : {failure : \"Drops the item\"}})\r\nawait test.roll();","n3bUmtYaVljPdcJW":"let roll = await new Roll(\"1d10 + @sin\", {sin: this.actor.system.status.sin.value || 0}).roll();\nroll.toMessage(this.script.getChatData());\n\nlet skills = await ItemDialog.create(this.actor.itemTypes.skill, \"unlimited\", {text: \"Select penalized Skills\", title: this.effect.name})\nlet names = skills?.map(i => i.name) || [];\nthis.effect.updateSource({name: this.effect.setSpecifier(names.join(\", \")), \"flags.wfrp4e.skills\" : names, duration: {\n value: roll.total,\n units: \"days\"\n}});","n5RJqJL9fdRIxkuN":"if (this.actor.system.status.advantage.value > 0)\r\n{\r\n await this.actor.modifyAdvantage(-1);\r\n this.script.scriptNotification(\"Advantage Subtracted\")\r\n}\r\nelse \r\n{\r\n return this.script.scriptNotification(\"Not enough Advantage!\", \"error\")\r\n}\r\n\r\nlet test = await this.actor.setupTrait(this.item)\r\nawait test.roll();","n5wowuDE8Dz1uBZn":"let damage = this.effect.sourceActor.characteristics.int.bonus + 6;\nif (this.actor.has(game.i18n.localize(\"NAME.Undead\")) || this.actor.has(game.i18n.localize(\"NAME.Daemonic\"))) { \n damage += 6\n}\nthis.script.scriptMessage(await this.actor.applyBasicDamage(damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}));\n\nlet test = await this.actor.setupCharacteristic(\"int\", {fields : {difficulty : \"average\"}, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed) {\n\tthis.actor.addCondition(\"stunned\");\n}","N6E9Jsd8n2ubCfz8":"for(let key in this.item.system.AP)\n{\n this.item.system.AP[key]++;\n}","N7nGncsPrTz2ZbDA":"return !args.options.dodge || !this.actor.isMounted","N8hA6ysHCTlLd8Kj":"let characteristics = {\n \"ws\" : 0,\n \"bs\" : 0,\n \"s\" : 0,\n \"t\" : 5,\n \"i\" : 15,\n \"ag\" : 0,\n \"dex\" : 10,\n \"int\" : 15,\n \"wp\" : 15,\n \"fel\" : 0\n}\nlet skills = [\"Channelling\", \"Cool\", \"Dodge\", \"Entertain (Storytelling)\", \"Intuition\", \"Language (Magick)\", \"Lore (Magic)\", \"Perception\"]\nlet skillAdvancements = [5, 15, 10, 10, 15, 10, 10, 20]\nlet talents = [\"Arcane Magic\", \"Petty Magic\", \"Second Sight\"]\nlet trappings = [\"Hand Weapon\", \"Quarterstaff\", \"Ritual Dress incorporating many ingredients and fetishes\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n items.push({name : trapping, type : \"trapping\", \"system.trappingType.value\" : \"clothingAccessories\"})\n //ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","N8oUaIkE2Ne571ia":"let roll = await new Roll(\"1d10 + @sin\", {sin: this.actor.system.status.sin.value || 0}).roll();\nroll.toMessage(this.script.getChatData());\n\nlet skills = await ItemDialog.create(this.actor.itemTypes.skill, \"unlimited\", {text: \"Select penalized Skills\", title: this.effect.name})\nlet names = skills?.map(i => i.name) || [];\nthis.effect.updateSource({name: this.effect.setSpecifier(names.join(\", \")), \"flags.wfrp4e.skills\" : names, duration: {\n value: roll.total,\n units: \"hours\"\n}});","n8X4Vgmrs4M5pyHK":"return !this.actor.isOpposing || this.actor.attacker.test.item.attackType != \"melee\" || !this.item.equipped.value","n99CqhPx3uABCU15":"if (args.test.result.critical && args.test.preData.reversal.allowed)\n{\n args.test.result.other.push(`<strong>${this.effect.name}</strong>: can reverse Critical Hit roll`)\n}","N9kA46ZQ9LiRjy6T":"return args.skill?.name == game.i18n.localize(\"NAME.Haggle\") || args.skill?.name == game.i18n.localize(\"NAME.Gossip\");","Na7Nanl9YmxZlTo7":"return args.type != \"cast\" && args.type != \"channelling\"","naF5EWr1CBkYRZTK":"if (args.opposedTest?.attackerTest?.item?.system?.isRanged) \r\n{\r\n let choice = await Dialog.wait({\r\n title: this.effect.name,\r\n content: `<p>Abort damage with <strong>${this.effect.name}</strong>?`,\r\n buttons: {\r\n yes: {\r\n label: \"Yes\",\r\n callback: () => {\r\n return true;\r\n }\r\n },\r\n no: {\r\n label: \"No\",\r\n callback: () => {\r\n return false;\r\n }\r\n }\r\n }\r\n })\r\n\r\n if (choice)\r\n {\r\n args.abort = `<strong>${this.effect.name}</strong>: Damage cancelled`\r\n }\r\n}","nCfWscZucItTYObJ":"if (args.item.type == \"ammunition\")\n{ \n args.item.system.damage.value += \" + 1\"\n}","ncIjDE6TFx88IQA1":"return args.skill?.name == game.i18n.localize(\"NAME.Climb\") || args.skill?.name == game.i18n.localize(\"NAME.Athletics\");","nCWAflBj7Si2BI1Q":"if (args.item.type == \"spell\" && args.item.system.lore.value != \"petty\")\r\n{\r\n args.item.cn.value = Math.max(4, args.item.cn.value * 2)\r\n}","Nd1djAF6dLEiLfwV":"let roll = await new Roll(\"1d10 + @sin\", {sin: this.actor.system.status.sin.value || 0}).roll();\nroll.toMessage(this.script.getChatData());\nthis.effect.updateSource({duration: {\n value: roll.total,\n units: \"rounds\"\n}});","nD2QVg3DrPK3foMf":"args.actor.setupSkill(\"Dodge\", { fields: { difficulty: \"average\" } }).then(async test => {\r\n await test.roll();\r\n if (test.failed) {\r\n await args.actor.addCondition(\"bleeding\")\r\n await args.actor.addCondition(\"entangled\")\r\n }\r\n })","NdquQqyuOkGCj8Uo":"let darkvision = await fromUuid(\"Compendium.wfrp4e-core.items.Item.JQa5DLnTs2SEzRrc\")\r\nlet fear = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\r\nlet acutesense = await fromUuid(\"Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS\")\r\nfear = fear.toObject();\r\nfear.system.specification.value = 1;\r\nacutesense = acutesense.toObject();\r\nacutesense.name += \" (Smell)\";\r\nthis.actor.createEmbeddedDocuments(\"Item\", [darkvision, fear, acutesense], {fromEffect : this.effect.id})","NDvNGATDM2xPFJK0":"brokenbone = await fromUuid(\"Compendium.wfrp4e-core.items.hCadFsTRvLN9faaY\")\r\nteeth = await fromUuid(\"Compendium.wfrp4e-core.items.fBcZhOBn8IpoVqQ1\")\r\ntongue = await fromUuid(\"Compendium.wfrp4e-core.items.rkJA1DlK51QuRlJy\")\r\nbrokenbone = brokenbone.toObject();\r\nteeth = teeth.toObject();\r\ntongue = tongue.toObject();\r\n\r\n\r\nlet roll = await new Roll(\"1d10\").roll();\r\nroll.toMessage(this.script.getChatData({flavor : \"Teeth Lost\"}))\r\n\r\nteeth.system.location.value = `${roll.total} ${teeth.system.location.value}`\r\nbrokenbone.system.location.value = \"Jaw\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [brokenbone, teeth, tongue])\r\n\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"vhard\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"unconscious\")\r\n}","neaaVy6D6tfcst5P":"args.fields.slBonus += this.actor.characteristics.i.bonus;\r\n","nEaF3jbCiVYD8jia":"return args.skill?.name != game.i18n.localize(\"NAME.Charm\") && !args.skill?.name.includes(game.i18n.localize(\"NAME.Lore\"));","NEKLTgJJsayC7tpF":"return [\"ws\", \"ag\"].includes(args.characteristic);","NgKdPxwH3vr6mkNi":"args.fields.slBonus += 3;","ngMm7SgtVqVovFJG":"if (args.test.result.critical && args.test.result.critical != \"Total Power\")\r\n{\r\n args.test.result.other.push(`<a class =\"table-click critical-roll\" data-modifier=\"20\" data-table = \"crit${args.test.result.hitloc.result}\"><i class=\"fas fa-list\"></i> Bonecrusher Critical (+20)</a> (only if Critical Cast selected)`)\r\n}","nGTxNWBUBgTr87wU":"if (args.opposedTest.result.differenceSL >= 0 && args.opposedTest.result.differenceSL <= 2 && args.opposedTest.result.winner == \"attacker\")\r\n{ \r\n this.script.message(`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\")})\r\n}\r\n ","NheyFTaMKupOgRJb":"await this.actor.addEffectItems([\"Compendium.wfrp4e-core.items.Item.0LdHytqyNmg2pcAX\", \"Compendium.wfrp4e-core.items.Item.4AqSkJnFPqNuTkos\", \"Compendium.wfrp4e-core.items.Item.x8jsChg17VQ9XgiK\"], this.effect)","nHJdlqbOP0ECgywb":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.CnydL8p3PVAuF98w\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","NI3ZzIAlpQfVSjvf":"if (isNaN(parseInt(this.item.system.specification.value)))\r\n{\r\n let value = await ValueDialog.create(\"Enter Fear value\", this.item.name);\r\n if (value)\r\n {\r\n this.item.updateSource({\"system.specification.value\" : value});\r\n }\r\n}","nIOeK0BrtdZeZW8X":"console.log(\"SKILL\", this)\r\n\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty : \"challenging\"}, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\n\r\nlet rollD10 = await new Roll(\"1d10\").roll()\r\nrollD10.toMessage(this.script.getChatData())\r\n\r\n\r\nif (test.succeeded)\r\n{\r\n //...\r\n}\r\nelse if (test.failed)\r\n{\r\n //...\r\n}\r\n","njmMhHf9qjPBCcNn":"args.targets.slBonus -= 3;","njPP9wDAsdh4WHIj":"if (args.totalWoundLoss > 0 && [\"trait\", \"weapon\"].includes(args.opposedTest.attackerTest.item?.type))\r\n{\r\n this.script.scriptMessage(`<b>Infected: ${args.actor.name}</b> must pass an <b>Easy (+40) Endurance</b> Test or gain a @UUID[Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb]{Festering Wound}`, {whisper: ChatMessage.getWhisperRecipients(\"GM\")})\r\n}","Nk6qAalTmc6UI2XQ":"const message = game.messages.get(args.options.message);\r\nconst sl = message.system.sl;\r\nthis.effect.setFlag(\"wfrp4e-archives3\", \"sl\", sl);","nkbTnaeBpthyhw4J":"let fortunePoints = this.effect.sourceTest.result.overcast.usage.other.current\r\nlet current = this.actor.status.fortune.value\r\n\r\nthis.actor.update({\"system.status.fortune.value\" : fortunePoints + current})\r\n\r\nthis.script.scriptMessage(`<b>${this.actor.prototypeToken.name}</b> fortune points increased from ${current} to ${fortunePoints + current}`)","nkdKBJ8ItqWiRAWL":"// Apply changes when the mask is worn\r\n\r\nif (args.equipped) { \r\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [this.item.effects.contents[1]?.convertToApplied()]) \r\n this.script.scriptMessage(`${this.actor.name} dons the <strong>${this.item.name}</strong>. <br>\r\n They gain +50 to Swim Tests and can breathe underwater.<br>\r\n 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}. \r\n `,\r\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \r\n}\r\n\r\n// Notify of lingering effects when mask is removed\r\nelse if (!args.equipped)\r\n{\r\n await this.item.effects.contents[0].delete();\r\n await this.item.update({name : this.item.name += \" (Used)\"})\r\n this.script.scriptMessage(`<strong>${this.item.name}</strong> 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.`, \r\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\r\n )\r\n \r\n}\r\n","NkqtQaLEGYst0PUO":"if (this.actor.has(\"Magic Resistance\", \"talent\")) \r\n return\r\n\r\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.eowbsW6oHGSNJmxV\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","nkSmu7v9WiAaK4vq":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Tailor)';\r\nconst difficulty = 'easy';\r\nconst target = 20;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","NkZrMO4YPiQf0N5Q":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"average\"}, context : {failure: \"1 Korrumpierungspunkt erhalten\"}})\nawait test.roll();\nif (test.failed && this.actor.type == \"character\")\n{\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\n this.script.message(\"1 Korrumpierungspunkt erhalten\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\n}","nlQA0shW8FCXjY7u":"return args.type != \"cast\" || args.item.lore.value != \"fire\"","nlSJDfv4N9hrncHW":"this.actor.addCondition(\"stunned\");","NMZ3Fb164tUfwChF":"return !args.data.targets[0]?.actor?.hasCondition(\"entangled\")","NnA4zpuO6iUXKhH7":"if ((args.opposedTest.attackerTest.item && args.opposedTest.attackerTest.item.isMelee) || (args.opposedTest.attackerTest.item && !args.opposedTest.attackerTest.item.name.includes(\"Ranged\")))\r\n{\r\n let AP = parseInt(this.effect.sourceTest.result.SL)\r\n args.modifiers.ap.value += AP;\r\n args.modifiers.ap.magical += AP;\r\n args.modifiers.ap.details.push(`${this.effect.name} (${AP})`)\r\n}","NnDq4miIPNEtZUWb":"args.test.result.critModifier = args.test.result.critModifier || 0;\r\nargs.test.result.critModifier += 20;\r\n\r\nif (args.test.result.critical)\r\n{\r\n args.test.result.critical = `${game.i18n.localize(\"Critical\")} (+${args.test.result.critModifier})`\r\n}","nNwAFEURKlFhPcvA":"CorruptionMessageModel.createCorruptionMessage(\"minor\", this.script.getChatData());","NNytXz5XFPrEF6dw":"if (args.opposedTest.result.hitloc.value == this.item.system.location.key && args.totalWoundLoss > 0)\r\n{\r\n args.actor.addCondition(\"bleeding\", 1);\r\n}\r\n ","NO685xdEW0NtJCp7":"let roll = await new Roll(\"1d10\").roll();\nroll.toMessage(this.script.getChatData());\nthis.effect.updateSource({\"duration\" : {value: roll.total, units: \"rounds\"}})","Np25JqEiaoqerEk8":"if (test.result.tables.miscast) {\n test.result.other.push(`<b>${this.effect.name}:</b> You may reroll any result from the @Table[waaagh-miscast]{Waaagh! Miscast Table}.`);\n}","Np8P8IPT2GYlrh6G":"return args.skill?.name !== `${game.i18n.localize(\"NAME.Language\")} (${game.i18n.localize(\"SPEC.Magick\")})` && args.type !== \"channelling\";","NqFvdCKDLqIXaE9m":"return args.weapon?.system.isMelee;","NQSvFWhmBQAyx5Zz":"return args.item?.isRanged","nqWu0ZplxzRiUEAg":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\n\r\n// Kind of insane but whatever\r\nlet opposedResult = test.opposedMessages[0]?.system.opposedHandler?.resultMessage?.system.opposedTest?.result\r\n\r\nreturn opposedResult?.winner == \"attacker\";","NrVFrIXM8GnIbojv":"args.item.system.damage.value = `SB + ${this.actor.system.characteristics.fel.bonus}`;","nSXzktHyNjGUXjaw":"return args.item?.system.isRanged","NTFpkiGyBpOtrV0s":"if (this.actor.uuid == this.effect.sourceActor.uuid)\n{\n\treturn;\n}\n\nif (this.actor.has(\"Kaltblütig\") && !this.actor.hasSystemEffect(\"nausea\")) {\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {appendTitle : `- ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n\n let myRoll = await new Roll(\"1d10\").roll({allowInteractive : false});\n let duration = myRoll.total\n this.actor.addSystemEffect(\"nausea\");\n this.script.scriptMessage(`Symptom Übelkeit hinzugefügt, Dauer: ${duration} Stunden`);\n}\n}\nreturn false;","nuIpPD4uaZRuJni8":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.qdMbxW09FUoYBzmB\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","Nuth9S5UHIhpEuIC":"args.fields.modifier -= 20","NvaPNfZt5d9RqKSE":"if (args.test.isCritical) {\n args.test.result.tables.critical.modifier \n = (typeof args.test.result.tables.critical.modifier ==='undefined') \n ? 20 \n : args.test.result.tables.critical.modifier + 20\n}","nvrFhHHVq3KzirlR":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"))\r\n","nvrT2HhsiGSycaff":"const excessSL = this.effect.sourceTest.result.baseSL - this.effect.sourceItem.system.sl;\nlet damage = 10;\ndamage += excessSL;\nawait this.actor.applyDamage(damage, {\n damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP,\n loc: \"roll\",\n createMessage: this.script.getChatData(),\n});\nawait this.actor.addCondition('deafened', 2);","NX9fApO15NQuTipW":"return [\"ws\", \"bs\"].includes(args.characteristic)","nxNqWmmF6mJTnrLo":"return args.weapon?.system.usesHands.includes(this.item.system.location.key);","nYtAjSArsNbrU2ob":"if ([\"ag\", \"i\", \"int\"].includes(args.characteristic))\r\n{\r\n args.fields.modifier -= 10;\r\n}\r\nelse if ([\"wp\"].includes(args.characteristic))\r\n{\r\n args.fields.modifier += 10;\r\n}","nzh8d46l1ikhkz8Q":"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\")","nZtN0zM49xTuG86V":"if (this.actor.system.status.advantage.value >= 2)\n{\n await this.actor.modifyAdvantage(-2);\n this.script.notification(\"Vorteil entfernt\")\n}\nelse\n{\n return this.script.notification(\"Vorteil entfernt\", \"error\")\n}\n\nlet test = await this.actor.setupTrait(this.item)\nawait test.roll();","o0dJxmnrWAZVkGKM":"if (args.opposedTest.attackerTest.weapon.attackType == \"ranged\" && args.opposedTest.defenderTest.weapon?.id == this.item.id)\n {\n args.modifiers.ap.shield += 2;\n }","O1FwJHbDqZHwaYK8":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();","o1zD8mej9TWKNxUq":"args.fields.slBonus -= 1;","o2QhtiLAmUEpDgBX":"return args.skill?.name != \"Segeln (Luftschiff)\"","o3JUBKLvE6bBxK2n":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), { fields: { difficulty: \"average\" } })\r\nawait test.roll();\r\nif (test.failed) \r\n{\r\n await this.actor.addCondition(\"prone\")\r\n let injury = await fromUuid(\"Compendium.wfrp4e-core.items.ZhMADOqoo0y8Q9bx\");\r\n injury = injury.toObject()\r\n let toes = Math.clamped(Math.abs(test.result.SL) + 1, 1, 5)\r\n injury.system.location.key = this.item.system.location.key[0] + injury.system.location.value\r\n if (injury.system.location.key[0] == \"r\")\r\n {\r\n injury.system.location.value = `${toes} Right ${injury.system.location.value}s`\r\n }\r\n else if (injury.system.location.key[0] == \"l\")\r\n {\r\n injury.system.location.value = `${toes} Left ${injury.system.location.value}s`\r\n }\r\n setProperty(injury, \"system.wfrp4e.count\", toes)\r\n this.actor.createEmbeddedDocuments(\"Item\", [injury])\r\n}","O45vpR4jDbQQnmvJ":"let items = [];\r\n\r\nlet etiquette = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.sYbgpSnRqSZWgwFP\")).toObject();\r\netiquette.name += \" (Followers of Khorne)\";\r\n\r\nitems.push(etiquette);\r\n\r\nlet animosity = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.Q2MCUrG2HppMcvN0\")).toObject();\r\nanimosity.name = animosity.name.replace(\"(Target)\", \"(Followers of Slaanesh)\");\r\n\r\nitems.push(animosity);\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect : this.effect.id});\r\n","o478K0vsLGzY8YTK":"return args.context.dispel","O7lXFZLrLdFaShGR":"args.options.catfall = true;","o88xuUConwt0vFLw":"let points = this.effect.sourceTest.result.overcast.usage.other.current;\r\n\r\nthis.actor.update({\"system.status.fortune.value\" : this.actor.system.status.fortune.value + points});\r\n\r\nthis.script.scriptMessage(`Gained ${points} Fortune Points`)","O9fc0hLHdkTgSuLg":"let bite = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\r\nlet venom = await fromUuid(\"Compendium.wfrp4e-core.items.gFkRm9wS65qe18Xv\")\r\nlet biteData = bite.toObject();\r\nlet venomData = venom.toObject();\r\n\r\nbiteData.system.specification.value = 3 - this.actor.characteristics.s.bonus;\r\nvenomData.system.specification.value = \"Average\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [biteData, venomData], {fromEffect : this.effect.id})","oA197GIqHpU5WR9V":"if (args.test.options.corruption || args.test.options.mutation)\n{ \n args.test.preData.canReverse = true;\n}","Oa9FmLXRRZRpLrrq":"let test = await this.actor.setupTrait(this.item); \r\nawait test.roll();","OAemeERMAeGv06pE":"let roll = await new Roll(\"1d5\").roll();\nroll.toMessage(this.script.getChatData());\nthis.actor.addCondition(\"ablaze\", roll.total);","OBF6r2CsMOEokAsS":"args.weaponProperties.damaging = true;\nargs.weaponProperties.impale = true;","obIXhQXKFyyQoNNV":"this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {appendTitle: ` - ${this.effect.name}`, fields: { difficulty: \"average\" } }).then(async test => {\r\n await test.roll()\r\n if (test.failed) {\r\n this.actor.modifyWounds(-1);\r\n this.script.scriptMessage(\"Takes 1 Damage\")\r\n }\r\n})","ocBW3osTFnb5JCfe":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MVI0lXcg6vvtooAF\")\r\nlet data = item.toObject()\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\r\n","OCFrGXAYfo9OYnhc":"return args.item?.system.magicMissile?.value || args.item?.system.attackType","OcQe0zfksf1DCJYe":"args.actor.system.characteristics.s.value += 30\r\nargs.actor.system.characteristics.t.value += 30\r\n\r\nargs.actor.system.characteristics.s.bonus += 3\r\nargs.actor.system.characteristics.t.bonus += 3\r\n\r\nif (args.actor.system.characteristics.s.value > 100)\r\n{\r\n args.actor.system.characteristics.s.value = 100\r\n args.actor.system.characteristics.s.bonus = 10\r\n}\r\n\r\nif (args.actor.system.characteristics.t.value > 100)\r\n{\r\n args.actor.system.characteristics.t.value = 100\r\nargs.actor.system.characteristics.t.bonus = 10\r\n}","oDNfCNyt5KaUYmg2":"if(args.opposedTest.result.winner == \"defender\")\r\n{\r\n let roll = Math.ceil(CONFIG.Dice.randomUniform() * 10)\r\n let msg = `Rolled ${roll}.`\r\n if (roll >= 7)\r\n {\r\n msg = `Attack hits with an SL of ${roll - 6}.`\r\n }\r\n this.script.scriptMessage(msg, {blind: true, whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n}","OeCgX3hIsfLfmGvC":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Perception\"))\r\nawait test.roll();\r\nif (test.succeeded)\r\n{\r\n this.actor.removeCondition(\"surprised\");\r\n}","OeKeQAAcJhdI4Qky":"if (this.actor.hasCondition(\"stunned\") || this.actor.hasCondition(\"unconscious\"))\r\n{\r\n\tthis.script.scriptNotification(\"Disabled!\");\r\n\tawait this.effect.update({\"disabled\" : true})\r\n}","oEsUsI74yGTZ9CwU":"return args.item?.name == game.i18n.localize(\"NAME.CharmAnimal\")","OEy2lxvic37dRBEt":"let filters = [\r\n {\r\n property : \"type\",\r\n value : \"spell\"\r\n },\r\n {\r\n property : \"system.lore.value\",\r\n value : \"petty\"\r\n }\r\n]\r\n\r\nlet petty = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 3, \"Choose 3 Petty Spells\")\r\n\r\n\r\nfilters = [\r\n {\r\n property : \"type\",\r\n value : \"spell\"\r\n },\r\n {\r\n property : \"system.lore.value\",\r\n value : \"\"\r\n }\r\n]\r\n\r\nlet arcane = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 3, \"Choose 3 Arcane Spells\")\r\n\r\nlet items = petty.concat(arcane).map(i => i.toObject())\r\n\r\nthis.actor.createEmbeddedDocuments(\"Item\", items);","OF4sSVOvHoKuPk7L":"if (this.item.flags.burning) return\nconst runesOfBurning = this.item.effects.contents.filter(e => e.name == this.effect.name)\nconst ablaze = runesOfBurning.length\nargs.actor.addCondition(\"ablaze\", ablaze)\nargs.extraMessages.push(\n \"<strong>\" + this.effect.name + \"</strong>: \"\n + ablaze + \" @Condition[Ablaze] Conditions\")\nthis.item.flags.burning = true","ofddAHvzn1xUueSG":"args.AP.head.value -= tinDifference(args.AP.head.layers)\r\nargs.AP.body.value -= tinDifference(args.AP.body.layers)\r\nargs.AP.lArm.value -= tinDifference(args.AP.lArm.layers)\r\nargs.AP.rArm.value -= tinDifference(args.AP.rArm.layers)\r\nargs.AP.rLeg.value -= tinDifference(args.AP.rLeg.layers)\r\nargs.AP.lLeg.value -= tinDifference(args.AP.lLeg.layers)\r\n\r\nfunction tinDifference(layers)\r\n{ \r\n let metalAP = layers.filter(i => i.metal).reduce((prev, current) => prev + current.value, 0)\r\n\r\n let tinAP = layers.filter(i => i.metal).reduce((prev, current) => prev + Math.max(0, current.value - 2), 0)\r\n\r\n return metalAP - tinAP;\r\n}","ofijDpDzoLphIp8R":"this.actor.addEffectItems(\"Compendium.wfrp4e-helf.items.Item.PfqCi0tJN1ZxtwVi\");","Ofn6vDbP3fZ4UlSc":"args.fields.modifier += -20;\r\n ","OFViRemr1cpnO3af":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"difficult\"}, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (!test.succeeded)\n{\n await this.actor.addCondition(\"bleeding\");\n}","oGdsGPgJWcyWkiWl":"this.actor.addCondition(\"broken\")\r\n\r\nif (this.actor.has(game.i18n.localize(\"NAME.Undead\")))\r\n{\r\n this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true}))\r\n}","ogJBAXTXyhTqACPO":"return args.item?.system.attackType != \"melee\"","OgSI0Z6SHjYuqKIz":"let blows = this.item.getFlag(\"wfrp4e\", \"blows\") || 0\r\nlet difficulties = Object.keys(game.wfrp4e.config.difficultyLabels)\r\n\r\nblows = Math.clamped(blows, 0, difficulties.length - 1)\r\nif (this.item.system.protects[args.opposedTest.result.hitloc.value])\r\n{\r\n let difficulty = difficulties[blows];\r\n this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields: {difficulty}, skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => {\r\n await test.roll();\r\n if (test.failed)\r\n {\r\n this.script.scriptMessage(`${this.actor.name} must break from combat and flee until they pass a <strong>Challenging (+0) Willpower</strong> Test`);\r\n this.item.setFlag(\"wfrp4e\", \"failedCool\", true);\r\n }\r\n })\r\n}","OGX4BneaYAnV25TO":"let chatData = { whisper: ChatMessage.getWhisperRecipients(\"GM\") }\r\nlet message = \"\"\r\n\r\nlet wounds = duplicate(this.actor.status.wounds)\r\nlet regenRoll = await new Roll(\"1d10\").roll();\r\nlet regen = regenRoll.total;\r\n\r\nif (wounds.value >= wounds.max)\r\n return\r\n\r\nif (wounds.value > 0) \r\n{\r\n wounds.value += regen\r\n if (wounds.value > wounds.max)\r\n {\r\n wounds.value = wounds.max\r\n }\r\n message += `<b>${this.actor.name}</b> regains ${regen} Wounds.`\r\n\r\n if (regen == 10)\r\n {\r\n message += `<br>Additionally, they regenerate a Critical Wound.`\r\n }\r\n}\r\nelse if (regen >= 8) \r\n{\r\n message += `<b>${this.actor.name}</b> rolled a ${regen} and regains 1 Wound.`\r\n wounds.value += 1\r\n if (regen == 10)\r\n {\r\n message += `<br>Additionally, they regenerate a Critical Wound.`\r\n }\r\n}\r\nelse \r\n{\r\n message += `<b>${this.actor.name}</b> Regenerate roll of ${regen} - No effect.`\r\n}\r\n\r\nawait this.actor.update({ \"system.status.wounds\": wounds })\r\nthis.script.scriptMessage(message, { whisper: ChatMessage.getWhisperRecipients(\"GM\") })","oHenUKtaS3jT5xQn":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.4xF7M6ylIiGntekh\")\r\nitem = item.toObject()\r\nitem.name = this.effect.name\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})\r\n","ohl803m0tUwNfKAk":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = 5 - this.actor.characteristics.s.bonus\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","oHmtdXWVwm7y7BtO":"args.fields.difficulty = \"hard\";","OicQSEVZBbqLtrcf":"let choice = await ItemDialog.create(this.actor.itemTypes.critical, (this.effect.sourceTest.result.overcast.usage.other.current || 1), \"Choose the Critical Wounds to heal (cannot reattach body parts)\")\r\n\r\nthis.script.scriptMessage(`Healed <strong>${choice.map(i => i.name).join(`, `)}</strong>`);\r\nthis.actor.deleteEmbeddedDocuments(\"Item\", choice.map(i => i.id))","OJMgS8ZQv0j4tEFf":"return [\"ws\", \"bs\", \"s\", \"fel\", \"ag\", \"t\", \"dex\"].includes(args.characteristic)","OKivTxfbKZw5Lj3V":"return args.type === \"cast\" && [\"daemonology\", \"necromancy\"].includes(args.spell?.system.lore.value);","okr3TtzpFoefUuJS":"let item = await fromUuid('Compendium.wfrp4e-core.items.EaqlLRQigwnsEAXX')\r\nlet data = item.toObject();\r\ndata.system.location.value = \"Collar Bone\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","okW06V9UiPC4Vcrn":"let characteristics = {\n \"ws\" : 5,\n \"bs\" : 0,\n \"s\" : 5,\n \"t\" : 5,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 5,\n \"fel\" : 5\n}\nlet skills = [\"Cool\", \"Dodge\"]\nlet skillAdvancements = [10, 10]\nlet talents = [\"Combat Reflexes\", \"Resolute\"]\nlet trappings = [\"Leather Jack\", \"Leather Leggings\", \"Leather Skullcap\", \"Hand Weapon\", \"Spear\", \"Shield\"]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","OMAUX1fnHyIpplul":"return ![\"fel\", \"dex\"].includes(args.characteristic)","On1itZhp0AOzNyyc":"let test = await this.actor.setupSkill(\"Runesmithing\", {appendTitle: ` - ${this.effect.name}`});\nawait test.roll();\nthis.effect.update({\"disabled\" : true});","OnkEe4ISru1hjJWP":"this.actor.flags.useless[this.item.system.location.key] = true;","Op88kMtimSEWlY2h":"if (this.item.system.quantity.value)\r\n{\r\n\tthis.item.system.reduceQuantity();\r\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\r\n\tactor.applyEffect({effectData : [this.item.effects.contents[1].convertToApplied()]})\r\n}\r\nelse\r\n{\r\n\tthis.script.scriptNotification(\"None left!\", \"error\")\r\n}","oPg4se8iQRD14kmB":"let filters = [\r\n {\r\n property : \"type\",\r\n value : \"weapon\"\r\n },\r\n {\r\n property : \"system.weaponGroup.value\",\r\n value : [\"twohanded\", \"polearm\"]\r\n }\r\n]\r\n\r\nlet items = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 1, \"Choose an appropriate Polearm or Two-Handed Weapon\")\r\nitems = items.map(i => i.toObject())\r\n\r\nitems.forEach(i => equip(i))\r\n\r\nthis.actor.createEmbeddedDocuments(\"Item\", items);\r\n\r\nfunction equip(item)\r\n{\r\n if (item.type == \"armour\")\r\n item.system.worn.value = true\r\n else if (item.type == \"weapon\")\r\n item.system.equipped = true\r\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\r\n item.system.worn = true\r\n}","oqgd9G6oI1ncPYLw":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.CV9btQn09S9Fn8Jk\");\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id});","oQI06eh8mJ9UqETO":"if (this.item.system.disabled) {\n await this.effect.deleteCreatedItems();\n} else if (!this.actor.items.find(i => i.name === \"Furtif\")) {\n await this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.OzwDT6kzoLYeeR2d\", this.effect);\n}","OqLKL0PiCvYH2QxW":"if (args.test.options.wallcrawler)\r\n{\r\n\tif (parseInt(args.test.result.SL) < 0 || args.test.failed)\r\n\t{\r\n\t\tif (parseInt(args.test.result.SL) < 0)\r\n\t\t{\r\n\t\t\targs.test.result.SL = \"+0\";\r\n\t\t\targs.test.result.description = game.i18n.localize(\"ROLL.MarginalSuccess\");\r\n\t\t}\r\n\t\targs.test.result.outcome = \"success\"\r\n args.test.result.other.push(`<strong>${this.effect.name}</strong>: Minimum +0 SL`)\r\n\t}\r\n}","OqxeuZfZDfm9ax6h":"this.actor.system.status.addArmour(1, {locations : \"head\", source : this.effect})","OsLXutfXyQCAkhAf":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Sail';\r\nconst difficulty = 'average';\r\nconst target = 30;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","oTXPA6rbPnYOKNmo":"let characteristics = {\n \"ws\" : 35,\n \"bs\" : 10,\n \"s\" : 25,\n \"t\" : 30,\n \"i\" : 30,\n \"ag\" : 25,\n \"dex\" : 0,\n \"int\" : 15,\n \"wp\" : 35,\n \"fel\" : 15\n}\nlet skills = [\"Besonnenheit\", \"Ausweichen\", \"Einschüchtern\", \"Intuition\", \"Sprache (Schlachtenzunge)\", \"Anführen\" , \"Wissen (Kriegsführung)\", \"Wahrnehmung\"]\nlet skillAdvancements = [25, 15, 25, 25, 15, 30, 20, 20]\n\nlet talents = [\"Kampfsinn\", \"Meisterkämpfer\", \"Kampfreflexe\", \"Inspirierend\", \"Glückspilz\", \"Entschlossen\", \"Unerschütterlich\", \"Mitreißender Anführer\"]\nlet trappings = [\"Waffe\", \"Schild\", \"Kürass\", \"Plattenarme\", \"Helm\", \"Plattenbeine\"]\nlet specialItems = [\n {name: \"Two Handed Weapon\", type: \"trapping\", trappingType: \"clothingAccessories\" },\n]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let item of specialItems) {\n let newItem\n if (item.type == \"weapon\") {\n newItem = new ItemWFRP4e({ name: item.name, type: item.type, system: { equipped: true, damage: {value: item.damage}} })\n } else if (item.type == \"trapping\") {\n newItem = new ItemWFRP4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type, system: { worn: true, trappingType: { value: item.trappingType} } } )\n } else {\n newItem = new ItemWFRP4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type })\n }\n items.push(newItem.toObject())\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else\n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else\n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings)\n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n trappingItem.system.equipped.value = true;\n\n items.push(trappingItem);\n }\n else\n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nlet filters = [\n {\n property : \"type\",\n value : \"weapon\"\n },\n {\n property : \"system.weaponGroup.value\",\n value : [\"twohanded\", \"polearm\"]\n }\n]\n\nitems = items.concat(await ItemDialog.createFromFilters(filters, 1, {text: \"Wähle eine passende Stangenwaffe oder zweihändige Waffe\"}))\n\nlet ride = await foundry.applications.api.DialogV2.confirm({window : {title : \"Fähigkeit\"}, content : \"Chaos Steed und +20 auf Reiten (Pferd) hinzufügen?\"})\n\nif (ride)\n{\n let skill = await game.wfrp4e.utility.findSkill(\"Reiten (Pferd)\")\n skill = skill.toObject();\n skill.system.advances.value = 20;\n items = items.concat({name : \"Chaos Steed\", type: \"trapping\", \"system.trappingType.value\" : \"misc\"}, skill)\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nconsole.log(\">>>>>>><\", items)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n","OUef2n36h6lbrsjx":"if (!this.item.system.properties.qualities.precise) this.item.system.qualities.value.push({name : 'precise'})","oV81zgbZsuTFG6L2":"let caster = this.effect.sourceActor;\r\n\r\nthis.actor.modifyWounds(caster.system.characteristics.fel.bonus);\r\n\r\nthis.script.scriptMessage(`Healed ${caster.system.characteristics.fel.bonus} Wounds`);","OvIELZLvnlN2H2uw":"args.update({light : {\r\n \"dim\": 2,\r\n \"bright\": 1,\r\n \"alpha\": 0.5,\r\n \"animation\": {\r\n \"speed\": 4,\r\n \"intensity\": 4,\r\n \"type\": \"pulse\",\r\n },\r\n \"color\": \"#949bff\",\r\n}});","oW1gtYVT5nrxDjM7":"return args.characteristic != \"ag\"","oWa7RkScnl6lR5vd":"if (args.test.characteristicKey == \"wp\") \r\n{\r\n if (args.test.failed)\r\n {\r\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.AGcJl5rHjkyIQBPP\")\r\n let data = item.toObject();\r\n this.actor.createEmbeddedDocuments(\"Item\", [data])\r\n \r\n this.script.scriptMessage(`Willpower Test failed, <b>${this.actor.prototypeToken.name}</b> gains @UUID[Compendium.wfrp4e-core.items.AGcJl5rHjkyIQBPP] for [[1d10]] hours`)\r\n }\r\n}","oWM43EdUiyHgUlfW":"if (args.test.item && args.test.item.name == game.i18n.localize(\"NAME.ConsumeAlcohol\"))\r\n args.test.preData.canReverse = true","OXoqtpOdfkURZbuL":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.yRhhOlt18COq4e1q\")\r\nlet data = item.toObject()\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\r\n","OxsBnnVI3Smpknpb":"if (this.actor.status.advantage.value && !this.actor.sameSideAs(this.effect.sourceActor))\r\n{\r\n this.actor.modifyAdvantage(-1);\r\n this.script.scriptNotification(`${this.actor.name} loses 1 Advantage`);\r\n}","OYLqLl6vikJD8flg":"const crowd = this.effect.getFlag(\"wfrp4e\", \"crowd\") ?? 0;\nconst bonus = 2 + Math.floor(crowd * 0.1);\n\nargs.fields.slBonus += bonus ;","OYRUSP7Q0Je0jdCY":"let species = await ValueDialog.create({text : \"Zielspezies eingeben\", title : this.effect.name})\n\nthis.effect.updateSource({name : this.effect.setSpecifier(species)});","Oz7pWF9mEc1pQypj":"let roll = await new Roll(\"1d10\").roll();\r\nroll.toMessage({flavor : this.effect.name, speaker : {alias : this.actor.prototypeToken.name}})\r\nthis.actor.addCondition(\"stunned\", roll.total)","p222EiR8RRtlPm31":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\r\nawait test.roll();\r\nreturn test.failed;","P29tT1eMMdAw3CPF":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.3S4OYOZLauXctmev\")\r\nlet data = item.toObject();\r\ndata.system.location.key = this.item.system.location.key\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\r\n\r\n\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"hard\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n\tthis.actor.addCondition(\"unconscious\")\r\n}","p7NJB1PsY6X5q8OO":"if (this.actor.system.details.experience.current < 100) {\r\n return this.script.notification(game.i18n.localize(\"SCRIPT.NotEnoughXP\"))\r\n}\r\n\r\nlet traits = await warhammer.utility.findAllItems(\"trait\");\r\ntraits = traits.filter(t => t.name.includes(\"Companion Trait\"));\r\n\r\nlet items = await ItemDialog.create(traits);\r\nthis.actor.createEmbeddedDocuments(\"Item\", items);\r\nlet expLog = foundry.utils.duplicate(this.actor.details.experience.log || []);\r\nexpLog.push({amount : 100, reason: items[0].name, spent: this.actor.details.experience.spent + 100, total: this.actor.details.experience.total, type: \"spent\"});\r\nthis.actor.update({\r\n \"system.details.experience.spent\": this.actor.details.experience.spent + 100,\r\n \"system.details.experience.log\": expLog\r\n });","pAgiAGyaLJY10894":"return args.skill?.name == game.i18n.localize(\"NAME.Charm\");","PaiSiMxCKx9IWmn1":"this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.system.status.corruption.value) + 1});\nthis.script.notification(\"Korruption hinzugefügt\");","pBMioPUtDn1mk9f5":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.5KP9sOoLSGvj9EXp\")\r\nlet data = item.toObject(); \r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});","PBW6IZtwawNHxB6y":"return args.options.dodge && this.actor.isMounted","Pc98GFZjvokeyUcs":"let roll = await new Roll(\"1d10\").roll();\nroll.toMessage(this.script.getChatData());\nthis.effect.updateSource({duration: {\n value: roll.total,\n units: \"rounds\"\n}});","PdClojv7yNgQpOUc":"return args.skill?.name != game.i18n.localize(\"NAME.Endurance\");","pdvCwjxHI56EmxuU":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.sJ3yX1kvzu2hgNq5\")\nlet amphibious = item.toObject();\n\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS\")\nlet as = item.toObject();\nas.name += \" (Sight)\";\nawait this.actor.createEmbeddedDocuments(\"Item\", [amphibious, as], {fromEffect : this.effect.id})","PeZYj8b0vedyJj00":"// This script needs to be separate because equipTransfer is off on the other effect, and thus won't execute when added to an actor\r\n\r\nlet mainEffect = this.item.effects.contents[0];\r\nif (mainEffect.name.includes(\"(Lore)\"))\r\n{\r\n let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, \"Choose Lore\");\r\n if (choice.length)\r\n {\r\n mainEffect.update({name : mainEffect.name.replace(\"Lore\", choice[0].name)})\r\n this.item.update({name : this.item.name += ` (${choice[0].name})`})\r\n }\r\n}\r\n\r\nthis.effect.delete();","pG5OVokZzCRHIrwz":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.mgeiaDZXei7JBEgo\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","Pg9C6nJX5QHIdqa9":"return !args.item?.system.attackType\r\n","PGHvFHBIygB5pnWT":"args.actor.addCondition(\"ablaze\", 1)\nargs.extraMessages.push(\n \"<strong>\" + this.effect.name + \"</strong>: 1 Zustand @Condition[Ablaze] hinzugefügt\")","Ph3TdQw1lGiFr049":" if (!args.test.context.phantasmal && \r\n (this.actor.isOpposing || args.test.context.defending) && \r\n args.test.result.roll % 11 == 0 && \r\n args.test.succeeded && \r\n [\"Language (Magick)\", \"Dodge\"].includes(args.test.item?.name))\r\n {\r\n args.test.context.phantasmal = true; // Flag so items aren't readded if test is edited\r\n let text = `<strong>${this.effect.name}</strong>: Adding Unstable and Ward`\r\n args.test.result.other.push(text) \r\n this.script.scriptNotification(text);\r\n \r\n let ward = await fromUuid(\"Compendium.wfrp4e-core.items.Bvd2aZ0gQUXHfCTh\")\r\n let wardData = ward.toObject();\r\n wardData.system.specification.value = 9;\r\n \r\n let unstable = await fromUuid(\"Compendium.wfrp4e-core.items.D0ImWEIMSDgElsnl\")\r\n let unstableData = unstable.toObject();\r\n this.actor.createEmbeddedDocuments(\"Item\", [wardData, unstableData], {fromEffect: this.effect.id})\r\n }\r\n","pHyXdPnWwoFrUA5n":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Entertain\"));","PI1QNaKFeqood6d7":"if (args.attackerTest.weapon && args.defenderTest.weapon)\r\n{\r\n\r\n let attackerReach = game.wfrp4e.config.reachNum[args.attackerTest.weapon.reach.value]\r\n let defenderReach = game.wfrp4e.config.reachNum[args.defenderTest.weapon.reach.value]\r\n \r\n if (attackerReach == defenderReach)\r\n attackerReach = attackerReach < 7 ? attackerReach + 1 : attackerReach\r\n\r\n attackerReach = game.wfrp4e.utility.findKey(attackerReach, game.wfrp4e.config.reachNum)\r\n defenderReach = game.wfrp4e.utility.findKey(defenderReach, game.wfrp4e.config.reachNum)\r\n\r\n args.attackerTest.weapon.reach.value = attackerReach\r\n args.defenderTest.weapon.reach.value = defenderReach\r\n}","pj7gjxHrnrZonC6U":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.8pVzgPkgWpTJvfhG\")\nlet data = item.toObject();\ndata.name = `${data.name} (Mort-vivant, Warm-bloods)`;\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","PjOi61gB2nSYooLs":"return this.sourceActor.uuid === this.actor.uuid || !args.item?.system?.isRanged;","PjRxGuUDKGmSmVDc":"fromUuid(\"Compendium.wfrp4e-core.items.EO05HX7jql0g605A\").then(item => {\r\n item = item.toObject()\r\n item.system.specification.value = this.actor.characteristics.ag.value\r\n this.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})\r\n})","PkHrZiuFokN0OyXi":"if (args.test.result.critical)\n{ \n args.test.result.other.push(`<strong>${this.effect.name}</strong>: Can reverse Critical Wound roll`)\n}","pkKpxVqRHIzywerL":"const ablaze = this.actor.hasCondition(\"ablaze\");\r\n\r\nif (ablaze) {\r\n ablaze.delete();\r\n this.script.scriptNotification(\"Resisted Ablaze\");\r\n}","pLKv4moua6XhNdmA":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.1dUizIgLBgn4jICC\");\r\nlet data = item.toObject();\r\ndata.name += \" (Woodlands)\";\r\nthis.actor.createEmbeddedDocuments(\"Item\", Array(this.effect.sourceTest.result.overcast.usage.other.current).fill(data), {fromEffect : this.effect.id})","PmELrzD3RmF9qKkO":"if (this.item.system.specification.value == \"Size\")\r\n{\r\n let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.actorSizes, this.item.img), 1, \"Choose Size\");\r\n if (choice[0])\r\n {\r\n this.item.updateSource({\"system.specification.value\" : choice[0].name})\r\n this.effect.updateSource({name : this.effect.name + ` (${choice[0].name})`})\r\n }\r\n}","PMISUsaEDBA7D3od":"// After consumption, the user gains the Magic Resistance 3 Creature Trait, \r\n// reducing the SL of any spell affecting it by 3. \r\n// This effect lasts for one hour.\r\nconst hasMagicResistance = this.actor.has(\"Magic Resistance\")\r\n\r\nif (hasMagicResistance === undefined) {\r\n fromUuid(\"Compendium.wfrp4e-core.items.yrkI7ATjqLPDTFmZ\").then(trait => {\r\n let traitItem = trait.toObject()\r\n traitItem.system.specification.value = 2\r\n this.actor.createEmbeddedDocuments(\"Item\", [traitItem], {fromEffect: this.effect.id})\r\n })\r\n this.script.scriptMessage(`<p><strong>${this.actor.prototypeToken.name}</strong> has gained the Magic Resistance Trait. This effect lasts for one hour.</p>`, {whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true }) \r\n}\r\n\r\nif (hasMagicResistance) {\r\n // 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. \r\n let msg = `<p><strong>${this.actor.prototypeToken.name}</strong> has enhanced their Magic Resistance by 1 to Rating ${parseInt(hasMagicResistance.system.specification.value)}. This effect lasts for one hour.</p>`\r\n\r\n // Resist toxic effect\r\n this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {\r\n fields: {difficulty: \"challenging\"}\r\n }).then(async test => {\r\n await test.roll()\r\n\r\n // If they fail ...\r\n if (!test.succeeded) {\r\n msg += `<p>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.</p>\r\n <p>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.</p>`\r\n this.actor.addCondition(\"poisoned\", 1)\r\n }\r\n this.script.scriptMessage(msg, {whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true })\r\n })\r\n}\r\n","PMNjdEAusVBfam09":"return args.skill?.name === game.i18n.localize(\"NAME.Charm\");","Pn5fekTbkwlr61XU":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Engineer)';\r\nconst difficulty = 'easy';\r\nconst target = 10;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","pnB9TzSEytkxk3Rb":"return this.actor.hasSystemEffect(\"infighting\")","pNPjXEoQGHLKzq0r":"let talent = this.actor.has(\"Arcane Magic (Light)\", \"talent\")\r\nlet demon = this.actor.has(game.i18n.localize(\"NAME.Daemonic\"))\r\n\r\nif (!talent)\r\n{\r\n await this.actor.addCondition(\"blinded\")\r\n}\r\n\r\nif (demon)\r\n{\r\n await this.actor.addCondition(\"stunned\")\r\n}","PoNnT5EqvLj2r5yf":"return args.skill?.name != game.i18n.localize(\"NAME.OutdoorSurvival\") && args.skill?.name != game.i18n.localize(\"NAME.Track\");","ppc8L3WtIx6JzlAd":"if (args.equipped) {\n await this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.mDgEMOoJpi8DkRYb\", this.effect);\n} else {\n this.effect.deleteCreatedItems()\n}","pPV9oEydXb7oi6jX":" if (args.totalWoundLoss > 0)\r\n {\r\n args.actor.addCondition('ablaze')\r\n }","pq1YQffxtOcqCRTn":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {appendTitle: ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (!test.succeeded)\r\n{\r\n this.actor.addCondition(\"prone\")\r\n}","pqpU9J1x23YLwWYG":"this.item.system.encumbrance.value = Math.max(0, this.item.system.encumbrance.value - 2)","pqQkeUVpuZ0jOKnZ":"const tables = [\n game.wfrp4e.tables.findTable(\"mutatephys\"),\n game.wfrp4e.tables.findTable(\"mutatephys\", \"Khorne\"),\n];\n\nif (!tables.length) {\n return ui.notifications.error(\"Mutationstabelle nicht gefunden, bitte stelle sicher, dass eine Tabelle mit dem Schlüssel `mutatephys` in die Welt importiert wurde.\");\n}\n\nconst values = {}\n\nlet i = 0;\nfor (const table of tables) {\n values[i] = table.name;\n i++;\n}\n\nconst key = await ValueDialog.create({}, null, values);\nconst table = tables[key];\n\nconst results = (await table.drawMany(2)).results;\nconst uuids = results.map(result => `Compendium.${result.documentCollection}.${result.documentId}`);\n\nawait this.actor.addEffectItems(uuids, this.effect);\nthis.script.notification(\"Mutationswurf durchgeführt und angewendet\");","pR4Q2OnPxXtwRVli":"let criticals = this.actor.itemTypes.critical;\r\n\r\nif (criticals.length)\r\n{\r\n this.script.scriptNotification(\"Cannot suffer Critical Wounds\");\r\n this.actor.deleteEmbeddedDocuments(\"Item\", criticals.map(i => i.id))\r\n}\r\n\r\nif (getProperty(args.data, \"system.status.wounds.value\") == 0)\r\n{\r\n this.script.scriptNotification(`Dormant for ${Math.ceil(CONFIG.Dice.randomUniform() * 10)} Rounds`)\r\n}","pRp6hoBJ0JQa4NNG":"return args.item?.system?.attackType != \"ranged\" || this.actor.system.canFly.effects.filter(e => e.name != \"Flying\")[0].disabled","pSfA9mBk9Uw8QMLj":"return args.weapon?.system.isRanged;","PsO7aTdELJt35eHP":"let morale = await new Roll(\"-1d10\").roll();\r\nlet mood = await new Roll(\"-2d10\").roll();\r\n\r\nmorale.toMessage(this.script.getChatData({flavor : \"Morale\"}));\r\nmood.toMessage(this.script.getChatData({flavor : \"Manann's Mood\"}));\r\n\r\nawait this.actor.system.status.morale.addEntry(\"Albatross Died\", morale.total)\r\nawait this.actor.system.status.mood.addEntry(\"Albatross Died\", mood.total);\r\n\r\nthis.effect.delete();","Puv2wLrSVe6b1jLf":"if (args.sizeDiff < 0 ) {\n args.damage += 3\n args.breakdown.other.push({label : this.effect.name, value : 3});\n}","PVjaKAHTKDA0rA9J":"let test = await this.actor.setupSkill(\"Dodge\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\r\nawait test.roll();","pvk5OhTNdVgwXoUa":"args.fields.successBonus += 2;","pVSnn4Zw6y1EBDhv":"args.actor.system.details.man -= 1;\r\nargs.actor.system.details.move.value -= 1;","pvTcazVvW4v04otW":"if (args.totalWoundLoss > 0) {\n await args.actor.addCondition(\"poisoned\", 2)\n}","PWHKisZTZEgCANd8":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Dodge\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed)\n{\n\tlet sourceActor = this.effect.sourceActor;\n\tthis.script.message(await this.actor.applyBasicDamage(4 + sourceActor.system.characteristics.s.bonus, {suppressMsg : true}))\n}","PwqTmw7rsG8hzqCS":"if (args.test.result.critical && args.test.result.roll % 10 == 0) \r\n{\r\n game.wfrp4e.tables.findTable(\"knuckleduster-diseases\").roll().then(roll => {\r\n let results = roll.results[0]\r\n\r\n this.script.scriptMessage(`<strong>${this.actor.name}</strong> contracts @UUID[Compendium.${results.documentCollection}.${results.documentId}]{${results.text}}`, {blind : true, whisper: ChatMessage.getWhisperRecipients(\"GM\") })\r\n })\r\n\r\n }\r\n\r\n","px7eEdhOEt7zOTrq":"return [\"int\", \"t\", \"wp\", \"i\"].includes(args.characteristic)","pzimrxrqpv282Oqb":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.TaYriYcJkFuIdBKp\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id});\r\n","pzknBcJtZWeliE27":"return args.item?.name == game.i18n.localize(\"NAME.Leadership\") || args.item?.name == game.i18n.localize(\"NAME.Cool\")","q0LvphC8RDSyR0oY":"let choice = await ItemDialog.create(ItemDialog.objectToArray({\r\n ws : game.wfrp4e.config.characteristics.ws,\r\n t : game.wfrp4e.config.characteristics.t,\r\n ag : game.wfrp4e.config.characteristics.ag,\r\n wp : game.wfrp4e.config.characteristics.wp\r\n}, this.effect.img), 1, \"Choose Characteristic\");\r\n\r\nthis.effect.updateSource({\"flags.wfrp4e.characteristic\" : choice[0].id})","Q1kUE8jcG7id3MHT":"let criticals = this.actor.itemTypes.critical;\n\nif (criticals.length)\n{\n let choice = await ItemDialog.create(criticals, 1, {title: this.effect.name, text: \"Choose Critical to Heal\"})\n\n if (choice[0])\n {\n this.script.message(`Healed ${choice[0].name}`);\n choice[0].delete();\n }\n}\nelse \n{\n this.script.notification(\"No Critical Wounds!\")\n}","Q1trEhtqjIiDvFPF":"args.prefillModifiers.modifier -= 10 * getProperty(this.effect, 'flags.wfrp4e.value')","q3nRyXaxksdCiLFM":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.j6v78dnOOdCB6c3d\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","Q4EQgP4gZR8TTm7S":"let penalty = 0\r\nif (args.item?.system.attackType)\r\n{\r\n penalty -= 30\r\n}\r\nif (args.actor.has(\"Second Sight\", \"talent\"))\r\n penalty += 10\r\n\r\nargs.prefillModifiers.modifier += penalty","Q5gh5Y9dCdclcwsD":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Channelling\")) && args.skill?.name != `${game.i18n.localize(\"NAME.Language\")} (${game.i18n.localize(\"SPEC.Magick\")})`","q5RgoYr12kBF6FA5":"return args.item?.system?.attackType == \"ranged\" && this.item == args.item && !this.actor.isOpposing","Q68WiUWY7GxiXBbT":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9GNpAqgsKzxZKJpp\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = \"When Alone\";\r\ndata.effects[0].disabled = true;\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","Q7eULXQ9AfDRmUGO":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Carpenter)';\r\nconst difficulty = 'difficult';\r\nconst target = 40;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","q8lOAWr2970sZeTw":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Carpentry)';\r\nconst difficulty = 'challenging';\r\nconst target = 20;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","Q9EmlWmuDac83cJw":"return args.skill?.name == game.i18n.localize(\"NAME.Climb\") || args.skill?.name?.includes(game.i18n.localize(\"NAME.Stealth\"));","QaEUhlvxFPzowH0v":"args.actor.characteristics.ag.modifier -= 10;\r\n\r\n if (args.actor.details.move.value > 3)\r\n {\r\n args.actor.details.move.value -= 1;\r\n if (args.actor.details.move.value < 3)\r\n args.actor.details.move.value = 3\r\n }","qAEZgtu5CrfUkxhx":"if (args.test.options.staunchBleeding) \r\n{\r\n if (args.test.succeeded) \r\n {\r\n let staunch = Number(args.test.result.SL) + 1\r\n if (args.test.options.fieldDressing && args.test.result.reversed)\r\n {\r\n staunch = Math.min(1, Number(args.test.result.SL)) + 1\r\n }\r\n args.test.result.other.push(`<b>${this.actor.name}</b> removed <b>${staunch}</b> Bleeding conditions from the patient.`)\r\n }\r\n else if (this.actor.characteristics.int.bonus + Number(args.test.result.SL) < 0)\r\n {\r\n args.test.result.other.push(`The patient contracts a @UUID[Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg]{Minor Infection}.`)\r\n }\r\n}","QaGNsqKm2Nf0zGVm":"return [\"t\", \"int\", \"wp\", \"fel\"].includes(args.characteristic)","qaVde0sTuMBRi2nl":"return [\"NAME.Evaluate\", \"NAME.Gamble\"].map(i => game.i18n.localize(i)).includes(args.skill?.name)","QBBrzcSAe8QqE4WP":"const SL = this.effect.sourceTest.result.SL;\nconst damage = 8 + SL;\n\nawait this.actor.applyBasicDamage(damage, {loc: \"roll\"});\n\nconst test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {\n skipTargets: true,\n appendTitle: ` - ${this.effect.name}`,\n fields: {difficulty: \"challenging\"},\n context: {\n failure: `Erhält 1 Zustand @Condition[Ablaze].`\n }\n})\n\nawait test.roll();\nif (test.failed) {\n await this.actor.addCondition(\"ablaze\");\n}","QbIYnshWeP1U8SUy":"args.applyAP = false;\r\nargs.applyTB = false;","qcyl98GYD55BkJsD":"this.actor.status.encumbrance.state = 0;\r\nthis.actor.status.encumbrance.pct = 0;","qDYJnO2JosPJrjpz":"if (args.totalWoundLoss <= 0) return;\n\n// Poisoned handled by Venin trait\n\nconst test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {\n skipTargets: true,\n appendTitle: ` — ${this.effect.name}`,\n fields: {difficulty: \"average\"},\n context: {\n failure: `Erhält 1 Korrumpierungspunkt.`\n }\n});\n\nawait test.roll();\n\nif (test.failed && args.actor.type === \"character\")\n args.actor.update({\"system.status.corruption.value\": args.actor.system.status.corruption.value + 1});\n\n\nawait args.actor.applyEffect({effects : this.item.effects.getName(\"Biss des Purpurschädels\")})","QF8LanKNoAlTkQG0":"this.actor.system.status.encumbrance.max += 2","QfTBRGXVfwQSghmd":"fromUuid(this.effect.origin).then(caster => {\r\n if (caster) {\r\n if (actor.items.find(it => it.name == game.i18n.localize(\"Bestial\"))) {\r\n let healed = caster.characteristics.wp.bonus\r\n let wounds = duplicate(args.actor.status.wounds)\r\n wounds.value += healed\r\n\r\n if (wounds.value > wounds.max)\r\n wounds.value = wounds.max\r\n\r\n args.actor.update({ \"system.status.wounds\": wounds })\r\n ChatMessage.create({ content: `${this.actor.prototypeToken.name} regains ${healed} Wounds`, speaker: { alias: this.effect.name } })\r\n } else {\r\n ui.notifications.warn(\"Target actor has no Bestial trait\")\r\n }\r\n }\r\n})\r\n\r\n","qggycOtvFfaBr4Ax":"this.actor.applyDamage(1 + this.actor.system.status.sin?.value || 0, {\n damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL,\n createMessage: this.script.getChatData()\n});\n\nconst test = await this.actor.setupSkill(\n game.i18n.localize(\"NAME.Endurance\"),\n {\n fields: {difficulty: \"average\"},\n skipTargets: true,\n appendTitle: ` — ${this.effect.name}`,\n },\n);\n\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"stunned\");\n}","Qgn92fZyc3Psn8QJ":"if (args.test.options.useOnesAttractive && (args.test.result.roll <= game.settings.get(\"wfrp4e\", \"automaticSuccess\") || args.test.result.roll <= args.test.target))\r\n{\r\n\r\nlet SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10)\r\nlet ones = Number(args.test.result.roll.toString().split(\"\").pop())\r\n\r\nif (ones > SL)\r\n\targs.test.data.result.SL = \"+\" + (ones + args.test.successBonus + args.test.slBonus)\r\n args.test.result.other.push(`<b>${this.effect.name}</b>: Used unit dice as SL`)\r\n}","qhjU1QdsfqA8h5iI":"return args.item?.system?.attackType != \"ranged\" || !this.item.equipped.value","QHQ7XmFOjT9wXgw1":"if (args.actorsystem.details.move.oars.value > 0)\r\n args.actor.system.details.move.oars.value -= 1;\r\n\r\nargs.actor.system.details.man -= 2;","qijgjcOBCDmhglRX":"return args.skill?.name == game.i18n.localize(\"NAME.SleightOfHand\");","qITSQMvvkgj81fW1":"return ![\"t\", \"s\"].includes(args.characteristic)","QjlGijPHAwAEX3mf":"this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.Bvd2aZ0gQUXHfCTh\", this.effect, {\"system.specification.value\" : 9})","qjli5evn8UA9uTeZ":"return args.actor.uuid == this.effect.sourceActor.uuid;","qK4q4o6cQhcGzFX3":"let fear = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\r\nlet leader = await fromUuid(\"Compendium.wfrp4e-core.items.Item.vCgEAetBMngR53aT\")\r\nlet fearData = fear.toObject();\r\nlet leaderData = leader.toObject();\r\nfearData.system.specification.value = this.effect.sourceTest.result.overcast.usage.other.current; \r\ntalents = new Array(1 + this.effect.sourceTest.result.overcast.available).fill(leaderData); // Assume any unused overcast is for war leader\r\nthis.actor.createEmbeddedDocuments(\"Item\", [fearData].concat(talents), {fromEffect : this.effect.id})","Qk7t2l5ep9RDVpgE":"args.options.diceman= true;","QKjR6P1WEHXf4K77":"args.fields.slBonus -= 2\r\n","QKt9ZYpVpznncfJ1":"for(let key in this.item.system.AP)\n{\n if (this.item.system.AP[key])\n {\n this.item.system.AP[key]++;\n }\n}","QKTA2TqZ77pvHWSJ":" this.actor.getActiveTokens().forEach(t => t.document.update({light : {\r\n \"dim\": 0,\r\n \"bright\": 0,\r\n \"alpha\": 0.5,\r\n \"animation\": {\r\n \"type\": \"\",\r\n },\r\n \"color\": \"#000000\",\r\n }}));","QLBxcP85duX1Z7LX":"if (!args.item.actor?.has(\"Gesegnet (Taal)\", \"talent\")) return;\n\nargs.item.system.AP.head = 3;","QLE6dDm6Bns2J5Tl":"let property = this.effect.getFlag(\"wfrp4e\", \"property\");\nif (property && !this.item.system.qualities.value.find(i => i.name == property));\n{\n this.item.system.qualities.value.push({name : property});\n}","QLUaOkwuSPvBp7jU":"this.script.scriptNotification(\"Kann keine Ziele angreifen, die nicht Gefesselt sind\")\nargs.abort = true;","qmGwT929EiZ3lW2x":"if (args.weaponProperties.qualities.penetrating)\n{\n args.alreadyPenetrating = true;\n}\nelse \n{\n args.weaponProperties.qualities.penetrating = true;\n}","qmH61HmrEJcmQTiu":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.tNWrJUOArwfWXsPw\");\nitem = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id});","qmOt7h17hGAKqQe0":"\r\nlet choice = await Dialog.wait({\r\n title: this.effect.name,\r\n content: `<p><strong>${this.effect.name}</strong>: Is this a ranged or magical attack that orignates outside the Dome?</p>`,\r\n buttons: {\r\n yes: {\r\n label: \"Yes\",\r\n callback: () => {\r\n return true;\r\n }\r\n },\r\n no: {\r\n label: \"No\",\r\n callback: () => {\r\n return false;\r\n }\r\n }\r\n }\r\n})\r\n\r\nif (choice)\r\n{\r\n\targs.ward = 6;\r\n}","qnJu82zgnfOsnqZV":"let closed = !this.item.getFlag(\"wfrp4e-soc\", \"gunport\") || false;\r\n\r\nawait this.item.setFlag(\"wfrp4e-soc\", \"gunport\", closed);\r\nlet scriptData = this.effect.flags.wfrp4e.scriptData;\r\n\r\nif (closed) {\r\n scriptData[0].label = \"Open\";\r\n} else {\r\n scriptData[0].label = \"Close\";\r\n}\r\n\r\nawait this.effect.update({\"flags.wfrp4e.scriptData\": scriptData});","QNxmImpLTou6WdMQ":"let test = args.test\r\nif (test.result.minormis || test.result.majormis || test.result.catastrophicmis)\r\n test.result.other.push(\"Can make a <b>Difficult (-10) Willpower</b> Test to prevent the Miscast\")","Qo8q0P5j9OKEAP70":"let locs = Object.values(this.actor.system.status.armour).map(i => i.label).filter(i => i);\n\nlet location = locs[Math.floor(CONFIG.Dice.randomUniform() * (locs.length))];\n\nthis.script.notification(location);\n\nthis.effect.updateSource({name: this.effect.setSpecifier(location)});","QoEOxRruQXYrZrv3":"let filters = [\r\n {\r\n property : \"type\",\r\n value : \"skill\"\r\n },\r\n {\r\n property : \"name\",\r\n value : /Melee/gm,\r\n regex: true\r\n }\r\n]\r\n\r\nlet items = await game.wfrp4e.apps.ItemDialog.createFromFilters(filters, 2, \"Choose 2 Skills to add +20\")\r\nitems = items.map(i => i.toObject())\r\nitems.forEach(i => i.system.advances.value = 20)\r\n\r\nthis.actor.createEmbeddedDocuments(\"Item\", items);","QPuS9YsWAm4LUZWd":"let skills = this.actor.itemTypes.skill.filter(i => i.name == \"Language (Magick)\" || i.name.includes(\"Channelling\"))\nfor(let skill of skills)\n{\n await skill.update({\"system.modifier.value\" : -1 * skill.system.total.value})\n}\n\nthis.script.notification(\"Modifikatoren zu Fähigkeiten hinzugefügt: \" + skills.map(i => i.name).join(\", \"), \"info\", true);","QPVVDPcJ4Xi5FmQl":"if(this.actor.hasCondition(\"fatigued\") && args.opposedTest.result.hitloc.value == \"head\" && (args.opposedTest.attackerTest.result.critical || args.actor.status.wounds.value - args.totalWoundLoss < 0))\r\n{\r\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), { fields: { difficulty: \"average\" }, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\n await test.roll();\r\n if (test.failed)\r\n {\r\n this.actor.addCondition(\"unconscious\")\r\n }\r\n}","QQ2gHThZHdO4yLLX":"return args.skill?.name == game.i18n.localize(\"NAME.Swim\");","QqkE7rlqhkeRohFD":"return !([\"cast\", \"channelling\"].includes(args.type) && this.actor.hasCondition(\"fatigued\"))","QQPiREc50HT5W2Tr":"if (args.item.type == \"weapon\" && args.item.weaponGroup.value == \"brawling\")\r\n args.item.damage.value += \" + 1\"","QqybHxNCzPEzG1Qh":"return args.fields.dualWielding || args.options.dualWieldOffhand","QRSACifDrvojIXHB":"if (!this.actor.effects.find(e => e.isCondition))\r\n{\r\n\treturn this.script.scriptNotification(\"No Conditions on this Actor\")\r\n}\r\n\r\nlet choice = await ItemDialog.create(this.actor.effects.filter(i => i.isCondition), 1, \"Choose a Condition\")\r\n\r\nif (choice[0])\r\n{\r\n\tthis.actor.removeCondition(choice[0].conditionId)\r\n}\r\n","qSwCYMMiIHmSV1X5":"if (this.item.system.quantity.value)\r\n{\r\n\tthis.item.system.reduceQuantity();\r\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\r\n let effectData = this.item.effects.contents[0].convertToApplied();\r\n\teffectData.flags.wfrp4e.sourceItem = this.item.uuid\r\n effectData.duration.seconds = 10800\r\n\tactor.applyEffect({effectData : [effectData]})\r\n}\r\nelse\r\n{\r\n\tthis.script.scriptNotification(\"None left!\", \"error\")\r\n}","qT0WBPxLMMO9gvCd":"if (!this.actor.has(\"Night Vision\") && !this.actor.has(\"Night Vision\", \"talent\") && !this.actor.hasCondition(\"blinded\"))\r\n{\r\n this.actor.addCondition(\"blinded\", 1, {\"flags.wfrp4e.nightshroud\" : true})\r\n}","qTcK1TSjLTi0jNQK":"let AP = args.actor.status.armour;\r\n\r\nAP[\"head\"].value += 1;\r\nAP[\"rArm\"].value += 1;\r\nAP[\"lArm\"].value += 1;\r\nAP[\"body\"].value += 1;\r\nAP[\"lLeg\"].value += 1;\r\nAP[\"rLeg\"].value += 1;","qTk96NKh14YOIShf":"return args.skill?.name === game.i18n.localize(\"NAME.Haggle\");","qu194dVXm9Vx1TGk":"if (args.test.options.useOnesSupportive && (args.test.result.roll <= game.settings.get(\"wfrp4e\", \"automaticSuccess\") || args.test.result.roll <= args.test.target))\r\n{\r\n\r\nlet SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10)\r\nlet ones = Number(args.test.result.roll.toString().split(\"\").pop())\r\n\r\nif (ones > SL)\r\n\targs.test.data.result.SL = \"+\" + (ones + args.test.successBonus + args.test.slBonus)\r\n args.test.result.other.push(`<b>${this.effect.name}</b>: Used unit dice as SL`)\r\n}","quPcuKsq2fcild4a":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"easy\"}, context: {failure : `<strong>${this.effect.name}</strong>: Vomit!`} })\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"prone\")\r\n}","qUwnVlWpsmDom3RK":"args.fields.modifier -= 5;","QwHoqu2oO8QO8Mad":"let content = `<b>${this.effect.name}</b>: All targets engaged with <b>${this.actor.prototypeToken.name}</b> take [[/r 1d10]] Damage, modified by TB and AP.`\r\n\r\nthis.script.scriptMessage(content)","qxzhPtysAjPWspKf":"if (this.actor.has(\"Undead\") || this.actor.has(\"Daemonic\"))\r\n{\r\n this.script.scriptNotification(`Cannot enter ${this.effect.name}!`);\r\n}","qyBmkCJo5606o4J9":"this.item.system.flaws.value = this.item.system.flaws.value.filter(i => i.name != \"weakpoints\")","qZ8TBagp2d4dJAqI":"return !args.weapon || args.weapon?.system.isMelee","qzGPJflVW7c2Ciim":"return args.skill?.name !== game.i18n.localize(\"NAME.Cool\");","qZschZU0nee0kJlk":"args.fields.modifier -= 30;","R32U01LBjBrK1pns":" const templateMap = {\r\n 'P2e7Yx98bK3u110a' : \"\",\r\n 'iuMp3KLaMT2WCmie' : \"Xp4r2KUhqfjak8zq\", \r\n 'RBuYcT5tppwcmnC5' : \"wYN19h3WVF1yOVq2\", \r\n 'vcGpNwNbhvfzVveQ' : \"ac5ClOuaYtzOYyWp\", \r\n 'jmhKZy0w9TzkEK9c' : \"IS3LTdTuay6uRHUq\", \r\n '9Byj6k7SmdTYis2V' : \"LjMlx99gBGeRJUQu\", \r\n 'laJwc2l9tzJPgaaJ' : \"x5wpMprsObuqMCYg\",\r\n }\r\n let template = (await game.wfrp4e.tables.rollTable(\"hireling-templates\", {hideDSN: true})).object;\r\n let physicalQuirk = (await game.wfrp4e.tables.rollTable(\"physical-quirks\", {hideDSN: true})).text;\r\n let workEthic = (await game.wfrp4e.tables.rollTable(\"work-ethic\", {hideDSN: true})).text;\r\n let personalityQuirk = (await game.wfrp4e.tables.rollTable(\"personality-quirks\", {hideDSN: true})).text;\r\n\r\n\r\n let templateItem = await game.wfrp4e.utility.findItemId(templateMap[template._id]);\r\n\r\n let bio = \r\n `\r\n <p><strong>Template</strong>: ${template.text}</p>\r\n <p><strong>Phsyical Quirk</strong>: ${physicalQuirk}</p>\r\n <p><strong>Work Ethic</strong>: ${workEthic}</p>\r\n <p><strong>Personality Quirk</strong>: ${personalityQuirk}</p>\r\n `\r\n \r\n this.script.scriptMessage(bio, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n\r\n await this.actor.update({\"system.details.gmnotes.value\" : bio})\r\n\r\n if (templateItem)\r\n {\r\n this.actor.createEmbeddedDocuments(\"Item\", [templateItem.toObject()])\r\n }","R3OfRdi6xv0e9mzB":"return args.item.name.includes(\"Arme\")","R4A2ozuhFbrjr6nj":"await this.actor.hasCondition(\"broken\")?.delete();","R5dOZWFxE2n6tooX":"return this.item.system.usesLocation(args.weapon)","r6hi5vMdLhTaaPfb":"args.actor.details.move.value += this.effect.sourceTest.result.overcast.usage.other.current","R6SnyF3y4Vsq6oga":"let lore = this.effect.name.split(\"(\")[1].split(\")\")[0].toLowerCase();\r\n\r\n// If channelling corresponding lore\r\nif (args.type == \"channelling\" && args.spell.system.lore.value == lore)\r\n args.prefillModifiers.slBonus += 1\r\n// If channelling or casting different lore\r\nelse if (args.spell.system.lore.value != lore && args.spell.system.lore.value != \"petty\")\r\n args.prefillModifiers.slBonus -= 1","R8ecKGRzOr4ThvVa":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Maintenance Crew Test';\r\nconst difficulty = 'hard';\r\nconst target = 80;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","R8FBHZaaARA3z9pB":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Carpenter)';\r\nconst difficulty = 'hard';\r\nconst target = 40;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","R95pDZMHnD9iHAl8":"return args.skill?.name.includes(this.item.system.tests.value);","r9N0cd9sp6iVG0es":"let results = {\n 1 : \"Fimir\",\n 2 : \"Dark Elves\",\n 3 : \"Dragons\",\n 4 : \"Daemons\",\n 5 : \"The mortal followers of a particular Chaos God\",\n 6 : \"The mortal followers of a particular Chaos God\",\n 7 : \"Vampires and Necromancers\",\n 8 : \"Vampires and Necromancers\",\n 9 : \"Dwarfs\",\n 10 : \"Dwarfs\"\n};\n\nlet gods = [\n \"Tzeentch\",\n \"Slaanesh\",\n \"Nurgle\",\n \"Khorne\"\n];\n\nlet roll = await new Roll(\"1d10\").roll();\n\nroll.toMessage(this.script.getChatData());\n\nlet result = results[roll.total].replace(\"a particular Chaos God\", gods[Math.ceil(CONFIG.Dice.randomUniform() * 4)]);\n\nthis.effect.updateSource({name: this.effect.setSpecifier(result)});","ramav4ymrDDkPKK4":"if (this.actor.hasCondition(\"bleeding\"))\r\n{\r\n this.actor.removeCondition(\"bleeding\");\r\n this.script.scriptNotification(\"Removed 1 Bleeding Condition\")\r\n}\r\nelse \r\n{\r\n this.script.scriptNotification(\"No Bleeding Conditions\");\r\n}","ratP9ByLjQPiLlFK":"args.data.canReverse = true","rBAoyhzeU3Q8MVSk":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Carpenter)';\r\nconst difficulty = 'difficult';\r\nconst target = 50;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","rCh3ltUrUMovd2Kc":"if (this.actor.hasCondition(\"surprised\"))\r\n{\r\n this.script.scriptNotification(\"Cannot be surprised\");\r\n this.actor.removeCondition(\"surprised\");\r\n}","rdaMhMyHrJjQ6vVC":"game.wfrp4e.utility.postFear(this.item.Advances, this.actor.name)","rdD6Ra954TlkzQCu":"const knownTechniques = this.actor.itemTypes[\"wfrp4e-helf.technique\"].length;\nconst xpCost = knownTechniques * 100;\n\nif (this.actor.system.details.experience.current < xpCost) {\n return this.script.notification(game.i18n.localize(\"SCRIPT.NotEnoughXP\"));\n}\n\nconst techniques = await warhammer.utility.findAllItems(\"wfrp4e-helf.technique\", \"Loading Techniques\", true);\nconst choice = await ItemDialog.create(techniques, 1, {text: \"Choose Sword Dance\", title: this.effect.name});\nif (choice.length) {\n this.actor.addEffectItems(choice.map(i => i.uuid), this.effect);\n let expLog = foundry.utils.duplicate(this.actor.details.experience.log || []);\n expLog.push({\n amount: xpCost,\n reason: `${game.i18n.localize(\"WFRP4E.SwordDance\")}: ${choice[0].name}`,\n spent: this.actor.details.experience.spent + xpCost,\n total: this.actor.details.experience.total,\n type: \"spent\",\n });\n this.actor.update({\n \"system.details.experience.spent\": this.actor.details.experience.spent + xpCost,\n \"system.details.experience.log\": expLog,\n });\n}","rDexKQt0ctzdMKdR":"if (args.prayer)\n{\n args.abort = true;\n this.script.notification(\"Segnen oder Anrufen kann nicht verwendet werden!\")\n}\n\nreturn true;","RDtJXji3hgcKnEBk":"let as = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS\")).toObject();\r\nlet hv = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.Nj3tC8A5fZ3zEdMR\")).toObject();\r\nlet ms = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.6w30u0VPsAicrqb5\")).toObject();\r\nlet ss = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.OEjUvJKi0xmBwbS2\")).toObject();\r\n\r\nas.name += \" (Sight)\";\r\n\r\nlet roll = (await new Roll(\"1d10\").roll());\r\nroll.toMessage(this.script.getChatData())\r\nlet items = []\r\n\r\nif (roll.total <= 2)\r\n{\r\n items = items.concat([as]);\r\n}\r\nelse if (roll.total <= 4)\r\n{\r\n items = items.concat([hv]);\r\n}\r\nelse if (roll.total <= 6)\r\n{\r\n items = items.concat([ms]);\r\n}\r\nelse if (roll.total <= 8)\r\n{\r\n items = items.concat([ss]);\r\n}\r\nelse if (roll.total <= 10)\r\n{\r\n items = items.concat([as, hv, ms, ss]);\r\n}\r\n\r\nthis.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect: this.effect.id})","re1UFtxvRRjpPB7Z":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.nF5z1OEhpi4t6a6S\");\r\nlet data = item.toObject();\r\ndata.system.location.key = this.item.system.location.key\r\nif (data.system.location.key[0] == \"r\")\r\n{\r\n\tdata.system.location.value = \"Right Ankle\"\r\n}\r\nelse if (data.system.location.key[0] == \"l\")\r\n{\r\n\tdata.system.location.value = \"Left Ankle\"\r\n}\r\n\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {skipLocationValue : true, fromEffect: this.effect.id})\r\n","red2bt4PGgIWAdTR":"if (this.item.system.quantity.value)\r\n{\r\n\tthis.item.system.reduceQuantity();\r\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\r\n let effectData = this.item.effects.contents[0].convertToApplied();\r\n let minutes = Math.ceil(CONFIG.Dice.randomUniform() * 10) * 10;\r\n effectData.duration.seconds = 60 * minutes\r\n this.script.scriptMessage(`<strong>Duration</strong>: ${minutes} minutes`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n\tactor.applyEffect({effectData : [effectData]})\r\n}\r\nelse\r\n{\r\n\tthis.script.scriptNotification(\"None left!\", \"error\")\r\n}","ReJpL0IVesKUbXgj":"args.fields.slBonus -= 8;","rF0Z3hTUUnSxL3Mq":"let armour = (await fromUuid(\"Compendium.wfrp4e-core.items.VUJUZVN3VYhOaPjj\")).toObject()\r\nlet bite = (await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")).toObject()\r\nlet fear = (await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")).toObject()\r\nlet nightVision = (await fromUuid(\"Compendium.wfrp4e-core.items.FmHDbCOy3pH8yKhm\")).toObject()\r\nlet tracker = (await fromUuid(\"Compendium.wfrp4e-core.items.ClOlztW6hH8rslbp\")).toObject()\r\nlet weapon = (await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")).toObject()\r\n\r\narmour.name = \"Armour (Hide)\"\r\narmour.system.specification.value = 2\r\nbite.system.specification.value = 3\r\nfear.system.specification.value = 2\r\nweapon.system.specification.value = 4\r\nlet items = [armour, bite, fear, nightVision, tracker, weapon]\r\n\r\n\r\nlet belligerent = (await fromUuid(\"Compendium.wfrp4e-core.items.GbDyBCu8ZjDp6dkj\")).toObject()//{Belligerent}\r\nlet bestial = (await fromUuid(\"Compendium.wfrp4e-core.items.AGcJl5rHjkyIQBPP\")).toObject()//{Bestial}\r\nlet big = (await fromUuid(\"Compendium.wfrp4e-core.items.a8MC97PLzl10WocT\")).toObject()//{Big}\r\nlet blessed = (await fromUuid(\"Compendium.wfrp4e-core.items.5muSFXd6oc760uVj\")).toObject()//{Blessed (Ulric)}\r\nlet champion = (await fromUuid(\"Compendium.wfrp4e-core.items.4mF5Sp3t09kZhBYc\")).toObject()//{Champion}\r\nlet die = (await fromUuid(\"Compendium.wfrp4e-core.items.UsJ2uIOOtHA7JqD5\")).toObject()//{Die Hard}\r\nlet fast = (await fromUuid(\"Compendium.wfrp4e-core.items.9MjH4xyVrd3Inzak\")).toObject()//{Fast}\r\nlet frenzy = (await fromUuid(\"Compendium.wfrp4e-core.items.yRhhOlt18COq4e1q\")).toObject()//{Frenzy}\r\nlet immunity = (await fromUuid(\"Compendium.wfrp4e-core.items.IAWyzDfC286a9MPz\")).toObject()//{Immunity to Psychology}\r\nlet regenerate = (await fromUuid(\"Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR\")).toObject()//{Regenerate}\r\nlet size = (await fromUuid(\"Compendium.wfrp4e-core.items.8slW8CJ2oVTxeQ6q\")).toObject()//{Size (Large)}\r\n\r\nblessed.system.specification.value = \"Ulric\"\r\nsize.system.specification.value = \"Large\"\r\n\r\nlet optional = [belligerent, bestial, big, blessed, champion, die, fast, frenzy, immunity, regenerate, size];\r\n\r\nlet chosen = await ItemDialog.create(optional, \"unlimited\", \"Choose Optional Traits\");\r\n\r\nitems = items.concat(chosen || [])\r\nthis.script.scriptNotification(`Adding ${items.map(i => i.name).join(\", \")}`);\r\nthis.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect : this.effect.id})\r\n","RgNdS87nO7RVawuw":"this.actor.removeCondition(\"fatigued\", 1);","rgnGu3IQrS8Vj9Op":"const bonus = game.settings.get(\"wfrp4e\", \"homebrew\").advantageBonus;\n\nargs.fields.modifier += bonus;","rgSwSeB3shIMVMb6":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.x0WMGwuQzReXcQrs\")\r\nlet data = item.toObject(); \r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id});","RHyBLYT5oHf7EPnG":"let skills = this.actor.itemTypes.skill.filter(i => i.name.includes(game.i18n.localize(\"NAME.Melee\")))\r\n\r\nlet skill = await ItemDialog.create(skills, 1, \"Select the skill used by the weapon\")\r\nlet group = game.wfrp4e.utility.extractParenthesesText(skill[0]?.name)\r\nlet groupKey = game.wfrp4e.utility.findKey(group, game.wfrp4e.config.weaponGroups)\r\n\r\nlet weapon = {\r\n\tname : this.effect.name,\r\n\ttype : \"weapon\",\r\n\timg : this.effect.img,\r\n\tsystem : {\r\n\t\t\"damage.value\" : this.actor.system.characteristics.wp.bonus,\r\n\t\t\"weaponGroup.value\" : groupKey || \"basic\",\r\n\t\t\"twohanded.value\" : [\"polearm\", \"twohanded\"].includes(groupKey),\r\n\t\t\"reach.value\" : \"average\",\r\n\t\t\"qualities.value\" : [{name : \"magical\"}]\r\n\t},\r\n}\r\n\r\nItem.implementation.create(foundry.utils.expandObject(weapon), {parent : this.actor, fromEffect : this.effect.id})\r\nthis.script.scriptNotification(\"Item created. Further customization must be done manually within the Item's sheet\");","RI8crJxeD8JLDwMh":"return args.weapon?.system?.weaponGroup?.value != \"fencing\"","rIISfbCShejmJNKw":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.oRx92ByVNEBN6YkK\")\r\nlet data = item.toObject()\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\r\n","rJ8pspSekyDLkiqG":"return args.skill.name === game.i18n.localize(\"NAME.Cool\")","RjcHrQ9inlFj9cUU":"const excessSL = this.effect.sourceTest.result.baseSL - this.effect.sourceItem.system.sl;\nconst weapon = this.effect.sourceActor.items.find(i => i.equipped && i.system.tags.has(\"weapon\"));\nlet damage = weapon.Damage;\ndamage += excessSL;\nthis.actor.applyDamage(damage, {\n loc: \"roll\",\n weaponProperties: {qualities: {penetrating: true}},\n createMessage: this.script.getChatData(),\n});","RJpglw5eVRM1f9t0":"args.wounds *= 5","RKIFGN583PQnqHGk":"if (args.opposedTest.result.hitloc.value == \"body\" && args.totalWoundLoss > 0)\r\n{\r\n args.actor.addCondition(\"bleeding\", 2)\r\n this.script.scriptMessage(\"Gained 2 Bleeding Conditions\")\r\n}","RlhOAKfN0ghrrooR":"let holed = this.actor.appliedEffects.filter(e => e.name.includes(\"Holed\"));\r\n\r\nfor (let effect of holed) {\r\n await effect.update({name: effect.name.replace(/\\d+/, rating => parseInt(rating) * 2)});\r\n}\r\n\r\nthis.script.scriptNotification(`Holed Ratings of ${this.actor.name} have been doubled.`);","rLMaVNEGdZ6xj5Au":"return ![\"i\", \"int\", \"fel\"].includes(args.characteristic)","rlTvhnDpj4lzfusf":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Sail\")) && args.skill?.name !== game.i18n.localize(\"NAME.Climb\");","RlVvlmhOfscaJqCd":"const deletes = this.actor.itemTags.armour.map(a => {\n return {_id: a._id}\n});\nconst armourTrait = this.actor.itemTags.trait.find(t => t.name === game.i18n.localize(\"NAME.TraitArmour\"));\n\nif (armourTrait)\n deletes.push({_id: armourTrait._id});\n\nthis.actor.deleteEmbeddedDocuments(\"Item\", deletes);","rly9iBUy8EX7NhQT":"if (game.user.targets.size !== 1)\r\n return ui.notifications.warn(\"You must target exactly one Boat.\");\r\n\r\nconst target = game.user.targets.first();\r\nconst vehicle = target.actor;\r\n\r\nif (!(vehicle.system instanceof VehicleModel)) \r\n return ui.notifications.warn(\"You can only Constrict a Boat\");\r\n\r\nif (vehicle.size > 3)\r\n return ui.notifications.warn(\"You can only Constrict vessels of Size Large or smaller\");\r\n\r\nconst turns = Math.ceil(vehicle.system.details.length.value / 10);\r\n\r\nconst mainEffect = this.item.effects.contents[0];\r\nconst effectData = mainEffect.toObject();\r\n\r\neffectData.statuses = [effectData.name.slugify()];\r\n\r\nfoundry.utils.setProperty(effectData, \"flags.wfrp4e.target\", target.id);\r\nfoundry.utils.setProperty(effectData, \"flags.wfrp4e.turns\", turns);\r\n\r\nawait this.actor.applyEffect({effectData: [effectData]});\r\n\r\nconst speaker = ChatMessage.getSpeaker({actor: this.actor});\r\n\r\nthis.script.scriptMessage(`<b>${speaker.alias}</b> started wrapping itself around the <b>${target.name}</b> and will be able to start crushing it after ${turns} turns.`);","Rmk3UwD0zz4HlTHR":"return args.item?.name === game.i18n.localize(\"NAME.Stealth\")","RNHrSTfMLXm5sXkC":"return [\"ws\", \"bs\", \"s\", \"ag\"].includes(args.characteristic)","rnioLwiJP7ps5Jwy":"if (args.item.type == \"skill\" && args.item.name == \"Melee (Basic)\")\r\n{\r\n args.item.system.modifier.value += 30;\r\n}","Rnpw6UQdJifLeuna":"this.effect.updateSource({\"flags.wfrp4e.applicationData.type\" : \"crew\"})","RNr9CwyvLhlnwD2h":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Sail\"));","roKvPHDSpX4IV11C":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Perform\")) && args.characteristic != \"ag\"","ROXCqAFSTLouJniL":"if (args.test.spell.name == \"Warp Lightning\")\r\n{\r\n if (args.test.result.minormis || args.test.result.majormis || args.test.result.catastrophicmis)\r\n {\r\n this.script.scriptMessage(`<strong>${this.item.name}</strong> Overloads!`)\r\n }\r\n}","roYVcP5Zqcsa8jVw":"args.actor.system.details.move.value -= 1;","RPqgRUkiLY5thVbC":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Strength';\r\nconst difficulty = 'average';\r\nconst target = 10;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","RprZWlnopSqZt7KZ":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"));","rpxQU26BU7nwjtqY":"let location = this.item.system.location.key\r\nlet test = await this.actor.setupCharacteristic(\"dex\", {context : {failure : `<strong>${this.effect.name}</strong>: Drop the item!`}, skipTargets: true, appendTitle : \" - \" + this.effect.name, fields : {difficulty : \"average\"}})\r\nawait test.roll();\r\n\r\n\r\nif (location && test.failed)\r\n{\r\n let dropped = this.item.system.weaponsAtLocation;\r\n\r\n if (dropped.length)\r\n {\r\n this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(\", \")}!`)\r\n for(let weapon of dropped)\r\n {\r\n await weapon.system.toggleEquip();\r\n }\r\n }\r\n}\r\n\r\nreturn test.succeeded","RQPe7k09QdAyws67":"return this.effect.name !== game.i18n.localize(\"WFRP4E.YenluiDark\")","rqTT8yOyK4bUwbdm":"let test = args.test\r\nif (test.spell.lore.value == \"fire\")\r\n{\r\n if (test.result.overcast.usage.target?.AoE)\r\n {\r\n test.result.overcast.usage.target.current += test.actor.characteristics.wp.bonus\r\n test.result.overcast.usage.target.initial += test.actor.characteristics.wp.bonus\r\n }\r\n if (test.result.overcast.usage.range)\r\n {\r\n test.result.overcast.usage.range.current *= 2\r\n test.result.overcast.usage.range.initial *= 2\r\n }\r\n \r\n}","RqWnhnwFxaHubgiA":"await args.actor.addCondition(\"blinded\");\r\nawait args.actor.addCondition(\"deafened\");\r\nawait args.actor.addCondition(\"stunned\");","rr4htuVq45onXdRG":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {appendTitle: ` - ${this.effect.name}`, fields : {difficulty : \"average\"}})\r\ntest.roll();","Rr82rh79nCkKHcBD":"this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.IAWyzDfC286a9MPz\", this.effect)","RrchOMpEdIvceJxl":"return args.skill?.name == \"Stealth (Rural)\"","rRfff55c7elyvbCb":"return this.actor.flags.useless[this.item.system.location.key] && args.weapon?.system.usesHands.includes(this.item.system.location.key[0] + \"Arm\")","RRK91ySi5SzYCRvy":"return args.weapon?.system.isRanged","rROfpTez9681wXWx":"return this.actor.attacker && this.item.properties.qualities.defensive","RSsGiDFibuqg3sHr":"let diseaseIndex = game.packs\r\n.filter(i => i.metadata.type == \"Item\")\r\n.reduce((acc, pack) => acc.concat(pack.index.contents), [])\r\n.filter(i => i.type == \"disease\")\r\n.map(i => {\r\n\ti.id = i._id\r\n\treturn i\r\n})\r\n\r\nlet choice = await ItemDialog.create(diseaseIndex , 1, \"Choose a Disease\")\r\n\r\nif (choice[0])\r\n{\r\n\tawait this.item.updateSource({\"system.specification.value\" : choice[0].name})\r\n}","RsWXCcYHONf3ANlD":"this.actor.addCondition(\"stunned\", 1);\r\n","rUGSx06BuBvX9kgf":"if (args.test.result.charging)\r\n{\r\n args.test.result.damage += 1\r\n args.test.result.additionalDamage += 1\r\n if (!args.test.result.resolute) {\r\n args.test.result.breakdown.damage.other.push({label : this.effect.name, value : this.item.Advances});\r\n args.test.result.resolute = true // Prevent duplicate messages\r\n }\r\n}\r\n","RUpVgB0czqg95K1Q":"if (this.item.system.protects[args.loc])\n{\n args.weaponProperties.qualities.penetrating = false;\n}","RuW1PWUFxIbbSlIm":"return ![\"t\", \"wp\", \"ag\", \"i\", \"int\"].includes(args.characteristic)","RvipIYj9H7n4UDMe":" let characteristics = {\n \"ws\" : -10,\n \"bs\" : -10,\n \"s\" : -5,\n \"t\" : -5,\n \"i\" : -10,\n \"ag\" : -10,\n \"dex\" : -10,\n \"int\" : 0,\n \"wp\" : 0,\n \"fel\" : 0\n }\n let skills = []\n let skillAdvancements = []\n let talents = []\n let trappings = []\n let items = []\n\n let updateObj = this.actor.toObject();\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let index = 0; index < skills.length; index++)\n {\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n }\n \n for (let trapping of trappings) \n {\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n \n equip(trappingItem)\n \n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n }","rVpPNILEzWL9lj6b":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.kJNAY1YRaCy9IgmT\")\r\nlet terrorTraitItem = item.toObject()\r\nterrorTraitItem.system.specification.value = Number(this.effect.item.system.specification.value) \r\nthis.actor.createEmbeddedDocuments(\"Item\", [terrorTraitItem]);","rVRDoxiWILo7d8FF":"let specification = Number(this.item.specification.value) || 1;\r\nargs.actor.system.status.wounds.max += Math.floor(args.actor.system.status.wounds.max * 0.3 * specification);\r\nargs.actor.system.status.carries.max -= Math.floor(args.actor.system.status.carries.max * 0.1 * specification);\r\nargs.actor.system.details.price.gc += args.actor.system.details.price.gc * 0.2 * specification;","RwMw848y13Jq2L4f":"let test = await this.actor.setupSkill(\"Endurance\", {fields : {difficulty : \"difficult\"}, appendTitle : ` - ${this.effect.name}`});\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n\tawait this.actor.addCondition(\"blinded\");\r\n}\r\n\r\nlet msg = ``\r\nlet armour = args.actor.itemTypes.armour.filter(i => i.system.isMetal && i.system.isEquipped);\r\nfor(let item of armour)\r\n{\r\n\tfor(let key in item.system.AP)\r\n\t{\r\n\t\tlet AP = item.system.AP[key]\r\n\t\tlet damage = Math.floor(AP / 2);\r\n\t\tawait item.system.damageItem(damage, [key]);\r\n\t}\r\n\tmsg += `<p><strong>${item.name}</strong> AP reduced by half</p>`\r\n}\r\nif (msg)\r\n{\r\n\tthis.script.scriptMessage(msg, {speaker : {alias : args.actor.name}});\r\n}","rX8FTinyTMj9WJri":"if (!this.actor.flags.holed) return;\r\nif (this.actor.flags.holed.applied === true) return;\r\nif (this.actor.hasCondition(\"dead\")) return;\r\n\r\nconst currentHoled = this.actor.flags.holed.holed || 0;\r\n\r\nconst openGunPorts = this.actor.itemTypes.vehicleMod.reduce((acc, m) => {\r\n if (!m.name.toLowerCase().includes(\"gun port\")) \r\n return acc;\r\n \r\n let closed = m.getFlag(\"wfrp4e-soc\", \"gunport\");\r\n if (!closed) acc++;\r\n \r\n return acc;\r\n}, 0);\r\n\r\nconst totalHoled = currentHoled + openGunPorts;\r\nconst toughness = this.actor.system.characteristics.t.value;\r\nthis.actor.flags.holed.total = totalHoled;\r\n\r\nif (totalHoled >= toughness) {\r\n const speaker = ChatMessage.getSpeaker({actor: this.actor});\r\n this.script.scriptMessage(`\r\n <p><b>${speaker.alias}</b> sank due to having <em>Holed (${totalHoled})</em> rating equal to, or exceeding its <em>Toughness (${toughness })</em></p>\r\n <p>\r\n <em>Holed</em> due to Critical Damage: ${currentHoled}<br/>\r\n <em>Holed</em> due to opened Gun Ports: ${openGunPorts}\r\n </p>\r\n `, { flavor: this.effect.name.split(\"(\")[0]});\r\n this.actor.addCondition(\"dead\");\r\n} else if (totalHoled >= (toughness * 0.5)) {\r\n this.actor.system.details.move.value -= 1;\r\n this.actor.system.details.man -= 1;\r\n this.actor.flags.holed.half = true;\r\n}\r\n\r\nthis.actor.flags.holed.applied = true;","rxB1AqfVMDqTRieE":"return ![\"ws\", \"bs\", \"ag\"].includes(args.characteristic) && args.skill?.name != game.i18n.localize(\"NAME.Perception\")","rXMylpnEtZpwou6x":"this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty : \"average\"}}).then(async test =>\r\n{\r\n await test.roll()\r\n if (test.failed)\r\n {\r\n this.actor.addCondition(\"fatigued\") \r\n }\r\n})","rXuOTYAOHCiW167c":"let difficulty = \"\"\n if (this.effect.name.includes(\"Moderate\"))\n difficulty = \"easy\"\n else if (this.effect.name.includes(\"Severe\"))\n difficulty = \"average\"\n else\n difficulty = \"veasy\"\n \n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {context : {failure : this.actor.name + \" dies from Blight\"}, fields: {difficulty}, appendTitle : \" - Blight\"})\n await test.roll();\n if (test.failed)\n {\n this.actor.addCondition(\"dead\");\n }","RyQtuiRykUCQ6Xag":"if (!this.item.actor.name.includes(\"Brunner\")) return;\n\nargs.actor.addCondition(\"ablaze\");","RZibsagclQO5U6o9":"this.actor.modifyAdvantage(1)","RZlMkxJz5apn0mUj":"return args.item?.system.attackType != \"ranged\"","s07GKMPCvQ8Heorc":"const value = this.effect.sourceActor.system.characteristics.wp.bonus;\r\nthis.script.message(await args.actor.applyBasicDamage(value, {damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true}));","s0kTuDE0qv68V2KI":" this.actor.getActiveTokens().forEach(t => t.document.update({texture : {tint : \"#FFBF00\"}}));\r\n","S1QihXuvdEVzeRtB":"let dice = await new Roll(\"1d10\").roll()\r\nlet roll = dice.total\r\nlet talent \r\nlet message\r\nlet modifier = 0\r\n\r\nif (roll <= 3)\r\n{\r\n item = await fromUuid(\"Compendium.wfrp4e-core.items.mNoCuaVbFBflfO6X\")\r\n}\r\n\r\nelse if (roll <= 6)\r\n{\r\n item = await fromUuid(\"Compendium.wfrp4e-core.items.OEjUvJKi0xmBwbS2\")\r\n modifier = -3\r\n}\r\n\r\nelse if (roll <= 9)\r\n{\r\n item = await fromUuid(\"Compendium.wfrp4e-core.items.mdPGZsn2396dEpOf\")\r\n modifier = -3\r\n}\r\n\r\nelse if (roll = 10)\r\n{\r\n item = await fromUuid(\"Compendium.wfrp4e-core.items.qdMbxW09FUoYBzmB\")\r\n modifier = -5\r\n}\r\n\r\nmessage = `${roll} Rolled, gain ${item.name}, ${modifier} Strength`\r\ndice.toMessage(this.script.getChatData())\r\n\r\nlet changes = duplicate(this.effect.changes)\r\nchanges[0].value = modifier\r\n\r\nthis.effect.updateSource({changes})\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id})\r\n\r\nthis.script.scriptNotification(message)","S1SQe0Do7ZcuNV5j":"if (![\"roll\", \"none\"].includes(args.fields.hitLocation))\n{\n args.fields.modifier += 20;\n}","S3DCTw4yJ85eSaKp":"this.actor.setupCharacteristic(\"s\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(test => test.roll())","S3Dev4hleOYqDNe9":"if (args.test.options.healWounds) {\r\n if (args.test.succeeded) \r\n {\r\n let wounds = this.actor.characteristics.int.bonus + Number(args.test.result.SL)\r\n if (args.test.options.fieldDressing && args.test.result.reversed)\r\n {\r\n wounds = this.actor.characteristics.int.bonus + Math.min(1, Number(args.test.result.SL))\r\n }\r\n\targs.test.result.woundsHealed = wounds\r\n\targs.test.result.other.push(`<b>${this.actor.name}</b> healed <b>${wounds}</b> wounds of the patient.`)\r\n }\r\n else if (this.actor.characteristics.int.bonus + Number(args.test.result.SL) < 0)\r\n {\r\n args.test.result.other.push(`The patient contracts a @UUID[Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg]{Minor Infection}.`)\r\n }\r\n}","s3Wg2xd6AlJ4sz3n":"let damage = this.actor.itemTypes.mutation * 6;\n\nif (!damage)\n{\n return \n}\n\nawait this.actor.applyDamage(damage, {\n loc: \"roll\",\n damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL,\n createMessage: this.script.getChatData(),\n});","S4793DLFhjMxpM8x":"return ![\"ws\", \"bs\"].includes(args.characteristic) && !args.item?.system.attackType && !args.options.dodge","s5bO0Sf0qpS27Tve":"await args.actor.addCondition(\"ablaze\", 3)\r\nawait args.actor.addCondition(\"prone\");","s6eZXfZkC1My6EXl":"let lore = this.effect.name.split(\" \")[2].toLowerCase();\r\nif (args.item.type == \"spell\" && args.item.system.lore.value == lore)\r\n{\r\n args.item.system.cn.value -= 1\r\n}\r\n","S6tUyFJvGMV19mvP":"this.actor.status.addArmour(2, {source: this.effect})","s7gJQdzuM3fz2zQK":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.QluSTTTq3viHJJUh\")\r\nlet data = item.toObject();\r\ndata.system.location.value = \"Hip\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\r\n \r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"prone\")\r\n}","s7kW3lm2eU5IPrLP":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.JQa5DLnTs2SEzRrc\")\nlet dv = item.toObject();\n\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.Item.OzwDT6kzoLYeeR2d\")\nlet stealthy = item.toObject();\n\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.Item.XSb3QVB9ipPBFt56\")\nlet shadow = item.toObject();\nthis.actor.createEmbeddedDocuments(\"Item\", [dv, stealthy, shadow], {fromEffect : this.effect.id});","s8idWt9YdMTRfnjV":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = 4 - this.actor.characteristics.s.bonus\r\ndata.name = item.name.replace(\"(Feature)\", \"\");\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","s8xU6OOZbbfo6VIw":"args.fields.slBonus += this.actor.system.characteristics.ag.bonus\r\n","s94yKZ4o5XN4JWM1":"// Any attack with such ammunition which inflicts at least one Wound,\r\n// also inflicts one Bleeding Condition.\r\n\r\nif (args.totalWoundLoss > 0) {\r\n args.actor.addCondition(\"bleeding\")\r\n}\r\n","S95QqpX1cZyIVCPy":"if (parseInt(this.item.system.specification.value) > 0)\r\n{\r\n\tthis.actor.system.status.ward.value = parseInt(this.item.system.specification.value);\r\n}\r\n\r\n","s9J1TUkpGdvSWvPO":"this.actor.addCondition(\"blinded\");","s9KcytRE7i0cU06n":"if ([\"dragon\"].includes(args.opposedTest.defender.details.species.value.toLowerCase()))\n {\n args.modifiers.other.push({label : this.effect.name, details : \"Wunden verdoppelt gegen Drachen\", value : args.totalWoundLoss});\n args.totalWoundLoss *=2;\n }","sagKJM6oDFlw4ED2":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\r\nawait test.roll();\r\nreturn test.failed;","sAVpm7hFRHpbCLXm":"return [\"ws\", \"bs\", \"s\", \"t\", \"ag\", \"i\"].includes(args.characteristic)","sB4KB9bT3nQhAoqG":"// This script needs to be separate because equipTransfer is off on the other effect, and thus won't execute when added to an actor\r\n\r\nlet mainEffect = this.item.effects.contents[0];\r\nif (mainEffect.name.includes(\"<Lore>\"))\r\n{\r\n let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.magicLores, this.item.img), 1, \"Choose Lore\");\r\n if (choice.length)\r\n {\r\n mainEffect.update({name : mainEffect.name.replace(\"<Lore>\", choice[0].name)})\r\n this.item.update({name : this.item.name += ` (${choice[0].name})`})\r\n }\r\n}\r\n\r\nthis.effect.delete();","sbK1a7txpSoXFzyB":"if (args.test.options.useOnesArgumentative && (args.test.result.roll <= game.settings.get(\"wfrp4e\", \"automaticSuccess\") || args.test.result.roll <= args.test.target))\r\n{\r\n\r\nlet SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll / 10)\r\nlet ones = Number(args.test.result.roll.toString().split(\"\").pop())\r\n\r\nif (ones > SL)\r\n\targs.test.data.result.SL = \"+\" + (ones + args.test.successBonus + args.test.slBonus)\r\n args.test.result.other.push(`<b>${this.effect.name}</b>: Used unit dice as SL`)\r\n}","sBXqivqv19SvN5cZ":"if (args.skill?.name.includes(\"Language\"))\n{\n args.abort = true;\n this.script.notification(\"Impossible d'effectuer des Tests de Langue !\")\n}","scfm5iWWBxWI6QaK":"let darkvision = await fromUuid(\"Compendium.wfrp4e-core.items.Item.JQa5DLnTs2SEzRrc\")\r\nlet fear = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\r\nlet acutesense = await fromUuid(\"Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS\")\r\nfear = fear.toObject();\r\nfear.system.specification.value = 1;\r\nthis.actor.createEmbeddedDocuments(\"Item\", [darkvision, fear, acutesense], {fromEffect : this.effect.id})","SdrCM66oViwRFF8I":"await this.actor.addCondition(\"prone\");\nawait this.actor.addCondition(\"blinded\", 1 + this.actor.system.status.sin?.value || 0)","SDwuKuqTsCBZ6hnb":"if (args.totalWoundLoss > 0 && this.item.protects[args.loc])\n{\n let roll = await new Roll(\"1d10\").roll();\n roll.toMessage(this.script.getChatData())\n if (roll.total == 10)\n {\n args.abort = this.effect.name\n }\n}","SdZ7xAEzJGVDCsaI":"let damage = await new Roll(\"2d10 + @sin\", {sin: this.actor.system.status.sin.value || 0}).roll();\ndamage.toMessage(this.script.getChatData());\nthis.actor.applyDamage(damage.total, {\n damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL,\n createMessage: this.script.getChatData()\n});\n\nconst test = await this.actor.setupSkill(\n game.i18n.localize(\"NAME.Endurance\"),\n {\n fields: {difficulty: \"hard\"},\n skipTargets: true,\n appendTitle: ` — ${this.effect.name}`,\n },\n);\n\nawait test.roll();\nif (test.failed)\n{\n if (parseInt(test.result.SL) <= -4)\n {\n this.actor.addCondition(\"unconscious\");\n }\n else \n {\n this.actor.addCondition(\"stunned\");\n }\n}","SefcrhXsdYGFcCW6":"args.actor.system.details.move.value -= 3;\r\nargs.actor.system.details.man -= 2;\r\nargs.actor.system.status.carries.max *= 2;","SGr50Hq1AHIEzIFN":"let choice = await ItemDialog.create(ItemDialog.objectToArray({\r\n int : game.wfrp4e.config.characteristics.int,\r\n fel : game.wfrp4e.config.characteristics.fel\r\n}, this.effect.img), 1, \"Choose Characteristic\");\r\n\r\nthis.effect.updateSource({\"flags.wfrp4e.characteristic\" : choice[0].id})","sgS9rblPkQB36C8S":"if (this.item.name.includes(\"(\"))\r\n{\r\n\tlet trade = this.item.parenthesesText;\r\n\tif (trade?.toLowerCase() != \"any\")\r\n\t return this.item.updateSource({\"system.tests.value\" : this.item.system.tests.value.replace(\"any one\", trade)})\r\n}\r\n\r\nlet index = game.packs\r\n.filter(i => i.metadata.type == \"Item\")\r\n.reduce((acc, pack) => acc.concat(pack.index.contents), [])\r\n.filter(i => i.type == \"skill\" && i.name.includes(game.i18n.localize(\"NAME.Trade\")))\r\n.map(i => {\r\n\ti.id = i._id\r\n\treturn i\r\n})\r\n\r\nlet choice = await ItemDialog.create(index, 1, \"Choose a Trade Skill\")\r\nlet text;\r\nif (!choice[0])\r\n{\r\n let custom = await ValueDialog.create(\"Enter Custom Trade Skill\", \"Custom Trade\"); \r\n text = custom || \"\"\r\n}\r\nelse \r\n{\r\n text = game.wfrp4e.utility.extractParenthesesText(choice[0].name)\r\n}\r\n\r\nawait 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)});","sHfkTRqTWPg2JAGN":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.JQa5DLnTs2SEzRrc\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","shkBUtUuMPDKvFm7":"let test = await this.actor.setupSkill(\"Dodge\", {fields : {difficulty : \"average\"}})\r\nlet caster = this.effect.sourceActor\r\n\r\nlet fallen = this.effect.sourceTest.result.SL + caster.characteristics.wp.bonus\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"prone\")\r\n this.script.scriptMessage(`<b>${this.actor.prototypeToken.name}</b> falls ${fallen} yards`)\r\n}","sHVLKIdPbzLVItCa":"if (args.actorsystem.details.move.oars.value > 0)\r\n args.actor.system.details.move.oars.value -= 1;","SjDNjLBGsd9fYObo":"args.applyAP = false;","sjnoYbWpAugyDilW":"let test = await args.actor.setupSkill(\"Charm\", {\r\n appendTitle: ` – ${this.effect.name}`,\r\n skipTargets: true,\r\n fields: {difficulty: 'average'},\r\n characteristic: 'fel',\r\n context: {\r\n success: \"Animal becomes docile towards Humans, Elves who honour Isha, and similar allies.\"\r\n }\r\n});\r\nawait test.roll();","SK8paBvnvc5YLFI1":"if (args.test.options.doombolt && !args.test.options.doomboltRolled)\n{\n\targs.test.options.doomboltRolled = true;\n\n\tlet test = await this.actor.setupSkill(`${game.i18n.localize(\"NAME.Language\")} (${game.i18n.localize(\"SPEC.Magick\")})`, {fields : {difficulty : \"hard\"}, context : {failure : \"@Table[majormis]{Major Miscast}\"}});\n\tawait test.roll();\n\n\tif (test.succeeded)\n\t{\n\t\targs.test.preData.additionalDamage = 4;\n\t}\n}","SKn61f2ykhzuwMdw":"if ((args.test.result.roll % 11 == 0 || args.test.result.roll == 100) && args.test.failed)\n{\n delete args.test.result.misfire;\n args.test.result.tables.misfire = {\n label : \"Fehlzündung\",\n class : \"fumble-roll\",\n modifier : 0,\n key : \"artillery-misfires\"\n }\n}","sKO8TcLIkCTnFvXu":"args.abort = true;\r\nthis.script.scriptNotification(`Cannot use ${this.item.system.location.value}!`, \"error\")","skVq3eDEYKFF2iZp":"// I'm assuming the endurance test specified is for the end-round check\r\nawait this.actor.addCondition(\"poisoned\", 4);\r\n","SlrslcNdnYONcSH3":"let weapon = this.actor.itemTags[\"weapon\"].find(i => i.system.isEquipped);\nif (!weapon)\n{\n this.script.notification(\"Keine Waffe ausgerüstet!\", \"error\");\n return;\n}\n\nif (await this.actor.spend(\"system.status.fortune.value\", 1))\n{\n let test = await this.actor.setupWeapon(weapon, {appendTitle : ` - ${this.effect.name}`, whirlwind: true});\n test.roll();\n}\nelse\n{\n this.script.notification(\"Nicht genug Glück!\", \"error\");\n}","slSRg5p8h34Vot34":"args.context.doubleDamage = true;","SLy1Fs3oXcHgFgjK":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\r\nlet data = item.toObject();\r\nlet value = getProperty(this.effect.sourceTest, \"result.overcast.usage.other.current\") || 1\r\ndata.system.specification.value = value\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","slzh77d2DPtvsXk0":"if (!this.item.system.properties.qualities.damaging) this.item.system.qualities.value.push({name : 'damaging'})","SlzPn7ONIKab9URj":"if (game.combat.combatant?.actor?.uuid == this.actor.uuid)\n{\n \nthis.script.message(await this.actor.applyBasicDamage(2, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}))\n}","sm9d5lk6cM0OuUkf":"this.actor.applyFear(Math.min(4, this.effect.sourceTest.result.overcast.usage.other.current))","SNjG7IvgQzvCGczR":"if (this.actor.system.details.experience.current < 100) {\r\n return this.script.notification(game.i18n.localize(\"SCRIPT.NotEnoughXP\"))\r\n}\r\n\r\nlet item = await game.wfrp4e.utility.findItem(\"Messenger\", \"trait\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item]);\r\nlet expLog = foundry.utils.duplicate(this.actor.details.experience.log || []);\r\nexpLog.push({amount : 100, reason: item.name, spent: this.actor.details.experience.spent + 100, total: this.actor.details.experience.total, type: \"spent\"});\r\nthis.actor.update({\r\n \"system.details.experience.spent\": this.actor.details.experience.spent + 100,\r\n \"system.details.experience.log\": expLog\r\n });","sNSfDBIA2k17hPYI":"let ablaze = this.actor.hasCondition(\"ablaze\");\r\nif (ablaze)\r\n{\r\n\tablaze?.delete();\r\n\tthis.script.scriptNotification(\"Ignore Ablaze\");\r\n}\r\n","SO4Aa9argKbuO9rQ":"args.prefillModifiers.modifier -= 20","SPOkFWZWziZk5b7A":"return args.item?.system?.attackType != \"melee\"","sPvfYQEnyAYNpIhF":"let shouldDamage = await Dialog.confirm({\r\n title: this.effect.name + \" - \" + args.actor.name,\r\n content: \"Are you humanoid creature who have not made a sacrifice to Rhya (or another diety of nature or powerful nature spirit to whom the cult of Rhya are well disposed, such as Isha or Taal) since the last spring equinox?\"\r\n});\r\n\r\nif (shouldDamage) {\r\n let damage = 1 + this.effect.sourceTest.result.baseSL;\r\n await args.actor.applyBasicDamage(damage, {damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL});\r\n args.actor.addCondition(\"fatigued\");\r\n}","sQDh3g11pWchxpW9":"return true","SrCHfOJFZwDickqa":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"average\"}});\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"prone\")\r\n}","SreM9Jyj2XZjoezH":"return args.item?.system?.attackType == \"ranged\"","SRmfstEs278bP9Pz":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.yRhhOlt18COq4e1q\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","sSMg43ZjnNmpytfj":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name});\r\nawait test.roll();\r\n","Ssn21dxoMQiqD1y4":"return args.type == \"cast\" && args.item.lore.value == \"fire\"","SSqGxyN9hw0HDmED":"this.actor.addCondition(\"prone\");","ssuryRgATzt6XksC":"if (args.totalWoundLoss > 0)\n{\n let roll = await new Roll(\"1d10\").roll({allowInteractive : false});\n roll.toMessage(this.script.getChatData());\n args.totalWoundLoss += roll.total;\n args.modifiers.other.push({label : this.effect.name, value : roll.total})\n}","sT3t7huqUVWpbCt3":"if (Number(this.actor.system.details.age.value) > 870) {\n args.fields.slBonus -= 4;\n} else if (Number(this.actor.system.details.age.value) > 350) {\n args.fields.slBonus -= 3;\n} else {\n args.fields.slBonus -= 2;\n}","StAderQaQQsxb6Rv":"let target = await game.wfrp4e.tables.rollTable(\"fixations\")\r\nif (target)\r\n{\r\n this.script.scriptNotification(target.result);\r\n let hatred = this.actor.items.find(i => i.getFlag(\"wfrp4e\", \"fromEffect\") == this.effect.id)\r\n if (hatred)\r\n {\r\n hatred.update({\"system.specification.value\" : target.result})\r\n }\r\n}","SThruXFhxUdNKCG4":"const test = await this.actor.setupCharacteristic(\"int\", {fields: {difficulty: \"easy\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`});\r\nawait test.roll();\r\n\r\nif (test.failed) {\r\n this.actor.addCondition('stunned');\r\n}\r\n\r\nthis.script.scriptNotification(`${this.actor.name} failed the Intelligence Test and gained Stunned Condition!`);","SUfCkHdJg7rttdM1":"let amount = this.effect.sourceActor.system.characteristics.fel.bonus;\r\nargs.actor.addCondition(\"blinded\", amount);","sUHuj00IpoZ7Gd03":"return args.skill?.name != game.i18n.localize(\"NAME.Swim\");","surdCPFakh2JAAHa":"let test = this.actor.attacker?.test\nif (test && this.item.system.protects[test.result.hitloc.result] && test.result.critical)\n{\n this.script.message(`<strong>${this.item.name}</strong>: Kritische Treffer zweimal würfeln und das niedrigere Ergebnis wählen.`)\n}","svCqdytEOtqFXCcs":"let characteristics = {\n \"ws\" : 0,\n \"bs\" : 0,\n \"s\" : 0,\n \"t\" : 10,\n \"i\" : 15,\n \"ag\" : 0,\n \"dex\" : 10,\n \"int\" : 20,\n \"wp\" : 20,\n \"fel\" : 10\n}\nlet skills = [\"Kanalisieren\", \"Besonnenheit\", \"Ausweichen\", \"Unterhalten (Erzählen)\", \"Intuition\", \"Sprache (Magick)\", \"Wissen (Magick)\" , \"Wahrnehmung\"]\nlet skillAdvancements = [5, 15, 10, 10, 15, 10, 10, 20]\n\nlet talents = [\"Arkane Magie\", \"Niedere Magie\", \"Zweites Gesicht\"]\nlet trappings = [\"Waffe\", \"Robe\", \"Kampfstab (2H)\"]\nlet specialItems = [\n {name: \"Magischer Gegenstand\", type: \"trapping\", trappingType: \"misc\" },\n]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let item of specialItems) {\n let newItem\n if (item.type == \"weapon\") {\n newItem = new ItemWfrp4e({ name: item.name, type: item.type, system: { equipped: true, damage: {value: item.damage}} })\n } else if (item.type == \"trapping\") {\n newItem = new ItemWfrp4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type, system: { worn: true, trappingType: { value: item.trappingType} } } )\n } else {\n newItem = new ItemWfrp4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type })\n }\n items.push(newItem.toObject())\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else\n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else\n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings)\n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n trappingItem.system.equipped.value = true;\n\n items.push(trappingItem);\n }\n else\n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nlet ride = await foundry.applications.api.DialogV2.confirm({window : {title : \"Fähigkeit\"}, content : \"Chaos Steed und +20 auf Reiten (Pferd) hinzufügen?\"})\n\nif (ride)\n{\n let skill = await game.wfrp4e.utility.findSkill(\"Reiten (Pferd)\")\n skill = skill.toObject();\n skill.system.advances.value = 20;\n items = items.concat({name : \"Chaos Steed\", type: \"trapping\", \"system.trappingType.value\" : \"misc\"}, skill)\n}\n\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n","SvFKt9hMcFQjeILA":"args.actor.addCondition(\"entangled\", this.effect.sourceTest.result.overcast.usage.other.current)","SVnclT81zDqRLE5E":"args.test.result.other.push(`<strong>${this.effect.name}</strong>: @Fear[1,${this.actor.prototypeToken.name}]`)","SWIJjM2RCmzfr64u":"if (args.test.result.hitloc.result == \"head\" && args.test.result.critical)\r\n{\r\n args.test.result.critModifier = args.test.result.critModifier ? args.test.result.critModifier + 40 : 40\r\n\r\n args.test.result.critical += ` (+${args.test.result.critModifier})`\r\n}\r\n","SwliIjjjFtZMnJH3":"return !args.weapon?.system.properties.qualities.hack || args.weapon?.system?.isRanged","sWyO1DNaqb2EdHoW":"if (!this.actor.items.getName(game.i18n.localize(\"NAME.Frenzy\"))) // Either frenzy trait or psychology\r\n{\r\n // Add Frenzy psychology\r\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.DrNUTPeodEgpWTnT\")\r\n let data = item.toObject();\r\n data.effects[0].disabled = false;\r\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\r\n}\r\n\r\nthis.script.scriptMessage(`<p><strong>By imbibing this potion, ${this.actor.prototypeToken.name}</strong> has becomes subject to Frenzy. This Frenzy lasts [[1d10]] Rounds, and may not be ended sooner.</p>`, \r\n {whisper: ChatMessage.getWhisperRecipients(\"GM\"), blind: true }) ","sx7Ikn8WW00gBFb4":"let location = (Math.ceil(CONFIG.Dice.randomUniform() * 2) == 2 ? \"r\" : \"l\") + \"Arm\"\r\n\r\nif (location == \"lArm\")\r\n{\r\n\tthis.script.scriptNotification(\"Rolled Left\")\r\n}\r\nelse if (location == \"rArm\")\r\n{\r\n\tthis.script.scriptNotification(\"Rolled Right\")\r\n}\r\n\r\nthis.effect.updateSource({\"flags.wfrp4e.location\" : location});\r\n\r\nif (location)\r\n{\r\n let dropped = this.actor.itemTypes.weapon.filter(i => i.isEquipped & i.system.usesHands.includes(location));\r\n\r\n if (dropped.length)\r\n {\r\n this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(\", \")}!`)\r\n for(let weapon of dropped)\r\n {\r\n await weapon.system.toggleEquip();\r\n }\r\n }\r\n}\r\n\r\nlet roll = await new Roll(\"1d10\").roll()\r\n\r\nroll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Duration)`}));\r\n\r\nthis.effect.updateSource({\"duration.rounds\" : roll.total})","syBgPp7rOymCZejX":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"stunned\")\r\n}","sYlGRLApZ3Ub24ea":"this.actor.system.status.addArmour(3, {source: this.effect.name, magical: true})","syqqBkyP5tGqZ78t":"this.actor.has(\"Immunity to Psychology\")?.delete();\r\n\r\nlet roll = await new Roll(\"1d10\").roll();\r\n\r\nroll.toMessage(this.script.getChatData());\r\n\r\nthis.script.scriptNotification(`Removed Immunity to Psychology, Adding ${roll.total} Broken Conditions`)\r\nthis.actor.addCondition(\"broken\", roll.total, {\"flags.wfrp4e.blasted-mind\" : true})","syRJs8P4aBFB5USD":"if (this.actor?.system?.details?.god?.value !== \"Sigmar\") return\nif (this.actor?.currentCareer?.careergroup?.value !== \"Priester\"\n && this.actor?.currentCareer?.careergroup?.value !== \"Kriegerpriester\" ) return\n \nlet currentSin = this.actor.system.status.sin.value \nlet updatedSin = currentSin + 2\nawait this.actor.update({\"system.status.sin.value\": updatedSin})","sz0PqS1kroMOzUZk":"let characteristics = {\n \"ws\" : -15,\n \"bs\" : -30,\n \"s\" : 0,\n \"t\" : 0,\n \"i\" : -10,\n \"ag\" : -10,\n \"dex\" : 0,\n \"int\" : -20,\n \"wp\" : 15,\n \"fel\" : -20\n}\nlet skills = [\"Nahkampf (Waffenlos)\"]\nlet skillAdvancements = [10]\n\nlet talents = [\"Furchtlosigkeit (Alles)\", \"Raserei\", \"Unaufhaltsam\"]\nlet trappings = [\"Kürass\", \"Plattenarme\", \"Helm\", \"Plattenbeine\"]\nlet specialItems = []\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let item of specialItems) {\n let newItem\n if (item.type == \"weapon\") {\n newItem = new ItemWfrp4e({ name: item.name, type: item.type, system: { equipped: true, damage: {value: item.damage}} })\n } else if (item.type == \"trapping\") {\n newItem = new ItemWfrp4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type, system: { worn: true, trappingType: { value: item.trappingType} } } )\n } else {\n newItem = new ItemWfrp4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type })\n }\n items.push(newItem.toObject())\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else\n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else\n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings)\n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n trappingItem.system.equipped.value = true;\n\n items.push(trappingItem);\n }\n else\n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nconsole.log(\">>>>>>><\", items)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n","sZwLitzwKBTaFca3":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.5hH73j2NgPdsLCZN\")\r\nlet data = item.toObject();\r\ndata.name = data.name.replace(\"Target\", \"Greenskins, Undead, Chaos\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","T0KBl8iEkcPq08RI":"if (args.applyAP && args.modifiers.ap.magical)\n{\n args.modifiers.ap.ignored += args.modifiers.ap.magical\n args.modifiers.ap.details.push(\"<strong>\" + this.effect.name + \"</strong>: Ignore les PA magiques (\" + args.modifiers.ap.magical + \")\");\n}","T3RfSt3VMEat3iDD":"return args.skill?.name !== game.i18n.localize(\"NAME.Perception\");","t48hkacYdOpzWvK9":"args.options.beatBlade = true;","T4JEEDYCEIUbVHv4":"let fatigued = this.actor.hasCondition(\"fatigued\")\n if (!fatigued)\n {\n this.actor.addCondition(\"fatigued\")\n ui.notifications.notify(\"Zustand Erschöpft zu \" + this.actor.name + \" hinzugefügt; kann nicht entfernt werden, solange das Symptom Unwohlsein vorhanden ist.\")\n }","t56mnblo1kv3gM1M":"return args.skill?.name.includes(\"Melee (Basic)\") || (args.type == \"weapon\" && args.item?.system.weaponGroup.value == \"basic\");","T5fiTzhXEQAv9Drf":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.rlDZZTj5PXjuRXa2\")\r\nlet data = item.toObject();\r\ndata.system.location.key = this.item.system.location.key;\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\r\n\r\nlet location = this.item.system.location.key;\r\n\r\nif (location)\r\n{\r\n let dropped = this.item.system.weaponsAtLocation;\r\n\r\n if (dropped.length)\r\n {\r\n this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(\", \")}!`)\r\n for(let weapon of dropped)\r\n {\r\n await weapon.system.toggleEquip();\r\n }\r\n }\r\n}","T74FEjfFrh3f6MKv":"args.wpb = args.sb;","t8LYOuN5peEdWeXP":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.mNoCuaVbFBflfO6X\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","TAw9vXnfyIAl5DGs":"if (this.item.system.quantity.value)\r\n{\r\n game.wfrp4e.utility.postCorruptionTest(\"minor\", this.script.getChatData());\r\n\tthis.item.system.reduceQuantity();\r\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\r\n\tactor.applyEffect({effectData : [this.item.effects.contents[1].convertToApplied()]})\r\n}\r\nelse\r\n{\r\n\tthis.script.scriptNotification(\"None left!\", \"error\")\r\n}","TBpNFRL5uehs0fze":"if (this.item.system.quantity.value)\r\n{\r\n\tthis.item.system.reduceQuantity();\r\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\r\n\tactor.applyEffect({effectData : [this.item.effects.contents[0]]})\r\n}\r\nelse\r\n{\r\n\tthis.script.scriptNotification(\"None left!\", \"error\")\r\n}","TCgEBuMPPd5SLAsc":"args.fields.modifier -= 15","tCIT1a12Gt6k2ohA":"let resistance\r\nif (this.item.name.includes(\"(\"))\r\n{\r\n\tresistance = this.item.parenthesesText\r\n}\r\nelse \r\n{\r\n resistance = await ValueDialog.create(\"Enter Resistance\", \"Resistance\") \r\n \r\n if (resistance)\r\n {\r\n this.item.updateSource({name : this.item.name + ` (${resistance})`})\r\n this.effect.updateSource({name : this.effect.name + ` (${resistance})`})\r\n }\r\n} \r\nthis.item.updateSource({\"system.tests.value\" : this.item.system.tests.value.replace(\"the associated Threat\", resistance)})\r\n\r\nif (resistance && !this.effect.name.includes(\"(\"))\r\n{\r\n this.effect.updateSource({name : this.effect.name += ` (${resistance})`})\r\n}","TcqumwUFAL6V0cty":"if (this.item.getFlag(\"wfrp4e\", \"failedCool\"))\r\n{\r\n this.item.system.AP = {\r\n \"head\": 0,\r\n \"lArm\": 0,\r\n \"rArm\": 0,\r\n \"lLeg\": 0,\r\n \"rLeg\": 0,\r\n \"body\": 0\r\n }\r\n}","TCtXPvDpbfz1yrVZ":"let choice1 = [\n {\n type : \"skill\",\n name : \"Melee (Basic)\",\n diff : {\n system : {\n advances : {\n value : 20\n }\n }\n }\n }\n]\nlet choice2 = [\n {\n type : \"skill\",\n name : \"Melee (Two-Handed)\",\n diff : {\n system : {\n advances : {\n value : 20\n }\n }\n }\n }\n]\n\nlet choice = await new Promise((resolve, reject) => {\n new Dialog({\n title : \"Choice\",\n content : \n `<p>\n Select your choice\n </p>\n <ol>\n <li>Melee (Basic)</li>\n <li>Melee (Two-Handed)</li>\n </ol> \n `,\n buttons : {\n 1 : {\n label : \"Basic\",\n callback : () => {\n resolve(choice1)\n }\n },\n 2 : {\n label : \"Two-Handed\",\n callback : () => {\n resolve(choice2)\n }\n }\n }\n }).render(true)\n}) \n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n items.push(foundry.utils.mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n","tcZug8ehU6lyYBd9":"return args.skill?.name != \"Ranged (Blackpowder)\"","Td8M5K1P92GbM2IA":"if (!args.messageSent)\n{ \n args.messageSent = true;\n let runes = this.actor.effects.contents.filter(i => i.name == this.effect.name);\n this.script.message(`<strong>${args.attacker.speaker.alias}</strong> reduce Run speed by ${runes.length * 4} yds.`)\n}","tdICiJ26rJrDbxT6":"return args.characteristic != \"i\"","TdjlJro0RRVSh8g8":"return args.skill?.name != game.i18n.localize(\"NAME.Gamble\") && args.skill?.name != game.i18n.localize(\"NAME.SleightOfHand\");","tDrs0aNIYmZPsOoS":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"prone\")\r\n}\r\n","TEiNj5FgkoD3YbhS":"this.actor.hasCondition(\"bleeding\")?.delete()","tFAKRRRfTjQfdQz3":"this.actor.getActiveTokens().forEach(t => t.document.update({\"texture.tint\" : \"\"}));","tfdKU6nmvUtEjXE2":"let choice = await Dialog.wait({\r\n title : \"Choice\",\r\n content : \r\n `<p>\r\n Select your choice\r\n </p>\r\n `,\r\n buttons : {\r\n 1 : {\r\n label : \"Shield\",\r\n callback : () => {\r\n return \"shield\"\r\n }\r\n },\r\n 2 : {\r\n label : \"Two-Handed Weapon\",\r\n callback : () => {\r\n return \"twohanded\"\r\n }\r\n },\r\n }\r\n})\r\n\r\nlet weapons = await warhammer.utility.findAllItems(\"weapon\", \"Loading Weapons\");\r\nlet items\r\nif (choice == \"shield\") \r\n{\r\n items = await game.wfrp4e.apps.ItemDialog.create(weapons.filter(i => i.system.properties.qualities.shield), 1, \"Choisissez a Shield\");\r\n}\r\nelse if (choice == \"twohanded\")\r\n{\r\n items = await game.wfrp4e.apps.ItemDialog.create(weapons.filter(i => i.system.weaponGroup.value == \"twohanded\"), 1, \"Choisissez a Two-Handed Weapon\");\r\n}\r\nitems = items.map(i => i.toObject())\r\n\r\nitems.forEach(i => i.system.equipped.value)\r\n\r\nthis.actor.createEmbeddedDocuments(\"Item\", items);\r\n","tG1qGqzBLmAR3WHm":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nif (test.failed) \r\n{\r\n let add = 0\r\n\r\n if (test.result.roll % 11 == 0 || test.result.roll == 100) \r\n {\r\n add = 1 // can't use isFumble if no hit location\r\n }\r\n\r\n await this.actor.addCondition(\"stunned\", Math.max(1, Math.abs(test.result.SL)) + add)\r\n await this.actor.addCondition(\"blinded\", Math.max(1, Math.abs(test.result.SL)))\r\n\r\n}","tg9N6aUo8WRPKj3H":"// If the creature currently has a Surprised, Unconscious, or Entangled Condition, it does not gain this Advantage.\nconst surprised = this.actor.hasCondition(\"surprised\")\nconst unconscious = this.actor.hasCondition(\"unconscious\")\nconst entangled = this.actor.hasCondition(\"entangled\")\nif (entangled || unconscious || surprised) return\n\n// If, at the beginning of its turn, this creature does not have at least Rating Advantage points, its Advantage pool immediately increases to Rating.\nconst grimRating = parseInt(this.item.specification.value) || 1\nif (grimRating > this.actor.status.advantage.value) {\n this.actor.setAdvantage(grimRating)\n}","TGN070HeJLl3gSMY":"let test = await this.actor.setupCharacteristic(\"ag\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context: { failure: \"Goes Prone\" }})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"prone\");\r\n}","tGVEV6TLl310mFLP":"let nonmagical = args.modifiers.ap.value - args.modifiers.ap.magical\r\nif (args.applyAP && nonmagical) \r\n{\r\n let nonmagical = args.modifiers.ap.value - args.modifiers.ap.magical\r\n args.modifiers.ap.ignored += nonmagical\r\n args.modifiers.ap.details.push(\"<strong>\" + this.effect.name + \"</strong>: Ignore Non-Magical AP (\" + nonmagical + \")\");\r\n}","tHBlC7SpYiQ7SUGo":"return args.characteristic !== \"t\";","thxlWeZbow8iE7xA":"const uuid = \"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\";\r\nconst item = await fromUuid(uuid);\r\nconst data = item.toObject();\r\ndata.system.specification.value = 1;\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id});","TIoUbjOtj7PTK2t8":"const test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {\n skipTargets: true,\n appendTitle: ` — ${this.effect.name}`,\n fields: {difficulty: \"challenging\"},\n context: {\n failure: `Butcher verliert Zähne.`\n }\n});\n\nawait test.roll();\n\nif (test.failed) {\n const SL = Number(test.result.SL);\n this.script.message(`Butcher verliert ${SL} Zähne.`);\n}","tKBq1nGZo8t6vvQ6":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.5hH73j2NgPdsLCZN\");\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id})","tki0DhoTecjq3LyZ":"this.actor.applyDamage(1, {\n damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL,\n createMessage: this.script.getChatData()\n});\n\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {appendTitle: ` - ${this.effect.name}`, skipTargets: true});\nawait test.roll();\nif (test.failed)\n{ \n this.actor.addCondition(\"broken\");\n}","TKjBb75exjae87fa":"args.modifiers.other.push({label : this.effect.name, details : \"Schadenserhöhung\", value : 2})","tkZ8Ybqu518LQYEn":"await args.actor.addCondition(\"ablaze\");\n\targs.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.4CMKeDTDrRQZbPIJ\", this.effect, [{\"system.specification.value\": \"Krezok Soulflayer\"}])","TmaS8o33825QUMrx":"let stomp = game.wfrp4e.config.systemItems.stomp;\r\nlet test = await this.actor.setupTrait(stomp)\r\nawait test.roll();","tn6SwmjAuNzqE6dx":"let damage = 0\r\nlet test = await this.actor.setupSkill(\"Dodge\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\r\nawait test.roll();\r\n\r\nif (test.succeeded)\r\n{\r\n damage = 10;\r\n}\r\nelse if (test.failed)\r\n{\r\n damage = 20;\r\n}\r\n\r\nthis.script.scriptMessage(await this.actor.applyBasicDamage(damage, {loc : \"roll\", hideDSN: true, suppressMsg : true}))","tnE8LF6E3svIlLca":"return args.skill?.name == game.i18n.localize(\"NAME.Research\");","TnFobCxG4pxlYmKr":"let gorCharacteristics = {\r\n \"ws\": 45,\r\n \"bs\": 30,\r\n \"s\": 35,\r\n \"t\": 45,\r\n \"i\": 30,\r\n \"ag\": 35,\r\n \"dex\": 25,\r\n \"int\": 25,\r\n \"wp\": 30,\r\n \"fel\": 25\r\n}\r\nfor (let char in this.actor.characteristics) {\r\n if (this.actor.characteristics[char].initial < gorCharacteristics[char])\r\n this.actor.characteristics[char].initial = gorCharacteristics[char]\r\n}","tnilBagajWM8UGQt":"return args.item?.name != game.i18n.localize(\"NAME.ConsumeAlcohol\")","tNTO1LVN7JqHf4YN":"if (args.test.characteristicKey == \"wp\") \r\n{\r\n if (args.test.failed)\r\n {\r\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [game.wfrp4e.config.symptomEffects[\"malaise\"]])\r\n this.script.scriptMessage(`Willpower Test failed, <b>${this.actor.prototypeToken.name}</b> gains @Condition[Malaise] for [[1d10]] hours`, {whisper: ChatMessage.getWhisperRecipients(\"GM\")})\r\n }\r\n}","TNWmIkuubqBn38he":"this.effect.deleteCreatedItems();","ToKlHDAjJOsC51ag":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.GlShFJF2TpsNh1FX\")\r\nlet data = item.toObject();\r\ndata.system.location.key = this.item.system.location.key\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\r\n \r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}});\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n args.actor.addCondition(\"unconscious\")\r\n}","tolkNN5P7oOC8GKZ":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"difficult\"}})\r\nawait test.roll();\r\n\r\nif (test.failed)\r\n{\r\n let sourceActor = this.effect.sourceActor;\r\n if (sourceActor)\r\n {\r\n this.script.scriptMessage(await this.actor.applyBasicDamage(sourceActor.system.characteristics.wp.bonus, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL}))\r\n }\r\n}","toSrgcvWq9b5eN0K":"let location = await game.wfrp4e.tables.rollTable(\"hitloc\", {hideDSN: true})\r\n\r\nthis.item.updateSource({name : `${this.item.name} (${location.description})`})\r\nthis.script.scriptMessage(`<strong>Location:</strong> ${location.description}`, { whisper: ChatMessage.getWhisperRecipients(\"GM\") })","TOyQLrugFGzwc5nY":"return !(args.skill?.name.includes(game.i18n.localize(\"NAME.Melee\")) || args.item?.isMelee || args.options.corruption);","TpgK2aAe93ui3Rbs":"if (args.test.isFumble && args.test.options.supercharge) {\n args.test.result.tables.misfire = {\n label : \"Fehlzündung (Überladen)\",\n class : \"fumble-roll\",\n modifier : 0,\n key : \"artillery-misfires\"\n } \n}","tpz88eQFTjWHdFL5":"return args.item?.system?.attackType != \"ranged\" || this.item != args.item || this.actor.isOpposing","TpZItJ5Ugbazaobd":"let locations = [];\r\n\r\nwhile (locations.length < 2)\r\n{\r\n let loc = await game.wfrp4e.tables.rollTable(\"hitloc\", {hideDSN : true})\r\n if (!locations.includes(loc.result))\r\n {\r\n locations.push(loc.result);\r\n }\r\n}\r\n\r\nlocationText = locations.map(i => game.wfrp4e.config.locations[i]).join(\", \")\r\n\r\nthis.item.updateSource({name : this.item.name += ` (${locationText})`, \"flags.wfrp4e.locations\" : locations})\r\nthis.effect.updateSource({\"flags.wfrp4e.locations\" : locations})","Tq45Nd8J3eTvHT41":"return args.skill?.name != game.i18n.localize(\"NAME.Perception\") && args.skill?.name != game.i18n.localize(\"NAME.SetTrap\");","TQRL4mZhZohXg1Au":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\ntest.roll();","TrIYdcG3jDER4WgY":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.xsGbDFqK2qh7lsIj\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = \"Minor\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","TSsHcn4EDulD03RU":"return !this.actor.hasCondition(\"fatigued\")","TU2xjbJ0zFtytF3J":"return args.skill?.name == game.i18n.localize(\"NAME.CharmAnimal\");","tuIsytv3jl2yAIb2":"return args.skill?.name !== game.i18n.localize(\"NAME.Charm\") && args.skill?.name !== game.i18n.localize(\"NAME.Intimidate\") && args.skill?.name !== game.i18n.localize(\"NAME.Leadership\")","tUwP7TjrOOOnaCYJ":"let fatigued = this.actor.hasCondition(\"fatigued\")\r\nif (fatigued)\r\n{\r\n this.script.scriptNotification(`Cleared ${fatigued.conditionValue} Fatigued Conditions`)\r\n fatigued.delete(); \r\n}\r\nelse \r\n{\r\n\tthis.script.scriptNotification(`No Fatigued Conditions`)\r\n}","TwgdEucxcHloc4cX":"let choice1 = [\n {\n type : \"armour\",\n name : \"Mail Chausses\"\n },\n {\n type : \"armour\",\n name : \"Mail Coat\"\n },\n {\n type : \"armour\",\n name : \"Mail Coif\"\n },\n]\nlet choice2 = [\n {\n type : \"armour\",\n name : \"Mail Chausses\"\n },\n {\n type : \"armour\",\n name : \"Mail Coat\"\n },\n {\n type : \"armour\",\n name : \"Mail Coif\"\n },\n {\n type : \"armour\",\n name : \"Leather Leggings\"\n },\n {\n type : \"armour\",\n name : \"Leather Skullcap\"\n },\n {\n type : \"armour\",\n name : \"Leather Jack\"\n },\n]\nlet choice3 = [\n {\n type : \"armour\",\n name : \"Plate Breastplate\"\n },\n {\n type : \"armour\",\n name : \"Plate Bracers\"\n },\n {\n type : \"armour\",\n name : \"Plate Helm\"\n },\n {\n type : \"armour\",\n name : \"Plate Leggings\"\n },\n]\n\nlet choice = await new Promise((resolve, reject) => {\n new Dialog({\n title : \"Choice\",\n content : \n `<p>\n Select your choice\n </p>\n <ol>\n <li>Mail</li>\n <li>Mail & Leather</li>\n <li>Plate</li>\n </ol> \n `,\n buttons : {\n 1 : {\n label : \"Mail\",\n callback : () => {\n resolve(choice1)\n }\n },\n 2 : {\n label : \"Mail & Leather\",\n callback : () => {\n resolve(choice2)\n }\n },\n 3 : {\n label : \"Plate\",\n callback : () => {\n resolve(choice3)\n }\n }\n }\n }).render(true)\n}) \n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`${c.name} nicht gefunden`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","TwwKxFjK6TNGKbRB":"this.script.scriptMessage(await this.actor.applyBasicDamage(12, {damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}))\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"hard\"}})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addSystemEffect(\"cold1\")\r\n}\r\n\r\n","TXBg7zWxPfWxFmUB":"if (args.type == \"effect\" && args.options.action == \"create\" && [\"ablaze\"].some(i => args.document.statuses.has(i)))\n{\n this.script.notification(\"Immune to \" + args.document.name);\n return false;\n}","TXce477AiXHKbepk":"return args.type !== \"pray\" || args.item?.system?.type?.value !== \"miracle\" || args.item?.system?.god?.value?.toLowerCase() !== \"taal\";","TxfmxDGBj04AQQpt":"let weapon = args.opposedTest.defenderTest.weapon\r\nif (\r\n !args.opposedTest.result.swapped && \r\n args.opposedTest.result.winner == \"defender\" && \r\n args.opposedTest.attackerTest.result.damage && \r\n weapon && \r\n weapon?.system.properties.qualities.fast\r\n )\r\n{\r\n args.opposedTest.swap(this.effect.label);\r\n}","TY0xSQ00XXyEr49r":"args.fields.slBonus += 1;","tyQLkRLk1AXB4g2u":"if (args.test.succeeded) {\n args.test.result.critical = \"Critical\"\n\n args.test.result.tables.critical = {\n label : args.test.result.critical,\n class : \"Critique-roll\",\n modifier : args.test.result.critModifier,\n key: `crit${args.test.result.hitloc.result}`\n }\n\n args.test.result.other.push (`<strong>${this.effect.name}:</strong> Alle Erfolge sind Kritische Treffer.`)\n\n}","TzgmYRXFXRspIo1i":"this.effect.delete();","U1RUcgP8LD2qeGTm":"return !args.options.reload","U1UpSRJOSjPpO4HS":"let mutations = await warhammer.utility.findAllItems(\"mutation\", \"Loading Mutations\")\r\nlet roll = Math.floor(CONFIG.Dice.randomUniform() * mutations.length);\r\nthis.actor.createEmbeddedDocuments(\"Item\", [mutations[roll]]);\r\nthis.script.scriptNotification(`Added ${mutations[roll].name}`)","U26XMie3Kjoddisj":"let stunned = this.actor.hasCondition(\"stunned\")\r\nif (stunned)\r\n{\r\n this.script.scriptNotification(`Cleared 1 Stunned Condition`)\r\n this.actor.removeCondition(\"stunned\");\r\n}\r\nelse \r\n{\r\n\tthis.script.scriptNotification(`No Stunned Conditions`)\r\n}","u2TxLqkTdoK8aHTo":"let fatigued = this.actor.hasCondition(\"fatigued\")\n if (!fatigued)\n {\n this.actor.addCondition(\"fatigued\")\n ui.notifications.notify(\"Fatigued added to \" + this.actor.name + \" which cannot be removed until the Malaise symptom is gone.\")\n }","U2xKn7R1gm8kiQm8":"this.actor.hasCondition(\"broken\")?.delete();\r\n\r\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.8pVzgPkgWpTJvfhG\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","u3olS2p7Ls1JXfAH":"this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"mutatephys\", {}, \"Tzeentch\"));","u46KnlxCjP42F6QY":"let table = await fromUuid(\"RollTable.uATmVS40DQLC1woJ\");\n\nif (table)\n{\n table.roll();\n}\nelse\n{\n this.script.notification(\"Tabelle für Persönlichkeitsmerkmale nicht gefunden\", \"error\");\n}","U4A8FDNmwBGTuQZO":"if (args.attacker.has(\"Undead\") && !args.attacker.has(\"Ethereal\"))\r\n{\r\n args.totalWoundLoss = Math.floor(args.totalWoundLoss / 2)\r\n args.modifiers.other.push({label : this.effect.name, details : \"Halved\", value : \"× 0.5\"})\r\n}","u4fKgGFEnOCnvvsv":"return args.item?.system?.isRanged;","u5dNZ0s3lWfL8KFb":"return args.fields.charging","U5ndCwcJ1s3Ns26w":"args.item.system.qualities.value.push({name : \"magical\"});\r\nargs.item.system.damage.value += ` + ${parseInt(this.effect.sourceTest.result.SL)}`;\r\nargs.item.name += ` (${this.effect.name})`","u6CYMSZADrfXd48Q":"args.fields.modifier += 20;","U78c4oUjKwyUu6jT":"return (args.skill?.name != game.i18n.localize(\"NAME.Perception\") && args.characteristic != \"fel\")","U7lRf56BFaTfsC6B":"const type = await ValueDialog.create({\r\n title: game.i18n.localize(\"SCRIPT.FellstaveDialogTitle\"),\r\n text: game.i18n.localize(\"SCRIPT.FellstaveDialogText\")\r\n}, \"\");\r\n\r\nawait this.effect.item.update({name: `${this.effect.item.name} (${type})`});\r\nconst updates = this.effect.item.effects.map(e => {\r\n return {_id: e.id, name: e.name + ` (${type})`}\r\n});\r\nthis.effect.item.updateEmbeddedDocuments(\"ActiveEffect\", updates);","U9xh2wriSqCosugW":"if (args.test.options.stag)\r\n{\r\n\tif (parseInt(args.test.result.SL) < 0 || args.test.failed)\r\n\t{\r\n\t\tif (parseInt(args.test.result.SL) < 0)\r\n\t\t{\r\n\t\t\targs.test.result.SL = \"+0\";\r\n\t\t\targs.test.result.description = game.i18n.localize(\"ROLL.MarginalSuccess\");\r\n\t\t}\r\n\t\targs.test.result.outcome = \"success\"\r\n args.test.result.other.push(`<strong>${this.effect.name}</strong>: Minimum +0 SL`)\r\n\t}\r\n}","uA5qaat5EXzkzltq":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"difficult\"}, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (!test.succeeded)\n{\n let plague = await fromUuid(\"Compendium.wfrp4e-core.items.Item.aKiuGzlVO51JvsjV\")\n let obj = plague.toObject();\n await this.actor.createEmbeddedDocuments(\"Item\", [obj]);\n}\n\nthis.effect.delete();","uACa6u4JLNMRgFlr":"const talents = await Promise.all([\"Furious Assault\", \"Sea Legs\"].map(game.wfrp4e.utility.findTalent))\r\nthis.actor.createEmbeddedDocuments(\"Item\", talents, {fromEffect : this.effect.id})","UaImulhbPURkLJg2":"return this.actor.attacker && (args.skill?.name.includes(\"Melee (Basic)\") || (args.type == \"weapon\" && args.item?.system.weaponGroup.value == \"basic\"))","uAy4w7y8Uu9POF8C":"args.item.system.qualities.value.push({name : \"impact\"})","UbGzr86u3wqSEr2h":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"average\"}, appendTitle : \" - Wounded\"})\n await test.roll();\n if (test.failed)\n {\n fromUuid(\"Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb\").then(disease => {\n this.actor.createEmbeddedDocuments(\"Item\", [disease.toObject()])\n this.script.scriptNotification(\"Gained \" + disease.name)\n })\n }","UC6G3pFQwzUhrw6F":"return args.skill?.name != game.i18n.localize(\"NAME.CharmAnimal\");","ucF4aiJ1gpDB333G":"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)\r\n{\r\n args.test.result.other.push(`<b>${this.effect.name}</b>: Fall distance damage reduced by ${Number(args.test.result.SL) + 1} yards`)\r\n args.test.result.catfall = true; // Prevent duplicate messages\r\n}","uCJk19rijMPRU8jg":"return this.item.equipped.value \n && args?.weapon\n && ([\"giant\"].includes(args.target.Species.toLowerCase()))","UDPsaymtZf39UsMk":"\r\n let fatigued = this.actor.hasCondition(\"fatigued\")\r\n if (!fatigued)\r\n {\r\n this.actor.addCondition(\"fatigued\")\r\n ui.notifications.notify(\"Fatigued added to \" + this.actor.name + \" which cannot be removed until the Malaise symptom is gone.\")\r\n }","uEVSUTTam4Z96JJ2":"if (this.item.equipped.value\n && args.sourceItem \n && (args.sourceItem.isRanged || args.opposedTest.attackerTest?.spell)\n ) \n{\n args.modifiers.other.push({label : this.effect.name, details : \"Schadensreduzierung\", value : -2})\n}","UfkysrAftCs09Fct":"return args.skill.name !== game.i18n.localize(\"NAME.Gamble\")","ugL5IBB6R2yWyMWd":"if (args.totalWoundLoss > 0)\r\n{\r\n let apply = await Dialog.confirm({title : this.effect.name, content : `<p>Appy ${this.effect.name} Damage? Attacker must have used bare hands or a melee weapon made of metal.`})\r\n if (apply)\r\n {\r\n \r\n let damage = 5 + this.actor.characteristics.wp.bonus;\r\n \r\n let loc = args.opposedTest.attackerTest.weapon?.system.usesHands[0] || \"rArm\";\r\n \r\n let APatLoc = args.opposedTest.attacker.system.status.armour[loc];\r\n \r\n let metalAP = APatLoc.layers.reduce((metal, layer) => metal += (layer.metal ? layer.value : 0), 0)\r\n \r\n let APused = Math.max(0, APatLoc.value - metalAP); // remove metal AP at location;\r\n \r\n damage -= (APused + args.opposedTest.attacker.system.characteristics.t.bonus)\r\n \r\n let msg = await args.opposedTest.attacker.applyBasicDamage(damage, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL});\r\n msg += ` (ignored ${metalAP} metal AP on ${game.wfrp4e.config.locations[loc]})`\r\n this.script.scriptMessage(msg)\r\n }\r\n}","UgQW0UMPOZ0jwfVJ":"let current = this.actor.status.fortune.value\r\n\r\nthis.actor.update({\"system.status.fortune.value\" : 1 + current})\r\n\r\nthis.script.scriptMessage(`<b>${this.actor.prototypeToken.name}</b> fortune points increased from ${current} to ${1 + current}`)","UH5MIzqi2MvEqTwj":"if (args.totalWoundLoss > 0)\r\n{\r\n let roll = await new Roll(\"1d10\").roll();\r\n roll.toMessage(this.script.getChatData());\r\n args.totalWoundLoss += roll.total;\r\n args.modifiers.other.push({label : this.effect.name, value : roll.total})\r\n}","uhCq5NwjQ2a2idPn":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Tailor)';\r\nconst difficulty = 'easy';\r\nconst target = 30;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","UINefUJZN0GjcCbB":"if (args.type == \"cast\")\n{\n args.abort = true;\n this.script.notification(\"Impossible de lancer des sorts !\");\n}\nreturn true;","uLBDnWC3S0lRitbj":"let test = await this.actor.setupCharacteristic(\"int\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\n\r\nlet opposedResult = test.opposedMessages[0]?.getOppose()?.resultMessage?.getOpposedTest()?.result\r\n\r\nif (opposedResult?.winner == \"attacker\")\r\n{\r\n if (test.failed && (test.result.roll % 11 == 0 || test.result.roll == 100))\r\n {\r\n this.actor.addCondition(\"unconscious\")\r\n await this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\r\n this.script.scriptMessage(\"Erhält einen Korruptionspunkt\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n }\r\n else \r\n {\r\n await this.actor.addCondition(\"stunned\", 1 + opposedResult.differenceSL);\r\n }\r\n}\r\nelse \r\n{\r\n return false;\r\n}","ULmZMLezDamerN04":"let spells = await warhammer.utility.findAllItems(\"spell\", \"Loading Spells\")\r\n\r\nlet lore = (await game.wfrp4e.tables.rollTable(\"random-caster\", {hideDSN: true})).text\r\nthis.script.scriptNotification(lore)\r\nif (lore == \"GM's Choice\") {\r\n return\r\n}\r\n\r\nelse if (lore == \"Arcane Magic\") {\r\n lore = \"Arcane\"\r\n}\r\n\r\nelse if (lore == \"Petty Magic\") {\r\n lore = \"petty\"\r\n}\r\n\r\nelse {\r\n lore = lore.toLowerCase();\r\n}\r\n\r\nlet spellsWithLore = []\r\nif (lore == \"Arcane\") {\r\n spellsWithLore = spells.filter(i => !i.system.lore.value)\r\n}\r\nelse {\r\n spellsWithLore = spells.filter(i => i.system.lore.value == lore)\r\n}\r\n\r\nlet selectedSpell = spellsWithLore[Math.floor(CONFIG.Dice.randomUniform() * spellsWithLore.length)]\r\nItem.implementation.create(selectedSpell.toObject(), { parent: this.actor}).then(item => {\r\n this.actor.setupCast(item).then(test => test.roll());\r\n})","UlRSaZG4ZUU6fMND":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Carpenter)';\r\nconst difficulty = 'challenging';\r\nconst target = 10;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","ulXfbycWUu36vdmS":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"difficult\", slBonus : -1 * this.effect.sourceTest.result.SL}})\nawait test.roll();\nif (test.succeeded)\n{\n\tthis.script.notification(`Widerstand gegen ${this.effect.name}`);\n}\nreturn test.failed;","UlygtNPSDlWPIFCI":"args.fields.slBonus++;\n","Um6xMMiUftLXJxEt":"return [\"fel\", \"dex\"].includes(args.characteristic)","uMvD2HWFNGqCmrBM":"if (args.test.options.addChargingDice)\n{\n\targs.test.result.diceDamage = {formula: \"1d10\", value : Math.ceil(CONFIG.Dice.randomUniform() * 10) }\n\targs.test.result.additionalDamage += args.test.result.diceDamage.value;\n}","UnqnWi0dZYLf5fTT":"let choice1 = [\n {\n type : \"armour\",\n name : \"Mail Chausses\"\n },\n {\n type : \"armour\",\n name : \"Mail Coat\"\n },\n {\n type : \"armour\",\n name : \"Mail Coif\"\n },\n]\nlet choice2 = [\n {\n type : \"armour\",\n name : \"Mail Chausses\"\n },\n {\n type : \"armour\",\n name : \"Mail Coat\"\n },\n {\n type : \"armour\",\n name : \"Mail Coif\"\n },\n {\n type : \"armour\",\n name : \"Leather Leggings\"\n },\n {\n type : \"armour\",\n name : \"Leather Skullcap\"\n },\n {\n type : \"armour\",\n name : \"Leather Jack\"\n },\n]\nlet choice3 = [\n {\n type : \"armour\",\n name : \"Plate Breastplate\"\n },\n {\n type : \"armour\",\n name : \"Plate Bracers\"\n },\n {\n type : \"armour\",\n name : \"Plate Helm\"\n },\n {\n type : \"armour\",\n name : \"Plate Leggings\"\n },\n]\n\nlet choice = await Dialog.wait({\n title : \"Choice\",\n content : \n `<p>\n Select your choice\n </p>\n <ol>\n <li>Mail</li>\n <li>Mail & Leather</li>\n <li>Plate</li>\n </ol> \n `,\n buttons : {\n 1 : {\n label : \"Mail\",\n callback : () => {\n return choice1\n }\n },\n 2 : {\n label : \"Mail & Leather\",\n callback : () => {\n return choice2\n }\n },\n 3 : {\n label : \"Plate\",\n callback : () => {\n return choice3\n }\n }\n }\n})\n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`${c.name} nicht gefunden`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","uNYstk3eXmWamhzs":"args.actor.addCondition(\"blinded\")","uOHAsKlkFuIaAmjb":"args.actor.modifyWounds(1)","upfK6GM33qZCZjll":"return args.item?.name != \"Play (Lute)\"","UQtXuQmUlTyDKqhe":"let characteristics = {\n \"ws\" : 10,\n \"bs\" : 20,\n \"s\" : 0,\n \"t\" : 10,\n \"i\" : 15,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 40,\n \"wp\" : 45,\n \"fel\" : 10\n}\nlet skills = [\"Kanalisieren\", \"Besonnenheit\", \"Einschüchtern\", \"Sprache (Magick)\", \"Sprache (Nehekharan)\", \"Wissen (Magick)\", \"Wahrnehmung\"]\nlet skillAdvancements = [10, 20, 15, 15, 10, 10, 10]\nlet talents = [\"Arkane Magie (Domäne)\", \"Robustheit\", \"Bedrohlich\", \"Niedere Magie\", \"Lesen & Schreiben\", \"Zweites Gesicht\"]\nlet trappings = [\"Waffe\"]\nlet specialItems = [\n {name: \"Mouldering Robes\", type: \"trapping\", trappingType: \"clothingAccessories\" },\n {name: \"Pouches containing ritual components\", type: \"trapping\", trappingType: \"clothingAccessories\" },\n {name: \"Staff\", type: \"weapon\", damage: \"SB+2\"},\n {name: \"Dunkle Magie (Nekromantie)\", type: \"talent\"},\n]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let item of specialItems) {\n let newItem\n if (item.type == \"weapon\") {\n newItem = new ItemWfrp4e({ name: item.name, type: item.type, system: { equipped: true, damage: {value: item.damage}} })\n } else if (item.type == \"trapping\") {\n newItem = new ItemWfrp4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type, system: { worn: true, trappingType: { value: item.trappingType} } } )\n } else {\n newItem = new ItemWfrp4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type })\n }\n items.push(newItem.toObject())\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n trappingItem.system.equipped.value = true;\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nlet filters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"system.lore.value\",\n value : \"petty\"\n }\n]\n\nlet petty = (await ItemDialog.createFromFilters(filters, 3, {text: \"Wähle 3 Zaubertricks der Niederen Magie\"})).map(i => i.toObject());\n\n\nfilters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"system.lore.value\",\n value : \"\"\n }\n]\n\nlet arcane = (await ItemDialog.createFromFilters(filters, 2, {text : \"Wähle 2 Arkane Zauber\"})).map(i => i.toObject());\n\nfilters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"name\",\n value: /^((?!\\().)*$/gm, // Remove tout spells with parentheses (tout arcane spells spells)\n regex: true\n },\n {\n property : \"system.lore.value\",\n value : \"necromancy\"\n }\n]\n\nlet necromancy = (await ItemDialog.createFromFilters(filters, 1, {text : \"Wähle 1 Zauber der Nekromantie\"})).map(i => i.toObject());\n\narcane.forEach(i => {\n i.img = \"modules/wfrp4e-core/icons/spells/necromancy.png\";\n i.system.lore.value = \"necromancy\";\n})\nlet spells = [...petty, ...necromancy, ...arcane];\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items.concat(spells));\n","ur2HAWDGSGvyAynU":"if (args.combat.combatant.actor.uuid === this.effect.sourceActor.uuid) {\r\n this.effect.delete();\r\n}","uRiAvo9fb3U7FIIy":"if (!this.actor.has(\"Segnung der Macht\",\"prayer\")) this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.KSDrXcieyRc37YI7\", this.effect)","UsAHQecRlWL5PhP6":"this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty : \"average\"}}).then(async test =>\r\n{\r\n await test.roll()\r\n if (test.failed)\r\n {\r\n this.actor.corruptionDialog(\"moderate\") \r\n }\r\n})","UsuwsmU1TUQLQVM2":"let lore = this.effect.name.split(\"(\")[1].split(\")\")[0].toLowerCase();\r\nreturn !args.spell || (args.type == \"cast\" && [\"petty\", lore].includes(args.spell.system.lore.value));","uSwkYENTOcnfRrqA":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Melee\")) && args.weapon?.system?.attackType != \"melee\"","UTlgF4azrGQZsoDv":"const talents = await Promise.all([\"Ambidextrous\", \"Distract\"].map(game.wfrp4e.utility.findTalent))\r\nthis.actor.createEmbeddedDocuments(\"Item\", talents, {fromEffect : this.effect.id})","UtqUthabeQ4rHDLQ":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.tNWrJUOArwfWXsPw\");\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect: this.effect.id});","UUHQRPRrrRSr9MIA":"const venomFlag = this.effect.getFlag(\"wfrp4e-tribes\", \"venom\");\n\nif (venomFlag) {\n this.actor.updateEmbeddedDocuments(\"Item\", [venomFlag]);\n}","Uvk1X7sEhvv77YkD":"if (!args.flags.distractingApplied)\r\n{\r\n args.fields.modifier -= 20;\r\n args.flags.distractingApplied = true;\r\n}","UvycHOjSPm5Zv9KJ":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Dodge\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\nlet baseDamage = \"4\";\r\nif (test.succeeded)\r\n baseDamage = \"0\";\r\n \r\nlet damage = this.effect.sourceItem.system.computeSpellDamage(baseDamage, true) + parseInt(this.effect.sourceTest.result.SL);\r\n\r\nthis.script.scriptMessage(await this.actor.applyBasicDamage(damage, {suppressMsg : true}))\r\nthis.actor.addCondition(\"ablaze\")","uwdQvZtzy2HVeEzx":"if (args.totalWoundLoss > 0)\r\n{\r\n let roll = await new Roll(\"1d10\").roll();\r\n roll.toMessage(this.script.getChatData());\r\n args.modifiers.other.push({label : this.effect.name, value : roll.total})\r\n \r\n args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"hard\"}, skipTargets: true, appendTitle : \" - \" + this.effect.name}).then(async test => {\r\n await test.roll();\r\n if (test.failed)\r\n {\r\n this.script.scriptMessage(\"<strong>\" + args.actor.name + \"</strong> takes a @Table[critbody]{Critical Hit} to the torse\", {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \r\n }\r\n })\r\n}\r\n","UwjkHRAQHESdYXJs":"this.actor.getActiveTokens().forEach(t => t.document.update({light : {\r\n \"dim\": 2,\r\n \"bright\": 1,\r\n \"alpha\": 0.5,\r\n \"animation\": {\r\n \"speed\": 4,\r\n \"intensity\": 4,\r\n \"type\": \"pulse\",\r\n },\r\n \"color\": \"#949bff\",\r\n}}));","UWrzokgabRKUpnkG":"return [\"t\", \"wp\", \"ag\", \"i\", \"int\"].includes(args.characteristic)","ux3jaLpAUhZ5YqA6":"return args.item?.name != game.i18n.localize(\"NAME.Leadership\") && args.item?.name != game.i18n.localize(\"NAME.Cool\")","Ux4buMc7llF1Kg8p":"if (!this.actor.hasCondition(\"stunned\") && !this.actor.hasCondition(\"unconcscious\"))\r\n{\r\n this.effect.delete();\r\n}","Ux7L2VL2fYfITST6":"if (args.test.isCriticalFumble && args.test.context.dispel)\n{\n\tif (parseInt(args.test.result.SL) > 0 || args.test.succeeded)\n\t{\n\t\tif (parseInt(args.test.result.SL) > 0)\n\t\t{\n\t\t\targs.test.result.SL = \"-0\";\n\t\t\targs.test.result.description = game.i18n.localize(\"ROLL.MarginalFailure\");\n\t\t}\n\t\targs.test.result.outcome = \"failure\"\n args.test.result.other.push(`<strong>${this.effect.name}</strong>: Automatic Failure`)\n\t}\n\n}","UXdlnmwVgjc1QpF2":"args.actor.system.details.move.value += 1;\r\nargs.actor.system.status.carries.max = Math.floor(args.actor.system.status.carries.max * 0.75);","UxVfVoH7cbC9ESDr":"const test = await args.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {\n skipTargets: true,\n appendTitle: ` — ${this.effect.name}`,\n fields: {difficulty: \"challenging\"},\n context: {\n failure: `Erhält 1 Zustand @Condition[Stunned].`\n }\n});\n\nawait test.roll();\n\nif (test.failed)\n args.actor.addCondition(\"stunned\");","UYLXm2W6jVn21Age":"args.fields.modifier += 40;","uZeNKQ24fToJ7qtY":"let addWounds = 0\nswitch (args.actor.system.details.size.value) {\n case \"lrg\": \n addWounds = 5\n break\n case \"enor\":\n addWounds = 10\n break\n case \"mnst\":\n addWounds = 15\n break\n}\nif (addWounds > 0) {\n args.modifiers.other.push({label : this.effect.name, details : \"Schadenserhöhung\", value : addWounds})\n}","v00nVCRKqqRvY28t":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: {difficulty: \"hard\"}});\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"stunned\", 3)\r\n}\r\n","V0b4yLTawjCnm9ke":"if (args.opposedTest.attackerTest.result.critical\n || (args.totalWoundLoss > 0 && args.totalWoundLoss > args.actor.system.status.wounds.value))\n{\n await args.actor.corruptionDialog(\"minor\")\n}","v18mmwUmuKiVfwzQ":"let test = await this.actor.setupTest(game.i18n.localize(\"NAME.Endurance\"), {appendTitle : ` - ${this.effect.name}`, skipTargets: true});\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"stunned\");\r\n}","V1D2Uo3WDKYQePU3":"let damage = this.effect.sourceTest.result.damage;\r\n \r\nlet loc = \"head\"\r\nlet APatLoc = this.actor.system.status.armour[loc];\r\n\r\nlet metalAP = APatLoc.layers.reduce((metal, layer) => metal += (layer.metal ? layer.value : 0), 0)\r\n\r\nlet APused = Math.max(0, APatLoc.value - metalAP); // remove metal AP at location;\r\n\r\ndamage -= (APused + this.actor.system.characteristics.t.bonus)\r\n\r\nlet msg = await this.actor.applyBasicDamage(damage, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL});\r\nmsg += ` (ignored ${metalAP} metal AP on ${game.wfrp4e.config.locations[loc]})`\r\nthis.script.scriptMessage(msg)\r\n","V1KCAPGMPvAz3F3g":"let roll = await new Roll(\"1d10 + @sin\", {sin: this.actor.system.status.sin.value || 0}).roll();\nroll.toMessage(this.script.getChatData());\nthis.effect.updateSource({duration: {\n value: roll.total,\n units: \"days\"\n}});","V2lsVTi6q28eL5jl":"args.fields.slBonus += parseInt(this.effect.sourceTest.result.SL)","v4CCxVaVGf9i8U7X":"let cured = await Dialog.wait({\r\n title : this.effect.name,\r\n content : \"<p>Enter the number of diseases/poisons cured</p><input type='number'>\",\r\n buttons : {\r\n confirm : {\r\n label : \"Confirm\",\r\n callback : (dlg) => {\r\n let input = dlg.find(\"input\");\r\n value = parseInt(input[0].value);\r\n return value;\r\n }\r\n }\r\n }\r\n})\r\n\r\n\r\nlet damage = 0;\r\n\r\nlet rolls = new Array(cured).fill(\"\").map(i => `max(0, 1d10 - ${this.actor.system.characteristics.fel.bonus})`)\r\n\r\nlet test = new Roll(`${rolls.join(\" + \")}`);\r\nawait test.roll();\r\ntest.toMessage({speaker : {alias : this.actor.name}, flavor : this.effect.name});\r\nthis.script.scriptMessage(await this.actor.applyBasicDamage(test.total, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true }))","v4ITTsSY9EvCbhZP":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.9h82z72XGo9tfgQS\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","V4PcjtHde941wv6J":"await this.actor.addCondition(\"prone\");\nconst SL = this.effect.sourceTest.result.slOver;\nconst stunned = 1 + SL;\nawait this.actor.addCondition(\"stunned\", stunned);\n\nif (stunned > this.actor.system.characteristics.t.bonus) {\n const crit = `<a data-action=\"clickTable\" class=\"action-link critical\" data-table=\"crithead\" data-modifier=\"0\"><i class=\"fas fa-list\"></i> Kritischer Treffer</a>`;\n\n const Test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {\n skipTargets: true,\n appendTitle: ` - ${this.effect.name}`,\n fields: {difficulty: \"average\"},\n context: {failure: `Erleidet ${crit} am Kopf.`}\n })\n\n await test.roll();\n}","v5aUWYPlFHKWnZ5Y":"let damageCounter = this.effect.getFlag(\"wfrp4e\", \"damage\") || 0;\nawait this.actor.applyDamage(this.effect.sourceTest.result.damage + damageCounter, {sourceItem: this.effect.sourceItem, sourceTest: this.effect.sourceTest, createMessage: this.script.getChatData()})\ndamageCounter++;\nthis.effect.setFlag(\"wfrp4e\", \"damage\", damageCounter);\nawait this.actor.addCondition(\"ablaze\");","v5K5HaHTZmVSJBdr":"let bane = this.effect.specifier;\nif (bane)\n return;\nif (await this.script.dialog(\"Die Plage würfeln?\"))\n{\n let table = await fromUuid(\"Compendium.wfrp4e-archives2.tables.RollTable.wRfrOW5pRXRWM8Lb\");\n if (table)\n {\n bane = (await table.draw()).results[0].name;\n }\n else\n {\n this.script.notification(\"Zufallskreaturen-Tabelle nicht gefunden!\", \"error\");\n }\n}\n\nif (!bane)\n{\n bane = await ValueDialog.create({text: \"Plage eingeben\", title: this.effect.name})\n}\n\nif (bane)\n{\n this.effect.updateSource({name: this.effect.setSpecifier(bane)});\n}","v5xrDWcrTNFJkyQB":"let choice1 = [\n {\n type : \"skill\",\n name : \"Ranged (Bow)\",\n diff : {\n system : {\n advances : {\n value : 10\n }\n }\n }\n },\n {\n type : \"weapon\",\n name : \"Longbow\",\n },\n {\n type : \"ammunition\",\n name : \"Arrow\",\n }\n]\nlet choice2 = [\n]\n\nlet choice = await Dialog.wait({\n title : \"Option\",\n content : \n `<p>\n Add Option?\n </p>\n <ol>\n <li>Ranged (Bow) +10 and a Longbow with 12 Arrows</li>\n </ol> \n `,\n buttons : {\n 1 : {\n label : \"Yes\",\n callback : () => {\n return choice1;\n }\n },\n 2 : {\n label : \"No\",\n callback : () => {\n return choice2;\n }\n }\n }\n})\n\nlet updateObj = this.actor.toObject();\nlet items = []\nfor (let c of choice)\n{\n let existing \n if (c.type == \"skill\")\n {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type)\n if (existing && c.diff?.system?.advances?.value)\n {\n existing.system.advances.value += c.diff.system.advances.value\n }\n }\n\n if (!existing)\n {\n let item = await game.wfrp4e.utility.find(c.name, c.type)\n if (item)\n {\n item = item.toObject()\n equip(item);\n items.push(mergeObject(item, (c.diff || {})))\n }\n else\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n\n}\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n}","v6LIG7EwWYALxCpP":"return !this.effect.getFlag(\"wfrp4e\", \"trained\")?.includes(\"entertain\") || (!args.skill?.name.includes(game.i18n.localize(\"NAME.Entertain\")) && !args.skill?.name.includes(game.i18n.localize(\"NAME.Perform\")) && !args.skill?.name.includes(game.i18n.localize(\"NAME.Play\")))","V7qmFwUMCY2tfziH":"this.actor.addCondition(\"stunned\")","V9wD9FWHWxZUOGSI":"let roll = await (new Roll(`max(0, 1d10 - ${this.actor.characteristics.wp.bonus})`).roll())\r\nlet fatigued = roll.total\r\nroll.toMessage(this.script.getChatData());\r\nif (fatigued > this.actor.characteristics.wp.bonus)\r\n{\r\n this.actor.addCondition(\"unconscious\")\r\n this.script.scriptNotification(`Fell Unconscious`)\r\n}\r\nelse \r\n{\r\n fatigued = Math.max(0, fatigued)\r\n if (fatigued)\r\n this.actor.addCondition(\"fatigued\", fatigued)\r\n this.script.scriptNotification(`Gained ${fatigued} conditions`)\r\n}","V9xm4X1x3lPYTQaI":"if (args.extendedTest?.getFlag(\"wfrp4e\", \"fear\"))\r\n{\r\n\tthis.script.scriptNotification(\"Immune to Fear\");\r\n\targs.extendedTest.delete();\r\n\targs.abort = true;\r\n}","V9zm2hKUVLVZtAcN":"let characteristics = {\n \"ws\" : -10,\n \"bs\" : -10,\n \"s\" : 0,\n \"t\" : 15,\n \"i\" : 15,\n \"ag\" : -20,\n \"dex\" : 0,\n \"int\" : 20,\n \"wp\" : 10,\n \"fel\" : 10\n}\nlet skills = [\"Charm\", \"Channelling\", \"Entertain (Prophecy)\", \"Intuition\"]\nlet skillAdvancements = [0, 0, 20, 10]\nlet talents = [\"Detect Artefact\", \"Menacing\", \"Sixth Sense\"]\nlet traits = [\"Dooming\", \"Spellcaster (Lore of Life)\", \"Ward\"]\nlet trappings = []\nlet items = [];\nlet spells = [\"Forest of Thorns\"];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nconst traitRegex = /(?:,?(.+?)(\\+?\\d{1,2}\\+?)?\\s*?(?:\\((.+?)\\)\\s*(\\+?\\d{1,2})?|,|$))/gm\nfor (let trait of traits)\n{\n let traitMatches = trait.matchAll(traitRegex).next().value\n let traitName = traitMatches[1]\n let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there's a specialization\n let traitSpec = traitMatches[3]\n\n let traitItem;\n try {\n traitItem = await WFRP_Utility.findItem(traitName, \"trait\")\n }\n catch { }\n if (!traitItem) {\n ui.notifications.warn(`${trait} nicht gefunden`, {permanent : true})\n }\n traitItem = traitItem.toObject()\n\n if (Number.isNumeric(traitVal))\n {\n traitItem.system.specification.value = traitName.includes('Weapon','Horns','Tail','Tentacles','Bite') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal;\n traitItem.name = (traitItem.name + ` ${traitSpec ? \"(\"+ traitSpec + \")\" : \"\"}`).trim()\n }\n else \n traitItem.system.specification.value = traitSpec\n\n items.push(traitItem)\n\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let spell of spells) \n{\n let spellItem = await game.wfrp4e.utility.findItem(spell)\n if (spellItem)\n {\n spellItem = spellItem.toObject()\n\n items.push(spellItem);\n }\n else \n {\n ui.notifications.warn(`${spell} nicht gefunden`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.worn = true\n else if (item.type == \"weapon\")\n item.equipped = true\n else if (item.type == \"trapping\" && item.trappingType?.value == \"clothingAccessories\")\n item.worn = true\n}","VAPsww9x3HAw1sKP":"return !args.options.dodge","VAs1nXvicdQK18Do":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Language\"));","Vb7rgl8T4VRswbnZ":"this.actor.status.addArmour(parseInt(this.item.system.specification.value) || 0, {source: this.effect, damage : this.item.getFlag(\"wfrp4e\", \"APdamage\")})","VbI0Al6rJfypV3qY":"const failure = game.i18n.localize(\"ROLL.ImpressiveFailure\");\nconst success = game.i18n.localize(\"ROLL.AstoundingSuccess\");\n\nargs.test.result.description = args.test.succeeded ? success : failure;","VbL0TgaBAmYjrezZ":"const talents = await Promise.all([\"Hardy\"].map(game.wfrp4e.utility.findTalent))\r\nthis.actor.createEmbeddedDocuments(\"Item\", talents, {fromEffect : this.effect.id})","vBqrydNzHmEHClqZ":"let maxWounds = this.actor.system.status.wounds.max\nthis.actor.update({\"system.status.wounds.value\": maxWounds})","vc4bELo0cWYoILfB":"let choice = await ItemDialog.create(this.actor.itemTypes.disease, 1, \"Choose a disease to heal (must be naturally occuring)\")\r\n\r\nthis.script.scriptMessage(`Cured <strong>${choice[0]?.name}</strong>`);\r\nchoice[0].delete()","vc8eVKtyjtOGvWlK":"if (!this.actor.hasCondition(\"entangled\"))\r\n{\r\n this.effect.delete();\r\n}","VcE8Hie2jbpuyuM3":"const vomit = this.actor.itemTags.trait.find(t => t.name === \"Kotze\");\nconst name = \"Bileful rollTest\";\n\nif (!vomit) return;\n\nconst effect = vomit.effects.find(e => e.name === \"Kotze\");\nconst scriptData = effect.system.scriptData;\n\n// REMINDER\n\nscriptData.push({\n label: 'Erinnerung an die Zauberregeln',\n trigger: 'rollTest',\n script: `\n args.test.result.other.push(\"This rollTest attack follows the rules for the Lore of Nurgle spell @UUID[Compendium.wfrp4e-core.items.Item.XhyZ140R1iA1J7wZ].\");\n `\n});\n\n// /REMINDER\n\n// update Effect's name\nawait effect.update({\n name,\n \"system.scriptData\": scriptData\n});\n\n\n// update Trait's name\nawait vomit.update({name});\n\n// copy effect from Stream of Corruption spell\nconst effectData = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.XhyZ140R1iA1J7wZ.ActiveEffect.KAXAHr5NdusLTz6k\")).toObject();\n\nawait vomit.createEmbeddedDocuments(\"ActiveEffect\", [effectData]);","vcM0IgsYVmfWrlO3":"fromUuid(\"Compendium.wfrp4e-core.items.rOV2s6PQBBrhpMOv\").then(item => {\r\n this.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id});\r\n})","VCnNWmRBH28Rx0JH":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"))","ve3RcfTi49rdYZU0":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"average\"}, appendTitle : \" - Wounded\"})\n await test.roll();\n if (test.failed)\n {\n fromUuid(\"Compendium.wfrp4e-core.items.kKccDTGzWzSXCBOb\").then(disease => {\n this.actor.createEmbeddedDocuments(\"Item\", [disease.toObject()])\n this.script.scriptNotification(\"Gain de \" + disease.name)\n })\n }","vejhfB9aI58iF1vr":"let choice1 = [\n {\n type: \"trait\",\n name: \"Krankheit\",\n },\n {\n type: \"trait\",\n name: \"Infiziert\",\n },\n {\n type: \"trait\",\n name: \"Verstörend\",\n },\n {\n type: \"trait\",\n name: \"Befall\",\n },\n {\n type: \"trait\",\n name: \"Territorial\",\n }\n]\n\nlet updateObj;\nlet actor;\n\nasync function addTrait(c) {\n let items = [];\n console.log(\"TEST1\", c);\n let existing;\n if (c.type == \"trait\") {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type);\n }\n console.log(\"TEST\", existing);\n if (!existing) {\n let item = await game.wfrp4e.utility.find(c.name, c.type);\n if (item) {\n item = item.toObject();\n items.push(item);\n }\n else\n ui.notifications.warn(`${c} nicht gefunden`, { permanent: true });\n }\n console.log(\"WISH LIST2\", choice1, items);\n actor.createEmbeddedDocuments(\"Item\", items);\n}\n\nasync function dialogChoice() {\n for (let c of choice1)\n {\n if (await foundry.applications.api.DialogV2.confirm({window : {title: \"Option\"}, content:`<p>Option hinzufügen?</p><ol><li>${c.name}</li></ol>`}))\n {\n addTrait(c)\n c.valid = true;\n }\n }\n}\n\nupdateObj = this.actor.toObject();\nactor = this.actor\nawait dialogChoice();\n","vFUVWZ1l8wpTjLcx":"if (!this.actor.has(game.i18n.localize(\"NAME.Daemonic\")))\r\n return\r\n\r\nlet caster = this.effect.sourceActor;\r\nif (caster) \r\n{\r\n let wp = caster.system.characteristics.wp\r\n if (this.actor.system.characteristics.wp.value >= wp.value)\r\n {\r\n this.script.scriptNotification(\"Target has higher Willpower, no effect\")\r\n return\r\n }\r\n this.actor.applyBasicDamage(wp.bonus, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL })\r\n}","vgfs0DXvF5iKrz1M":"return args.characteristic != \"ag\" || this.item.getFlag(\"wfrp4e\", \"passed\")","VGuZMIR1lE8I1F1y":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {fields : {difficulty : \"difficult\"}, appendTitle : ` - ${this.effect.name}`})\nawait test.roll();\nif (test.failed) {\n this.actor.addCondition(\"stunned\");\n}","VINX6TBAJQznhVcN":"const repaired_message = `<p>Finished replacing <em>${this.item.name}</em> with a makeshift one.</p>`;\r\nconst test = 'Maintenance Crew Test';\r\nconst difficulty = 'hard';\r\nconst target = 80;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","vj3zArmX27vCxYJW":"return ![\"NAME.Perception\", \"NAME.Navigation\"].map(i => game.i18n.localize(i)).includes(args.skill?.name)","VJe23auRmrmZxdKM":"this.item.system.qualities.value.push({name: \"magical\"})\n\nthis.item.system.damage.value += \" + 1\"","vJgjAfwq8MuwE2HL":"let number = await new Roll(\"1d10\").roll();\nnumber.toMessage(this.script.getChatData());\n\nthis.actor.update({\"system.status.fortune.value\" : parseInt(this.actor.system.status.fortune.value) + number.total})\nthis.script.message(`${number.total} Glückspunkte hinzugefügt`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})","vJQRBxDfPwHens0a":"if (args.totalWoundLoss > 0) \r\n{\r\n args.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: { difficulty: \"difficult\" } }).then(async test => {\r\n await test.roll();\r\n if (test.failed) \r\n {\r\n await args.actor.addCondition(\"poisoned\")\r\n this.script.scriptMessage(await args.actor.applyBasicDamage(3, {suppressMsg : true, damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL }))\r\n }\r\n })\r\n}","vJT2UOO7Ov7a7Rx4":"if (args.totalWoundLoss > 0) this.actor.addCondition(\"surprised\")","vjyTKcNrJzX4XWnS":"let SL = parseInt(this.effect.sourceTest.result.SL)\r\nif (SL < 0)\r\n SL = 0\r\nthis.actor.addCondition(\"fatigued\", 1 + SL)","VKpKq4RSbI1KkUQK":"this.actor.flags.useless[this.effect.getFlag(\"wfrp4e\", \"location\")] = true;","Vkuu70BZV4DPYO2Q":"return args.item?.system?.attackType != \"ranged\"","VLdF2HPnCrNIgp7a":"let items = [];\r\n\r\nlet etiquette = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.sYbgpSnRqSZWgwFP\")).toObject();\r\netiquette.name += \" (Followers of Khorne)\";\r\n\r\nitems.push(etiquette);\r\n\r\nlet animosity = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.0VpT5yubw4UL7j6f\")).toObject();\r\n animosity.system.specification.value = \"Followers of Slaanesh\";\r\n\r\nitems.push(animosity);\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect : this.effect.id});\r\n","VlFUDaKUYoBYKYn0":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure: \"1 Corruption Point Gained\"}})\r\nawait test.roll();\r\nif (test.failed && this.actor.type == \"character\")\r\n{\r\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\r\n this.script.scriptMessage(\"Gained a Corruption point\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n}","VlHuDIAvPr8JM1P5":"return args.skill?.name !== game.i18n.localize(\"NAME.Row\");","vM2BPwYhHQaBAt2C":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.KII1gWnxIZ8HzmU5\");\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})","VM2zbABURI9K3JwQ":"if (!this.item.system.properties.qualities.pummel) this.item.system.qualities.value.push({name : 'pummel'});\n if (!this.item.system.properties.qualities.impale) this.item.system.qualities.value.push({name : 'impale'})\n if (!this.item.system.properties.qualities.penetrating) this.item.system.qualities.value.push({name : 'penetrating'})","vn13U388mwquGN9y":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.wGTD2LezlI6Atyy0\");\nlet leader = item.toObject();\n\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.Item.u0CFf3xwiyidD9T5\");\nlet luck = item.toObject();\nawait this.actor.createEmbeddedDocuments(\"Item\", [leader, luck], {fromEffect : this.effect.id});","VneW4jhf2nXdMpuV":"const excessSL = this.effect.sourceTest.result.baseSL - this.effect.sourceItem.system.sl;\nconst weapon = this.effect.sourceActor.items.find(i => i.equipped && i.system.tags.has(\"weapon\"));\nlet damage = weapon?.Damage + 4;\ndamage += excessSL;\nthis.actor.applyDamage(damage, {\n loc: \"roll\",\n createMessage: this.script.getChatData(),\n});","VNOKTzCrFbZ6PJUj":"return ![\"Charm Animal\", \"Endurance\", \"Outdoor Survival\"].includes(args.skill?.name)","vNp9wgdSvnNEjZyS":"args.fields.slBonus -= 2; ","Vns6WrafVq8NjX7t":"return args.skill?.name != game.i18n.localize(\"NAME.Heal\")","vNUGuypkhx2P5YIA":"return args.characteristic !== \"fel\"","VOc9sKag2Vy4vGGZ":"let specifier = this.item.specifier;\nlet rune;\nlet categories = [];\nif (specifier && specifier.toLowerCase() != \"alle formen\")\n{\n if (specifier.includes(\"Talisman\"))\n {\n categories.push(\"talisman\");\n }\n if (specifier.includes(\"Schutz\"))\n {\n categories.push(\"protection\");\n }\n if (specifier.includes(\"Waffe\"))\n {\n categories.push(\"weapon\");\n }\n if (specifier.includes(\"Rüstung\"))\n {\n categories.push(\"armour\");\n }\n if (specifier.includes(\"Ingenieurwesen\"))\n {\n categories.push(\"engineering\");\n }\n\n if (categories.length)\n {\n let runes = await warhammer.utility.findAllItems(\"wfrp4e-dwarfs.rune\", null, true, [\"system.category\", \"system.master\"]);\n let choices = runes.filter(i => categories.includes(i.system.category) && i.system.master);\n\n if (choices.length)\n {\n rune = (await ItemDialog.create(choices, 1, {title : this.effect.name, text : specifier, indexed: true}))[0]\n } \n else \n {\n rune = await DragDialog.create({text : `Provide Master Rune to learn (${specifier})`, title : this.effect.name, filter: (item) => item.type == \"wfrp4e-dwarfs.rune\" && item.system.master, onError: \"Es muss eine Meisterrune bereitgestellt werden\"});\n }\n }\n else \n {\n rune = await DragDialog.create({text : `Provide Master Rune to learn (${specifier})`, title : this.effect.name, filter: (item) => item.type == \"wfrp4e-dwarfs.rune\" && item.system.master, onError: \"Es muss eine Meisterrune bereitgestellt werden\"});\n }\n}\nelse \n{\n rune = await DragDialog.create({text : `Provide Master Rune to learn`, title : this.effect.name, filter: (item) => item.type == \"wfrp4e-dwarfs.rune\" && item.system.master, onError: \"Es muss eine Meisterrune bereitgestellt werden\"});\n}\n\nthis.actor.addEffectItems(rune.uuid, this.effect)\n\nlet talents = this.actor.itemTags.talent.filter(i => i.baseName == this.item.baseName);\nlet xpCost = talents.length * 100\n\nif (this.actor.type == \"character\" && (await foundry.applications.api.DialogV2.confirm({window: {title: this.effect.name}, content: `<p>Spend ${xpCost} XP for learning ${this.item.name}?</p>`})))\n{\n this.actor.update({\"system.details.experience.log\" : this.actor.system.addToExpLog(xpCost, this.item.name, this.actor.system.details.experience.spent + xpCost)})\n}","vPG4rV640aSzKzxe":"return !this.actor.flags.useless[this.item.system.location.key[0] + \"Arm\"] || [\"fel\", \"wp\", \"int\", \"t\"].includes(args.characteristic)","vphNSTVxfZjApblV":"const bonus = this.effect.getFlag(\"wfrp4e-tribes\", \"bonus\");\n\nargs.fields.modifier += bonus;","VQaC6ynouW5EQCbC":"let roll = await new Roll(\"1d10\").roll();\r\n\r\nawait roll.toMessage(this.script.getChatData());\r\n\r\nthis.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true}));\r\n\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name});\r\nawait test.roll();\r\n\r\nif (test.succeeded)\r\n{\r\n return false;\r\n}","VqTrKPtxv9hpn0Hr":"return args.skill?.name != \"Language (Magick)\"","VRDS4lkwSAzbtvm4":"if (args.totalWoundLoss > this.actor.system.status.wounds.value || args.opposedTest?.attackerTest.result.critical)\n{\n args.extraMessages.push(`<strong>${this.effect.name}</strong>: Can reverse Critical Wound roll`)\n}","vS2D9QUslR7ZtXXm":"let test = await this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n let roll = await new Roll(\"1d10\").roll();\r\n roll.toMessage(this.script.getChatData())\r\n\r\n this.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}))\r\n}","vSDMygIT9nNvEGWG":"// Each time the blade is used, the GM should secretly roll a d10.\r\n// On a 1, its poison has run dry, \r\n// and the next time it is employed it will shatter.\r\n\r\nif (Math.ceil(CONFIG.Dice.randomUniform() * 10) == 1) {\r\n this.item.setFlag(\"wfrp4e\", \"brittle\", true)\r\n ChatMessage.create({\r\n content: `\r\n <strong>${this.item.name}</strong> has run out of poison. It will shatter the next time it is used.`, \r\n whisper: ChatMessage.getWhisperRecipients(\"GM\"),\r\n blind: true\r\n })\r\n}\r\n","VswXxqDjU9IH8dX0":"this.actor.addCondition(\"broken\", 1 + this.actor.system.status.sin?.value || 0)","VtCzyfSnO1im0dgX":"args.actor.system.status.carries.max = Math.floor(args.actor.system.status.carries.max * 1.25);","vTebTUzXortx1Qut":"let specification = Number(this.item.specification.value) || 1;\r\nargs.actor.system.characteristics.t.initial += 10 * specification;\r\nargs.actor.system.status.carries.max -= Math.floor(args.actor.system.status.carries.max * 0.1 * specification);\r\nargs.actor.system.details.price.gc += args.actor.system.details.price.gc * 0.1 * specification;","VTS4RzbmReI87K9a":"args.fields.slBonus = Math.floor(this.item.system.total.value * 0.1);","vtXJI2VGlU9vODXz":"args.initiative += \"+10\";","VTzpExK3QSCaFQPf":"if (args.equipped) \n{\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.SfUUdOGjdYpr3KSR\")\n let regen = item.toObject();\n item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.kJNAY1YRaCy9IgmT\");\n let terror = item.toObject();\n terror.system.specification.value = 2;\n this.actor.createEmbeddedDocuments(\"Item\", [regen, terror], {fromEffect : this.effect.id});\n} \nelse \n{\n this.effect.deleteCreatedItems();\n}","VuE1mhrB6X6MYTzg":"return args.characteristic == \"fel\"","VUFST9Tb3zL9vWvg":"if (this.item.attackType == \"ranged\") args.initiative += \"+10\"","vUpMQlbwDiYfMCNS":"this.actor.addCondition(\"ablaze\");","VurA2XNqC0d9U49C":"this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test =>\r\n{\r\n await test.roll()\r\n if (test.failed)\r\n {\r\n this.actor.addCondition(\"fatigued\") \r\n }\r\n})","vuzRRj5d9XdNYx3o":"let broken = this.actor.hasCondition(\"broken\")\r\nif (broken)\r\n{\r\n broken.delete();\r\n this.script.scriptNotification(\"Removed Broken\")\r\n}","vvdo1NxjmGVkmFCT":"await this.actor.addCondition(\"stunned\");\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"hard\"}, skipTargets: true, appendTitle : \" - \" + this.effect.name})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n\tawait this.actor.addCondition(\"prone\")\r\n\tawait this.actor.addCondition(\"stunned\")\r\n}\r\n \r\nlet location = this.item.system.location.key;\r\n\r\nif (location)\r\n{\r\n let dropped = this.item.system.weaponsAtLocation;\r\n\r\n if (dropped.length)\r\n {\r\n this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(\", \")}!`)\r\n for(let weapon of dropped)\r\n {\r\n await weapon.system.toggleEquip();\r\n }\r\n }\r\n}","vvVhAqreedtmOR9b":"args.totalWoundLoss = Math.max(0, args.totalWoundLoss - 1)\r\nargs.modifiers.other.push({label : this.effect.name, value : -1})","vwsrPDuVxeNOtdhA":"return args.skill?.name != game.i18n.localize(\"NAME.Charm\")","VXERNoc5IazQGuGO":"if (args.applyAP && args.modifiers.ap.metal)\r\n{\r\n args.modifiers.ap.ignored += args.modifiers.ap.metal\r\n args.modifiers.other.push({value : args.modifiers.ap.metal, label : this.effect.name, details : \"Add Metal AP to Damage\" })\r\n args.modifiers.ap.details.push(\"<strong>\" + this.effect.name + \"</strong>: Ignore Metal (\" + args.modifiers.ap.metal + \")\");\r\n args.modifiers.ap.metal = 0\r\n}","vY3xeTTL3ghPrJpN":"this.actor.addCondition(\"entangled\");","VYw9ipwoHArGVnyW":"if (args.equipped)\n{ \n this.script.notification(\"Raserei!\")\n let frenzy = (await fromUuid(\"Compendium.wfrp4e-core.items.Item.yRhhOlt18COq4e1q.ActiveEffect.ydTMvbmqv6BZ4u6d\")).toObject();\n frenzy.statuses = [\"frenzy\"];\n frenzy.disabled = false;\n ActiveEffect.implementation.create(frenzy, {parent: this.actor});\n}\nelse \n{\n this.actor.effects.find(e => e.statuses.has(\"frenzy\"))?.delete();\n}","vZ5HCrhY8e4R1TrG":"let eye = await fromUuid(\"Compendium.wfrp4e-core.items.weczkAMPlTjX7lqU\")\r\nlet nose = await fromUuid(\"Compendium.wfrp4e-core.items.SpPRZZRHxly7uo2G\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [eye, nose]);","VzgTGb5QXKoyPNh3":"if (args.attackerTest.weapon && args.defenderTest.weapon)\r\n{\r\n let attackerReach = game.wfrp4e.config.reachNum[args.attackerTest.weapon.reach.value]\r\n let defenderReach = game.wfrp4e.config.reachNum[args.defenderTest.weapon.reach.value]\r\n \r\n if (attackerReach == defenderReach)\r\n defenderReach = defenderReach < 7 ? defenderReach + 1 : defenderReach \r\n\r\n attackerReach = game.wfrp4e.utility.findKey(attackerReach, game.wfrp4e.config.reachNum)\r\n defenderReach = game.wfrp4e.utility.findKey(defenderReach, game.wfrp4e.config.reachNum)\r\n\r\n args.attackerTest.weapon.reach.value = attackerReach\r\n args.defenderTest.weapon.reach.value = defenderReach\r\n}","vzMxIDjRlQSxXtCW":"// Remove the miscast if doubles rolled and succeeded\r\nif(args.test.succeeded && args.test.result.minormis && args.test.result.roll % 11 == 0)\r\n{\r\n delete args.test.result.minormis\r\n}\r\n// Decrement the major miscast to minor miscast\r\nelse if(args.test.succeeded && args.test.result.majormis && args.test.result.roll % 11 == 0)\r\n{\r\n delete args.test.result.majormis\r\n args.test.result.minormis = game.i18n.localize(\"ROLL.MinorMis\")\r\n}","VzO0ZDcTWvaBn4vm":"if (args.test.preData.skillName?.includes(game.i18n.localize(\"NAME.Language\")) || args.test instanceof CastTest)\r\n{\r\n\tif (parseInt(args.test.result.SL) > 0 || args.test.succeeded)\r\n\t{\r\n\t\tif (parseInt(args.test.result.SL) > 0)\r\n\t\t{\r\n\t\t\targs.test.result.SL = \"-0\";\r\n\t\t\targs.test.result.description = game.i18n.localize(\"ROLL.MarginalFailure\");\r\n\t\t}\r\n\t\targs.test.result.outcome = \"failure\"\r\n args.test.result.other.push(`<strong>${this.effect.name}</strong>: Maximum -0 SL`)\r\n\t}\r\n}","vzSj3vvPryp02EVC":"if (args.test.failed)\n {\n let applicableCharacteristics = [\"ws\", \"bs\", \"s\", \"fel\", \"ag\", \"t\", \"dex\"];\n if (applicableCharacteristics.includes(args.test.characteristicKey))\n {\n this.actor.addCondition(\"stunned\");\n }\n }","W2rdTwflbUVxFyfd":"let difficulty = \"\"\n if (this.effect.name.includes(\"Moderate\"))\n difficulty = \"easy\"\n else if (this.effect.name.includes(\"Severe\"))\n difficulty = \"average\"\n else\n difficulty = \"veasy\"\n\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {context : {failure : this.actor.name + \" stirbt an der Fäulnis\"}, fields: {difficulty}, appendTitle : \" - Fäulnis\"})\n await test.roll();\n if (test.failed)\n {\n this.actor.addCondition(\"dead\");\n }","w3r54pKZQKaH2Yer":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\")\r\nlet data = item.toObject();\r\nlet slOver = this.effect.sourceTest.result.slOver;\r\nlet overcast = this.effect.sourceTest.result.overcast\r\nslOver -= ((overcast.total - overcast.available) * 2) // If they used an overcast, subtract 2 SL for each one\r\nlet added = Math.floor(slOver / 3) || 0\r\ndata.system.specification.value = 1 + added; // For each +3 SL, add 1 specification\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","w4JKuTECFmu3YmTR":"return !args.skill?.name?.includes(game.i18n.localize(\"NAME.Ride\"))","w4RuGIfseGoxXA3k":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Carpenter)';\r\nconst difficulty = 'challenging';\r\nconst target = 20;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","w4zubIHP0XgMXsFe":"return !args.options.terror && !args.extendedTest?.getFlag(\"wfrp4e\", \"fear\");","W5qtA7Ul5cOj18Nd":"this.item.update({\"system.AP\" : {lArm : 3, rArm : 3, lLeg : 3, rLeg: 3}});","w6tr8mWy0ZSUkHLt":"const uuids = [\r\n \"Compendium.wfrp4e-core.items.Item.77p3QRKgFWakkndF\", // Blather\r\n \"Compendium.wfrp4e-core.items.Item.b4x1qEWcevX7xK58\", // Schemer\r\n];\r\n\r\nconst items = await Promise.all(uuids.map(uuid => fromUuid(uuid)));\r\nawait this.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect: this.effect.id});","w7K0lbxQKJ2tsc6f":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.EO05HX7jql0g605A\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = 60\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","w8s2RUzA1jmyu7vy":"if (args.test.isCritical && args.test.weapon.weaponGroup.value == \"crossbow\") {\n args.test.result.tables.critical.modifier \n = (typeof args.test.result.tables.critical.modifier ==='undefined') \n ? 10 \n : args.test.result.tables.critical.modifier + 10\n}","W9nyUNQStMr1pUHJ":"if (args.opposedTest.result.hitloc.value == this.item.system.location.key)\r\n{\r\n args.actor.addCondition(\"bleeding\", 1);\r\n this.script.scriptNotification(\"Added Bleeding\")\r\n}","WaeL2I8VVJmBBKHk":"const vomit = this.actor.itemTags.trait.find(t => t.name === \"Vomissement\");\nconst name = \"Test de Corruption\";\n\nif (!vomit) return;\n\nconst effect = vomit.effects.find(e => e.name === \"Vomissement\");\nconst scriptData = effect.system.scriptData;\n\nscriptData[0].script = `\nargs.actor.addCondition(\"stunned\");\nargs.actor.corruptionDialog(\"moderate\");\n`\n\nawait effect.update({\n name,\n \"system.scriptData\": scriptData\n});\n\nawait vomit.update({name});","wAETU6aTRr9d4oCU":"args.fields.slBonus++;","wagZ4VV7431N3Sm8":"!args.options.terror","wAntJhgb8Og5vJXh":"args.options.staunchBleeding = true;","wb1DpSdIhSqYG5cp":"args.fields.slBonus = -1 * parseInt(this.effect.sourceTest.result.SL)","WB6sIpLEPC8YPX67":"if (args.options.dodge)\r\n{\r\n\targs.abort = true;\r\n\tthis.script.scriptNotification(\"Cannot Dodge!\")\r\n}\r\nreturn [\"t\", \"int\", \"wp\", \"fel\"].includes(args.characteristic)","wBc8XvkAnv3j93vR":"if (Number(args.actor.system.status.fate.value) > 0) {\n args.actor.update({\"system.status.fate.value\": Math.max(args.actor.system.status.fate.value - 1, 0)});\n args.actor.update({\"system.status.fortune.value\": Math.max(args.actor.system.status.fortune.value - 1, 0)});\n this.script.message(`Schicksal und Glück um 1 reduziert`);\n}\nelse if (Number(args.actor.system.status.resilience.value) > 0)\n{\n args.actor.update({\"system.status.resilience.value\": Math.max(args.actor.system.status.resilience.value - 1, 0)});\n args.actor.update({\"system.status.resolve.value\": Math.max(args.actor.system.status.resolve.value - 1, 0)});\n this.script.message(`Zähigkeit und Mut um 1 reduziert`);\n}","wbM7tpw4TxvadcWm":"let items = this.effect.itemTargets;\r\nlet msg = \"\";\r\nfor(let item of items)\r\n{\r\n if (item.system.properties.qualities.durable)\r\n {\r\n await item.update({\"system.qualities.value\" : []});\r\n msg += `<p>${item.name} loses all Qualities</p>`\r\n }\r\n else \r\n {\r\n msg += `<p>${item.name} crumbles into dust!</p>` \r\n await item.update({name : item.name + \" (Dust)\"})\r\n }\r\n}\r\nif(msg)\r\n{\r\n this.script.scriptMessage(msg);\r\n}","WDN1kNe7lMc3Zf3d":"if (args.equipped)\n{\n this.actor.addEffectItems(\"Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn\", this.effect, {\"system.specification.value\" : 1})\n}\nelse\n{\n this.effect.deleteCreatedItems();\n}","we6JUzDvybekAbtn":"return args.type !== \"channelling\" && !args.skill?.name.includes(game.i18n.localize(\"NAME.Channelling\")) && args.skill?.name !== `${game.i18n.localize(\"NAME.Language\")} (${game.i18n.localize(\"SPEC.Magick\")})`","weDTna1dLMwHsNlJ":"args.modifiers.other.push({label : this.effect.name, details : \"Schadensreduzierung\", value : -4})","WeTlTniskT3Ej6vg":"args.modifiers.other.push({label : this.effect.name, value : 2})","wFHjQyCR6Wzn6TeQ":"this.actor.system.status.addArmour(1, {source: this.effect, magical: true});","Wh1VV3javfzcV3bP":"let spells = await warhammer.utility.findAllItems(\"spell\", \"Loading Spells\", true, [\"system.lore.value\"]);\n\nspells = spells.filter(i => [\"dark\", \"light\", \"fire\", \"life\", \"beasts\", \"shadows\", \"death\", \"heavens\", \"metal\"].includes(i.system.lore.value)).sort((a, b) => a.name > b.name ? 1 : -1);\n\nlet choices = await ItemDialog.create(spells, 7, {text : \"Choisissez 7 Sorts parmi toute combinaison de Magie de Couleur, Sorcellerie ou Magie Noire\", title : this.effect.name})\n\nthis.actor.addEffectItems(choices.map(i => i.uuid), this.effect)","whUSkaR1yem21bXp":"let characteristics = {\n \"ws\" : 10,\n \"bs\" : 5,\n \"s\" : 0,\n \"t\" : 5,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 6,\n \"int\" : -5,\n \"wp\" : 0,\n \"fel\" : 10\n}\nlet skills = [\"Melee (Basic)\", \"Track\"]\nlet skillAdvancements = [8, 7]\nlet talents = [\"Berserk Charge\", \"Careful Strike\", \"Strike to Injure\"]\nlet traits = [\"Flight (8)\", \"Fury\", \"Swarm\", \"Tracker\"]\nlet trappings = []\nlet items = [];\nlet spells = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nconst traitRegex = /(?:,?(.+?)(\\+?\\d{1,2}\\+?)?\\s*?(?:\\((.+?)\\)\\s*(\\+?\\d{1,2})?|,|$))/gm\nfor (let trait of traits)\n{\n let traitMatches = trait.matchAll(traitRegex).next().value\n let traitName = traitMatches[1]\n let traitVal = traitMatches[2] || traitMatches[4] // could be match 2 or 4 depending on if there's a specialization\n let traitSpec = traitMatches[3]\n\n let traitItem;\n try {\n traitItem = await WFRP_Utility.findItem(traitName, \"trait\")\n }\n catch { }\n if (!traitItem) {\n ui.notifications.warn(`${trait} nicht gefunden`, {permanent : true})\n }\n traitItem = traitItem.toObject()\n\n if (Number.isNumeric(traitVal))\n {\n traitItem.system.specification.value = traitName.includes('Weapon','Horns','Tail','Tentacles','Bite') ? traitVal - parseInt(characteristicValues[3]/10) : traitVal;\n traitItem.name = (traitItem.name + ` ${traitSpec ? \"(\"+ traitSpec + \")\" : \"\"}`).trim()\n }\n else \n traitItem.system.specification.value = traitSpec\n\n items.push(traitItem)\n\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n equip(trappingItem)\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let spell of spells) \n{\n let spellItem = await game.wfrp4e.utility.findItem(spell)\n if (spellItem)\n {\n spellItem = spellItem.toObject()\n\n items.push(spellItem);\n }\n else \n {\n ui.notifications.warn(`${spell} nicht gefunden`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n\n\nfunction equip(item)\n{\n if (item.type == \"armour\")\n item.worn = true\n else if (item.type == \"weapon\")\n item.equipped = true\n else if (item.type == \"trapping\" && item.trappingType?.value == \"clothingAccessories\")\n item.worn = true\n}","wIdpkqPBmeVwSSQS":"let roll = await new Roll(\"2d10\").roll();\nroll.toMessage(this.script.getChatData());\n\nthis.actor.applyDamage(roll.total, {\n damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL,\n createMessage: this.script.getChatData()\n});","wIqIF9B43SyDgGYv":"if (args.type == \"effect\" && args.options.action == \"delete\" && [\"fatigued\"].some(i => args.document.statuses.has(i)))\n{\n this.script.notification(\"Impossible de retirer \" + args.document.name);\n return false;\n}","WiYtNU2Y5BJfIpeM":"let location = this.item.system.location.key;\r\n\r\nif (location)\r\n{\r\n let dropped = this.item.system.weaponsAtLocation;\r\n\r\n if (dropped.length)\r\n {\r\n this.script.scriptNotification(`Dropped ${dropped.map(i => i.name).join(\", \")}!`)\r\n for(let weapon of dropped)\r\n {\r\n await weapon.system.toggleEquip();\r\n }\r\n }\r\n}","WJkwIrdj4NceOYe8":"return args.characteristic !== 'fel';","wKIGVpPddx7Y3SQH":"let damage = await new Roll(\"1d10 + @sin\", {sin: this.actor.system.status.sin.value || 0}).roll();\ndamage.toMessage(this.script.getChatData());\nthis.actor.applyDamage(damage.total, {\n damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL,\n createMessage: this.script.getChatData()\n});\n\nconst test = await this.actor.setupSkill(\n game.i18n.localize(\"NAME.Endurance\"),\n {\n fields: {difficulty: \"challenging\"},\n skipTargets: true,\n appendTitle: ` — ${this.effect.name}`,\n },\n);\n\nawait test.roll();\nif (test.failed)\n{\n this.actor.addCondition(\"stunned\");\n}","WKXyVHQwQCNTfSKv":"if ((args.item.type == \"weapon\" || args.item.system.attackType) && !args.item.isMagical )\r\n{\r\n args.item.system.qualities.value.push({name : \"magical\"})\r\n}","wkY4Uj2NjT8mQNT4":"args.item.system.damage.value = \"+6\";\r\nargs.item.system.qualities.value.push({name : \"magical\"});","wLg8LbPAPbQgUg0Z":"return (args.item?.system?.attackType != \"melee\" \n || this.actor.attacker != undefined \n || args.target?.hasCondition(\"surprised\") == undefined)","WnWA0e0bgqBsZp2L":"this.item.update({\"system.twohanded.value\" : !this.item.system.twohanded.value})","Wo4wQKUxSItAhRzZ":"let lore = this.effect.name.split(\"(\")[1].split(\")\")[0].toLowerCase();\r\n\r\n// If channelling corresponding lore\r\nif (args.type == \"channelling\" && args.spell.system.lore.value == lore)\r\n args.prefillModifiers.slBonus += 3\r\n// If channelling or casting different lore\r\nelse if (args.spell.system.lore.value != lore && args.spell.system.lore.value != \"petty\")\r\n args.prefillModifiers.slBonus -= 1","WO5n7Vbx8AgoVrwC":" let characteristics = {\n \"ws\" : 0,\n \"bs\" : 0,\n \"s\" : 0,\n \"t\" : 0,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 10,\n \"wp\" : 5,\n \"fel\" : 5\n }\n let skills = [\"Intuition\", \"Lore (Local)\", \"Perception\"]\n let skillAdvancements = [10, 10, 10]\n let talents = []\n let trappings = [\"Mail Coat\", \"Mail Chausses\", \"Mail Coif\", \"Hand Weapon\"]\n let items = []\n\n let updateObj = this.actor.toObject();\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let index = 0; index < skills.length; index++)\n {\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n }\n \n for (let trapping of trappings) \n {\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n \n equip(trappingItem)\n \n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n }","WOpRJluHKER1MdgI":"let difficulty = \"\"\n if (this.effect.name.includes(\"Moderate\"))\n difficulty = \"easy\"\n else if (this.effect.name.includes(\"Severe\"))\n difficulty = \"average\"\n else\n difficulty = \"veasy\"\n\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {context : {failure : this.actor.name + \" stirbt an der Fäulnis\"}, fields: {difficulty}, appendTitle : \" - Fäulnis\"})\n await test.roll();\n if (test.failed)\n {\n this.actor.addCondition(\"dead\");\n }","WP6opTZkvX3xwtJI":"this.actor.setWounds(0);\nthis.actor.addCondition(\"ablaze\");","WPQbVpD1uwSLAXq1":"if (this.actor.system.status.wounds.value == 0)\r\n{\r\n\tthis.actor.addCondition(\"dead\");\r\n}","Wqff6ICWYzvLDYC8":"if (this.actor.system.details.experience.current < 100) {\r\n return this.script.notification(game.i18n.localize(\"SCRIPT.NotEnoughXP\"))\r\n}\r\n\r\nlet item = await game.wfrp4e.utility.findItem(\"Sensory Sharing\", \"trait\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item]);\r\nlet expLog = foundry.utils.duplicate(this.actor.details.experience.log || []);\r\nexpLog.push({amount : 100, reason: item.name, spent: this.actor.details.experience.spent + 100, total: this.actor.details.experience.total, type: \"spent\"});\r\nthis.actor.update({\r\n \"system.details.experience.spent\": this.actor.details.experience.spent + 100,\r\n \"system.details.experience.log\": expLog\r\n });","WR0Kqn8CF5iwToak":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Tailor)';\r\nconst difficulty = 'difficult';\r\nconst target = 40;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","WRe1eGmGVGejPcS8":"let wind = this.effect.name.split(\" \")[2]\r\nreturn args.type == \"cast\" && game.wfrp4e.config.magicWind[args.item.system.lore.value] == wind;","wRxgpGmlUpe7nwzJ":"this.actor.getActiveTokens().forEach(t => t.document.update({light : {\r\n \"dim\": 0,\r\n \"bright\": 0,\r\n \"angle\": 360,\r\n \"alpha\": 0.5,\r\n \"animation\": {\r\n \"speed\": 0,\r\n \"intensity\": 0,\r\n \"type\": \"none\",\r\n },\r\n \"color\": \"\",\r\n }}));","wS6OIR3QN4mOUHn0":"if (args.totalWoundLoss > args.actor.characteristics.t.bonus)\r\n{\r\n args.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\")).then(async test => {\r\n await test.roll()\r\n if (test.failed) {\r\n let disease = await fromUuid(\"Compendium.wfrp4e-core.items.M8XyRs9DN12XsFTQ\")\r\n disease = disease.toObject()\r\n disease.system.duration.active = true\r\n args.actor.createEmbeddedDocuments(\"Item\", [disease])\r\n }\r\n })\r\n}","WsN2R1qOzuLa2qyB":"let specifier = this.item.specifier;\nlet rune;\nlet categories = [];\nif (specifier && specifier.toLowerCase() != \"alle formen\")\n{\n if (specifier.includes(\"Talisman\"))\n {\n categories.push(\"talisman\");\n }\n if (specifier.includes(\"Schutz\"))\n {\n categories.push(\"protection\");\n }\n if (specifier.includes(\"Waffe\"))\n {\n categories.push(\"weapon\");\n }\n if (specifier.includes(\"Rüstung\"))\n {\n categories.push(\"armour\");\n }\n if (specifier.includes(\"Ingenieurwesen\"))\n {\n categories.push(\"engineering\");\n }\n\n if (categories.length)\n {\n let runes = await warhammer.utility.findAllItems(\"wfrp4e-dwarfs.rune\", null, true, [\"system.category\", \"system.master\"]);\n let choices = runes.filter(i => categories.includes(i.system.category) && !i.system.master);\n\n if (choices.length)\n {\n rune = (await ItemDialog.create(choices, 1, {title : this.effect.name, text : specifier, indexed: true}))[0]\n } \n else \n {\n rune = await DragDialog.create({text : `Provide Rune to learn (${specifier})`, title : this.effect.name, filter: (item) => item.type == \"wfrp4e-dwarfs.rune\" && !item.system.master, onError: \"Es muss eine Rune (nicht Meisterrune) bereitgestellt werden\"});\n }\n }\n else \n {\n rune = await DragDialog.create({text : `Provide Rune to learn (${specifier})`, title : this.effect.name, filter: (item) => item.type == \"wfrp4e-dwarfs.rune\" && !item.system.master, onError: \"Es muss eine Rune (nicht Meisterrune) bereitgestellt werden\"});\n }\n}\nelse \n{\n rune = await DragDialog.create({text : `Provide Rune to learn`, title : this.effect.name, filter: (item) => item.type == \"wfrp4e-dwarfs.rune\" && !item.system.master, onError: \"Es muss eine Rune (nicht Meisterrune) bereitgestellt werden\"});\n}\n\nthis.actor.addEffectItems(rune.uuid, this.effect)\n\nlet talents = this.actor.itemTags.talent.filter(i => i.baseName == this.item.baseName);\nlet xpCost = talents.length * 100\n\nif (this.actor.type == \"character\" && (await foundry.applications.api.DialogV2.confirm({window: {title: this.effect.name}, content: `<p>Spend ${xpCost} XP for learning ${this.item.name}?</p>`})))\n{\n this.actor.update({\"system.details.experience.log\" : this.actor.system.addToExpLog(xpCost, this.item.name, this.actor.system.details.experience.spent + xpCost)})\n}","wsqNM4NHnwaAAQym":" args.applyAP = false;\r\n\r\n this.script.scriptNotification(\"This test only applies to criminals, otherwise close the dialog.\");\r\n this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"average\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => \r\n {\r\n await test.roll();\r\n if (test.failed)\r\n {\r\n args.actor.addCondition(\"unconscious\");\r\n }\r\n });","WtbSIghR0q4euE7J":"if (args.effect.conditionId == \"ablaze\")\n{\n args.data.formula = `(${args.data.formula}) * 2`;\n}","WTRYAEzwxRuGENyI":" // Every living creature within 10 yards, other than the wielder of the hammer,\r\n // must make a Challenging (+0) Endurance Test \r\n\r\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {\r\n skipTargets: true, appendTitle : \" - \" + this.effect.name,\r\n fields: {difficulty: \"challenging\"}\r\n })\r\n \r\n await test.roll();\r\n if (test.failed)\r\n {\r\n // or gain a Deafened Condition \r\n this.actor.addCondition(\"deafened\");\r\n // and suffer 1d10 Wounds which bypass armour but not Toughness Bonus.\r\n let damage = (await new Roll(\"1d10\").roll());\r\n await damage.toMessage(this.script.getChatData());\r\n this.script.scriptMessage(await this.actor.applyBasicDamage(damage.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}))\r\n }","wUlYLBT59Efys5aS":"args.actor.addCondition(\"prone\");","WwxXgsNxlccmqTze":"this.actor.addCondition(\"dead\")","WY3DajPRGcMNt158":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.MVI0lXcg6vvtooAF\")\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id})","wyTCozh9qGTx6yK0":"if (args.options.terror || args.extendedTest?.getFlag(\"wfrp4e\", \"fear\"))\r\n{\r\n\targs.abort = true;\r\n\tthis.script.scriptNotification(\"Does not need to make Fear or Terror tests\");\r\n}","wzkxiKjxVEeNS1di":"let roll = await new Roll(\"1d10\").roll();\r\nthis.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true}))\r\n\r\nawait this.actor.addCondition(\"deafened\", 3)\r\n\r\nlet 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\"}})\r\nawait test.roll();\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"broken\")\r\n}","WzMmwjZbhyCbHxyZ":"this.actor.status.encumbrance.state += 2\r\nthis.actor.status.encumbrance.pct = 100;","X08401eOhKJrhNf1":"const grim = this.actor.items.find(i => i.type === \"trait\" && i.name.includes(\"Grim\"));\r\n\r\nif (args.options?.deltaAdv > 0 && this.actor.hasCondition(\"engaged\") && grim.specification.value !== 4) {\r\n grim.update({\"system.specification.value\": 4});\r\n}\r\n\r\nif (!this.actor.hasCondition(\"engaged\") && grim.specification.value !== 2) {\r\n grim.update({\"system.specification.value\": 2});\r\n}","x1Ecj6MXY94kpcQq":"if (!this.item.equipped.value) {\n return this.script.notification(`Du musst ${this.item.name} ausrüsten, um Wunden zu regenerieren.`,\"info\")\n}\n\nconst runesOfRestoration = this.item.effects.contents.filter(e => e.name == this.effect.name)\nconst restorationWounds = parseInt(runesOfRestoration.length * this.actor.system.characteristics.t.bonus)\n\nthis.actor.modifyWounds(restorationWounds)\nthis.script.message(`Du hast ${restorationWounds} Wunden mit ${this.script.label} geheilt.`)","x2RLUUNB7BiIDYCP":"\r\n let difficulty = \"\"\r\n if (this.effect.name.includes(\"Moderate\"))\r\n difficulty = \"easy\"\r\n else if (this.effect.name.includes(\"Severe\"))\r\n difficulty = \"average\"\r\n else\r\n difficulty = \"veasy\"\r\n \r\n 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\"})\r\n await test.roll();\r\n if (test.failed)\r\n {\r\n this.actor.addCondition(\"dead\");\r\n }\r\n ","X3bLbOfcJAftOMa7":"return [\"ws\", \"bs\", \"ag\"].includes(args.characteristic)","X3vpmNUj9SL2CDnF":"let item = args.actor.items.find(i => i.name.includes(\"Flying Jib\"));\r\nitem.name += ` (Disabled by ${this.item.name})`;","x76tKw4L8dX00ikE":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.uqGxFOEqeurwkAO3\")\r\nlet data = item.toObject();\r\nsetProperty(data, \"flags.wfrp4e.breath\", \"fire\")\r\ndata.system.specification.value = 5\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","X7ikFOGKYzTMr4d1":"args.fields.difficulty = \"difficult\"","x8XK2fzzXCnSwfjt":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Athletics\"))\r\nawait test.roll();\r\n\r\nif (test.succeeded)\r\n{\r\n\tthis.actor.removeCondition(\"prone\");\r\n}","x9Ah9e5xAGqCNFO3":"if (args.totalWoundLoss > 0)\n {\n args.totalWoundLoss += 2;\n args.modifiers.other.push({label : this.effect.name, value : 2})\n }","x9G6Du5EWV6byf4C":"if (parseInt(this.effect.sourceTest.result.SL) >= 3)\r\n{\r\n this.actor.modifyWounds(this.actor.system.characteristics.t.bonus * 2)\r\n}\r\nelse \r\n{\r\n this.actor.modifyWounds(this.actor.system.characteristics.t.bonus)\r\n}","x9iKFYYc4Ocy8PTS":"let item = this.effect.getCreatedItems()?.[0];\r\nChatMessage.create({content : \"<em>Grace is beyond style</em>\", speaker : ChatMessage.getSpeaker({token: this.actor.getActiveTokens()[0]?.document, actor: this.actor})}, {chatBubble : true})\r\n\r\nlet choice = await ItemDialog.create(ItemDialog.objectToArray({\r\n \"nobles\" : \"Nobles\",\r\n \"guilders\" : \"Guilders\",\r\n \"servants\" : \"Servants\"\r\n}), 1, \"Choose Group\")\r\n\r\nlet name = choice[0]?.name\r\n\r\nif (!name)\r\n{\r\n return;\r\n}\r\n\r\nif (item)\r\n{\r\n item.update({\r\n name : item.name.split(\"(\")[0] + ` (${name})`, \r\n \"system.tests.value\" : item.system.tests.value.split(\"(\")[0] + ` (${name}`\r\n })\r\n}\r\nelse \r\n{\r\n item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.sYbgpSnRqSZWgwFP\");\r\n let data = item.toObject();\r\n data.name += ` (${name})`\r\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect: this.effect.id})\r\n}","xBpLQa7yBPczDMY8":" let scythe = (await fromUuid(\"Compendium.wfrp4e-core.items.CXg7XOFJwu4LZ9LM\")).toObject();\r\n scythe.name = \"Scythe of Shyish\";\r\n scythe.system.damage.value = \"WPB + 3\"\r\n scythe.system.equipped = true;\r\n scythe.img = this.effect.icon;\r\n scythe.system.qualities.value.push({name : \"magical\"})\r\n this.actor.createEmbeddedDocuments(\"Item\", [scythe], {fromEffect : this.effect.id})","XCAfy460IotarQek":"return false;","XClTZOjuhcxWLF51":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty: \"difficult\"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\n\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"stunned\")\r\n}\r\n\r\n\r\nlet item = await fromUuid(\"Compendium.wfrp4e-core.items.4lj1ik958mbgAlaF\")\r\nlet data = item.toObject();\r\ndata.system.location.key = this.item.system.location.key\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\r\n","xcny1zYAphdfrKv9":"args.fields.modifier -=20;","XcvDYNZgJ2rpAdDV":"\r\n let fatigued = this.actor.hasCondition(\"fatigued\")\r\n if (!fatigued)\r\n {\r\n this.actor.addCondition(\"fatigued\")\r\n ui.notifications.notify(\"Fatigued added to \" + this.actor.name + \" which cannot be removed until the Malaise symptom is gone.\")\r\n }","xcy5GOUSZ0meIejZ":"if (args.test.isFumble)\r\n{\r\n args.test.result.other.push(\"@Table[warp-grinder-fumble]\")\r\n}","Xe8ijqWU3bbtq7ZY":"if (args.opposedTest.defenderTest.actor.Species.toLowerCase().includes(\"skaven\"))\r\n{\r\n args.addImpact = true;\r\n args.opposedTest.result.other.push(\"Impact against Skaven\")\r\n}","xEE0ymsaH2tn2M99":"return args.type != \"cast\";","Xf4FcZ4ZLdWmOXBa":"return args.skill?.name != game.i18n.localize(\"NAME.Perception\") && !args.skill?.name.includes(game.i18n.localize(\"NAME.Stealth\"));","XfRvVBTVIuAm8RaZ":"return args.item?.name != game.i18n.localize(\"NAME.CharmAnimal\")","XfSxXatjEYlPEbaK":"const broken = this.actor.hasCondition(\"broken\");\n\n//broken?.delete();","Xg4qHLsyXGuUZfT8":"this.actor.hasCondition(\"ablaze\")?.delete();","xgdhf0wlNP2cHIQx":"await this.actor.addCondition(\"entangled\", this.effect.sourceTest.result.overcast.usage.other.current)","xgplXZMs459X7XXM":"// Apply changes when the mask is worn\r\n\r\nif (args.equipped) { \r\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [this.item.effects.contents[1]?.convertToApplied()]) \r\n this.script.scriptMessage(`${this.actor.name} dons the <strong>${this.item.name}</strong>. <br>\r\n They suffer –20 to all attempts to resist Disease.<br>\r\n 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}. \r\n `,\r\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}) \r\n}\r\n\r\n// Notify of lingering effects when mask is removed\r\nelse if (!args.equipped)\r\n{\r\n await this.item.effects.contents[0].delete();\r\n await this.item.update({name : this.item.name += \" (Used)\"})\r\n this.script.scriptMessage(`<strong>${this.item.name}</strong> 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.`, \r\n {whisper: ChatMessage.getWhisperRecipients(\"GM\")}\r\n )\r\n \r\n}\r\n","xihniGjgqOhuaKWc":" \r\n if (args.test.failed)\r\n {\r\n let applicableCharacteristics = [\"ws\", \"bs\", \"s\", \"fel\", \"ag\", \"t\", \"dex\"];\r\n if (applicableCharacteristics.includes(args.test.characteristicKey))\r\n {\r\n this.actor.addCondition(\"stunned\");\r\n }\r\n }","xIIkfmgWfh3teEfr":"if (this.item.system.armourType.value == 'mail' && !this.item.system.properties.qualities.impenetrable) this.item.system.qualities.value.push({name : 'impenetrable'});\n if (this.item.system.armourType.value == 'plate') this.item.system.qualities.value = this.item.system.qualities.value.filter(i => i.name != 'weakpoints')","xIRU2SaqLeWmqGDI":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.vMYEkrWj0ip6ZOdv\")\r\nlet data = item.toObject();\r\ndata.name += \" (Disease)\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","xiyQSXozoLxt0MZs":"const uuids = [\r\n \"Compendium.wfrp4e-core.items.Item.wMwSRDmgiF2IdCJr\", // Painless\r\n \"Compendium.wfrp4e-core.items.Item.IAWyzDfC286a9MPz\", // Immunity to Psychology\r\n];\r\n\r\nconst items = await Promise.all(uuids.map(uuid => fromUuid(uuid)));\r\nawait this.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect: this.effect.id});","XjUXxUA0hbwjUatW":"if (this.actor.hasCondition(\"engaged\") && this.effect.disabled)\n{\n this.effect.update({\"disabled\" : false})\n this.item.effects.contents[1].update({\"disabled\" : false});\n this.script.notification(\"Enabled\")\n}\nelse if (this.effect.active && !this.actor.hasCondition(\"engaged\"))\n{\n this.effect.update({\"disabled\" : true})\n this.item.effects.contents[1].update({\"disabled\" : true});\n \n}","xJZKVGE04o84Gibo":"if (!this.item.actor.name.includes(\"Brunner\")) return;\n\nargs.item.system.damage.value += \"+1\";","Xk9XPklxxTvFlwpI":"args.options.useOnesArgumentative = true;","xkdQhZ9KKqmocNLO":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.Item.tXKX29QZBdHmyMc7\")\nlet data = item.toObject();\nawait this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","xklncIMwQIespDxS":"let test = await this.actor.setupCharacteristic(\"t\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"vhard\"}});\r\nawait test.roll();\r\ngame.wfrp4e.utility.postCorruptionTest(\"minor\", this.script.getChatData())\r\n\r\nif (test.failed)\r\n{\r\n this.actor.addCondition(\"unconscious\");\r\n}","xL4S0H1RP8hhXW7c":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.xneBqGOs1QS7kfUr\")\r\nlet data = item.toObject();\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","xLKAuD6yzwjAL6tJ":"return !args.weapon || args.weapon?.system.properties?.qualities.shield || !this.item.system.usesLocation(args.weapon)","xMhhVol8Is3DJ3gb":"if (this.effect.sourceTest.succeeded)\r\n{\r\n let blinded = 1 + this.effect.sourceTest.result.overcast.usage.other.count\r\n this.actor.addCondition(\"blinded\", blinded)\r\n}","xnHobI9HojObLHMp":"args.applyTB = false;\r\nargs.applyAP = false;","XO9m2AvFRAAeEuty":"if (args.test.options.fieldDressing && args.test.result.reversed)\r\n{\r\n\targs.test.data.result.SL = \"+\" + Math.min(1, Number(args.test.data.result.SL))\r\n\targs.test.result.other.push(`<b>${this.effect.name}</b>: SL limited to 1`)\r\n}","xobGBJbgFjQCrwvq":"let roll;\r\nif (this.actor.has(game.i18n.localize(\"NAME.Daemonic\")) || this.actor.has(game.i18n.localize(\"NAME.Undead\")) || [\"Goblin\", \"Orc\", \"Undead\"].includes(this.actor.system.details.species.value))\r\n{\r\n roll = await new Roll(`1d10 + ${this.effect.sourceTest.result.overcast.usage.other.current}`).roll()\r\n}\r\nelse \r\n{\r\n roll = await new Roll(`1d10`).roll()\r\n}\r\n\r\nroll.toMessage(this.script.getChatData())\r\nawait this.actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg : true})\r\n\r\nif (this.actor.has(\"Undead\") || args.actor.has(\"Daemonic\"))\r\n{\r\n this.actor.addCondition(\"ablaze\")\r\n}","xot4JWCRzLkobHtL":"args.actor.removeCondition(\"broken\", 1);","xPDMpOvC1ZBVxrNg":"args.fields.modifier += 10;","xpgXWoK2zDnG1uiF":"let stunned = args.actor.hasCondition(\"stunned\")\r\nif (stunned)\r\n setProperty(stunned, \"flags.wfrp4e.scriptData\", getProperty(stunned, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\r\n\r\nlet poisoned= args.actor.hasCondition(\"poisoned\")\r\nif (poisoned)\r\n setProperty(poisoned, \"flags.wfrp4e.scriptData\", getProperty(poisoned, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\r\n\r\nlet deafened = args.actor.hasCondition(\"deafened\")\r\nif (deafened)\r\n setProperty(deafened, \"flags.wfrp4e.scriptData\", getProperty(deafened, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\r\n\r\nlet entangled = args.actor.hasCondition(\"entangled\")\r\nif (entangled)\r\n setProperty(entangled, \"flags.wfrp4e.scriptData\", getProperty(entangled, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\r\n\r\nlet fatigued = args.actor.hasCondition(\"fatigued\")\r\nif (fatigued)\r\n setProperty(fatigued, \"flags.wfrp4e.scriptData\", getProperty(fatigued, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\r\n\r\nlet blinded = args.actor.hasCondition(\"blinded\")\r\nif (blinded)\r\n setProperty(blinded, \"flags.wfrp4e.scriptData\", getProperty(blinded, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\r\n\r\nlet broken = args.actor.hasCondition(\"broken\")\r\nif (broken)\r\n setProperty(broken, \"flags.wfrp4e.scriptData\", getProperty(broken, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))\r\n\r\nlet prone= args.actor.hasCondition(\"prone\")\r\nif (prone)\r\n setProperty(prone, \"flags.wfrp4e.scriptData\", getProperty(prone, \"flags.wfrp4e.scriptData\").filter(s => s.trigger != \"dialog\"))","XPpHYTTT0hqYuSfa":"fromUuid(\"Compendium.wfrp4e-core.items.IAWyzDfC286a9MPz\").then(item => {\n item = item.toObject()\n this.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})\n})","xPwa3NftkpMBc2AO":"return ![\"ws\", \"s\", \"ag\"].includes(args.characteristic)","XPxAKqPpPYE4E6B5":"args.fields.modifier -= 10 * this.effect.conditionValue","xq3RANOtmPhy77ne":"args.update({texture : {tint : \"#FFBF00\"}});","xQ3xR2Wf0wHFa76H":"return [\"ws\", \"bs\", \"fel\", \"dex\"].includes(args.characteristic) || args.weapon","xQnoRTHotZKrwPrx":"return args.type == \"cast\" && args.item?.system.lore?.value == \"shadow\"","xqWxV9w5ezBQdJkZ":"return args.options.corruption;","xRd6oA1QWLVpfoBm":"if (!this.actor.has(\"Night Vision\"))\r\n{\r\n let item = await fromUuid(\"Compendium.wfrp4e-core.items.FmHDbCOy3pH8yKhm\");\r\n let data = item.toObject();\r\n this.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})\r\n}","XRrGBbplNLZpXnCH":"let item;\r\nlet items = []\r\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.rOV2s6PQBBrhpMOv\")\r\n{\r\n let data = item.toObject();\r\n items.push(data)\r\n}\r\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.VUJUZVN3VYhOaPjj\")\r\n{\r\n let data = item.toObject();\r\n data.system.specification.value = 2\r\n items.push(data)\r\n}\r\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.GbDyBCu8ZjDp6dkj\")\r\n{\r\n let data = item.toObject();\r\n items.push(data)\r\n}\r\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.a8MC97PLzl10WocT\")\r\n{\r\n let data = item.toObject();\r\n items.push(data)\r\n}\r\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\r\n{\r\n let data = item.toObject();\r\n data.system.specification.value = 1;\r\n items.push(data)\r\n}\r\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.pTorrE0l3VybAbtn\")\r\n{\r\n let data = item.toObject();\r\n data.system.specification.value = 1;\r\n items.push(data)\r\n}\r\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.fjd1u9VAgiYzhBRp\")\r\n{\r\n let data = item.toObject();\r\n items.push(data)\r\n}\r\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.mDgEMOoJpi8DkRYb\")\r\n{\r\n let data = item.toObject();\r\n items.push(data)\r\n}\r\nitem = await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")\r\n{\r\n let data = item.toObject();\r\n data.system.specification.value = 2;\r\n items.push(data)\r\n}\r\n\r\nthis.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect : this.effect.id})\r\n","xRTmMwNfdirjsi8X":"this.actor.addCondition(\"ablaze\");\r\n\r\nthis.actor.applyBasicDamage(this.effect.sourceTest.result.damage)","xS2su09zcza9du09":"if ([\"Minor\", \"Moderate\", \"Major\"].includes(this.item.system.specification.value))\r\n{\r\n\treturn\r\n}\r\n\r\nlet choice = await ItemDialog.create(ItemDialog.objectToArray({minor : \"Minor\", moderate : \"Moderate\", major : \"Major\"}, this.item.img), 1, \"Choose Corruption Severity\");\r\n\r\nthis.item.updateSource({\"system.specification.value\" : choice[0]?.name || \"\"})","XSbQKrrbjsN15Zp9":"if (!args.messageSent)\n{\n args.messageSent = true;\n let advantage = this.item.effects.filter(i => i.name == this.effect.name).length;\n this.actor.setAdvantage(advantage)\n this.script.message(`Allies within 12 yards gain ${advantage} Advantage`)\n}","XthZ3GCC3WhsEI2g":"args.update({light : {\r\n \"dim\": 10,\r\n \"bright\": 5,\r\n \"alpha\": 0.5,\r\n \"animation\": {\r\n \"speed\": 4,\r\n \"intensity\": 4,\r\n \"type\": \"flame\",\r\n },\r\n \"color\": \"#ac9e6c\",\r\n}});","Xu5cED1MhT4ba7da":"args.fields.modifier += 10\r\n","XuFxKPYheYF4WMmQ":"return args.skill?.name != game.i18n.localize(\"NAME.Cool\");","xUpKYT7BZCSmAfUy":"if (this.item.system.quantity.value)\r\n{\r\n\tthis.item.system.reduceQuantity();\r\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\r\n\tactor.applyEffect({effectData : [this.item.effects.contents[0].convertToApplied()]})\r\n}\r\nelse\r\n{\r\n\tthis.script.scriptNotification(\"None left!\", \"error\")\r\n}","xvGxwv7X0Vq3vNqb":"args.fields.modifier -= 10;","xvH4PKJasHcehOZz":"return args.skill?.name == `${game.i18n.localize(\"NAME.Lore\")} (${this.item.parenthesesText})`","xVYVegD692CCv8Yl":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"hard\"}, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\n\r\nlet newFortune = Math.max(0, this.actor.status.fortune.value - 1)\r\nthis.actor.update({ \"system.status.fortune.value\": newFortune });\r\n\r\nif (test.failed)\r\n{ \r\n let char = this.effect.sourceActor.characteristics;\r\n let duration = Math.floor((char.wp.initial + char.wp.advances)/10) ;\r\n this.script.scriptMessage(\"<strong>Fatethief</strong> has been applied for \" + duration + \" days\"); \r\n}","XWbpSJrduXAhXAAV":"await this.actor.applyDamage(this.effect.sourceTest.result.damage, {sourceItem: this.effect.sourceItem, sourceTest: this.effect.sourceTest, createMessage: this.script.getChatData()})\nawait this.actor.addCondition(\"ablaze\");","xWPgIZOQLba5nZ23":"let nbFatigue = 1 + Number(this.effect.sourceTest.result.SL);\r\nthis.actor.addCondition(\"fatigued\", nbFatigue); \r\n\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields : {difficulty : \"hard\"}, appendTitle : ` - ${this.effect.name}`})\r\nawait test.roll();\r\n\r\nif (test.succeeded)\r\n{\r\n this.script.scriptNotification(this.actor.name + \"resisted !\")\r\n}\r\nelse if (test.failed)\r\n{\r\n this.actor.addCondition(\"unconscious\", 1);\r\n}","XXnzUdsIYQ9Wjyu0":"return args.item?.system.attackType != \"ranged\" || args.flags.howlingWarpGale || this.actor.sameSideAs(this.effect.sourceActor)","XYaYeiVkc5GKYTjC":"return args.spell?.system.lore.value != \"fire\"","xYTkj8jhSVOSoLbC":"this.actor.flags.useless[this.item.system.location.key[0] + \"Arm\"] = true;","XzJotwVUIuQu6b0G":"return !args.context.whirlwind || !args.weapon || !this.actor.has(game.i18n.localize(\"NAME.DualWielder\"), \"talent\") || this.actor.noOffhand","Y27MmN5KFw45d5vQ":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {difficulty: \"challenging\"})\nawait test.roll();\nif (!test.succeeded)\n{ \n let rollResult = await (await fromUuid(\"RollTable.GL7rKOEThauPUK0E\")).roll({allowInteractive : false});\n let diseaseId = rollResult.results[0].documentId;\n let disease = await fromUuid(\"Item.\"+diseaseId);\n obj = disease.toObject();\n this.actor.createEmbeddedDocuments(\"Item\", [obj]);\n}","y3agVFVBR8tVqWyx":"let test = await this.actor.setupCharacteristic(\"wp\", {skipTargets: true, appendTitle : ` - ${this.effect.name}`});\r\nawait test.roll();","y3F1K1sYBymPZCjz":"let characteristics = {\n \"ws\" : 10,\n \"bs\" : 0,\n \"s\" : 5,\n \"t\" : 0,\n \"i\" : 5,\n \"ag\" : 10,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 0,\n \"fel\" : 0\n}\nlet skills = [\"Athletik\", \"Tierpflege\", \"Sprache (Schlachtenzunge)\", \"Nahkampf (Standard)\", \"Nahkampf (Kavallerie)\", \"Reiten\"]\nlet skillAdvancements = [10,10, 10, 10, 10, 20]\n\nlet talents = [\"Raureiter\", \"Mächtiger Schlag\"]\nlet trappings = [\"Waffe\", \"Schild\", \"Lanze\", \"Kürass\", \"Plattenarme\", \"Helm\", \"Plattenbeine\"]\nlet specialItems = [\n {name: \"Chaos Steed\", type: \"trapping\", trappingType: \"misc\" },\n]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let item of specialItems) {\n let newItem\n if (item.type == \"weapon\") {\n newItem = new ItemWFRP4e({ name: item.name, type: item.type, system: { equipped: true, damage: {value: item.damage}} })\n } else if (item.type == \"trapping\") {\n newItem = new ItemWFRP4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type, system: { worn: true, trappingType: { value: item.trappingType} } } )\n } else {\n newItem = new ItemWFRP4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type })\n }\n items.push(newItem.toObject())\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else\n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else\n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings)\n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n trappingItem.system.equipped.value = true;\n\n items.push(trappingItem);\n }\n else\n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nconsole.log(\">>>>>>><\", items)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n","Y43z8YCohJMA8Ia7":"if (!args.test.preData.options?.giantbane) return\nif (!this.item.equipped.value || !args.test.item) return;\nargs.test.preData.canReverse = true","Y6ppJBerpM3TtSic":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.g4Q6AtzZuo5iIvD4\");\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item.toObject()], {fromEffect : this.effect.id});","y7hk7prQ0lLTyv1Y":"return args.item?.system?.isRanged && (args.item.system.weaponGroup.value !== \"blackpowder\" || args.item.system.weaponGroup.value !== \"engineering\")","Y7McxsHFeGhwQx0J":"this.actor.createEmbeddedDocuments(\"Item\", [expandObject({\r\n name : \"Ghostly Flame\",\r\n type : \"weapon\",\r\n img : this.effect.img,\r\n system : {\r\n \"weaponGroup.value\" : \"throwing\",\r\n \"damage.value\" : \"SB + WPB\",\r\n \"qualities.value\" : [{name : \"magical\"}],\r\n \"equipped\" : true\r\n }\r\n})], {fromEffect: this.effect.id})","Y8J66v8VTKUASGuK":"if (!this.actor.effects.find(e => e.isCondition))\r\n{\r\n\treturn this.script.scriptNotification(\"No Conditions on this Actor\")\r\n}\r\n\r\nlet choice = await ItemDialog.create(this.actor.effects.filter(i => i.isCondition), 1, \"Choose a Condition\")\r\n\r\nif (choice[0])\r\n{\r\n\tawait this.actor.removeCondition(choice[0].conditionId)\r\n}\r\n\r\nif (this.actor.effects.find(e => e.isCondition))\r\n{\r\n return false; // Delete the effect if there are still conditions, otherwise, effect remains and provides the bonus\r\n}","y9fwuiqn44t13WAq":"return this.item.equipped.value \n && args?.weapon\n && ([\"goblin\"].includes(args.target.Species.toLowerCase()))","YaKnYEbmmZZtByJc":"if (args.opposedTest.attackerTest.options.ballockKnife)\r\n{\r\n args.weaponProperties.impale = true;\r\n args.extraMessages.push(`<strong>${this.item.name}</strong>: Impale Added`)\r\n}","yAL0YwZWVm8o1nxa":"if (this.actor.hasCondition(\"dead\") && !this.actor.gardenOfCorpses)\r\n{\r\n this.script.scriptMessage(\"[[3d10]] @UUID[Compendium.wfrp4e-core.actors.T79RqnDOAQLn3I1s]{zombies} spring forth from the remains.\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n this.actor.gardenOfCorpses = true;\r\n // local storage is sufficient to prevent multiple messages\r\n}","yamap8V6Gx2Z9Smu":"const uuids = [\r\n \"Compendium.wfrp4e-core.items.Item.nWLsoWQBCjPRKxYx\", // Robust\r\n \"Compendium.wfrp4e-core.items.Item.jviOQmy0luQOySC2\", // Tenacious\r\n];\r\n\r\nconst items = await Promise.all(uuids.map(uuid => fromUuid(uuid)));\r\nawait this.actor.createEmbeddedDocuments(\"Item\", items, {fromEffect: this.effect.id});","yatUu0cd7iKs50rq":"return args.skill?.name != game.i18n.localize(\"NAME.Track\");","ybxDG2ezvRx02LYx":"return !args.options.corruption","yCgH3N9AurIiAv0i":"if (!this.item.name.includes(\"(\") || this.item.system.tests.value.includes(\"(Sinn)\"))\r\n{\r\n let tests = this.item.system.tests.value\r\n let name = this.item.name\r\n\r\n // If name already specifies, make sure tests value reflects that\r\n if (name.includes(\"(\"))\r\n {\r\n let sense = name.split(\"(\")[1].split(\")\")[0]\r\n tests = `${tests.split(\"(\")[0].trim()} (${sense})`;\r\n }\r\n else // If no sense specified, provide dialog choice\r\n {\r\n let choice = await ItemDialog.create(ItemDialog.objectToArray({\r\n taste : \"Geschmack\",\r\n sight : \"Sicht\",\r\n smell : \"Geruch\",\r\n hearing : \"Gehör\",\r\n touch : \"Berührung\"\r\n }, this.item.img), 1, \"Wähle Sinn\");\r\n if (choice[0])\r\n {\r\n name = `${name.split(\"(\")[0].trim()} (${choice[0].name})`\r\n tests = `${tests.split(\"(\")[0].trim()} (${choice[0].name})`\r\n }\r\n }\r\n\r\n this.item.updateSource({name, \"system.tests.value\" : tests})\r\n}","YDANERWYHyJ2ACeo":"args.fields.modifier -= 25","YdiQFkm8j48Xs7gI":"if (args.totalWoundLoss > 0 && args.opposedTest.attackerTest.result.critical && args.loc == \"head\") {\n let brainRot = await fromUuid(\"Compendium.wfrp4e-lustria.items.Item.IsNQH867Y58pZgq6\");\n args.test.targets[0].createEmbeddedDocuments(\"Item\", [brainRot], {fromEffect : this.effect.id});\n this.script.scriptMessage(`${args.test.targets[0].name} has been infected by Brain Rot`);\n}","YDqpKJVy8ijEKdLX":"return !(this.actor.attacker && (args.skill?.name.includes(\"Melee (Basic)\") || (args.type == \"weapon\" && args.item?.system.weaponGroup.value == \"basic\")))","yDvxF9llUYwJg0sE":"if (getProperty(args.data, \"system.loaded.value\") == true)\r\n{\r\n let repeaterValue = Math.ceil(CONFIG.Dice.randomUniform() * 10);\r\n let qualities = foundry.utils.deepClone(this.item.system.qualities.value);\r\n let repeater = qualities.find(i => i.name == \"repeater\")\r\n if (repeater)\r\n {\r\n repeater.value = repeaterValue\r\n }\r\n else \r\n {\r\n qualities.push({name : \"repeater\", value : repeaterValue})\r\n }\r\n setProperty(args.data, \"system.loaded.amt\", repeaterValue)\r\n this.item.update({\"system.qualities.value\" : qualities});\r\n this.script.scriptNotification(\"Repeater \" + repeaterValue);\r\n}\r\nelse if (getProperty(args.data, \"system.loaded.value\") == false)\r\n{\r\n let qualities = foundry.utils.deepClone(this.item.system.qualities.value).filter(i => i.name != \"repeater\");\r\n this.item.update({\"system.qualities.value\" : qualities});\r\n}","YEBw2CzHYxsTpTy5":"return args.skill?.name == game.i18n.localize(\"NAME.Haggle\");","Yf2MmOzazzMdmoPU":"let armour = await fromUuid(\"Compendium.wfrp4e-core.items.VUJUZVN3VYhOaPjj\")\r\nlet armourData = armour.toObject()\r\narmourData.system.specification.value = 1\r\n \r\nlet fury = await fromUuid(\"Compendium.wfrp4e-core.items.fjd1u9VAgiYzhBRp\");\r\nlet furyData = fury.toObject();\r\n\r\nlet horns = await fromUuid(\"Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW\")\r\nlet hornsData = horns.toObject()\r\nhornsData.system.specification.value = 6\r\n\r\nthis.actor.createEmbeddedDocuments(\"Item\", [armourData, furyData, hornsData], {fromEffect : this.effect.id})","yFMvxecXAZ6T2O0S":"if (args.totalWoundLoss >= 1)\r\n{\r\n let roll = await new Roll(\"1d10\").roll();\r\n await roll.toMessage(this.script.getChatData());\r\n if (roll.total == 9)\r\n {\r\n this.script.scriptMessage(`Two @UUID[Compendium.wfrp4e-eis.actors.cLOGeMqUty61nYB9]{Blue Horror of Tzeentch} claw their way out of ${this.actor.name}'s screaming flesh, killing them in the process.`, {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n }\r\n}","YfRPSgJjvHvl50HW":"return args.skill?.name != \"Runesmithing\"","YFSgWRXel0bWE3EE":"return [\"ag\", \"ws\", \"bs\"].includes(args.characteristic) || args.skill?.name == game.i18n.localize(\"NAME.Climb\");","yHAPfyaRfC4ijV6x":"let locs = Object.values(this.actor.system.status.armour).map(i => i.label).filter(i => i);\n\nlet location = locs[Math.floor(CONFIG.Dice.randomUniform() * (locs.length))];\n\nlet duration = await new Roll(\"1d10\").roll();\nduration.toMessage(this.script.getChatData());\nthis.effect.updateSource({name: this.effect.setSpecifier(location), duration: {value: duration.total, units: \"hours\"}});","YHEIkBKWXKNPqglh":"if (args.test.result.castOutcome == \"success\")\r\n{\r\n game.wfrp4e.utility.postCorruptionTest(\"moderate\", this.script.getChatData())\r\n}\r\n","YhhiWEQbox3WZA3Q":"return args.skill?.name == game.i18n.localize(\"NAME.Heal\") && game.combat?.active","yIGItnshXI4W46cp":"return args.skill?.name != game.i18n.localize(\"NAME.Charm\");","YjAIsFlxKTJvYs60":"this.item.system.reduceQuantity();","YjJcRdytVRm88qLn":"args.options.additionalDamage = 1","YjKiWcx7d2nwPy4L":"if (args.applyAP) \n{\n let nonmagical = args.modifiers.ap.value - args.modifiers.ap.magical\n args.modifiers.ap.ignored += nonmagical\n args.modifiers.ap.details.push(\"<strong>\" + this.effect.name + \"</strong>: Ignore Non-Magical AP (\" + nonmagical + \")\");\n}","yJuEWH4wVYuPZMvL":"const excessSL = this.effect.sourceTest.result.baseSL - this.effect.sourceItem.system.sl;\nargs.fields.slBonus += 1 + excessSL;","YJX7WnxzXXIVdH6P":"let lore = await ValueDialog.create({text : \"Choisissez un Savoir\", title: \"Savoir\"}, \"\", {\"fire\" : \"Fire\", \"death\" : \"Death\", \"metal\" : \"Metal\", \"shadow\" : \"Discret\"});\n\nlet filters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"system.lore.value\",\n value : \"petty\"\n }\n]\n\nlet petty = await ItemDialog.createFromFilters(filters, 6, {title : this.effect.name, text : \"Choisissez 6 Sorts Mineurs\"})\n\n\nfilters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"system.lore.value\",\n value : [\"\"]\n }\n]\n\nlet arcane = await ItemDialog.createFromFilters(filters, 12, {title : this.effect.name, text : \"Choisissez 12 Sorts d'Arcane\"})\n\nlet items = petty.map(i => i.toObject()).concat(arcane.map(i => {\n let spell = i.toObject();\n spell.img = `modules/wfrp4e-core/icons/spells/${lore}.png`\n spell.system.lore.value = lore;\n return spell;\n}));\n\n\nthis.actor.createEmbeddedDocuments(\"Item\", items);","YMaxpXnml01bLGpO":"return args.item?.name.includes(game.i18n.localize(\"NAME.Stealth\"))","yMMzZ7daCqRlGT3N":"let item = args.opposedTest.attackerTest.item;\r\nif (!item.isMagical && (item.type == \"weapon\" || item.type == \"trait\"))\r\n{\r\n args.modifiers.other.push({label : this.effect.name, details : \"Remove Damage Rating\", value : -1 * (args.totalWoundLoss - args.opposedTest.result.differenceSL)})\r\n}\r\n","YN8719gme9AxYtyY":"let characteristics = {\n \"ws\" : 10,\n \"bs\" : 0,\n \"s\" : 5,\n \"t\" : 15,\n \"i\" : 20,\n \"ag\" : 15,\n \"dex\" : 20,\n \"int\" : 35,\n \"wp\" : 30,\n \"fel\" : 10\n}\nlet skills = [\"Kanalisieren\", \"Besonnenheit\", \"Ausweichen\", \"Unterhalten (Erzählen)\", \"Intuition\", \"Sprache (Magick)\", \"Anführen\", \"Wissen (Magick)\", \"Wissen (Theologie)\", \"Wahrnehmung\"]\nlet skillAdvancements = [20, 25, 20, 25, 30, 25, 15, 20, 10, 30]\n\nlet talents = [\"Äthergespür\", \"Instinktive Aussprache\", \"Instinktive Aussprache\", \"Glückspilz\", \"Magiegespür\", \"Bedrohlich\", \"Arkane Magie (Domäne)\", \"Niedere Magie\", \"Zweites Gesicht\", \"Sechster Sinn\"]\nlet trappings = [\"Waffe\", \"Robe\", \"Kampfstab (2H)\"]\nlet specialItems = [ \n {name: \"Magic Item\", type: \"trapping\", trappingType: \"misc\" }, \n] \nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let item of specialItems) {\n let newItem\n if (item.type == \"weapon\") {\n newItem = new ItemWFRP4e({ name: item.name, type: item.type, system: { equipped: true, damage: {value: item.damage}} })\n } else if (item.type == \"trapping\") {\n newItem = new ItemWFRP4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type, system: { worn: true, trappingType: { value: item.trappingType} } } )\n } else {\n newItem = new ItemWfrp4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type })\n }\n items.push(newItem.toObject())\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n trappingItem.system.equipped.value = true;\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nlet ride = await foundry.applications.api.DialogV2.confirm({window : {title : \"Fähigkeit\"}, content : \"Chaos Steed und +20 auf Reiten (Pferd) hinzufügen?\"})\n\nif (ride)\n{\n let skill = await game.wfrp4e.utility.findSkill(\"Reiten (Pferd)\")\n skill = skill.toObject();\n skill.system.advances.value = 20;\n items = items.concat({name : \"Chaos Steed\", type: \"trapping\", \"system.trappingType.value\" : \"misc\"}, skill)\n}\n\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n","ynNCBAYwJFkTiXV1":"this.actor.system.status.addArmour(4, {source : this.effect})","ynoHNXXCGRS6fTqF":"let msg = \"\"\r\n\r\nlet i_gain = (await new Roll(\"1d10\").roll()).total\r\n\r\nif (args.actor.characteristics.i.value <= 0)\r\n{\r\n i_gain += (await new Roll(\"2d10\").roll()).total\r\n}\r\n\r\nmsg = `<b>${this.actor.prototypeToken.name}</b> gains ${i_gain} Initiative`\r\n\r\nlet newValue = i_gain + args.actor.characteristics.i.modifier\r\n\r\nthis.actor.update({\"system.characteristics.i.modifier\" : newValue})\r\n\r\n\r\nlet hitloc = await game.wfrp4e.tables.rollTable(\"hitloc\")\r\n\r\nlet value = hitloc.result\r\nlet desc = hitloc.description\r\n\r\nthis.effect.updateSource({\"flags.wfrp4e.location\" : value})\r\n\r\nmsg += ` as eyes push out of their ${desc}`\r\n\r\nthis.script.scriptMessage(msg)","ynV7tz0OdCwlsQp6":"let msg = \"\"\r\nmsg += `<p>${await this.actor.applyBasicDamage(8, {loc : \"roll\", suppressMsg: true, hideDSN: true})}</p>`\r\nmsg += `<p>${await this.actor.applyBasicDamage(8, {loc : \"roll\", suppressMsg: true, hideDSN: true})}</p>`\r\nmsg += `<p>${await this.actor.applyBasicDamage(8, {loc : \"roll\", suppressMsg: true, hideDSN: true})}</p>`\r\n\r\nthis.script.scriptMessage(msg);","YOKoZFlBEpFavfOS":"return args.type == \"channelling\"","yPxYRObUiqAIhlNB":"this.actor.system.status.encumbrance.max += 1","YQ2LnLxp0xgy3meI":"if (args.test.preData.options?.corruption && args.test.failed) {\r\n args.test?.result?.other.push(\"Gain additional +1 Corruption from \" + this.effect.name)\r\n}","yQziCK8G8I1RYkTj":"let add;\r\nif (args.opposedTest?.attackerTest?.weapon?.isRanged && args.opposedTest?.result.hitloc?.value === \"head\") {\r\n add = await Dialog.confirm({title : this.effect.name, content : \"Add 1 AP? Bascinet provides 4 AP instead of 3 against missile attacks from the front\"})\r\n}\r\n\r\nif (add) {\r\n\r\n args.modifiers.ap.metal++;\r\n args.modifiers.ap.used++;\r\n args.modifiers.ap.value++;\r\n args.modifiers.ap.details.push(\"+1 AP against missile attacks to the front\");\r\n}","yr1FmaTY18JXWa8s":"return [\"witchcraft\", \"necromancy\", \"daemonology\", \"slaanesh\", \"nurgle\", \"tzeentch\", \"undivided\"].includes(args.spell?.system.lore.value);","yRRzSKlcN3L7rEEe":"return args.skill?.name.includes(game.i18n.localize(\"NAME.Entertain\")) || args.skill?.name.includes(game.i18n.localize(\"NAME.Perform\")) || args.skill?.name.includes(game.i18n.localize(\"NAME.Play\"));","YRUTliBzAQvncGNX":"this.actor.addCondition(\"fatigued\");\r\nthis.script.scriptNotification(\"Added Fatigued\")","YrXhk2YJaWSChMhp":"// Brawling management\nlet base = this.actor.characteristics.ws.value;\nlet melee = this.actor.has(\"Nahkampf (Waffenlos)\", \"skill\");\nif (!melee) {\n melee = await fromUuid(\"Compendium.wfrp4e-core.items.Item.jLyoyqwmBVPjRjhM\");\n melee = melee.toObject();\n melee.system.modifier.value = 55 - base;\n await this.actor.createEmbeddedDocuments(\"Item\", [melee], {fromEffect : this.effect.id});\n} else {\n //this.actor.updateEmbeddedDocuments(\"Item\", { _id: melee.id, 'system.modifier.value': 55-base});\n await this.effect.update({\"flags.wfrp4e.fistsOfGork\" : 55 - base})\n}\n\n// Weapon management\nbase = this.actor.characteristics.s.bonus;\nweapon = await fromUuid(\"Compendium.wfrp4e-core.items.Item.AtpAudHA4ybXVlWM\");\nweapon = weapon.toObject();\nweapon.name = \"Fists of Gork\";\nweapon.img = this.effect.img;\nweapon.system.rollable.skill = \"Nahkampf (Waffenlos)\";\nweapon.system.specification.value = 9 - base;\nawait this.actor.createEmbeddedDocuments(\"Item\", [weapon], {fromEffect : this.effect.id});\n\n//this.script.scriptMessage(`${this.actor.name} now has Melee (Brawling) 55 and Weapon (Fists) +9`);","YsS2RZsl2ZsqjhWV":"return !args.fields.charging","YsUdMhQ2AArcJIqy":"let choice1 = [\n {\n type: \"trait\",\n name: \"Korrumpierend (Gering)\",\n diff : {\n system : {\n specification : {\n value : \"Minor\"\n }\n }\n }\n },\n {\n type: \"trait\",\n name: \"Infiziert\",\n },\n {\n type: \"trait\",\n name: \"Territorial\",\n }\n]\n\nlet updateObj;\nlet actor;\n\nasync function addTrait(c) {\n let items = [];\n let existing;\n if (c.type == \"trait\") {\n existing = updateObj.items.find(i => i.name == c.name && i.type == c.type);\n }\n if (!existing) {\n let item = await game.wfrp4e.utility.find(c.name, c.type);\n if (item) {\n item = item.toObject();\n foundry.utils.mergeObject(item, c.diff);\n items.push(item);\n }\n else\n ui.notifications.warn(`${c} nicht gefunden`, { permanent: true });\n }\n actor.createEmbeddedDocuments(\"Item\", items);\n}\n\nasync function dialogChoice() {\n for (let c of choice1)\n {\n if (await foundry.applications.api.DialogV2.confirm({window : {title: \"Option\"}, content:`<p>Option hinzufügen?</p><ol><li>${c.name}</li></ol>`}))\n {\n addTrait(c)\n c.valid = true;\n }\n }\n}\nupdateObj = this.actor.toObject();\nactor = this.actor\nawait dialogChoice();\n","yTmRoUstxHMso91c":"if (args.item.name == \"Magic Resistance\" && args.item.type == \"trait\")\r\n{\r\n args.item.system.specification.value = Number(args.item.system.specification.value) + 1\r\n}","yvtF2t9aibxibAIM":"const test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Perception\"), {\n skipTargets: true,\n appendTitle: ` — ${this.effect.name}`,\n fields: {difficulty: \"challenging\"},\n context: {\n failure: `Erhält den Zustand @Condition[Prone].`,\n success: `Kann sich bewegen.`\n }\n});\n\nawait test.roll();\n\nif (test.failed)\n this.actor.addCondition(\"prone\");","YwLEw4BiKq4EMy57":"let i_gain = (await new Roll(\"2d10\").roll()).total\r\nlet fel_gain = 0\r\nif (args.actor.characteristics.fel.value <= 0)\r\n{\r\n fel_gain += (await new Roll(\"2d10\").roll()).total\r\n}\r\n\r\nlet msg = `<b>${this.actor.prototypeToken.name}</b> gains ${i_gain} Intelligence`\r\n\r\nif (fel_gain)\r\n msg += ` and ${fel_gain} Fellowship`\r\n\r\n\r\nlet newInt = i_gain + args.actor.characteristics.int.modifier\r\nlet newFel = fel_gain + args.actor.characteristics.fel.modifier\r\n\r\nargs.actor.update({\"system.characteristics.int.modifier\" : newInt, \"system.characteristics.fel.modifier\" : newFel})\r\n\r\nthis.script.scriptMessage(msg)","yXUPiWuQ5o0JBY4i":"return args.skill?.name == game.i18n.localize(\"Endurance\") || args.characteristic == \"int\"","YyKU2rIRmFSCqSlW":"let newEffect = this.effect.sourceItem.effects?.contents[1]\r\n\r\nif (newEffect)\r\n{\r\n this.actor.createEmbeddedDocuments(\"ActiveEffect\", [newEffect.convertToApplied()]);\r\n}","yYNBZjmBnytXpRn3":"this.actor.reset();","YySjPfSAPdMAfjsh":"let talents = [\"Berserk Charge\", \"Combat Aware\", \"Combat Reflexes\", \"Furious Assault\", \"Implacable\", \"Magic Resistance\", \"Resistance (Magic)\", \"Resolute\", \"Strike Mighty Blow\", \"Warrior Born\"];\r\nlet currentCareer = this.actor.system.currentCareer;\r\n\r\nif (!currentCareer) return;\r\n\r\nfor (let talent of talents) {\r\n if (currentCareer.system.talents.includes(talent))\r\n continue;\r\n currentCareer.system.talents.push(talent);\t\r\n}\r\n\r\n","yzN7ZNlgCiSVJqsU":"let sourceItem = this.effect.sourceItem;\r\n\r\nif (sourceItem)\r\n{\r\n\tthis.actor.applyEffect({effectUuids : [sourceItem.effects.contents[1].uuid]})\r\n\tthis.script.scriptNotification(\"Angewandt nach Effekten\");\r\n}","z14Tb2YKCjiE5ZTU":"this.actor.getActiveTokens().forEach(t => t.document.update({light : {\r\n \"dim\": 30,\r\n \"bright\": 20,\r\n \"angle\": 90,\r\n \"alpha\": 0.6,\r\n \"animation\": {\r\n \"speed\": 3,\r\n \"intensity\": 3,\r\n \"type\": \"torch\",\r\n },\r\n \"color\": \"#ffcc66\",\r\n }}));","Z1zriXibT0mAmdhb":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.BqPZn6q3VHn9HUrW\")\r\nitem = item.toObject()\r\nitem.name = this.effect.name\r\nitem.system.specification.value = this.actor.characteristics.s.bonus\r\nitem.system.description.value = \"\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [item], {fromEffect : this.effect.id})","Z30zYayPryXOjT5N":"args.item.system.damage.value = \"SB + 6\";","Z41L3MwOpJdAjVaj":"if (args.actorsystem.details.move.sail.value > 0)\r\n args.actor.system.details.move.sail.value -= 2;\r\n","Z4WrrlVGpPY4iUbG":"await this.actor.addCondition(\"ablaze\")","Z52yZDm6lP6fOP3O":"let ablaze = this.actor.hasCondition(\"ablaze\")\r\nif (ablaze)\r\n{\r\n this.script.scriptNotification(\"Immune to Ablaze\");\r\n ablaze.delete()\r\n}","z5HfNUrHy5MS3K7a":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context : {failure: \"1 Corruption Point Gained\"}})\r\nawait test.roll();\r\nif (test.failed && this.actor.type == \"character\")\r\n{\r\n this.actor.update({\"system.status.corruption.value\" : parseInt(this.actor.status.corruption.value) + 1})\r\n this.script.scriptMessage(\"Erhält einen Korruptionspunkt\", {whisper : ChatMessage.getWhisperRecipients(\"GM\")})\r\n}","Z6jNlyZMECkW4Hon":"let spells = await warhammer.utility.findAllItems(\"spell\", \"Loading Spells\", true);\r\n\r\nlet choice = await ItemDialog.create(spells, 1);\r\n\r\nif (choice[0])\r\n{\r\n this.script.scriptMessage(`Chose @UUID[${choice[0].uuid}]{${choice[0].name}}`)\r\n let spell = (await fromUuid(choice[0].uuid)).toObject(); // Might be an index so retrieve item object for sure\r\n setProperty(spell, \"flags.wfrp4e.boonOfTzeentch\", true);\r\n spell.system.wind.value = \"Channelling (Dhar)\";\r\n spell.system.memorized.value = true;\r\n this.actor.createEmbeddedDocuments(\"Item\", [spell], {fromEffect: this.effect.id})\r\n}","Z6OmmC0irJzxSnMH":"let chatData = { whisper: ChatMessage.getWhisperRecipients(\"GM\") }\r\nlet message = \"\"\r\n\r\nlet wounds = duplicate(this.actor.status.wounds)\r\nlet regenRoll = await new Roll(\"1d10\").roll();\r\nlet regen = regenRoll.total;\r\n\r\nif (wounds.value >= wounds.max)\r\n return\r\n\r\nif (wounds.value > 0) \r\n{\r\n wounds.value += regen\r\n if (wounds.value > wounds.max)\r\n {\r\n wounds.value = wounds.max\r\n }\r\n message += `<b>${this.actor.name}</b> regains ${regen} Wounds.`\r\n\r\n if (regen == 10)\r\n {\r\n message += `<br>Additionally, they regenerate a Critical Wound.`\r\n }\r\n}\r\nelse if (regen >= 8) \r\n{\r\n message += `<b>${this.actor.name}</b> rolled a ${regen} and regains 1 Wound.`\r\n wounds.value += 1\r\n if (regen == 10)\r\n {\r\n message += `<br>Additionally, they regenerate a Critical Wound.`\r\n }\r\n}\r\nelse \r\n{\r\n message += `<b>${this.actor.name}</b> Regenerate roll of ${regen} - No effect.`\r\n}\r\n\r\nawait this.actor.update({ \"system.status.wounds\": wounds })\r\nthis.script.scriptMessage(message, { whisper: ChatMessage.getWhisperRecipients(\"GM\") })\r\n\r\nif (this.actor.Species?.toLowerCase() != \"ogre\")\r\n{\r\n this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {skipTargets: true, appendTitle : \" - \" + this.effect.name, fields : {difficulty : \"average\"}}).then(test => {\r\n test.roll()\r\n })\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n","z8mwLihZQu0JtUHY":"\nlet characteristics = {\n \"ws\" : 20,\n \"bs\" : 20,\n \"s\" : 0,\n \"t\" : 20,\n \"i\" : 30,\n \"ag\" : 0,\n \"dex\" : 10,\n \"int\" : 65,\n \"wp\" : 70,\n \"fel\" : 20\n}\nlet skills = [\"Kanalisieren\", \"Besonnenheit\", \"Einschüchtern\", \"Sprache (Magick)\", \"Sprache (Nehekharan)\", \"Anführen\", \"Wissen (Magick)\", \"Wahrnehmung\"]\nlet skillAdvancements = [20, 30, 25, 30, 20, 20, 30, 20]\nlet talents = [\"Äthergespür\", \"Arkane Magie (Domäne)\", \"Robustheit\", \"Instinktive Aussprache\", \"Magiegespür\", \"Bedrohlich\", \"Bedrohlich\", \"Niedere Magie\", \"Lesen & Schreiben\", \"Zweites Gesicht\", \"Kampfzauberer\"]\nlet trappings = [\"Waffe\"]\nlet specialItems = [\n {name: \"Mouldering Robes\", type: \"trapping\", trappingType: \"clothingAccessories\" },\n {name: \"Pouches containing ritual components\", type: \"trapping\", trappingType: \"clothingAccessories\" },\n {name: \"Staff\", type: \"weapon\", damage: \"SB+2\"},\n {name: \"Dunkle Magie (Nekromantie)\", type: \"talent\"},\n]\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let item of specialItems) {\n let newItem\n if (item.type == \"weapon\") {\n newItem = new ItemWFRP4e({ name: item.name, type: item.type, system: { equipped: true, damage: {value: item.damage}} })\n } else if (item.type == \"trapping\") {\n newItem = new ItemWFRP4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type, system: { worn: true, trappingType: { value: item.trappingType} } } )\n } else {\n newItem = new ItemWFRP4e({ img: \"systems/wfrp4e/icons/blank.png\", name: item.name, type: item.type })\n }\n items.push(newItem.toObject())\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n trappingItem.system.equipped.value = true;\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nconsole.log(\">>>>>>><\", items)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n","z8W5PAwBR0PXY6ty":" await args.actor.addCondition(\"ablaze\");\n await args.actor.addCondition(\"blinded\");\n await args.actor.addCondition(\"poisoned\", 2);","z926Cl2vxUfyLY0V":"if (![\"rArm\", \"lArm\"].includes(this.effect.getFlag(\"wfrp4e\", \"location\")))\r\n\treturn true\r\n\r\nreturn [\"fel\", \"wp\", \"int\", \"t\"].includes(args.characteristic)","z9NEbIUBsKMaTuCz":"if (args.opposedTest.result.hitloc && args.opposedTest.result.hitloc.value == \"head\") \r\n{\r\n args.actor.addCondition(\"entangled\")\r\n}","zA6TDttpwMSMl7D8":"// An imbiber must take a Consume Alcohol Test.\r\nthis.actor.setupSkill(game.i18n.localize(\"NAME.ConsumeAlcohol\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => {\r\n await test.roll()\r\n // If they succeed, \r\n // as a result of whatever potential futures they glimpse, \r\n // they can spend a Fortune Point within the next hour to reverse the dice of any failed Test.\r\n if (test.succeeded) {\r\n this.script.scriptMessage(`Als ein Resultat welcher möglichen Zukunft auch immer sie erspähen, kann <strong>${this.actor.prototypeToken.name}</strong> in der nächsten Stunde einen Glückspunkt ausgeben um die Würfel eines fehlgeschlagenen Tests umzukehren.`, \r\n {\r\n whisper: ChatMessage.getWhisperRecipients(\"GM\"), \r\n blind: true \r\n }) \r\n }\r\n})","zadppy7FEbXvgUON":" let characteristics = {\n \"ws\" : 5,\n \"bs\" : 0,\n \"s\" : 0,\n \"t\" : 0,\n \"i\" : 0,\n \"ag\" : 10,\n \"dex\" : 10,\n \"int\" : 0,\n \"wp\" : 0,\n \"fel\" : 5\n }\n let skills = [\"Perception\", \"Sleight of Hand\", \"Stealth (Urban)\"]\n let skillAdvancements = [10, 10, 10]\n let talents = [\"Criminal\", \"Etiquette (Criminals)\"]\n let trappings = [\"Rope, 10 yards\", \"Lockpick\", \"Mask\"]\n let items = []\n \n let updateObj = this.actor.toObject();\n \n for (let ch in characteristics)\n {\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n }\n \n for (let index = 0; index < skills.length; index++)\n {\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n }\n \n for (let talent of talents)\n {\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n }\n \n for (let trapping of trappings) \n {\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n \n equip(trappingItem)\n \n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n }\n \n \n await this.actor.update(updateObj)\n this.actor.createEmbeddedDocuments(\"Item\", items);\n \n function equip(item)\n {\n if (item.type == \"armour\")\n item.system.worn.value = true\n else if (item.type == \"weapon\")\n item.system.equipped = true\n else if (item.type == \"trapping\" && item.system.trappingType.value == \"clothingAccessories\")\n item.system.worn = true\n }","zasFOZohkrdFIBwr":"let modifier = 0\n if (this.effect.name.includes(\"Moderate\"))\n modifier = -20\n else\n modifier = -10\n args.fields.modifier += modifier","zBHTIBU8OlYj1YIO":"args.fields.modifier += this.effect.sourceActor?.system.characteristics.wp.value;","ZbuW8y7t9Y8oUFWq":"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\"))","ZCBcwbVFHFTFRntb":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Carpentry)';\r\nconst difficulty = 'easy';\r\nconst target = 10;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","ZCExF4uNFmHkGEbb":"this.actor.deleteEmbeddedDocuments(\"Item\", [this.effect.getFlag(\"wfrp4e\", \"disease\")].filter(i => i));","ZCkYe5XMVY1RWMXG":"args.options.wallcrawler = true;","ZCrfdLPOxiNDCDSg":"this.actor.effects.get(this.effect.id).delete(); // can't use this.effect because it thinks it's parent is the item, but it actually is the actor","ZCuOjLAeENKN1Q4L":"let halve;\r\nif (args.opposedTest.attackerTest.item?.type != \"spell\")\r\n{\r\n halve = await Dialog.confirm({title : this.effect.name, content : \"Halve Damage? (Halves Damage from all fire)\"})\r\n}\r\nelse\r\n{\r\n halve = args.opposedTest.attackerTest.item?.system.lore?.value == \"fire\";\r\n}\r\n\r\nif (halve)\r\n{\r\n args.totalWoundLoss /= 2;\r\n args.modifiers.other.push({label : this.effect.name, details : \"Halved\", value : \"× 0.5\"})\r\n}","zdGAvfL7zJ7wpYxG":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Carpenter)';\r\nconst difficulty = 'easy';\r\nconst target = 40;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","ZdHvGvSJBsIuPphF":"return !args.fields.dualWielding && !args.options.dualWieldOffhand","Ze9E2zR1GFGWGMVH":"return [\"Pick Lock\", \"Sleight of Hand\", \"Channelling (Ulgu)\"].includes(args.skill?.name)","ZEdDcBka21rnMuz5":"let initiativeSetting = game.settings.get(\"wfrp4e\", \"initiativeRule\")\r\n\r\nswitch (initiativeSetting) {\r\n case \"default\":\r\n args.initiative += \"+10\"\r\n break;\r\n\r\n case \"sl\":\r\n args.initiative += \"+1\"\r\n break;\r\n\r\n case \"d10Init\":\r\n args.initiative += \"+10\"\r\n break;\r\n\r\n case \"d10InitAgi\":\r\n args.initiative += \"+1\"\r\n break;\r\n}","ZEXhYJqqxF6QAixX":"return args.options.terror || args.extendedTest?.getFlag(\"wfrp4e\", \"fear\");","zF1IKmobCB8ea58M":"return this.sourceActor.uuid === this.actor.uuid || ![\"ws\", \"ag\"].includes(args.characteristic);","ZfgPAtNKA5KrETer":"return args.type == \"cast\";","ZfOhDMHPyEkThjEk":"foundry.utils.setProperty(args, \"context.context.failure\", [`<strong>${this.effect.name}</strong>: Can Reroll!`])","zFYCaGR0wbFWjl4T":"return args.skill?.name != game.i18n.localize(\"NAME.OutdoorSurvival\");","ZgF1sYdbAKaOuHmK":"return args.skill?.name !== game.i18n.localize(\"NAME.Charm\");","ZGlJnrIemqul24j7":"let infected = await fromUuid(\"Compendium.wfrp4e-core.items.V0c3qBU1CMm8bmsW\")\r\nlet bite = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\r\nlet biteData = bite.toObject();\r\nlet infectedData = infected.toObject();\r\n\r\nbiteData.system.specification.value = 4 - this.actor.characteristics.s.bonus\r\n\r\nthis.actor.createEmbeddedDocuments(\"Item\", [biteData, infectedData], {fromEffect : this.effect.id})","zGwtyjTUBeSQ110p":"if (args.opposedTest.attackerTest.preData.charging) \n{\n let mostProtectedLoc;\n let mostProtectedValue = 0;\n for (let loc in this.actor.status.armour) \n {\n if (this.actor.status.armour[loc].value != undefined && this.actor.status.armour[loc].value > mostProtectedValue) \n {\n mostProtectedLoc = loc;\n mostProtectedValue = this.actor.status.armour[loc].value;\n }\n }\n if (mostProtectedValue)\n {\n args.modifiers.other.push({label: this.effect.name, value : mostProtectedValue});\n }\n}","ZhuitY1KOU1Xe7cP":"return !args.weapon?.system.properties.qualities.pummel","ZI2YnAAGoLpmVDIL":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.aE3pyW20Orvdjzj0\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = \"Religion\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","zI5hXv2NLGWqnmDD":"if (args.totalWoundLoss > 0)\n{\n\targs.actor.applyEffect({effectUuids : this.item.effects.contents[0].uuid})\n}","zi8Z3NlwVj3IfgAW":"if (this.item.system.quantity.value)\r\n{\r\n\tthis.item.system.reduceQuantity();\r\n\tlet actor = Array.from(game.user.targets)[0]?.actor || this.actor;\r\n\tactor.applyEffect({effectData : [this.item.effects.contents[3].convertToApplied()]})\r\n}\r\nelse\r\n{\r\n\tthis.script.scriptNotification(\"Nichts übrig!\", \"error\")\r\n}","zIErcRiBmIZRbary":"if (args.test.failed)\n {\n let applicableCharacteristics = [\"ws\", \"bs\", \"s\", \"fel\", \"ag\", \"t\", \"dex\"];\n if (applicableCharacteristics.includes(args.test.characteristicKey))\n {\n this.actor.addCondition(\"stunned\");\n }\n }","ziG9H5Kdb7xC3dFE":"return !args.skill?.name.includes(game.i18n.localize(\"NAME.Art\"));","ZingXNvYyZ2BEvfY":"let characteristics = {\n \"ws\" : 10,\n \"bs\" : 0,\n \"s\" : 5,\n \"t\" : 5,\n \"i\" : 10,\n \"ag\" : 0,\n \"dex\" : 0,\n \"int\" : 0,\n \"wp\" : 0,\n \"fel\" : 0\n}\nlet skills = [\"Besonnenheit\", \"Ausweichen\", \"Sprache (Schlachtenzunge)\"]\nlet skillAdvancements = [10, 10, 10]\n\nlet talents = [\"Kampfreflexe\", \"Entschlossen\"]\nlet trappings = [\"Kürass\", \"Plattenarme\", \"Helm\", \"Plattenbeine\"]\n\nlet items = [];\n\nlet updateObj = this.actor.toObject();\n\nfor (let ch in characteristics)\n{\n updateObj.system.characteristics[ch].modifier += characteristics[ch];\n}\n\nfor (let index = 0; index < skills.length; index++)\n{\n let skill = skills[index]\n let skillItem;\n skillItem = updateObj.items.find(i => i.name == skill && i.type == \"skill\")\n if (skillItem)\n skillItem.system.advances.value += skillAdvancements[index]\n else \n {\n skillItem = await game.wfrp4e.utility.findSkill(skill)\n skillItem = skillItem.toObject();\n skillItem.system.advances.value = skillAdvancements[index];\n items.push(skillItem);\n }\n}\n\nfor (let talent of talents)\n{\n let talentItem = await game.wfrp4e.utility.findTalent(talent)\n if (talentItem)\n {\n items.push(talentItem.toObject());\n }\n else \n {\n ui.notifications.warn(`${talent} nicht gefunden`, {permanent : true})\n }\n}\n\nfor (let trapping of trappings) \n{\n let trappingItem = await game.wfrp4e.utility.findItem(trapping)\n if (trappingItem)\n {\n trappingItem = trappingItem.toObject()\n\n trappingItem.system.equipped.value = true;\n\n items.push(trappingItem);\n }\n else \n {\n ui.notifications.warn(`${trapping} nicht gefunden`, {permanent : true})\n }\n}\n\nlet weapons = await warhammer.utility.findAllItems(\"weapon\", \"Waffen laden\");\n\nitems = items.concat((await game.wfrp4e.apps.ItemDialog.create([await fromUuid(\"Compendium.wfrp4e-core.items.Item.1zaqojk0Oq1m8vYv\"), await fromUuid(\"Compendium.wfrp4e-core.items.Item.bBX8MP6QfcyU6Fy3\")], 1, \"Wähle eine Waffe\")) || [])\n\nlet choices = weapons.filter(i => i.system.properties.qualities.shield || i.system.weaponGroup.value == \"polearm\" || i.system.weaponGroup.value == \"twohanded\");\n\nitems = items.concat(await game.wfrp4e.apps.ItemDialog.create(choices, 1, \"Wähle einen Schild, eine Stangenwaffe oder eine zweihändige Waffe\"));\n\nupdateObj.name = updateObj.name += \" \" + this.effect.name\n\nawait this.actor.update(updateObj)\nthis.actor.createEmbeddedDocuments(\"Item\", items);\n","zIpl3SkWv8zzlr2D":"let filters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"system.lore.value\",\n value : \"petty\"\n }\n]\n\nlet petty = (await ItemDialog.createFromFilters(filters, 4, {text : \"Wähle 4 Zaubertricks der Niederen Magie\"})).map(i => i.toObject());\n\n\nfilters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"system.lore.value\",\n value : [\"death\"]\n }\n]\n\nlet arcane = (await ItemDialog.createFromFilters(filters, 8, {text : \"Wähle 8 Arkane Zauber und Zauber der Lehre des Todes\"})).map(i => i.toObject());\n\nfilters = [\n {\n property : \"type\",\n value : \"spell\"\n },\n {\n property : \"name\",\n value: /^((?!\\().)*$/gm, // Remove all spells with parentheses (all arcane spells spells)\n regex: true\n },\n {\n property : \"system.lore.value\",\n value : \"necromancy\"\n }\n]\n\nlet necromancy = (await ItemDialog.createFromFilters(filters, 3, {text : \"Wähle 3 aus der Lehre der Nekromantie\"})).map(i => i.toObject());\n\nlet items = [...necromancy, ...petty, ...arcane]\n\nthis.actor.createEmbeddedDocuments(\"Item\", items);","zjTEhJuLcFVkzory":"if (!args.test.preData.options?.kingship) return\n\nif (!this.item.equipped.value || !args.test.item) return;\nif ([game.i18n.localize(\"NAME.Charm\"), \n game.i18n.localize(\"NAME.Intimidate\"), \n game.i18n.localize(\"NAME.Leadership\")].includes(args.test.item.name))\n{\n args.test.preData.canReverse = true\n}","ZJy2rvpKmUHXGrAi":"args.actor.details.move.run *= 1.5","zK38Rl5t9zbFi4Se":"if (args.opposedTest.result.hitloc.value == this.item.system.location.key && args.totalWoundLoss > 0)\r\n{\r\n args.actor.addCondition(\"bleeding\", 1);\r\n this.script.scriptNotification(\"Blutend hinzugefügt\")\r\n}","zk44dFEGkylB7kW6":" let modifier; let target = args.data.targets[0]\r\n if (target.actor.details.size.value == \"tiny\")\r\n modifier = 30\r\n if (target.actor.details.size.value == \"ltl\")\r\n modifier = 20\r\n if (target.actor.details.size.value == \"sml\")\r\n modifier = 10\r\n\t\r\n args.fields.modifier += (modifier || 0); // Offset size modifier ","zkc1gIPLj0VoAONT":"let AP = args.actor.status.armour;\r\n\r\nAP[\"head\"].value += 2;\r\nAP[\"rArm\"].value += 2;\r\nAP[\"lArm\"].value += 2;\r\nAP[\"body\"].value += 2;\r\nAP[\"lLeg\"].value += 2;\r\nAP[\"rLeg\"].value += 2;","zL7ECmBBMAqf5Esn":"let hasMagazine = await Dialog.confirm({content: \"<p>Does the vessel have a magazine or any other kind of store for blackpowder?</p>\"});\r\n\r\nif (!hasMagazine) return;\r\n\r\nlet roll = new Roll(\"d10\");\r\nawait roll.evaluate();\r\n// await roll.toMessage();\r\nlet anchor = roll.toAnchor();\r\n\r\nlet crits = [];\r\n\r\nfor (let i = 0; i < roll.total; i++) {\r\n let result = await WFRP_Tables.rollTable('crithull');\r\n let collection = game.packs.get(result.object.documentCollection)\r\n\r\n if (collection)\r\n await collection.getDocuments()\r\n\r\n if (!collection)\r\n collection = game.items;\r\n\r\n let item = collection.get(result.object.documentId)\r\n if (item)\r\n crits.push(item);\r\n}\r\n\r\nconst items = await this.actor.createEmbeddedDocuments(\"Item\", crits);\r\nconst speaker = ChatMessage.getSpeaker({actor: this.actor});\r\nconst uuids = items.map(i => `@UUID[${i.uuid}]`);\r\nthis.script.scriptMessage(`<p><b>${this.item.name}</b> caused an additional ${anchor.outerHTML} Critical Hits to the Hull!</p><ul><li>${uuids.join('<li>')}</ul>`)","zLBLEDl3aGcAxai2":"const hasTraits = args.actor.has(\"Dämonisch\") || args.actor.has(\"Untot\") || args.actor.has(\"Zauberkundig\");\r\nconst hasSinOrCorruption = args.actor.status.sin.value > 0 || args.actor.status.corruption.value > 0;\r\nconst isSpellcaster = args.actor.itemTags.talent.some(i =>\r\n i.name.includes(game.i18n.localize(\"NAME.ArcaneMagic\")) ||\r\n i.name.includes(game.i18n.localize(\"NAME.ChaosMagic\")) ||\r\n i.name.includes(game.i18n.localize(\"NAME.PettyMagic\"))\r\n );\r\nconst shouldDamage = hasTraits || hasSinOrCorruption || isSpellcaster;\r\n\r\nif (shouldDamage) {\r\n const roll = new Roll(\"1d10\");\r\n await roll.evaluate();\r\n let damage = roll.total;\r\n await roll.toMessage();\r\n await this.script.message(await this.actor.applyBasicDamage(damage, {damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true}));\r\n}","ZLspFT2I3ZdWWr2H":"return args.skill?.name !== game.i18n.localize(\"NAME.Leadership\");","ZMwJad6v4G13SgjR":"return args.type == \"cast\" || args.type == \"channelling\"","ZNu4B0OdjkM9lmtu":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.9h82z72XGo9tfgQS\")\r\nlet data = item.toObject();\r\ndata.name = data.name += \" (Vision)\"\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","ZNW3ubbKIYXAyE48":"let wounds = this.actor.itemTypes.disease.filter(i => i.name == \"Festering Wound\" && i.system.duration.active);\r\nlet selected;\r\nif (wounds.length == 0)\r\n{\r\n return this.script.scriptNotification(\"No Festering Wounds!\");\r\n}\r\nelse if (wounds.length == 1)\r\n{\r\n selected = wounds[0];\r\n}\r\nelse if (wounds.length >= 2)\r\n{\r\n selected = (await ItemDialog.create(wounds, 1))[0];\r\n}\r\n\r\nif (selected)\r\n{\r\n let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Endurance\"), {fields: {difficulty : \"average\"}})\r\n await test.roll();\r\n if (test.succeeded)\r\n {\r\n let SL = parseInt(test.result.SL);\r\n if (SL >= 0)\r\n {\r\n selected.update({\"system.duration.value\" : selected.system.duration.value - SL})\r\n this.script.scriptMessage(`<strong>${selected.name}</strong> duration reduced by ${SL}!`)\r\n }\r\n }\r\n}","Znz4g56UH23SSCg7":"if (!args.messageSent)\n{\n args.messageSent = true;\n let advantage = this.item.effects.filter(i => i.name == this.effect.name).length;\n this.actor.setAdvantage(advantage)\n this.script.message(`Allies within 6 yards gain ${advantage} Advantage`)\n}","ZOgtDW3mkTfeyc5M":"args.actor.system.details.price.gc += args.actor.system.details.price.gc * 0.1;","zphxI8VSWbNQCMBy":"args.size = \"lrg\"","zqShIJnrRReGgP94":"let {added, removed} = this.effect.getFlag(\"wfrp4e\", \"propertiesChanged\");\r\n\r\nfor(let property of (added || []))\r\n{\r\n let hasValue = game.wfrp4e.config.propertyHasValue[property];\r\n if (!args.item.system.qualities.value.find(i => i.name == property))\r\n {\r\n args.item.system.qualities.value.push({name : property, value : (hasValue ? 2 : null)})\r\n }\r\n}\r\n\r\nfor(let property of (removed || []))\r\n{\r\n args.item.system.flaws.value = args.item.system.flaws.value.filter(i => i.name != property)\r\n}","ZqTW093qENOwGONP":"let msg = \"\"\r\n\r\nlet SL = parseInt(this.effect.sourceTest.result.SL);\r\n\r\nfor(let i = 0; i < SL; i++)\r\n{\r\n msg += `<p>${await this.actor.applyBasicDamage(3, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP})}</p>`\r\n}\r\n\r\nthis.script.scriptMessage(msg);","zR4WAjzXHTZuiu5G":"let actor = this.actor;\r\n let effect = this.effect;\r\n let bleedingAmt;\r\n let bleedingRoll;\r\n let msg = \"\"\r\n\r\n let damage = effect.conditionValue;\r\n let scriptArgs = {msg, damage};\r\n await Promise.all(actor.runScripts(\"preApplyCondition\", {effect, data : scriptArgs}))\r\n msg = scriptArgs.msg;\r\n damage = scriptArgs.damage;\r\n msg += await actor.applyBasicDamage(damage, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, minimumOne : false, suppressMsg : true})\r\n\r\n if (actor.status.wounds.value == 0 && !actor.hasCondition(\"unconscious\"))\r\n {\r\n await actor.addCondition(\"unconscious\")\r\n msg += \"<br>\" + game.i18n.format(\"BleedUnc\", {name: actor.prototypeToken.name })\r\n }\r\n\r\n if (actor.hasCondition(\"unconscious\"))\r\n {\r\n bleedingAmt = effect.conditionValue;\r\n bleedingRoll = (await new Roll(\"1d100\").roll()).total;\r\n if (bleedingRoll <= bleedingAmt * 10)\r\n {\r\n msg += \"<br>\" + game.i18n.format(\"BleedFail\", {name: actor.prototypeToken.name}) + \" (\" + game.i18n.localize(\"Rolled\") + \" \" + bleedingRoll + \")\";\r\n await actor.addCondition(\"dead\")\r\n }\r\n else if (bleedingRoll % 11 == 0)\r\n {\r\n msg += \"<br>\" + game.i18n.format(\"BleedCrit\", { name: actor.prototypeToken.name } ) + \" (\" + game.i18n.localize(\"Rolled\") + bleedingRoll + \")\"\r\n await actor.removeCondition(\"bleeding\")\r\n }\r\n else\r\n {\r\n msg += \"<br>\" + game.i18n.localize(\"BleedRoll\") + \": \" + bleedingRoll;\r\n }\r\n }\r\n\r\n await Promise.all(actor.runScripts(\"applyCondition\", {effect, data : {bleedingRoll}}))\r\n if (args.suppressMessage)\r\n {\r\n let messageData = game.wfrp4e.utility.chatDataSetup(msg);\r\n messageData.speaker = {alias: this.effect.name}\r\n messageData.flavor = this.effect.name;\r\n return messageData\r\n }\r\n else\r\n {\r\n return this.script.scriptMessage(msg)\r\n }\r\n ","ZrePyV2spv3v65Tg":"return args.type != \"weapon\" && !this.actor.statuses.has(\"infighting\")","ZRoG7GiMDQWso6gN":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Trade (Carpentry)';\r\nconst difficulty = 'difficult';\r\nconst target = 30;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","zsiV6XEHlCNGLLPl":"return args.skill?.name == game.i18n.localize(\"NAME.SetTrap\");","ZsOHDb7XwmuUUWPL":"return args.characteristic === 'fel';","zsoTVkHe4nHY1M52":"this.script.scriptMessage(await this.actor.applyBasicDamage(10 + parseInt(this.effect.sourceTest.result.SL), {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP}))","ZsQR3AVKi0v5U593":"args.actor.addCondition(\"ablaze\", 2)","ZTE8LdRblyG4yYoE":"if (args.test.result.castOutcome == \"success\")\r\n{\r\n // Wait till after chat card is posted\r\n game.wfrp4e.utility.sleep(500).then(() => {\r\n game.wfrp4e.utility.postTerror(1, this.effect.name)\r\n game.wfrp4e.utility.postTerror(2, this.effect.name)\r\n })\r\n}","ztIkD5Zt6ko9D4Ca":"args.fields.modifier -= 10","ZuoIVv3nmlGhhdx0":"let rating = parseInt(this.effect.name.match(/\\d+/)?.[0]) || 1;\r\nlet holed = this.actor.flags.holed || {holed: 0};\r\nholed.holed += rating;\r\nthis.actor.flags.holed = holed;\r\n","ZURBQYTYcP5jci5k":"const broken = this.actor.hasCondition(\"broken\");\n\nbroken?.delete();","zUv9e0A3OEXWY9Mv":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.pLW9SVX0TVTYPiPv\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = 9 - this.actor.system.characteristics.s.bonus\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","ZvbBM4gTJHPdU8jU":"let test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\r\nawait test.roll();\r\nreturn test.failed","zWZG8OmxqTpzHjFV":"args.actor.characteristics.ag.modifier -= 10;\n\n if (args.actor.details.move.value > 3)\n {\n args.actor.details.move.value -= 1;\n if (args.actor.details.move.value < 3)\n args.actor.details.move.value = 3\n }","zxG5KbliWE9xWNQD":"this.script.message(\"Überspring automatisch jede \" + this.script.label);\r\nargs.abort = true;","Zxh4RAENoaAQAaNg":"return !this.actor.flags.useless.rEye || !this.actor.flags.useless.lEye || [\"wp\", \"t\", \"s\"].includes(args.characteristic)","zXh8rgMxWoCLTxVd":"const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;\r\nconst test = 'Sail';\r\nconst difficulty = 'challenging';\r\nconst target = 40;\r\n\r\nconst extendedTestData = {\r\n name: this.item.name,\r\n type: \"extendedTest\",\r\n img: this.item.img,\r\n system: {\r\n SL: {\r\n current: 0,\r\n target: target\r\n },\r\n test: {\r\n value: test\r\n },\r\n completion: {\r\n value: \"remove\"\r\n },\r\n difficulty: {\r\n value: difficulty\r\n }\r\n },\r\n effects: [\r\n {\r\n name: `Repair the ${this.item.name}`,\r\n icon: this.item.img,\r\n flags: {\r\n wfrp4e: {\r\n applicationData: {\r\n type: \"document\",\r\n documentType: \"Item\"\r\n },\r\n scriptData: [\r\n {\r\n label: this.item.name,\r\n script: `\r\n let id = this.item.flags.wfrp4e.fromEffect;\r\n let effect = this.actor.appliedEffects.find(e => e.id === id);\r\n this.script.scriptMessage(\"${repaired_message}\");\r\n await effect.item.delete();\r\n `,\r\n trigger: \"deleteEffect\"\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n ]\r\n};\r\n\r\nawait this.actor.createEmbeddedDocuments(\"Item\", [extendedTestData], {fromEffect: this.effect.id});\r\n","ZxtOdwsM2Sqj9Zam":"let item = await fromUuid(\"Compendium.wfrp4e-core.items.AtpAudHA4ybXVlWM\")\r\nlet data = item.toObject();\r\ndata.system.specification.value = 0\r\ndata.name = this.effect.name;\r\nthis.actor.createEmbeddedDocuments(\"Item\", [data], {fromEffect : this.effect.id})","zY4ZjY7uyKIKMYmX":"this.script.scriptMessage(await game.wfrp4e.tables.formatChatRoll(\"fleshy-curse\"))\r\n\r\nlet test = await this.actor.setupSkill(game.i18n.localize(\"NAME.Cool\"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : \"hard\"}})\r\nawait test.roll();\r\nif (test.succeeded)\r\n{\r\n this.effect.delete()\r\n}","ZYsMgB4BwXBJcpYf":"// The wearer of the cloak causes Fear 2 \r\n// in Wolves, Lions, Goats, and Chimeras.\r\ngame.wfrp4e.utility.postFear(2, this.effect.name)\r\n","ZZb57zYE7bJy7rfU":"let damage = await new Roll(\"1d10\").roll();\ndamage.toMessage(this.script.getChatData());\nthis.actor.applyDamage(damage.total, {\n damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL,\n createMessage: this.script.getChatData()\n});\n\nthis.actor.addCondition(\"prone\");","zzk2uRSFjFHB5kjw":"\r\n let roll = Math.ceil(CONFIG.Dice.randomUniform() * 10)\r\n if (args.test.isFumble && roll == 1 && !args.test.result.misfire)\r\n {\r\n args.test.result.misfire = game.i18n.localize(\"Misfire\") + \" (Rolled 1)\"\r\n args.test.result.misfireDamage = eval(parseInt(args.test.result.roll.toString().split('').pop()) + args.test.item.Damage)\r\n }\r\n else if (args.test.isFumble && roll != 1)\r\n args.test.result.other.push(\"Misfire Roll: \" + roll)"});
|
||
} |