@jtff/miztemplate-lib 2.2.0 → 3.0.0-rc10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/index.js +4 -3
  2. package/lib/jtff-lib-ci.js +4 -308
  3. package/lib/mizlib.js +321 -0
  4. package/lua/lib/Hercules_Cargo.lua +686 -0
  5. package/lua/lib/Moose_.lua +117314 -0
  6. package/lua/lib/Splash_Damage_2_0.lua +472 -0
  7. package/lua/lib/gemman.lua +1 -0
  8. package/lua/lib/mist_4_5_107.lua +9084 -0
  9. package/lua/lib/skynet-iads-compiled.lua +3864 -0
  10. package/lua/settings/settings-RAT.lua +235 -0
  11. package/lua/settings/settings-airboss.lua +142 -0
  12. package/lua/settings/settings-atis.lua +31 -0
  13. package/lua/settings/settings-awacs.lua +58 -0
  14. package/lua/settings/settings-awacsondemand.lua +26 -0
  15. package/lua/settings/settings-beacons.lua +10 -0
  16. package/lua/settings/settings-capwarzone.lua +164 -0
  17. package/lua/settings/settings-capzone.lua +32 -0
  18. package/lua/settings/settings-fac_ranges.lua +17 -0
  19. package/lua/settings/settings-foxzone.lua +14 -0
  20. package/lua/settings/settings-gemman.lua +6 -0
  21. package/lua/settings/settings-global.lua +31 -0
  22. package/lua/settings/settings-intercept.lua +23 -0
  23. package/lua/settings/settings-logistics.lua +22 -0
  24. package/lua/settings/settings-ondemandawacs.lua +29 -0
  25. package/lua/settings/settings-ondemandtankers.lua +29 -0
  26. package/lua/settings/settings-pedros.lua +11 -0
  27. package/lua/settings/settings-ranges.lua +28 -0
  28. package/lua/settings/settings-reapers.lua +25 -0
  29. package/lua/settings/settings-sams.lua +19 -0
  30. package/lua/settings/settings-skynet.lua +239 -0
  31. package/lua/settings/settings-tankers.lua +32 -0
  32. package/lua/settings/settings-training_ranges.lua +37 -0
  33. package/lua/src/010-root_menus.lua +5 -0
  34. package/lua/src/020-mission_functions.lua +1059 -0
  35. package/lua/src/110-set_clients.lua +61 -0
  36. package/lua/src/120-tankers.lua +589 -0
  37. package/lua/src/130-airboss.lua +621 -0
  38. package/lua/src/135-pedro.lua +21 -0
  39. package/lua/src/140-beacons.lua +19 -0
  40. package/lua/src/150-awacs.lua +599 -0
  41. package/lua/src/160-atis.lua +53 -0
  42. package/lua/src/170-cap_zone_training.lua +127 -0
  43. package/lua/src/172-cap_zone_war.lua +190 -0
  44. package/lua/src/173-fox_zone_training.lua +87 -0
  45. package/lua/src/176-random_air_traffic.lua +73 -0
  46. package/lua/src/178-training-intercept.lua +263 -0
  47. package/lua/src/180-logistics.lua +80 -0
  48. package/lua/src/190-ranges.lua +54 -0
  49. package/lua/src/191-sams.lua +49 -0
  50. package/lua/src/193-training_ranges.lua +191 -0
  51. package/lua/src/195-reaper-ondemand.lua +522 -0
  52. package/lua/src/196-fac_ranges.lua +34 -0
  53. package/lua/src/199-skynet.lua +721 -0
  54. package/lua/src/200-mission.lua +3 -0
  55. package/package.json +4 -3
  56. package/resources/radios/.gitkeep +0 -0
  57. package/resources/sounds/CTLD/beacon.ogg +0 -0
  58. package/resources/sounds/CTLD/beaconsilent.ogg +0 -0
  59. package/resources/sounds/Misc/.gitkeep +0 -0
  60. package/resources/sounds/Misc/2_Bips.ogg +0 -0
  61. package/resources/sounds/Misc/Bip.ogg +0 -0
  62. package/resources/sounds/Misc/crash_wood.ogg +0 -0
  63. package/scripts/build.js +1 -1
  64. package/scripts/inject-scripts.js +124 -228
  65. package/scripts/template-update.js +1 -1
@@ -0,0 +1,621 @@
1
+ -- *****************************************************************************
2
+ -- ** AirBoss **
3
+ -- *********************************************************
4
+ function detectShitHotBreak(objAirboss)
5
+ local clientData={}
6
+ local player_name=""
7
+ --env.info('detectShitHotBreak : '.. objAirboss.customconfig.alias..' suspense ...')
8
+ objAirboss.CVNClients:ForEachClientInZone( objAirboss.CVN_GROUPZone,
9
+ function( MooseClient )
10
+
11
+ local function resetFlag()
12
+ --trigger.action.outText('RESET SH Pass FLAG)', 5 )
13
+ client_in_zone_flag:Set(0)
14
+ end
15
+
16
+ local player_velocity = MooseClient:GetVelocityKNOTS()
17
+ local player_name = MooseClient:GetPlayerName()
18
+ local player_alt = MooseClient:GetAltitude()
19
+ local player_type = MooseClient:GetTypeName()
20
+
21
+ local player_alt_feet = math.floor((player_alt * ( 3.28 / 10)))*10
22
+
23
+ local player_velocity_round = math.floor((player_velocity/10))*10
24
+
25
+ local Play_SH_Sound = USERSOUND:New( soundFilesPrefix .. "AIRBOSS/Airboss Soundfiles/GreatBallsOfFire.ogg" )
26
+ --trigger.action.outText(player_name..' altitude is '..player_alt, 5)
27
+ --trigger.action.outText(player_name..' speed is '..player_velocity, 5)
28
+ if client_in_zone_flag == nil then
29
+ client_in_zone_flag = USERFLAG:New(MooseClient:GetClientGroupID() + 10000000)
30
+ else
31
+ end
32
+
33
+ if client_performing_sh == nil then
34
+ client_performing_sh = USERFLAG:New(MooseClient:GetClientGroupID() + 100000000)
35
+ else
36
+ end
37
+
38
+ if client_in_zone_flag:Get() == 0 and player_velocity > 475 and player_alt < 213 then
39
+ -- Requirements for Shit Hot break are velocity >475 knots and less than 213 meters (700')
40
+ --trigger.action.outText(player_name..' performing a Sierra Hotel Break!', 10)
41
+ local sh_message_to_discord = ('**'..player_name..' is performing a Sierra Hotel Break at '..player_velocity_round..' knots and '..player_alt_feet..' feet!**')
42
+ GemMan:SendTable({
43
+ command="moose_text",
44
+ text=sh_message_to_discord,
45
+ msg_type='lso'
46
+ })
47
+ Play_SH_Sound:ToAll()
48
+ client_in_zone_flag:Set(1)
49
+ client_performing_sh:Set(1)
50
+ timer.scheduleFunction(resetFlag, {}, timer.getTime() + 10)
51
+ else
52
+ end
53
+
54
+ --trigger.action.outText('ForEachClientInZone: Client name is '..clientData.clientName , 5)
55
+ --trigger.action.outText('ForEachClientInZone: Client fuel1 is '..clientData.clientFuel1 , 5)
56
+
57
+ end
58
+ )
59
+ end
60
+
61
+ function switchCarrierDefCon2(params)
62
+ local carrierName = params[1]
63
+ local timeMinutes = params[2]
64
+ local cvUnit = UNIT:FindByName(carrierName)
65
+ local cvGroup = cvUnit:GetGroup()
66
+ cvGroup:OptionROE(ENUMS.ROE.WeaponFree):OptionAlarmStateRed()
67
+ debug_msg(string.format("CSG : %s DEFCON 2 -> ROE = %d", carrierName, ENUMS.ROE.WeaponFree))
68
+ SCHEDULER:New(
69
+ nil,
70
+ function(carrierName)
71
+ debug_squeduler_msg(carrierName .. " switchback to DEFCON 4")
72
+ debug_msg(string.format("CSG : %s DEFCON 4 -> ROE = %d", carrierName, ENUMS.ROE.ReturnFire))
73
+ UNIT:FindByName(carrierName):GetGroup():OptionROE(ENUMS.ROE.ReturnFire):OptionAlarmStateRed()
74
+ end,
75
+ { carrierName },
76
+ timeMinutes*60
77
+ )
78
+ end
79
+
80
+ function forceCarrierDefCon4(params)
81
+ local carrierName = params[1]
82
+ local cvUnit = UNIT:FindByName(carrierName)
83
+ local cvGroup = cvUnit:GetGroup()
84
+ cvGroup:OptionROE(ENUMS.ROE.WeaponFree):OptionAlarmStateRed()
85
+ end
86
+
87
+ function getCaseTypeFromWeather(CVNCoordinates, recovery_start, recovery_stop)
88
+ if (CVNCoordinates) then
89
+ if ((timer.getAbsTime() >= (CVNCoordinates:GetSunset(true) - 30*60)) or (timer.getAbsTime() <= (CVNCoordinates:GetSunrise(true) + 30*60))) then
90
+ --Navy Night conditions
91
+ debug_msg("CASE III weather : Navy Night")
92
+ return 3
93
+ end
94
+ if (recovery_stop) then
95
+ if (recovery_stop > (CVNCoordinates:GetSunset(true) - 30*60)) then
96
+ --recovery_stop after Navy SunSet
97
+ debug_msg("CASE III weather : Recovery ending after Navy SunSet")
98
+ return 3
99
+ end
100
+ end
101
+ if (recovery_start) then
102
+ if (recovery_start < (CVNCoordinates:GetSunrise(true) + 30*60)) then
103
+ --recover_start before Navy SunRise
104
+ debug_msg("CASE III weather : Recovery starting before Navy SunRise")
105
+ return 3
106
+ end
107
+ end
108
+ end
109
+ local weather = env.mission.weather
110
+ local clouds = weather.clouds
111
+ -- local static = weather.atmosphere_type == 0
112
+ local visibility = weather.visibility.distance
113
+ -- local turbulence = weather.groundTurbulence
114
+ local dust = nil
115
+ if weather.enable_dust == true then
116
+ dust = weather.dust_density
117
+ end
118
+ local fog = nil
119
+ if weather.enable_fog == true then
120
+ fog = weather.fog
121
+ end
122
+
123
+ -- debug_msg(string.format("visibility : %i | cloud : base %i density %i | fog %i,%i | dust %i", visibility, clouds.base, clouds.density, fog.thickness, fog.visibility, dust))
124
+ local minVisibility = visibility
125
+ if (weather.enable_fog and fog.thickness > 0) then
126
+ minVisibility = math.min(minVisibility,fog.visibility)
127
+ end
128
+ if (weather.enable_dust) then
129
+ minVisibility = math.min(minVisibility,dust)
130
+ end
131
+
132
+ if (minVisibility > UTILS.NMToMeters(5)) then
133
+ if (clouds.base > UTILS.FeetToMeters(3000)) then
134
+ debug_msg("CASE I weather")
135
+ return 1
136
+ elseif (clouds.base > UTILS.FeetToMeters(1000)) then
137
+ debug_msg("CASE II weather")
138
+ return 2
139
+ else
140
+ debug_msg("CASE III weather")
141
+ return 3
142
+ end
143
+ else
144
+ debug_msg("CASE III weather")
145
+ return 3
146
+ end
147
+ end
148
+
149
+ AIRBOSSArray = {}
150
+ compteur = 0
151
+ MenuCoalitionCSGCommandsBlue = MENU_COALITION:New(coalition.side.BLUE, "CSG Commands", MenuCoalitionBlue)
152
+ MenuCoalitionCSGCommandsRed = MENU_COALITION:New(coalition.side.RED, "CSG Commands", MenuCoalitionRed)
153
+ for index, airbossconfig in ipairs(AirBossConfig) do
154
+ if airbossconfig.enable == true then
155
+ compteur = compteur +1
156
+ --populate_SC(airbossconfig.carriername)
157
+ local MenuCoalitionCSGCommands = nil
158
+ if airbossconfig.coalition == coalition.side.BLUE then
159
+ MenuCoalitionCSGCommands = MenuCoalitionCSGCommandsBlue
160
+ else
161
+ MenuCoalitionCSGCommands = MenuCoalitionCSGCommandsRed
162
+ end
163
+ local objAirboss = AIRBOSS:New(airbossconfig.carriername, airbossconfig.alias)
164
+ objAirboss.menuObject = MENU_COALITION:New(
165
+ airbossconfig.coalition,
166
+ airbossconfig.alias,
167
+ MenuCoalitionCSGCommands
168
+ )
169
+ MENU_COALITION_COMMAND:New(
170
+ airbossconfig.coalition,
171
+ "DEFCON 2 - 5 minutes",
172
+ objAirboss.menuObject,
173
+ switchCarrierDefCon2,
174
+ {
175
+ airbossconfig.carriername,
176
+ 5
177
+ }
178
+ )
179
+ MENU_COALITION_COMMAND:New(
180
+ airbossconfig.coalition,
181
+ "DEFCON 2 - 10 minutes",
182
+ objAirboss.menuObject,
183
+ switchCarrierDefCon2,
184
+ {
185
+ airbossconfig.carriername,
186
+ 10
187
+ }
188
+ )
189
+ MENU_COALITION_COMMAND:New(
190
+ airbossconfig.coalition,
191
+ "Release : DEFCON 4",
192
+ objAirboss.menuObject,
193
+ forceCarrierDefCon4,
194
+ {
195
+ airbossconfig.carriername
196
+ }
197
+ )
198
+ objAirboss:SetTACAN(airbossconfig.tacan.channel, airbossconfig.tacan.mode, airbossconfig.tacan.morse)
199
+ objAirboss:SetICLS(airbossconfig.icls.channel, airbossconfig.icls.morse)
200
+ objAirboss:SetLSORadio(airbossconfig.freq.lso)
201
+ objAirboss:SetMarshalRadio(airbossconfig.freq.marshall)
202
+ if (airbossconfig.infinitepatrol) then
203
+ objAirboss:SetPatrolAdInfinitum(true)
204
+ end
205
+ objAirboss:SetCarrierControlledArea(airbossconfig.controlarea)
206
+ objAirboss:SetStaticWeather(true)
207
+ objAirboss:SetRespawnAI(false)
208
+ objAirboss:SetRecoveryCase(getCaseTypeFromWeather(nil, nil, nil))
209
+ objAirboss:SetEmergencyLandings(true)
210
+ objAirboss:SetMaxLandingPattern(airbossconfig.maxpatterns)
211
+ objAirboss:SetMaxSectionSize(4)
212
+ objAirboss:SetMaxMarshalStacks(airbossconfig.maxstacks)
213
+ objAirboss:SetDefaultPlayerSkill(airbossconfig.difficulty) -- other options EASY / HARD
214
+ objAirboss:SetFunkManOn(10043, "127.0.0.1")
215
+ if airbossconfig.wirecorrection then
216
+ objAirboss:SetMPWireCorrection(airbossconfig.wirecorrection)
217
+ else
218
+ objAirboss:SetMPWireCorrection()
219
+ end
220
+ if airbossconfig.operationsstatspath then
221
+ objAirboss:Load(airbossconfig.operationsstatspath)
222
+ if airbossconfig.operationsstatspath then
223
+ objAirboss:SetTrapSheet(airbossconfig.operationstrapsheetpath)
224
+ end
225
+ --objAirboss:SetAutoSave(airbossconfig.operationsstatspath)
226
+ end
227
+ if airbossconfig.handleAI == true then
228
+ objAirboss:SetHandleAION()
229
+ objAirboss:SetDespawnOnEngineShutdown(true)
230
+ else
231
+ objAirboss:SetHandleAIOFF()
232
+ end
233
+ if airbossconfig.recoverytanker then
234
+ for index,value in pairs(tankersArray) do
235
+ if ((value.customconfig.airboss_recovery == true) and (value.customconfig.groupName == airbossconfig.recoverytanker))then
236
+ objAirboss:SetRecoveryTanker(tankersArray[index])
237
+ objAirboss:MessageToMarshal('Recovery Tanker Setup : '..airbossconfig.recoverytanker, airbossconfig.alias, "", 30, false, 0)
238
+ break
239
+ end
240
+ end
241
+ end
242
+ if airbossconfig.menurecovery.enable == true then
243
+ objAirboss:SetMenuRecovery(airbossconfig.menurecovery.duration,
244
+ airbossconfig.menurecovery.windondeck,
245
+ airbossconfig.menurecovery.uturn,
246
+ airbossconfig.menurecovery.offset)
247
+ end
248
+ objAirboss:SetMenuMarkZones(airbossconfig.enable_menumarkzones)
249
+ objAirboss:SetMenuSmokeZones(airbossconfig.enable_menusmokezones)
250
+ objAirboss:SetAirbossNiceGuy(airbossconfig.enable_niceguy)
251
+ objAirboss:SetRadioRelayMarshal(airbossconfig.releayunit.marshall)
252
+ objAirboss:SetRadioRelayLSO(airbossconfig.releayunit.lso)
253
+ objAirboss:SetSoundfilesFolder(soundFilesPrefix .. "AIRBOSS/Airboss Soundfiles/")
254
+ if airbossconfig.voices.marshall then
255
+ if airbossconfig.voices.marshall == "Raynor" then
256
+ objAirboss:SetVoiceOversMarshalByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal Raynor/')
257
+ elseif airbossconfig.voices.marshall == "Gabriella" then
258
+ objAirboss:SetVoiceOversMarshalByGabriella(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal Gabriella/')
259
+ elseif airbossconfig.voices.marshall == "FF" then
260
+ objAirboss:SetVoiceOversMarshalByFF(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal FF/')
261
+ end
262
+ else
263
+ objAirboss:SetVoiceOversMarshalByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack Marshal Raynor/')
264
+ end
265
+ if airbossconfig.voices.lso then
266
+ if airbossconfig.voices.lso == "Raynor" then
267
+ objAirboss:SetVoiceOversLSOByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack LSO Raynor/')
268
+ elseif airbossconfig.voices.lso == "FF" then
269
+ objAirboss:SetVoiceOversLSOByFF(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack LSO FF/')
270
+ end
271
+ else
272
+ objAirboss:SetVoiceOversLSOByRaynor(soundFilesPrefix .. 'AIRBOSS/Airboss Soundpack LSO Raynor/')
273
+ end
274
+ objAirboss:SetDebugModeOFF()
275
+ objAirboss.trapsheet = false
276
+ if airbossconfig.singlecarrier == true then
277
+ objAirboss:SetMenuSingleCarrier()
278
+ end
279
+ if (airbossconfig.recoveryops.mode == 'cyclic') then
280
+ if not(airbossconfig.recoveryops.cyclic.event_duration_minutes) then
281
+ airbossconfig.recoveryops.cyclic.event_duration_minutes = 60
282
+ end
283
+ end
284
+ if (airbossconfig.dl4) then
285
+ local cvUnit = UNIT:FindByName(airbossconfig.carriername)
286
+ cvUnit:SetCommand(
287
+ {
288
+ id = "ActivateLink4",
289
+ params =
290
+ {
291
+ ["unitId"] = cvUnit:GetID(),
292
+ ["frequency"] = airbossconfig.dl4.freq * 1000000
293
+ },
294
+ }
295
+ )
296
+ cvUnit:SetCommand(
297
+ {
298
+ id = "ActivateACLS",
299
+ params =
300
+ {
301
+ ["unitId"] = cvUnit:GetID(),
302
+ },
303
+ }
304
+ )
305
+ end
306
+ objAirboss.customconfig = airbossconfig
307
+
308
+ function objAirboss:OnAfterLSOGrade(From, Event, To, playerData, myGrade)
309
+
310
+ local string_grade = myGrade.grade
311
+ local player_callsign = playerData.callsign
312
+ local unit_name = playerData.unitname
313
+ local player_name = playerData.name
314
+ local player_wire = playerData.wire
315
+
316
+ player_name = player_name:gsub('[%p]', '')
317
+ local client_performing_sh = USERFLAG:New(UNIT:FindByName(unit_name):GetClient():GetClientGroupID() + 100000000)
318
+ --local gradeForFile
319
+ if string_grade == "_OK_" then
320
+ --if string_grade == "_OK_" and player_wire == "3" and player_Tgroove >=15 and player_Tgroove <19 then
321
+ timer.scheduleFunction(
322
+ function()
323
+ trigger.action.outSound("Airboss Soundfiles/ffyrtp.ogg")
324
+ end,
325
+ {},
326
+ timer.getTime() + 5
327
+ )
328
+ if client_performing_sh:Get() == 1 then
329
+ myGrade.grade = "_OK_<SH>"
330
+ myGrade.points = myGrade.points
331
+ client_performing_sh:Set(0)
332
+ self:SetTrapSheet(self.trappath, "SH_unicorn_AIRBOSS-trapsheet-"..player_name)
333
+ timer.scheduleFunction(
334
+ function()
335
+ trigger.action.outSound("Airboss Soundfiles/sureshot.ogg")
336
+ end,
337
+ {},
338
+ timer.getTime() + 5
339
+ )
340
+ else
341
+ self:SetTrapSheet(self.trappath, "unicorn_AIRBOSS-trapsheet-"..player_name)
342
+ end
343
+
344
+ elseif string_grade == "OK" and player_wire >1 then
345
+ if client_performing_sh:Get() == 1 then
346
+ myGrade.grade = "OK<SH>"
347
+ myGrade.points = myGrade.points + 0.5
348
+ client_performing_sh:Set(0)
349
+ self:SetTrapSheet(self.trappath, "SH_AIRBOSS-trapsheet-"..player_name)
350
+ else
351
+ self:SetTrapSheet(self.trappath, "AIRBOSS-trapsheet-"..player_name)
352
+ end
353
+
354
+ elseif string_grade == "(OK)" and player_wire >1 then
355
+ self:SetTrapSheet(self.trappath, "AIRBOSS-trapsheet-"..player_name)
356
+ if client_performing_sh:Get() == 1 then
357
+ myGrade.grade = "(OK)<SH>"
358
+ myGrade.points = myGrade.points + 1.00
359
+ client_performing_sh:Set(0)
360
+ self:SetTrapSheet(self.trappath, "SH_AIRBOSS-trapsheet-"..player_name)
361
+ else
362
+ self:SetTrapSheet(self.trappath, "AIRBOSS-trapsheet-"..player_name)
363
+ end
364
+
365
+ elseif string_grade == "--" and player_wire >1 then
366
+ if client_performing_sh:Get() == 1 then
367
+ myGrade.grade = "--<SH>"
368
+ myGrade.points = myGrade.points + 1.00
369
+ client_performing_sh:Set(0)
370
+ self:SetTrapSheet(self.trappath, "SH_AIRBOSS-trapsheet-"..player_name)
371
+ else
372
+ self:SetTrapSheet(self.trappath, "AIRBOSS-trapsheet-"..player_name)
373
+ end
374
+ else
375
+ self:SetTrapSheet(self.trappath, "AIRBOSS-trapsheet-"..player_name)
376
+ end
377
+ myGrade.messageType = 2
378
+ myGrade.callsign = playerData.callsign
379
+ myGrade.name = playerData.name
380
+ myGrade.airbossconfig = self.customconfig
381
+ if playerData.wire == 1 then
382
+ myGrade.points = myGrade.points -1.00
383
+ local onewire_to_discord = ('**'..player_name..' almost had a rampstrike with that 1-wire!**')
384
+ GemMan:SendTable({
385
+ command="moose_text",
386
+ text=onewire_to_discord,
387
+ msg_type='lso'
388
+ })
389
+ end
390
+ self:_SaveTrapSheet(playerData, myGrade)
391
+
392
+ --if self.funkmanSocket then
393
+ --
394
+ -- -- Extract used info for FunkMan. We need to be careful with the amount of data send via UDP socket.
395
+ -- local trapsheet={} ; trapsheet.X={} ; trapsheet.Z={} ; trapsheet.AoA={} ; trapsheet.Alt={}
396
+ --
397
+ -- -- Loop over trapsheet and extract used values.
398
+ -- for i = 1, #playerData.trapsheet do
399
+ -- local ts=playerData.trapsheet[i] --#AIRBOSS.GrooveData
400
+ -- table.insert(trapsheet.X, UTILS.Round(ts.X, 1))
401
+ -- table.insert(trapsheet.Z, UTILS.Round(ts.Z, 1))
402
+ -- table.insert(trapsheet.AoA, UTILS.Round(ts.AoA, 2))
403
+ -- table.insert(trapsheet.Alt, UTILS.Round(ts.Alt, 1))
404
+ -- end
405
+ --
406
+ -- local result={}
407
+ -- result.command=SOCKET.DataType.LSOGRADE
408
+ -- result.name=playerData.name
409
+ -- result.trapsheet=trapsheet
410
+ -- result.airframe=myGrade.airframe
411
+ -- result.modex=myGrade.modex
412
+ -- result.mitime=myGrade.mitime
413
+ -- result.midate=myGrade.midate
414
+ -- result.wind=myGrade.wind
415
+ -- result.carriertype=myGrade.carriertype
416
+ -- result.carriername=myGrade.carriername
417
+ -- result.carrierrwy=myGrade.carrierrwy
418
+ -- result.landingdist=self.carrierparam.landingdist
419
+ -- result.theatre=myGrade.theatre
420
+ -- result.case=playerData.case
421
+ -- result.Tgroove=myGrade.Tgroove
422
+ -- result.wire=myGrade.wire
423
+ -- result.grade=myGrade.grade
424
+ -- result.points=myGrade.points
425
+ -- result.details=myGrade.details
426
+ -- result.finalscore=myGrade.finalscore or myGrade.points
427
+ --
428
+ -- -- Debug info.
429
+ -- self:T(self.lid.."Result onafterLSOGrade")
430
+ -- self:T(result)
431
+ --
432
+ -- -- Send result.
433
+ -- self.funkmanSocket:SendTable(result)
434
+ --end
435
+
436
+ --TODO reactivate the timer.schedule maybe ?
437
+ --timer.scheduleFunction(
438
+ -- function(airbossObject)
439
+ -- airbossObject:SetTrapSheet(airbossObject.trappath)
440
+ -- end,
441
+ -- {self},
442
+ -- timer.getTime() + 10
443
+ --)
444
+ --local myScheduleTime = TIMER:New(10, nil,nil):resetTrapSheetFileFormat()
445
+ end
446
+
447
+
448
+
449
+ function objAirboss:OnAfterRecoveryStart(From, Event, To, Case, Offset)
450
+ self:MessageToMarshal('Recovery started Case '..Case..'...', self.customconfig.alias, "", 30, false, 10)
451
+ end
452
+
453
+ function objAirboss:OnAfterRecoveryStop(From, Event, To)
454
+ self:MessageToMarshal('Recovery finished.', self.customconfig.alias, "", 30, false, 10)
455
+ if (airbossconfig.recoveryops.mode == 'cyclic') then
456
+ if self.recoverywindow then
457
+ if ((timer.getAbsTime() + UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*1/3, 0) > self.recoverywindow.STOP)
458
+ or (timer.getAbsTime() + UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*3/3, 0) < self.recoverywindow.START)) then
459
+ self:SetRecoveryCase(getCaseTypeFromWeather(
460
+ self:GetCoordinate(),
461
+ timer.getAbsTime() + UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*1/3, 0),
462
+ timer.getAbsTime() + UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*3/3, 0)
463
+ ))
464
+ if self.defaultcase == 1 then
465
+ self:SetMaxSectionSize(4)
466
+ elseif self.defaultcase == 2 then
467
+ self:SetMaxSectionSize(2)
468
+ elseif self.defaultcase == 3 then
469
+ self:SetMaxSectionSize(1)
470
+ else
471
+ self:SetMaxSectionSize(1)
472
+ end
473
+ self:AddRecoveryWindow(
474
+ UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*1/3, 0),
475
+ UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*3/3, 0),
476
+ self.defaultcase,
477
+ self.customconfig.menurecovery.offset,
478
+ true,
479
+ self.customconfig.menurecovery.windondeck,
480
+ self.customconfig.menurecovery.uturn
481
+ )
482
+ self:MessageToMarshal('Next Recovery in : '..UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes/3, 0)..' minutes', self.customconfig.alias, "", 30, false, 0)
483
+ --LeaveRecovery(self)
484
+ end
485
+ else
486
+ self:SetRecoveryCase(getCaseTypeFromWeather(
487
+ self:GetCoordinate(),
488
+ timer.getAbsTime() + UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*1/3, 0),
489
+ timer.getAbsTime() + UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*3/3, 0)
490
+ ))
491
+ if self.defaultcase == 1 then
492
+ self:MessageToMarshal('Good visibility : Case I', self.customconfig.alias, "", 45, false, 0)
493
+ self:SetMaxSectionSize(4)
494
+ elseif self.defaultcase == 2 then
495
+ self:MessageToMarshal('Bad visibility in altitude : Case II', self.customconfig.alias, "", 45, false, 0)
496
+ self:SetMaxSectionSize(2)
497
+ elseif self.defaultcase == 3 then
498
+ self:MessageToMarshal('Bad visibility : Case III', self.customconfig.alias, "", 45, false, 0)
499
+ self:SetMaxSectionSize(1)
500
+ else
501
+ self:SetMaxSectionSize(1)
502
+ end
503
+ self:AddRecoveryWindow(
504
+ UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*1/3, 0),
505
+ UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes*60*3/3, 0),
506
+ self.defaultcase,
507
+ self.customconfig.menurecovery.offset,
508
+ true,
509
+ self.customconfig.menurecovery.windondeck,
510
+ self.customconfig.menurecovery.uturn
511
+ )
512
+ self:MessageToMarshal('Next Recovery in : '..UTILS.Round(self.customconfig.recoveryops.cyclic.event_duration_minutes/3, 0)..' minutes', self.customconfig.alias, "", 30, false, 0)
513
+ --LeaveRecovery(self)
514
+ end
515
+ end
516
+ end
517
+
518
+ AIRBOSSArray[compteur] = objAirboss
519
+ AIRBOSSArray[compteur]:Start()
520
+ AIRBOSSArray[compteur].CVN_GROUPZone = ZONE_GROUP:New(
521
+ 'cvnGroupZone-'..AIRBOSSArray[compteur].customconfig.alias,
522
+ AIRBOSSArray[compteur].carrier:GetGroup(),
523
+ 1111)
524
+ AIRBOSSArray[compteur].CVNClients = SET_CLIENT:New()
525
+ :FilterCoalitions(UTILS.GetCoalitionName(AIRBOSSArray[compteur].customconfig.coalition))
526
+ :FilterStart()
527
+ local myscheduler
528
+ local myschedulerID
529
+ myscheduler, myschedulerID = SCHEDULER:New(
530
+ nil,
531
+ detectShitHotBreak,
532
+ {AIRBOSSArray[compteur]},
533
+ 2,
534
+ 1
535
+ )
536
+ AIRBOSSArray[compteur].scheduler = myscheduler
537
+ AIRBOSSArray[compteur].schedulerID = myschedulerID
538
+ --trigger.action.outText('INFO '..airbossconfig.alias..' : Naval sunset at '..UTILS.SecondsToClock((AIRBOSSArray[compteur]:GetCoordinate():GetSunset(true) - 30*60)), 75)
539
+ if (airbossconfig.recoveryops.mode == 'cyclic') then
540
+ AIRBOSSArray[compteur]:SetRecoveryCase(getCaseTypeFromWeather(
541
+ AIRBOSSArray[compteur]:GetCoordinate(),
542
+ timer.getAbsTime() + (airbossconfig.recoveryops.cyclic.event_ia_reserved_minutes)*60+UTILS.Round(airbossconfig.recoveryops.cyclic.event_duration_minutes*60*0/3, 0),
543
+ timer.getAbsTime() + (airbossconfig.recoveryops.cyclic.event_ia_reserved_minutes)*60+UTILS.Round(airbossconfig.recoveryops.cyclic.event_duration_minutes*60*2/3, 0)
544
+ ))
545
+ if AIRBOSSArray[compteur].defaultcase == 1 then
546
+ AIRBOSSArray[compteur]:MessageToMarshal('Good visibility : Case I', AIRBOSSArray[compteur].customconfig.alias, "", 45, false, 0)
547
+ AIRBOSSArray[compteur]:SetMaxSectionSize(4)
548
+ elseif AIRBOSSArray[compteur].defaultcase == 2 then
549
+ AIRBOSSArray[compteur]:MessageToMarshal('Bad visibility in altitude : Case II', AIRBOSSArray[compteur].customconfig.alias, "", 45, false, 0)
550
+ AIRBOSSArray[compteur]:SetMaxSectionSize(2)
551
+ elseif AIRBOSSArray[compteur].defaultcase == 3 then
552
+ AIRBOSSArray[compteur]:MessageToMarshal('Bad visibility : Case III', AIRBOSSArray[compteur].customconfig.alias, "", 45, false, 0)
553
+ AIRBOSSArray[compteur]:SetMaxSectionSize(1)
554
+ else
555
+ AIRBOSSArray[compteur]:SetMaxSectionSize(1)
556
+ end
557
+ if airbossconfig.recoveryops.cyclic.event_ia_reserved_minutes then
558
+ AIRBOSSArray[compteur]:AddRecoveryWindow(
559
+ (airbossconfig.recoveryops.cyclic.event_ia_reserved_minutes)*60+UTILS.Round(airbossconfig.recoveryops.cyclic.event_duration_minutes*60*0/3, 0),
560
+ (airbossconfig.recoveryops.cyclic.event_ia_reserved_minutes)*60+UTILS.Round(airbossconfig.recoveryops.cyclic.event_duration_minutes*60*2/3, 0),
561
+ AIRBOSSArray[compteur].defaultcase,
562
+ airbossconfig.menurecovery.offset,
563
+ true,
564
+ airbossconfig.menurecovery.windondeck,
565
+ airbossconfig.menurecovery.uturn
566
+ )
567
+ else
568
+ AIRBOSSArray[compteur]:AddRecoveryWindow(
569
+ 15*60+UTILS.Round(airbossconfig.recoveryops.cyclic.event_duration_minutes*60*0/3, 0),
570
+ 15*60+UTILS.Round(airbossconfig.recoveryops.cyclic.event_duration_minutes*60*2/3, 0),
571
+ AIRBOSSArray[compteur].defaultcase,
572
+ airbossconfig.menurecovery.offset,
573
+ true,
574
+ airbossconfig.menurecovery.windondeck,
575
+ airbossconfig.menurecovery.uturn
576
+ )
577
+ end
578
+ else
579
+ if (airbossconfig.recoveryops.mode == 'alpha') then
580
+ if (airbossconfig.recoveryops.alpha) then
581
+ if (airbossconfig.recoveryops.alpha.recoveries) then
582
+ for alphaindex, alphaevent in ipairs(airbossconfig.recoveryops.alpha.recoveries) do
583
+ local effectiveeventcase = getCaseTypeFromWeather(
584
+ AIRBOSSArray[compteur]:GetCoordinate(),
585
+ UTILS.Round(env.mission.start_time + (alphaevent.recovery_start_minutes * 60) ,0),
586
+ UTILS.Round(env.mission.start_time + (( alphaevent.recovery_start_minutes + alphaevent.recovery_duration_minutes ) * 60),0)
587
+ )
588
+ if AIRBOSSArray[compteur].defaultcase == 1 then
589
+ AIRBOSSArray[compteur]:SetMaxSectionSize(4)
590
+ elseif AIRBOSSArray[compteur].defaultcase == 2 then
591
+ AIRBOSSArray[compteur]:SetMaxSectionSize(2)
592
+ elseif AIRBOSSArray[compteur].defaultcase == 3 then
593
+ AIRBOSSArray[compteur]:SetMaxSectionSize(1)
594
+ else
595
+ AIRBOSSArray[compteur]:SetMaxSectionSize(1)
596
+ end
597
+ AIRBOSSArray[compteur]:AddRecoveryWindow(
598
+ UTILS.SecondsToClock(env.mission.start_time + (alphaevent.recovery_start_minutes * 60) ),
599
+ UTILS.SecondsToClock(env.mission.start_time +
600
+ ( (alphaevent.recovery_start_minutes + alphaevent.recovery_duration_minutes) * 60)),
601
+ effectiveeventcase,
602
+ airbossconfig.menurecovery.offset,
603
+ true,
604
+ airbossconfig.menurecovery.windondeck,
605
+ airbossconfig.menurecovery.uturn
606
+ )
607
+ end
608
+ end
609
+ end
610
+ end
611
+ end
612
+ trigger.action.outText('AIRBOSS scripts Loaded for unit '..airbossconfig.carriername, 10)
613
+ timer.scheduleFunction(function()
614
+ 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)
615
+ end, nil, timer.getTime() + 30 )
616
+ else
617
+ timer.scheduleFunction(function()
618
+ trigger.action.outText('AIRBOSS script disabled for unit '..airbossconfig.carriername, 10)
619
+ end, nil, timer.getTime() + 8 )
620
+ end
621
+ end
@@ -0,0 +1,21 @@
1
+ -- *****************************************************************************
2
+ -- ** Rescue Hello **
3
+ -- *********************************************************
4
+ PedroArray = {}
5
+ compteur = 0
6
+ for index,pedro in ipairs(PedrosConfig) do
7
+ if pedro.enable == true then
8
+ compteur = compteur +1
9
+ local rescuehelo = RESCUEHELO:New(UNIT:FindByName(pedro.patternUnit),pedro.groupName)
10
+ :SetHomeBase(AIRBASE:FindByName(pedro.baseUnit))
11
+ :SetTakeoffCold()
12
+ :SetRespawnOnOff(pedro.autorespawn)
13
+ :SetRescueDuration(1)
14
+ :SetModex(pedro.modex)
15
+ function rescuehelo:OnAfterStart(from, event, to)
16
+ self.helo:CommandSetFrequency(pedro.freq, radio.modulation.AM)
17
+ end
18
+ PedroArray[compteur] = rescuehelo
19
+ PedroArray[compteur]:Start()
20
+ end
21
+ end
@@ -0,0 +1,19 @@
1
+ -- *****************************************************************************
2
+ -- ** BEACONS **
3
+ -- *********************************************************
4
+ BeaconArray = {}
5
+ compteur = 0
6
+ for index, beaconconfig in ipairs(BeaconsConfig) do
7
+ if beaconconfig.enable == true then
8
+ compteur = compteur + 1
9
+ env.info('creation Beacon Zone : '.. beaconconfig.name..'...')
10
+ local myunit = UNIT:FindByName(beaconconfig.unitName)
11
+ local mybeacon = myunit:GetBeacon()
12
+ mybeacon.customconfig = beaconconfig
13
+ BeaconArray[compteur] = mybeacon
14
+ BeaconArray[compteur]:ActivateTACAN(beaconconfig.tacan.channel,
15
+ beaconconfig.tacan.band,
16
+ beaconconfig.tacan.morse,
17
+ true)
18
+ end
19
+ end