
{$EVENT evtUnitWounded : OnUnitWoundedSpecial}
var SpecialUnits : array of Integer;

function UnitIsSpecial(aUnit : Integer; out aID : Integer) : Integer;
var I : Integer;
begin
	Result := -1;
	for I := 0 to high(SpecialUnits) do
		If SpecialUnits[I] = aUnit then 
			Result := I;
			
	aID := Result;
	
end;

procedure AddUnitAsSpecial(aUnit : Integer);
var I, J : Integer;
begin
	//J := IncLArrayI(SpecialUnits);
	SpecialUnits[IncLArrayI(SpecialUnits)] := aUnit;
end;

procedure AddGroupAsSpecialUnits(aGroup : Integer);
var I, MemCnt : Integer;
begin
	MemCnt := S.GroupmemberCount(aGroup);
	for I := 0 to MemCnt - 1 do 
		AddUnitAsSpecial(S.GroupMember(aGroup, I));
end;

Procedure OnUnitWoundedSpecial(aUnit,aKiller : Integer);
var aIndex : Integer;
begin
	If UnitIsSpecial(aKiller, aIndex) = -1 then
		Exit;
	
	A.UnitKill(aUnit, false);
	


end;