Inital Commit

This commit is contained in:
iTracerFacer
2024-11-12 14:18:28 -06:00
commit 949e19c61a
2188 changed files with 988098 additions and 0 deletions

5
DCS_Caucasus/.buildpath Normal file
View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
<buildpathentry kind="src" path="src"/>
<buildpathentry combineaccessrules="false" kind="prj" path="/Moose_Framework"/>
</buildpath>

18
DCS_Caucasus/.project Normal file
View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>DCS_Caucasus</name>
<comment></comment>
<projects>
<project>Moose_Framework</project>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.dltk.core.scriptbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.ldt.nature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,2 @@
Grammar__default_id=lua-5.1
eclipse.preferences.version=1

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,59 @@
--_SETTINGS:SetPlayerMenuOff()
----env.info("Loading Main Script", true)
---- Setup Command Centers. See Moose_ErmenekLiberation_ZoneCapture.lua for remaining code.
---- Set SRS settings
--STTS.DIRECTORY = "C:\\Program Files\\DCS-SimpleRadio-Standalone"
--STTS.SRS_PORT = "5002"
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ):FilterStart()
US_PlanesClientSet = SET_CLIENT:New():FilterCountries( "USA" ):FilterCategories( "plane" ):FilterStart()
-- Define the SPAWN object for the red AI plane template.
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
-- If a blocked plane exists, this red plane will be ReSpawned.
RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
US_PlanesSpawn = SPAWN:New( "AI US" ):InitCleanUp( 20 )
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
US_AI_Balancer = AI_BALANCER:New( US_PlanesClientSet, US_PlanesSpawn )
PatrolZone1 = ZONE:New("PatrolZone1")
PatrolZone2 = ZONE:New("PatrolZone2")
Spawn_US_AWACS = SPAWN:New("BLUE EWR E-2D Wizard Group")
:InitLimit(1,500)
:InitRepeatOnLanding()
:SpawnScheduled(300, .4)
Spawn_RU_AWACS = SPAWN:New("RED EWR")
:InitLimit(1,500)
:InitRepeatOnLanding()
:SpawnScheduled(300, .4)
function US_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
--local Patrol = AI_PATROL_ZONE:New( PatrolZoneArray[math.random( 1, 2 )], 3000, 6000, 400, 600 )
local Patrol = AI_CAP_ZONE:New(PatrolZone1,5000,30000,400,500)
Patrol:ManageFuel( 0.2, 60 )
Patrol:SetEngageZone(PatrolZone1)
Patrol:SetControllable( AIGroup )
Patrol:Start()
end
function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
--local Patrol = AI_PATROL_ZONE:New( PatrolZoneArray[math.random( 1, 2 )], 3000, 6000, 400, 600 )
local Patrol = AI_CAP_ZONE:New(PatrolZone2,5000,30000,400,500)
Patrol:ManageFuel( 0.2, 60 )
Patrol:SetEngageZone(PatrolZone2)
Patrol:SetControllable( AIGroup )
Patrol:Start()
end

View File

@@ -0,0 +1,59 @@
--_SETTINGS:SetPlayerMenuOff()
----env.info("Loading Main Script", true)
---- Setup Command Centers. See Moose_ErmenekLiberation_ZoneCapture.lua for remaining code.
---- Set SRS settings
--STTS.DIRECTORY = "C:\\Program Files\\DCS-SimpleRadio-Standalone"
--STTS.SRS_PORT = "5002"
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCategories( "plane" ):FilterStart()
US_PlanesClientSet = SET_CLIENT:New():FilterCountries( "USA" ):FilterCategories( "plane" ):FilterStart()
-- Define the SPAWN object for the red AI plane template.
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
-- If a blocked plane exists, this red plane will be ReSpawned.
RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 )
US_PlanesSpawn = SPAWN:New( "AI US" ):InitCleanUp( 20 )
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )
US_AI_Balancer = AI_BALANCER:New( US_PlanesClientSet, US_PlanesSpawn )
PatrolZone1 = ZONE:New("PatrolZone1")
PatrolZone2 = ZONE:New("PatrolZone2")
Spawn_US_AWACS = SPAWN:New("BLUE EWR E-2D Wizard Group")
:InitLimit(1,500)
:InitRepeatOnLanding()
:SpawnScheduled(300, .4)
Spawn_RU_AWACS = SPAWN:New("RED EWR")
:InitLimit(1,500)
:InitRepeatOnLanding()
:SpawnScheduled(300, .4)
function US_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
--local Patrol = AI_PATROL_ZONE:New( PatrolZoneArray[math.random( 1, 2 )], 3000, 6000, 400, 600 )
local Patrol = AI_CAP_ZONE:New(PatrolZone1,5000,30000,400,500)
Patrol:ManageFuel( 0.2, 60 )
Patrol:SetEngageZone(PatrolZone1)
Patrol:SetControllable( AIGroup )
Patrol:Start()
end
function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
--local Patrol = AI_PATROL_ZONE:New( PatrolZoneArray[math.random( 1, 2 )], 3000, 6000, 400, 600 )
local Patrol = AI_CAP_ZONE:New(PatrolZone2,5000,30000,400,500)
Patrol:ManageFuel( 0.2, 60 )
Patrol:SetEngageZone(PatrolZone2)
Patrol:SetControllable( AIGroup )
Patrol:Start()
end

View File

@@ -0,0 +1,91 @@
--_SETTINGS:SetPlayerMenuOff()
----env.info("Loading Main Script", true)
---- Setup Command Centers. See Moose_ErmenekLiberation_ZoneCapture.lua for remaining code.
---- Set SRS settings
--STTS.DIRECTORY = "C:\\Program Files\\DCS-SimpleRadio-Standalone"
--STTS.SRS_PORT = "5002"
-- Define the SET of CLIENTs from the red coalition. This SET is filled during startup.
RU_PlanesClientSetFW190 = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterPrefixes("FW190"):FilterStart()
RU_PlanesClientSetBF109 = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterPrefixes("BF109"):FilterStart()
US_PlanesClientSetP51 = SET_CLIENT:New():FilterCountries( "USA" ):FilterCategories( "plane" ):FilterPrefixes("P51"):FilterStart()
US_PlanesClientSetSpitFire = SET_CLIENT:New():FilterCountries( "USA" ):FilterCategories( "plane" ):FilterPrefixes("Spitfire"):FilterStart()
-- Define the SPAWN object for the red AI plane template.
-- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off.
-- If a blocked plane exists, this red plane will be ReSpawned.
RU_PlanesSpawnFW190 = SPAWN:New( "AI RU-FW190" ):InitCleanUp( 20 )
RU_PlanesSpawnBF109 = SPAWN:New( "AI RU-BF109" ):InitCleanUp( 20 )
US_PlanesSpawnP51 = SPAWN:New( "AI US-P51" ):InitCleanUp( 20 )
US_PlanesSpawnSpitFire = SPAWN:New( "AI US-SPITFIRE" ):InitCleanUp( 20 )
-- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter.
RU_AI_BalancerFW190 = AI_BALANCER:New( RU_PlanesClientSetFW190, RU_PlanesSpawnFW190 )
RU_AI_BalancerBF109 = AI_BALANCER:New( RU_PlanesClientSetBF109, RU_PlanesSpawnBF109 )
US_AI_BalancerP51 = AI_BALANCER:New( US_PlanesClientSetP51, US_PlanesSpawnP51 )
US_AI_BalancerSpitFire = AI_BALANCER:New( US_PlanesClientSetSpitFire, US_PlanesSpawnSpitFire )
PatrolZone1 = ZONE:New("PatrolZone1")
PatrolZone2 = ZONE:New("PatrolZone2")
function US_AI_BalancerP51:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
--local Patrol = AI_PATROL_ZONE:New( PatrolZoneArray[math.random( 1, 2 )], 3000, 6000, 400, 600 )
local Patrol = AI_CAP_ZONE:New(PatrolZone1,5000,30000,400,500)
Patrol:ManageFuel( 0.2, 60 )
Patrol:SetEngageZone(PatrolZone1)
Patrol:SetControllable( AIGroup )
Patrol:Start()
end
function US_AI_BalancerSpitFire:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
--local Patrol = AI_PATROL_ZONE:New( PatrolZoneArray[math.random( 1, 2 )], 3000, 6000, 400, 600 )
local Patrol = AI_CAP_ZONE:New(PatrolZone1,5000,30000,400,500)
Patrol:ManageFuel( 0.2, 60 )
Patrol:SetEngageZone(PatrolZone1)
Patrol:SetControllable( AIGroup )
Patrol:Start()
end
function RU_AI_BalancerFW190:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
--local Patrol = AI_PATROL_ZONE:New( PatrolZoneArray[math.random( 1, 2 )], 3000, 6000, 400, 600 )
local Patrol = AI_CAP_ZONE:New(PatrolZone2,5000,30000,400,500)
Patrol:ManageFuel( 0.2, 60 )
Patrol:SetEngageZone(PatrolZone2)
Patrol:SetControllable( AIGroup )
Patrol:Start()
end
function RU_AI_BalancerBF109:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
--local Patrol = AI_PATROL_ZONE:New( PatrolZoneArray[math.random( 1, 2 )], 3000, 6000, 400, 600 )
local Patrol = AI_CAP_ZONE:New(PatrolZone2,5000,30000,400,500)
Patrol:ManageFuel( 0.2, 60 )
Patrol:SetEngageZone(PatrolZone2)
Patrol:SetControllable( AIGroup )
Patrol:Start()
end
Spawn_US_AWACS = SPAWN:New("BLUE EWR E-2D Wizard Group")
:InitLimit(1,500)
:InitRepeatOnLanding()
:SpawnScheduled(300, .4)
Spawn_RU_AWACS = SPAWN:New("RED EWR")
:InitLimit(1,500)
:InitRepeatOnLanding()
:SpawnScheduled(300, .4)

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
<buildpathentry combineaccessrules="false" kind="prj" path="/Moose_Framework"/>
</buildpath>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Battle of Gori</name>
<comment></comment>
<projects>
<project>Moose_Framework</project>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.dltk.core.scriptbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.ldt.nature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,2 @@
Grammar__default_id=lua-5.1
eclipse.preferences.version=1

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 KiB

View File

@@ -0,0 +1,464 @@
--Verion 1.4.2
ProviderChecker = {}
-- Best to leave this on for the most part.
ProviderChecker.TankerFuelChecking = true
-- Only necessary to set if you don't set them to invicible
ProviderChecker.TankerKilledTimer = 60
-- Good to set even if you are using Fuel Check, in case it lands for some weird AI reason.
ProviderChecker.TankerRTBTimer = 60
-- If you want it to respawn when fuel state reaches 20%, instead of having it RTB all the way to base.
ProviderChecker.AWACFuelChecking = true
-- Killed Timer is the time delay to respawn for killed in seconds. Minimum of 5 seconds, anything less will default to 5 seconds
ProviderChecker.AWACKilledTimer = 600
-- RTB Timer is time delay to respawn from landing. Can be 0
ProviderChecker.AWACRTBTimer = 60
ProviderChecker.AWACSeventHandler = {}
ProviderChecker.TankereventHandler = {}
ProviderChecker.TankerTable = {}
ProviderChecker.AwacsTable = {}
ProviderChecker.TankerRefuelingCountBlueFor = 0
ProviderChecker.TankerRefuelingCountRedFor = 0
--Tankers waiting for respawn
ProviderChecker.TankerStandbyTable= {}
function ProviderChecker.TankerRadioStatus(radio_coalition)
local coalition_side = ""
if radio_coalition == 1 then
coalition_side = coalition_side .. "red"
elseif radio_coalition == 2 then
coalition_side = coalition_side .. "blue"
end
local tanker_status_start = "===========================\n"
local tanker_status_end = "==========================="
local tanker_status_mid = ""
for fueler, params in pairs(ProviderChecker.TankerTable) do
if params.coalition == coalition_side then
if params.has_tasking then
local m_tanker_id = Group.getByName(params.name)
local m_tanker_radio = params.radio_freqeuncy
local m_tanker_units = m_tanker_id:getUnits()
local m_tanker_unit = m_tanker_units[1]
local m_tanker_callsign = m_tanker_unit:getCallsign()
local m_tanker_channel = params.channel
local m_tanker_mode = params.modeChannel
local m_tanker_ac_type = m_tanker_unit:getTypeName()
tanker_status_mid = tanker_status_mid .. "Tanker: " .. m_tanker_callsign .. " Radio: " .. m_tanker_radio ..
" TACAN: " .. m_tanker_channel .. m_tanker_mode .. " Aircraft: " .. m_tanker_ac_type .. "\n"
else
local m_tanker_id = Group.getByName(params.name)
local m_tanker_radio = params.radio_freqeuncy
local m_tanker_units = m_tanker_id:getUnits()
local m_tanker_unit = m_tanker_units[1]
local m_tanker_callsign = m_tanker_unit:getCallsign()
tanker_status_mid = tanker_status_mid .. "Tanker: " .. m_tanker_callsign .. " Radio: " .. m_tanker_radio ..
" TACAN: N/A" .. " Aircraft: " .. m_tanker_ac_type .. "\n"
end
end
end
local out_message = tanker_status_start .. tanker_status_mid .. tanker_status_end
trigger.action.outTextForCoalition(radio_coalition, out_message, 30, true)
end
function ProviderChecker.RefreshTACAN(_nil,time)
for fueler, params in pairs(ProviderChecker.TankerTable) do
if params.has_tasking then
local tanker_id = Group.getByName(params.name)
if tanker_id then
local tanker_controller = tanker_id:getController()
local tanker_tacan = {
id = 'ActivateBeacon',
params = {
["type"] = params.type,
["AA"] = params.AA,
["unitId"] = tanker_id,
["modeChannel"] = params.modeChannel,
["channel"] = params.channel,
["system"] = params.system,
["callsign"] = params.callsign,
["bearing"] = params.bearing,
["frequency"] = params.frequency,
}
}
tanker_controller:setCommand(tanker_tacan)
end
end
end
return time + 10
end
--Will Eventually consoldate these to one function. Pass type (awacs or tanker) as argument.
function ProviderChecker.SpawnNewTanker(_unit, time)
--respawn uses the same name, and tankers are tracked by name instead of ID. Will change this for AWACS in future update.
NewGroup = mist.respawnGroup(_unit,true)
NewName = NewGroup.units[1].name
NewUnit = Unit.getByName(NewName)
tanker_controller = NewUnit:getController()
for tanker, params in pairs(ProviderChecker.TankerTable) do
if params.name == NewName then
local frequency = tonumber(params.radio_freqeuncy) * 1000000
SetFrequency = {
id = 'SetFrequency',
params = {
frequency = frequency,
modulation = 0,
}
}
tanker_controller:setCommand(SetFrequency)
trigger.action.outTextForCoalition(NewUnit:getCoalition(),"Tanker " ..NewUnit:getCallsign().. " is back online!", 10, false)
end
end
return nil
end
function ProviderChecker.SpawnNewAwacs(_unit, time)
NewGroup = mist.respawnGroup(_unit,true)
NewName = NewGroup.units[1].name
NewUnit = Unit.getByName(NewName)
awacs_controller = NewUnit:getController()
for awacs, params in pairs(ProviderChecker.AwacsTable) do
if params.name == NewName then
local frequency = tonumber(params.radio_freqeuncy) * 1000000
SetFrequency = {
id = 'SetFrequency',
params = {
frequency = frequency,
modulation = 0,
}
}
awacs_controller:setCommand(SetFrequency)
trigger.action.outTextForCoalition(NewUnit:getCoalition(),"AWACS " .. NewUnit:getCallsign() .. " is back online!", 10, false)
end
end
return nil
end
--due to how scheduled functions work, I need to create a class to handle this. Will upgrade later next revision.
function ProviderChecker.checkTankerFuel(_nil,time)
for fueler, params in pairs(ProviderChecker.TankerTable) do
local fueler_group_name = params.name
local fueler_group = Group.getByName(fueler_group_name)
if fueler_group then
local fueler_units = fueler_group:getUnits()
local fueler_id = fueler_units[1]
local fueler_fuel = fueler_id:getFuel()
if fueler_fuel < 0.20 then
if params.coalition == "blue" then
if ProviderChecker.TankerRefuelingCountBlueFor < 1 then
trigger.action.outTextForCoalition(
fueler_id:getCoalition(),
"Tanker " .. fueler_id:getCallsign() .. " Is out of Fuel. Respawning in 5 seconds",
10
)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, fueler_group_name, timer.getTime() + 5)
elseif ProviderChecker.TankerRefuelingCountBlueFor > 0 then
trigger.action.outTextForCoalition(
fueler_id:getCoalition(),
"Tanker " .. fueler_id:getCallsign() .. " fuel at less than 20%. Will respawn when no aircraft are refueling",
10
)
end
elseif params.coalition == "red" then
if ProviderChecker.TankerRefuelingCountRedFor < 1 then
trigger.action.outTextForCoalition(
fueler_id:getCoalition(),
"Tanker " .. fueler_id:getCallsign() .. " Is out of Fuel. Respawning in 5 seconds",
10
)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, fueler_group_name, timer.getTime() + 5)
elseif ProviderChecker.TankerRefuelingCountRedFor > 0 then
trigger.action.outTextForCoalition(
fueler_id:getCoalition(),
"Tanker " .. fueler_id:getCallsign() .. " fuel at less than 20%. Will respawn when no aircraft are refueling",
10
)
end
end
elseif fueler_fuel < 0.22 then
trigger.action.outTextForCoalition(
fueler_id:getCoalition(),
"Tanker " .. fueler_id:getCallsign() .. " at 25%. Will respawn at 20% if no aircraft are refueling",
10
)
end
end
end
return time + 120
end
function ProviderChecker.checkAWACSFuel(_nil,time)
--Due to the respawn and scheduledFunction limitations, Checking Refuel requires imediate respawn, else it would loop to respawn again and again.
for awacs, params in pairs(ProviderChecker.AwacsTable) do
local awacs_group_name = params.name
local awacs_group = Group.getByName(awacs_group_name)
if awacs_group then
local awacs_units = awacs_group:getUnits()
local awacs_id = awacs_units[1]
local awacs_fuel = awacs_id:getFuel()
if awacs_fuel < 0.30 then
if params.coalition == "blue" then
trigger.action.outTextForCoalition(
awacs_id:getCoalition(),
"AWACS " .. awacs_id:getCallsign() .. " Is out of Fuel. Respawning in 5 seconds",
10
)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, awacs_group_name, timer.getTime() + 5)
elseif params.coalition == "red" then
trigger.action.outTextForCoalition(
awacs_id:getCoalition(),
"AWACS " .. awacs_id:getCallsign() .. " Is out of Fuel. Respawning in 5 seconds",
10
)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, awacs_group_name, timer.getTime() + 5)
end
end
end
end
return time + 120
end
function ProviderChecker.TankereventHandler:onEvent(_event)
-- Adds up the number of units taking fuel because the event handler is based on unit taking fuel, not giving fuel
-- Solution to this later will be check nearest unit of type tanker and create a "class" out of that.
if (_event.id == 7) and _event.initiator then
local refueling_unit = _event.initiator
local refueling_unit_coalition = refueling_unit:getCoalition()
if refueling_unit_coalition == 2 then
ProviderChecker.TankerRefuelingCountBlueFor = ProviderChecker.TankerRefuelingCountBlueFor + 1
elseif refueling_unit_coalition == 1 then
ProviderChecker.TankerRefuelingCountRedFor = ProviderChecker.TankerRefuelingCountRedFor + 1
end
end
-- Removes the number of units taking fuel
if (_event.id == 14) and _event.initiator then
local refueling_unit = _event.initiator
local refueling_unit_coalition = refueling_unit:getCoalition()
if refueling_unit_coalition == 2 then
ProviderChecker.TankerRefuelingCountBlueFor = ProviderChecker.TankerRefuelingCountBlueFor - 1
elseif refueling_unit_coalition == 1 then
ProviderChecker.TankerRefuelingCountRedFor = ProviderChecker.TankerRefuelingCountRedFor - 1
end
end
-- Checks if tanker landed.
if (_event.id == 4) and _event.initiator then
if _event.initiator then
local LandedUnit = _event.initiator
local LandedUnitName = LandedUnit:getName()
local LandedUnitInfo = Unit.getGroup(LandedUnit)
local LandedUnitGroupName = LandedUnitInfo:getName()
for fueler, params in pairs(ProviderChecker.TankerTable) do
if LandedUnitGroupName == params.name then
if ProviderChecker.TankerRTBTimer > 5 then
trigger.action.outTextForCoalition(
LandedUnit:getCoalition(),
"Tanker " .. LandedUnit:getCallsign() .. " Landed - Respawning in " .. (ProviderChecker.TankerRTBTimer / 60) .. " minutes", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, LandedUnitGroupName, timer.getTime() + ProviderChecker.TankerRTBTimer)
else
trigger.action.outTextForCoalition(
LandedUnit:getCoalition(),
"Tanker " .. LandedUnit:getCallsign() .. " Landed - Respawning", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, LandedUnitGroupName, timer.getTime() + 5)
end
end
end
end
end
if (_event.id == 5) and _event.initiator then
local DeadUnit = _event.initiator
local DeadUnitName = DeadUnit:getName()
local DeadUnitInfo = Unit.getGroup(DeadUnit)
local DeadUnitGroupName = DeadUnitInfo:getName()
for fueler, params in pairs(ProviderChecker.TankerTable) do
if DeadUnitGroupName == params.name then
if ProviderChecker.TankerKilledTimer > 5 then
trigger.action.outTextForCoalition(
DeadUnit:getCoalition(),
"Tanker " .. DeadUnit:getCallsign() .. " has crashed! Replacement will be on station in " .. (ProviderChecker.TankerKilledTimer / 60) .. " minutes", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, DeadUnitGroupName, timer.getTime() + ProviderChecker.TankerKilledTimer)
else
trigger.action.outTextForCoalition(
DeadUnit:getCoalition(),
"Tanker " .. LandedUnit:getCallsign() .. " has crashed! Replacement will be on station in 5 Seconds", 10,false)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, DeadUnitGroupName, timer.getTime() + 5)
end
end
end
end
end
function ProviderChecker.AWACSeventHandler:onEvent(_event)
-- Checks if tanker landed.
if (_event.id == 4) and _event.initiator then
local LandedUnit = _event.initiator
local LandedUnitName = LandedUnit:getName()
local LandedUnitInfo = Unit.getGroup(LandedUnit)
local LandedUnitGroupName = LandedUnitInfo:getName()
for awacs, params in pairs(ProviderChecker.AwacsTable) do
if LandedUnitGroupName == params.name then
if ProviderChecker.AWACRTBTimer > 5 then
trigger.action.outTextForCoalition(
LandedUnit:getCoalition(),
"AWACS " .. LandedUnit:getCallsign() .. " Landed - Respawning in " .. (ProviderChecker.AWACRTBTimer / 60) .. " minutes", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, LandedUnitGroupName, timer.getTime() + ProviderChecker.AWACRTBTimer)
else
trigger.action.outTextForCoalition(
LandedUnit:getCoalition(),
"AWACS " .. LandedUnit:getCallsign() .. " Landed - Respawning", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, LandedUnitGroupName, timer.getTime() + 5)
end
end
end
end
if (_event.id == 5) and _event.initiator then
local DeadUnit = _event.initiator
local DeadUnitName = DeadUnit:getName()
local DeadUnitInfo = Unit.getGroup(DeadUnit)
local DeadUnitGroupName = DeadUnitInfo:getName()
for awacs, params in pairs(ProviderChecker.AwacsTable) do
if DeadUnitGroupName == params.name then
if ProviderChecker.AWACKilledTimer > 5 then
trigger.action.outTextForCoalition(
DeadUnit:getCoalition(),
"AWACS " .. DeadUnit:getCallsign() .. " has been shot down! Replacement will be on station in " .. (ProviderChecker.AWACKilledTimer / 60) .. " minutes", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, DeadUnitGroupName, timer.getTime() + ProviderChecker.AWACKilledTimer)
else
trigger.action.outTextForCoalition(
DeadUnit:getCoalition(),
"AWACS " .. DeadUnit:getCallsign() .. " has been shot down! Replacement will be on station in 5 Seconds", 10,false)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, DeadUnitGroupName, timer.getTime() + 5)
end
end
end
end
end
-- function ProviderChecker.ServiceCheckerMsg()
function ProviderChecker.GetServicesList()
-- You can -only- get TACAN data from the mission file. So since MIST respawn uses the same TACANs on respawn,
-- I can pull from the mission file and refresh that way
for coa_name, coa_data in pairs(env.mission.coalition) do
if (coa_name == 'red' or coa_name == 'blue') and type(coa_data) == 'table' then
if coa_data.country then --there is a country table
for cntry_id, cntry_data in pairs(coa_data.country) do
for obj_type_name, obj_type_data in pairs(cntry_data) do
if obj_type_name == "plane" then
if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then --there's a group!
for group_num, group_data in pairs(obj_type_data.group) do
group_Id = group_data.groupId
group_radio = group_data.frequency
group_name = env.getValueDictByKey(group_data.name)
if group_data.task == "Refueling" then
if group_data["units"][1]["type"] ~= "IL-78M" then
if group_data.tasks and group_data.tasks.parmas then
for tasks_id, tasks_data in pairs(group_data.tasks) do
if tasks_data.params and tasks_data.params.action and tasks_data.params.action.params then
tasks_data.params.action.params["coalition"] = coa_name
tasks_data.params.action.params["radio_freqeuncy"] = group_radio
tasks_data.params.action.params["name"] = group_name
tasks_data.params.action.params["has_tasking"] = true
ProviderChecker.TankerTable[group_Id] = tasks_data.params.action.params
end --if task_data.params
end -- for tasks_id, tasks_data
-- Because for some weird ass reason, the tasks will be blank so I need to pull them from waypoints instead
elseif group_data.route.points then
for point_id, point_params in pairs(group_data.route.points) do
if point_params.task then
for tasks_id, tasks_data in pairs(point_params.task.params.tasks) do
if tasks_data.params and tasks_data.params.action and tasks_data.params.action.id == "ActivateBeacon" then
tasks_data.params.action.params["coalition"] = coa_name
tasks_data.params.action.params["radio_freqeuncy"] = group_radio
tasks_data.params.action.params["name"] = group_name
tasks_data.params.action.params["has_tasking"] = true
ProviderChecker.TankerTable[group_Id] = tasks_data.params.action.params
end -- if tasks_data.params and
end -- for tasks_id, tasks_data in
end --if point_params.task
end -- for point_id, point_params
end -- if group_data.tasks then
else
ProviderChecker.TankerTable[group_Id] = {}
ProviderChecker.TankerTable[group_Id]["coalition"] = coa_name
ProviderChecker.TankerTable[group_Id]["radio_freqeuncy"] = group_radio
ProviderChecker.TankerTable[group_Id]["name"] = group_name
ProviderChecker.TankerTable[group_Id]["has_tasking"] = false
end -- group_data["units"][1]["type"] ~= "IL-78M" then
elseif group_data.task == "AWACS" then
ProviderChecker.AwacsTable[group_Id] = {}
ProviderChecker.AwacsTable[group_Id]["coalition"] = coa_name
ProviderChecker.AwacsTable[group_Id]["radio_freqeuncy"] = group_radio
ProviderChecker.AwacsTable[group_Id]["name"] = group_name
ProviderChecker.AwacsTable[group_Id]["modeChannel"] = "N/A"
ProviderChecker.AwacsTable[group_Id]["callsign"] = "N/A"
end --if group_data.tas == "Refueling then"
end --for group_num, group_data in pairs(obj_type_data.group) do
end --if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then
end --if obj_type_name == "helicopter" or obj_type_name == "ship" or obj_type_name == "plane" or obj_type_name == "vehicle" or obj_type_name == "static" then
end --for obj_type_name, obj_type_data in pairs(cntry_data) do
end --for cntry_id, cntry_data in pairs(coa_data.country) do
end --if coa_data.country then --there is a country table
end --if coa_name == 'red' or coa_name == 'blue' and type(coa_data) == 'table' then
end --for coa_name, coa_data in pairs(mission.coalition) do
end
world.addEventHandler(ProviderChecker.AWACSeventHandler)
env.info("F99th AWACS Checker event handler added")
world.addEventHandler(ProviderChecker.TankereventHandler)
env.info("F99th Tanker Checker event handler added")
ProviderChecker.GetServicesList()
timer.scheduleFunction(ProviderChecker.RefreshTACAN, nil, timer.getTime() + 10)
missionCommands.addCommandForCoalition(2,"Get Tanker Info",nil, ProviderChecker.TankerRadioStatus,2)
missionCommands.addCommandForCoalition(1,"Get Tanker Info",nil, ProviderChecker.TankerRadioStatus,1)
if ProviderChecker.TankerFuelChecking then
timer.scheduleFunction(ProviderChecker.checkTankerFuel, nil, timer.getTime() + 120)
end
if ProviderChecker.AWACFuelChecking then
timer.scheduleFunction(ProviderChecker.checkAWACSFuel, nil, timer.getTime() + 120)
end

Binary file not shown.

View File

@@ -0,0 +1,330 @@
-- The Battle of Gori by F99Th-TracerFacer
_SETTINGS:SetPlayerMenuOff()
ScoreRequiredToWin = 100
BlueCurrentScore = 0
RedCurrentScore = 0
StatBlueCratesMoved = 0
StatBlueRescued = 0
StatRedArtyUnitsDead = 0
StatRedCAPDead = 0
StatBlueCAPDead = 0
PlayerClients = SET_PLAYER:New():FilterStart()
:HandleEvent( EVENTS.Crash )
function PlayerClients:OnEventCrash( EventData )
local coal = EventData.initiator:getCoalition()
local side, oside
if coal == 1 then
side = 'RED'
oside = 'BLUE'
GoriPlayerName = EventData.initiator:getPlayerName()
if GoriPlayerName ~= nil then
MESSAGE:New("\n\nA " .. side .. " player ( " .. GoriPlayerName .. " ) has crashed! " .. oside .. " Team gains 1 point!", 10, "Alert!"):ToAll()
ScoreAddBlue(1)
StatRedCAPDead = StatRedCAPDead + 1
end
elseif coal == 2 then
side = 'BLUE'
oside = 'RED'
GoriPlayerName = EventData.initiator:getPlayerName()
if GoriPlayerName ~= nil then
MESSAGE:New("\n\nA " .. side .. " player ( " .. GoriPlayerName .. " ) has crashed! " .. oside .. " Team gains 1 point!", 10, "Alert!"):ToAll()
ScoreAddRed(1)
StatBlueCAPDead = StatBlueCAPDead + 1
end
else
env.info("**** We should not have gotten here! Moose_BattleofGori.lua ****")
end
end
-- Setup Shelling Zones
local BombZone1 = ZONE_POLYGON:New("BombZone1", GROUP:FindByName( "BombZone1"))
local HighAirShellingZone = ZONE:New("HIGH AIR SHELLING ZONE")
-- Setup Arty Zone
local ArtyTemplate = { "RU_ARTY", "RU_ARTY #001", "RU_ARTY #002", "RU_ARTY_SA8", "RU_ARTY_SA9", "RU_ARTY_SA11" }
local ArtyZone = ZONE_POLYGON:New( "ARTY LOCATIONS", GROUP:FindByName( "ARTY LOCATIONS" ))
local ArtyZoneTable = { ArtyZone }
-- Setup SA10 Zone
local SA10Zone = ZONE_POLYGON:New( "SA10 LOCATIONS", GROUP:FindByName( "SA10 LOCATIONS" ))
local SA10ZoneTable = { SA10Zone }
-- Setup Arty Spawns (Thanks to GoreUncle for helping with the OnEventDead stuff :)
ArtySpawns = SPAWN:New( "Arty Force" )
:InitLimit( 60, 0 )
:InitHeading(260,280)
:InitRandomizeZones( ArtyZoneTable )
:InitRandomizeTemplate( ArtyTemplate )
:OnSpawnGroup(
function(SpawnedGroup)
SpawnedGroup:HandleEvent( EVENTS.Dead )
function SpawnedGroup:OnEventDead( EventData )
MESSAGE:New("NATO Forces have destroyed an Artillery Unit! Blue Team gets 1 point!\n\n", 10, "Alert!", true):ToAll()
ScoreAddBlue(1)
StatRedArtyUnitsDead = StatRedArtyUnitsDead + 1
end
end
):SpawnScheduled( .1, .2 )
-- Mission Status msg - used in F10 menu and when certain units are killed.
function MissionStatus(MsgTime)
MissionStatusMsg = MESSAGE:New(
"\n\n\nBlue Score: " .. BlueCurrentScore ..
"\nRed Score : " .. RedCurrentScore .. "\n\n" ..
"Required to win: " .. ScoreRequiredToWin .. "\n\n", MsgTime, "Mission Status", false):ToAll()
end
function ScoreAddBlue(AddScore)
BlueCurrentScore = BlueCurrentScore + AddScore
MissionStatus(10)
end
function ScoreAddRed(AddScore)
RedCurrentScore = RedCurrentScore + AddScore
MissionStatus(10)
end
local SA10Template = { "SA10_" }
-- Setup SA10 Spawns
SA10Spawns = SPAWN:New( "SA10_" )
:InitLimit( 24, 48 )
:InitHeading(260,280)
:InitRandomizeZones( SA10ZoneTable )
:InitRandomizeTemplate( SA10Template )
:SpawnScheduled( 500, .2 )
-- Different Schedulers are configured for different senarios. Ground Shelling, Low Air Shelling, and High Air Shelling.
-- This shelling works independantly of the actual arty units above.
-- Example:
-- ShellingScheduler = SCHEDULER:New(SchedulerObject,SchedulerFunction,SchedulerArguments,Start,Repeat,RandomizeFactor,Stop)
-- Setup Shelling Zones
local BombZone1 = ZONE_POLYGON:New("BombZone1", GROUP:FindByName( "BombZone1"))
local HighAirShellingZone = ZONE:New("HIGH AIR SHELLING ZONE")
GroundShellingScheduler = SCHEDULER:New( nil,
function()
Exp_Strength = math.random(300, 1000)
Exp_Zone = BombZone1
Blast_Location = Exp_Zone:GetRandomVec2()
Explode = COORDINATE:NewFromVec2( Blast_Location,0)
Explode:Explosion( Exp_Strength )
end, {}, 10, 15, .5
)
AirLowShellingScheduler = SCHEDULER:New( nil,
function()
Exp_Strength = math.random(300, 700)
Exp_Alt = math.random(50, 500)
Exp_Zone = BombZone1
Blast_Location = Exp_Zone:GetRandomVec2()
Explode = COORDINATE:NewFromVec2( Blast_Location, Exp_Alt)
Explode:Explosion( Exp_Strength )
end, {}, 10, 1, .2
)
-- HighAirShellingScheduler = SCHEDULER:New( nil,
--
-- function()
--
-- Exp_Strength = math.random(300, 700)
-- Exp_Alt = math.random(50, 15000)
-- Exp_Zone = HighAirShellingZone
-- Blast_Location = Exp_Zone:GetRandomVec2()
-- Explode = COORDINATE:NewFromVec2( Blast_Location, Exp_Alt)
-- Explode:Explosion( Exp_Strength )
--
--
-- end, {}, 10, 1, .8
-- )
MonitorWinCondition = SCHEDULER:New( nil,
function()
if BlueCurrentScore >= ScoreRequiredToWin then
MsgTime = 218
MESSAGE:New("NATO Forces have won the day!!\n\nMission will restart shortly.\n\n", MsgTime, "Winner!", true):ToAll()
MissionStatus(MsgTime)
MsgScorePercent(MsgTime)
trigger.action.setUserFlag(66, true)
end
if RedCurrentScore >= ScoreRequiredToWin then
MsgTime = 218
MESSAGE:New("Russian Forces have won the day!!\n\nMission will restart shortly.\n\n", MsgTime, "Winner!", true):ToAll()
MissionStatus(MsgTime)
MsgScorePercent(MsgTime)
trigger.action.setUserFlag(66, true)
end
end, {}, 10, 1, 0
)
function MsgScorePercent(MsgTime)
MESSAGE:New("\n\n\nRed:\n" ..
"------Blue Shot Down: " .. StatBlueCAPDead .. "%\n\n" ..
"Blue:\n" ..
"------Red Shot Down: " .. StatRedCAPDead .. "%\n" ..
"------Blue Crates Moved: " .. StatBlueCratesMoved .. "%\n" ..
"------Blue Rescues: " .. StatBlueRescued .. "%\n\n", MsgTime, "Stat Breakdown Percentages", false):ToAll()
end
SEAD_RU_SAM_Defenses = SEAD:New( {
'SA10_#001',
'SA10_#002',
'SA10_#003',
'SA10_#004',
'RU_AAA #001',
'RU_AAA #002',
'RU_AAA #003',
'RU_AAA #004',
'RU_AAA #005',
'RED EWR #003'
} )
-----------Spawn AWACS------------------------------
Spawn_BlueEWR = SPAWN:New("BLUE EWR"):InitLimit( 1, 50 )
:InitRepeatOnEngineShutDown()
:InitCleanUp(120)
:SpawnScheduled(300,.3)
Spawn_RedEWR = SPAWN:New("RED EWR"):InitLimit( 1, 50 )
:InitRepeatOnEngineShutDown()
:InitCleanUp(120)
:SpawnScheduled(300,.4)
Spawn_Blue135 = SPAWN:New("Shell SHL 42 X 253"):InitLimit( 1, 50 )
:InitRepeatOnEngineShutDown()
:InitCleanUp(120)
:SpawnScheduled(300,.3)
Spawn_Blue135MPRS = SPAWN:New("Texaco TEX 41 X 252"):InitLimit( 1, 50 )
:InitRepeatOnEngineShutDown()
:InitCleanUp(120)
:SpawnScheduled(300,.3)
--Setup the BLUEA2A dispatcher, and initialize it.
BLUEBorderZone = ZONE_POLYGON:New( "BLUE BORDER", GROUP:FindByName( "BLUE BORDER" ) )
BLUEA2ADispatcher = AI_A2A_GCICAP:New( { "BLUE EWR" }, { "FIGHTER SWEEP BLUE" }, { "BLUE BORDER" }, 1 )
BLUEA2ADispatcher:SetDefaultLandingAtRunway()
BLUEA2ADispatcher:SetDefaultTakeoffInAir()
BLUEA2ADispatcher:SetBorderZone( BLUEBorderZone )
BLUEA2ADispatcher:SetTacticalDisplay(false)
BLUEA2ADispatcher:SetDefaultFuelThreshold( 0.20 )
BLUEA2ADispatcher:SetRefreshTimeInterval( 300 )
--Setup the RedA2A dispatcher, and initialize it.
CCCPBorderZone = ZONE_POLYGON:New( "RED BORDER", GROUP:FindByName( "RED BORDER" ) )
RedA2ADispatcher = AI_A2A_GCICAP:New( { "RED EWR" }, { "FIGHTER SWEEP RED" }, { "RED BORDER" }, 2 )
RedA2ADispatcher:SetDefaultLandingAtRunway()
RedA2ADispatcher:SetDefaultTakeoffInAir()
RedA2ADispatcher:SetBorderZone( CCCPBorderZone )
RedA2ADispatcher:SetTacticalDisplay(false)
RedA2ADispatcher:SetDefaultFuelThreshold( 0.20 )
RedA2ADispatcher:SetRefreshTimeInterval( 300 )
--Setup the VazianiDispatcher and initialize it.
VazianiBorderZone = ZONE_POLYGON:New( "VAZIANI DEFENSE ZONE", GROUP:FindByName( "VAZIANI DEFENSE ZONE" ) )
VazianiDispatcher = AI_A2A_GCICAP:New( { "RED EWR" }, { "FIGHTER SWEEP RED" }, { "VAZIANI DEFENSE ZONE" }, 0 )
VazianiDispatcher:SetDefaultLandingAtRunway()
VazianiDispatcher:SetDefaultTakeoffInAir()
VazianiDispatcher:SetBorderZone( VazianiBorderZone )
VazianiDispatcher:SetTacticalDisplay(false)
VazianiDispatcher:SetDefaultFuelThreshold( 0.20 )
VazianiDispatcher:SetRefreshTimeInterval( 60 )
VazianiDispatcher:SetDefaultOverhead(2)
--Setup the Kutasi Dispatcher and initialize it.
KutasiBorderZone = ZONE_POLYGON:New( "KUTASI DEFENSE ZONE", GROUP:FindByName( "KUTASI DEFENSE ZONE" ) )
KutasiDispatcher = AI_A2A_GCICAP:New( { "BLUE EWR" }, { "FIGHTER SWEEP BLUE" }, { "KUTASI DEFENSE ZONE" }, 0 )
KutasiDispatcher:SetDefaultLandingAtRunway()
KutasiDispatcher:SetDefaultTakeoffInAir()
KutasiDispatcher:SetBorderZone( KutasiBorderZone )
KutasiDispatcher:SetTacticalDisplay(false)
KutasiDispatcher:SetDefaultFuelThreshold( 0.20 )
KutasiDispatcher:SetRefreshTimeInterval( 60 )
KutasiDispatcher:SetDefaultOverhead(2)
-- Random RU Troop Zones
local T1Z = ZONE_POLYGON:New("RU_TROOPS_ZONE_1", GROUP:FindByName("RU_TROOPS_ZONE_1"))
local TroopZoneTable = { T1Z, T1Z, T1Z, T1Z, T1Z, BombZone1 }
local TroopTemplate = { "RU_TROOPS #001", "RU_TROOPS #002", "RU_TROOPS #003", "RU_TROOPS #004" }
RU_TroopSpawns_Initial = SPAWN:New("Troops")
:InitLimit(150, 1000)
:InitHeading(290, 250)
:InitRandomizeTemplate( TroopTemplate )
:InitRandomizeZones( TroopZoneTable )
:SpawnScheduled( 600, .2 )
-----------US Troops------------------------------
SpawnUSTroops1 = SPAWN:New("US_INFANTRY #001")
:InitLimit( 10, 500 )
:SpawnScheduled(120, .1)
:InitRandomizeRoute( 1, 1, 800)
:InitCleanUp(120)
SpawnUSTroops2 = SPAWN:New("US_INFANTRY #002")
:InitLimit( 10, 500 )
:SpawnScheduled(120, .3)
:InitRandomizeRoute( 1, 1, 800)
:InitCleanUp(120)
SpawnUSTroops3 = SPAWN:New("US_INFANTRY #003")
:InitLimit( 10, 500 )
:SpawnScheduled(120, .2)
:InitRandomizeRoute( 1, 1, 800)
:InitCleanUp(120)

View File

@@ -0,0 +1,37 @@
weapRestrict = {}
weapRestrict.playerTakeOff ={}
weapRestrict.weapon2BAN={"weapons.bombs.RN-24","weapons.bombs.RN-28"}
function weapRestrict.playerTakeOff:onEvent(e)
if e.id == world.event.S_EVENT_TAKEOFF and e.initiator then
local playerGroup = e.initiator:getGroup()
local playerGroupID = playerGroup:getID()
local wCount
local i
local bCount
local bwCount
local checkPayload = e.initiator:getAmmo()
local pUnitPos = e.initiator:getPoint()
local uIdS
uIdS = tostring(playerGroupID)
if checkPayload then
for bCount =1, #checkPayload do
for bwCount = 1, #weapRestrict.weapon2BAN do
if weapRestrict.weapon2BAN[bwCount] == checkPayload[bCount].desc.typeName then
local naughty_player = e.initiator:getPlayerName()
trigger.action.outText("Restricted Weapon detected: " .. checkPayload[bCount].desc.typeName .. ", this weapon is BANNED, ".. naughty_player .. " kicking to spectator", 120)
trigger.action.outText("NukeUser:".. naughty_player, 0.01)
return
end
end
end
end
end
end
world.addEventHandler(weapRestrict.playerTakeOff)

View File

@@ -0,0 +1,53 @@
onEngineStart = {}
function onEngineStart:onEvent(event)
if world.event.S_EVENT_BIRTH == event.id and event.initiator:getPlayerName() ~= nil then
local playerGroup = event.initiator:getGroup()
local playerUnit = playerGroup:getUnit(1)
local playerName = playerUnit:getPlayerName()
local playerSide = playerGroup:getCoalition()
local playerID = playerGroup:getID()
local playerAircraft = playerUnit:getTypeName()
local MissionName =
"======[ Fighting 99th - Battle of Gori ]======"
local TeamSpeak =
"Please join our TeamSpeak server @ teamspeak.f99th.com for improved comms and a better mission experience!"
local ObjectiveRed =
"===============[ MISSION OBJECTIVE ]==============\n" ..
"CAP - Keep skies over Gori clear of NATO aircraft.\n\n"
local ObjectiveBlue =
"===============[ MISSION OBJECTIVE ]==============\n" ..
"CAP - Control the airspace above the Gori Valley. Protect CAS and HELO aircraft as the attempt to destroy artillery positions and retrieve medvacs from the city.\n\n" ..
"CAS - Destroy Russian AAA and artillery units surrounding the City of Gori. Clear a path for helo operations as they attempt to rescue our people. Leave no one behind!\n\n" ..
"HELO - CAS and AFAC Helos are available. Fly to the town of Gori, land near the blue smoke zones. Use CDLD F10 Menu to pick up MEDVACS. Fly to the green smoke and unload the troops using the same menu.\n\n"
local SmokeZones =
"=================[ SMOKE ZONES ]================\n" ..
"RED SMOKE : AFAC Targets for CAS.\n" ..
"BLUE SMOKE : PICKUP MEDEVACS FROM THIS LOCATION.\n" ..
"GREEN SMOKE: RETURN MEDEVACS TO THIS LOCATION.\n\n"
local EndBrief = "===============[ END MISSION BRIEF ]==============\n\n"
-- Send appropriate message to each coalition.
if playerSide == coalition.side.BLUE then --blue team
trigger.action.outTextForGroup(playerID, "" .. MissionName .. "\n\n" .. "Welcome to a F99th DCS Server, " .. playerName .. "!" .. "\n\n" .. TeamSpeak .. "\n\n" .. ObjectiveBlue .. SmokeZones .. EndBrief, 120)
end
if playerSide == coalition.side.RED then -- red team
trigger.action.outTextForGroup(playerID, "" .. MissionName .. "\n\n" .. "Welcome to a F99th DCS Server, " .. playerName .. "!" .. "\n\n" .. TeamSpeak .. "\n\n" .. ObjectiveRed .. EndBrief, 120)
end
-- trigger.action.outSoundForGroup(playerID, "l10n/DEFAULT/battlemusic.ogg") -- Damn Cry Babbies
end
end
world.addEventHandler(onEngineStart)

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,176 @@
_SETTINGS:SetPlayerMenuOff()
HQ = GROUP:FindByName( "HQ", "Bravo HQ" )
CommandCenter = COMMANDCENTER:New( HQ, "Bravo" )
Scoring = SCORING:New( "Bunker Busting" )
--------------Random Air Traffic--------------
-- local rat130 = RAT:New("RAT_130")
-- rat130:SetDeparture({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- rat130:SetDestination({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- rat130:ContinueJourney()
-- rat130:Spawn(1)
--
-- local ratB52 = RAT:New("RAT_B52")
-- ratB52:SetDeparture({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratB52:SetDestination({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratB52:ContinueJourney()
-- ratB52:Spawn(1)
--
-- local ratc17 = RAT:New("RAT_C17")
-- ratc17:SetDeparture({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratc17:SetDestination({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratc17:ContinueJourney()
-- ratc17:Spawn(1)
--
-- local ratf117 = RAT:New("RAT_F117")
-- ratf117:SetDeparture({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratf117:SetDestination({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratf117:ContinueJourney()
-- ratf117:Spawn(1)
--
-- local ratbch53 = RAT:New("RAT_CH53")
-- ratbch53:SetDeparture({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratbch53:SetDestination({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratbch53:ContinueJourney()
-- ratbch53:Spawn(1)
--
-- local ratApache = RAT:New("RAT_APACHE")
-- ratApache:SetDeparture({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratApache:SetDestination({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratApache:ContinueJourney()
-- ratApache:Spawn(1)
--
-- local ratCobra = RAT:New("RAT_COBRA")
-- ratCobra:SetDeparture({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratCobra:SetDestination({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratCobra:ContinueJourney()
-- ratCobra:Spawn(1)
--
-- local ratF4 = RAT:New("RAT_F4")
-- ratF4:SetDeparture({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratF4:SetDestination({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratF4:ContinueJourney()
-- ratF4:Spawn(1)
--
-- local ratS3b = RAT:New("RAT_S3B")
-- ratS3b:SetDeparture({"Senaki-Kolkhi","Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratS3b:SetDestination({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratS3b:ContinueJourney()
-- ratS3b:Spawn(1)
--
-- local ratHawk = RAT:New("RAT_HAWK")
-- ratHawk:SetDeparture({"Senaki-Kolkhi","Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratHawk:SetDestination({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratHawk:ContinueJourney()
-- ratHawk:Spawn(1)
--
-- local ratC101 = RAT:New("RAT_c101")
-- ratC101:SetDeparture({"Senaki-Kolkhi","Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratC101:SetDestination({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratC101:ContinueJourney()
-- ratC101:Spawn(1)
--
-- local ratL39 = RAT:New("RAT_l39")
-- ratL39:SetDeparture({"Senaki-Kolkhi","Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratL39:SetDestination({"Senaki-Kolkhi", "Senaki-Kolkhi", "Sukhumi-Babushara", "Gudauta", "Sochi-Adler"})
-- ratL39:ContinueJourney()
-- ratL39:Spawn(1)
-----------Spawn AWACS------------------------------
-- -- Refueling
-- Spawn_KC135 = SPAWN:New("KC-135"):InitLimit( 1, 50 )
-- Spawn_KC135:InitRepeatOnLanding()
-- Spawn_KC135:SpawnScheduled(600,.1)
--
-- Spawn_KC130 = SPAWN:New("KC-130"):InitLimit( 1, 50 )
-- Spawn_KC130:InitRepeatOnLanding()
-- Spawn_KC130:SpawnScheduled(600,.2)
------------------- CCCP SEAD Defenses------------------------------
SEAD_RU_SAM_Defenses = SEAD:New( {
'AAA 6 #005',
'AAA 6 #003',
'AAA 6 #004',
'AAA 3',
'AAA 4',
'AAA 5',
'AAA 5 #001',
'AAA #006',
'MISSION 6 DEF #001',
'MISSION 6 DEF #002',
} )
local TemplateTable = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N" }
local M1Z = ZONE_POLYGON:New( "MISSION 1 ZONE", GROUP:FindByName( "MISSION 1 ZONE" ))
local M2Z = ZONE_POLYGON:New( "MISSION 2 ZONE", GROUP:FindByName( "MISSION 2 ZONE" ))
local M3Z = ZONE_POLYGON:New( "MISSION 3 ZONE", GROUP:FindByName( "MISSION 3 ZONE" ))
local M4Z = ZONE_POLYGON:New( "MISSION 4 ZONE", GROUP:FindByName( "MISSION 4 ZONE" ))
local M5Z = ZONE_POLYGON:New( "MISSION 5 ZONE", GROUP:FindByName( "MISSION 5 ZONE" ))
local M6Z = ZONE_POLYGON:New( "MISSION 6 ZONE", GROUP:FindByName( "MISSION 6 ZONE" ))
local ZoneTable = { M1Z, M2Z, M3Z, M4Z, M5Z, M6Z }
Spawn_Vehicle_1 = SPAWN:New( "RU GROUND FORCE" )
:InitLimit( 80, 80 )
:InitRandomizeZones( ZoneTable )
:InitRandomizeTemplate( TemplateTable )
:SpawnScheduled( .1, .2 )
--Setup the BLUEA2A dispatcher, and initialize it.
BLUEBorderZone = ZONE_POLYGON:New( "BLUE BORDER", GROUP:FindByName( "BLUE BORDER" ) )
BLUEA2ADispatcher = AI_A2A_GCICAP:New( { "BLUE EWR" }, { "FIGHTER SWEEP BLUE" }, { "BLUE BORDER" }, 2 )
BLUEA2ADispatcher:SetDefaultLandingAtRunway()
BLUEA2ADispatcher:SetDefaultTakeoffFromParkingCold()
BLUEA2ADispatcher:SetBorderZone( BLUEBorderZone )
BLUEA2ADispatcher:SetTacticalDisplay(false)
BLUEA2ADispatcher:SetDefaultFuelThreshold( 0.20 )
BLUEA2ADispatcher:SetRefreshTimeInterval( 240 )
BLUEA2ADispatcher:SetDefaultOverhead(.25)
BLUEA2ADispatcher:SetDefaultCapLimit(2)
--Setup the RedA2A dispatcher, and initialize it.
CCCPBorderZone = ZONE_POLYGON:New( "RED BORDER", GROUP:FindByName( "RED BORDER" ) )
RedA2ADispatcher = AI_A2A_GCICAP:New( { "RED EWR" }, { "FIGHTER SWEEP RED" }, { "RED BORDER" }, 2 )
RedA2ADispatcher:SetDefaultLandingAtRunway()
RedA2ADispatcher:SetDefaultTakeoffFromParkingCold()
RedA2ADispatcher:SetBorderZone( CCCPBorderZone )
RedA2ADispatcher:SetTacticalDisplay(false)
RedA2ADispatcher:SetDefaultFuelThreshold( 0.20 )
RedA2ADispatcher:SetRefreshTimeInterval( 240 )
RedA2ADispatcher:SetDefaultOverhead(.25)
RedA2ADispatcher:SetDefaultCapLimit(4)
--ADDED 2020 ATIS
--atisGudauta=ATIS:New("Gudauta", 126.50)
--atisGudauta:SetTowerFrequencies({259.000, 130.000})
--atisGudauta:Start(50)
--atisSochi=ATIS:New("Sochi-Adler", 126.00)
--atisSochi:SetTowerFrequencies({256.000, 127.000})
--atisSochi:AddILS(111.10, "6")
--atisSochi:Start(30)
--atisSenaki=ATIS:New("Senaki-Kolkhi", 125.50)
--atisSenaki:SetTowerFrequencies({261.000, 132.000})
--atisSenaki:AddILS(108.90, "9")
--atisSenaki:SetTACAN(31)
--atisSenaki:Start(60)
--atisSukhumi=ATIS:New("Sukhumi-Babushara", 125.00)
--atisSukhumi:SetTowerFrequencies({258.000, 129.000})
--atisSukhumi:Start(20)

View File

@@ -0,0 +1,54 @@
onEngineStart = {}
function onEngineStart:onEvent(event)
if world.event.S_EVENT_BIRTH == event.id and event.initiator:getPlayerName() ~= nil then
local playerGroup = event.initiator:getGroup()
local playerUnit = playerGroup:getUnit(1)
local playerName = playerUnit:getPlayerName()
local playerSide = playerGroup:getCoalition()
local playerID = playerGroup:getID()
local playerAircraft = playerUnit:getTypeName()
local MissionName =
"======[ Fighting 99th - Bunker Busting ]======"
local TeamSpeak =
"Please join our TeamSpeak server @ teamspeak.f99th.com for improved comms and a better mission experience!"
local ObjectiveRed =
"===============[ MISSION OBJECTIVE ]==============\n" ..
"U.S. intel has discovered our vast network of Command Bunkers located in the caucus mountains. We've hidden them deep in the valleys and small towns.\n\n" ..
"Your Primary objective is protecting the skies above our bunkers. Work closely with your teammates and focus on attack and AFAC aircraft.\n\n"
local ObjectiveBlue =
"===============[ MISSION OBJECTIVE ]==============\n" ..
"CAP - There is heavy enemy fighter presence over the 6 way points in your NAV systems. We need to keep the skies clear of enemy fighters so that CAS aircraft can destroy the Command Bunkers at each location.\n\n" ..
"CAS - Destroy the Command Bunkers at each of the way points in your NAV systems. Expect random AAA resistance. See the Mission Briefing [ Alt-B ] for image of the Bunker.\n\n" ..
"HELO - CAS and AFAC Helos are available. Help eliminate AAA units around each WP. There are multiple FARPS to take off from and land at for re-arm/re-pair.\n\n"
-- local SmokeZones =
-- "=================[ SMOKE ZONES ]================\n" ..
-- "RED SMOKE : OWNED BY RED FORCES.\n" ..
-- "GREEN SMOKE: EMPTY - READY FOR CAPTURE.\n" ..
-- "BLUE SMOKE : OWNED BY U.S. FORCES.\n\n" ..
local EndBrief = "===============[ END MISSION BRIEF ]==============\n\n"
-- Send appropriate message to each coalition.
if playerSide == coalition.side.BLUE then --blue team
trigger.action.outTextForGroup(playerID, "" .. MissionName .. "\n\n" .. "Welcome to a F99th DCS Server, " .. playerName .. "!" .. "\n\n" .. TeamSpeak .. "\n\n" .. ObjectiveBlue .. EndBrief, 120)
end
if playerSide == coalition.side.RED then -- red team
trigger.action.outTextForGroup(playerID, "" .. MissionName .. "\n\n" .. "Welcome to a F99th DCS Server, " .. playerName .. "!" .. "\n\n" .. TeamSpeak .. "\n\n" .. ObjectiveRed .. EndBrief, 120)
end
-- trigger.action.outSoundForGroup(playerID, "l10n/DEFAULT/battlemusic.ogg") -- Damn Cry Babbies
end
end
world.addEventHandler(onEngineStart)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 395 KiB

View File

@@ -0,0 +1,464 @@
--Verion 1.4.2
ProviderChecker = {}
-- Best to leave this on for the most part.
ProviderChecker.TankerFuelChecking = true
-- Only necessary to set if you don't set them to invicible
ProviderChecker.TankerKilledTimer = 60
-- Good to set even if you are using Fuel Check, in case it lands for some weird AI reason.
ProviderChecker.TankerRTBTimer = 60
-- If you want it to respawn when fuel state reaches 20%, instead of having it RTB all the way to base.
ProviderChecker.AWACFuelChecking = true
-- Killed Timer is the time delay to respawn for killed in seconds. Minimum of 5 seconds, anything less will default to 5 seconds
ProviderChecker.AWACKilledTimer = 600
-- RTB Timer is time delay to respawn from landing. Can be 0
ProviderChecker.AWACRTBTimer = 60
ProviderChecker.AWACSeventHandler = {}
ProviderChecker.TankereventHandler = {}
ProviderChecker.TankerTable = {}
ProviderChecker.AwacsTable = {}
ProviderChecker.TankerRefuelingCountBlueFor = 0
ProviderChecker.TankerRefuelingCountRedFor = 0
--Tankers waiting for respawn
ProviderChecker.TankerStandbyTable= {}
function ProviderChecker.TankerRadioStatus(radio_coalition)
local coalition_side = ""
if radio_coalition == 1 then
coalition_side = coalition_side .. "red"
elseif radio_coalition == 2 then
coalition_side = coalition_side .. "blue"
end
local tanker_status_start = "===========================\n"
local tanker_status_end = "==========================="
local tanker_status_mid = ""
for fueler, params in pairs(ProviderChecker.TankerTable) do
if params.coalition == coalition_side then
if params.has_tasking then
local m_tanker_id = Group.getByName(params.name)
local m_tanker_radio = params.radio_freqeuncy
local m_tanker_units = m_tanker_id:getUnits()
local m_tanker_unit = m_tanker_units[1]
local m_tanker_callsign = m_tanker_unit:getCallsign()
local m_tanker_channel = params.channel
local m_tanker_mode = params.modeChannel
local m_tanker_ac_type = m_tanker_unit:getTypeName()
tanker_status_mid = tanker_status_mid .. "Tanker: " .. m_tanker_callsign .. " Radio: " .. m_tanker_radio ..
" TACAN: " .. m_tanker_channel .. m_tanker_mode .. " Aircraft: " .. m_tanker_ac_type .. "\n"
else
local m_tanker_id = Group.getByName(params.name)
local m_tanker_radio = params.radio_freqeuncy
local m_tanker_units = m_tanker_id:getUnits()
local m_tanker_unit = m_tanker_units[1]
local m_tanker_callsign = m_tanker_unit:getCallsign()
tanker_status_mid = tanker_status_mid .. "Tanker: " .. m_tanker_callsign .. " Radio: " .. m_tanker_radio ..
" TACAN: N/A" .. " Aircraft: " .. m_tanker_ac_type .. "\n"
end
end
end
local out_message = tanker_status_start .. tanker_status_mid .. tanker_status_end
trigger.action.outTextForCoalition(radio_coalition, out_message, 30, true)
end
function ProviderChecker.RefreshTACAN(_nil,time)
for fueler, params in pairs(ProviderChecker.TankerTable) do
if params.has_tasking then
local tanker_id = Group.getByName(params.name)
if tanker_id then
local tanker_controller = tanker_id:getController()
local tanker_tacan = {
id = 'ActivateBeacon',
params = {
["type"] = params.type,
["AA"] = params.AA,
["unitId"] = tanker_id,
["modeChannel"] = params.modeChannel,
["channel"] = params.channel,
["system"] = params.system,
["callsign"] = params.callsign,
["bearing"] = params.bearing,
["frequency"] = params.frequency,
}
}
tanker_controller:setCommand(tanker_tacan)
end
end
end
return time + 10
end
--Will Eventually consoldate these to one function. Pass type (awacs or tanker) as argument.
function ProviderChecker.SpawnNewTanker(_unit, time)
--respawn uses the same name, and tankers are tracked by name instead of ID. Will change this for AWACS in future update.
NewGroup = mist.respawnGroup(_unit,true)
NewName = NewGroup.units[1].name
NewUnit = Unit.getByName(NewName)
tanker_controller = NewUnit:getController()
for tanker, params in pairs(ProviderChecker.TankerTable) do
if params.name == NewName then
local frequency = tonumber(params.radio_freqeuncy) * 1000000
SetFrequency = {
id = 'SetFrequency',
params = {
frequency = frequency,
modulation = 0,
}
}
tanker_controller:setCommand(SetFrequency)
trigger.action.outTextForCoalition(NewUnit:getCoalition(),"Tanker " ..NewUnit:getCallsign().. " is back online!", 10, false)
end
end
return nil
end
function ProviderChecker.SpawnNewAwacs(_unit, time)
NewGroup = mist.respawnGroup(_unit,true)
NewName = NewGroup.units[1].name
NewUnit = Unit.getByName(NewName)
awacs_controller = NewUnit:getController()
for awacs, params in pairs(ProviderChecker.AwacsTable) do
if params.name == NewName then
local frequency = tonumber(params.radio_freqeuncy) * 1000000
SetFrequency = {
id = 'SetFrequency',
params = {
frequency = frequency,
modulation = 0,
}
}
awacs_controller:setCommand(SetFrequency)
trigger.action.outTextForCoalition(NewUnit:getCoalition(),"AWACS " .. NewUnit:getCallsign() .. " is back online!", 10, false)
end
end
return nil
end
--due to how scheduled functions work, I need to create a class to handle this. Will upgrade later next revision.
function ProviderChecker.checkTankerFuel(_nil,time)
for fueler, params in pairs(ProviderChecker.TankerTable) do
local fueler_group_name = params.name
local fueler_group = Group.getByName(fueler_group_name)
if fueler_group then
local fueler_units = fueler_group:getUnits()
local fueler_id = fueler_units[1]
local fueler_fuel = fueler_id:getFuel()
if fueler_fuel < 0.20 then
if params.coalition == "blue" then
if ProviderChecker.TankerRefuelingCountBlueFor < 1 then
trigger.action.outTextForCoalition(
fueler_id:getCoalition(),
"Tanker " .. fueler_id:getCallsign() .. " Is out of Fuel. Respawning in 5 seconds",
10
)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, fueler_group_name, timer.getTime() + 5)
elseif ProviderChecker.TankerRefuelingCountBlueFor > 0 then
trigger.action.outTextForCoalition(
fueler_id:getCoalition(),
"Tanker " .. fueler_id:getCallsign() .. " fuel at less than 20%. Will respawn when no aircraft are refueling",
10
)
end
elseif params.coalition == "red" then
if ProviderChecker.TankerRefuelingCountRedFor < 1 then
trigger.action.outTextForCoalition(
fueler_id:getCoalition(),
"Tanker " .. fueler_id:getCallsign() .. " Is out of Fuel. Respawning in 5 seconds",
10
)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, fueler_group_name, timer.getTime() + 5)
elseif ProviderChecker.TankerRefuelingCountRedFor > 0 then
trigger.action.outTextForCoalition(
fueler_id:getCoalition(),
"Tanker " .. fueler_id:getCallsign() .. " fuel at less than 20%. Will respawn when no aircraft are refueling",
10
)
end
end
elseif fueler_fuel < 0.22 then
trigger.action.outTextForCoalition(
fueler_id:getCoalition(),
"Tanker " .. fueler_id:getCallsign() .. " at 25%. Will respawn at 20% if no aircraft are refueling",
10
)
end
end
end
return time + 120
end
function ProviderChecker.checkAWACSFuel(_nil,time)
--Due to the respawn and scheduledFunction limitations, Checking Refuel requires imediate respawn, else it would loop to respawn again and again.
for awacs, params in pairs(ProviderChecker.AwacsTable) do
local awacs_group_name = params.name
local awacs_group = Group.getByName(awacs_group_name)
if awacs_group then
local awacs_units = awacs_group:getUnits()
local awacs_id = awacs_units[1]
local awacs_fuel = awacs_id:getFuel()
if awacs_fuel < 0.30 then
if params.coalition == "blue" then
trigger.action.outTextForCoalition(
awacs_id:getCoalition(),
"AWACS " .. awacs_id:getCallsign() .. " Is out of Fuel. Respawning in 5 seconds",
10
)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, awacs_group_name, timer.getTime() + 5)
elseif params.coalition == "red" then
trigger.action.outTextForCoalition(
awacs_id:getCoalition(),
"AWACS " .. awacs_id:getCallsign() .. " Is out of Fuel. Respawning in 5 seconds",
10
)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, awacs_group_name, timer.getTime() + 5)
end
end
end
end
return time + 120
end
function ProviderChecker.TankereventHandler:onEvent(_event)
-- Adds up the number of units taking fuel because the event handler is based on unit taking fuel, not giving fuel
-- Solution to this later will be check nearest unit of type tanker and create a "class" out of that.
if (_event.id == 7) and _event.initiator then
local refueling_unit = _event.initiator
local refueling_unit_coalition = refueling_unit:getCoalition()
if refueling_unit_coalition == 2 then
ProviderChecker.TankerRefuelingCountBlueFor = ProviderChecker.TankerRefuelingCountBlueFor + 1
elseif refueling_unit_coalition == 1 then
ProviderChecker.TankerRefuelingCountRedFor = ProviderChecker.TankerRefuelingCountRedFor + 1
end
end
-- Removes the number of units taking fuel
if (_event.id == 14) and _event.initiator then
local refueling_unit = _event.initiator
local refueling_unit_coalition = refueling_unit:getCoalition()
if refueling_unit_coalition == 2 then
ProviderChecker.TankerRefuelingCountBlueFor = ProviderChecker.TankerRefuelingCountBlueFor - 1
elseif refueling_unit_coalition == 1 then
ProviderChecker.TankerRefuelingCountRedFor = ProviderChecker.TankerRefuelingCountRedFor - 1
end
end
-- Checks if tanker landed.
if (_event.id == 4) and _event.initiator then
if _event.initiator then
local LandedUnit = _event.initiator
local LandedUnitName = LandedUnit:getName()
local LandedUnitInfo = Unit.getGroup(LandedUnit)
local LandedUnitGroupName = LandedUnitInfo:getName()
for fueler, params in pairs(ProviderChecker.TankerTable) do
if LandedUnitGroupName == params.name then
if ProviderChecker.TankerRTBTimer > 5 then
trigger.action.outTextForCoalition(
LandedUnit:getCoalition(),
"Tanker " .. LandedUnit:getCallsign() .. " Landed - Respawning in " .. (ProviderChecker.TankerRTBTimer / 60) .. " minutes", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, LandedUnitGroupName, timer.getTime() + ProviderChecker.TankerRTBTimer)
else
trigger.action.outTextForCoalition(
LandedUnit:getCoalition(),
"Tanker " .. LandedUnit:getCallsign() .. " Landed - Respawning", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, LandedUnitGroupName, timer.getTime() + 5)
end
end
end
end
end
if (_event.id == 5) and _event.initiator then
local DeadUnit = _event.initiator
local DeadUnitName = DeadUnit:getName()
local DeadUnitInfo = Unit.getGroup(DeadUnit)
local DeadUnitGroupName = DeadUnitInfo:getName()
for fueler, params in pairs(ProviderChecker.TankerTable) do
if DeadUnitGroupName == params.name then
if ProviderChecker.TankerKilledTimer > 5 then
trigger.action.outTextForCoalition(
DeadUnit:getCoalition(),
"Tanker " .. DeadUnit:getCallsign() .. " has crashed! Replacement will be on station in " .. (ProviderChecker.TankerKilledTimer / 60) .. " minutes", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, DeadUnitGroupName, timer.getTime() + ProviderChecker.TankerKilledTimer)
else
trigger.action.outTextForCoalition(
DeadUnit:getCoalition(),
"Tanker " .. LandedUnit:getCallsign() .. " has crashed! Replacement will be on station in 5 Seconds", 10,false)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, DeadUnitGroupName, timer.getTime() + 5)
end
end
end
end
end
function ProviderChecker.AWACSeventHandler:onEvent(_event)
-- Checks if tanker landed.
if (_event.id == 4) and _event.initiator then
local LandedUnit = _event.initiator
local LandedUnitName = LandedUnit:getName()
local LandedUnitInfo = Unit.getGroup(LandedUnit)
local LandedUnitGroupName = LandedUnitInfo:getName()
for awacs, params in pairs(ProviderChecker.AwacsTable) do
if LandedUnitGroupName == params.name then
if ProviderChecker.AWACRTBTimer > 5 then
trigger.action.outTextForCoalition(
LandedUnit:getCoalition(),
"AWACS " .. LandedUnit:getCallsign() .. " Landed - Respawning in " .. (ProviderChecker.AWACRTBTimer / 60) .. " minutes", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, LandedUnitGroupName, timer.getTime() + ProviderChecker.AWACRTBTimer)
else
trigger.action.outTextForCoalition(
LandedUnit:getCoalition(),
"AWACS " .. LandedUnit:getCallsign() .. " Landed - Respawning", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, LandedUnitGroupName, timer.getTime() + 5)
end
end
end
end
if (_event.id == 5) and _event.initiator then
local DeadUnit = _event.initiator
local DeadUnitName = DeadUnit:getName()
local DeadUnitInfo = Unit.getGroup(DeadUnit)
local DeadUnitGroupName = DeadUnitInfo:getName()
for awacs, params in pairs(ProviderChecker.AwacsTable) do
if DeadUnitGroupName == params.name then
if ProviderChecker.AWACKilledTimer > 5 then
trigger.action.outTextForCoalition(
DeadUnit:getCoalition(),
"AWACS " .. DeadUnit:getCallsign() .. " has been shot down! Replacement will be on station in " .. (ProviderChecker.AWACKilledTimer / 60) .. " minutes", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, DeadUnitGroupName, timer.getTime() + ProviderChecker.AWACKilledTimer)
else
trigger.action.outTextForCoalition(
DeadUnit:getCoalition(),
"AWACS " .. DeadUnit:getCallsign() .. " has been shot down! Replacement will be on station in 5 Seconds", 10,false)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, DeadUnitGroupName, timer.getTime() + 5)
end
end
end
end
end
-- function ProviderChecker.ServiceCheckerMsg()
function ProviderChecker.GetServicesList()
-- You can -only- get TACAN data from the mission file. So since MIST respawn uses the same TACANs on respawn,
-- I can pull from the mission file and refresh that way
for coa_name, coa_data in pairs(env.mission.coalition) do
if (coa_name == 'red' or coa_name == 'blue') and type(coa_data) == 'table' then
if coa_data.country then --there is a country table
for cntry_id, cntry_data in pairs(coa_data.country) do
for obj_type_name, obj_type_data in pairs(cntry_data) do
if obj_type_name == "plane" then
if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then --there's a group!
for group_num, group_data in pairs(obj_type_data.group) do
group_Id = group_data.groupId
group_radio = group_data.frequency
group_name = env.getValueDictByKey(group_data.name)
if group_data.task == "Refueling" then
if group_data["units"][1]["type"] ~= "IL-78M" then
if group_data.tasks and group_data.tasks.parmas then
for tasks_id, tasks_data in pairs(group_data.tasks) do
if tasks_data.params and tasks_data.params.action and tasks_data.params.action.params then
tasks_data.params.action.params["coalition"] = coa_name
tasks_data.params.action.params["radio_freqeuncy"] = group_radio
tasks_data.params.action.params["name"] = group_name
tasks_data.params.action.params["has_tasking"] = true
ProviderChecker.TankerTable[group_Id] = tasks_data.params.action.params
end --if task_data.params
end -- for tasks_id, tasks_data
-- Because for some weird ass reason, the tasks will be blank so I need to pull them from waypoints instead
elseif group_data.route.points then
for point_id, point_params in pairs(group_data.route.points) do
if point_params.task then
for tasks_id, tasks_data in pairs(point_params.task.params.tasks) do
if tasks_data.params and tasks_data.params.action and tasks_data.params.action.id == "ActivateBeacon" then
tasks_data.params.action.params["coalition"] = coa_name
tasks_data.params.action.params["radio_freqeuncy"] = group_radio
tasks_data.params.action.params["name"] = group_name
tasks_data.params.action.params["has_tasking"] = true
ProviderChecker.TankerTable[group_Id] = tasks_data.params.action.params
end -- if tasks_data.params and
end -- for tasks_id, tasks_data in
end --if point_params.task
end -- for point_id, point_params
end -- if group_data.tasks then
else
ProviderChecker.TankerTable[group_Id] = {}
ProviderChecker.TankerTable[group_Id]["coalition"] = coa_name
ProviderChecker.TankerTable[group_Id]["radio_freqeuncy"] = group_radio
ProviderChecker.TankerTable[group_Id]["name"] = group_name
ProviderChecker.TankerTable[group_Id]["has_tasking"] = false
end -- group_data["units"][1]["type"] ~= "IL-78M" then
elseif group_data.task == "AWACS" then
ProviderChecker.AwacsTable[group_Id] = {}
ProviderChecker.AwacsTable[group_Id]["coalition"] = coa_name
ProviderChecker.AwacsTable[group_Id]["radio_freqeuncy"] = group_radio
ProviderChecker.AwacsTable[group_Id]["name"] = group_name
ProviderChecker.AwacsTable[group_Id]["modeChannel"] = "N/A"
ProviderChecker.AwacsTable[group_Id]["callsign"] = "N/A"
end --if group_data.tas == "Refueling then"
end --for group_num, group_data in pairs(obj_type_data.group) do
end --if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then
end --if obj_type_name == "helicopter" or obj_type_name == "ship" or obj_type_name == "plane" or obj_type_name == "vehicle" or obj_type_name == "static" then
end --for obj_type_name, obj_type_data in pairs(cntry_data) do
end --for cntry_id, cntry_data in pairs(coa_data.country) do
end --if coa_data.country then --there is a country table
end --if coa_name == 'red' or coa_name == 'blue' and type(coa_data) == 'table' then
end --for coa_name, coa_data in pairs(mission.coalition) do
end
world.addEventHandler(ProviderChecker.AWACSeventHandler)
env.info("F99th AWACS Checker event handler added")
world.addEventHandler(ProviderChecker.TankereventHandler)
env.info("F99th Tanker Checker event handler added")
ProviderChecker.GetServicesList()
timer.scheduleFunction(ProviderChecker.RefreshTACAN, nil, timer.getTime() + 10)
missionCommands.addCommandForCoalition(2,"Get Tanker Info",nil, ProviderChecker.TankerRadioStatus,2)
missionCommands.addCommandForCoalition(1,"Get Tanker Info",nil, ProviderChecker.TankerRadioStatus,1)
if ProviderChecker.TankerFuelChecking then
timer.scheduleFunction(ProviderChecker.checkTankerFuel, nil, timer.getTime() + 120)
end
if ProviderChecker.AWACFuelChecking then
timer.scheduleFunction(ProviderChecker.checkAWACSFuel, nil, timer.getTime() + 120)
end

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,25 @@
-- ************** ADD-ON AAA SPAWNABLE CRATES ******************
-- Weights must be unique as we use the weight to change the cargo to the correct unit
-- when we unpack
--
do
local _addCrates = {
["AA Crates"] = {
{ weight = 421, desc = "AAA Vulcan", unit = "Vulcan", side = 2, cratesRequired = 1 },
{ weight = 422, desc = "AAA Gepard", unit = "Gepard", side = 2, cratesRequired = 2 },
{ weight = 423, desc = "AAA ZU-23", unit = "Ural-375 ZU-23", side = 1, cratesRequired = 1 },
{ weight = 424, desc = "AAA ZSU-23-4 Shilka", unit = "ZSU-23-4 Shilka", side = 1, cratesRequired = 2 },
},
}
-- add extra crate options
for _subMenuName, _crates in pairs(_addCrates) do
for _, _crate in pairs(_crates) do
-- add crate to the menu table
table.insert(ctld.spawnableCrates[_subMenuName], _crate)
-- add crate to the lookup table
ctld.crateLookupTable[tostring(_crate.weight)] = _crate
end
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,23 @@
-- ************** ADD-ON AAA SPAWNABLE CRATES ******************
-- Weights must be unique as we use the weight to change the cargo to the correct unit
-- when we unpack
--
do
local _addCrates = {
["Ground Forces"] = {
{ weight = 300, desc = "MBT M1A2 Abrams", unit = "M-1 Abrams", side = 2 },
{ weight = 305, desc = "MBT T-72B", unit = "T-72B", side = 1 },
},
}
-- add extra crate options
for _subMenuName, _crates in pairs(_addCrates) do
for _, _crate in pairs(_crates) do
-- add crate to the menu table
table.insert(ctld.spawnableCrates[_subMenuName], _crate)
-- add crate to the lookup table
ctld.crateLookupTable[tostring(_crate.weight)] = _crate
end
end
end

View File

@@ -0,0 +1,754 @@
--[[
Iron Hand by F99Th-TracerFacer
This is a DSMC Compatible Mission. Persitance will be enabled on servers with the
DSMC mod installed. No saving is done while players are on the server. All players must log off!
and the server shutdown before a new mission file is made.
Due to the way triggers don't work quiet right we have to come up with another way of
loading the ground units ONLY ONCE - and never again on subsequent mission loads. I've tried
various automated ways of doing this but in the end it has to be controlled manually by 1 of 2 ways.
1. I run the mission, save the scenery once, open newly created mission file in ME and remove setup script.
upload this to the server and this is what gets played on a daily basis. This causes several problems
but mostly with ground units who will lose their routes in the new mission. I don't like this.
OR (THE WAY WE WILL DO IT FOR NOW UNTIL I GET SMARTER)
2. We use some F10 menus to present 1 player (F99th-MISSION COMMANDER) with a special menu. Only F99th- players will be allowed into this slot.
This menu will have 2 options:
1. Warn the Players they should all log off. (shut down the server after this and a new
mission file will be created with time/date/weather reset) Do this on a populated server that
you want to shut down.
2. Populate the mission with initial objects. You must do this at least once on first mission run.
This should only be done once. Once you use this option the menu item is removed, however on
subsequent mission loads .002, .003, .004, etc - this menu item will still show up.
DO NOT USE IT IF IT'S NOT THE FIRST RUN OF THE MISSION. IT WILL POPULATE THE MAP AGAIN.
MENU WILL AUTOMATICALLY DISAPPEAR AFTER 5 MINS TO PREVENT IDIOCY.
** If you do this on accident, just load the previous mission file and don't be stupid twice. =] **
--]]
_SETTINGS:SetPlayerMenuOff()
HQ = GROUP:FindByName( "HQ", "Bravo HQ" )
CommandCenter = COMMANDCENTER:New( HQ, "Bravo" )
RedHQ = GROUP:FindByName( "RedHQ", "RedHQ" )
RedCC = COMMANDCENTER:New( HQ, "RedHQ" )
Scoring = SCORING:New( "Iron Hand" )
SoundRadioMsg = USERSOUND:New("l10n/DEFAULT/beeps-and-clicks.wav")
--Setup the RedA2A dispatcher, and initialize it.
CCCPBorderZone = ZONE_POLYGON:New( "RED BORDER", GROUP:FindByName( "RED BORDER" ) )
RedA2ADispatcher = AI_A2A_GCICAP:New( { "RED EWR" }, { "FIGHTER SWEEP RED" }, { "RED BORDER" }, 6 )
RedA2ADispatcher:SetDefaultLandingAtRunway()
RedA2ADispatcher:SetDefaultTakeoffFromParkingCold()
RedA2ADispatcher:SetBorderZone( CCCPBorderZone )
RedA2ADispatcher:SetTacticalDisplay(false)
RedA2ADispatcher:SetDefaultFuelThreshold( 0.35 )
RedA2ADispatcher:SetRefreshTimeInterval( 420 )
RedA2ADispatcher:SetDefaultOverhead(.75)
RedA2ADispatcher:SetDefaultCapLimit(6)
-- Spawn Some Trains
Spawn_TanksFromTrainGudauta = SPAWN:New("TANKSFROMTRAINTOGUDAUTA")
:InitLimit(6,6)
Spawn_Train_TOGUDAUTA = SPAWN:New("TRAINTOGUDAUTA")
:InitLimit(1,5)
:SpawnScheduled( 8000, .3 )
-- Spawned via mission trigger with :Spawn()
Spawn_Train_ArtyKobuleti = SPAWN:New("Train_ArtyKobuleti")
Spawn_ArtyKobuleti = SPAWN:New("ARTY-KOBULETI")
:InitLimit(7,7)
-- Spawn Batumi Speed Boat
Spawn_Batumi_Speedboat = SPAWN:New("RU-BATUMI-SPEEDBOAT")
:InitRandomizeRoute(1,103,1000)
:InitLimit(5,25)
--Spawn Moving Ground Units - Stop these from spawning if warehouse is blown up.
Spawn_Moving_1 = SPAWN:New("WAREHOUSE CONVOY-1")
:InitLimit(6, 50)
:SpawnScheduled( 2400, .3 )
--Spawn Moving Ground Units - Stop these from spawning if warehouse is blown up.
Spawn_Moving_2 = SPAWN:New("WAREHOUSE CONVOY-2")
:InitLimit(6, 50)
:SpawnScheduled( 2400, .3 )
--Spawn Moving Ground Units - Stop these from spawning if warehouse is blown up.
Spawn_Moving_3 = SPAWN:New("WAREHOUSE CONVOY-3")
:InitLimit(6, 50)
:SpawnScheduled( 2400, .3 )
--Spawn Moving Ground Units - Stop these from spawning if warehouse is blown up.
Spawn_Moving_4 = SPAWN:New("WAREHOUSE CONVOY-4")
:InitLimit(6, 50)
:SpawnScheduled( 2400, .3 )
--Spawn Moving Ground Units - Stop these from spawning if warehouse is blown up.
Spawn_Moving_5 = SPAWN:New("WAREHOUSE CONVOY-5")
:InitRandomizeRoute(0,14,2000)
:InitLimit(6, 50)
:SpawnScheduled( 2400, .3 )
--Spawn Moving Ground Units - Stop these from spawning if warehouse is blown up.
Spawn_Moving_6 = SPAWN:New("WAREHOUSE CONVOY-6")
:InitRandomizeRoute(0,17,2000)
:InitLimit(6, 50)
:SpawnScheduled( 2400, .3 )
--Spawn Moving Ground Units - Stop these from spawning if warehouse is blown up.
Spawn_Moving_7 = SPAWN:New("WAREHOUSE CONVOY-7")
:InitRandomizeRoute(0,14,2000)
:InitLimit(6, 50)
:SpawnScheduled( 2400, .3 )
--Spawn Moving Ground Units - Stop these from spawning if warehouse is blown up.
Spawn_Moving_8 = SPAWN:New("WAREHOUSE CONVOY-8")
:InitRandomizeRoute(0,14,2000)
:InitLimit(6, 50)
:SpawnScheduled( 2400, .3 )
--Spawn Moving Ground Units - Stop these from spawning if warehouse is blown up.
Spawn_Moving_CONVOY_SOCHI_1 = SPAWN:New("CONVOY-SOCHI-1")
:InitRandomizeRoute(0,14,2000)
:InitLimit(6, 50)
:SpawnScheduled( 5000, .3 )
Spawn_Moving_CONVOY_SOCHI_2 = SPAWN:New("CONVOY-SOCHI-2")
:InitRandomizeRoute(0,14,2000)
:InitLimit(6, 50)
:SpawnScheduled( 5000, .3 )
Spawn_Moving_CONVOY_SUKUMI_1 = SPAWN:New("CONVOY-SUKHUMI-1")
:InitRandomizeRoute(0,14,2000)
:InitLimit(6, 50)
:SpawnScheduled( 5000, .3 )
Spawn_Moving_CONVOY_SUKUMI_2 = SPAWN:New("CONVOY-SUKHUMI-2")
:InitRandomizeRoute(0,14,2000)
:InitLimit(6, 50)
:SpawnScheduled( 5000, .3 )
Spawn_Moving_CONVOY_GUDAUTA_1 = SPAWN:New("CONVOY-GUDAUTA-1")
:InitRandomizeRoute(0,14,2000)
:InitLimit(6, 50)
:SpawnScheduled( 5000, .3 )
Spawn_Moving_CONVOY_GUDAUTA_2 = SPAWN:New("CONVOY-GUDAUTA-2")
:InitRandomizeRoute(0,14,2000)
:InitLimit(6, 50)
:SpawnScheduled( 5000, .3 )
-- C130 PROTECTION MISSION STATUS MESSAGES- this mission starts when Sochi, Gudauta and Sukumi are taken by Blue.
local TankerPilotSupply = UNIT:FindByName("TANKER PILOT SUPPLY")
TankerPilotSupply:HandleEvent(EVENTS.Birth)
function TankerPilotSupply:OnEventBirth(EventData)
TankerPilotSupply:MessageToBlue("[ ESCORT MISSION ]\n\nTHIS IS CAPT. OBVIOUS, REQUESTING IMMEDIATE ESCORT FROM KRASNADOR TO SOCHI.\n\nCARGO ONBOARD: PILOTS FOR THE TANKERS LOCATED AT SOCHI!\n\n", 15)
SoundRadioMsg:ToCoalition(coalition.side.BLUE)
end
-- TankerPilotSupply:HandleEvent(EVENTS.EngineStartup)
-- function TankerPilotSupply:OnEventEngineStartup(EventData)
-- TankerPilotSupply:MessageToBlue("[ CAPT. OBVIOUS KRASNADOR C-130 ]\n\nEngines are running, we are taxing.\n\nETA: 30 mins.\nCargo: Tanker Pilots\nDestination: Sochi\n", 15)
-- SoundRadioMsg:ToCoalition(coalition.side.BLUE)
-- end
TankerPilotSupply:HandleEvent(EVENTS.Hit)
function TankerPilotSupply:OnEventHit(EventData)
TankerPilotSupply:MessageToBlue("[ CAPT. OBVIOUS C-130 INBOUND TO SOCHI]\n\nWe are taking fire!! Mayday Mayday!", 15)
SoundRadioMsg:ToCoalition(coalition.side.BLUE)
end
TankerPilotSupply:HandleEvent(EVENTS.Crash)
function TankerPilotSupply:OnEventCrash(EventData)
TankerPilotSupply:MessageToBlue("[ TANKER MISSION FAILURE ]\n\nThe C-130 that was carrying the pilots for our tankers has been shot down! No tankers will be available for the remainder of the mission!", 30)
SoundRadioMsg:ToCoalition(coalition.side.BLUE)
end
TankerPilotSupply:HandleEvent(EVENTS.Land)
function TankerPilotSupply:OnEventLand(EventData)
TankerPilotSupply:MessageToBlue("[ CAPT. OBVIOUS C130 @ SOCHI ]\n\nWe have landed. Tanker pilots have been delivered. Tankers will be starting up soon!", 15)
SoundRadioMsg:ToCoalition(coalition.side.BLUE)
end
-----------Spawn AWACS------------------------------
Spawn_BlueEWR = SPAWN:New("BLUE EWR"):InitLimit( 1, 50 )
:InitRepeatOnEngineShutDown()
:InitCleanUp(120)
:SpawnScheduled(300,.3)
-----------Spawn AWACS CVN---------------------------
Spawn_BlueEWR = SPAWN:New("BLUE EWR MAGIC"):InitLimit( 1, 50 )
:InitRepeatOnEngineShutDown()
:InitCleanUp(120)
:SpawnScheduled(300,.3)
Spawn_RedEWR = SPAWN:New("RED EWR"):InitLimit( 1, 50 )
:InitRepeatOnEngineShutDown()
:InitCleanUp(120)
:SpawnScheduled(300,.4)
-- Spawn Tankers (after Sochi, Gudauta and Sukhumi are captured.
Spawn_Blue135 = SPAWN:New("Shell SHL 42 X 253am"):InitLimit( 1, 50 )
:InitRepeatOnEngineShutDown()
:InitCleanUp(120)
Spawn_Blue135MPRS = SPAWN:New("Texaco TEX 41 X 252am"):InitLimit( 1, 50 )
:InitRepeatOnEngineShutDown()
:InitCleanUp(120)
--:SpawnScheduled(300,.3) -- TURN ON WITH MISSION TRIGGER INSTEAD
Spawn_MaykopBombers = SPAWN:New("MAYKOP BOMBER")
:InitLimit(4, 50)
:InitCleanUp(120)
-- Spawn_MaykopBombers:SpawnScheduled(1200,.2) -- TURN ON IN ME WHEN MAYKOP IS TAKEN
-- Recovery Tanker
-- S-3B at USS Stennis spawning on deck.
local CVNRecoveryTanker=RECOVERYTANKER:New("CVN-71 Theodore Roosevelt", "Arco ARC 43 Y 253am")
-- Custom settings for radio frequency, TACAN, callsign and modex.
CVNRecoveryTanker:SetRadio(253)
CVNRecoveryTanker:SetTACAN(43, "ARC")
CVNRecoveryTanker:SetCallsign(CALLSIGN.Tanker.Arco, 3)
CVNRecoveryTanker:SetModex(0) -- "Triple nuts"
-- Start recovery tanker.
-- NOTE: If you spawn on deck, it seems prudent to delay the spawn a bit after the mission starts.
CVNRecoveryTanker:__Start(1)
-- Base Capture Events & Functions
-- Beslan
CaptureBeslan = AIRBASE:FindByName("Beslan")
CaptureBeslan:HandleEvent(EVENTS.BaseCaptured)
function CaptureBeslan:OnEventBaseCaptured(EventData)
local coa = CaptureBeslan:GetCoalition()
-- To a specific coalition.
if coa == 1 then -- red
--SoundRadioMsg:ToCoalition(coalition.side.RED)
local RadioMessage = MESSAGE:New("Failure! Beslan has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToRed()
elseif coa == 2 then -- blue
--SoundRadioMsg:ToCoalition(coalition.side.BLUE)
local RadioMessage = MESSAGE:New("Beslan has been captured by NATO! You may now use the Aircraft at this Airbase. ",5,"[ MISSION PROGRESS ]", false):ToBlue()
trigger.action.setUserFlag("Beslan-1",0)
trigger.action.setUserFlag("Beslan-2",0)
trigger.action.setUserFlag("Beslan-3",0)
trigger.action.setUserFlag("Beslan-4",0)
trigger.action.setUserFlag("Beslan-5",0)
trigger.action.setUserFlag("Beslan-6",0)
trigger.action.setUserFlag("Beslan-7",0)
trigger.action.setUserFlag("Beslan-8",0)
trigger.action.setUserFlag("BESLAN-UH1-1",0)
trigger.action.setUserFlag("BESLAN-UH1-2",0)
trigger.action.setUserFlag("BESLAN-MI8-1",0)
trigger.action.setUserFlag("BESLAN-MI8-2",0)
trigger.action.setUserFlag("BESLAN-HIND-1",0)
trigger.action.setUserFlag("BESLAN-HIND-2",0)
trigger.action.setUserFlag("BESLAN-APACHE-1",0)
trigger.action.setUserFlag("BESLAN-APACHE-2",0)
trigger.action.setUserFlag("BESLAN-GAZ-1",0)
trigger.action.setUserFlag("BESLAN-GAZ-2",0)
trigger.action.setUserFlag("BESLAN-GAZ-3",0)
trigger.action.setUserFlag("BESLAN-GAZ-4",0)
trigger.action.setUserFlag("BESLAN-KA50-1",0)
trigger.action.setUserFlag("BESLAN-KA50-2",0)
-- Figure out how to add smoke effects?
end
end
-- Kolkhi
CaptureKolkhi = AIRBASE:FindByName("Senaki-Kolkhi")
CaptureKolkhi:HandleEvent(EVENTS.BaseCaptured)
function CaptureKolkhi:OnEventBaseCaptured(EventData)
local coa = CaptureKolkhi:GetCoalition()
if coa == 1 then -- red
local RadioMessage = MESSAGE:New("Failure! Kolkhi has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToRed()
elseif coa == 2 then -- blue
local RadioMessage = MESSAGE:New("Congratulations! Kolkhi has been captured by NATO! You may now use the Aircraft at this Airbase.",5,"[ MISSION PROGRESS ]", false):ToBlue()
--Enable Blue
trigger.action.setUserFlag("KOLKHI-MI8-1",0)
trigger.action.setUserFlag("KOLKHI-MI8-2",0)
trigger.action.setUserFlag("KOLKHI-UH1-1",0)
trigger.action.setUserFlag("KOLKHI-UH1-2",0)
--Disable Red
trigger.action.setUserFlag("Kolkhi-1",100)
trigger.action.setUserFlag("Kolkhi-2",100)
trigger.action.setUserFlag("Kolkhi-3",100)
trigger.action.setUserFlag("Kolkhi-4",100)
trigger.action.setUserFlag("Kolkhi-5",100)
trigger.action.setUserFlag("Kolkhi-6",100)
end
end
-- Kobuleti
CaptureKobuleti = AIRBASE:FindByName("Kobuleti")
CaptureKobuleti:HandleEvent(EVENTS.BaseCaptured)
function CaptureKobuleti:OnEventBaseCaptured(EventData)
local coa = CaptureKobuleti:GetCoalition()
-- To a specific coalition.
if coa == 1 then -- red
--SoundRadioMsg:ToCoalition(coalition.side.RED)
local RadioMessage = MESSAGE:New("Failure! Kobuleti has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToRed()
elseif coa == 2 then -- blue
--SoundRadioMsg:ToCoalition(coalition.side.BLUE)
local RadioMessage = MESSAGE:New("Congratulations! Kobuleti has been captured by NATO! You may now use the Aircraft at this Airbase.",5,"[ MISSION PROGRESS ]", false):ToBlue()
trigger.action.setUserFlag("KOBULETI-MI8-1",0)
trigger.action.setUserFlag("KOBULETI-MI8-2",0)
trigger.action.setUserFlag("KOBULETI-UH1-1",0)
trigger.action.setUserFlag("KOBULETI-UH1-2",0)
-- Figure out how to add smoke effects?
end
end
-- Sukhumi
CaptureSukhumi = AIRBASE:FindByName("Sukhumi-Babushara")
CaptureSukhumi:HandleEvent(EVENTS.BaseCaptured)
function CaptureSukhumi:OnEventBaseCaptured(EventData)
local coa = CaptureSukhumi:GetCoalition()
-- To a specific coalition.
if coa == 1 then -- red
--SoundRadioMsg:ToCoalition(coalition.side.RED)
local RadioMessage = MESSAGE:New("Failure! Sukhumi has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToRed()
elseif coa == 2 then -- blue
--SoundRadioMsg:ToCoalition(coalition.side.BLUE)
local RadioMessage = MESSAGE:New("Sukhumi has been captured by NATO! You may now use the Aircraft at this Airbase.",5,"[ MISSION PROGRESS ]", false):ToBlue()
trigger.action.setUserFlag("Sukhumi-1",0)
trigger.action.setUserFlag("Sukhumi-2",0)
trigger.action.setUserFlag("Sukhumi-3",0)
trigger.action.setUserFlag("Sukhumi-4",0)
trigger.action.setUserFlag("Sukhumi-5",0)
trigger.action.setUserFlag("Sukhumi-6",0)
trigger.action.setUserFlag("Sukhumi-7",0)
trigger.action.setUserFlag("Sukhumi-8",0)
trigger.action.setUserFlag("Sukhumi-9",0)
trigger.action.setUserFlag("Sukhumi-10",0)
trigger.action.setUserFlag("Sukhumi-11",0)
trigger.action.setUserFlag("SUKHUMI-MI8-1",0)
trigger.action.setUserFlag("SUKHUMI-MI8-2",0)
trigger.action.setUserFlag("SUKHUMI-UH1-1",0)
trigger.action.setUserFlag("SUKHUMI-UH1-2",0)
-- Figure out how to add smoke effects?
end
end
-- Gudauta
CaptureGudauta = AIRBASE:FindByName("Gudauta")
CaptureGudauta:HandleEvent(EVENTS.BaseCaptured)
function CaptureGudauta:OnEventBaseCaptured(EventData)
local coa = CaptureGudauta:GetCoalition()
-- To a specific coalition.
if coa == 1 then -- red
--SoundRadioMsg:ToCoalition(coalition.side.RED)
local RadioMessage = MESSAGE:New("Failure! Gudauta has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToRed()
elseif coa == 2 then -- blue
--SoundRadioMsg:ToCoalition(coalition.side.BLUE)
local RadioMessage = MESSAGE:New("Gudauta has been captured by NATO! You may now use the Aircraft at this Airbase.",5,"[ MISSION PROGRESS ]", false):ToBlue()
--Enable Blue
trigger.action.setUserFlag("GUDAUTA-MI8-1",0)
trigger.action.setUserFlag("GUDAUTA-MI8-2",0)
trigger.action.setUserFlag("GUDAUTA-UH1-1",0)
trigger.action.setUserFlag("GUDAUTA-UH1-2",0)
trigger.action.setUserFlag("GUDAUTA-MIRAGE-1",0)
trigger.action.setUserFlag("GUDAUTA-MIRAGE-2",0)
--Diable Red
trigger.action.setUserFlag("Gudauta-1",100)
trigger.action.setUserFlag("Gudauta-2",100)
trigger.action.setUserFlag("Gudauta-3",100)
trigger.action.setUserFlag("Gudauta-4",100)
end
end
-- Sochi
CaptureSochi = AIRBASE:FindByName("Sochi-Adler")
CaptureSochi:HandleEvent(EVENTS.BaseCaptured)
function CaptureSochi:OnEventBaseCaptured(EventData)
local coa = CaptureSochi:GetCoalition()
-- To a specific coalition.
if coa == 1 then -- red
--SoundRadioMsg:ToCoalition(coalition.side.RED)
local RadioMessage = MESSAGE:New("Failure! Sochi has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToRed()
elseif coa == 2 then -- blue
--SoundRadioMsg:ToCoalition(coalition.side.BLUE)
local RadioMessage = MESSAGE:New("Sochi has been captured by NATO! You may now use the Aircraft at this Airbase.",5,"[ MISSION PROGRESS ]", false):ToBlue()
trigger.action.setUserFlag("Sochi-1",0)
trigger.action.setUserFlag("Sochi-2",0)
trigger.action.setUserFlag("Sochi-3",0)
trigger.action.setUserFlag("Sochi-4",0)
trigger.action.setUserFlag("Sochi-5",0)
trigger.action.setUserFlag("Sochi-6",0)
trigger.action.setUserFlag("Sochi-7",0)
trigger.action.setUserFlag("Sochi-8",0)
trigger.action.setUserFlag("Sochi-9",0)
trigger.action.setUserFlag("Sochi-10",0)
trigger.action.setUserFlag("Sochi-11",0)
trigger.action.setUserFlag("SOCHI-APACHE-1",0)
trigger.action.setUserFlag("SOCHI-APACHE-2",0)
trigger.action.setUserFlag("SOCHI-APACHE-3",0)
trigger.action.setUserFlag("SOCHI-APACHE-4",0)
trigger.action.setUserFlag("SOCHI-HIND-1",0)
trigger.action.setUserFlag("SOCHI-HIND-2",0)
trigger.action.setUserFlag("SOCHI-HIND-3",0)
trigger.action.setUserFlag("SOCHI-HIND-4",0)
trigger.action.setUserFlag("SOCHI-MI8-1",0)
trigger.action.setUserFlag("SOCHI-MI8-2",0)
trigger.action.setUserFlag("SOCHI-UH1-1",0)
trigger.action.setUserFlag("SOCHI-UH1-2",0)
trigger.action.setUserFlag("SOCHI-GAZ-1",0)
trigger.action.setUserFlag("SOCHI-GAZ-2",0)
trigger.action.setUserFlag("SOCHI-GAZ-3",0)
trigger.action.setUserFlag("SOCHI-GAZ-4",0)
trigger.action.setUserFlag("SOCHI-KA50-1",0)
trigger.action.setUserFlag("SOCHI-KA50-2",0)
trigger.action.setUserFlag("SOCHI-KA50-3",0)
trigger.action.setUserFlag("SOCHI-KA50-4",0)
-- Figure out how to add smoke effects?
end
end
-- Mozdok
CaptureMozdok = AIRBASE:FindByName("Mozdok")
CaptureMozdok:HandleEvent(EVENTS.BaseCaptured)
function CaptureMozdok:OnEventBaseCaptured(EventData)
local coa = CaptureMozdok:GetCoalition()
if coa == 1 then -- red
local RadioMessage = MESSAGE:New("Failure! Mozdok has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToRed()
elseif coa == 2 then -- blue
local RadioMessage = MESSAGE:New("Mozdok has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToBlue()
end
end
-- Nalchik
CaptureNalchik = AIRBASE:FindByName("Nalchik")
CaptureNalchik:HandleEvent(EVENTS.BaseCaptured)
function CaptureNalchik:OnEventBaseCaptured(EventData)
local coa = CaptureNalchik:GetCoalition()
if coa == 1 then -- red
local RadioMessage = MESSAGE:New("Failure! Nalchik has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToRed()
elseif coa == 2 then -- blue
local RadioMessage = MESSAGE:New("Nalchik has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToBlue()
end
end
-- Kobuleti
CaptureKobuleti = AIRBASE:FindByName("Kobuleti")
CaptureKobuleti:HandleEvent(EVENTS.BaseCaptured)
function CaptureKobuleti:OnEventBaseCaptured(EventData)
local coa = CaptureKobuleti:GetCoalition()
if coa == 1 then -- red
local RadioMessage = MESSAGE:New("Failure! Kobuleti has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToRed()
elseif coa == 2 then -- blue
local RadioMessage = MESSAGE:New("Kobuleti has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToBlue()
trigger.action.setUserFlag("KOBULETI-MI8-1",0)
trigger.action.setUserFlag("KOBULETI-MI8-2",0)
trigger.action.setUserFlag("KOBULETI-UH1-1",0)
trigger.action.setUserFlag("KOBULETI-UH1-2",0)
end
end
-- Maykop
CaptureMaykop = AIRBASE:FindByName("Maykop-Khanskaya")
CaptureMaykop:HandleEvent(EVENTS.BaseCaptured)
function CaptureMaykop:OnEventBaseCaptured(EventData)
local coa = CaptureMaykop:GetCoalition()
if coa == 1 then -- red
local RadioMessage = MESSAGE:New("Failure! Maykop has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToRed()
elseif coa == 2 then -- blue
local RadioMessage = MESSAGE:New("Maykop has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToBlue()
trigger.action.setUserFlag("Maykop-1",0)
trigger.action.setUserFlag("Maykop-2",0)
trigger.action.setUserFlag("Maykop-3",0)
trigger.action.setUserFlag("Maykop-4",0)
trigger.action.setUserFlag("Maykop-5",0)
trigger.action.setUserFlag("Maykop-6",0)
end
end
-- Kutaisi
CaptureKutaisi = AIRBASE:FindByName("Kutaisi")
CaptureKutaisi:HandleEvent(EVENTS.BaseCaptured)
function CaptureKutaisi:OnEventBaseCaptured(EventData)
local coa = CaptureKutaisi:GetCoalition()
if coa == 1 then -- red
local RadioMessage = MESSAGE:New("Failure! Kutaisi has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToRed()
elseif coa == 2 then -- blue
local RadioMessage = MESSAGE:New("Kutaisi has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToBlue()
trigger.action.setUserFlag("Kutaisi-1",0)
trigger.action.setUserFlag("Kutaisi-2",0)
trigger.action.setUserFlag("Kutaisi-3",0)
trigger.action.setUserFlag("Kutaisi-4",0)
trigger.action.setUserFlag("Kutaisi-5",0)
trigger.action.setUserFlag("Kutaisi-6",0)
trigger.action.setUserFlag("Kutaisi-7",0)
trigger.action.setUserFlag("Kutaisi-8",0)
trigger.action.setUserFlag("Kutaisi-9",0)
trigger.action.setUserFlag("Kutaisi-10",0)
trigger.action.setUserFlag("Kutaisi-11",0)
trigger.action.setUserFlag("Kutaisi-12",0)
end
end
-- Mineralnye Vody
CaptureVody = AIRBASE:FindByName("Mineralnye Vody")
CaptureVody:HandleEvent(EVENTS.BaseCaptured)
function CaptureVody:OnEventBaseCaptured(EventData)
local coa = CaptureVody:GetCoalition()
if coa == 1 then -- red
local RadioMessage = MESSAGE:New("Failure! Mineralnye Vody has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToRed()
elseif coa == 2 then -- blue
local RadioMessage = MESSAGE:New("Mineralnye Vody has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToBlue()
end
end
-- Batumi
CaptureBatumi = AIRBASE:FindByName("Batumi")
CaptureBatumi:HandleEvent(EVENTS.BaseCaptured)
function CaptureBatumi:OnEventBaseCaptured(EventData)
local coa = CaptureBatumi:GetCoalition()
-- To a specific coalition.
if coa == 1 then -- red
--SoundRadioMsg:ToCoalition(coalition.side.RED)
local RadioMessage = MESSAGE:New("Failure! Batumi has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToRed()
elseif coa == 2 then -- blue
--SoundRadioMsg:ToCoalition(coalition.side.BLUE)
local RadioMessage = MESSAGE:New("Batumi has been captured by NATO!",5,"[ MISSION PROGRESS ]", false):ToBlue()
trigger.action.setUserFlag("Batumi-1",0)
trigger.action.setUserFlag("Batumi-2",0)
trigger.action.setUserFlag("Batumi-3",0)
trigger.action.setUserFlag("Batumi-4",0)
trigger.action.setUserFlag("Batumi-5",0)
trigger.action.setUserFlag("Batumi-6",0)
trigger.action.setUserFlag("BATUMI-APACHE-1",0)
trigger.action.setUserFlag("BATUMI-APACHE-2",0)
trigger.action.setUserFlag("BATUMI-APACHE-3",0)
trigger.action.setUserFlag("BATUMI-APACHE-4",0)
trigger.action.setUserFlag("BATUMI-HIND-1",0)
trigger.action.setUserFlag("BATUMI-HIND-2",0)
trigger.action.setUserFlag("BATUMI-HIND-3",0)
trigger.action.setUserFlag("BATUMI-HIND-4",0)
trigger.action.setUserFlag("BATUMI-UH1-1",0)
trigger.action.setUserFlag("BATUMI-UH1-2",0)
trigger.action.setUserFlag("BATUMI-UH1-3",0)
trigger.action.setUserFlag("BATUMI-UH1-4",0)
trigger.action.setUserFlag("BATUMI-GAZ-1",0)
trigger.action.setUserFlag("BATUMI-GAZ-2",0)
trigger.action.setUserFlag("BATUMI-GAZ-3",0)
trigger.action.setUserFlag("BATUMI-GAZ-4",0)
trigger.action.setUserFlag("BATUMI-MI8-1",0)
trigger.action.setUserFlag("BATUMI-MI8-2",0)
trigger.action.setUserFlag("BATUMI-MI8-3",0)
trigger.action.setUserFlag("BATUMI-MI8-4",0)
trigger.action.setUserFlag("BATUMI-KA50-1",0)
trigger.action.setUserFlag("BATUMI-KA50-2",0)
trigger.action.setUserFlag("BATUMI-KA50-3",0)
trigger.action.setUserFlag("BATUMI-KA50-4",0)
-- Figure out how to add smoke effects?
end
end
-- Clean = CLEANUP_AIRBASE:New( AIRBASE.Caucasus.Batumi )
-- Clean:SetCleanMissiles( false )
-- I don't know why this crap doesn't work. Well it works, but the onbrith or startup events keep happening
-- even though the plane is already alive. Update: happens when each new player logs in - all the events fire. =/ lame.
---- Messages for AWACS
-- Spawn_BlueEWR:HandleEvent(EVENTS.Birth)
-- function Spawn_BlueEWR:OnEventBirth(EventData)
-- local RadioMessage = MESSAGE:New("A new AWACS has spawned.",15,"[ AWACS STATUS ]", true):ToBlue()
-- SoundRadioMsg:ToCoalition(coalition.side.BLUE)
-- end
--
-- Spawn_BlueEWR:HandleEvent(EVENTS.EngineStartup)
-- function Spawn_BlueEWR:OnEventEngineStartup(EventData)
-- local RadioMessage = MESSAGE:New("AWACS Startup Complete.",15,"[ AWACS STATUS ]", true):ToBlue()
-- SoundRadioMsg:ToCoalition(coalition.side.BLUE)
-- end
--
-- Spawn_BlueEWR:HandleEvent(EVENTS.EngineShutdown)
-- function Spawn_BlueEWR:OnEventEngineShutdown(EventData)
-- local RadioMessage = MESSAGE:New("AWACS Shutdown. Swapping Pilots, restarting soon..",15,"[ AWACS STATUS ]", true):ToBlue()
-- SoundRadioMsg:ToCoalition(coalition.side.BLUE)
-- end
--
-- Spawn_BlueEWR:HandleEvent(EVENTS.Land)
-- function Spawn_BlueEWR:OnEventLand(EventData)
-- local RadioMessage = MESSAGE:New("AWACS has landed. Taxing to parking.",15,"[ AWACS STATUS ]", true):ToBlue()
-- SoundRadioMsg:ToCoalition(coalition.side.BLUE)
-- end
--
-- Spawn_BlueEWR:HandleEvent(EVENTS.Takeoff)
-- function Spawn_BlueEWR:OnEventTakeoff(EventData)
-- local RadioMessage = MESSAGE:New("AWACS has taken off, AWACS Services Online.",15,"[ AWACS STATUS ]", true):ToBlue()
-- SoundRadioMsg:ToCoalition(coalition.side.BLUE)
-- end
--
-- -- Messages for RED AWACS
-- Spawn_RedEWR:HandleEvent(EVENTS.Birth)
-- function Spawn_RedEWR:OnEventBirth(EventData)
-- local RadioMessage = MESSAGE:New("A new AWACS has spawned..",15,"[ AWACS STATUS ]", true):ToRed()
-- SoundRadioMsg:ToCoalition(coalition.side.RED)
-- end
---- Spawn_RedEWR:HandleEvent(EVENTS.EngineStartup)
---- function Spawn_RedEWR:OnEventEngineStartup(EventData)
---- local RadioMessage = MESSAGE:New("AWACS Startup Complete.",15,"[ AWACS STATUS ]", true):ToRed()
---- SoundRadioMsg:ToCoalition(coalition.side.RED)
---- end
-- Spawn_RedEWR:HandleEvent(EVENTS.EngineShutdown)
-- function Spawn_RedEWR:OnEventEngineShutdown(EventData)
-- local RadioMessage = MESSAGE:New("AWACS Shuting down..",15,"[ AWACS STATUS ]", true):ToRed()
-- SoundRadioMsg:ToCoalition(coalition.side.RED)
-- end
-- Spawn_RedEWR:HandleEvent(EVENTS.Land)
-- function Spawn_RedEWR:OnEventLand(EventData)
-- local RadioMessage = MESSAGE:New("AWACS has landed..",15,"[ AWACS STATUS ]", true):ToRed()
-- SoundRadioMsg:ToCoalition(coalition.side.RED)
-- end
-- Spawn_RedEWR:HandleEvent(EVENTS.Takeoff)
-- function Spawn_RedEWR:OnEventTakeoff(EventData)
-- local RadioMessage = MESSAGE:New("AWACS has taken off..",15,"[ AWACS STATUS ]", true):ToRed()
-- SoundRadioMsg:ToCoalition(coalition.side.RED)
-- end
--
---- Messages for Shell SHL 42 X 253
-- Spawn_Blue135:HandleEvent(EVENTS.Birth)
-- function Spawn_Blue135:OnEventBirth(EventData)
-- local RadioMessage = MESSAGE:New("Tanker Shell on 42x 253am has spawned..",15,"[ 135 TANKER STATUS ]", true):ToBlue()
-- SoundRadioMsg:ToCoalition(coalition.side.BLUE)
-- end
---- Spawn_Blue135:HandleEvent(EVENTS.EngineStartup)
---- function Spawn_Blue135:OnEventEngineStartup(EventData)
---- local RadioMessage = MESSAGE:New("Tanker Shell on 42x 253am has started up..",15,"[ 135 TANKER STATUS ]", true):ToBlue()
---- SoundRadioMsg:ToCoalition(coalition.side.BLUE)
---- end
-- Spawn_Blue135:HandleEvent(EVENTS.EngineShutdown)
-- function Spawn_Blue135:OnEventEngineShutdown(EventData)
-- local RadioMessage = MESSAGE:New("Tanker Shell on 42x 253am has shut down..",15,"[ 135 TANKER STATUS ]", true):ToBlue()
-- SoundRadioMsg:ToCoalition(coalition.side.BLUE)
-- end
-- Spawn_Blue135:HandleEvent(EVENTS.Land)
-- function Spawn_Blue135:OnEventLand(EventData)
-- local RadioMessage = MESSAGE:New("Tanker Shell on 42x 253am has Landed..",15,"[ 135 TANKER STATUS ]", true):ToBlue()
-- SoundRadioMsg:ToCoalition(coalition.side.BLUE)
-- end
-- Spawn_Blue135:HandleEvent(EVENTS.Takeoff)
-- function Spawn_Blue135:OnEventTakeoff(EventData)
-- local RadioMessage = MESSAGE:New("Tanker Shell on 42x 253am has taken off..",15,"[ 135 TANKER STATUS ]", true):ToBlue()
-- SoundRadioMsg:ToCoalition(coalition.side.BLUE)
-- end
--
-- -- Messages for Texaco TEX 41 X 252
-- Spawn_Blue135MPRS:HandleEvent(EVENTS.Birth)
-- function Spawn_Blue135MPRS:OnEventBirth(EventData)
-- local RadioMessage = MESSAGE:New("Tanker Texaco TEX 41x 252am has spawned..",15,"[ 135MPRS TANKER STATUS ]", true):ToBlue()
-- SoundRadioMsg:ToCoalition(coalition.side.BLUE)
-- end
---- Spawn_Blue135MPRS:HandleEvent(EVENTS.EngineStartup)
---- function Spawn_Blue135MPRS:OnEventEngineStartup(EventData)
---- local RadioMessage = MESSAGE:New("Tanker Texaco TEX 41x 252am has started up..",15,"[ 135MPRS TANKER STATUS ]", true):ToBlue()
---- SoundRadioMsg:ToCoalition(coalition.side.BLUE)
---- end
-- Spawn_Blue135MPRS:HandleEvent(EVENTS.EngineShutdown)
-- function Spawn_Blue135MPRS:OnEventEngineShutdown(EventData)
-- local RadioMessage = MESSAGE:New("Tanker Texaco TEX 41x 252am has shut down..",15,"[ 135MPRS TANKER STATUS ]", true):ToBlue()
-- SoundRadioMsg:ToCoalition(coalition.side.BLUE)
-- end
-- Spawn_Blue135MPRS:HandleEvent(EVENTS.Land)
-- function Spawn_Blue135MPRS:OnEventLand(EventData)
-- local RadioMessage = MESSAGE:New("Tanker Texaco TEX 41x 252am has Landed..",15,"[ 135MPRS TANKER STATUS ]", true):ToBlue()
-- SoundRadioMsg:ToCoalition(coalition.side.BLUE)
-- end
-- Spawn_Blue135MPRS:HandleEvent(EVENTS.Tkeoff)
-- function Spawn_Blue135MPRS:OnEventTakeoff(EventData)
-- local RadioMessage = MESSAGE:New("Tanker Texaco TEX 41x 252am has taken off..",15,"[ 135MPRS TANKER STATUS ]", true):ToBlue()
-- SoundRadioMsg:ToCoalition(coalition.side.BLUE)
-- end

View File

@@ -0,0 +1,123 @@
--[[
The purpose of this file is to setup the mission in support of the
Persistance mod DSMC. This MOD requires that you strictly control the
spawning of new units to prevent subsequent luanches of the mission
from spawning more and more units on top of ones already spawned.
1. Load mission in single player.
2. Let all objects load.
3. Use F10 Menu to DSMC Save.
4. Open newly created mission in ME and remove this script from the mission.
4. Upload your edited version to the server.
--]]
-- Create zones to use later in the randomization.
local BATUMI_COSTAL_DEF_1 = ZONE_POLYGON:New("RU_BATUMI_COSTAL_DEF_1", GROUP:FindByName("RU_BATUMI_COSTAL_DEF_1" ) )
local BATUMI_COSTAL_DEF_2 = ZONE_POLYGON:New("RU_BATUMI_COSTAL_DEF_2", GROUP:FindByName("RU_BATUMI_COSTAL_DEF_2" ) )
local BATUMI_COSTAL_DEF_Zones = { BATUMI_COSTAL_DEF_1, BATUMI_COSTAL_DEF_2 }
local RU_BATUMI_COSTAL_DEF_TEMPLATES = {
"RU_BATUMI_COSTAL_DEF_TEMPLATE_1",
"RU_BATUMI_COSTAL_DEF_TEMPLATE_2",
"RU_BATUMI_COSTAL_DEF_TEMPLATE_3", }
Spawn_Batumi_CostalDef = SPAWN:New("RU_BATUMI_COSTAL_DEF_TEMPLATE_1")
:InitLimit( 100, 100 )
:InitRandomizeZones( BATUMI_COSTAL_DEF_Zones )
:InitRandomizeTemplate( RU_BATUMI_COSTAL_DEF_TEMPLATES )
:SpawnScheduled( .1, .2 )
local GROUND_ZONE_1 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_1", GROUP:FindByName( "RU_GRND_SPWN_ZONE_1" ) )
local GROUND_ZONE_2 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_2", GROUP:FindByName( "RU_GRND_SPWN_ZONE_2" ) )
local GROUND_ZONE_3 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_3", GROUP:FindByName( "RU_GRND_SPWN_ZONE_3" ) )
local GROUND_ZONE_4 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_4", GROUP:FindByName( "RU_GRND_SPWN_ZONE_4" ) )
local GROUND_ZONE_5 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_5", GROUP:FindByName( "RU_GRND_SPWN_ZONE_5" ) )
local GROUND_ZONE_6 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_6", GROUP:FindByName( "RU_GRND_SPWN_ZONE_6" ) )
local GROUND_ZONE_7 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_7", GROUP:FindByName( "RU_GRND_SPWN_ZONE_7" ) )
local GROUND_ZONE_8 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_8", GROUP:FindByName( "RU_GRND_SPWN_ZONE_8" ) )
local GROUND_ZONE_9 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_9", GROUP:FindByName( "RU_GRND_SPWN_ZONE_9" ) )
local GROUND_ZONE_10 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_10", GROUP:FindByName( "RU_GRND_SPWN_ZONE_10" ) )
local GROUND_ZONE_11 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_11", GROUP:FindByName( "RU_GRND_SPWN_ZONE_11" ) )
local GROUND_ZONE_12 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_12", GROUP:FindByName( "RU_GRND_SPWN_ZONE_12" ) )
local GROUND_ZONE_13 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_13", GROUP:FindByName( "RU_GRND_SPWN_ZONE_13" ) )
local GROUND_ZONE_14 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_14", GROUP:FindByName( "RU_GRND_SPWN_ZONE_14" ) )
local GROUND_ZONE_15 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_15", GROUP:FindByName( "RU_GRND_SPWN_ZONE_15" ) )
local GROUND_ZONE_16 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_16", GROUP:FindByName( "RU_GRND_SPWN_ZONE_16" ) )
local GROUND_ZONE_17 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_17", GROUP:FindByName( "RU_GRND_SPWN_ZONE_17" ) )
local GROUND_ZONE_18 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_18", GROUP:FindByName( "RU_GRND_SPWN_ZONE_18" ) )
local GROUND_ZONE_19 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_19", GROUP:FindByName( "RU_GRND_SPWN_ZONE_19" ) )
local GROUND_ZONE_20 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_20", GROUP:FindByName( "RU_GRND_SPWN_ZONE_20" ) )
local GROUND_ZONE_21 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_21", GROUP:FindByName( "RU_GRND_SPWN_ZONE_21" ) )
local GROUND_ZONE_22 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_22", GROUP:FindByName( "RU_GRND_SPWN_ZONE_22" ) )
local GROUND_ZONE_23 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_23", GROUP:FindByName( "RU_GRND_SPWN_ZONE_23" ) )
local GROUND_ZONE_24 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_24", GROUP:FindByName( "RU_GRND_SPWN_ZONE_24" ) )
local GROUND_ZONE_25 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_25", GROUP:FindByName( "RU_GRND_SPWN_ZONE_25" ) )
local GROUND_ZONE_26 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_26", GROUP:FindByName( "RU_GRND_SPWN_ZONE_26" ) )
local GROUND_ZONE_27 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_27", GROUP:FindByName( "RU_GRND_SPWN_ZONE_27" ) )
local GROUND_ZONE_28 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_28", GROUP:FindByName( "RU_GRND_SPWN_ZONE_28" ) )
local GROUND_ZONE_29 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_29", GROUP:FindByName( "RU_GRND_SPWN_ZONE_29" ) )
local GROUND_ZONE_30 = ZONE_POLYGON:New( "RU_GRND_SPWN_ZONE_30", GROUP:FindByName( "RU_GRND_SPWN_ZONE_30" ) )
-- Group all the above zones into an array to use later..
local GROUND_Zones = { GROUND_ZONE_1, GROUND_ZONE_2, GROUND_ZONE_3, GROUND_ZONE_4, GROUND_ZONE_5, GROUND_ZONE_6,
GROUND_ZONE_7, GROUND_ZONE_8, GROUND_ZONE_9, GROUND_ZONE_10, GROUND_ZONE_11, GROUND_ZONE_12, GROUND_ZONE_13, GROUND_ZONE_14,
GROUND_ZONE_15, GROUND_ZONE_16, GROUND_ZONE_17, GROUND_ZONE_18, GROUND_ZONE_19, GROUND_ZONE_20, GROUND_ZONE_21, GROUND_ZONE_22,
GROUND_ZONE_23, GROUND_ZONE_24, GROUND_ZONE_25, GROUND_ZONE_26, GROUND_ZONE_27, GROUND_ZONE_28, GROUND_ZONE_29, GROUND_ZONE_30 }
-- These are the ground templates found in the mission editor.
local GROUND_Templates = {
"GROUND_Template1",
"GROUND_Template2",
"GROUND_Template3",
"GROUND_Template4",
"GROUND_Template5",
"GROUND_Template6",
"GROUND_Template7",
"GROUND_Template8",
"GROUND_Template9",
"GROUND_Template10",
"GROUND_Template11",
"GROUND_Template12",
"GROUND_Template13",
"GROUND_Template14", }
--Spawn the ground units using the zone and unit templates defined above.
Spawn_Ground = SPAWN:New("RU_GROUND_TEMPLATE")
:InitLimit( 200, 200 )
:InitRandomizeZones( GROUND_Zones )
:InitRandomizeTemplate( GROUND_Templates )
:SpawnScheduled( .1, .2 )
local AAA_Templates = {
"AAA_Template1",
"AAA_Template2",
"AAA_Template3",
"AAA_Template4",
"AAA_Template5",
"AAA_Template6",
"AAA_Template7",
"AAA_Template8" }
Spawn_AAA = SPAWN:New("RED EWR-14")
:InitLimit( 20, 30 )
:InitRandomizeZones( GROUND_Zones )
:InitRandomizeTemplate( AAA_Templates )
:SpawnScheduled( .1, .2 )
-- There are 10 units in this sam site. Spawning 40 at the beging and limit to 40 will produce 4 SA10 sam sites (max)
local SA10_Templates = {"AAA_SA10_Template"}
Spawn_SA10 = SPAWN:New("SA_10_SITE")
:InitLimit( 40, 40 )
:InitRandomizeZones( GROUND_Zones )
:InitRandomizeTemplate( SA10_Templates )
:SpawnScheduled( .1, .2 )

View File

@@ -0,0 +1,20 @@
--[[
Code for the moose missions.
--]]
WarehouseMission = MISSION
:New( RedCC, "Overlord", "Primary", "Destroy enemy warehouse network!", coalition.side.RED )
:AddScoring( Scoring )
WarehouseMissionAttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterStart()
WarehouseMissionTargetSetUnit = SET_UNIT:New():FilterCoalitions("blue"):FilterPrefixes( "WAREHOUSE" ):FilterStart()
-- WarehouseMissionTargetSetUnit = SET_STATIC:FilterPrefixes("WAREHOUSE")
WarehouseMissionTaskBAI = TASK_A2G_BAI:New( WarehouseMission, WarehouseMissionAttackGroups,"BAI", WarehouseMissionTargetSetUnit )

View File

@@ -0,0 +1,37 @@
weapRestrict = {}
weapRestrict.playerTakeOff ={}
weapRestrict.weapon2BAN={"weapons.bombs.RN-24","weapons.bombs.RN-28"}
function weapRestrict.playerTakeOff:onEvent(e)
if e.id == world.event.S_EVENT_TAKEOFF and e.initiator then
local playerGroup = e.initiator:getGroup()
local playerGroupID = playerGroup:getID()
local wCount
local i
local bCount
local bwCount
local checkPayload = e.initiator:getAmmo()
local pUnitPos = e.initiator:getPoint()
local uIdS
uIdS = tostring(playerGroupID)
if checkPayload then
for bCount =1, #checkPayload do
for bwCount = 1, #weapRestrict.weapon2BAN do
if weapRestrict.weapon2BAN[bwCount] == checkPayload[bCount].desc.typeName then
local naughty_player = e.initiator:getPlayerName()
trigger.action.outText("Restricted Weapon detected: " .. checkPayload[bCount].desc.typeName .. ", this weapon is BANNED, ".. naughty_player .. " kicking to spectator", 120)
trigger.action.outText("NukeUser:".. naughty_player, 0.01)
return
end
end
end
end
end
end
world.addEventHandler(weapRestrict.playerTakeOff)

View File

@@ -0,0 +1,278 @@
-- Since DCS is dumb, and will let a plane spawn at an airbase it doesn't own...
-- We need to run this once at mission start up. Checks the airbases that are blue and unlocks or relocks
-- the slots based on coalition. We need to run this right after SlotBlocker.lua so that we unlock only the planes
-- that should be unlocked.
-- Base Capture Events & Functions
local CaptureNalchik = AIRBASE:FindByName("Kobuleti")
local coa = CaptureNalchik:GetCoalition()
if coa == 1 then -- red
local RadioMessage = MESSAGE:New("Nalchik is Red",5,"[ MISSION SETUP ]", false):ToBlue()
elseif coa == 2 then -- blue
local RadioMessage = MESSAGE:New("Enabling Nalchik for NATO",5,"[ MISSION SETUP ]", false):ToBlue()
-- Disable Red
trigger.action.setUserFlag("Nalchik-1",100)
trigger.action.setUserFlag("Nalchik-2",100)
trigger.action.setUserFlag("Nalchik-3",100)
trigger.action.setUserFlag("Nalchik-4",100)
trigger.action.setUserFlag("Nalchik-5",100)
end
local CaptureKolkhi = AIRBASE:FindByName("Senaki-Kolkhi")
local coa = CaptureKolkhi:GetCoalition()
if coa == 1 then -- red
local RadioMessage = MESSAGE:New("Kolkhi is Red",5,"[ MISSION SETUP ]", false):ToBlue()
elseif coa == 2 then -- blue
local RadioMessage = MESSAGE:New("Enabling Kolkhi for NATO",5,"[ MISSION SETUP ]", false):ToBlue()
--Enable Blue
trigger.action.setUserFlag("KOLKHI-MI8-1",0)
trigger.action.setUserFlag("KOLKHI-MI8-2",0)
trigger.action.setUserFlag("KOLKHI-UH1-1",0)
trigger.action.setUserFlag("KOLKHI-UH1-2",0)
--Disable Red
trigger.action.setUserFlag("Kolkhi-1",100)
trigger.action.setUserFlag("Kolkhi-2",100)
trigger.action.setUserFlag("Kolkhi-3",100)
trigger.action.setUserFlag("Kolkhi-4",100)
trigger.action.setUserFlag("Kolkhi-5",100)
trigger.action.setUserFlag("Kolkhi-6",100)
end
local CaptureKobuleti = AIRBASE:FindByName("Kobuleti")
local coa = CaptureKobuleti:GetCoalition()
if coa == 1 then -- red
local RadioMessage = MESSAGE:New("Kobuleti is Red",5,"[ MISSION SETUP ]", false):ToBlue()
elseif coa == 2 then -- blue
local RadioMessage = MESSAGE:New("Enabling Kobuleti for NATO",5,"[ MISSION SETUP ]", false):ToBlue()
trigger.action.setUserFlag("KOBULETI-MI8-1",0)
trigger.action.setUserFlag("KOBULETI-MI8-2",0)
trigger.action.setUserFlag("KOBULETI-UH1-1",0)
trigger.action.setUserFlag("KOBULETI-UH1-2",0)
end
local CaptureMaykop = AIRBASE:FindByName("Maykop-Khanskaya")
local coa = CaptureMaykop:GetCoalition()
if coa == 1 then -- red
local RadioMessage = MESSAGE:New("Maykop is Red",5,"[ MISSION SETUP ]", false):ToBlue()
elseif coa == 2 then -- blue
local RadioMessage = MESSAGE:New("Enabling Maykop for NATO",5,"[ MISSION SETUP ]", false):ToBlue()
trigger.action.setUserFlag("Maykop-1",0)
trigger.action.setUserFlag("Maykop-2",0)
trigger.action.setUserFlag("Maykop-3",0)
trigger.action.setUserFlag("Maykop-4",0)
trigger.action.setUserFlag("Maykop-5",0)
trigger.action.setUserFlag("Maykop-6",0)
end
local CaptureVody = AIRBASE:FindByName("Mineralnye Vody")
local coa = CaptureVody:GetCoalition()
if coa == 1 then -- red
local RadioMessage = MESSAGE:New("Vody is Red",5,"[ MISSION SETUP ]", false):ToBlue()
elseif coa == 2 then -- blue
local RadioMessage = MESSAGE:New("Enabling Vody for NATO",5,"[ MISSION SETUP ]", false):ToBlue()
--Enable Blue
trigger.action.setUserFlag("Vody-1",0)
trigger.action.setUserFlag("Vody-2",0)
trigger.action.setUserFlag("Vody-3",0)
trigger.action.setUserFlag("Vody-4",0)
trigger.action.setUserFlag("Vody-5",0)
trigger.action.setUserFlag("Vody-6",0)
trigger.action.setUserFlag("Vody-7",0)
trigger.action.setUserFlag("Vody-8",0)
--Dsiable Red
trigger.action.setUserFlag("Vody-9",100)
trigger.action.setUserFlag("Vody-10",100)
trigger.action.setUserFlag("Vody-11",100)
end
-- Sukhumi
CaptureSukhumi = AIRBASE:FindByName("Sukhumi-Babushara")
local coa = CaptureSukhumi:GetCoalition()
-- To a specific coalition.
if coa == 1 then -- red
local RadioMessage = MESSAGE:New("Sukhumi is Red",5,"[ MISSION SETUP ]", false):ToBlue()
elseif coa == 2 then -- blue
local RadioMessage = MESSAGE:New("Enabling Sukhumi for NATO",5,"[ MISSION SETUP ]", false):ToBlue()
trigger.action.setUserFlag("Sukhumi-1",0)
trigger.action.setUserFlag("Sukhumi-2",0)
trigger.action.setUserFlag("Sukhumi-3",0)
trigger.action.setUserFlag("Sukhumi-4",0)
trigger.action.setUserFlag("Sukhumi-5",0)
trigger.action.setUserFlag("Sukhumi-6",0)
trigger.action.setUserFlag("Sukhumi-7",0)
trigger.action.setUserFlag("Sukhumi-8",0)
trigger.action.setUserFlag("Sukhumi-9",0)
trigger.action.setUserFlag("Sukhumi-10",0)
trigger.action.setUserFlag("Sukhumi-11",0)
trigger.action.setUserFlag("SUKHUMI-MI8-1",0)
trigger.action.setUserFlag("SUKHUMI-MI8-2",0)
trigger.action.setUserFlag("SUKHUMI-UH1-1",0)
trigger.action.setUserFlag("SUKHUMI-UH1-2",0)
end
-- Gudauta
CaptureGudauta = AIRBASE:FindByName("Gudauta")
local coa = CaptureGudauta:GetCoalition()
if coa == 1 then -- red
local RadioMessage = MESSAGE:New("Gudauta is Red",5,"[ MISSION SETUP ]", false):ToBlue()
elseif coa == 2 then -- blue
--Enable Blue
local RadioMessage = MESSAGE:New("Enabling Gudauta for NATO",5,"[ MISSION SETUP ]", false):ToBlue()
trigger.action.setUserFlag("GUDAUTA-MI8-1",0)
trigger.action.setUserFlag("GUDAUTA-MI8-2",0)
trigger.action.setUserFlag("GUDAUTA-UH1-1",0)
trigger.action.setUserFlag("GUDAUTA-UH1-2",0)
trigger.action.setUserFlag("GUDAUTA-MIRAGE-1",0)
trigger.action.setUserFlag("GUDAUTA-MIRAGE-2",0)
--Diable Red
trigger.action.setUserFlag("Gudauta-1",100)
trigger.action.setUserFlag("Gudauta-2",100)
trigger.action.setUserFlag("Gudauta-3",100)
trigger.action.setUserFlag("Gudauta-4",100)
end
-- Sochi
CaptureSochi = AIRBASE:FindByName("Sochi-Adler")
local coa = CaptureSochi:GetCoalition()
if coa == 1 then -- red
local RadioMessage = MESSAGE:New("Sochi is Red",5,"[ MISSION SETUP ]", false):ToBlue()
elseif coa == 2 then -- blue
local RadioMessage = MESSAGE:New("Enabling Sochi for NATO",5,"[ MISSION SETUP ]", false):ToBlue()
trigger.action.setUserFlag("Sochi-1",0)
trigger.action.setUserFlag("Sochi-2",0)
trigger.action.setUserFlag("Sochi-3",0)
trigger.action.setUserFlag("Sochi-4",0)
trigger.action.setUserFlag("Sochi-5",0)
trigger.action.setUserFlag("Sochi-6",0)
trigger.action.setUserFlag("Sochi-7",0)
trigger.action.setUserFlag("Sochi-8",0)
trigger.action.setUserFlag("Sochi-9",0)
trigger.action.setUserFlag("Sochi-10",0)
trigger.action.setUserFlag("Sochi-11",0)
trigger.action.setUserFlag("SOCHI-APACHE-1",0)
trigger.action.setUserFlag("SOCHI-APACHE-2",0)
trigger.action.setUserFlag("SOCHI-APACHE-3",0)
trigger.action.setUserFlag("SOCHI-APACHE-4",0)
trigger.action.setUserFlag("SOCHI-HIND-1",0)
trigger.action.setUserFlag("SOCHI-HIND-2",0)
trigger.action.setUserFlag("SOCHI-HIND-3",0)
trigger.action.setUserFlag("SOCHI-HIND-4",0)
trigger.action.setUserFlag("SOCHI-MI8-1",0)
trigger.action.setUserFlag("SOCHI-MI8-2",0)
trigger.action.setUserFlag("SOCHI-UH1-1",0)
trigger.action.setUserFlag("SOCHI-UH1-2",0)
trigger.action.setUserFlag("SOCHI-GAZ-1",0)
trigger.action.setUserFlag("SOCHI-GAZ-2",0)
trigger.action.setUserFlag("SOCHI-GAZ-3",0)
trigger.action.setUserFlag("SOCHI-GAZ-4",0)
trigger.action.setUserFlag("SOCHI-KA50-1",0)
trigger.action.setUserFlag("SOCHI-KA50-2",0)
trigger.action.setUserFlag("SOCHI-KA50-3",0)
trigger.action.setUserFlag("SOCHI-KA50-4",0)
--Disable Red
trigger.action.setUserFlag("Sochi-9",100)
trigger.action.setUserFlag("Sochi-10",100)
trigger.action.setUserFlag("Sochi-11",100)
end
-- Batumi
CaptureBatumi = AIRBASE:FindByName("Batumi")
local coa = CaptureBatumi:GetCoalition()
if coa == 1 then -- red
local RadioMessage = MESSAGE:New("Batumi is Red",5,"[ MISSION SETUP ]", false):ToBlue()
elseif coa == 2 then -- blue
local RadioMessage = MESSAGE:New("Enabling Batumi for NATO",5,"[ MISSION SETUP ]", false):ToBlue()
trigger.action.setUserFlag("Batumi-1",0)
trigger.action.setUserFlag("Batumi-2",0)
trigger.action.setUserFlag("Batumi-3",0)
trigger.action.setUserFlag("Batumi-4",0)
trigger.action.setUserFlag("Batumi-5",0)
trigger.action.setUserFlag("Batumi-6",0)
trigger.action.setUserFlag("BATUMI-APACHE-1",0)
trigger.action.setUserFlag("BATUMI-APACHE-2",0)
trigger.action.setUserFlag("BATUMI-APACHE-3",0)
trigger.action.setUserFlag("BATUMI-APACHE-4",0)
trigger.action.setUserFlag("BATUMI-HIND-1",0)
trigger.action.setUserFlag("BATUMI-HIND-2",0)
trigger.action.setUserFlag("BATUMI-HIND-3",0)
trigger.action.setUserFlag("BATUMI-HIND-4",0)
trigger.action.setUserFlag("BATUMI-UH1-1",0)
trigger.action.setUserFlag("BATUMI-UH1-2",0)
trigger.action.setUserFlag("BATUMI-UH1-3",0)
trigger.action.setUserFlag("BATUMI-UH1-4",0)
trigger.action.setUserFlag("BATUMI-GAZ-1",0)
trigger.action.setUserFlag("BATUMI-GAZ-2",0)
trigger.action.setUserFlag("BATUMI-GAZ-3",0)
trigger.action.setUserFlag("BATUMI-GAZ-4",0)
trigger.action.setUserFlag("BATUMI-MI8-1",0)
trigger.action.setUserFlag("BATUMI-MI8-2",0)
trigger.action.setUserFlag("BATUMI-MI8-3",0)
trigger.action.setUserFlag("BATUMI-MI8-4",0)
trigger.action.setUserFlag("BATUMI-KA50-1",0)
trigger.action.setUserFlag("BATUMI-KA50-2",0)
trigger.action.setUserFlag("BATUMI-KA50-3",0)
trigger.action.setUserFlag("BATUMI-KA50-4",0)
--Block Red Planes
trigger.action.setUserFlag("Batumi-5",100)
trigger.action.setUserFlag("Batumi-6",100)
end

View File

@@ -0,0 +1,192 @@
trigger.action.setUserFlag("SSB",100)
-- trigger.action.setUserFlag("F99th-MISSION COMMANDER",100)
trigger.action.setUserFlag("Kutaisi-1",100)
trigger.action.setUserFlag("Kutaisi-2",100)
trigger.action.setUserFlag("Kutaisi-3",100)
trigger.action.setUserFlag("Kutaisi-4",100)
trigger.action.setUserFlag("Kutaisi-5",100)
trigger.action.setUserFlag("Kutaisi-6",100)
trigger.action.setUserFlag("Kutaisi-7",100)
trigger.action.setUserFlag("Kutaisi-8",100)
trigger.action.setUserFlag("Kutaisi-9",100)
trigger.action.setUserFlag("Kutaisi-10",100)
trigger.action.setUserFlag("Kutaisi-11",100)
trigger.action.setUserFlag("Kutaisi-12",100)
trigger.action.setUserFlag("Mozdok-1",100)
trigger.action.setUserFlag("Mozdok-2",100)
trigger.action.setUserFlag("Mozdok-3",100)
trigger.action.setUserFlag("Mozdok-4",100)
trigger.action.setUserFlag("Mozdok-5",100)
trigger.action.setUserFlag("Mozdok-6",100)
trigger.action.setUserFlag("Mozdok-7",100)
trigger.action.setUserFlag("Mozdok-8",100)
trigger.action.setUserFlag("Beslan-1",100)
trigger.action.setUserFlag("Beslan-2",100)
trigger.action.setUserFlag("Beslan-3",100)
trigger.action.setUserFlag("Beslan-4",100)
trigger.action.setUserFlag("Beslan-5",100)
trigger.action.setUserFlag("Beslan-6",100)
trigger.action.setUserFlag("Beslan-7",100)
trigger.action.setUserFlag("Beslan-8",100)
trigger.action.setUserFlag("BESLAN-UH1-1",100)
trigger.action.setUserFlag("BESLAN-UH1-2",100)
trigger.action.setUserFlag("BESLAN-MI8-1",100)
trigger.action.setUserFlag("BESLAN-MI8-2",100)
trigger.action.setUserFlag("BESLAN-HIND-1",100)
trigger.action.setUserFlag("BESLAN-HIND-2",100)
trigger.action.setUserFlag("BESLAN-APACHE-1",100)
trigger.action.setUserFlag("BESLAN-APACHE-2",100)
trigger.action.setUserFlag("BESLAN-GAZ-1",100)
trigger.action.setUserFlag("BESLAN-GAZ-2",100)
trigger.action.setUserFlag("BESLAN-GAZ-3",100)
trigger.action.setUserFlag("BESLAN-GAZ-4",100)
trigger.action.setUserFlag("BESLAN-KA50-1",100)
trigger.action.setUserFlag("BESLAN-KA50-2",100)
trigger.action.setUserFlag("Maykop-1",100)
trigger.action.setUserFlag("Maykop-2",100)
trigger.action.setUserFlag("Maykop-3",100)
trigger.action.setUserFlag("Maykop-4",100)
trigger.action.setUserFlag("Maykop-5",100)
trigger.action.setUserFlag("Maykop-6",100)
trigger.action.setUserFlag("Sukhumi-1",100)
trigger.action.setUserFlag("Sukhumi-2",100)
trigger.action.setUserFlag("Sukhumi-3",100)
trigger.action.setUserFlag("Sukhumi-4",100)
trigger.action.setUserFlag("Sukhumi-5",100)
trigger.action.setUserFlag("Sukhumi-6",100)
trigger.action.setUserFlag("Sukhumi-7",100)
trigger.action.setUserFlag("Sukhumi-8",100)
trigger.action.setUserFlag("Sukhumi-9",100)
trigger.action.setUserFlag("Sukhumi-10",100)
trigger.action.setUserFlag("Sukhumi-11",100)
trigger.action.setUserFlag("SUKHUMI-MI8-1",100)
trigger.action.setUserFlag("SUKHUMI-MI8-2",100)
trigger.action.setUserFlag("SUKHUMI-UH1-1",100)
trigger.action.setUserFlag("SUKHUMI-UH1-2",100)
--KOBULETI
trigger.action.setUserFlag("KOBULETI-MI8-1",100)
trigger.action.setUserFlag("KOBULETI-MI8-2",100)
trigger.action.setUserFlag("KOBULETI-UH1-1",100)
trigger.action.setUserFlag("KOBULETI-UH1-2",100)
--KOLKHI
trigger.action.setUserFlag("KOLKHI-MI8-1",100)
trigger.action.setUserFlag("KOLKHI-MI8-2",100)
trigger.action.setUserFlag("KOLKHI-UH1-1",100)
trigger.action.setUserFlag("KOLKHI-UH1-2",100)
trigger.action.setUserFlag("Vody-1",100)
trigger.action.setUserFlag("Vody-2",100)
trigger.action.setUserFlag("Vody-3",100)
trigger.action.setUserFlag("Vody-4",100)
trigger.action.setUserFlag("Vody-5",100)
trigger.action.setUserFlag("Vody-6",100)
trigger.action.setUserFlag("Vody-7",100)
trigger.action.setUserFlag("Vody-8",100)
-- Batumi
trigger.action.setUserFlag("Batumi-1",100)
trigger.action.setUserFlag("Batumi-2",100)
trigger.action.setUserFlag("Batumi-3",100)
trigger.action.setUserFlag("Batumi-4",100)
trigger.action.setUserFlag("BATUMI-APACHE-1",100)
trigger.action.setUserFlag("BATUMI-APACHE-2",100)
trigger.action.setUserFlag("BATUMI-APACHE-3",100)
trigger.action.setUserFlag("BATUMI-APACHE-4",100)
trigger.action.setUserFlag("BATUMI-HIND-1",100)
trigger.action.setUserFlag("BATUMI-HIND-2",100)
trigger.action.setUserFlag("BATUMI-HIND-3",100)
trigger.action.setUserFlag("BATUMI-HIND-4",100)
trigger.action.setUserFlag("BATUMI-UH1-1",100)
trigger.action.setUserFlag("BATUMI-UH1-2",100)
trigger.action.setUserFlag("BATUMI-UH1-3",100)
trigger.action.setUserFlag("BATUMI-UH1-4",100)
trigger.action.setUserFlag("BATUMI-GAZ-1",100)
trigger.action.setUserFlag("BATUMI-GAZ-2",100)
trigger.action.setUserFlag("BATUMI-GAZ-3",100)
trigger.action.setUserFlag("BATUMI-GAZ-4",100)
trigger.action.setUserFlag("BATUMI-MI8-1",100)
trigger.action.setUserFlag("BATUMI-MI8-2",100)
trigger.action.setUserFlag("BATUMI-MI8-3",100)
trigger.action.setUserFlag("BATUMI-MI8-4",100)
trigger.action.setUserFlag("BATUMI-KA50-1",100)
trigger.action.setUserFlag("BATUMI-KA50-2",100)
trigger.action.setUserFlag("BATUMI-KA50-3",100)
trigger.action.setUserFlag("BATUMI-KA50-4",100)
-- Gudauta
trigger.action.setUserFlag("GUDAUTA-MI8-1",100)
trigger.action.setUserFlag("GUDAUTA-MI8-2",100)
trigger.action.setUserFlag("GUDAUTA-UH1-1",100)
trigger.action.setUserFlag("GUDAUTA-UH1-2",100)
trigger.action.setUserFlag("GUDAUTA-MIRAGE-1",100)
trigger.action.setUserFlag("GUDAUTA-MIRAGE-2",100)
-- Sochi
trigger.action.setUserFlag("Sochi-1",100)
trigger.action.setUserFlag("Sochi-2",100)
trigger.action.setUserFlag("Sochi-3",100)
trigger.action.setUserFlag("Sochi-4",100)
trigger.action.setUserFlag("Sochi-5",100)
trigger.action.setUserFlag("Sochi-6",100)
trigger.action.setUserFlag("Sochi-7",100)
trigger.action.setUserFlag("Sochi-8",100)
trigger.action.setUserFlag("SOCHI-APACHE-1",100)
trigger.action.setUserFlag("SOCHI-APACHE-2",100)
trigger.action.setUserFlag("SOCHI-APACHE-3",100)
trigger.action.setUserFlag("SOCHI-APACHE-4",100)
trigger.action.setUserFlag("SOCHI-HIND-1",100)
trigger.action.setUserFlag("SOCHI-HIND-2",100)
trigger.action.setUserFlag("SOCHI-HIND-3",100)
trigger.action.setUserFlag("SOCHI-HIND-4",100)
trigger.action.setUserFlag("SOCHI-MI8-1",100)
trigger.action.setUserFlag("SOCHI-MI8-2",100)
trigger.action.setUserFlag("SOCHI-UH1-1",100)
trigger.action.setUserFlag("SOCHI-UH1-2",100)
trigger.action.setUserFlag("SOCHI-GAZ-1",100)
trigger.action.setUserFlag("SOCHI-GAZ-2",100)
trigger.action.setUserFlag("SOCHI-GAZ-3",100)
trigger.action.setUserFlag("SOCHI-GAZ-4",100)
trigger.action.setUserFlag("SOCHI-KA50-1",100)
trigger.action.setUserFlag("SOCHI-KA50-2",100)
trigger.action.setUserFlag("SOCHI-KA50-3",100)
trigger.action.setUserFlag("SOCHI-KA50-4",100)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,25 @@
-- ************** ADD-ON AAA SPAWNABLE CRATES ******************
-- Weights must be unique as we use the weight to change the cargo to the correct unit
-- when we unpack
--
do
local _addCrates = {
["AA Crates"] = {
{ weight = 421, desc = "AAA Vulcan", unit = "Vulcan", side = 2, cratesRequired = 1 },
{ weight = 422, desc = "AAA Gepard", unit = "Gepard", side = 2, cratesRequired = 2 },
{ weight = 423, desc = "AAA ZU-23", unit = "Ural-375 ZU-23", side = 1, cratesRequired = 1 },
{ weight = 424, desc = "AAA ZSU-23-4 Shilka", unit = "ZSU-23-4 Shilka", side = 1, cratesRequired = 2 },
},
}
-- add extra crate options
for _subMenuName, _crates in pairs(_addCrates) do
for _, _crate in pairs(_crates) do
-- add crate to the menu table
table.insert(ctld.spawnableCrates[_subMenuName], _crate)
-- add crate to the lookup table
ctld.crateLookupTable[tostring(_crate.weight)] = _crate
end
end
end

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 KiB

View File

@@ -0,0 +1,464 @@
--Verion 1.4.2
ProviderChecker = {}
-- Best to leave this on for the most part.
ProviderChecker.TankerFuelChecking = true
-- Only necessary to set if you don't set them to invicible
ProviderChecker.TankerKilledTimer = 60
-- Good to set even if you are using Fuel Check, in case it lands for some weird AI reason.
ProviderChecker.TankerRTBTimer = 60
-- If you want it to respawn when fuel state reaches 20%, instead of having it RTB all the way to base.
ProviderChecker.AWACFuelChecking = true
-- Killed Timer is the time delay to respawn for killed in seconds. Minimum of 5 seconds, anything less will default to 5 seconds
ProviderChecker.AWACKilledTimer = 600
-- RTB Timer is time delay to respawn from landing. Can be 0
ProviderChecker.AWACRTBTimer = 60
ProviderChecker.AWACSeventHandler = {}
ProviderChecker.TankereventHandler = {}
ProviderChecker.TankerTable = {}
ProviderChecker.AwacsTable = {}
ProviderChecker.TankerRefuelingCountBlueFor = 0
ProviderChecker.TankerRefuelingCountRedFor = 0
--Tankers waiting for respawn
ProviderChecker.TankerStandbyTable= {}
function ProviderChecker.TankerRadioStatus(radio_coalition)
local coalition_side = ""
if radio_coalition == 1 then
coalition_side = coalition_side .. "red"
elseif radio_coalition == 2 then
coalition_side = coalition_side .. "blue"
end
local tanker_status_start = "===========================\n"
local tanker_status_end = "==========================="
local tanker_status_mid = ""
for fueler, params in pairs(ProviderChecker.TankerTable) do
if params.coalition == coalition_side then
if params.has_tasking then
local m_tanker_id = Group.getByName(params.name)
local m_tanker_radio = params.radio_freqeuncy
local m_tanker_units = m_tanker_id:getUnits()
local m_tanker_unit = m_tanker_units[1]
local m_tanker_callsign = m_tanker_unit:getCallsign()
local m_tanker_channel = params.channel
local m_tanker_mode = params.modeChannel
local m_tanker_ac_type = m_tanker_unit:getTypeName()
tanker_status_mid = tanker_status_mid .. "Tanker: " .. m_tanker_callsign .. " Radio: " .. m_tanker_radio ..
" TACAN: " .. m_tanker_channel .. m_tanker_mode .. " Aircraft: " .. m_tanker_ac_type .. "\n"
else
local m_tanker_id = Group.getByName(params.name)
local m_tanker_radio = params.radio_freqeuncy
local m_tanker_units = m_tanker_id:getUnits()
local m_tanker_unit = m_tanker_units[1]
local m_tanker_callsign = m_tanker_unit:getCallsign()
tanker_status_mid = tanker_status_mid .. "Tanker: " .. m_tanker_callsign .. " Radio: " .. m_tanker_radio ..
" TACAN: N/A" .. " Aircraft: " .. m_tanker_ac_type .. "\n"
end
end
end
local out_message = tanker_status_start .. tanker_status_mid .. tanker_status_end
trigger.action.outTextForCoalition(radio_coalition, out_message, 30, true)
end
function ProviderChecker.RefreshTACAN(_nil,time)
for fueler, params in pairs(ProviderChecker.TankerTable) do
if params.has_tasking then
local tanker_id = Group.getByName(params.name)
if tanker_id then
local tanker_controller = tanker_id:getController()
local tanker_tacan = {
id = 'ActivateBeacon',
params = {
["type"] = params.type,
["AA"] = params.AA,
["unitId"] = tanker_id,
["modeChannel"] = params.modeChannel,
["channel"] = params.channel,
["system"] = params.system,
["callsign"] = params.callsign,
["bearing"] = params.bearing,
["frequency"] = params.frequency,
}
}
tanker_controller:setCommand(tanker_tacan)
end
end
end
return time + 10
end
--Will Eventually consoldate these to one function. Pass type (awacs or tanker) as argument.
function ProviderChecker.SpawnNewTanker(_unit, time)
--respawn uses the same name, and tankers are tracked by name instead of ID. Will change this for AWACS in future update.
NewGroup = mist.respawnGroup(_unit,true)
NewName = NewGroup.units[1].name
NewUnit = Unit.getByName(NewName)
tanker_controller = NewUnit:getController()
for tanker, params in pairs(ProviderChecker.TankerTable) do
if params.name == NewName then
local frequency = tonumber(params.radio_freqeuncy) * 1000000
SetFrequency = {
id = 'SetFrequency',
params = {
frequency = frequency,
modulation = 0,
}
}
tanker_controller:setCommand(SetFrequency)
trigger.action.outTextForCoalition(NewUnit:getCoalition(),"Tanker " ..NewUnit:getCallsign().. " is back online!", 10, false)
end
end
return nil
end
function ProviderChecker.SpawnNewAwacs(_unit, time)
NewGroup = mist.respawnGroup(_unit,true)
NewName = NewGroup.units[1].name
NewUnit = Unit.getByName(NewName)
awacs_controller = NewUnit:getController()
for awacs, params in pairs(ProviderChecker.AwacsTable) do
if params.name == NewName then
local frequency = tonumber(params.radio_freqeuncy) * 1000000
SetFrequency = {
id = 'SetFrequency',
params = {
frequency = frequency,
modulation = 0,
}
}
awacs_controller:setCommand(SetFrequency)
trigger.action.outTextForCoalition(NewUnit:getCoalition(),"AWACS " .. NewUnit:getCallsign() .. " is back online!", 10, false)
end
end
return nil
end
--due to how scheduled functions work, I need to create a class to handle this. Will upgrade later next revision.
function ProviderChecker.checkTankerFuel(_nil,time)
for fueler, params in pairs(ProviderChecker.TankerTable) do
local fueler_group_name = params.name
local fueler_group = Group.getByName(fueler_group_name)
if fueler_group then
local fueler_units = fueler_group:getUnits()
local fueler_id = fueler_units[1]
local fueler_fuel = fueler_id:getFuel()
if fueler_fuel < 0.20 then
if params.coalition == "blue" then
if ProviderChecker.TankerRefuelingCountBlueFor < 1 then
trigger.action.outTextForCoalition(
fueler_id:getCoalition(),
"Tanker " .. fueler_id:getCallsign() .. " Is out of Fuel. Respawning in 5 seconds",
10
)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, fueler_group_name, timer.getTime() + 5)
elseif ProviderChecker.TankerRefuelingCountBlueFor > 0 then
trigger.action.outTextForCoalition(
fueler_id:getCoalition(),
"Tanker " .. fueler_id:getCallsign() .. " fuel at less than 20%. Will respawn when no aircraft are refueling",
10
)
end
elseif params.coalition == "red" then
if ProviderChecker.TankerRefuelingCountRedFor < 1 then
trigger.action.outTextForCoalition(
fueler_id:getCoalition(),
"Tanker " .. fueler_id:getCallsign() .. " Is out of Fuel. Respawning in 5 seconds",
10
)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, fueler_group_name, timer.getTime() + 5)
elseif ProviderChecker.TankerRefuelingCountRedFor > 0 then
trigger.action.outTextForCoalition(
fueler_id:getCoalition(),
"Tanker " .. fueler_id:getCallsign() .. " fuel at less than 20%. Will respawn when no aircraft are refueling",
10
)
end
end
elseif fueler_fuel < 0.22 then
trigger.action.outTextForCoalition(
fueler_id:getCoalition(),
"Tanker " .. fueler_id:getCallsign() .. " at 25%. Will respawn at 20% if no aircraft are refueling",
10
)
end
end
end
return time + 120
end
function ProviderChecker.checkAWACSFuel(_nil,time)
--Due to the respawn and scheduledFunction limitations, Checking Refuel requires imediate respawn, else it would loop to respawn again and again.
for awacs, params in pairs(ProviderChecker.AwacsTable) do
local awacs_group_name = params.name
local awacs_group = Group.getByName(awacs_group_name)
if awacs_group then
local awacs_units = awacs_group:getUnits()
local awacs_id = awacs_units[1]
local awacs_fuel = awacs_id:getFuel()
if awacs_fuel < 0.30 then
if params.coalition == "blue" then
trigger.action.outTextForCoalition(
awacs_id:getCoalition(),
"AWACS " .. awacs_id:getCallsign() .. " Is out of Fuel. Respawning in 5 seconds",
10
)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, awacs_group_name, timer.getTime() + 5)
elseif params.coalition == "red" then
trigger.action.outTextForCoalition(
awacs_id:getCoalition(),
"AWACS " .. awacs_id:getCallsign() .. " Is out of Fuel. Respawning in 5 seconds",
10
)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, awacs_group_name, timer.getTime() + 5)
end
end
end
end
return time + 120
end
function ProviderChecker.TankereventHandler:onEvent(_event)
-- Adds up the number of units taking fuel because the event handler is based on unit taking fuel, not giving fuel
-- Solution to this later will be check nearest unit of type tanker and create a "class" out of that.
if (_event.id == 7) and _event.initiator then
local refueling_unit = _event.initiator
local refueling_unit_coalition = refueling_unit:getCoalition()
if refueling_unit_coalition == 2 then
ProviderChecker.TankerRefuelingCountBlueFor = ProviderChecker.TankerRefuelingCountBlueFor + 1
elseif refueling_unit_coalition == 1 then
ProviderChecker.TankerRefuelingCountRedFor = ProviderChecker.TankerRefuelingCountRedFor + 1
end
end
-- Removes the number of units taking fuel
if (_event.id == 14) and _event.initiator then
local refueling_unit = _event.initiator
local refueling_unit_coalition = refueling_unit:getCoalition()
if refueling_unit_coalition == 2 then
ProviderChecker.TankerRefuelingCountBlueFor = ProviderChecker.TankerRefuelingCountBlueFor - 1
elseif refueling_unit_coalition == 1 then
ProviderChecker.TankerRefuelingCountRedFor = ProviderChecker.TankerRefuelingCountRedFor - 1
end
end
-- Checks if tanker landed.
if (_event.id == 4) and _event.initiator then
if _event.initiator then
local LandedUnit = _event.initiator
local LandedUnitName = LandedUnit:getName()
local LandedUnitInfo = Unit.getGroup(LandedUnit)
local LandedUnitGroupName = LandedUnitInfo:getName()
for fueler, params in pairs(ProviderChecker.TankerTable) do
if LandedUnitGroupName == params.name then
if ProviderChecker.TankerRTBTimer > 5 then
trigger.action.outTextForCoalition(
LandedUnit:getCoalition(),
"Tanker " .. LandedUnit:getCallsign() .. " Landed - Respawning in " .. (ProviderChecker.TankerRTBTimer / 60) .. " minutes", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, LandedUnitGroupName, timer.getTime() + ProviderChecker.TankerRTBTimer)
else
trigger.action.outTextForCoalition(
LandedUnit:getCoalition(),
"Tanker " .. LandedUnit:getCallsign() .. " Landed - Respawning", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, LandedUnitGroupName, timer.getTime() + 5)
end
end
end
end
end
if (_event.id == 5) and _event.initiator then
local DeadUnit = _event.initiator
local DeadUnitName = DeadUnit:getName()
local DeadUnitInfo = Unit.getGroup(DeadUnit)
local DeadUnitGroupName = DeadUnitInfo:getName()
for fueler, params in pairs(ProviderChecker.TankerTable) do
if DeadUnitGroupName == params.name then
if ProviderChecker.TankerKilledTimer > 5 then
trigger.action.outTextForCoalition(
DeadUnit:getCoalition(),
"Tanker " .. DeadUnit:getCallsign() .. " has crashed! Replacement will be on station in " .. (ProviderChecker.TankerKilledTimer / 60) .. " minutes", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, DeadUnitGroupName, timer.getTime() + ProviderChecker.TankerKilledTimer)
else
trigger.action.outTextForCoalition(
DeadUnit:getCoalition(),
"Tanker " .. LandedUnit:getCallsign() .. " has crashed! Replacement will be on station in 5 Seconds", 10,false)
timer.scheduleFunction(ProviderChecker.SpawnNewTanker, DeadUnitGroupName, timer.getTime() + 5)
end
end
end
end
end
function ProviderChecker.AWACSeventHandler:onEvent(_event)
-- Checks if tanker landed.
if (_event.id == 4) and _event.initiator then
local LandedUnit = _event.initiator
local LandedUnitName = LandedUnit:getName()
local LandedUnitInfo = Unit.getGroup(LandedUnit)
local LandedUnitGroupName = LandedUnitInfo:getName()
for awacs, params in pairs(ProviderChecker.AwacsTable) do
if LandedUnitGroupName == params.name then
if ProviderChecker.AWACRTBTimer > 5 then
trigger.action.outTextForCoalition(
LandedUnit:getCoalition(),
"AWACS " .. LandedUnit:getCallsign() .. " Landed - Respawning in " .. (ProviderChecker.AWACRTBTimer / 60) .. " minutes", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, LandedUnitGroupName, timer.getTime() + ProviderChecker.AWACRTBTimer)
else
trigger.action.outTextForCoalition(
LandedUnit:getCoalition(),
"AWACS " .. LandedUnit:getCallsign() .. " Landed - Respawning", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, LandedUnitGroupName, timer.getTime() + 5)
end
end
end
end
if (_event.id == 5) and _event.initiator then
local DeadUnit = _event.initiator
local DeadUnitName = DeadUnit:getName()
local DeadUnitInfo = Unit.getGroup(DeadUnit)
local DeadUnitGroupName = DeadUnitInfo:getName()
for awacs, params in pairs(ProviderChecker.AwacsTable) do
if DeadUnitGroupName == params.name then
if ProviderChecker.AWACKilledTimer > 5 then
trigger.action.outTextForCoalition(
DeadUnit:getCoalition(),
"AWACS " .. DeadUnit:getCallsign() .. " has been shot down! Replacement will be on station in " .. (ProviderChecker.AWACKilledTimer / 60) .. " minutes", 10, false)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, DeadUnitGroupName, timer.getTime() + ProviderChecker.AWACKilledTimer)
else
trigger.action.outTextForCoalition(
DeadUnit:getCoalition(),
"AWACS " .. DeadUnit:getCallsign() .. " has been shot down! Replacement will be on station in 5 Seconds", 10,false)
timer.scheduleFunction(ProviderChecker.SpawnNewAwacs, DeadUnitGroupName, timer.getTime() + 5)
end
end
end
end
end
-- function ProviderChecker.ServiceCheckerMsg()
function ProviderChecker.GetServicesList()
-- You can -only- get TACAN data from the mission file. So since MIST respawn uses the same TACANs on respawn,
-- I can pull from the mission file and refresh that way
for coa_name, coa_data in pairs(env.mission.coalition) do
if (coa_name == 'red' or coa_name == 'blue') and type(coa_data) == 'table' then
if coa_data.country then --there is a country table
for cntry_id, cntry_data in pairs(coa_data.country) do
for obj_type_name, obj_type_data in pairs(cntry_data) do
if obj_type_name == "plane" then
if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then --there's a group!
for group_num, group_data in pairs(obj_type_data.group) do
group_Id = group_data.groupId
group_radio = group_data.frequency
group_name = env.getValueDictByKey(group_data.name)
if group_data.task == "Refueling" then
if group_data["units"][1]["type"] ~= "IL-78M" then
if group_data.tasks and group_data.tasks.parmas then
for tasks_id, tasks_data in pairs(group_data.tasks) do
if tasks_data.params and tasks_data.params.action and tasks_data.params.action.params then
tasks_data.params.action.params["coalition"] = coa_name
tasks_data.params.action.params["radio_freqeuncy"] = group_radio
tasks_data.params.action.params["name"] = group_name
tasks_data.params.action.params["has_tasking"] = true
ProviderChecker.TankerTable[group_Id] = tasks_data.params.action.params
end --if task_data.params
end -- for tasks_id, tasks_data
-- Because for some weird ass reason, the tasks will be blank so I need to pull them from waypoints instead
elseif group_data.route.points then
for point_id, point_params in pairs(group_data.route.points) do
if point_params.task then
for tasks_id, tasks_data in pairs(point_params.task.params.tasks) do
if tasks_data.params and tasks_data.params.action and tasks_data.params.action.id == "ActivateBeacon" then
tasks_data.params.action.params["coalition"] = coa_name
tasks_data.params.action.params["radio_freqeuncy"] = group_radio
tasks_data.params.action.params["name"] = group_name
tasks_data.params.action.params["has_tasking"] = true
ProviderChecker.TankerTable[group_Id] = tasks_data.params.action.params
end -- if tasks_data.params and
end -- for tasks_id, tasks_data in
end --if point_params.task
end -- for point_id, point_params
end -- if group_data.tasks then
else
ProviderChecker.TankerTable[group_Id] = {}
ProviderChecker.TankerTable[group_Id]["coalition"] = coa_name
ProviderChecker.TankerTable[group_Id]["radio_freqeuncy"] = group_radio
ProviderChecker.TankerTable[group_Id]["name"] = group_name
ProviderChecker.TankerTable[group_Id]["has_tasking"] = false
end -- group_data["units"][1]["type"] ~= "IL-78M" then
elseif group_data.task == "AWACS" then
ProviderChecker.AwacsTable[group_Id] = {}
ProviderChecker.AwacsTable[group_Id]["coalition"] = coa_name
ProviderChecker.AwacsTable[group_Id]["radio_freqeuncy"] = group_radio
ProviderChecker.AwacsTable[group_Id]["name"] = group_name
ProviderChecker.AwacsTable[group_Id]["modeChannel"] = "N/A"
ProviderChecker.AwacsTable[group_Id]["callsign"] = "N/A"
end --if group_data.tas == "Refueling then"
end --for group_num, group_data in pairs(obj_type_data.group) do
end --if ((type(obj_type_data) == 'table') and obj_type_data.group and (type(obj_type_data.group) == 'table') and (#obj_type_data.group > 0)) then
end --if obj_type_name == "helicopter" or obj_type_name == "ship" or obj_type_name == "plane" or obj_type_name == "vehicle" or obj_type_name == "static" then
end --for obj_type_name, obj_type_data in pairs(cntry_data) do
end --for cntry_id, cntry_data in pairs(coa_data.country) do
end --if coa_data.country then --there is a country table
end --if coa_name == 'red' or coa_name == 'blue' and type(coa_data) == 'table' then
end --for coa_name, coa_data in pairs(mission.coalition) do
end
world.addEventHandler(ProviderChecker.AWACSeventHandler)
env.info("F99th AWACS Checker event handler added")
world.addEventHandler(ProviderChecker.TankereventHandler)
env.info("F99th Tanker Checker event handler added")
ProviderChecker.GetServicesList()
timer.scheduleFunction(ProviderChecker.RefreshTACAN, nil, timer.getTime() + 10)
missionCommands.addCommandForCoalition(2,"Get Tanker Info",nil, ProviderChecker.TankerRadioStatus,2)
missionCommands.addCommandForCoalition(1,"Get Tanker Info",nil, ProviderChecker.TankerRadioStatus,1)
if ProviderChecker.TankerFuelChecking then
timer.scheduleFunction(ProviderChecker.checkTankerFuel, nil, timer.getTime() + 120)
end
if ProviderChecker.AWACFuelChecking then
timer.scheduleFunction(ProviderChecker.checkAWACSFuel, nil, timer.getTime() + 120)
end

Some files were not shown because too many files have changed in this diff Show More