_SETTINGS:SetPlayerMenuOff()

local tanker=RECOVERYTANKER:New("USS Stennis", "Shell Group")
tanker:SetTakeoffAir()
tanker:SetRadio(129.300)
tanker:SetModex(511)
tanker:SetTACAN(44, "SHL")
tanker:__Start(1)

rescuehelo=RESCUEHELO:New("USS Stennis", "Rescue Helo")
rescuehelo:SetHomeBase(AIRBASE:FindByName("Lake Erie"))
rescuehelo:SetModex(42)
rescuehelo:__Start(1)
  
local airbossStennis=AIRBOSS:New("USS Stennis")

airbossStennis:AddRecoveryWindow("00:30", "01:00", 3, 0, true, 20, false)
airbossStennis:AddRecoveryWindow("01:30", "02:00", 3, 0, true, 20, false)
airbossStennis:AddRecoveryWindow("02:30", "03:00", 3, 0, true, 20, false)
airbossStennis:AddRecoveryWindow("03:30", "04:00", 3, 0, true, 20, false)
airbossStennis:AddRecoveryWindow("04:30", "05:00", 3, 0, true, 20, false)
airbossStennis:AddRecoveryWindow("05:30", "06:00", 3, 0, true, 20, false)
airbossStennis:AddRecoveryWindow("06:30", "07:00", 1, nil, true, 22, false)
airbossStennis:AddRecoveryWindow("07:30", "08:00", 1, nil, true, 22, false)
airbossStennis:AddRecoveryWindow("08:30", "09:00", 1, nil, true, 22, false)
airbossStennis:AddRecoveryWindow("09:30", "10:00", 1, nil, true, 22, false)
airbossStennis:AddRecoveryWindow("10:30", "11:00", 1, nil, true, 22, false)
airbossStennis:AddRecoveryWindow("11:30", "12:00", 1, nil, true, 22, false)
airbossStennis:AddRecoveryWindow("12:30", "13:00", 1, nil, true, 22, false)
airbossStennis:AddRecoveryWindow("13:30", "14:00", 1, nil, true, 22, false)
airbossStennis:AddRecoveryWindow("14:30", "15:00", 1, nil, true, 22, false)
airbossStennis:AddRecoveryWindow("15:30", "16:00", 1, nil, true, 22, false)
airbossStennis:AddRecoveryWindow("16:30", "17:00", 1, nil, true, 22, false)
airbossStennis:AddRecoveryWindow("17:30", "18:00", 1, nil, true, 22, false)
airbossStennis:AddRecoveryWindow("18:30", "19:00", 1, nil, true, 22, false)
airbossStennis:AddRecoveryWindow("19:30", "20:00", 3, 0, true, 20, false)
airbossStennis:AddRecoveryWindow("20:30", "21:00", 3, 0, true, 20, false)
airbossStennis:AddRecoveryWindow("21:30", "22:00", 3, 0, true, 20, false)
airbossStennis:AddRecoveryWindow("22:30", "23:00", 3, 0, true, 20, false)
airbossStennis:AddRecoveryWindow("23:30", "00:00+1", 3, 0, true, 20, false)

airbossStennis:SetSoundfilesFolder("Airboss Soundfiles/")
airbossStennis:SetDespawnOnEngineShutdown()

airbossStennis:SetMaxFlightsPerStack(1)
airbossStennis:SetMaxMarshalStacks(15)
airbossStennis:SetMaxSectionSize(4)
airbossStennis:SetLSORadio(140.200)
airbossStennis:SetMarshalRadio(127.200)
airbossStennis:SetICLS(11)
airbossStennis:SetTACAN(74,"X")
airbossStennis:SetHandleAIOFF()
airbossStennis:SetDefaultPlayerSkill(AIRBOSS.Difficulty.Normal)
airbossStennis:SetAirbossNiceGuy(true)
airbossStennis:SetEmergencyLandings(true)
airbossStennis:SetPatrolAdInfinitum(true)

airbossStennis:Start()

function tanker:OnAfterStart(From,Event,To)
  airbossStennis:SetRecoveryTanker(tanker)  
  airbossStennis:SetRadioRelayLSO(self:GetUnitName())
 
end

function rescuehelo:OnAfterStart(From,Event,To)
  airbossStennis:SetRadioRelayMarshal(self:GetUnitName())
end

-- --- Function called when a player gets graded by the LSO.
-- function AirbossStennis:OnAfterLSOGrade(From, Event, To, playerData, grade)
--   local PlayerData=playerData --Ops.Airboss#AIRBOSS.PlayerData
--   local Grade=grade --Ops.Airboss#AIRBOSS.LSOgrade

--   ----------------------------------------
--   --- Interface your Discord bot here! ---
--   ----------------------------------------
  
--   local score=tonumber(Grade.points)
--   local name=tostring(PlayerData.name)
  
--   -- Report LSO grade to dcs.log file.
--   env.info(string.format("Player %s scored %.1f", name, score))
-- end
