// uvodni pokec k misi a vybirani vojaku
EXPORT function uvodni_kecy;
begin
  DialogueOn;
  Say(sef,'D1-sef-1');
  Say(pl,'D1-pl-1');
  case nat of
   nation_arabian:Say(sef,'D1-sef-2ar');
   nation_american:Say(sef,'D1-sef-2am');
   nation_russian:Say(sef,'D1-sef-2ru');
  end;
  Say(pl,'D1-pl-2');
  Say(sef,'D1-sef-3');
  Say(pl,'D1-pl-3');
  Say(sef,'D1-sef-4');
  Say(sef,'D1-sef-4a');
  Say(pl,'D1-pl-4');
  Say(sef,'D1-sef-5');
  Say(pl,'D1-pl-5');
  DialogueOff;
end;

// funkce na vyber vojaku pro danou misi
// player,sebel + pocet_vojaku_na_zacatku, alespon 1 engineer
EXPORT function vyber_vojaky;
VAR pom;
VAR units_na_vyber;
VAR i;
VAR vyber;
begin
  units_na_vyber=[sel_not_changeable,sel_hired,sel_dont_change_class,pl,ls];
  units_na_vyber=units_na_vyber^[sel_not_hired,sel_changeable,sel_change_class];
  units_na_vyber=units_na_vyber^lidi_na_vyber;
  pom=CharacterSelection('Vyber si lidi pro misi',
                          pocet_vojaku_na_zacatku,pocet_vojaku_na_zacatku,
                          units_na_vyber,
                          [[class_engineer,1,pocet_vojaku_na_zacatku],
                          [class_scientistic,0,pocet_vojaku_na_zacatku],
                          [class_mechanic,0,pocet_vojaku_na_zacatku],
                          [class_soldier,0,pocet_vojaku_na_zacatku]]);
  vyber=[pl,ls];
  vyber=vyber^pom;
  result:=vyber;
end;

// funkce na placnuti vojaky do uvodniho postaveni
EXPORT function placni_vojcly_do_enter_aree;
VAR i;
begin
  for i in enter do PlaceUnitXYR(i,62,113,5,false);
  ChangeMissionObjectives('M1');
end;

// funkce na skoro zniceni base Vulcano 1
EXPORT function prepare_znicenou_bazi;
VAR pom,i;
begin
  uc_side=You2;
  uc_nation=nat;

  bc_level=levely_vojaku[dif];
  bc_type=b_depot;

  CreateAndPlaceBuildingXYD(80,146,1);
  bc_type=b_armoury;
  CreateAndPlaceBuildingXYD(81,140,2);
  bc_type=b_workshop;
  CreateAndPlaceBuildingXYD(94,153,5);
  bc_type=b_lab;
  bc_kind1=b_lab_basic;
  bc_kind2=b_lab_basic;
  CreateAndPlaceBuildingXYD(88,140,0);
  bc_type=b_breastwork;
  CreateAndPlaceBuildingXYD(70,131,2);
  CreateAndPlaceBuildingXYD(77,131,3);
  CreateAndPlaceBuildingXYD(97,137,4);
  CreateAndPlaceBuildingXYD(106,149,4);
  pom=FilterAllUnits([[f_side,You2]]);
  for i in pom do SetLives(i,rand(250,300));
end;

// zabidi blede modrych vojclu v V1
EXPORT function chcip_vojaku;
VAR pom,i;
begin
  pom=FilterAllUnits([[f_side,You2],[f_type,unit_human]]);
  for i in pom do SetLives(i,1);
end;