


var arrayUnit: array of array[0..2] of Integer;
var len : Integer;


procedure OnMissionStart;
begin
   
Actions.FogRevealCircle(0,119,59,6);
Actions.ShowMsg(0,'<$0>');

	
end;


procedure OnWarriorEquipped(aUnitID : Integer; aGroupID : Integer);
var tempX : Integer;
var tempY : Integer;
var temporary : Integer;
var typeU : Integer;
begin
	typeU := States.UnitType(aUnitID);
		if   (typeU = 16) and (States.UnitOwner(aUnitID) = 3) then
			begin
				tempX := States.UnitPositionX(aUnitID);
				tempY := States.UnitPositionY(aUnitID);
				Actions.UnitKill(aUnitID, True);
				if typeU = 16  then
				begin
				typeU := 23;
				temporary := Actions.GiveGroup(3, 23, tempX, tempY, 4, 1, 1);
			end;
		
			len := len +1;
			SetLength(arrayUnit, len);
			arrayUnit[len-1][0] := temporary;
			arrayUnit[len-1][1] := States.GameTime;
			arrayUnit[len-1][2] := typeU;
			end;
			
			typeU := States.UnitType(aUnitID);
		if   (typeU = 14) and (States.UnitOwner(aUnitID) = 3) then
			begin
				tempX := States.UnitPositionX(aUnitID);
				tempY := States.UnitPositionY(aUnitID);
				Actions.UnitKill(aUnitID, True);
				if typeU = 14  then
				begin
				typeU := 23;
				temporary := Actions.GiveGroup(3, 23, tempX, tempY, 4, 1, 1);
			end;
		
			len := len +1;
			SetLength(arrayUnit, len);
			arrayUnit[len-1][0] := temporary;
			arrayUnit[len-1][1] := States.GameTime;
			arrayUnit[len-1][2] := typeU;
			end;
	
		
end;
