Skip to content
#2738
Auto-translated
OrnsteinDragonslayer
There is an enemy hero. After he is killed, he should "resurrect." These resurrections will continue until the player captures all the mines. I wrote a few functions, but something isn't working. I don't know how to connect them. Maybe you can help?

I'm not very good with scripts, but this function should work, considering that the AI has a city and the mines have script names:
function start()
MakeHeroReturnToTavernAfterDeath("Aberrar",1,1)
for i = 1,6 do
sleep(1)
Trigger(OBJECT_CAPTURE_TRIGGER,"mine"..i,"ImmortalNecr")
end
end

startThread(start)

function ImmortalNecr()
if GetObjectOwner("mine1") == 1 and GetObjectOwner("mine2") == 1 and GetObjectOwner("mine3") == 1 and GetObjectOwner("mine4") == 1 and GetObjectOwner("mine5") == 1 and GetObjectOwner("mine6") == 1 then
RemoveObject("Aberrar")
MakeHeroReturnToTavernAfterDeath("Aberrar",nil)
end
end