Trigger(PLAYER_REMOVE_HERO_TRIGGER, player number, "script")
function script(hero)
if (hero == "hero") or (hero == "necromancer") then
Loose()
end
end
But I'm not sure you won't lose as soon as the initial hero disappears from the map, and besides, I think the necromancer appears from a reserve, not teleporting from somewhere on the edge of the map... so I suggest doing this:
necromant = 0, write this at the very beginning of the entire map script, on a separate line
At the beginning of the script with the hero replacement, write necromant = 1
Trigger(PLAYER_REMOVE_HERO_TRIGGER, 1, "Heroes")
function Heroes(hero)
if (hero == "hero 1") and necromant == 0 then
UnreserveHero("necromancer") if the necromancer appears from the reserve
Loose()
elseif (hero == "necromancer") then
UnreserveHero("necromancer") if the necromancer appears from the reserve
Loose()
end
end