---------------------------------------------------------------------------------
function Objective0()
  if ( GetIGlobalVar("temp.luc.objective.0", 0) == 0) then     
	ObjectiveChanged(0, 0);
	DisableAviation (0, -1);
	Suicide();
  end;	
end;
---------------------------------------------------------------------------------
function Objective1()
  if ( GetIGlobalVar("temp.luc.objective.1", 0) == 0) then     
	ObjectiveChanged(1, 0);
	Suicide();
  end;	
end;
---------------------------------------------------------------------------------
function Objective2()
  if ( GetIGlobalVar("temp.luc.objective.2", 0) == 0) then     
	ObjectiveChanged(2, 0);
	Suicide();
  end;	
end;
---------------------------------------------------------------------------------
function Objective3()
  if ( GetIGlobalVar("temp.luc.objective.3", 0) == 0) then     
	ObjectiveChanged(3, 0);
	Suicide();
  end;	
end;
---------------------------------------------------------------------------------
function Objective4()
  if ( GetIGlobalVar("temp.luc.objective.4", 0) == 0) then     
	ObjectiveChanged(4, 0);
	Suicide();
  end;	
end;
---------------------------------------------------------------------------------
function Objective5()
  if ( GetIGlobalVar("temp.luc.objective.5", 0) == 0) then     
	ObjectiveChanged(5, 0);
	Suicide();
  end;	
end;
---------------------------------------------------------------------------------
function z_0() 
	if ( GetNUnitsInScriptGroup(9) < 1) then
	ChangePlayer (333, 2);
	end;

     if ( GetNScriptUnitsInArea (334, "p_z0") > 0) then
      if ( GetNUnitsInScriptGroup(333) > 0) then
       if ( GetNUnitsInScriptGroup(334) > 0) then
	SetIGlobalVar("temp.luc.objective.0", 1);
	ChangePlayer (334, 2);
	ObjectiveChanged(0, 1);
	LandReinforcement(456);
	RunScript("mov", 100);
	Suicide();
       end;
      end;
     end;


	if ( GetNUnitsInScriptGroup(333) <= 0) then
	SetIGlobalVar("temp.luc.objective.0", 2);
	ObjectiveChanged(0, 2);
	Suicide();
	end;


	if ( GetNUnitsInScriptGroup(334) <= 0) then
	SetIGlobalVar("temp.luc.objective.0", 2);
	ObjectiveChanged(0, 2);
	Suicide();
	end;

end;
---------------------------------------------------------------------------------
function z_1()
	if ( GetNUnitsInArea(1, "z_0") < 1) then
	SetIGlobalVar("temp.luc.objective.1", 1);
	ObjectiveChanged(1, 1);
	RunScript("Objective2", 2000);
	LandReinforcement(455);
	LandReinforcement(169);
	Suicide();
	end;
end;
---------------------------------------------------------------------------------
function z_2()
	if ( GetNUnitsInArea(1, "z_2") < 1) then
	SetIGlobalVar("temp.luc.objective.2", 1);
	ObjectiveChanged(2, 1);
	RunScript("Objective3", 2000);
	LandReinforcement(456);
	Suicide();
	end;
end;
---------------------------------------------------------------------------------
function z_3()
	if ( GetNUnitsInArea(1, "z_3") < 1) then
	SetIGlobalVar("temp.luc.objective.3", 1);
	ObjectiveChanged(3, 1);
	RunScript("Objective4", 2000);
	LandReinforcement(220);
	Suicide();
	end;
end;
---------------------------------------------------------------------------------
function z_4()
	if ( GetNUnitsInArea(1, "z_4") < 1) then
	SetIGlobalVar("temp.luc.objective.4", 1);
	ObjectiveChanged(4, 1);
	Suicide();
	end;
end;
---------------------------------------------------------------------------------
function z_5()
	if ( GetNUnitsInScriptGroup(587) < 1) then
	SetIGlobalVar("temp.luc.objective.5", 1);
	ObjectiveChanged(5, 1);
	Suicide();
	end;
end;
---------------------------------------------------------------------------------
function ToWin()
	if ((GetIGlobalVar("temp.luc.objective.1", 0) 
	* GetIGlobalVar("temp.luc.objective.3", 0) 
	* GetIGlobalVar("temp.luc.objective.4", 0)) == 1) then
		Win(0);
		Suicide();
	end;
end;

---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
function gamover_Loose1()
	if ( GetNUnitsInParty (0) < 1) then
	RunScript("gamover_Loose0", 5000);
	Suicide();
	end;
end;

function gamover_Loose2()
 if ( GetNUnitsInScriptGroup(444) <= 0) then
	SetIGlobalVar("temp.luc.objective.5", 2);
	ObjectiveChanged(5, 2);
	DisplayTrace ("Rosyjski genera³ nie ¿yje!");
	RunScript("gamover_Loose0", 5000);
	Suicide();
	end;
end

function gamover_Loose0()
        Loose();
        Suicide();
end;
---------------------------------------------------------------------------------
function mov()

    if ( GetNUnitsInArea(1, "z_0") < 1) then

     		movx, movy, radius = GetScriptAreaParams ("ext1");
		
		Cmd (0,333,movx,movy);
		Cmd (39,334,333);

	if ( GetNScriptUnitsInArea(334, "ext1") > 0) then
	DeleteReinforcement (333);
	DeleteReinforcement (334);	
	Suicide();	
	end;

    end;
end;
---------------------------------------------------------------------------------
function mov2()
mov2x, mov2y = GetObjCoord (444);
Cmd (3,587,mov2x,mov2y);
end;
---------------------------------------------------------------------------------
function at1()

	if ( GetNUnitsInArea(0, "z_x_0") > 0) then
	gen = 1
	Suicide();
	end;


	if ( GetNUnitsInArea(0, "z_x_6") > 0) then
	gen = 1
	Suicide();
	end;


	if ( GetNUnitsInArea(0, "z_x_1") > 0) then
	gen = 1
	Suicide();
	end;


	if ( GetNUnitsInArea(0, "z_x_2") > 0) then
	gen = 1
	Suicide();
	end;


	if ( GetNUnitsInArea(0, "z_x_3") > 0) then
	gen = 1
	Suicide();
	end;



	if ( GetNUnitsInArea(0, "z_x_4") > 0) then
	gen = 1
	Suicide();
	end;


	if ( GetNUnitsInArea(0, "z_x_5") > 0) then
	gen = 1
	Suicide();
	end;

end;


function at1_1()

 if ( GetIGlobalVar("temp.bar.objective.5", 0) == 0) then

  if ( GetNUnitsInScriptGroup(587) > 0) then

    if ( gen > 0 ) then
--DisplayTrace ("Ãåíåðàë");

	RunScript("Objective5", 1000);
	RunScript("mov2", 9000);
	Suicide();

    end;

  end;
 end;
end;

---------------------------------------------------------------------------------
--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--
---------------------------------------------------------------------------------
function Kill()
	if ( GetIGlobalVar("temp.luc.objective.0", 0) == 1) then
	KillScript("z_0");
	Suicide();
	end;


	if ( GetIGlobalVar("temp.luc.objective.1", 0) == 1) then
	KillScript("z_1");
	Suicide();
	end;

	if ( GetIGlobalVar("temp.luc.objective.2", 0) == 1) then
	KillScript("z_2");
	Suicide();
	end;

	if ( GetIGlobalVar("temp.luc.objective.3", 0) == 1) then
	KillScript("z_3");
	Suicide();
	end;

	if ( GetIGlobalVar("temp.luc.objective.4", 0) == 1) then
	KillScript("z_4");
	Suicide();
	end;

	if ( GetIGlobalVar("temp.luc.objective.5", 0) == 1) then
	KillScript("z_5");
	KillScript("at1");
	KillScript("at1_1");
	KillScript("mov2");
	Suicide();
	end;


end;
---------------------------------------------------------------------------------
--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--
---------------------------------------------------------------------------------

function Init()

	RunScript("Objective0", 2000);
	RunScript("Objective1", 5000);

	RunScript("z_0", 2000);
	RunScript("z_1", 2000);
	RunScript("z_2", 2000);
	RunScript("z_3", 2000);
	RunScript("z_4", 2000);
	RunScript("z_5", 2000);
	RunScript("at1", 2000);
	RunScript("at1_1", 2000);

	RunScript("ToWin", 2000);
	RunScript("gamover_Loose1", 2000);
	RunScript("gamover_Loose2", 2000);



end;