Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local ObjectiveGroups =
- {
- ['FACTORY'] =
- {
- ['OIL'] =
- {
- ['Nalchik Oil Station'] = {"Nalchik Oil Tank #001","Nalcik Oil Tank #002","Nalchik Oil CP","Nalchik Oil Barraks"},
- ['Mozdok Oil Station'] = {"Mozdok Oil Tank #001","Mozdok Oil Tank #002","Mozdok Oil CP","Mozdok Oil Barraks"},
- },
- ['METAL'] =
- {
- ['Nalchik Metal Workshop'] = "",
- ['Gali Metal Workshop'] = "",
- ['Zugdidi Metal Workshop'] = "",
- },
- ['AMMUNITION'] =
- {
- },
- ['ELECTRIC'] =
- {
- },
- ['NUCLEAR'] =
- {
- },
- },
- ['RADAR'] =
- {
- ['HEWS'] = --High Early Warning System
- {
- ['Nalchik HEWS'] = "",
- ['Vaziani HEWS'] = "",
- },
- ['LEWS'] = --Low Early Warning System
- {
- ['Nalchik HEWS'] = "",
- ['Vaziani HEWS'] = "",
- },
- },
- ['ARMY'] =
- {
- ['ARMYBASE'] =
- {
- ['Nalchik Armybase'] = "",
- ['Vaziani Armybase'] = "",
- },
- ['FARP'] =
- {
- ['London'] = "",
- ['Vetka'] = "",
- },
- ['CP'] =
- {
- ['Nalchik CP'] = "",
- ['Vaziani CP'] = "",
- },
- ['AIRBASE'] =
- {
- ['Gelendzhik'] = {},
- ['Novorossiysk'] = {},
- ['Krymsk'] = {},
- ['Anapa-Vityazevo'] = {},
- ['Krasnodar-Center'] = {},
- ['Krasnodar-Pashkovsky'] = {},
- ['Maykop-Khanskaya'] = {},
- ['Sochi-Adler'] = {},
- ['Gudauta'] = {},
- ['Sukhumi-Babushara'] = {},
- ['Senaki-Kolkhi'] = {},
- ['Kutaisi'] = {},
- ['Kobuleti'] = {},
- ['Batumi'] = {},
- ['Mineralnye Vody'] = {},
- ['Nalchik'] = {},
- ['Mozdok'] = {},
- ['Beslan'] = {},
- ['Tblisi=Lochini'] = {},
- ['Soganlug'] = {},
- ['Vaziani'] = {},
- },
- },
- }
- local CoaObj =
- {
- ['red'] =
- {
- ['FACTORY'] =
- {
- ['OIL'] = {"Nalchik Oil Station", "Nalchik Oil Station"},
- ['METAL'] = {"Nalchik Metal Workshop","Gali Metal Workshop","Zugdidi Metal Workshop"},
- ['AMMUNITION'] = {"Mozdok Ammo","Gori Ammo"},
- ['ELECTRIC'] = {"Gali Electric","Zugdidi Electric"},
- ['NUCLEAR'] = {"Poti Nuclear","Gelendzhik Nuclear"},
- },
- ['RADAR'] =
- {
- ['HEWS'] = {"Nalchik HEWS","Vaziani HEWS"}, --High Early Warning System
- ['LEWS'] = {"Nalchik HEWS","Vaziani HEWS"}, --Low Early Warning System
- },
- ['ARMY'] =
- {
- ['ARMYBASE'] = {"Nalchik Armybase","Vaziani Armybase"},
- ['FARP'] = {"London","Vetka"},
- ['CP'] = {"Nalchik CP","Vaziani CP"},
- ['AIRBASE'] = {"Gelendzhik","Novorossiysk","Krymsk","Anapa-Vityazevo","Krasnodar-Center","Krasnodar-Pashkovsky","Maykop-Khanskaya","Sochi-Adler","Gudauta","Sukhumi-Babushara","Senaki-Kolkhi","Kutaisi","Kobuleti","Batumi","Mineralnye Vody","Nalchik","Mozdok","Beslan","Tblisi=Lochini","Soganlug","Vaziani"}
- },
- },
- ['blue'] =
- {
- ['FACTORY'] =
- {
- ['OIL'] = {"Nalchik Oil Station", "Nalchik Oil Station"},
- ['METAL'] = {"Nalchik Metal Workshop","Gali Metal Workshop","Zugdidi Metal Workshop"},
- ['AMMUNITION'] = {"Mozdok Ammo","Gori Ammo"},
- ['ELECTRIC'] = {"Gali Electric","Zugdidi Electric"},
- ['NUCLEAR'] = {"Poti Nuclear","Gelendzhik Nuclear"},
- },
- ['RADAR'] =
- {
- ['HEWS'] = {"Nalchik HEWS","Vaziani HEWS"}, --High Early Warning System
- ['LEWS'] = {"Nalchik HEWS","Vaziani HEWS"}, --Low Early Warning System
- },
- ['ARMY'] =
- {
- ['ARMYBASE'] = {"Nalchik Armybase","Vaziani Armybase"},
- ['FARP'] = {"London","Vetka"},
- ['CP'] = {"Nalchik CP","Vaziani CP"},
- ['AIRBASE'] = {"Gelendzhik","Novorossiysk","Krymsk","Anapa-Vityazevo","Krasnodar-Center","Krasnodar-Pashkovsky","Maykop-Khanskaya","Sochi-Adler","Gudauta","Sukhumi-Babushara","Senaki-Kolkhi","Kutaisi","Kobuleti","Batumi","Mineralnye Vody","Nalchik","Mozdok","Beslan","Tblisi=Lochini","Soganlug","Vaziani"}
- },
- },
- }
- local moral =
- {
- ['red'] =
- {
- ['BUILDING'] = "",
- ['PLANE'] = "",
- ['VEHICLE'] = "",
- },
- ['blue'] =
- {
- ['BUILDING'] = "",
- ['PLANE'] = "",
- ['VEHICLE'] = "",
- },
- }
- --Manage Ground movement
- local polyzone =
- {
- ["red"] =
- {
- [1] = 'Kutaisi-Senaki'
- },
- ["blue"] =
- {
- [5] = 'Senaki-Kutaisi'
- }
- }
- local AutoMovement =
- {
- ["stop"] = ,
- ["path"] =
- {
- ["red"] = ,
- ["blue"] = ,
- },
- }
- function ManageMove()
- for
- if trigger.misc.getUserFlag(i)
- function GoToRoute(path)
- for GName, GTable in pairs(mist.DBs.groupsByName) do
- if GTable.category == "vehicle" then
- local unit = GTable.unitName
- local pos = unit:getPosition().p
- local zone = mist.getGroupPoints(polyzone[path])
- if mist.pointInPolygon(pos, zone) then
- ReturnToRoute(GName,path)
- end
- end
- end
- end
- for coa,data in pairs(polyzone) do
- for i,name in pairs(data) do
- if coa = "red" then
- mist.flagFunc.units_in_polygon
- {
- units = {'[red][helicopter]','[red][plane]'},
- zone = mist.getGroupPoints(polyzone.red[i]),
- flag = i,
- req_num = 1,
- interval = 10,
- toggle = true
- }
- elseif coa = "blue" then
- mist.flagFunc.units_in_polygon
- {
- units = {'[blue][helicopter]','[blue][plane]'},
- zone = mist.getGroupPoints(polyzone.blue[i]),
- flag = i,
- req_num = 1,
- interval = 10,
- toggle = true
- }
- end
- end
- end
- ReturnToRoute ('blue #001', "path" )
- ReturnToRoute ('blue', "path" )
- ReturnToRoute ('blue #001', "path #001" )
- ReturnToRoute ('blue', "path #001" )
- mist.groupRandomDistSelf("Red", 5)
- mist.groupRandomDistSelf("Red #001", 5)
- end
- --Get trigger zone V3 point.
- function getObjV3(ObName)
- local tZone = trigger.misc.getZone(ObName)
- local tZonepos = {}
- local tZoneposx = tZone.point.x
- local tZoneposz = tZone.point.z
- local tZoneposy = land.getHeight({x = tZone.point.x, y = tZone.point.z})
- local tZoneV3 = {x=tZoneposx, y=tZoneposy, z=tZoneposz}
- return tZoneV3
- end
- --Get distance between 2 V3 points.
- function getDistV3(1V3,2V3)
- local pointX = 1V3.x - 2V3.x
- local pointZ = 1V3.z - 2V3.z
- return (pointX^2 + pointZ^2)^0.5
- end
- --Assign Objective to Coalition
- function AssignCoaObj(ObjName,Coa)
- if not Coa then
- CoaObj[Coa][
- elseif Coa == "red" then
- elseif Coa == "blue" then
- end
- end
- for FCat, ListFTypes in pairs(ObjectiveGroups) do
- end
- --Deactivating Facilities before they expload to remove burned buildings.
- function DeactivateFacility()
- for coalition, bases in pairs(deactivateUnits) do
- for base, units in pairs(bases) do
- for index, unit in pairs(units) do
- if Unit.getByName(unit) then
- Unit.getByName(unit):destroy()
- end
- end
- end
- end
- for i, group in pairs(VDatabase) do
- for j, v in pairs(group.units) do
- local unit = Unit.getByName(v.name)
- if unit and unit:getLife() <= 1 then
- local unitpos = unit:getPoint()
- unit:destroy()
- trigger.action.explosion(unitpos, 3)
- end
- end
- end
- end
- function getObjLifeList()
- For ObCat, ListObTypes in pairs(ObjectiveGroups) do
- For ObType, ListObNames in pairs(ListObTypes) do
- For ObName, Life in pairs(ListObNames) do
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement