foundryvtt-wh4-lang-fr-fr/scripts/FX8ILw0VgbNxkObA.js

14 lines
582 B
JavaScript
Raw Normal View History

2024-10-08 20:52:09 +02:00
const uuid = "Compendium.wfrp4e-core.items.Item.mCvZAj5F6hfUZhzR";
const item = await fromUuid(uuid);
const data = item.toObject();
data.name = this.effect.name;
data.type = 'trapping';
data.system.trappingType = {value: 'clothingAccessories'};
data.system.equipped = {value: true};
const effectData = this.effect.sourceItem.effects.find(e => e.disabled).toObject();
effectData.disabled = false;
effectData.system.transferData.equipTransfer = true;
data.effects = [effectData];
const dagger = await this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id});