------------------------------------------------------------
--     2008 Elite Games Team (R) All Rights Reserved      --
--             "STAR WOLVES 2: CIVIL WAR"                 --
------------------------------------------------------------

------------------------------------------------------------
-- Auto-built Quest-Action-file created by "MapBuilder2"  --
------------------------------------------------------------
--      "MapBuilder2" v.2.6 Elite Games Team              --
------------------------------------------------------------


--info:top=120,left=70,allvis=0;
function StartMission()
--------------------------------------------------------------------------------
--  StartDialog("Dialog1");
  count_or_go_on();
--------------------------------------------------------------------------------
end;


--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

function count_or_go_on()
  if (pilot_El) or (pilot_Ace) or (pilot_Astra) or (pilot_Bavard) or (pilot_Joker) then
    if (count_pilots() >= 6) then
      choose_pilot();
    else
      StartDialog("Dialog1");
    end;
  else
    StartDialog("Dialog1");
  end; 
end;

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------


--info:top=160,left=70,allvis=0;
function UelCopy_ComeOn()
  SetQuestState("quest_12e_01", QUEST_DONE);
  ship1 = CreateCarcass("EvilEye_ino2", PATROL:GetPosition()+Vector3(20, 10, -30), Vector3(-1,0,0)); 
  ship1:AssignPilot(UelDSpeaker);
  UelDFlight = Player_Group:CreateFlight("UelDFlight");
  UelDFlight:AddShip(ship1);
  UelDFlight:Escort(mothership);
  AddPost("mail_012e");
  AddQuest("quest_12e_02", "#L_Quest_12e_02a", "#L_Quest_12e_02b", QUEST_PROCESS);
  SedoySpeaker:Message("#L_Sedoy_01", 12, "UelCopy_Answer");
end;


--info:top=200,left=70,allvis=0;
function UelCopy_Answer()
  UelDSpeaker:Message("#L_Uel2_01", 3, "Hero_Go");
end;


--info:top=240,left=70,allvis=0;
function Hero_Go()
  HeroSpeaker:Message("#L_Hero_01", 4);
end;


--info:top=120,left=240,allvis=0;
function StartInitMission()
  InocoTeam = CreateTeam("Inoco");

  MothershipPilot = mothership:GetPilot();
  MothershipFlight = MothershipPilot:GetFlight();

  Player_Group = MothershipPilot:GetGroup();
  Inoco_Group = InocoTeam:CreateGroup("Inoco_Group");

  HeroSpeaker = GetPilot("Hero");
  SedoySpeaker = GetPilot("Sedoy");
  YanaSpeaker = GetPilot("Yana");
  UelDSpeaker = CreatePilot("Uel2");
  PatrolSpeaker = CreatePilot("InocoOfficer");

  NewInocoFlight("Inoco_Group", "ino1", PORTAL_R:GetPosition()+Vector3(20, 10, 40), 1, 15, Vector3(-0.33, 0, -0.67));

  ClearRoute();
  SetQuestLabel("__NoEject", "Cleric")
end;


--info:top=80,left=130,allvis=0;
function ACTION_INIT()
  SetQuestLabel("CurrentQuest","12e");
  StartInitMission();

  Timer_Seq(5, StartMission);
  return TRUE;
end;


--info:top=80,left=570,allvis=0;
function ACTION_LEAVELOCATION()
  QuestActionDone();

  return TRUE;
end;


--info:top=80,left=470,allvis=0;
function ACTION_FINI()

  return TRUE;
end;
