-------------------------------
function Start()
EnableAutoFinish(nil);
EnableCinematicCamera(not nil);
kills=0;
creatures=GetDefenderCreatures();
for i, c in creatures do
Number=GetCreatureNumber(c);
end;
end;
function DefenderCreatureDeath(creatureName)
CrType=GetCreatureType( creatureName );
kills=kills+1;
if (kills<=3) then
x,y=GetUnitPosition(creatureName);
sleep(1);
AddCreature(DEFENDER, CrType,Number, x, y);
end;
local defenders = GetDefenderCreatures();
if (length(defenders) == 0) then Finish(ATTACKER) end;
end;
function AttackerCreatureDeath()
local attackers = GetAttackerCreatures();
if (length(attackers) == 0) then Finish(DEFENDER) end;
end