{$I HKS_SaveCData.script}
var BaronLanger : Integer;
	BaronDied : Boolean;
	
const TIME_LANGER_ESCPAE = 15000;


procedure LangerEscapes;
begin
	If S.GameTime = TIME_LANGER_ESCPAE then 
	begin
		BaronLanger := A.GiveUnit(15, 13, 72, 102, 4);
		A.UnitOrderWalk(BaronLanger, 37, 1);
	end else
	If S.GameTime > TIME_LANGER_ESCPAE then 
	begin
		If S.UnitDead(BaronLanger) then 
		begin
			BaronDied := true;
			Actions.OverlayTextSetFormatted(-1, '2', []);
		 Actions.OverlayTextAppendFormatted(-1, '<$2>', []);
		end else
		If S.UnitIdle(BaronLanger) then 
		begin
			A.UnitKill(BaronLanger, true);
			A.PlayerDefeat(0);
			BaronDied := true;
                        Actions.OverlayTextSetFormatted(-1, '3', []);
		 Actions.OverlayTextAppendFormatted(-1, '<$3>', []);
		end;
	
	end;
end;
Procedure OnTick;
begin
  if States.GameTime mod 10 = 0 then
	If not BaronDied then 
		LangerEscapes;
	
 if States.GameTime = 10 then
	Actions.ShowMsg(0, '<$1>');
 if States.GameTime = 15000 then
	Actions.ShowMsg(0, '<$3>');
end;