0% found this document useful (0 votes)
49 views

Message

This document contains code to summon or dismiss a Hexblade weapon item for an actor. It first checks if the Advanced Macros module is enabled, then gets the actor and target data. If the argument is "on" it will create a new Hexblade item for the actor with various data properties like name, damage values, and flags. If the argument is "off" it will delete any existing FlameBlade items for that actor.

Uploaded by

Leonardo Fonseca
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

Message

This document contains code to summon or dismiss a Hexblade weapon item for an actor. It first checks if the Advanced Macros module is enabled, then gets the actor and target data. If the argument is "on" it will create a new Hexblade item for the actor with various data properties like name, damage values, and flags. If the argument is "off" it will delete any existing FlameBlade items for that actor.

Uploaded by

Leonardo Fonseca
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

if (!game.modules.get("advanced-macros")?.active) ui.notifications.

error("Please
enable the Advanced Macros module")
const { actor, token, lArgs } = MidiMacros.targets(args)
const DAEItem = lArgs.efData.flags.dae.itemData

if (args[0] === "on") {


await actor.createEmbeddedDocuments("Item",
[{
"name": "Hexblade",
"type": "weapon",
"data": {
"quantity": 1,
"equipped": true,
"properties": {
"thr": false,
"ver": false,
"amm": false,
"hvy": true,
"fin": false,
"fir": false,
"foc": false,
"lgt": false,
"lod": false,
"rch": false,
"rel": false,
"ret": false,
"spc": false,
"two": true,
"ada": false,
"mgc": true,
"sil": false
},
"activation": {
"type": "action",
"cost": 1,
"condition": ""
},
"target": {
"value": 1,
"width": null,
"units": "",
"type": "creature"
},
"range": {
"value": 5,
},
"ability": "cha",
"actionType": "msak",
"attackBonus": "1",
"critical": {
"threshold": 19,
"damage": ""
},
"damage": {
"parts": [
["2d6 + @mod + 1 + (@attributes.prof)",
"slashing"
],
],
},
"weaponType": "simpleM",
"proficient": true,
},
"flags": {
"midi-srd": {
"FlameBlade":
actor.id
}
},
"img": DAEItem.img,
"effects": []
}]
);
ui.notifications.notify("A Hexblade appears in your inventory")
}

// Delete Flame Blade


if (args[0] === "off") {
MidiMacros.deleteItems("FlameBlade", actor)
}

You might also like