let ingredients = this.actor.itemTypes.trapping.filter(i => i.system.trappingType.value == "ingredient");

if (ingredients.length == 0)
{
  return this.script.notification("Keine Zutaten!");
}
this.script.notification("Betroffen: " + ingredients.map(i => i.name).join(", "));

for(let i of ingredients)
{
  await i.update({
    name: i.setSpecifier("Verdorben"),
    effects: [{
      name: "Verdorben",
      img: i.img,
      system: {
        transferData :{
          documentType: "Item"
        },
        scriptData: [
          {
            label: "Böser Einfluss",
            script: "args.fields.malignantInfluence = true;",
            trigger: "dialog",
            options: {
              activateScript: "return true;"
            }
          }
        ]
      }
    }]         
  });
}