-- ***************************************************************************** -- ** AirBoss ** -- ********************************************************* function detectShitHotBreak(objAirboss) local clientData={} local player_name="" jtff_log.debug('detectShitHotBreak : '.. objAirboss.customconfig.alias .. ' has ' .. objAirboss.CVNClients:Count()..' clients in Set ...',"AIRBOSS") objAirboss.CVNClients:ForEachClientInZone( objAirboss.CVN_UNITZone, function( MooseClient ) local function resetFlag(userflag) --trigger.action.outText('RESET SH Pass FLAG)', 5 ) userflag:Set(0) end local player_velocity = MooseClient:GetVelocityKNOTS() local player_name = MooseClient:GetPlayerName() local player_type = MooseClient:GetTypeName() local player_fuel = MooseClient:GetFuel() local player_alt_feet = UTILS.MetersToFeet(MooseClient:GetAltitude()) --trigger.action.outText('ForEachClientInZone: MooseClient name is '..player_name , 5) local Play_SH_Sound = USERSOUND:New( soundFilesPrefix .. "AIRBOSS/Airboss Soundfiles/GreatBallsOfFire.ogg" ) --trigger.action.outText(player_name..' altitude is '..player_alt_feet..' feet', 5) --trigger.action.outText(player_name..' speed is '..player_velocity, 5) local client_in_zone_flag = USERFLAG:New(MooseClient:GetUCID()) local client_performing_sh = USERFLAG:New(MooseClient:GetUCID()..'_sh') if client_in_zone_flag:Get() == 0 and player_velocity > 475 and player_alt_feet < 700 then -- Requirements for Shit Hot break are velocity >475 knots and less than 700 feet trigger.action.outText(player_name..' performing a Sierra Hotel Break around ' .. objAirboss.customconfig.alias .. ' !', 10) local sh_message_to_discord = ('**'..player_name..' is performing a Sierra Hotel Break at '..UTILS.Round(player_velocity, 0)..' knots and '..player_alt_feet..' feet!**') FunkMan:SendTable({ command="moose_text", text=sh_message_to_discord, msg_type='lso' }) Play_SH_Sound:ToClient(MooseClient) client_in_zone_flag:Set(1) client_performing_sh:Set(1) timer.scheduleFunction(resetFlag, {client_in_zone_flag}, timer.getTime() + 5 * 60) else end --trigger.action.outText('ForEachClientInZone: Client name is '..player_name , 5) --trigger.action.outText('ForEachClientInZone: Client fuel is '..player_fuel , 5) end ) end function switchCarrierDefCon2(params) local carrierName = params[1] local timeMinutes = params[2] local cvUnit = UNIT:FindByName(carrierName) local cvGroup = cvUnit:GetGroup() cvGroup:OptionROE(ENUMS.ROE.WeaponFree):OptionAlarmStateRed() jtff_log.info(string.format("CSG : %s DEFCON 2 -> ROE = %d", carrierName, ENUMS.ROE.WeaponFree),"AIRBOSS") SCHEDULER:New( nil, function(carrierName) jtff_log.info(carrierName .. " switchback to DEFCON 4","AIRBOSS") jtff_log.info(string.format("CSG : %s DEFCON 4 -> ROE = %d", carrierName, ENUMS.ROE.ReturnFire),"AIRBOSS") UNIT:FindByName(carrierName):GetGroup():OptionROE(ENUMS.ROE.ReturnFire):OptionAlarmStateRed() end, { carrierName }, timeMinutes*60 ) end function forceCarrierDefCon4(params) local carrierName = params[1] local cvUnit = UNIT:FindByName(carrierName) local cvGroup = cvUnit:GetGroup() cvGroup:OptionROE(ENUMS.ROE.WeaponFree):OptionAlarmStateRed() end function getCaseTypeFromWeather(CVNCoordinates, recovery_start, recovery_stop) if (CVNCoordinates) then if ((timer.getAbsTime() >= (CVNCoordinates:GetSunset(true) - 30*60)) or (timer.getAbsTime() <= (CVNCoordinates:GetSunrise(true) + 30*60))) then --Navy Night conditions jtff_log.info("CASE III weather : Navy Night", "AIRBOSS") return 3 end if (recovery_stop) then if (recovery_stop > (CVNCoordinates:GetSunset(true) - 30*60)) then --recovery_stop after Navy SunSet jtff_log.info("CASE III weather : Recovery ending after Navy SunSet", "AIRBOSS") return 3 end end if (recovery_start) then if (recovery_start < (CVNCoordinates:GetSunrise(true) + 30*60)) then --recover_start before Navy SunRise jtff_log.info("CASE III weather : Recovery starting before Navy SunRise","AIRBOSS") return 3 end end end local weather = env.mission.weather local clouds = weather.clouds -- local static = weather.atmosphere_type == 0 local visibility = weather.visibility.distance -- local turbulence = weather.groundTurbulence local dust = nil if weather.enable_dust == true then dust = weather.dust_density end local fog = nil if weather.enable_fog == true then fog = weather.fog end -- jtff_log.trace(string.format("visibility : %i | cloud : base %i density %i | fog %i,%i | dust %i", visibility, clouds.base, clouds.density, fog.thickness, fog.visibility, dust),"AIRBOSS") local minVisibility = visibility if (weather.enable_fog and fog.thickness > 0) then minVisibility = math.min(minVisibility,fog.visibility) end if (weather.enable_dust) then minVisibility = math.min(minVisibility,dust) end if (minVisibility > UTILS.NMToMeters(5)) then if (clouds.base > UTILS.FeetToMeters(3000)) then jtff_log.debug("CASE I weather","AIRBOSS") return 1 elseif (clouds.base > UTILS.FeetToMeters(1000)) then jtff_log.debug("CASE II weather","AIRBOSS") return 2 else jtff_log.debug("CASE III weather","AIRBOSS") return 3 end else jtff_log.debug("CASE III weather","AIRBOSS") return 3 end end function startRecoveryOnDemand(objAirboss) local effectiveeventcase = getCaseTypeFromWeather( objAirboss:GetCoordinate(), UTILS.Round(timer.getAbsTime() + 5 *60,0), UTILS.Round(timer.getAbsTime() + ((objAirboss.customconfig.recoveryops.ondemand.recovery_duration_minutes or 30) * 60),0) ) if effectiveeventcase == 1 then objAirboss:MessageToMarshal('Good visibility : Case I', objAirboss.customconfig.alias, "", 45, false, 0) objAirboss:SetMaxSectionSize(4) elseif effectiveeventcase == 2 then objAirboss:MessageToMarshal('Bad visibility in altitude : Case II', objAirboss.customconfig.alias, "", 45, false, 0) objAirboss:SetMaxSectionSize(2) elseif effectiveeventcase == 3 then objAirboss:MessageToMarshal('Bad visibility : Case III', objAirboss.customconfig.alias, "", 45, false, 0) objAirboss:SetMaxSectionSize(1) else objAirboss:SetMaxSectionSize(1) end objAirboss:AddRecoveryWindow( UTILS.SecondsToClock(timer.getAbsTime() + 10 * 60, false, false), UTILS.SecondsToClock(timer.getAbsTime() + 10 * 60 + ((objAirboss.customconfig.recoveryops.ondemand.recovery_duration_minutes or 30) * 60),false, false), effectiveeventcase, objAirboss.customconfig.menurecovery.offset, true, objAirboss.customconfig.menurecovery.windondeck, objAirboss.customconfig.menurecovery.uturn ) end function wipeDeckLayout(objAirboss) local statObj = coalition.getStaticObjects(objAirboss:GetCoalition()) jtff_log.info(string.format("CSG : %s Wiping Deck Layout...", objAirboss.customconfig.alias),"AIRBOSS") for i, static in pairs(statObj) do local staticName = static:getName() if string.match(staticName, objAirboss.customconfig.alias .. "_Deck_Layout_.*") then jtff_log.debug(string.format("CSG : %s Deleting Static %s.", objAirboss.customconfig.alias, staticName),"AIRBOSS") static:destroy() end end jtff_log.info(string.format("CSG : %s Deck Layout is shining clean", objAirboss.customconfig.alias),"AIRBOSS") end function spawnDeckLayout_Zone(objAirboss, zoneName, layoutData) jtff_log.info(string.format("CSG : %s Deck Layout " .. zoneName .. " Spawning Layout...", objAirboss.customconfig.alias),"AIRBOSS") spawnStaticListWithUnitLink( layoutData, objAirboss.customconfig.alias .. "_Deck_Layout_" .. zoneName, objAirboss.carrier:GetID(), objAirboss.carrier:GetCountry() ) jtff_log.info(string.format("CSG : %s Deck Layout " .. zoneName .. " is up and ready.", objAirboss.customconfig.alias),"AIRBOSS") end function cleanDeckLayout(objAirboss) wipeDeckLayout(objAirboss) local lsoLayout = { { ["category"] = "Personnel", ["offsets"] = { ["y"] = -22.642253013093, ["angle"] = 9.4630780121514, ["x"] = -129.54834584263, }, -- end of ["offsets"] ["shape_name"] = "carrier_lso_usa", ["type"] = "Carrier LSO Personell", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = -21.045047881828, ["angle"] = 46.778217419792, ["x"] = -130.21820141007, }, -- end of ["offsets"] ["shape_name"] = "carrier_lso1_usa", ["type"] = "Carrier LSO Personell 1", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = -21.839557639788, ["angle"] = 9.3409049645118, ["x"] = -129.49332696254, }, -- end of ["offsets"] ["shape_name"] = "carrier_lso2_usa", ["type"] = "Carrier LSO Personell 2", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = -22.255108049524, ["angle"] = 46.673497664673, ["x"] = -130.45775733336, }, -- end of ["offsets"] ["shape_name"] = "carrier_lso3_usa", ["type"] = "Carrier LSO Personell 3", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = -20.754178989515, ["angle"] = 45.957912671355, ["x"] = -129.34298284226, }, -- end of ["offsets"] ["shape_name"] = "carrier_lso4_usa", ["type"] = "Carrier LSO Personell 4", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = -21.663772743992, ["angle"] = 46.778217419792, ["x"] = -130.12909556276, }, -- end of ["offsets"] ["shape_name"] = "carrier_lso5_usa", ["type"] = "Carrier LSO Personell 5", }, } spawnDeckLayout_Zone(objAirboss, "LSO", lsoLayout) local islandLayout = { { ["livery_id"] = "usn hsm-70", ["category"] = "Helicopters", ["offsets"] = { ["y"] = 19.24072690114, ["angle"] = 114.52850551587, ["x"] = -62.06548607626, }, -- end of ["offsets"] ["type"] = "S_70B_Seahawk", }, { ["livery_id"] = "usn hsc-9", ["category"] = "Helicopters", ["offsets"] = { ["y"] = 18.832155465242, ["angle"] = 114.54595880839, ["x"] = -58.356914646729, }, -- end of ["offsets"] ["type"] = "S_70B_Seahawk", }, { ["livery_id"] = "usn hsm-70", ["category"] = "Helicopters", ["offsets"] = { ["y"] = 18.463584036166, ["angle"] = 114.52850551587, ["x"] = -54.716914652369, }, -- end of ["offsets"] ["type"] = "S_70B_Seahawk", }, { ["livery_id"] = "usn hsc-9", ["category"] = "Helicopters", ["offsets"] = { ["y"] = 18.063584040064, ["angle"] = 114.54595880839, ["x"] = -51.002628938575, }, -- end of ["offsets"] ["type"] = "S_70B_Seahawk", }, { ["livery_id"] = "vaw-124_161781 - used", ["category"] = "Planes", ["offsets"] = { ["y"] = 14.988698327991, ["angle"] = 117.80972450962, ["x"] = -35.311371789741, }, -- end of ["offsets"] ["type"] = "E-2C", }, } spawnDeckLayout_Zone(objAirboss, "Island", islandLayout) local fingerLayout = { { ["category"] = "ADEquipment", ["offsets"] = { ["y"] = -33.184467034521, ["angle"] = 57.655506497452, ["x"] = -118.52125502295, }, -- end of ["offsets"] ["type"] = "CV_59_MD3", }, { ["category"] = "ADEquipment", ["offsets"] = { ["y"] = -28.268248410584, ["angle"] = 57.655506497452, ["x"] = -119.29494811179, }, -- end of ["offsets"] ["type"] = "CV_59_MD3", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = -26.53677632134, ["angle"] = 52.398177611214, ["x"] = -121.48120753936, }, -- end of ["offsets"] ["shape_name"] = "carrier_airboss_USA", ["type"] = "Carrier Airboss", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = -25.971342876553, ["angle"] = 53.515188332491, ["x"] = -120.90243392733, }, -- end of ["offsets"] ["shape_name"] = "carrier_tech_USA", ["type"] = "us carrier tech", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = -28.356878435401, ["angle"] = 55.993555870323, ["x"] = -117.49430504236, }, -- end of ["offsets"] ["shape_name"] = "carrier_tech_USA", ["type"] = "us carrier tech", }, } spawnDeckLayout_Zone(objAirboss, "Finger", fingerLayout) local junkyardLayout = { { ["livery_id"] = "VF-41 AJ100 1989 by Reflected", ["category"] = "Planes", ["offsets"] = { ["y"] = 23.868126250806, ["angle"] = 118.38568316278, ["x"] = -76.849637038031, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["category"] = "ADEquipment", ["offsets"] = { ["y"] = 17.139018329887, ["angle"] = 58.035591095156, ["x"] = -65.813777735393, }, -- end of ["offsets"] ["type"] = "AS32-31A", }, { ["category"] = "ADEquipment", ["offsets"] = { ["y"] = 24.120499629569, ["angle"] = 61.561156184185, ["x"] = -69.203061035979, }, -- end of ["offsets"] ["type"] = "CV_59_NS60", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = 17.879791797899, ["angle"] = 50.6353950667, ["x"] = -74.475258571736, }, -- end of ["offsets"] ["shape_name"] = "carrier_tech_USA", ["type"] = "us carrier tech", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = 25.619087114483, ["angle"] = 54.614745761248, ["x"] = -66.508616271609, }, -- end of ["offsets"] ["shape_name"] = "carrier_seaman_USA", ["type"] = "Carrier Seaman", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = 34.051254809191, ["angle"] = 53.968973938009, ["x"] = -81.499626394137, }, -- end of ["offsets"] ["shape_name"] = "carrier_seaman_USA", ["type"] = "Carrier Seaman", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = 17.570464910906, ["angle"] = 54.614745761248, ["x"] = -69.116627300857, }, -- end of ["offsets"] ["shape_name"] = "carrier_tech_USA", ["type"] = "us carrier tech", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = 17.633141928651, ["angle"] = 54.527479298648, ["x"] = -69.719469345642, }, -- end of ["offsets"] ["shape_name"] = "carrier_tech_USA", ["type"] = "us carrier tech", }, } spawnDeckLayout_Zone(objAirboss, "Junkyard", junkyardLayout) end function flexDeck3SpawnLayout(objAirboss) flexDeck7SpawnLayout(objAirboss) local elev2Layout = { { ["livery_id"] = "vaq-137 co 158805", ["category"] = "Planes", ["offsets"] = { ["y"] = 33.621846629802, ["angle"] = 4.7080880359424, ["x"] = -13.423541233483, }, -- end of ["offsets"] ["type"] = "EA_6B", }, { ["livery_id"] = "vfa-87", ["category"] = "Planes", ["offsets"] = { ["y"] = 32.375666919525, ["angle"] = 4.7080880359424, ["x"] = -25.647526329967, }, -- end of ["offsets"] ["type"] = "FA-18C_hornet", }, { ["livery_id"] = "vfa-87", ["category"] = "Planes", ["offsets"] = { ["y"] = 30.99658128452, ["angle"] = 1.5490420898326, ["x"] = -19.557373659788, }, -- end of ["offsets"] ["type"] = "FA-18C_hornet", }, } spawnDeckLayout_Zone(objAirboss, "Elev2", elev2Layout) local elev4Layout = { { ["livery_id"] = "jtff_vf-84_91_200", ["category"] = "Planes", ["offsets"] = { ["y"] = -34.152985378431, ["angle"] = 20.423745714676, ["x"] = -110.45527895631, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["livery_id"] = "jtff_vf-84_91_201", ["category"] = "Planes", ["offsets"] = { ["y"] = -33.777172440145, ["angle"] = 20.423745714676, ["x"] = -96.916883461044, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["livery_id"] = "jtff_vf-84_91_202", ["category"] = "Planes", ["offsets"] = { ["y"] = -29.525479966254, ["angle"] = 23.565338368266, ["x"] = -103.85620127214, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["category"] = "ADEquipment", ["offsets"] = { ["y"] = -25.86192061308, ["angle"] = 13.686774801978, ["x"] = -113.12563229675, }, -- end of ["offsets"] ["type"] = "AS32-p25", }, } spawnDeckLayout_Zone(objAirboss, "Elev4", elev4Layout) end function flexDeck7SpawnLayout(objAirboss) cleanDeckLayout(objAirboss) local pointLayout = { { ["category"] = "ADEquipment", ["offsets"] = { ["y"] = 28.099036062225, ["angle"] = 4.5335551107429, ["x"] = 73.682386210606, }, -- end of ["offsets"] ["type"] = "AS32-32A", }, { ["livery_id"] = "marines 06 cb 161352", ["category"] = "Planes", ["offsets"] = { ["y"] = 33.012193853945, ["angle"] = 4.7080880359424, ["x"] = 48.207851738378, }, -- end of ["offsets"] ["type"] = "EA_6B", }, { ["livery_id"] = "vaq-132 ae 605", ["category"] = "Planes", ["offsets"] = { ["y"] = 32.037151622558, ["angle"] = 4.2368491379039, ["x"] = 65.674634840866, }, -- end of ["offsets"] ["type"] = "EA_6B", }, { ["livery_id"] = "vaq-132 ae 604", ["category"] = "Planes", ["offsets"] = { ["y"] = 33.063487980478, ["angle"] = 4.7080880359424, ["x"] = 56.912418720699, }, -- end of ["offsets"] ["type"] = "EA_6B", }, { ["livery_id"] = "vaq-132 ae 605", ["category"] = "Planes", ["offsets"] = { ["y"] = 24.590838184328, ["angle"] = 4.0623162127045, ["x"] = 78.22761285087, }, -- end of ["offsets"] ["type"] = "EA_6B", }, } spawnDeckLayout_Zone(objAirboss, "Point", pointLayout) local cat1Layout = { { ["livery_id"] = "VFA-87", ["category"] = "Planes", ["offsets"] = { ["y"] = 10.075737706355, ["angle"] = 116.53563415567, ["x"] = 145.80306508157, }, -- end of ["offsets"] ["type"] = "FA-18C_hornet", }, { ["livery_id"] = "VFA-87", ["category"] = "Planes", ["offsets"] = { ["y"] = 10.541399489708, ["angle"] = 116.53563415567, ["x"] = 132.19996926151, }, -- end of ["offsets"] ["type"] = "FA-18C_hornet", }, { ["livery_id"] = "VFA-87", ["category"] = "Planes", ["offsets"] = { ["y"] = 10.98313938269, ["angle"] = 116.53563415567, ["x"] = 118.83733772334, }, -- end of ["offsets"] ["type"] = "FA-18C_hornet", }, { ["livery_id"] = "VFA-87", ["category"] = "Planes", ["offsets"] = { ["y"] = 12.59068314775, ["angle"] = 116.53563415567, ["x"] = 106.45353714522, }, -- end of ["offsets"] ["type"] = "FA-18C_hornet", }, { ["livery_id"] = "VFA-87", ["category"] = "Planes", ["offsets"] = { ["y"] = 14.419254583666, ["angle"] = 116.53563415567, ["x"] = 94.424965715345, }, -- end of ["offsets"] ["type"] = "FA-18C_hornet", }, { ["livery_id"] = "VFA-87", ["category"] = "Planes", ["offsets"] = { ["y"] = 18.643328055733, ["angle"] = 116.53563415567, ["x"] = 83.777230709954, }, -- end of ["offsets"] ["type"] = "FA-18C_hornet", }, } spawnDeckLayout_Zone(objAirboss, "Cat1", cat1Layout) local patioLayout = { { ["livery_id"] = "VF-41 AJ102 1981 base Reflected", ["category"] = "Planes", ["offsets"] = { ["y"] = 28.093555953897, ["angle"] = 118.10643048246, ["x"] = -116.21846377714, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["livery_id"] = "VF-41 AJ105 1989 by Reflected", ["category"] = "Planes", ["offsets"] = { ["y"] = 26.33823811991, ["angle"] = 118.50785621042, ["x"] = -125.6398759805, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["livery_id"] = "VF-41 AJ107 1981 base Reflected", ["category"] = "Planes", ["offsets"] = { ["y"] = 24.866259756495, ["angle"] = 118.90928193838, ["x"] = -137.27914171635, }, -- end of ["offsets"] ["type"] = "F-14B", }, } spawnDeckLayout_Zone(objAirboss, "Patio", patioLayout) local elev1Layout = { { ["livery_id"] = "VFA-87", ["category"] = "Planes", ["offsets"] = { ["y"] = 31.562717287402, ["angle"] = 117.80972450962, ["x"] = 35.545373177252, }, -- end of ["offsets"] ["type"] = "FA-18C_hornet", }, { ["livery_id"] = "VFA-87", ["category"] = "Planes", ["offsets"] = { ["y"] = 31.631930277644, ["angle"] = 117.80972450962, ["x"] = 26.732753925417, }, -- end of ["offsets"] ["type"] = "FA-18C_hornet", }, { ["livery_id"] = "VFA-87", ["category"] = "Planes", ["offsets"] = { ["y"] = 31.755826137288, ["angle"] = 117.80972450962, ["x"] = 17.845507060166, }, -- end of ["offsets"] ["type"] = "FA-18C_hornet", }, } spawnDeckLayout_Zone(objAirboss, "Elev1", elev1Layout) local coralLayout = { { ["livery_id"] = "usn vrc-40", ["category"] = "Planes", ["offsets"] = { ["y"] = 32.194100140318, ["angle"] = 4.6906347434224, ["x"] = 8.026960843163, }, -- end of ["offsets"] ["type"] = "C2A_Greyhound", }, { ["livery_id"] = "usaf - vs-24 - cag", ["category"] = "Planes", ["offsets"] = { ["y"] = 29.785585834077, ["angle"] = 4.6906347434224, ["x"] = -1.16631697175602, }, -- end of ["offsets"] ["type"] = "S-3B Tanker", }, } spawnDeckLayout_Zone(objAirboss, "Coral", coralLayout) end function launchDeck7SpawnLayout(objAirboss) flexDeck7SpawnLayout(objAirboss) local sternLayout = { { ["livery_id"] = "VF-41 AJ101 1981 base Reflected", ["category"] = "Planes", ["offsets"] = { ["y"] = 17.098132258261, ["angle"] = 18.957669143001, ["x"] = -152.05692527267, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["livery_id"] = "jtff_vf-84_91_205", ["category"] = "Planes", ["offsets"] = { ["y"] = 6.1548658818238, ["angle"] = 25.101228110021, ["x"] = -154.09653869538, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["livery_id"] = "VF-41 AJ103 1981 base Reflected", ["category"] = "Planes", ["offsets"] = { ["y"] = -4.3075244605538, ["angle"] = 25.066321524981, ["x"] = -155.52554595995, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["livery_id"] = "VF-41 AJ106 1981 base Reflected", ["category"] = "Planes", ["offsets"] = { ["y"] = -12.208173326793, ["angle"] = 19.25437511584, ["x"] = -150.18756952213, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["livery_id"] = "VF-41 AJ110 1981 base Reflected", ["category"] = "Planes", ["offsets"] = { ["y"] = -13.74494937795, ["angle"] = 19.044935605601, ["x"] = -133.97486609459, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["livery_id"] = "jtff_vf-84_91_203", ["category"] = "Planes", ["offsets"] = { ["y"] = -17.274425547057, ["angle"] = 19.27182840836, ["x"] = -119.46237855354, }, -- end of ["offsets"] ["type"] = "F-14B", }, } spawnDeckLayout_Zone(objAirboss, "Stern", sternLayout) end function launchDeck1SpawnLayout(objAirboss) flexDeck3SpawnLayout(objAirboss) local elev3Layout = { { ["livery_id"] = "jtff_vf-84_91_206", ["category"] = "Planes", ["offsets"] = { ["y"] = 33.021151110532, ["angle"] = 117.80972450962, ["x"] = -91.343728458666, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["livery_id"] = "JTFF_VF-84_commemorative_92_207", ["category"] = "Planes", ["offsets"] = { ["y"] = 32.929781304891, ["angle"] = 117.80972450962, ["x"] = -102.40483618017, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["category"] = "ADEquipment", ["offsets"] = { ["y"] = 29.92471616058, ["angle"] = 58.035591095156, ["x"] = -97.143110662258, }, -- end of ["offsets"] ["type"] = "AS32-31A", }, { ["category"] = "ADEquipment", ["offsets"] = { ["y"] = 24.313863322494, ["angle"] = 13.547148461818, ["x"] = -94.953329922951, }, -- end of ["offsets"] ["type"] = "AS32-p25", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = 30.933519971295, ["angle"] = 13.582055046858, ["x"] = -95.295382139387, }, -- end of ["offsets"] ["shape_name"] = "carrier_tech_USA", ["type"] = "us carrier tech", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = 24.943708100079, ["angle"] = 54.614745761248, ["x"] = -97.153104784033, }, -- end of ["offsets"] ["shape_name"] = "carrier_tech_USA", ["type"] = "us carrier tech", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = 24.411201211127, ["angle"] = 13.582055046858, ["x"] = -97.618770508055, }, -- end of ["offsets"] ["shape_name"] = "carrier_seaman_USA", ["type"] = "Carrier Seaman", }, { ["category"] = "Personnel", ["offsets"] = { ["y"] = 25.438348163322, ["angle"] = 16.11278246225, ["x"] = -100.66033122272, }, -- end of ["offsets"] ["shape_name"] = "carrier_tech_USA", ["type"] = "us carrier tech", }, } spawnDeckLayout_Zone(objAirboss, "Elev3", elev3Layout) local sternLayout = { { ["livery_id"] = "VF-41 AJ101 1981 base Reflected", ["category"] = "Planes", ["offsets"] = { ["y"] = 17.098132258261, ["angle"] = 18.957669143001, ["x"] = -152.05692527267, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["livery_id"] = "jtff_vf-84_91_205", ["category"] = "Planes", ["offsets"] = { ["y"] = 6.1548658818238, ["angle"] = 25.101228110021, ["x"] = -154.09653869538, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["livery_id"] = "VF-41 AJ103 1981 base Reflected", ["category"] = "Planes", ["offsets"] = { ["y"] = -4.3075244605538, ["angle"] = 25.066321524981, ["x"] = -155.52554595995, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["livery_id"] = "VF-41 AJ106 1981 base Reflected", ["category"] = "Planes", ["offsets"] = { ["y"] = -12.208173326793, ["angle"] = 19.25437511584, ["x"] = -150.18756952213, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["livery_id"] = "VF-41 AJ110 1981 base Reflected", ["category"] = "Planes", ["offsets"] = { ["y"] = -13.74494937795, ["angle"] = 19.044935605601, ["x"] = -133.97486609459, }, -- end of ["offsets"] ["type"] = "F-14B", }, { ["livery_id"] = "jtff_vf-84_91_203", ["category"] = "Planes", ["offsets"] = { ["y"] = -17.274425547057, ["angle"] = 19.27182840836, ["x"] = -119.46237855354, }, -- end of ["offsets"] ["type"] = "F-14B", }, } spawnDeckLayout_Zone(objAirboss, "Stern", sternLayout) end AIRBOSSArray = {} compteur = 0 MenuCoalitionCSGCommandsBlue = MENU_COALITION:New(coalition.side.BLUE, "CSG Commands", MenuCoalitionBlue) MenuCoalitionCSGCommandsRed = MENU_COALITION:New(coalition.side.RED, "CSG Commands", MenuCoalitionRed) for index, airbossconfig in ipairs(AirBossConfig) do if airbossconfig.enable == true then compteur = compteur +1 --populate_SC(airbossconfig.carriername) local MenuCoalitionCSGCommands = nil if airbossconfig.coalition == coalition.side.BLUE then MenuCoalitionCSGCommands = MenuCoalitionCSGCommandsBlue else MenuCoalitionCSGCommands = MenuCoalitionCSGCommandsRed end local objAirboss = AIRBOSS:New(airbossconfig.carriername, airbossconfig.alias) objAirboss:SetIntoWindLegacy(true) objAirboss.menuObject = MENU_COALITION:New( airbossconfig.coalition, airbossconfig.alias, MenuCoalitionCSGCommands ) MENU_COALITION_COMMAND:New( airbossconfig.coalition, "DEFCON 2 - 5 minutes", objAirboss.menuObject, switchCarrierDefCon2, { airbossconfig.carriername, 5 } ) MENU_COALITION_COMMAND:New( airbossconfig.coalition, "DEFCON 2 - 10 minutes", objAirboss.menuObject, switchCarrierDefCon2, { airbossconfig.carriername, 10 } ) MENU_COALITION_COMMAND:New( airbossconfig.coalition, "Release : DEFCON 4", objAirboss.menuObject, forceCarrierDefCon4, { airbossconfig.carriername } ) if ( (objAirboss.carriertype == AIRBOSS.CarrierType.ROOSEVELT) or (objAirboss.carriertype == AIRBOSS.CarrierType.LINCOLN) or (objAirboss.carriertype == AIRBOSS.CarrierType.WASHINGTON) or (objAirboss.carriertype == AIRBOSS.CarrierType.TRUMAN) ) then objAirboss.deckLayoutmenuObject = MENU_COALITION:New( airbossconfig.coalition, "Deck Layout", objAirboss.menuObject ) MENU_COALITION_COMMAND:New( airbossconfig.coalition, "DeckLayout : Clean Layout", objAirboss.deckLayoutmenuObject, cleanDeckLayout, objAirboss ) MENU_COALITION_COMMAND:New( airbossconfig.coalition, "DeckLayout : Flex 3 Spawns", objAirboss.deckLayoutmenuObject, flexDeck3SpawnLayout, objAirboss ) MENU_COALITION_COMMAND:New( airbossconfig.coalition, "DeckLayout : Flex 7 Spawns", objAirboss.deckLayoutmenuObject, flexDeck7SpawnLayout, objAirboss ) MENU_COALITION_COMMAND:New( airbossconfig.coalition, "DeckLayout : Launch 7 Spawns", objAirboss.deckLayoutmenuObject, launchDeck7SpawnLayout, objAirboss ) MENU_COALITION_COMMAND:New( airbossconfig.coalition, "DeckLayout : Launch 1 Spawn", objAirboss.deckLayoutmenuObject, launchDeck1SpawnLayout, objAirboss ) MENU_COALITION_COMMAND:New( airbossconfig.coalition, "DeckLayout : Wipe All", objAirboss.deckLayoutmenuObject, wipeDeckLayout, objAirboss ) end if (airbossconfig.recoveryops.mode == 'ondemand') then MENU_COALITION_COMMAND:New( airbossconfig.coalition, "OnDemand Recovery : will start turning in 5 minutes", objAirboss.menuObject, startRecoveryOnDemand, objAirboss ) end objAirboss:SetTACAN(airbossconfig.tacan.channel, airbossconfig.tacan.mode, airbossconfig.tacan.morse) objAirboss:SetICLS(airbossconfig.icls.channel, airbossconfig.icls.morse) if (airbossconfig.infinitepatrol) then objAirboss:SetPatrolAdInfinitum(true) end objAirboss:SetCarrierControlledArea(airbossconfig.controlarea) objAirboss:SetStaticWeather(true) objAirboss:SetRespawnAI(false) objAirboss:SetRecoveryCase(getCaseTypeFromWeather( objAirboss:GetCoordinate(), timer.getAbsTime(), timer.getAbsTime() + 60 )) objAirboss:SetEmergencyLandings(true) objAirboss:SetMaxLandingPattern(airbossconfig.maxpatterns) objAirboss:SetMaxSectionSize(4) objAirboss:SetMaxMarshalStacks(airbossconfig.maxstacks) objAirboss:SetDefaultPlayerSkill(airbossconfig.difficulty) -- other options EASY / HARD objAirboss:SetFunkManOn(FunkmanConfig.port, FunkmanConfig.ip) if airbossconfig.wirecorrection then objAirboss:SetMPWireCorrection(airbossconfig.wirecorrection) else objAirboss:SetMPWireCorrection() end if airbossconfig.operationsstatspath then objAirboss:Load(airbossconfig.operationsstatspath) if airbossconfig.operationsstatspath then objAirboss:SetTrapSheet(airbossconfig.operationstrapsheetpath) end --objAirboss:SetAutoSave(airbossconfig.operationsstatspath) end if airbossconfig.handleAI == true then objAirboss:SetHandleAION() objAirboss:SetDespawnOnEngineShutdown(true) else objAirboss:SetHandleAIOFF() end if airbossconfig.recoverytanker then for index,value in pairs(tankersArray) do if ((value.customconfig.airboss_recovery == true) and (value.customconfig.groupName == airbossconfig.recoverytanker))then objAirboss:SetRecoveryTanker(tankersArray[index]) objAirboss:MessageToMarshal('Recovery Tanker Setup : '..airbossconfig.recoverytanker, airbossconfig.alias, "", 30, false, 0) break end end end if airbossconfig.menurecovery.enable == true then objAirboss:SetMenuRecovery(airbossconfig.menurecovery.duration, airbossconfig.menurecovery.windondeck, airbossconfig.menurecovery.uturn, airbossconfig.menurecovery.offset) end objAirboss:SetMenuMarkZones(airbossconfig.enable_menumarkzones) objAirboss:SetMenuSmokeZones(airbossconfig.enable_menusmokezones) objAirboss:SetAirbossNiceGuy(airbossconfig.enable_niceguy) if ( type(airbossconfig.srs) ~= nil ) then if ( airbossconfig.srs.useSRS == true) then objAirboss:EnableSRS(SRSConfig.path, SRSConfig.port, 'en-US') else objAirboss:SetSoundfilesFolder(soundFilesPrefix .. "AIRBOSS/Airboss Soundfiles/") if airbossconfig.voices.marshall then if airbossconfig.voices.marshall == "Raynor" then objAirboss:SetVoiceOversMarshalByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal Raynor/') elseif airbossconfig.voices.marshall == "Gabriella" then objAirboss:SetVoiceOversMarshalByGabriella(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal Gabriella/') elseif airbossconfig.voices.marshall == "FF" then objAirboss:SetVoiceOversMarshalByFF(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal FF/') end else objAirboss:SetVoiceOversMarshalByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal Raynor/') end if airbossconfig.voices.lso then if airbossconfig.voices.lso == "Raynor" then objAirboss:SetVoiceOversLSOByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack LSO Raynor/') elseif airbossconfig.voices.lso == "FF" then objAirboss:SetVoiceOversLSOByFF(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack LSO FF/') end else objAirboss:SetVoiceOversLSOByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack LSO Raynor/') end end else objAirboss:SetSoundfilesFolder(soundFilesPrefix .. "AIRBOSS/Airboss Soundfiles/") if airbossconfig.voices.marshall then if airbossconfig.voices.marshall == "Raynor" then objAirboss:SetVoiceOversMarshalByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal Raynor/') elseif airbossconfig.voices.marshall == "Gabriella" then objAirboss:SetVoiceOversMarshalByGabriella(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal Gabriella/') elseif airbossconfig.voices.marshall == "FF" then objAirboss:SetVoiceOversMarshalByFF(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal FF/') end else objAirboss:SetVoiceOversMarshalByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal Raynor/') end if airbossconfig.voices.lso then if airbossconfig.voices.lso == "Raynor" then objAirboss:SetVoiceOversLSOByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack LSO Raynor/') elseif airbossconfig.voices.lso == "FF" then objAirboss:SetVoiceOversLSOByFF(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack LSO FF/') end else objAirboss:SetVoiceOversLSOByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack LSO Raynor/') end end objAirboss:SetLSORadio(airbossconfig.freq.lso, radio.modulation.AM, airbossconfig.voices.lso) objAirboss:SetMarshalRadio(airbossconfig.freq.marshall, radio.modulation.AM, airbossconfig.voices.marshall) objAirboss:SetAirbossRadio(airbossconfig.freq.base, radio.modulation.AM, airbossconfig.voices.airboss) objAirboss:SetRadioRelayMarshal(airbossconfig.releayunit.marshall) objAirboss:SetRadioRelayLSO(airbossconfig.releayunit.lso) objAirboss:SetDebugModeOFF() objAirboss.trapsheet = false if airbossconfig.singlecarrier == true then objAirboss:SetMenuSingleCarrier() end if (airbossconfig.recoveryops.mode == 'cyclic') then if not(airbossconfig.recoveryops.cyclic.event_duration_minutes) then airbossconfig.recoveryops.cyclic.event_duration_minutes = 60 end end if (airbossconfig.dl4) then local cvUnit = UNIT:FindByName(airbossconfig.carriername) cvUnit:SetCommand( { id = "ActivateLink4", params = { ["unitId"] = cvUnit:GetID(), ["frequency"] = airbossconfig.dl4.freq * 1000000 }, } ) cvUnit:SetCommand( { id = "ActivateACLS", params = { ["unitId"] = cvUnit:GetID(), }, } ) end objAirboss.customconfig = airbossconfig if ( (objAirboss.carriertype == AIRBOSS.CarrierType.LINCOLN) or (objAirboss.carriertype == AIRBOSS.CarrierType.ROOSEVELT) or (objAirboss.carriertype == AIRBOSS.CarrierType.TRUMAN) or (objAirboss.carriertype == AIRBOSS.CarrierType.WASHINGTON) ) then jtff_log.info(string.format("CSG : %s is Supercarrier apply Deck Layout...", objAirboss.customconfig.alias),"AIRBOSS") flexDeck7SpawnLayout(objAirboss) else jtff_log.info(string.format("CSG : %s is not Supercarrier (%s) skipping Deck Layout...", objAirboss.customconfig.alias, objAirboss.carriertype),"AIRBOSS") end function objAirboss:OnAfterLSOGrade(From, Event, To, playerData, myGrade) local string_grade = myGrade.grade local player_callsign = playerData.callsign local unit_name = playerData.unitname local player_name = playerData.name local player_wire = playerData.wire player_name = player_name:gsub('[%p]', '') local client_performing_sh = USERFLAG:New(UNIT:FindByName(unit_name):GetClient():GetUCID()..'_sh') --local gradeForFile if string_grade == "_OK_" then --if string_grade == "_OK_" and player_wire == "3" and player_Tgroove >=15 and player_Tgroove <19 then timer.scheduleFunction( function() --trigger.action.outSound("AIRBOSS/Airboss Soundfiles/ffyrtp.ogg") end, {}, timer.getTime() + 5 ) if client_performing_sh:Get() == 1 then myGrade.grade = "_OK_" myGrade.points = myGrade.points + 1.00 client_performing_sh:Set(0) self:SetTrapSheet(self.trappath, "SH_unicorn_AIRBOSS-trapsheet-"..player_name) else self:SetTrapSheet(self.trappath, "unicorn_AIRBOSS-trapsheet-"..player_name) end timer.scheduleFunction( function() --trigger.action.outSound("AIRBOSS/Airboss Soundfiles/sureshot.ogg") end, {}, timer.getTime() + 5 ) elseif string_grade == "OK" and player_wire >1 then if client_performing_sh:Get() == 1 then myGrade.grade = "OK" myGrade.points = myGrade.points + 1.00 client_performing_sh:Set(0) self:SetTrapSheet(self.trappath, "SH_AIRBOSS-trapsheet-"..player_name) else self:SetTrapSheet(self.trappath, "AIRBOSS-trapsheet-"..player_name) end elseif string_grade == "(OK)" and player_wire >1 then self:SetTrapSheet(self.trappath, "AIRBOSS-trapsheet-"..player_name) if client_performing_sh:Get() == 1 then myGrade.grade = "(OK)" myGrade.points = myGrade.points + 1.00 client_performing_sh:Set(0) self:SetTrapSheet(self.trappath, "SH_AIRBOSS-trapsheet-"..player_name) else self:SetTrapSheet(self.trappath, "AIRBOSS-trapsheet-"..player_name) end elseif string_grade == "--" and player_wire >1 then if client_performing_sh:Get() == 1 then myGrade.grade = "--" myGrade.points = myGrade.points + 1.00 client_performing_sh:Set(0) self:SetTrapSheet(self.trappath, "SH_AIRBOSS-trapsheet-"..player_name) else self:SetTrapSheet(self.trappath, "AIRBOSS-trapsheet-"..player_name) end else self:SetTrapSheet(self.trappath, "AIRBOSS-trapsheet-"..player_name) end myGrade.messageType = 2 myGrade.callsign = playerData.callsign myGrade.name = playerData.name myGrade.airbossconfig = self.customconfig if playerData.wire == 1 then myGrade.points = myGrade.points -1.00 local onewire_to_discord = ('**'..player_name..' almost had a rampstrike with that 1-wire!**') FunkMan:SendTable({ command="moose_text", text=onewire_to_discord, msg_type='lso' }) timer.scheduleFunction( function() --trigger.action.outSound("AIRBOSS/Airboss Soundfiles/GetYourButtsUptoVipersOffice.ogg") end, {}, timer.getTime() + 5 ) end self:_SaveTrapSheet(playerData, myGrade) --if self.funkmanSocket then -- -- -- Extract used info for FunkMan. We need to be careful with the amount of data send via UDP socket. -- local trapsheet={} ; trapsheet.X={} ; trapsheet.Z={} ; trapsheet.AoA={} ; trapsheet.Alt={} -- -- -- Loop over trapsheet and extract used values. -- for i = 1, #playerData.trapsheet do -- local ts=playerData.trapsheet[i] --#AIRBOSS.GrooveData -- table.insert(trapsheet.X, UTILS.Round(ts.X, 1)) -- table.insert(trapsheet.Z, UTILS.Round(ts.Z, 1)) -- table.insert(trapsheet.AoA, UTILS.Round(ts.AoA, 2)) -- table.insert(trapsheet.Alt, UTILS.Round(ts.Alt, 1)) -- end -- -- local result={} -- result.command=SOCKET.DataType.LSOGRADE -- result.name=playerData.name -- result.trapsheet=trapsheet -- result.airframe=myGrade.airframe -- result.modex=myGrade.modex -- result.mitime=myGrade.mitime -- result.midate=myGrade.midate -- result.wind=myGrade.wind -- result.carriertype=myGrade.carriertype -- result.carriername=myGrade.carriername -- result.carrierrwy=myGrade.carrierrwy -- result.landingdist=self.carrierparam.landingdist -- result.theatre=myGrade.theatre -- result.case=playerData.case -- result.Tgroove=myGrade.Tgroove -- result.wire=myGrade.wire -- result.grade=myGrade.grade -- result.points=myGrade.points -- result.details=myGrade.details -- result.finalscore=myGrade.finalscore or myGrade.points -- -- -- Debug info. -- self:T(self.lid.."Result onafterLSOGrade") -- self:T(result) -- -- -- Send result. -- self.funkmanSocket:SendTable(result) --end --TODO reactivate the timer.schedule maybe ? --timer.scheduleFunction( -- function(airbossObject) -- airbossObject:SetTrapSheet(airbossObject.trappath) -- end, -- {self}, -- timer.getTime() + 10 --) --local myScheduleTime = TIMER:New(10, nil,nil):resetTrapSheetFileFormat() end function objAirboss:OnAfterRecoveryStart(From, Event, To, Case, Offset) self:MessageToMarshal('Recovery started Case '..Case..'...', self.customconfig.alias, "", 30, false, 10) end function objAirboss:OnAfterRecoveryStop(From, Event, To) self:MessageToMarshal('Recovery finished.', self.customconfig.alias, "", 30, false, 10) if (airbossconfig.recoveryops.mode == 'cyclic') then if self.recoverywindow then if ((timer.getAbsTime() + UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*1/3, 0) > self.recoverywindow.STOP) or (timer.getAbsTime() + UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*3/3, 0) < self.recoverywindow.START)) then self:SetRecoveryCase(getCaseTypeFromWeather( self:GetCoordinate(), timer.getAbsTime() + UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*1/3, 0), timer.getAbsTime() + UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*3/3, 0) )) if self.defaultcase == 1 then self:SetMaxSectionSize(4) elseif self.defaultcase == 2 then self:SetMaxSectionSize(2) elseif self.defaultcase == 3 then self:SetMaxSectionSize(1) else self:SetMaxSectionSize(1) end self:AddRecoveryWindow( UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*1/3, 0), UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*3/3, 0), self.defaultcase, self.customconfig.menurecovery.offset, true, self.customconfig.menurecovery.windondeck, self.customconfig.menurecovery.uturn ) self:MessageToMarshal('Next Recovery in : '..UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes/3, 0)..' minutes', self.customconfig.alias, "", 30, false, 0) --LeaveRecovery(self) end else self:SetRecoveryCase(getCaseTypeFromWeather( self:GetCoordinate(), timer.getAbsTime() + UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*1/3, 0), timer.getAbsTime() + UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*3/3, 0) )) if self.defaultcase == 1 then self:MessageToMarshal('Good visibility : Case I', self.customconfig.alias, "", 45, false, 0) self:SetMaxSectionSize(4) elseif self.defaultcase == 2 then self:MessageToMarshal('Bad visibility in altitude : Case II', self.customconfig.alias, "", 45, false, 0) self:SetMaxSectionSize(2) elseif self.defaultcase == 3 then self:MessageToMarshal('Bad visibility : Case III', self.customconfig.alias, "", 45, false, 0) self:SetMaxSectionSize(1) else self:SetMaxSectionSize(1) end self:AddRecoveryWindow( UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*1/3, 0), UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*3/3, 0), self.defaultcase, self.customconfig.menurecovery.offset, true, self.customconfig.menurecovery.windondeck, self.customconfig.menurecovery.uturn ) self:MessageToMarshal('Next Recovery in : '..UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes/3, 0)..' minutes', self.customconfig.alias, "", 30, false, 0) --LeaveRecovery(self) end end end AIRBOSSArray[compteur] = objAirboss AIRBOSSArray[compteur]:Start() AIRBOSSArray[compteur].CVN_UNITZone = ZONE_UNIT:New( 'cvnUnitZone-'..AIRBOSSArray[compteur].customconfig.alias, AIRBOSSArray[compteur].carrier, 1111) AIRBOSSArray[compteur].CVNClients = SET_CLIENT:New() :FilterActive() :FilterCoalitions(string.lower(UTILS.GetCoalitionName(objAirboss.customconfig.coalition))) :FilterStart() local myscheduler local myschedulerID myscheduler, myschedulerID = SCHEDULER:New( nil, detectShitHotBreak, {AIRBOSSArray[compteur]}, 2, 1 ) AIRBOSSArray[compteur].scheduler = myscheduler AIRBOSSArray[compteur].schedulerID = myschedulerID --trigger.action.outText('INFO '..airbossconfig.alias..' : Naval sunset at '..UTILS.SecondsToClock((AIRBOSSArray[compteur]:GetCoordinate():GetSunset(true) - 30*60)), 75) if (airbossconfig.recoveryops.mode == 'cyclic') then AIRBOSSArray[compteur]:SetRecoveryCase(getCaseTypeFromWeather( AIRBOSSArray[compteur]:GetCoordinate(), timer.getAbsTime() + (airbossconfig.recoveryops.cyclic.event_ia_reserved_minutes)*60+UTILS.Round(airbossconfig.recoveryops.cyclic.event_duration_minutes*60*0/3, 0), timer.getAbsTime() + (airbossconfig.recoveryops.cyclic.event_ia_reserved_minutes)*60+UTILS.Round(airbossconfig.recoveryops.cyclic.event_duration_minutes*60*2/3, 0) )) if AIRBOSSArray[compteur].defaultcase == 1 then AIRBOSSArray[compteur]:MessageToMarshal('Good visibility : Case I', AIRBOSSArray[compteur].customconfig.alias, "", 45, false, 0) AIRBOSSArray[compteur]:SetMaxSectionSize(4) elseif AIRBOSSArray[compteur].defaultcase == 2 then AIRBOSSArray[compteur]:MessageToMarshal('Bad visibility in altitude : Case II', AIRBOSSArray[compteur].customconfig.alias, "", 45, false, 0) AIRBOSSArray[compteur]:SetMaxSectionSize(2) elseif AIRBOSSArray[compteur].defaultcase == 3 then AIRBOSSArray[compteur]:MessageToMarshal('Bad visibility : Case III', AIRBOSSArray[compteur].customconfig.alias, "", 45, false, 0) AIRBOSSArray[compteur]:SetMaxSectionSize(1) else AIRBOSSArray[compteur]:SetMaxSectionSize(1) end if airbossconfig.recoveryops.cyclic.event_ia_reserved_minutes then AIRBOSSArray[compteur]:AddRecoveryWindow( (airbossconfig.recoveryops.cyclic.event_ia_reserved_minutes)*60+UTILS.Round(airbossconfig.recoveryops.cyclic.event_duration_minutes*60*0/3, 0), (airbossconfig.recoveryops.cyclic.event_ia_reserved_minutes)*60+UTILS.Round(airbossconfig.recoveryops.cyclic.event_duration_minutes*60*2/3, 0), AIRBOSSArray[compteur].defaultcase, airbossconfig.menurecovery.offset, true, airbossconfig.menurecovery.windondeck, airbossconfig.menurecovery.uturn ) else AIRBOSSArray[compteur]:AddRecoveryWindow( 15*60+UTILS.Round(airbossconfig.recoveryops.cyclic.event_duration_minutes*60*0/3, 0), 15*60+UTILS.Round(airbossconfig.recoveryops.cyclic.event_duration_minutes*60*2/3, 0), AIRBOSSArray[compteur].defaultcase, airbossconfig.menurecovery.offset, true, airbossconfig.menurecovery.windondeck, airbossconfig.menurecovery.uturn ) end else if (airbossconfig.recoveryops.mode == 'alpha') then if (airbossconfig.recoveryops.alpha) then if (airbossconfig.recoveryops.alpha.recoveries) then for alphaindex, alphaevent in ipairs(airbossconfig.recoveryops.alpha.recoveries) do AIRBOSSArray[compteur]:SetRecoveryCase(getCaseTypeFromWeather( AIRBOSSArray[compteur]:GetCoordinate(), UTILS.Round(env.mission.start_time + (alphaevent.recovery_start_minutes * 60) ,0), UTILS.Round(env.mission.start_time + (( alphaevent.recovery_start_minutes + alphaevent.recovery_duration_minutes ) * 60),0) )) if AIRBOSSArray[compteur].defaultcase == 1 then AIRBOSSArray[compteur]:MessageToMarshal('Good visibility : Case I', AIRBOSSArray[compteur].customconfig.alias, "", 45, false, 0) AIRBOSSArray[compteur]:SetMaxSectionSize(4) elseif AIRBOSSArray[compteur].defaultcase == 2 then AIRBOSSArray[compteur]:MessageToMarshal('Bad visibility in altitude : Case II', AIRBOSSArray[compteur].customconfig.alias, "", 45, false, 0) AIRBOSSArray[compteur]:SetMaxSectionSize(2) elseif AIRBOSSArray[compteur].defaultcase == 3 then AIRBOSSArray[compteur]:MessageToMarshal('Bad visibility : Case III', AIRBOSSArray[compteur].customconfig.alias, "", 45, false, 0) AIRBOSSArray[compteur]:SetMaxSectionSize(1) else AIRBOSSArray[compteur]:SetMaxSectionSize(1) end AIRBOSSArray[compteur]:AddRecoveryWindow( UTILS.SecondsToClock(env.mission.start_time + (alphaevent.recovery_start_minutes * 60) ), UTILS.SecondsToClock(env.mission.start_time + ( (alphaevent.recovery_start_minutes + alphaevent.recovery_duration_minutes) * 60)), AIRBOSSArray[compteur].defaultcase, airbossconfig.menurecovery.offset, true, airbossconfig.menurecovery.windondeck, airbossconfig.menurecovery.uturn ) end end end else if (airbossconfig.recoveryops.mode == 'ondemand') then end end end trigger.action.outText('AIRBOSS scripts Loaded for unit '..airbossconfig.carriername, 10) timer.scheduleFunction(function() trigger.action.outText( "<< If the AIRBOSS option does not appear in your F10 - Other Menu, try switching slots a few times and you will get the AIRBOSS message popups! Check the AIRBOSS documentation (link in briefing for more info) >>", 30) end, nil, timer.getTime() + 30 ) else timer.scheduleFunction(function() trigger.action.outText('AIRBOSS script disabled for unit '..airbossconfig.carriername, 10) end, nil, timer.getTime() + 8 ) end end