diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOattack.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOattack.sqf index d5c8cf55..4100dc9c 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOattack.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOattack.sqf @@ -158,6 +158,8 @@ while {_count < _numgroups} do { _town = _this select 2; _tskid = _this select 3; + _townpop = server getVariable [format["population%1",_town],0]; + private ["_size","_active","_alive"]; sleep 20; _size = count _soldiers; @@ -177,6 +179,7 @@ while {_count < _numgroups} do { }; }foreach(_soldiers); if(count _alive <= _lostat) then { + _townpop remoteExec ["influence",0,false]; [_tskid, "SUCCEEDED",true] spawn BIS_fnc_taskSetState; _active = false; }else{ diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOcounter.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOcounter.sqf index 419ec7b7..8ea5ae51 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOcounter.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/QRF/NATOcounter.sqf @@ -186,7 +186,12 @@ if((_ao select [0,1]) in ["A","E","I","O","a","e","i","o"]) then {_an = "An"}; if(_objective in OT_needsThe) then { _o = "The "; }; - format["We have captured %1%2",_o,_town] remoteExec ["notify_good",0,false]; + _effect = ""; + if(_objective == "fuel depot") then { + _efect = "(Vehicles are now cheaper)"; + }; + format["Resistance has captured %1%2 (+100 Influence) %3",_o,_objective,_effect] remoteExec ["notify_good",0,false]; + 100 remoteExec ["influenceSilent",0,false]; }else{ if(((count _inrange) / (count _alive)) > 0.7) then { //check for any alive enemies diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/characterSheet.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/characterSheet.sqf new file mode 100644 index 00000000..4ad36093 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/characterSheet.sqf @@ -0,0 +1,58 @@ +closedialog 0; +createDialog "OT_dialog_char"; +openMap false; + +disableSerialization; + +private _fitness = player getVariable ["OT_fitness",1]; + +private _ctrl = (findDisplay 8003) displayCtrl 1100; +_ctrl ctrlSetStructuredText parseText format["Fitness
Level %1
Increases the distance you can sprint",_fitness]; + +getFitnessPrice = { + private _fitness = player getVariable ["OT_fitness",1]; + private _price = 10; + if(_fitness == 2) then { + _price = 100; + }; + if(_fitness == 3) then { + _price = 500; + }; + if(_fitness == 4) then { + _price = 1000; + }; + _price; +}; + +private _price = [] call getFitnessPrice; +ctrlSetText [1600,format["Increase Level (-%1 Influence)",_price]]; + +if(_fitness == 5) then { + ctrlShow [1600,false]; +}; + +buyFitness = { + disableSerialization; + + private _fitness = player getVariable ["OT_fitness",1]; + private _price = [] call getFitnessPrice; + private _inf = player getVariable ["influence",0]; + + if(_inf < _price) exitWith {"You do not have enough influence" call notify_minor}; + + _fitness = _fitness + 1; + player setVariable ["OT_fitness",_fitness,true]; + if(_fitness == 5) then { + ctrlEnable [1600,false]; + }; + player setVariable ["influence",_inf - _price,true]; + + private _ctrl = (findDisplay 8003) displayCtrl 1100; + _ctrl ctrlSetStructuredText parseText format["Fitness
Level %1
Increases the distance you can sprint",_fitness]; + _price = [] call getFitnessPrice; + ctrlSetText [1600,format["Increase Level (-%1 Influence)",_price]]; + + if(_fitness == 5) then { + ctrlShow [1600,false]; + }; +}; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buy.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buy.sqf index 7d35785e..cdde9fd1 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buy.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buy.sqf @@ -31,6 +31,7 @@ call { player reveal _veh; format["You bought a Quadcopter",_cls call ISSE_Cfg_Vehicle_GetName] call notify_minor; playSound "3DEN_notificationDefault"; + hint "To use a UAV, scroll your mouse wheel to 'Open UAV Terminal' then right click your green copter on the ground and 'Connect terminal to UAV'"; }; if(_cls in OT_allVehicles) exitWith { _pos = (getpos player) findEmptyPosition [5,100,_cls]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/main.hpp b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/main.hpp index 7f783ea1..5b670613 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/main.hpp +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/dialogs/main.hpp @@ -110,16 +110,6 @@ class OT_dialog_command // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Xeqozy) //////////////////////////////////////////////////////// - class RscButton_1600: RscButton - { - idc = 1600; - text = "Fast Travel Unit/s"; //--- ToDo: Localize; - x = 0.0204687 * safezoneW + safezoneX; - y = 0.39 * safezoneH + safezoneY; - w = 0.0876563 * safezoneW; - h = 0.077 * safezoneH; - tooltip = "Fast travels all selected units that are not currently wanted (not implemented yet)"; //--- ToDo: Localize; - }; class RscButton_1601: RscButton { idc = 1601; @@ -142,16 +132,6 @@ class OT_dialog_command tooltip = "Commands first unit selected to walk to and open the closest container to them"; //--- ToDo: Localize; action = "closeDialog 0;[] spawn openInventory;"; }; - class RscButton_1603: RscButton - { - idc = 1603; - text = "Rearm"; //--- ToDo: Localize; - x = 0.0204687 * safezoneW + safezoneX; - y = 0.566 * safezoneH + safezoneY; - w = 0.0876563 * safezoneW; - h = 0.077 * safezoneH; - tooltip = "Commands all selected units to find ammo in the surrounding area (not implemented yet)"; //--- ToDo: Localize; - }; //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT END //////////////////////////////////////////////////////// @@ -226,8 +206,8 @@ class OT_dialog_main class controls { - //////////////////////////////////////////////////////// - // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Giqadi) + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Bagoqi) //////////////////////////////////////////////////////// class RscButton_1600: RscButton @@ -254,104 +234,104 @@ class OT_dialog_main class RscButton_1601: RscButton { idc = 1601; + action = "closeDialog 0;createDialog 'OT_dialog_place'"; text = "Place"; //--- ToDo: Localize; x = 0.005 * safezoneW + safezoneX; y = 0.577 * safezoneH + safezoneY; w = 0.149531 * safezoneW; h = 0.066 * safezoneH; - action = "closeDialog 0;createDialog 'OT_dialog_place'"; - tooltip = "Place smaller items around houses you own or at friendly bases"; + tooltip = "Place smaller items around houses you own or at friendly bases"; //--- ToDo: Localize; }; class RscButton_1602: RscButton { idc = 1602; + action = "closeDialog 0;[] spawn buildMenu"; text = "Build"; //--- ToDo: Localize; x = 0.005 * safezoneW + safezoneX; y = 0.654 * safezoneH + safezoneY; w = 0.149531 * safezoneW; h = 0.066 * safezoneH; - action = "closeDialog 0;[] spawn buildMenu"; - tooltip = "Build structures in towns and at bases"; + tooltip = "Build structures in towns and at bases"; //--- ToDo: Localize; }; class RscButton_1603: RscButton { idc = 1603; + action = "[] spawn manageRecruits;"; text = "Manage Recruits"; //--- ToDo: Localize; x = 0.005 * safezoneW + safezoneX; y = 0.731 * safezoneH + safezoneY; w = 0.149531 * safezoneW; h = 0.066 * safezoneH; - action = "[] spawn manageRecruits;"; }; class RscPicture_1200: RscPicture { idc = 1200; text = "#(argb,8,8,3)color(0,0,0,0)"; - x = 0.762969 * safezoneW + safezoneX; - y = 0.368 * safezoneH + safezoneY; - w = 0.113437 * safezoneW; - h = 0.143 * safezoneH; + x = 45.5 * GUI_GRID_W + GUI_GRID_X; + y = 6.5 * GUI_GRID_H + GUI_GRID_Y; + w = 11 * GUI_GRID_W; + h = 6.5 * GUI_GRID_H; }; class RscButton_1605: RscButton { idc = 1605; + action = "closeDialog 0;[] spawn talkToCiv"; text = "Talk"; //--- ToDo: Localize; x = 0.881562 * safezoneW + safezoneX; y = 0.522 * safezoneH + safezoneY; w = 0.113437 * safezoneW; h = 0.044 * safezoneH; - action = "closeDialog 0;[] spawn talkToCiv"; - }; + }; class RscPicture_1201: RscPicture { idc = 1201; text = "#(argb,8,8,3)color(0,0,0,0)"; - x = 0.762969 * safezoneW + safezoneX; - y = 0.632 * safezoneH + safezoneY; - w = 0.113437 * safezoneW; - h = 0.143 * safezoneH; + x = 45.5 * GUI_GRID_W + GUI_GRID_X; + y = 18.5 * GUI_GRID_H + GUI_GRID_Y; + w = 11 * GUI_GRID_W; + h = 6.5 * GUI_GRID_H; }; class RscButton_1608: RscButton { idc = 1608; + action = "closeDialog 0;[] call buyBuilding"; text = "Buy"; //--- ToDo: Localize; - action = "closeDialog 0;[] call buyBuilding"; x = 0.881562 * safezoneW + safezoneX; y = 0.786 * safezoneH + safezoneY; w = 0.113437 * safezoneW; h = 0.044 * safezoneH; - tooltip = "Purchase this building"; + tooltip = "Purchase this building"; //--- ToDo: Localize; }; class RscButton_1609: RscButton { idc = 1609; + action = "closeDialog 0;[] call leaseBuilding"; text = "Lease"; //--- ToDo: Localize; x = 0.881562 * safezoneW + safezoneX; y = 0.841 * safezoneH + safezoneY; w = 0.0515625 * safezoneW; h = 0.044 * safezoneH; - action = "closeDialog 0;[] call leaseBuilding"; - tooltip = "Lease this building"; + tooltip = "Lease this building"; //--- ToDo: Localize; }; class RscButton_1610: RscButton { idc = 1610; + action = "closeDialog 0;[] spawn setHome"; text = "Set Home"; //--- ToDo: Localize; - action = "closeDialog 0;[] spawn setHome"; x = 0.943438 * safezoneW + safezoneX; y = 0.841 * safezoneH + safezoneY; w = 0.0515625 * safezoneW; h = 0.044 * safezoneH; - tooltip = "Make this your home (respawn point)"; + tooltip = "Make this your home (respawn point)"; //--- ToDo: Localize; }; class RscStructuredText_1101: RscStructuredText { @@ -373,13 +353,84 @@ class OT_dialog_main h = 0.143 * safezoneH; colorBackground[] = {0,0,0,0.4}; }; + class RscButton_1611: RscButton + { + idc = 1611; + action = "[] spawn characterSheet;"; + + text = "Character Sheet"; //--- ToDo: Localize; + x = 0.00499997 * safezoneW + safezoneX; + y = 0.808 * safezoneH + safezoneY; + w = 0.149531 * safezoneW; + h = 0.066 * safezoneH; + }; //////////////////////////////////////////////////////// // GUI EDITOR OUTPUT END //////////////////////////////////////////////////////// + }; }; +class OT_dialog_char +{ + idd=8003; + movingenable=false; + + class controls + { + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Pejity) + //////////////////////////////////////////////////////// + + class RscStructuredText_1100: RscStructuredText + { + idc = 1100; + text = ""; //--- ToDo: Localize; + x = 0.273125 * safezoneW + safezoneX; + y = 0.269 * safezoneH + safezoneY; + w = 0.149531 * safezoneW; + h = 0.143 * safezoneH; + colorBackground[] = {0,0,0,0.5}; + colorActive[] = {0,0,0,0.5}; + }; + class RscButton_1600: RscButton + { + idc = 1600; + text = "Increase Level (-10 Influence)"; //--- ToDo: Localize; + x = 0.273125 * safezoneW + safezoneX; + y = 0.423 * safezoneH + safezoneY; + w = 0.149531 * safezoneW; + h = 0.044 * safezoneH; + action="[] call buyFitness;" + }; + class RscStructuredText_1101: RscStructuredText + { + idc = 1101; + text = "TBC
Level 1
More perks coming soon"; //--- ToDo: Localize; + x = 0.427812 * safezoneW + safezoneX; + y = 0.269 * safezoneH + safezoneY; + w = 0.149531 * safezoneW; + h = 0.143 * safezoneH; + colorBackground[] = {0,0,0,0.3}; + colorActive[] = {0,0,0,0.3}; + }; + class RscStructuredText_1102: RscStructuredText + { + idc = 1102; + text = "TBC
Level 1
More perks coming soon"; //--- ToDo: Localize; + x = 0.5825 * safezoneW + safezoneX; + y = 0.269 * safezoneH + safezoneY; + w = 0.149531 * safezoneW; + h = 0.143 * safezoneH; + colorBackground[] = {0,0,0,0.3}; + colorActive[] = {0,0,0,0.3}; + }; + //////////////////////////////////////////////////////// + // GUI EDITOR OUTPUT END + //////////////////////////////////////////////////////// + } +} class OT_dialog_tute diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/income.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/income.sqf index 6f674b3e..8c371949 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/income.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/income.sqf @@ -35,19 +35,22 @@ while {true} do { [_x,"Lease Income",format["Lease income for this period: $%1",_lease]] call BIS_fnc_createLogRecord; }; }foreach(allPlayers); - _inf remoteExec ["influence",0,false]; + _numPlayers = count(allPlayers); if(isNil "_total") then {_total = 0}; _perPlayer = round(_total / _numPlayers); if(_perPlayer > 0) then { + _inf remoteExec ["influenceSilent",0,false]; { _money = _x getVariable ["money",0]; _x setVariable ["money",_money+_perPlayer,true]; - [_x,"Tax Income",format["Tax income for this period: $%1",_perPlayer]] call BIS_fnc_createLogRecord; + [_x,"Tax Income",format ["Tax income: $%1 (+%2 Influence)",[_perPlayer, 1, 0, true] call CBA_fnc_formatNumber,_inf]] call BIS_fnc_createLogRecord; }foreach(allPlayers); - format ["Tax income: $%1",[_perPlayer, 1, 0, true] call CBA_fnc_formatNumber] remoteExec ["notify_good",0,true]; - }; + format ["Tax income: $%1 (+%2 Influence)",[_perPlayer, 1, 0, true] call CBA_fnc_formatNumber,_inf] remoteExec ["notify_good",0,true]; + }else{ + _inf remoteExec ["influence",0,false]; + }; waitUntil {sleep 5;(date select 3) != _lasthour}; //do actions on the hour }; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf index 9e121d6c..674669b3 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf @@ -73,6 +73,7 @@ loot = compileFinal preProcessFileLineNumbers "AI\orders\loot.sqf"; mainMenu = compileFinal preProcessFileLineNumbers "UI\mainMenu.sqf"; buildMenu = compileFinal preProcessFileLineNumbers "UI\buildMenu.sqf"; manageRecruits = compileFinal preProcessFileLineNumbers "UI\manageRecruits.sqf"; +characterSheet = compileFinal preProcessFileLineNumbers "UI\characterSheet.sqf"; buyDialog = compileFinal preProcessFileLineNumbers "UI\buyDialog.sqf"; sellDialog = compileFinal preProcessFileLineNumbers "UI\sellDialog.sqf"; @@ -141,6 +142,9 @@ unitSeenNATO = compileFinal preProcessFileLineNumbers "funcs\unitSeenNATO.sqf"; wantedSystem = compileFinal preProcessFileLineNumbers "wantedSystem.sqf"; NATOsearch = compileFinal preProcessFileLineNumbers "AI\NATOsearch.sqf"; +//Perk System +perkSystem = compileFinal preProcessFileLineNumbers "perkSystem.sqf"; + //Key handler keyHandler = compileFinal preProcessFileLineNumbers "keyHandler.sqf"; menuHandler = {}; @@ -217,7 +221,17 @@ loadPlayerData = { influence = { _totalrep = (player getVariable ["influence",0])+_this; - player setVariable ["influence",_totalrep,true]; + player setVariable ["influence",_totalrep,true]; + _plusmin = ""; + if(_this > 0) then { + _plusmin = "+"; + }; + format["%1%2 Influence",_plusmin,_this] call notify_minor; +}; + +influenceSilent = { + _totalrep = (player getVariable ["influence",0])+_this; + player setVariable ["influence",_totalrep,true]; }; stopAndFace = { diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf index de64a141..fe4d618a 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf @@ -29,7 +29,7 @@ OT_item_wrecks = ["Land_Wreck_HMMWV_F","Land_Wreck_Skodovka_F","Land_Wreck_Truck OT_spawnTowns = ["Rautake","Tavu","Balavu","Muaceba","Katkoula","Savaka"]; //Towns where new players will spawn OT_spawnHouses = ["Land_Slum_01_F","Land_Slum_02_F","Land_House_Native_02_F"]; //Houses where new players will spawn -OT_NATOwait = 200; //Half the Average time between NATO orders +OT_NATOwait = 20; //Half the Average time between NATO orders OT_CRIMwait = 200; //Half the Average time between crim changes //Interactable items that spawn in your house diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm index 27db4f7e..2339779e 100644 Binary files a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm and b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm differ diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/perkSystem.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/perkSystem.sqf new file mode 100644 index 00000000..bfcf7362 --- /dev/null +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/perkSystem.sqf @@ -0,0 +1,11 @@ + +while {alive player} do { + sleep 2; + + private _fitness = player getVariable ["OT_fitness",1]; + if(_fitness > 1) then { + if(ace_advanced_fatigue_anreserve < 2300) then { + ace_advanced_fatigue_anreserve = ace_advanced_fatigue_anreserve + (_fitness * 5); + }; + }; +}; \ No newline at end of file diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/setupPlayer.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/setupPlayer.sqf index edf461e6..a152de9d 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/setupPlayer.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/setupPlayer.sqf @@ -1,4 +1,5 @@ player spawn wantedSystem; +player spawn perkSystem; _clothes = player getVariable ["uniform",(OT_clothes_guerilla call BIS_fnc_selectRandom)]; player forceAddUniform _clothes; player setVariable ["uniform",_clothes,true]; diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/reGarrisonTown.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/reGarrisonTown.sqf index 4d31f9e7..8cfb2dac 100644 --- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/reGarrisonTown.sqf +++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/insertion/reGarrisonTown.sqf @@ -1,5 +1,3 @@ -private ["_pos","_town","_townPos","_drop","_group","_start","_stability","_vehtype","_num","_count","_police","_group","_tgroup","_wp","_attackdir","_vehtype","_civ"]; - _town = _this; _townPos = server getVariable _town; @@ -8,163 +6,69 @@ _region = server getVariable format["region_%1",_town]; _police = []; _support = []; -_opendoor = false; +_close = nil; _dist = 8000; -_comp = ""; - -_attackdir = random 360; -if(surfaceIsWater ([_townPos,150,_attackDir] call BIS_fnc_relPos)) then { - _attackdir = _attackdir + 180; - if(_attackdir > 359) then {_attackdir = _attackdir - 359}; - if(surfaceIsWater ([_townPos,150,_attackDir] call BIS_fnc_relPos)) then { - _attackdir = _attackdir + 90; - if(_attackdir > 359) then {_attackdir = _attackdir - 359}; - if(surfaceIsWater ([_townPos,150,_attackDir] call BIS_fnc_relPos)) then { - _attackdir = _attackdir + 180; - if(_attackdir > 359) then {_attackdir = _attackdir - 359}; +_closest = ""; +{ + _pos = _x select 0; + _name = _x select 1; + if([_pos,_region] call fnc_isInMarker) then { + _d = (_pos distance _townPos); + if(_d < _dist) then { + _dist = _d; + _close = _pos; + _closest = _name; }; }; -}; -_attackdir = _attackdir - 45; -sleep 0.1; -_group = creategroup blufor; -_tgroup = creategroup blufor; - -_vehtype = OT_NATO_Vehicle_PoliceHeli; - -_drop = [_townPos,[350,500],_attackdir + (random 90)] call SHK_pos; -_spawnpos = OT_NATO_HQPos; - -if(_stability < 25 and (random 100) > 80) then { - //last ditch efforts to save this town - //send in the big guns - _vehtype = OT_NATO_Vehicle_AirTransport_Small; - _opendoor = true; - _num = 4 + round(random 4); - _count = 0; - while {_count < _num} do { - _start = [_spawnpos,[10,29],random 360] call SHK_pos; - _civ = _group createUnit [OT_NATO_Units_LevelTwo call BIS_fnc_selectRandom, _start, [],0, "NONE"]; - _civ setRank "SERGEANT"; - _police pushBack _civ; - _civ setVariable ["garrison","HQ",false]; - [_civ,_town] call initMilitary; - _count = _count + 1; - sleep 0.1; - }; -}; - -if(_stability < 40 and (random 100) > 90) then { - _townPos spawn CTRGsupport; -}; -_comp = _vehtype call ISSE_Cfg_Vehicle_GetName; -_veh = _vehtype createVehicle _spawnpos; -_dir = [_spawnpos,_townPos] call BIS_fnc_dirTo; -_veh setDir _dir; -_tgroup addVehicle _veh; - -createVehicleCrew _veh; -sleep 0.1; -{ - [_x] joinSilent _tgroup; - _x setVariable ["garrison","HQ",false]; -}foreach(crew _veh); - -{ - _x moveInCargo _veh; -}foreach(_police); - -_police pushBack _veh; - -_start = [_spawnpos,[10,29],random 360] call SHK_pos; -_civ = _group createUnit [OT_NATO_Unit_PoliceCommander, _start, [],0, "NONE"]; -_civ setVariable ["garrison",_town,false]; -_civ setRank "CORPORAL"; -_civ moveInCargo _veh; -_police pushBack _civ; -[_civ,_town] call initPolice; - -if(_stability > 50) then { +}foreach(OT_NATOobjectives); + +if(!isNil "_close") then { + _start = [_close,0,200, 1, 0, 0, 0] call BIS_fnc_findSafePos; + _group = creategroup blufor; + + _spawnpos = _start findEmptyPosition [0,100,OT_NATO_Vehicle_Police]; + _veh = OT_NATO_Vehicle_Police createVehicle _spawnpos; + _veh setDir 180; + _group addVehicle _veh; + + _police pushBack _veh; + + _civ = _group createUnit [OT_NATO_Unit_PoliceCommander, _start, [],0, "NONE"]; + _police pushBack _civ; + [_civ,_town] call initPolice; _civ setBehaviour "SAFE"; -}; -sleep 0.1; -_start = [_spawnpos,[10,29],random 360] call SHK_pos; -_civ = _group createUnit [OT_NATO_Unit_Police, _start, [],0, "NONE"]; -_civ setRank "PRIVATE"; -_civ moveInCargo _veh; -_civ setVariable ["garrison",_town,false]; - -_police pushBack _civ; -[_civ,_town] call initPolice; -if(_stability > 50) then { + sleep 0.01; + _start = [_start, 0, 20, 1, 0, 0, 0] call BIS_fnc_findSafePos; + _civ = _group createUnit [OT_NATO_Unit_Police, _start, [],0, "NONE"]; + + _police pushBack _civ; + [_civ,_town] call initPolice; _civ setBehaviour "SAFE"; + _count = _count + 2; + + _group setVariable ["veh",_veh]; + _group setVariable ["transport",_police]; + + _drop = (([_townPos, 100, 500, 1, 0, 0, 0] call BIS_fnc_findSafePos) nearRoads 200) select 0; + + _move = _group addWaypoint [_spawnpos,0]; + _move setWaypointType "GETIN"; + _move setWaypointSpeed "FULL"; + + _move = _group addWaypoint [_drop,0]; + _move setWaypointType "MOVE"; + _move setWaypointSpeed "FULL"; + + _move = _group addWaypoint [_drop,0]; + _move setWaypointType "GETOUT"; + _move setWaypointStatements ["true","(group this) call initPolicePatrol;"]; + + { + _x addCuratorEditableObjects [_police+_support,true]; + } forEach allCurators; }; -_moveto = [OT_NATO_HQPos,500,_dir] call SHK_pos; -_wp = _tgroup addWaypoint [_moveto,0]; -_wp setWaypointType "MOVE"; -_wp setWaypointBehaviour "COMBAT"; -_wp setWaypointSpeed "FULL"; -_wp setWaypointCompletionRadius 150; -_wp setWaypointStatements ["true","(vehicle this) flyInHeight 150;"]; - -_wp = _tgroup addWaypoint [_drop,0]; -_wp setWaypointType "MOVE"; -_wp setWaypointBehaviour "COMBAT"; -if(_opendoor) then { - _wp setWaypointStatements ["true","(vehicle this) AnimateDoor ['Door_rear_source', 1, false];"]; -}; -_wp setWaypointCompletionRadius 50; -_wp setWaypointSpeed "FULL"; - -_wp = _tgroup addWaypoint [_drop,0]; -_wp setWaypointType "SCRIPTED"; -_wp setWaypointStatements ["true","[vehicle this,75] execVM 'funcs\addons\eject.sqf'"]; -_wp setWaypointTimeout [10,10,10]; - -_wp = _tgroup addWaypoint [_drop,0]; -_wp setWaypointType "SCRIPTED"; -if(_opendoor) then { - _wp setWaypointStatements ["true","(vehicle this) AnimateDoor ['Door_rear_source', 0, false];"]; -}; -_wp setWaypointTimeout [15,15,15]; - -_moveto = [OT_NATO_HQPos,200,_dir] call SHK_pos; - -_wp = _tgroup addWaypoint [_moveto,0]; -_wp setWaypointType "LOITER"; -_wp setWaypointBehaviour "CARELESS"; -_wp setWaypointSpeed "FULL"; -_wp setWaypointCompletionRadius 100; - -_wp = _tgroup addWaypoint [_moveto,0]; -_wp setWaypointType "SCRIPTED"; -_wp setWaypointStatements ["true","[vehicle this] execVM 'funcs\cleanup.sqf'"]; - -_attackpos = [_townPos,[0,150]] call SHK_pos; - -_dir = [_attackpos,_drop] call BIS_fnc_dirTo; -_moveto = [_attackpos,100,_dir] call SHK_pos; - -_move = _group addWaypoint [_moveto,0]; -_move setWaypointType "MOVE"; -_move setWaypointSpeed "FULL"; -_move setWaypointBehaviour "COMBAT"; - -_move = _group addWaypoint [_attackpos,0]; -_move setWaypointType "GUARD"; -_move setWaypointSpeed "NORMAL"; -_move setWaypointBehaviour "STEALTH"; - -_an = "A"; -if((_comp select [0,1]) in ["A","E","I","O","a","e","i","o"]) then {_an = "An"}; -[3,_townPos,format["%1 Reinforcements",_town],format["Intelligence reports that NATO is reinforcing the garrison in %1. %5 %3 is known to be departing %4 at the time of this message containing %2 personnel.",_town,count units _group,_comp,OT_NATO_HQ,_an]] remoteExec ["intelEvent",0,false]; - - -{ - _x addCuratorEditableObjects [_police+_support,true]; -} forEach allCurators; - +[3,_townPos,format["%1 Reinforcements",_town],format["Intelligence reports that NATO is reinforcing the garrison in %1. %2 personnel were spotted departing %3 in an offroad.",_town,count units _group,_closest]] remoteExec ["intelEvent",0,false]; _police+_support; \ No newline at end of file