Don't confuse the log editor and the game console. You can find instructions on how to unlock it online. I also recommend using a dedicated script editor => https://yadi.sk/d/W6cz5UBu3SGAvb. It doesn't crash and works better, plus it's more convenient. You need to create a table of script names for the Elven heroes:
preserve_heroes={"Name", "Name1", ..., "Name7"}.
Then, in the function:
function Def(heroname)
for key, name in preserve_heroes do
if name==heroname then
local PreserveHero=1
end
end
if not PreserveHero then
StartCombat(...)
end
...
end
Trigger...
Thank you!