function ToWin()
if ((GetIGlobalVar("ukol.0", 1) * GetIGlobalVar("ukol.1", 1) * GetIGlobalVar("ukol.2", 1) * GetIGlobalVar("ukol.3", 1) * GetIGlobalVar("ukol.4", 1) * GetIGlobalVar("ukol.5", 1) * GetIGlobalVar("ukol.6", 1)) == 1) then
Win(0);
Suicide();
end;
end;

function Start()
SetIGlobalVar("ukol.0", 0);
SetIGlobalVar("ukol.1", 0);
SetIGlobalVar("ukol.2", 0);
SetIGlobalVar("ukol.3", 0);
SetIGlobalVar("ukol.4", 0);
SetIGlobalVar("ukol.5", 0);
SetIGlobalVar("ukol.6", 0);
SetIGlobalVar("ukol.7", 0);
DisableAviation(0, 2);
Suicide();
end;

function RevealObjective0()
if ( GetIGlobalVar("ukol.0", 0) == 0) then
        ObjectiveChanged(0, 0);
        Suicide();
	else Suicide();
	end;
end;

function Objective0()
if (GetNUnitsInArea(1, "pristav") <= 0) then
SetIGlobalVar("ukol.0", 1);
ObjectiveChanged(0, 1);
Suicide();
end;
end;

function RevealObjective1()
if ( GetIGlobalVar("ukol.1", 0) == 0) then
        ObjectiveChanged(1, 0);
        Suicide();
	else Suicide();
	end;
end;

function Objective1()
if ( GetNUnitsInScriptGroup(101, 1) <= 0) then
SetIGlobalVar("ukol.1", 1);
ObjectiveChanged(1, 1);
RunScript( "posily0", 120000);
Suicide();
end;
end;

function RevealObjective2()
if ( GetIGlobalVar("ukol.2", 0) == 0) then
        ObjectiveChanged(2, 0);
        Suicide();
	else Suicide();
	end;
end;

function Objective2()
if (GetNUnitsInArea(1, "tovarny") <= 0) then
SetIGlobalVar("ukol.2", 1);
ObjectiveChanged(2, 1);
Suicide();
end;
end;

function RevealObjective3()
if ( GetIGlobalVar("ukol.3", 0) == 0) then
        ObjectiveChanged(3, 0);
        Suicide();
	else Suicide();
	end;
end;

function Objective3()
if ( GetNUnitsInScriptGroup(102, 1) <= 0) then
SetIGlobalVar("ukol.3", 1);
ObjectiveChanged(3, 1);
Suicide();
end;
end;

function RevealObjective4()
if ( GetIGlobalVar("ukol.4", 0) == 0) then
        ObjectiveChanged(4, 0);
        Suicide();
	else Suicide();
	end;
end;

function Objective4()
if ( GetNUnitsInScriptGroup(103, 1) <= 0) then
SetIGlobalVar("ukol.4", 1);
ObjectiveChanged(4, 1);
RunScript( "RevealObjective7", 3000);
RunScript( "Objective7f", 5000);
RunScript( "protiutok3", 60000);
RunScript( "protiutok4", 180000);
Suicide();
end;
end;

function RevealObjective5()
if ( GetIGlobalVar("ukol.5", 0) == 0) then
        ObjectiveChanged(5, 0);
        Suicide();
	else Suicide();
	end;
end;

function Objective5()
if ( GetNUnitsInScriptGroup(104, 1) <= 0) then
SetIGlobalVar("ukol.5", 1);
ObjectiveChanged(5, 1);
Suicide();
end;
end;

function RevealObjective6()
if ( GetIGlobalVar("ukol.6", 0) == 0) then
        ObjectiveChanged(6, 0);
        Suicide();
	else Suicide();
	end;
end;

function Objective6()
if (GetNScriptUnitsInArea(11, "bunkr") == 1) then
SetIGlobalVar("ukol.6", 1);
ObjectiveChanged(6, 1);
RunScript( "RevealObjective0", 3000);
RunScript( "RevealObjective1", 5000);
RunScript( "RevealObjective2", 7000);
RunScript( "RevealObjective3", 9000);
RunScript( "RevealObjective4", 11000);
RunScript( "RevealObjective5", 13000);
RunScript( "posily1", 25000);
RunScript( "posily2", 120000);
RunScript( "dela_rus", 18000);
ViewZone ("high", 1);
RunScript( "closereport", 600000);
Suicide();
end;
end;

function closereport()
ViewZone ("high", 0);
Suicide();
end;

function RevealObjective7()
if ( GetIGlobalVar("ukol.7", 0) == 0) then
        ObjectiveChanged(7, 0);
        Suicide();
	else Suicide();
	end;
end;

function Objective7()
if ( GetNUnitsInScriptGroup(110, 1) <= 2) then
ObjectiveChanged(7, 1);
RunScript( "posily3", 120000);
KillScript ("Objective7f");
Suicide();
end;
end;

function Objective7f()
if (GetNUnitsInArea(1, "o7f") >= 1) then
ObjectiveChanged(7, 2);
KillScript ("Objective7");
KillScript ("posily3");
Suicide();
end;
end;

function posily0()
LandReinforcement(12);
Suicide();
end;

function posily1()
LandReinforcement(13);
Suicide();
end;

function posily2()
LandReinforcement(14);
Suicide();
end;

function posily3()
LandReinforcement(15);
Suicide();
end;

function dela_rus()
if ( GetIGlobalVar("ukol.6", 1) == 1) then
LandReinforcement(105);
LandReinforcement(106);
Suicide();
end;
end;

function protiutok0_konec()
if (GetNUnitsInArea(0, "predpristavem") >= 3) then
KillScript ("protiutok0_1");
KillScript ("protiutok0_2");
KillScript ("protiutok0_3");
KillScript ("protiutok0_4");
KillScript ("protiutok0_5");
KillScript ("protiutok0_6");
KillScript ("protiutok0_7");
KillScript ("protiutok0_8");
KillScript ("protiutok0_9");
KillScript ("protiutok0_10");
Suicide();
end;
end;

function protiutok0_1()
LandReinforcement(111);
RunScript( "protiutok0_2", 600000);
Suicide();
end;

function protiutok0_2()
LandReinforcement(112);
RunScript( "protiutok0_3", 1200000);
Suicide();
end;

function protiutok0_3()
LandReinforcement(113);
RunScript( "protiutok0_4", 1800000);
Suicide();
end;

function protiutok0_4()
LandReinforcement(114);
RunScript( "protiutok0_5", 1800000);
Suicide();
end;

function protiutok0_5()
LandReinforcement(115);
RunScript( "protiutok0_6", 2400000);
Suicide();
end;

function protiutok0_6()
LandReinforcement(116);
RunScript( "protiutok0_7", 2400000);
Suicide();
end;

function protiutok0_7()
LandReinforcement(117);
RunScript( "protiutok0_8", 3600000);
Suicide();
end;

function protiutok0_8()
LandReinforcement(118);
RunScript( "protiutok0_9", 3600000);
Suicide();
end;

function protiutok0_9()
LandReinforcement(119);
RunScript( "protiutok0_10", 3600000);
Suicide();
end;

function protiutok0_10()
LandReinforcement(120);
Suicide();
end;

function protiutok1()
LandReinforcement(107);
DisplayTrace ("The Russians are striking yet! Hurry up!");
Suicide();
end;

function protiutok2()
LandReinforcement(108);
Suicide();
end;

function protiutok3()
LandReinforcement(109);
Suicide();
end;

function protiutok4()
LandReinforcement(110);
RunScript( "Objective7", 5000);
Suicide();
end;

function ToLoose1()
if ( GetNUnitsInParty (0) <= 0) then
Loose(0);
DisplayTrace ("Unbelievable! The enemy has beaten you.");
Suicide();
end;
end;

function ToLoose2()
if ( GetNUnitsInScriptGroup(11, 0) == 0) then
Loose(0);
DisplayTrace ("You let the important officer die.");
Suicide();
end;
end;

function Init()
RunScript( "Start" , 1000);
RunScript( "ToWin" , 5000);
RunScript( "ToLoose1" , 5000);
RunScript( "ToLoose2" , 5000);
RunScript( "RevealObjective6", 2000);
RunScript( "Objective0", 5000);
RunScript( "Objective1", 5000);
RunScript( "Objective2", 5000);
RunScript( "Objective3", 5000);
RunScript( "Objective4", 5000);
RunScript( "Objective5", 5000);
RunScript( "Objective6", 7000);
RunScript( "protiutok0_1", 600000);
RunScript( "protiutok0_konec", 10000);
RunScript( "protiutok1", 30000);
RunScript( "protiutok2", 60000);
end;
