|
{"command":"const actors = canvas.tokens.controlled.flatMap((token) => token.actor ?? []);\nif (actors.length === 0 && game.user.character) actors.push(game.user.character);\nif (actors.length === 0) {\n return ui.notifications.error(\"PF2E.ErrorMessage.NoTokenSelected\", { localize: true });\n}\n\nconst ITEM_UUID = \"Compendium.pf2e.feat-effects.uBJsxCzNhje8m8jj\"; // Effect: Panache\nconst source = (await fromUuid(ITEM_UUID)).toObject();\nsource.flags = mergeObject(source.flags ?? {}, { core: { sourceId: ITEM_UUID } });\n\nfor (const actor of actors) {\n const existing = actor.itemTypes.effect.find((e) => e.flags.core?.sourceId === ITEM_UUID);\n if (existing) {\n await existing.delete();\n } else {\n await actor.createEmbeddedDocuments(\"Item\", [source]);\n }\n}","name":"Effect: Panache","type":"script","img":"systems/pf2e/icons/features/classes/panache.webp","author":"TLOzy5OtQ1QVXwy3","scope":"global","folder":null,"sort":0,"ownership":{"default":0,"TLOzy5OtQ1QVXwy3":3},"flags":{},"_stats":{"systemId":"pf2e","systemVersion":"4.12.9","coreVersion":"10.303","createdTime":1689463325918,"modifiedTime":1689463325918,"lastModifiedBy":"TLOzy5OtQ1QVXwy3"},"_id":"3l9xiExCovNou4GG"}
|