(_l => { lootItem = function(i) { _l(i); if (/legendary/.test(i.stat)) { message("Zdobyto przedmiot LEGENDARNY"); } }; })(lootItem);