Hi all, still futsing with this ice storm template deletion. Hoping i might be able to get some insight here. Current plan is to use midiqol on use macro to call item macro. which will add an active effect to the caster that expires at the end of their next turn with its change being to call item macro.
When the dae effect expires, it then calls item macro again and removes the template.
Just having trouble figuring out the flow for it. I currently have what i believe should work...
if(args[0].workflowOptions){
let curActor = await fromUuid(args[0].actorUuid);
let templateUuid = args[0].templateUuid;
let effectData = {
label: args[0].item.name + " Template",
icon: args[0].item.img,
changes: [
{
"key": "macro.itemMacro",
"value": templateUuid,
"mode": 5,
"priority": "20"
}
],
duration: {
startRound: game.combat ? game.combat.round : 0,
startTime: game.time.worldTime
},
flags: {
dae: {
specialDuration: ["turnEndSource"]
}
}
};
await curActor.createEmbeddedDocuments("ActiveEffect",[effectData]);
}
else if(args[0] == "off"){
const uuid = args[1];
console.warn("Template UUID: ", uuid);
}
but i get an error
and i dont know what i did wrong. any insight?