diff --git a/README.md b/README.md
index 70038e19..c24eb033 100644
--- a/README.md
+++ b/README.md
@@ -9,18 +9,13 @@ A dynamic and persistent revolution campaign mod for ARMA 3 Apex
* Buy and sell just about in any-game item/vehicle/weapon for currency at local shops and gun dealers
* Capture towns and military objectives one by one
* Dynamic economy/Regional pricing/Trade
-* Buy, sell and lease real estate with prices affected by regional politics
+* Buy, sell and lease real estate with prices affected by regional politics
* Fast travel to any owned real estate or camp
* Manipulate the markets with guns or piles of cash
* Recruit and arm civilians
* Recruit civilians simply just to loot for you
* Designed to work in both single player and multiplayer
-# Coming Features
-* Recruit and command entire squads
-* Player-based economy/production
-* Mid and end-game mechanics
-
# Required DLC
* APEX
@@ -28,9 +23,9 @@ A dynamic and persistent revolution campaign mod for ARMA 3 Apex
* VCOM AI by genesis92x https://forums.bistudio.com/topic/166374-vcom-ai-v20-ai-overhaul/
* Advanced Towing by Duda http://www.armaholic.com/page.php?id=30575
-# Recommended Addons
+# Required Addons
* ACE3 (Fully integrated) [(Steam Workshop)](https://steamcommunity.com/sharedfiles/filedetails/?id=463939057)
# To install
-Overthrow is available on the [Steam Workshop](http://steamcommunity.com/sharedfiles/filedetails/?id=774201744)
-
+* Overthrow is available on the [Steam Workshop](http://steamcommunity.com/sharedfiles/filedetails/?id=774201744)
+* or from [Github](https://github.com/ArmaOverthrow/Overthrow.Tanoa/releases/latest)
diff --git a/addons/overthrow_main/CfgFunctions.hpp b/addons/overthrow_main/CfgFunctions.hpp
index 539cec1b..4a74cd89 100644
--- a/addons/overthrow_main/CfgFunctions.hpp
+++ b/addons/overthrow_main/CfgFunctions.hpp
@@ -12,6 +12,10 @@ class CfgFunctions
class spawnTemplate {};
class spawnTemplateAttached {};
class unitStock {};
+ class saveGame {};
+ class loadGame {};
+ class setOwner {};
+ class getOwner {};
};
class Events
@@ -21,6 +25,61 @@ class CfgFunctions
class postInit {postInit = 1};
};
+ class UI
+ {
+ file = "\ot\functions\UI";
+ class notifyMinor {};
+ class notifyBig {};
+ class notifyGood {};
+ class notifyVehicle {};
+ };
+
+ /*
+ * User actions
+ */
+ class Actions
+ {
+ file = "\ot\functions\actions";
+
+ /* Main Menu */
+ class salvageWreck {};
+ class buyBuilding {};
+ class fastTravel {};
+ class talkToCiv {};
+ class recruitCiv {};
+
+ /* Vehicle */
+ class transferTo {};
+ class transferFrom {};
+ class transferLegit {};
+ class takeLegit {};
+ class warehouseTake {};
+
+ /* Workshop */
+ class workshopAdd {};
+
+ /* Shop */
+ class buy {};
+ class sell {};
+ class sellAll {};
+
+ /* Gun Dealer */
+ class getLocalMission {};
+ class getMission {};
+
+ /* Factory */
+ class factoryRefresh {};
+ class factorySet {};
+
+ /* Resistance Screen */
+ class showMemberInfo {};
+ class showBusinessInfo {};
+ class makeGeneral {};
+ class giveFunds {};
+ class takeFunds {};
+ class transferFunds {};
+ }
+
/*
* Locations, positions etc.
*/
@@ -151,6 +210,8 @@ class CfgFunctions
class NATO
{
file = "\ot\functions\factions\NATO";
+ class initNATO {};
+
class NATOQRF {};
class NATOGroundForces {};
class CTRGSupport {};
diff --git a/addons/overthrow_main/CfgWeapons.hpp b/addons/overthrow_main/CfgWeapons.hpp
index 4df52055..d2343f8b 100644
--- a/addons/overthrow_main/CfgWeapons.hpp
+++ b/addons/overthrow_main/CfgWeapons.hpp
@@ -76,4 +76,14 @@ class CfgWeapons {
mass = 30;
};
};
+ class OT_Fertilizer: OT_ItemCore {
+ scope = 2;
+ picture = "\ot\ui\items\fertilizer_x_ca.paa";
+ displayName = "Fertilizer";
+ descriptionShort = "A material of natural or synthetic origin that is applied to soils or to plant tissues (usually leaves) to supply one or more plant nutrients essential to the growth of plants.";
+ descriptionUse = "";
+ class ItemInfo: InventoryItem_Base_F {
+ mass = 80;
+ };
+ };
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOConvoy.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOConvoy.sqf
index 0aa7e70c..b7ecddf2 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOConvoy.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOConvoy.sqf
@@ -1,5 +1,7 @@
params ["_vehtypes","_hvts","_from","_to"];
+private _abandoned = server getvariable ["NATOabandoned",[]];
+if(_from in _abandoned) exitWith {};
private _frompos = server getvariable _from;
private _fromregion = _frompos call OT_fnc_getRegion;
@@ -8,25 +10,38 @@ private _topos = server getvariable _to;
private _dir = [_frompos,_topos] call BIS_fnc_dirTo;
private _group = creategroup blufor;
+_group setBehaviour "CARELESS";
private _track = objNull;
if ([_topos,_fromregion] call OT_fnc_regionIsConnected) then {
- _convoypos = _frompos;
+ _convoypos = [_frompos,random 360,120] call SHK_pos;
+ private _road = [_convoypos] call BIS_fnc_nearestRoad;
+ if (!isNull _road) then {
+ _roadscon = roadsConnectedto _road;
+ if (count _roadscon == 2) then {
+ _posVeh = (getpos _road) findEmptyPosition [0,15,_vehtypes select 0];
+ if(count _posVeh > 0) then {
+ _convoypos = _posVeh;
+ _dir = [_road, _roadscon select 0] call BIS_fnc_DirTo;
+ };
+ };
+ };
{
- _pos = [_convoypos,0,120,false,[0,0],[250,_x]] call SHK_pos;
+ _pos = _convoypos;
_veh = createVehicle [_x, _pos, [], 0,""];
_veh setVariable ["garrison","HQ",false];
_veh setDir (_dir);
_group addVehicle _veh;
createVehicleCrew _veh;
+ _driver = driver _veh;
+ _driver disableAI "AUTOCOMBAT";
{
[_x] joinSilent _group;
_x setVariable ["garrison","HQ",false];
- _x setVariable ["NOAI",true,false];
- _x disableAI "AUTOCOMBAT";
}foreach(crew _veh);
- _convoypos = [_convoypos,20,-_dir] call BIS_fnc_relPos;
+ _driver assignAsCommander _veh;
+ _convoypos = [_convoypos,20,_dir+180] call BIS_fnc_relPos;
sleep 0.1;
}foreach(_vehtypes);
@@ -38,20 +53,20 @@ if ([_topos,_fromregion] call OT_fnc_regionIsConnected) then {
_veh setDir (_dir);
_group addVehicle _veh;
createVehicleCrew _veh;
+
+ _driver = driver _veh;
+ _driver disableAI "AUTOCOMBAT";
{
[_x] joinSilent _group;
_x setVariable ["garrison","HQ",false];
- _x setVariable ["NOAI",true,false];
- _x disableAI "AUTOCOMBAT";
}foreach(crew _veh);
-
- _lead = leader _veh;
- _lead setVariable ["hvt",true,true];
- _lead setVariable ["hvt_id",_x select 0,true];
- _lead setRank "COLONEL";
+ _driver assignAsCommander _veh;
+ _driver setVariable ["hvt",true,true];
+ _driver setVariable ["hvt_id",_x select 0,true];
+ _driver setRank "COLONEL";
if(isNull _track) then {_track = _lead};
- _convoypos = [_convoypos,20,-_dir] call BIS_fnc_relPos;
+ _convoypos = [_convoypos,20,_dir] call BIS_fnc_relPos;
sleep 0.1;
_x set [2,"CONVOY"];
@@ -59,30 +74,32 @@ if ([_topos,_fromregion] call OT_fnc_regionIsConnected) then {
private _numsupport = 2;
- private _count = 0;
- while {_count < _numsupport} do {
- _vehtype = selectRandom OT_NATO_Vehicles_GroundSupport;
- _pos = [_convoypos,0,120,false,[0,0],[250,_vehtype]] call SHK_pos;
- _veh = createVehicle [_vehtype, _pos, [], 0,""];
- _veh setVariable ["garrison","HQ",false];
-
- _veh setDir (_dir);
- _group addVehicle _veh;
- createVehicleCrew _veh;
- {
- [_x] joinSilent _group;
- _x setVariable ["garrison","HQ",false];
- _x setVariable ["NOAI",true,false];
- _x disableAI "AUTOCOMBAT";
- }foreach(crew _veh);
- _convoypos = [_convoypos,20,-_dir] call BIS_fnc_relPos;
- _count = _count + 1;
- sleep 0.1;
+ if(count _hvts > 0) then {
+ private _count = 0;
+ while {_count < _numsupport} do {
+ _vehtype = selectRandom OT_NATO_Vehicles_GroundSupport;
+ _pos = [_convoypos,0,120,false,[0,0],[250,_vehtype]] call SHK_pos;
+ _veh = createVehicle [_vehtype, _pos, [], 0,""];
+ _veh setVariable ["garrison","HQ",false];
+ _veh setDir (_dir);
+ _group addVehicle _veh;
+ createVehicleCrew _veh;
+ _driver = driver _veh;
+ _driver disableAI "AUTOCOMBAT";
+ {
+ [_x] joinSilent _group;
+ _x setVariable ["garrison","HQ",false];
+ }foreach(crew _veh);
+ _driver assignAsCommander _veh;
+ _convoypos = [_convoypos,20,-_dir] call BIS_fnc_relPos;
+ _count = _count + 1;
+ sleep 0.1;
+ };
};
sleep 5;
_wp = _group addWaypoint [asltoatl _topos,50];
_wp setWaypointType "MOVE";
- _wp setWaypointBehaviour "SAFE";
+ _wp setWaypointBehaviour "CARELESS";
_wp setWaypointSpeed "LIMITED";
_wp setWaypointTimeout [60,60,60];
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATODeployFOB.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATODeployFOB.sqf
new file mode 100644
index 00000000..22c49a0a
--- /dev/null
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATODeployFOB.sqf
@@ -0,0 +1,33 @@
+_leader = _this;
+
+_group = group _leader;
+private _targetPos = _leader getVariable ["OT_targetPos",objNull];
+private _veh = vehicle _leader;
+
+_near = false;
+
+{
+ unassignVehicle _x;
+}foreach(units _group);
+(units _group) allowGetIn false;
+
+sleep 10;
+if(({alive _x} count (units _group)) == 0) exitWith {};
+
+if(!isNull _veh) then {deleteVehicle _veh};
+
+private _fobs = server getVariable ["NATOfobs",[]];
+
+{
+ _pb = _x select 0;
+ if(_pb distance _targetPos < 500) then {
+ _near = true;
+ };
+}foreach(_fobs);
+if(_near) exitWith {};
+
+_flag = OT_flag_NATO createVehicle _targetPos;
+
+_fobs pushback [_targetPos,count units _group,[]];
+server setVariable ["NATOfobs",_fobs,true];
+_group call OT_fnc_initMilitaryPatrol;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionDeployFOB.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionDeployFOB.sqf
new file mode 100644
index 00000000..077dfa31
--- /dev/null
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionDeployFOB.sqf
@@ -0,0 +1,147 @@
+params ["_posTarget"];
+
+private _close = nil;
+private _dist = 3000;
+private _closest = "";
+private _abandoned = server getVariable["NATOabandoned",[]];
+{
+ _pos = _x select 0;
+ _name = _x select 1;
+ if(([_pos,_posTarget] call OT_fnc_regionIsConnected) and !(_name in _abandoned)) then {
+ _d = (_pos distance _posTarget);
+ if(_d < _dist) then {
+ _dist = _d;
+ _close = _pos;
+ _closest = _name;
+ };
+ };
+}foreach(OT_NATOobjectives);
+_isAir = false;
+if(isNil "_close") then {
+ _isAir = true;
+ {
+ _x params ["_obpos","_name","_pri"];
+ if !(_name in _abandoned) exitWith {
+ _close = _obpos;
+ };
+ }foreach([OT_airportData,[],{random 100},"ASCEND"] call BIS_fnc_SortBy);
+};
+_start = [_close,50,200, 1, 0, 0, 0] call BIS_fnc_findSafePos;
+_group = [_start, WEST, OT_NATO_Group_Engineers] call BIS_fnc_spawnGroup;
+_group call distributeAILoad;
+sleep 0.5;
+
+_dir = [_start,_posTarget] call BIS_fnc_dirTo;
+
+if(_isAir) then {
+ _attackpos = [_posTarget,[0,150]] call SHK_pos;
+
+ //Determine direction to attack from (preferrably away from water)
+ _attackdir = random 360;
+ if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then {
+ _attackdir = _attackdir + 180;
+ if(_attackdir > 359) then {_attackdir = _attackdir - 359};
+ if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then {
+ _attackdir = _attackdir + 90;
+ if(_attackdir > 359) then {_attackdir = _attackdir - 359};
+ if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then {
+ _attackdir = _attackdir + 180;
+ if(_attackdir > 359) then {_attackdir = _attackdir - 359};
+ };
+ };
+ };
+ _attackdir = _attackdir - 45;
+ _ao = [_posTarget,[350,500],_attackdir + (random 90)] call SHK_pos;
+ _tgroup = creategroup blufor;
+
+ _spawnpos = _close findEmptyPosition [0,100,OT_NATO_Vehicle_AirTransport_Small];
+ _veh = OT_NATO_Vehicle_AirTransport_Small createVehicle _spawnpos;
+ _veh setDir _dir;
+ _tgroup addVehicle _veh;
+
+ _tgroup call distributeAILoad;
+
+ createVehicleCrew _veh;
+ {
+ [_x] joinSilent _tgroup;
+ _x setVariable ["garrison","HQ",false];
+ _x setVariable ["NOAI",true,false];
+ }foreach(crew _veh);
+
+ {
+ _x moveInCargo _veh;
+ _x setVariable ["garrison","HQ",false];
+ }foreach(units _group);
+
+ sleep 2;
+
+ _moveto = [_close,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 100;"];
+
+ _wp = _tgroup addWaypoint [_ao,0];
+ _wp setWaypointType "MOVE";
+ _wp setWaypointBehaviour "COMBAT";
+ _wp setWaypointStatements ["true","(vehicle this) AnimateDoor ['Door_rear_source', 1, false];"];
+ _wp setWaypointCompletionRadius 50;
+ _wp setWaypointSpeed "FULL";
+
+ _wp = _tgroup addWaypoint [_ao,0];
+ _wp setWaypointType "SCRIPTED";
+ _wp setWaypointStatements ["true","[vehicle this,75] spawn OT_fnc_parachuteAll"];
+ _wp setWaypointTimeout [10,10,10];
+
+ _wp = _tgroup addWaypoint [_ao,0];
+ _wp setWaypointType "SCRIPTED";
+ _wp setWaypointStatements ["true","(vehicle this) AnimateDoor ['Door_rear_source', 0, false];"];
+ _wp setWaypointTimeout [15,15,15];
+
+ _moveto = [_close,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] spawn OT_fnc_cleanup"];
+
+ {
+ _x addCuratorEditableObjects [units _tgroup,true];
+ } forEach allCurators;
+}else{
+ _convoypos = [_close,random 360,120] call SHK_pos;
+ private _road = [_convoypos] call BIS_fnc_nearestRoad;
+ if (!isNull _road) then {
+ _convoypos = (getpos _road);
+ };
+ _spawnpos = _convoypos findEmptyPosition [0,100,OT_NATO_Vehicle_Transport_Light];
+ _veh = OT_NATO_Vehicle_Transport_Light createVehicle _spawnpos;
+ _group addVehicle _veh;
+
+ {
+ _x moveInAny _veh;
+ }foreach(units _group);
+};
+{
+ _x addCuratorEditableObjects [units _group,true];
+} forEach allCurators;
+sleep 2;
+
+//This squad operates in stealth mode, therefore does not respond to calls for help from other units
+{
+ _x setVariable ["VCOM_NOPATHING_Unit",true,false];
+ _x setVariable ["OT_targetPos",_posTarget,true];
+}foreach(units _group);
+
+_wp = _group addWaypoint [_posTarget,0];
+_wp setWaypointType "MOVE";
+_wp setWaypointBehaviour "CARELESS";
+_wp setWaypointSpeed "FULL";
+_wp setWaypointStatements ["true","this spawn OT_fnc_NATODeployFOB"];
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionReconDestroy.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionReconDestroy.sqf
new file mode 100644
index 00000000..5aedafcd
--- /dev/null
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMissionReconDestroy.sqf
@@ -0,0 +1,135 @@
+params ["_knownPos"];
+
+private _posTarget = _knownPos;
+private _close = nil;
+private _dist = 2000;
+private _closest = "";
+private _abandoned = server getVariable["NATOabandoned",[]];
+{
+ _pos = _x select 0;
+ _name = _x select 1;
+ if(([_pos,_knownPos] call OT_fnc_regionIsConnected) and !(_name in _abandoned)) then {
+ _d = (_pos distance _knownPos);
+ if(_d < _dist) then {
+ _dist = _d;
+ _close = _pos;
+ _closest = _name;
+ };
+ };
+}foreach(OT_NATOobjectives);
+_isAir = false;
+if(isNil "_close") then {
+ _isAir = true;
+ {
+ _x params ["_obpos","_name","_pri"];
+ if !(_name in _abandoned) exitWith {
+ _close = _obpos;
+ };
+ }foreach([OT_airportData,[],{random 100},"ASCEND"] call BIS_fnc_SortBy);
+};
+_start = [_close,50,200, 1, 0, 0, 0] call BIS_fnc_findSafePos;
+_group = [_start, WEST, OT_NATO_Group_Recon] call BIS_fnc_spawnGroup;
+_group call distributeAILoad;
+sleep 0.5;
+
+_dir = [_start,_posTarget] call BIS_fnc_dirTo;
+
+if(_isAir) then {
+ _attackpos = [_posTarget,[0,150]] call SHK_pos;
+
+ //Determine direction to attack from (preferrably away from water)
+ _attackdir = random 360;
+ if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then {
+ _attackdir = _attackdir + 180;
+ if(_attackdir > 359) then {_attackdir = _attackdir - 359};
+ if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then {
+ _attackdir = _attackdir + 90;
+ if(_attackdir > 359) then {_attackdir = _attackdir - 359};
+ if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then {
+ _attackdir = _attackdir + 180;
+ if(_attackdir > 359) then {_attackdir = _attackdir - 359};
+ };
+ };
+ };
+ _attackdir = _attackdir - 45;
+ _ao = [_posTarget,[350,500],_attackdir + (random 90)] call SHK_pos;
+ _tgroup = creategroup blufor;
+
+ _spawnpos = _close findEmptyPosition [0,100,OT_NATO_Vehicle_AirTransport_Small];
+ _veh = OT_NATO_Vehicle_AirTransport_Small createVehicle _spawnpos;
+ _veh setDir _dir;
+ _tgroup addVehicle _veh;
+
+ _tgroup call distributeAILoad;
+
+ createVehicleCrew _veh;
+ {
+ [_x] joinSilent _tgroup;
+ _x setVariable ["garrison","HQ",false];
+ _x setVariable ["NOAI",true,false];
+ }foreach(crew _veh);
+
+ {
+ _x moveInCargo _veh;
+ _x setVariable ["garrison","HQ",false];
+ }foreach(units _group);
+
+ sleep 2;
+
+ _moveto = [_close,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 100;"];
+
+ _wp = _tgroup addWaypoint [_ao,0];
+ _wp setWaypointType "MOVE";
+ _wp setWaypointBehaviour "COMBAT";
+ _wp setWaypointStatements ["true","(vehicle this) AnimateDoor ['Door_rear_source', 1, false];"];
+ _wp setWaypointCompletionRadius 50;
+ _wp setWaypointSpeed "FULL";
+
+ _wp = _tgroup addWaypoint [_ao,0];
+ _wp setWaypointType "SCRIPTED";
+ _wp setWaypointStatements ["true","[vehicle this,75] spawn OT_fnc_parachuteAll"];
+ _wp setWaypointTimeout [10,10,10];
+
+ _wp = _tgroup addWaypoint [_ao,0];
+ _wp setWaypointType "SCRIPTED";
+ _wp setWaypointStatements ["true","(vehicle this) AnimateDoor ['Door_rear_source', 0, false];"];
+ _wp setWaypointTimeout [15,15,15];
+
+ _moveto = [_close,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] spawn OT_fnc_cleanup"];
+
+ {
+ _x addCuratorEditableObjects [units _tgroup,true];
+ } forEach allCurators;
+};
+{
+ _x addCuratorEditableObjects [units _group,true];
+} forEach allCurators;
+sleep 2;
+
+//This squad operates in stealth mode, therefore does not respond to calls for help from other units
+{
+ _x setVariable ["VCOM_NOPATHING_Unit",true,false];
+ _x setVariable ["OT_targetPos",_knownPos,true];
+}foreach(units _group);
+
+_wp = _group addWaypoint [_posTarget,0];
+_wp setWaypointType "MOVE";
+_wp setWaypointBehaviour "COMBAT";
+_wp setWaypointSpeed "FULL";
+_wp setWaypointStatements ["true","this spawn OT_fnc_NATOSetExplosives"];
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMortar.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMortar.sqf
new file mode 100644
index 00000000..ece6c8f0
--- /dev/null
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOMortar.sqf
@@ -0,0 +1,75 @@
+params ["_mortar","_mortargroup"];
+
+while {sleep 5+(random 5); ("8Rnd_82mm_Mo_shells" in getArtilleryAmmo[_mortar]) and (alive _mortar) and ({alive _x} count (units _mortargroup)) > 0} do {
+ private _attacking = server getVariable ["NATOattacking",""];
+ private _mortarpos = position _mortar;
+
+ if(_attacking != "" and !(_attacking in OT_allTowns)) then {
+ _pos = server getvariable _attacking;
+ _distance = (_pos distance _mortar);
+
+ _timesince = time - (server getVariable ["NATOattackstart",time]);
+ if(_timesince < 300) then {
+ if (_distance < 4000 and _distance > 500) then {
+ _mortargroup setCombatMode "RED";
+ _p = [_pos,random 360,300] call SHK_pos;
+ _mortar commandArtilleryFire [_p, "8Rnd_82mm_Mo_shells", 1];
+ sleep 3+(random 3);
+ _mortar commandArtilleryFire [_p, "8Rnd_82mm_Mo_shells", 1];
+ sleep 3;
+ _mortargroup setCombatMode "BLUE";
+ //Did anyone hear that?
+ if({side _x == resistance or captive _x} count (_mortarpos nearObjects ["CAManBase",3000]) > 0) then {
+ private _icons = spawner getVariable ["NATOmortars",[]];
+ _found = false;
+ {
+ if((_x select 0) == _mortar) exitWith {
+ _range = (_x select 1) - round((_x select 0) * 0.25);
+ _x set [1,_range];
+ _x set [2,[_mortarpos,random 360,_range] call SHK_pos];
+ };
+ }foreach(_icons);
+ if !(_found) then {
+ _icons pushback [_mortar,1500,[_mortarpos,random 360,1500] call SHK_pos];
+ };
+ spawner setVariable ["NATOmortars",_icons,true];
+ };
+ };
+ };
+ }else{
+ private _targets = [spawner getVariable ["NATOknownTargets",[]],[],{_x select 2},"DESCEND"] call BIS_fnc_SortBy;
+ {
+ _x params ["_ty","_pos","_pri","_obj","_done"];
+ _distance = (_pos distance _mortar);
+ if (_distance < 4000 and _distance > 250 and !_done) exitWith {
+ _x set [4,true];
+ _mortargroup setCombatMode "RED";
+
+ _mortar commandArtilleryFire [_pos, "8Rnd_82mm_Mo_shells", 1];
+ sleep 3+(random 3);
+ _mortar commandArtilleryFire [_pos, "8Rnd_82mm_Mo_shells", 1];
+ sleep 3+(random 3);
+ _mortar commandArtilleryFire [_pos, "8Rnd_82mm_Mo_shells", 1];
+ sleep 3;
+ _mortargroup setCombatMode "BLUE";
+ //Did anyone hear that?
+ if({side _x == resistance or captive _x} count (_mortarpos nearObjects ["CAManBase",3000]) > 0) then {
+ private _icons = spawner getVariable ["NATOmortars",[]];
+ _found = false;
+ {
+ if((_x select 0) == _mortar) exitWith {
+ _range = (_x select 1) - round((_x select 0) * 0.25);
+ _x set [1,_range];
+ _x set [2,[_mortarpos,random 360,_range] call SHK_pos];
+ };
+ }foreach(_icons);
+ if !(_found) then {
+ _icons pushback [_mortar,1500,[_mortarpos,random 360,1500] call SHK_pos];
+ };
+ spawner setVariable ["NATOmortars",_icons,true];
+ };
+ };
+ }foreach(_targets);
+ spawner setVariable ["NATOknowntargets",_targets,true];
+ };
+};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOSetExplosives.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOSetExplosives.sqf
new file mode 100644
index 00000000..59ebcf9d
--- /dev/null
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOSetExplosives.sqf
@@ -0,0 +1,38 @@
+_leader = _this;
+
+_group = group _leader;
+private _targetPos = _leader getVariable ["OT_targetPos",objNull];
+
+_gotexp = false;
+_expert = objNull;
+{
+ if("DemoCharge_Remote_Mag" in magazines _x) then {
+ _gotexp = true;
+ _expert = _x;
+ };
+}foreach(units _group);
+
+if(_gotexp) then {
+ _p = _targetPos;
+ _expert setVariable ["NOAI",true,true];
+ _group setCombatMode "COMBAT";
+ _expert commandMove _p;
+ waitUntil {sleep 1;(!alive _expert) or (_expert distance _target) < 10};
+ if(alive _expert) then {
+ _expert removeMagazineGlobal "DemoCharge_Remote_Mag";
+ _p set [2,1];
+ _charge = "DemoCharge_Remote_Ammo" createVehicle _p;
+ _charge setPosATL _p;
+
+ //run away!
+ _runto = [_p,[1000,2000],random 360] call SHK_pos;
+ _wp = _group addWaypoint [_runto,0];
+ _wp setWaypointType "MOVE";
+ _wp setWaypointBehaviour "COMBAT";
+ _wp setWaypointSpeed "FULL";
+ _expert setVariable ["NOAI",false,true];
+
+ sleep 120;
+ [[_charge], 0] call ace_explosives_fnc_scriptedExplosive;
+ };
+};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOupgradeFOB.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOupgradeFOB.sqf
new file mode 100644
index 00000000..23f4804a
--- /dev/null
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/AI/fn_NATOupgradeFOB.sqf
@@ -0,0 +1,92 @@
+params ["_pos","_upgrades"];
+
+{
+ if(_x == "Barriers") then {
+ _p = [_pos,8,0] call BIS_fnc_relPos;
+ _v = OT_NATO_Barrier_Small createVehicle _p;
+ _v setDir 180;
+
+ sleep 0.1;
+
+ _p = [_pos,8,180] call BIS_fnc_relPos;
+ _v = OT_NATO_Barrier_Small createVehicle _p;
+ _v setDir 0;
+
+ sleep 0.1;
+
+ _p = [_pos,7,270] call BIS_fnc_relPos;
+ _v = OT_NATO_Barrier_Large createVehicle _p;
+ _v setDir 270;
+
+ sleep 0.1;
+
+ _p = [_pos,7,90] call BIS_fnc_relPos;
+ _v = OT_NATO_Barrier_Large createVehicle _p;
+ _v setDir 90;
+ };
+ if(_x == "HMG") then {
+ _gun = OT_NATO_StaticGarrison_LevelOne select 0;
+
+ _p = [_pos,8.5,45] call BIS_fnc_relPos;
+ _v = _gun createVehicle _p;
+ _v setDir 45;
+ createVehicleCrew _v;
+
+ sleep 0.1;
+
+ _p = [_pos,10,45] call BIS_fnc_relPos;
+ _v = OT_NATO_Sandbag_Curved createVehicle _p;
+ _v setDir 225;
+
+ _p = [_pos,8.5,135] call BIS_fnc_relPos;
+ _v = _gun createVehicle _p;
+ _v setDir 135;
+ createVehicleCrew _v;
+
+ sleep 0.1;
+
+ _p = [_pos,10,135] call BIS_fnc_relPos;
+ _v = OT_NATO_Sandbag_Curved createVehicle _p;
+ _v setDir 315;
+
+ _p = [_pos,8.5,225] call BIS_fnc_relPos;
+ _v = _gun createVehicle _p;
+ _v setDir 225;
+ createVehicleCrew _v;
+
+ sleep 0.1;
+
+ _p = [_pos,10,225] call BIS_fnc_relPos;
+ _v = OT_NATO_Sandbag_Curved createVehicle _p;
+ _v setDir 45;
+
+ _p = [_pos,8.5,315] call BIS_fnc_relPos;
+ _v = _gun createVehicle _p;
+ _v setDir 315;
+ createVehicleCrew _v;
+
+ sleep 0.1;
+
+ _p = [_pos,10,315] call BIS_fnc_relPos;
+ _v = OT_NATO_Sandbag_Curved createVehicle _p;
+ _v setDir 135;
+ };
+ if(_x == "Mortar") then {
+ _p = _pos findEmptyPosition [0,50,OT_NATO_Mortar];
+ _v = OT_NATO_Mortar createVehicle _p;
+ createVehicleCrew _v;
+
+ _g = grpNull;
+ {
+ _x disableAI "AUTOTARGET";
+ _x disableAI "FSM";
+ _x disableAI "AUTOCOMBAT";
+ _x setVariable ["NOAI",true,false];
+ _g = group _x;
+ }foreach(crew _v);
+ _g setCombatMode "BLUE";
+ [_v,_g] spawn OT_fnc_NATOMortar;
+ };
+
+ sleep 0.1;
+}foreach(_upgrades);
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buildMenu.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buildMenu.sqf
index eb7906b3..59910e50 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buildMenu.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buildMenu.sqf
@@ -1,4 +1,4 @@
-if !(captive player) exitWith {"You cannot build while wanted" call notify_minor};
+if !(captive player) exitWith {"You cannot build while wanted" call OT_fnc_notifyMinor};
_base = (getpos player) call OT_fnc_nearestBase;
_closest = "";
_isbase = false;
@@ -42,13 +42,13 @@ if(!_isBase) then {
if ((!_isbase) and !(_closest in (server getVariable ["NATOabandoned",[]]))) exitWith {
if(_isobj) then {
- format ["NATO does not allow construction this close to %1.",_closest] call notify_minor;
+ format ["NATO does not allow construction this close to %1.",_closest] call OT_fnc_notifyMinor;
}else{
- format ["NATO is currently not allowing any construction in %1",_closest] call notify_minor;
+ format ["NATO is currently not allowing any construction in %1",_closest] call OT_fnc_notifyMinor;
};
};
-if((player distance _center) > modeMax) exitWith {format ["You need to be within %1m of the %2.",modeMax,_buildlocation] call notify_minor};
+if((player distance _center) > modeMax) exitWith {format ["You need to be within %1m of the %2.",modeMax,_buildlocation] call OT_fnc_notifyMinor};
openMap false;
_playerpos = (getpos player);
@@ -271,7 +271,7 @@ buildOnMouseUp = {
if(!isNull modeTarget and canBuildHere) then {
_money = player getVariable "money";
if(_money < modePrice) then {
- "You cannot afford that" call notify_minor;
+ "You cannot afford that" call OT_fnc_notifyMinor;
}else{
_created = objNULL;
playSound "3DEN_notificationDefault";
@@ -283,21 +283,21 @@ buildOnMouseUp = {
clearMagazineCargoGlobal _x;
clearBackpackCargoGlobal _x;
clearItemCargoGlobal _x;
- _x setVariable ["owner",getplayeruid player,true];
+ [_x,getplayeruid player] call OT_fnc_setOwner;
_x call initObjectLocal;
}foreach(_objects);
_created = _objects select 0;
deleteVehicle modeTarget;
}else{
_created = modeTarget;
- modeTarget setVariable ["owner",getplayeruid player,true];
+ [modeTarget,getplayeruid player] call OT_fnc_setOwner;
modeTarget enableSimulationGlobal true;
modeTarget = objNull;
};
if(modeCode != "") then {
_created setVariable ["OT_init",modeCode,true];
- [modeValue,modeCode] remoteExec ["structureInit",2];
+ [_created,modeValue,modeCode] remoteExec ["structureInit",2];
};
_clu = createVehicle ["Land_ClutterCutter_large_F", (getpos modeTarget), [], 0, "CAN_COLLIDE"];
_clu enableDynamicSimulation true;
@@ -308,7 +308,7 @@ buildOnMouseUp = {
};
};
if(!canBuildHere) then {
- "You cannot build that there" call notify_minor;
+ "You cannot build that there" call OT_fnc_notifyMinor;
};
};
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buyVehicleDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buyVehicleDialog.sqf
index b64b9b94..cb961efd 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buyVehicleDialog.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/buyVehicleDialog.sqf
@@ -14,43 +14,57 @@ if(_obpos distance player < 250) then {
}else{
_items = OT_vehicles + OT_boats + OT_staticBackpacks + [["Set_HMG"]];
};
+ if(_obname == "Chemical Plant") then {
+ _items = OT_explosives + OT_detonators + OT_vehicles + OT_boats + OT_staticBackpacks + [["Set_HMG"]];
+ };
}
};
if(OT_adminMode) then {
- _items = OT_helis + OT_vehicles + OT_boats + OT_staticBackpacks + [["Set_HMG"]];
+ _items = OT_explosives + OT_detonators + OT_helis + OT_vehicles + OT_boats + OT_staticBackpacks + [["Set_HMG"]];
};
createDialog "OT_dialog_buy";
{
_cls = _x select 0;
- _price = 0;
- if !(_cls == "Set_HMG") then {
- _price = [_town,_cls,_standing] call OT_fnc_getPrice;
- };
- if("fuel depot" in (server getVariable "OT_NATOabandoned")) then {
- _price = round(_price * 0.5);
- };
- _name = "";
- _pic = "";
- if(_cls == "Set_HMG") then {
- _p = (cost getVariable "I_HMG_01_high_weapon_F") select 0;
- _p = _p + ((cost getVariable "I_HMG_01_support_high_F") select 0);
- private _quad = ((cost getVariable "C_Quadbike_01_F") select 0) + 60;
- _p = _p + _quad;
- _p = _p + 150; //Convenience cost
- _price = _p;
- _name = "Quad Bike w/ HMG Backpacks";
- _pic = "C_Quadbike_01_F" call ISSE_Cfg_Vehicle_GetPic;
- }else{
- _pic = _cls call ISSE_Cfg_Vehicle_GetPic;
- _name = _cls call ISSE_Cfg_Vehicle_GetName;
+ if((_cls select [0,3]) != "IED") then {
+ _price = 0;
+ if !(_cls == "Set_HMG") then {
+ _price = [_town,_cls,_standing] call OT_fnc_getPrice;
+ };
+ if("fuel depot" in (server getVariable "OT_NATOabandoned")) then {
+ _price = round(_price * 0.5);
+ };
+ _name = "";
+ _pic = "";
+ call {
+ if(_cls == "Set_HMG") exitWith {
+ _p = (cost getVariable "I_HMG_01_high_weapon_F") select 0;
+ _p = _p + ((cost getVariable "I_HMG_01_support_high_F") select 0);
+ private _quad = ((cost getVariable "C_Quadbike_01_F") select 0) + 60;
+ _p = _p + _quad;
+ _p = _p + 150; //Convenience cost
+ _price = _p;
+ _name = "Quad Bike w/ HMG Backpacks";
+ _pic = "C_Quadbike_01_F" call ISSE_Cfg_Vehicle_GetPic;
+ };
+ if(_cls in OT_allExplosives) exitWith {
+ _pic = _cls call ISSE_Cfg_Magazine_GetPic;
+ _name = _cls call ISSE_Cfg_Magazine_GetName;
+ };
+ if(_cls in OT_allDetonators) exitWith {
+ _pic = _cls call ISSE_Cfg_Weapons_GetPic;
+ _name = _cls call ISSE_Cfg_Weapons_GetName;
+ };
+ _pic = _cls call ISSE_Cfg_Vehicle_GetPic;
+ _name = _cls call ISSE_Cfg_Vehicle_GetName;
+ };
+ _idx = lbAdd [1500,format["%1",_name]];
+ lbSetPicture [1500,_idx,_pic];
+ lbSetData [1500,_idx,_cls];
+ lbSetValue [1500,_idx,_price];
};
- _idx = lbAdd [1500,format["%1",_name]];
- lbSetPicture [1500,_idx,_pic];
- lbSetData [1500,_idx,_cls];
- lbSetValue [1500,_idx,_price];
}foreach(_items);
_price = [_town,OT_item_UAV,_standing] call OT_fnc_getPrice;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/characterSheet.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/characterSheet.sqf
index c5851ebe..c95ee982 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/characterSheet.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/characterSheet.sqf
@@ -62,7 +62,7 @@ buyPerk = {
private _price = [_perk] call getPerkPrice;
private _inf = player getVariable ["influence",0];
- if(_inf < _price) exitWith {"You do not have enough influence" call notify_minor};
+ if(_inf < _price) exitWith {"You do not have enough influence" call OT_fnc_notifyMinor};
_fitness = _fitness + 1;
player setVariable [format["OT_%1",_perk],_fitness,true];
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_garrisonDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_garrisonDialog.sqf
new file mode 100644
index 00000000..3cfb8d07
--- /dev/null
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_garrisonDialog.sqf
@@ -0,0 +1,55 @@
+createDialog "OT_dialog_garrison";
+disableSerialization;
+
+_b = player call OT_fnc_nearestRealEstate;
+_name = "Base";
+if(typename _b == "ARRAY") then {
+ if(typeof (_b select 0) == OT_item_Flag) then {
+ _name = "";
+ {
+ if((_x select 0) distance (_b select 0) < 10) exitWith {_name = _b select 1};
+ }foreach(server getVariable ["bases",[]]);
+ };
+}else{
+ _ob = (position player) call OT_fnc_nearestObjective;
+ _name = _ob select 1;
+};
+
+_textctrl = (findDisplay 9000) displayCtrl 1100;
+_textctrl ctrlSetStructuredText parseText format["%1",_name];
+
+_btn = (findDisplay 9000) displayCtrl 1600;
+_soldier = ((OT_recruitables select 0) select 0) call OT_fnc_getSoldier;
+_btn ctrlSetTooltip format["$%1",[_soldier select 0, 1, 0, true] call CBA_fnc_formatNumber];
+
+_btn = (findDisplay 9000) displayCtrl 1601;
+_soldier = ((OT_recruitables select 1) select 0) call OT_fnc_getSoldier;
+_btn ctrlSetTooltip format["$%1",[_soldier select 0, 1, 0, true] call CBA_fnc_formatNumber];
+
+_btn = (findDisplay 9000) displayCtrl 1602;
+_soldier = ((OT_recruitables select 13) select 0) call OT_fnc_getSoldier;
+_btn ctrlSetTooltip format["$%1",[_soldier select 0, 1, 0, true] call CBA_fnc_formatNumber];
+
+_btn = (findDisplay 9000) displayCtrl 1603;
+_soldier = ((OT_recruitables select 8) select 0) call OT_fnc_getSoldier;
+_btn ctrlSetTooltip format["$%1",[_soldier select 0, 1, 0, true] call CBA_fnc_formatNumber];
+
+_btn = (findDisplay 9000) displayCtrl 1604;
+_soldier = ((OT_recruitables select 9) select 0) call OT_fnc_getSoldier;
+_btn ctrlSetTooltip format["$%1",[_soldier select 0, 1, 0, true] call CBA_fnc_formatNumber];
+
+_btn = (findDisplay 9000) displayCtrl 1605;
+_soldier = ((OT_recruitables select 10) select 0) call OT_fnc_getSoldier;
+_btn ctrlSetTooltip format["$%1",[_soldier select 0, 1, 0, true] call CBA_fnc_formatNumber];
+
+_btn = (findDisplay 9000) displayCtrl 1606;
+_cost = ["Tanoa","I_HMG_01_high_weapon_F",0] call OT_fnc_getPrice;
+_cost = _cost + (["Tanoa","CIV",0] call OT_fnc_getPrice);
+_cost = _cost + 300;
+_btn ctrlSetTooltip format["$%1",[_cost, 1, 0, true] call CBA_fnc_formatNumber];
+
+_btn = (findDisplay 9000) displayCtrl 1607;
+_cost = ["Tanoa","I_GMG_01_high_weapon_F",0] call OT_fnc_getPrice;
+_cost = _cost + (["Tanoa","CIV",0] call OT_fnc_getPrice);
+_cost = _cost + 300;
+_btn ctrlSetTooltip format["$%1",[_cost, 1, 0, true] call CBA_fnc_formatNumber];
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_optionsDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_optionsDialog.sqf
index fc936241..6e0959b1 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_optionsDialog.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_optionsDialog.sqf
@@ -4,7 +4,7 @@ private _amgen = (getPlayerUID player) in (server getVariable ["generals",[]]);
if(!isMultiplayer) then {_amgen = true};
if(!_amgen) then {
- "You must be a General to change options" call notify_minor;
+ "You must be a General to change options" call OT_fnc_notifyMinor;
}else{
createDialog 'OT_dialog_options';
if(!isMultiplayer) then {
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_resistanceDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_resistanceDialog.sqf
index dbb2ad2f..5d8ebbef 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_resistanceDialog.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_resistanceDialog.sqf
@@ -48,13 +48,15 @@ lbClear 1501;
}foreach(OT_economicData);
_tax = server getVariable ["taxrate",0];
-
+_damaged = owners getVariable ["damagedBuildings",[]];
private _lease = 0;
{
_x params ["_id","_cls","_pos","_town"];
- private _data = [_cls,_town] call OT_fnc_getRealEstateData;
- _tl = (_data select 2);
- _lease = _lease + _tl;
+ if (!_id in _damaged) then {
+ private _data = [_cls,_town] call OT_fnc_getRealEstateData;
+ _tl = (_data select 2);
+ _lease = _lease + _tl;
+ };
}foreach(player getVariable ["leasedata",[]]);
if(_lease > 0) then {
@@ -78,10 +80,16 @@ _totaxper = round(_totax / _numPlayers);
private _perhr = (["Tanoa","WAGE",0] call OT_fnc_getPrice)*6;
private _wages = 0;
+private _income = 0;
{
if(_x != "Factory") then {
_num = server getVariable [format["%1employ",_x],0];
_wages = _wages + (_num * _perhr);
+ if(_num > 20) then {_num = 20};
+ _data = _x call OT_fnc_getEconomicData;
+ if(count _data == 2) then {
+ _income = _income + ((_num * 200) * 6);
+ };
};
}foreach(server getVariable ["GEURowned",[]]);
@@ -104,14 +112,16 @@ if(isMultiplayer) then {
}else{
_text = _text + format["Tax Income: $%1
",[_taxtotal, 1, 0, true] call CBA_fnc_formatNumber];
};
+_text = _text + format["Business Income: $%1 (6 hrs)
",[_income, 1, 0, true] call CBA_fnc_formatNumber];
+
private _minus = "";
if(_wages > 0) then {_minus = "-"};
-_text = _text + format["Wages: $%1%2
",_minus,[_wages, 1, 0, true] call CBA_fnc_formatNumber];
+_text = _text + format["Wages: $%1%2 (6 hrs)
",_minus,[_wages, 1, 0, true] call CBA_fnc_formatNumber];
if(isMultiplayer) then {
- _text = _text + format["Balance (Resistance): $%1
",[_balance, 1, 0, true] call CBA_fnc_formatNumber];
+ _text = _text + format["Balance (Resistance): $%1
",[_balance+_income, 1, 0, true] call CBA_fnc_formatNumber];
_text = _text + format["Balance (You): $%1
",[_lease + (_taxper-_totaxper), 1, 0, true] call CBA_fnc_formatNumber];
}else{
- _text = _text + format["Balance: $%1
",[_lease + (_taxper-_totaxper) + _balance, 1, 0, true] call CBA_fnc_formatNumber];
+ _text = _text + format["Balance: $%1
",[_lease + (_taxper-_totaxper) + _balance + _income, 1, 0, true] call CBA_fnc_formatNumber];
};
disableSerialization;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_reverseEngineerDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_reverseEngineerDialog.sqf
index 26dcf9ad..a73b9668 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_reverseEngineerDialog.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_reverseEngineerDialog.sqf
@@ -9,7 +9,7 @@ private _numitems = 0;
private _blueprints = server getVariable ["GEURblueprints",[]];
{
_cls = _x select 0;
- if !(_cls in _blueprints) then {
+ if !((_cls in _blueprints) or (_cls in OT_allExplosives)) then {
_name = "";
_pic = "";
if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) then {
@@ -32,7 +32,7 @@ private _blueprints = server getVariable ["GEURblueprints",[]];
}foreach(_playerstock);
{
- if (!(_x isKindOf "CaManBase") and alive _x) then {
+ if (!(_x isKindOf "CaManBase") and alive _x and (damage _x) == 0) then {
_cls = typeof _x;
_name = _cls call ISSE_Cfg_Vehicle_GetName;
_pic = _cls call ISSE_Cfg_Vehicle_GetPic;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_vehicleDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_vehicleDialog.sqf
index 8b8bbece..6caf57cf 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_vehicleDialog.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/fn_vehicleDialog.sqf
@@ -3,7 +3,7 @@ private _veh = vehicle player;
private _isgen = call OT_fnc_playerIsGeneral;
-if((_veh getVariable ["owner",""]) != (getplayeruid player)) then {
+if !(_veh call OT_fnc_playerIsOwner) then {
ctrlEnable [1605,false];
}else{
if(_veh getVariable ["OT_locked",false]) then {
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/importDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/importDialog.sqf
index 11b1fb73..e68641c1 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/importDialog.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/importDialog.sqf
@@ -18,7 +18,7 @@ _numitems = 0;
_cls = [_x] call BIS_fnc_baseWeapon;
};
- if !(_cls in _done) then {
+ if !((_cls in _done) or (_cls in OT_allExplosives)) then {
_done pushback _cls;
_price = ["Tanoa",_cls,100] call OT_fnc_getPrice;
_name = "";
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf
index ab9a05d7..0291ff57 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/mainMenu.sqf
@@ -10,8 +10,8 @@ _buildingtextctrl = (findDisplay 8001) displayCtrl 1102;
private _donerem = false;
if !(isNull cursorObject) then {
if((player distance cursorObject) < 20) then {
- if (cursorObject in (entities "")) then {
- if !((cursorObject isKindOf "CAManBase") or (side cursorObject) == west) then {
+ if (cursorObject in ((allMissionObjects "Static") + vehicles)) then {
+ if !((cursorObject isKindOf "CAManBase") or (side cursorObject) == west or (typeof cursorObject) == OT_item_flag) then {
call {
if(((cursorObject isKindOf "Land") or (cursorObject isKindOf "Air")) and ("ToolKit" in (items player)) and (damage cursorObject) == 1) exitWith {
_donerem = true;
@@ -26,7 +26,7 @@ if !(isNull cursorObject) then {
ctrlEnable [1614,false];
};
};
- if((call OT_fnc_playerIsGeneral) or (cursorObject getVariable ["owner",""]) == (getplayeruid player)) exitWith {
+ if((call OT_fnc_playerIsGeneral) or (cursorObject call OT_fnc_playerIsOwner)) exitWith {
_donerem = true;
private _type = typeof cursorObject;
_pic = getText(configfile >> "CfgVehicles" >> _type >> "editorPreview");
@@ -109,13 +109,18 @@ if(typename _b == "ARRAY") then {
_txt = "";
if(_building call OT_fnc_hasOwner) then {
- _owner = _building getVariable "owner";
+
+ _owner = _building call OT_fnc_getOwner;
_ownername = server getVariable format["name%1",_owner];
if(isNil "_ownername") then {_ownername = "Someone"};
- if(_building getVariable ["leased",false]) then {
- _ownername = format["%1 (Leased)",_ownername];
- };
+
if(_owner == getplayerUID player) then {
+ _leased = player getVariable ["leased",[]];
+ _id = [_building] call OT_fnc_getBuildID;
+ if(_id in _leased) then {
+ _ownername = format["%1 (Leased)",_ownername];
+ };
+
if(typeof _building == OT_item_Tent) exitWith {
ctrlSetText [1608,"Sell"];
ctrlEnable [1608,false];
@@ -127,17 +132,6 @@ if(typename _b == "ARRAY") then {
Owned by %1
",_ownername];
};
- if(typeof _building == OT_item_Flag) exitWith {
- ctrlSetText [1608,"Sell"];
- ctrlEnable [1608,false];
- ctrlEnable [1609,false];
- ctrlEnable [1610,false];
-
- _buildingTxt = format["
- %1
- Founded by %2
- ",_building getVariable "name",_ownername];
- };
ctrlSetText [1608,format["Sell ($%1)",[_sell, 1, 0, true] call CBA_fnc_formatNumber]];
@@ -147,23 +141,24 @@ if(typename _b == "ARRAY") then {
_buildingTxt = format["
Warehouse
- Owned by %1
- ",_ownername];
+ Owned by %1
+ Damage: %2%3
+ ",_ownername,round((damage _building) * 100),"%"];
};
- if(_building getVariable ["leased",false] or !((typeof _building) in OT_allRealEstate)) then {
+ if(_id in _leased) then {
ctrlEnable [1609,false];
ctrlEnable [1610,false];
- if !((typeof _building) in OT_allRealEstate) then {
- _lease = 0;
- ctrlSetText [1608,"Remove"];
- };
+ };
+ if(damage _building == 1) then {
+ _lease = 0;
};
_buildingTxt = format["
%1
Owned by %2
- Lease Value: $%3/6hrs
- ",_name,_ownername,[_lease, 1, 0, true] call CBA_fnc_formatNumber];
+ Lease Value: $%3/6hrs
+ Damage: %4%5
+ ",_name,_ownername,[_lease, 1, 0, true] call CBA_fnc_formatNumber,round((damage _building) * 100),"%"];
}else{
ctrlEnable [1608,false];
@@ -177,11 +172,12 @@ if(typename _b == "ARRAY") then {
};
_buildingTxt = format["
%1
- Owned by %2
- ",_name,_ownername];
+ Owned by %2
+ Damage: %2%3
+ ",_name,_ownername,round((damage _building) * 100),"%"];
};
if(typeof _building == OT_barracks) then {
- _owner = _building getVariable "owner";
+ _owner = _building call OT_fnc_getOwner;
_ownername = server getVariable format["name%1",_owner];
ctrlSetText [1608,"Sell"];
ctrlEnable [1608,false];
@@ -192,8 +188,69 @@ if(typename _b == "ARRAY") then {
_buildingTxt = format["
Barracks
- Built by %1
- ",_ownername];
+ Built by %1
+ Damage: %2%3
+ ",_ownername,round((damage _building) * 100),"%"];
+ };
+ if(typeof _building == OT_trainingCamp) then {
+ _owner = _building call OT_fnc_getOwner;
+ _ownername = server getVariable format["name%1",_owner];
+ ctrlSetText [1608,"Sell"];
+ ctrlEnable [1608,false];
+ ctrlEnable [1609,true];
+ ctrlSetText [1609,"Recruit"];
+ //ctrlEnable [1609,false];
+ ctrlEnable [1610,false];
+
+ _buildingTxt = format["
+ Training Camp
+ Built by %1
+ Damage: %2%3
+ ",_ownername,round((damage _building) * 100),"%"];
+ };
+
+ if(typeof _building == OT_refugeeCamp) then {
+ _owner = _building call OT_fnc_getOwner;
+ _ownername = server getVariable format["name%1",_owner];
+ ctrlSetText [1608,"Sell"];
+ ctrlEnable [1608,false];
+ ctrlEnable [1609,false];
+ ctrlEnable [1610,false];
+
+ _buildingTxt = format["
+ Refugee Camp
+ Built by %1
+ Damage: %2%3
+ ",_ownername,round((damage _building) * 100),"%"];
+ };
+
+ if(typeof _building == OT_item_flag) then {
+ _base = [];
+ {
+ if((_x select 0) distance _building < 5) exitWith {_base = _x};
+ }foreach(server getvariable ["bases",[]]);
+
+ _ownername = server getVariable format["name%1",_base select 2];
+ ctrlSetText [1608,"Sell"];
+ ctrlEnable [1608,true];
+ ctrlSetText [1608,"Garrison"];
+ ctrlEnable [1609,false];
+ //ctrlEnable [1609,false];
+ ctrlEnable [1610,false];
+
+ _buildingTxt = format["
+ %1
+ Founded by %2
+ ",_base select 1,_ownername];
+ };
+
+ if(damage _building == 1) then {
+ if((_owner == getplayerUID player) or (call OT_fnc_playerIsGeneral)) then {
+ ctrlEnable [1608,false]; //Not allowed to sell
+ ctrlSetText [1609,"Repair"]; //Replace lease/manage with repair
+ ctrlEnable [1609,true];
+ ctrlEnable [1610,false];
+ };
};
}else{
if(isNil "_price") then {
@@ -226,7 +283,7 @@ if(typename _b == "ARRAY") then {
};
if(typeof _building == OT_policeStation) then {
- _owner = _building getVariable "owner";
+ _owner = _building call OT_fnc_getOwner;
_ownername = server getVariable format["name%1",_owner];
ctrlSetText [1608,"Sell"];
ctrlEnable [1608,false];
@@ -241,7 +298,7 @@ if(typename _b == "ARRAY") then {
};
if(typeof _building == "Land_Cargo_House_V4_F") then {
- _owner = _building getVariable "owner";
+ _owner = _building call OT_fnc_getOwner;
_ownername = server getVariable format["name%1",_owner];
ctrlSetText [1608,"Sell"];
ctrlEnable [1608,false];
@@ -254,7 +311,7 @@ if(typename _b == "ARRAY") then {
",_ownername];
};
- if(!((typeof _building) in OT_allRealEstate)) then {
+ if(!((typeof _building) in OT_allRealEstate + [OT_item_flag])) then {
ctrlEnable [1609,false];
ctrlEnable [1610,false];
ctrlEnable [1608,false];
@@ -283,8 +340,8 @@ if(typename _b == "ARRAY") then {
",_obname];
ctrlEnable [1609,false];
};
- ctrlSetText [1608,"Sell"];
- ctrlEnable [1608,false];
+ ctrlSetText [1608,"Garrison"];
+ ctrlEnable [1608,true];
ctrlSetText [1609,"Procurement"];
ctrlEnable [1610,false];
}else{
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/policeDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/policeDialog.sqf
index a4f6379e..53fabae9 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/policeDialog.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/policeDialog.sqf
@@ -1,7 +1,7 @@
disableSerialization;
_town = (getpos player) call OT_fnc_nearestTown;
-if !(_town in (server getvariable ["NATOabandoned",[]])) exitWith {"This police station is under NATO control" call notify_minor};
+if !(_town in (server getvariable ["NATOabandoned",[]])) exitWith {"This police station is under NATO control" call OT_fnc_notifyMinor};
_garrison = server getVariable [format['police%1',_town],0];
createDialog "OT_dialog_police";
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/recruitDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/recruitDialog.sqf
index d279d1f6..3191c887 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/recruitDialog.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/recruitDialog.sqf
@@ -1,29 +1,43 @@
+_b = player call OT_fnc_nearestRealEstate;
+_building = objNull;
+if(typename _b != "ARRAY") exitWith {};
+_building = (_b select 0);
+if(damage _building == 1) exitWith {"Must repair before you can recruit" call OT_fnc_notifyMinor};
+
disableSerialization;
-_base = (getpos player) call OT_fnc_nearestObjective;
-if (isNil "_base") exitWith {};
-if !((_base select 1) in (server getvariable "NATOabandoned")) exitWith {"This barracks is under NATO control" call notify_minor};
+_base = nil;
+_good = true;
+if(typeof _building == OT_barracks) then {
+ _base = (getpos player) call OT_fnc_nearestObjective;
+ if !((_base select 1) in (server getvariable "NATOabandoned")) then {
+ _good = false;
+ }
+};
+if ((typeof _building == OT_barracks) and isNil "_base") exitWith {};
+if ((typeof _building == OT_barracks) and !_good) exitWith {"This barracks is under NATO control" call OT_fnc_notifyMinor};
private _price = floor((["Tanoa","CIV",0] call OT_fnc_getPrice) * 1.5);
createDialog "OT_dialog_buy";
ctrlSetText [1600,"Recruit"];
lbClear 1500;
-{
- _cls = _x select 0;
- _comp = _x select 1;
- _cost = (_price * count _comp);
-
- _idx = lbAdd [1500,_cls];
- lbSetValue [1500,_idx,_cost];
- lbSetData [1500,_idx,_cls];
-}foreach(OT_squadables);
-{
+if (typeof _building == OT_barracks) then {
+ {
+ _cls = _x select 0;
+ _comp = _x select 1;
+ _cost = (_price * count _comp);
+
+ _idx = lbAdd [1500,_cls];
+ lbSetValue [1500,_idx,_cost];
+ lbSetData [1500,_idx,_cls];
+ }foreach(OT_squadables);
+};
+{
_cls = _x select 0;
_name = _cls call ISSE_Cfg_Vehicle_GetName;
-
+
_idx = lbAdd [1500,_name];
lbSetValue [1500,_idx,_price];
lbSetData [1500,_idx,_cls];
}foreach(OT_recruitables);
-
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/warehouseDialog.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/warehouseDialog.sqf
index c4acfb0e..d4b1b7f5 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/warehouseDialog.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/warehouseDialog.sqf
@@ -2,38 +2,44 @@ private _cursel = lbCurSel 1500;
lbClear 1500;
_sorted = [allVariables warehouse,[],{_x},"ASCEND"] call BIS_fnc_SortBy;
_numitems = 0;
-{
+{
_d = warehouse getVariable [_x,[_x,0]];
- _cls = _d select 0;
- _num = _d select 1;
- _name = "";
- _pic = "";
-
- if(_num > 0) then {
- _numitems = _numitems + 1;
- if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) then {
- _name = _cls call ISSE_Cfg_Weapons_GetName;
- _pic = _cls call ISSE_Cfg_Weapons_GetPic;
- };
- if(_cls isKindOf ["Default",configFile >> "CfgMagazines"]) then {
- _name = _cls call ISSE_Cfg_Magazine_GetName;
- _pic = _cls call ISSE_Cfg_Magazine_GetPic;
- };
- if(_cls isKindOf "Bag_Base") then {
- _name = _cls call ISSE_Cfg_Vehicle_GetName;
- _pic = _cls call ISSE_Cfg_Vehicle_GetPic;
- };
- if(isClass (configFile >> "CfgGlasses" >> _cls)) then {
- _name = gettext(configFile >> "CfgGlasses" >> _cls >> "displayName");
- _pic = gettext(configFile >> "CfgGlasses" >> _cls >> "picture");
- };
+ if(typename _d == "ARRAY") then {
+ _cls = _d select 0;
+ _num = _d select 1;
+ _name = "";
+ _pic = "";
- _idx = lbAdd [1500,format["%1 x %2",_num,_name]];
- lbSetPicture [1500,_idx,_pic];
- lbSetValue [1500,_idx,_num];
- lbSetData [1500,_idx,_cls];
+ if(_num > 0) then {
+ _numitems = _numitems + 1;
+ call {
+ if(_cls isKindOf ["Default",configFile >> "CfgWeapons"]) exitWith {
+ _name = _cls call ISSE_Cfg_Weapons_GetName;
+ _pic = _cls call ISSE_Cfg_Weapons_GetPic;
+ };
+ if(_cls isKindOf ["Default",configFile >> "CfgMagazines"]) exitWith {
+ _name = _cls call ISSE_Cfg_Magazine_GetName;
+ _pic = _cls call ISSE_Cfg_Magazine_GetPic;
+ };
+ if(_cls isKindOf "Bag_Base") exitWith {
+ _name = _cls call ISSE_Cfg_Vehicle_GetName;
+ _pic = _cls call ISSE_Cfg_Vehicle_GetPic;
+ };
+ if(isClass (configFile >> "CfgGlasses" >> _cls)) exitWith {
+ _name = gettext(configFile >> "CfgGlasses" >> _cls >> "displayName");
+ _pic = gettext(configFile >> "CfgGlasses" >> _cls >> "picture");
+ };
+ _name = _cls call ISSE_Cfg_Vehicle_GetName;
+ _pic = _cls call ISSE_Cfg_Vehicle_GetPic;
+ };
+
+ _idx = lbAdd [1500,format["%1 x %2",_num,_name]];
+ lbSetPicture [1500,_idx,_pic];
+ lbSetValue [1500,_idx,_num];
+ lbSetData [1500,_idx,_cls];
+ };
};
}foreach(_sorted);
if(_cursel >= _numitems) then {_cursel = 0};
-lbSetCurSel [1500, _cursel];
\ No newline at end of file
+lbSetCurSel [1500, _cursel];
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/addPolice.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/addPolice.sqf
index ca776e87..a87770ef 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/addPolice.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/addPolice.sqf
@@ -5,10 +5,10 @@ _town = (getpos player) call OT_fnc_nearestTown;
_money = player getVariable ["money",0];
_price = ([_town,"CIV",-50] call OT_fnc_getPrice) + 250;
-if(_money < (_amt * _price)) exitWith {"You cannot afford that" call notify_minor};
+if(_money < (_amt * _price)) exitWith {"You cannot afford that" call OT_fnc_notifyMinor};
-if !(_town in (server getvariable ["NATOabandoned",[]])) exitWith {"This police station is under NATO control" call notify_minor};
+if !(_town in (server getvariable ["NATOabandoned",[]])) exitWith {"This police station is under NATO control" call OT_fnc_notifyMinor};
_garrison = server getVariable [format['police%1',_town],0];
_garrison = _garrison + _amt;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyAmmobox.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyAmmobox.sqf
deleted file mode 100644
index f8684386..00000000
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyAmmobox.sqf
+++ /dev/null
@@ -1,49 +0,0 @@
-if !(captive player) exitWith {"You cannot buy an ammobox while wanted" call notify_minor};
-
-_price = 150;
-
-_money = player getVariable "money";
-if(_money < _price) exitWith {format["You need $%1",_price] call notify_minor};
-
-_buildings = (getpos player) nearObjects 20;
-_handled = false;
-_building = objNULL;
-{
- _owner = _x getVariable "owner";
- if(!isNil "_owner") then {
- if ((typeof _x) in OT_allBuyableBuildings and _owner == getplayerUID player) exitWith {
- _handled = true;
-
- playSound "ClickSoft";
- player setVariable ["money",_money-_price,true];
-
- _cosa = OT_item_Storage createVehicle (getpos player);
-
- clearWeaponCargoGlobal _cosa;
- clearMagazineCargoGlobal _cosa;
- clearBackpackCargoGlobal _cosa;
- clearItemCargoGlobal _cosa;
-
- _cosa enableSimulationGlobal false;
- _cosa attachTo [player,[0,2,1]];
- _idx = player addAction ["Drop Here", {{detach _x} forEach attachedObjects player; removeAllActions player},nil,0,false,true,"",""];
-
- waitUntil {sleep 0.05; (count attachedObjects player == 0) or (vehicle player != player) or (!alive player) or (!isPlayer player)};
-
- {detach _x} forEach attachedObjects player;
- player removeAction _idx;
-
- _cosa setPosATL [getPosATL _cosa select 0,getPosATL _cosa select 1,getPosATL player select 2];
- _cosa setVariable ["owner",getPlayerUID player,true];
- sleep 1;
- _cosa addAction ["Move this", "actions\move.sqf",nil,0,false,true,"",""];
- _cosa enableSimulationGlobal true;
- };
- };
-
-}foreach(_buildings);
-
-if !(_handled) then {
- "You don't own any buildings nearby" call notify_minor;
-};
-
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyBuilding.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyBuilding.sqf
deleted file mode 100644
index ca538424..00000000
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buyBuilding.sqf
+++ /dev/null
@@ -1,132 +0,0 @@
-if !(captive player) exitWith {"You cannot buy or manage real estate while wanted" call notify_minor};
-
-_b = player call OT_fnc_nearestRealEstate;
-private _handled = false;
-private _type = "buy";
-private _err = false;
-private _isfactory = false;
-if(typename _b == "ARRAY") then {
- _building = (_b select 0);
- if !(_building call OT_fnc_hasOwner) then {
- _handled = true;
- }else{
- _owner = _building getVariable "owner";
- if(_owner == getplayeruid player) then {
- _home = player getVariable "home";
- if(_home distance _building < 5) exitWith {"You cannot sell your home" call notify_minor;_err = true};
- _type = "sell";
- _handled = true;
- };
- };
-}else{
- _b = (position player) call OT_fnc_nearestLocation;
- if((_b select 1) == "Business") then {
- if (call OT_fnc_playerIsGeneral) then {
- _name = (_b select 0);
- _pos = (_b select 2) select 0;
- _price = _name call OT_fnc_getBusinessPrice;
- _err = true;
- _money = [] call OT_fnc_resistanceFunds;
- if(_money >= _price) then {
- [-_price] call OT_fnc_resistanceFunds;
- _owned = server getVariable ["GEURowned",[]];
- if(_owned find _name == -1) then {
- server setVariable ["GEURowned",_owned + [_name],true];
- server setVariable [format["%1employ",_name],2];
- _pos remoteExec ["OT_fnc_resetSpawn",2,false];
- format["%1 is now operational",_name] remoteExec ["notify_minor",0,true];
- _name setMarkerColor "ColorGUER";
- };
- }else{
- "The resistance cannot afford this" call notify_minor;
- };
- };
- }else{
- if((getpos player) distance OT_factoryPos < 150) then {
- if (call OT_fnc_playerIsGeneral) then {
- _name = "Factory";
-
- _owned = server getVariable ["GEURowned",[]];
- if(_owned find _name == -1) then {
- _pos = OT_factoryPos;
- _price = _name call OT_fnc_getBusinessPrice;
- _err = true;
- _money = [] call OT_fnc_resistanceFunds;
- if(_money >= _price) then {
- [-_price] call OT_fnc_resistanceFunds;
- server setVariable ["GEURowned",_owned + [_name],true];
- server setVariable [format["%1employ",_name],2];
- _pos remoteExec ["OT_fnc_resetSpawn",2,false];
- format["%1 is now operational",_name] remoteExec ["notify_minor",0,true];
- _name setMarkerColor "ColorGUER";
- }else{
- "The resistance cannot afford this" call notify_minor;
- };
- }else{
- //Manage
- [] spawn OT_fnc_factoryDialog;
- _isfactory = true;
- };
- };
- };
- };
-};
-if(_err) exitWith {};
-if(_handled) then {
- _building = _b select 0;
- _price = _b select 1;
- _sell = _b select 2;
- _lease = _b select 3;
- _totaloccupants = _b select 4;
- _town = (getpos _building) call OT_fnc_nearestTown;
-
- _money = player getVariable "money";
-
- if(_type == "buy" and _money < _price) exitWith {"You cannot afford that" call notify_minor};
-
-
- _mrkid = format["bdg-%1",_building];
- _owned = player getVariable "owned";
-
- if(_type == "buy") then {
- _building setVariable ["owner",getPlayerUID player,true];
- [-_price] call money;
-
- _mrk = createMarkerLocal [_mrkid,getpos _building];
- _mrk setMarkerShape "ICON";
- _mrk setMarkerColor "ColorWhite";
- if(typeof _building == OT_warehouse) then {
- _mrk setMarkerType "OT_warehouse";
- }else{
- _mrk setMarkerType "loc_Tourism";
- _mrk setMarkerAlpha 0;
- _mrk setMarkerAlphaLocal 1;
- };
-
- _owned pushback ([_building] call fnc_getBuildID);
- [player,"Building Purchased",format["Bought: %1 in %2 for $%3",getText(configFile >> "CfgVehicles" >> (typeof _building) >> "displayName"),(getpos _building) call OT_fnc_nearestTown,_price]] call BIS_fnc_createLogRecord;
- if(_price > 10000) then {
- [_town,round(_price / 10000)] call standing;
- };
- }else{
- if ((typeof _building) in OT_allRealEstate) then {
- _building setVariable ["owner",nil,true];
- _building setVariable ["leased",nil,true];
- deleteMarker _mrkid;
- _owned deleteAt (_owned find ([_building] call fnc_getBuildID));
- [player,"Building Sold",format["Sold: %1 in %2 for $%3",getText(configFile >> "CfgVehicles" >> (typeof _building) >> "displayName"),(getpos _building) call OT_fnc_nearestTown,_sell]] call BIS_fnc_createLogRecord;
- [_sell] call money;
- }else{
- deleteVehicle _building;
- _owned deleteAt (_owned find ([_building] call fnc_getBuildID));
- };
- };
-
- player setVariable ["owned",_owned,true];
-
-
-}else{
- if !(_isfactory) then {
- "There are no buildings for sale nearby" call notify_minor;
- };
-};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/exportAll.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/exportAll.sqf
index 5fee5cc1..21e9e188 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/exportAll.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/exportAll.sqf
@@ -12,7 +12,7 @@ if(_town in (server getVariable ["NATOabandoned",[]])) then {
hint format ["Only legal items may be exported while NATO controls %1",_town];
};
-"Exporting inventory" call notify_minor;
+"Exporting inventory" call OT_fnc_notifyMinor;
[5,false] call progressBar;
sleep 5;
_total = 0;
@@ -21,7 +21,9 @@ _total = 0;
_cls = _x select 0;
_num = _x select 1;
if(_doillegal or _cls in (OT_allItems + OT_allBackpacks + OT_Resources + OT_allClothing)) then {
- _costprice = ["Tanoa",_cls,0] call OT_fnc_getSellPrice;
+ _baseprice = ["Tanoa",_cls,0] call OT_fnc_getSellPrice;
+ _costprice = round(_baseprice * 0.4); //The cost of export
+
_total = _total + (_costprice * _num);
call {
if(_cls isKindOf ["Rifle",configFile >> "CfgWeapons"]) exitWith {
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf
new file mode 100644
index 00000000..a7ae4c1e
--- /dev/null
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_addGarrison.sqf
@@ -0,0 +1,74 @@
+params ["_create"];
+
+private _b = (getpos player) call OT_fnc_nearestBase;
+private _pos = _b select 0;
+_code = format["fob%1",_pos];
+if(_pos distance player > 30) then {
+ _b = (getpos player) call OT_fnc_nearestObjective;
+ _pos = _b select 0;
+ _code = _b select 1;
+};
+
+if(({side _x == west or side _x == east} count (_pos nearEntities 50)) > 0) exitWith {"You cannot garrison with enemies nearby" call OT_fnc_notifyMinor};
+
+_group = spawner getVariable [format["resgarrison%1",_code],grpNull];
+_doinit = false;
+if(isNull _group) then {
+ _group = creategroup resistance;
+ spawner setVariable [format["resgarrison%1",_code],_group,true];
+ _doinit = true;
+};
+private _sol = [];
+if(typename _create == "SCALAR") then {
+ _sol = OT_recruitables select _create;
+ _cls = _sol select 0;
+
+ _soldier = _cls call OT_fnc_getSoldier;
+
+ private _money = player getVariable ["money",0];
+ private _cost = _soldier select 0;
+ if(_money < _cost) exitWith {format ["You need $%1",_cost] call OT_fnc_notifyMinor};
+
+ [-_cost] call money;
+
+ private _civ = [_soldier,_pos,_group] call OT_fnc_createSoldier;
+
+ if(_doinit) then {
+ _group call OT_fnc_initMilitaryPatrol;
+ };
+}else{
+ if(_create == "HMG") then {
+ _p = _pos findEmptyPosition [30,80,"I_HMG_01_high_F"];
+
+ _cost = ["Tanoa","I_HMG_01_high_weapon_F",0] call OT_fnc_getPrice;
+ _cost = _cost + (["Tanoa","CIV",0] call OT_fnc_getPrice);
+ _cost = _cost + 300;
+
+ private _money = player getVariable ["money",0];
+ if(_money < _cost) exitWith {format ["You need $%1",_cost] call OT_fnc_notifyMinor};
+ [-_cost] call money;
+
+ _gun = "I_HMG_01_high_F" createVehicle _p;
+ createVehicleCrew _gun;
+ {
+ [_x] joinSilent _group;
+ }foreach(crew _gun);
+ };
+ if(_create == "GMG") then {
+ _p = _pos findEmptyPosition [10,50,"I_GMG_01_high_F"];
+
+ _cost = ["Tanoa","I_GMG_01_high_weapon_F",0] call OT_fnc_getPrice;
+ _cost = _cost + (["Tanoa","CIV",0] call OT_fnc_getPrice);
+ _cost = _cost + 300;
+
+ private _money = player getVariable ["money",0];
+ if(_money < _cost) exitWith {format ["You need $%1",_cost] call OT_fnc_notifyMinor};
+ [-_cost] call money;
+
+ _gun = "I_GMG_01_high_F" createVehicle _p;
+ createVehicleCrew _gun;
+ {
+ [_x] joinSilent _group;
+ }foreach(crew _gun);
+ };
+};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_makeGeneral.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_makeGeneral.sqf
deleted file mode 100644
index e69de29b..00000000
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_transferFunds.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_transferFunds.sqf
deleted file mode 100644
index e69de29b..00000000
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/getIntel.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/getIntel.sqf
index 63a01df0..e20967b8 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/getIntel.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/getIntel.sqf
@@ -1,9 +1,9 @@
-if !(captive player) exitWith {"You cannot probe for intel while wanted" call notify_minor};
+if !(captive player) exitWith {"You cannot probe for intel while wanted" call OT_fnc_notifyMinor};
private _civ = OT_interactingWith;
if(player getVariable ["influence",0] > 0) then {
player globalchat (["So, how's things?","Hey! How's it going","So any news?","What's new?","Hey what's up?","sup?"] call BIS_fnc_selectRandom);
[player,_civ] call giveIntel;
}else{
- "You need 1 influence to probe for intel" call notify_minor;
+ "You need 1 influence to probe for intel" call OT_fnc_notifyMinor;
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/giveMoney.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/giveMoney.sqf
deleted file mode 100644
index ce976b55..00000000
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/giveMoney.sqf
+++ /dev/null
@@ -1,33 +0,0 @@
-_money = player getVariable "money";
-
-if(_money < 100) exitWith {"You don't have $100 to give" call notify_minor};
-
-_civ = player getvariable "hiringciv";
-
-_handled = false;
-
-_town = (getpos player) call OT_fnc_nearestTown;
-_rep = player getVariable format["rep%1",_town];
-if(_rep > 100) then {_rep = 100};
-if(_rep < -100) then {_rep = -100};
-
-if(isPlayer _civ) exitWith {
- _handled = true;
- _mon = _x getVariable "money";
- _x setVariable ["money",_mon+100,true];
-};
-if(side _civ == civilian) then {
- _handled = true;
- _civ setVariable ["gotmoney",true,false];
- _civ setVariable ["askedintel",false,false];
- if((random 100) > 80) then {
- _x globalChat "I'll tell everyone in town how generous you are!";
- [_town,1] call standing;
- }else{
- _civ globalChat "Thank you, kind sir!";
- };
-};
-
-if(_handled) then {
- player setVariable ["money",_money-100,true];
-};
\ No newline at end of file
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/import.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/import.sqf
index 2be5cf7e..17577780 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/import.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/import.sqf
@@ -8,7 +8,7 @@ private _price = ["Tanoa",_cls,100] call OT_fnc_getPrice;
_total = (_num * _price);
private _veh = (vehicle player);
-if((player getVariable ["money",0]) < _total) exitWith {format["You need $%1",[_total, 1, 0, true] call CBA_fnc_formatNumber] call notify_minor;OT_taking = false};
+if((player getVariable ["money",0]) < _total) exitWith {format["You need $%1",[_total, 1, 0, true] call CBA_fnc_formatNumber] call OT_fnc_notifyMinor;OT_taking = false};
if ((!(_veh isKindOf "Truck_F")) and (!(_veh canAdd [_cls,_num]))) exitWith {hint "This vehicle cannot fit that, use a truck for more storage";OT_taking = false};
_count = 0;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf
index 3a9d2dca..23a8bfad 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/leaseBuilding.sqf
@@ -3,8 +3,24 @@ _building = objNull;
if(typename _b == "ARRAY") then {
_building = (_b select 0);
};
+if(damage _building == 1) exitWith {
+ _price = round((_b select 1) * 0.25);
+ _money = player getVariable ["money",0];
+ if(_money >= _price) then {
+ [-_price] call money;
+ _building setDamage 0;
+ _id = [_building] call OT_fnc_getBuildID;
+ _damaged = owners getVariable ["damagedBuildings",[]];
+ if(_id in _damaged) then {
+ _damaged deleteAt (_damaged find _id);
+ owners setVariable ["damagedBuildings",_damaged,true];
+ }
+ }else{
+ format["You need $%1",[_price, 1, 0, true] call CBA_fnc_formatNumber];
+ };
+};
if(typeof _building == OT_policeStation) exitWith {[] call policeDialog};
-if(typeof _building == OT_barracks) exitWith {[] call recruitDialog};
+if((typeof _building == OT_barracks) or (typeof _building == OT_trainingCamp)) exitWith {[] call recruitDialog};
if(typeof _building == OT_warehouse) exitWith {[] call buyVehicleDialog};
if(typename _b != "ARRAY") exitWith {
@@ -17,7 +33,7 @@ if(typename _b != "ARRAY") exitWith {
};
};
-if !(captive player) exitWith {"You cannot lease buildings while wanted" call notify_minor};
+if !(captive player) exitWith {"You cannot lease buildings while wanted" call OT_fnc_notifyMinor};
_handled = false;
@@ -29,10 +45,10 @@ if(typename _b == "ARRAY") then {
if !(_building call OT_fnc_hasOwner) then {
_handled = true;
}else{
- _owner = _building getVariable "owner";
+ _owner = _building call OT_fnc_getOwner;
if(_owner == getplayeruid player) then {
_home = player getVariable "home";
- if((_home distance _building) < 5) exitWith {"You cannot lease your home" call notify_minor;_err = true};
+ if((_home distance _building) < 5) exitWith {"You cannot lease your home" call OT_fnc_notifyMinor;_err = true};
_handled = true;
};
};
@@ -48,9 +64,8 @@ if(_handled) then {
_leasedata pushback [_id,typeof _building,getpos _building,(getpos _building) call OT_fnc_nearestTown];
player setvariable ["leasedata",_leasedata,true];
- _building setVariable ["leased",true,true];
_mrkid = format["bdg-%1",_building];
_mrkid setMarkerAlphaLocal 0.3;
playSound "3DEN_notificationDefault";
- "Building leased" call notify_minor;
+ "Building leased" call OT_fnc_notifyMinor;
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/move.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/move.sqf
deleted file mode 100644
index a3a90888..00000000
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/move.sqf
+++ /dev/null
@@ -1,48 +0,0 @@
-private ["_idx","_jugador","_cosa","_id"];
-
-_cosa = _this select 0;
-_jugador = _this select 1;
-_id = _this select 2;
-_cosa remoteExec ["enableSimulationGlobal false",2,false];
-_cosa enableSimulation false;
-_cosa removeAction _id;
-
-_originalpos = getposATL _cosa;
-_originaldir = getDir _cosa;
-_mass = getMass _cosa;
-_cosa setMass 0;
-{
- _cosa disableCollisionWith _x;
-}foreach(vehicles + allUnits);
-
-_p = getpos _cosa;
-_j = getpos _jugador;
-_p = [0,2.5,((_p select 2) - (_j select 2))+1.2];
-
-_cosa attachTo [_jugador,_p];
-_cosa allowDamage false;
-
-OT_moveIdx = _jugador addAction ["Drop Here", {{detach _x} forEach attachedObjects player;},nil,0,false,true,"",""];
-
-waitUntil {sleep 0.1; (count attachedObjects _jugador == 0) or (vehicle _jugador != _jugador) or (!alive _jugador) or (!isPlayer _jugador)};
-
-{detach _x} forEach attachedObjects _jugador;
-_jugador removeAction OT_moveIdx;
-
-if!([(getpos player),"Misc"] call OT_fnc_canPlace) exitWith {
- "You cannot move this too far from a building or camp that you own" call notify_minor;
- _cosa setPosATL _originalpos;
- _cosa setDir _originaldir;
- _cosa addAction ["Move this", "actions\move.sqf",nil,0,false,true,"",""];
- _cosa enableSimulationGlobal true;
-};
-
-_cosa setPosATL [getPosATL _cosa select 0,getPosATL _cosa select 1,getPosATL _jugador select 2];
-_cosa addAction ["Move this", "actions\move.sqf",nil,0,false,true,"",""];
-_cosa remoteExec ["enableSimulationGlobal true",2];
-_cosa enableSimulation true;
-_cosa allowDamage true;
-_cosa setMass _mass;
-{
- _cosa enableCollisionWith _x;
-}foreach(vehicles + allUnits);
\ No newline at end of file
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf
index 9eb63bff..b98c4872 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/placementMode.sqf
@@ -1,4 +1,4 @@
-if !(captive player) exitWith {"You cannot place objects while wanted" call notify_minor};
+if !(captive player) exitWith {"You cannot place objects while wanted" call OT_fnc_notifyMinor};
private ["_typecls","_types","_cost","_attach","_idx","_money"];
_typecls = _this;
@@ -9,8 +9,8 @@ _description = "";
modeFinished = false;
modeCancelled = false;
call {
- if(_typecls == "Camp") exitWith {attachAt = [0,3.5,1.1];modeValues = [OT_item_Tent];_cost=40;_description="Creates a fast travel destination for you and your group. Only one allowed per player, will remove any existing camps."};
- if(_typecls == "Base") exitWith {attachAt = [0,6,4];modeValues = [OT_item_Flag];_cost=500;_description="Creates a fast travel destination for all friendlies and enables build mode for military structures"};
+ if(_typecls == "Camp") exitWith {attachAt = [0,3.5,1.1];modeValues = [OT_item_Tent];_cost=40;_description="Creates a fast travel destination for all friendlies. Only one allowed per player, will remove any existing camps."};
+ if(_typecls == "Base") exitWith {attachAt = [0,6,4];modeValues = [OT_item_Flag];_cost=250;_description="Creates a fast travel destination for all friendlies and enables build mode for basic military structures"};
if(_typecls == "Ammobox") exitWith {modeValues = [OT_item_Storage];_cost=60;_description="Another empty ammobox to fill with items you have acquired through.. various means."};
if(_typecls == "Whiteboard") exitWith {modeValues = [OT_item_Map];_cost=20;_description="Plan out your next assault in the middle of the jungle."};
{
@@ -19,13 +19,13 @@ call {
};
//Price check (on aisle 3)
_money = player getVariable "money";
-if(_cost > _money) exitWith {format["You cannot afford that, you need $%1",_cost] call notify_minor};
+if(_cost > _money) exitWith {format["You cannot afford that, you need $%1",_cost] call OT_fnc_notifyMinor};
if !([getpos player,_typecls] call OT_fnc_canPlace) exitWith {
call {
- if(_typecls == "Camp") exitWith {"Camps cannot be near another building" call notify_minor};
- if(_typecls == "Base") exitWith {"Bases cannot be too close to a town, NATO installation or existing base" call notify_minor};
- "You must be near a base or owned structure" call notify_minor
+ if(_typecls == "Camp") exitWith {"Camps cannot be near another building" call OT_fnc_notifyMinor};
+ if(_typecls == "Base") exitWith {"Bases cannot be too close to a town, NATO installation or existing base" call OT_fnc_notifyMinor};
+ "You must be near a base or owned structure" call OT_fnc_notifyMinor
};
};
@@ -155,13 +155,8 @@ if(_cost > 0) then {
}else{
if ([getpos player,_typecls] call OT_fnc_canPlace) then {
[-_cost] call money;
- modeTarget setPosATL [getPosATL modeTarget select 0,getPosATL modeTarget select 1,getPosATL player select 2];
- if !((typeof modeTarget) in OT_miscables) then {
- [modeTarget,true] remoteExec ["enableSimulationGlobal",2];
- }else{
- [modeTarget,false] remoteExec ["enableSimulationGlobal",2];
- };
- modeTarget setVariable ["owner",getPlayerUID player,true];
+ modeTarget setPosATL [getPosATL modeTarget select 0,getPosATL modeTarget select 1,getPosATL player select 2];
+ [modeTarget,getPlayerUID player] call OT_fnc_setOwner;
modeTarget remoteExec["initObjectLocal",0,modeTarget];
if(_typecls == "Base" or _typecls == "Camp") then {
_veh = createVehicle ["Land_ClutterCutter_large_F", (getpos modeTarget), [], 0, "CAN_COLLIDE"];
@@ -214,7 +209,7 @@ if(_cost > 0) then {
if(count _camp > 0) then {
{
_t = typeof _x;
- if(_x getVariable ["owner",""] == getplayeruid player) then {
+ if((_x call OT_fnc_getOwner) == getplayeruid player) then {
if(_t == OT_item_Tent or _t == "Land_ClutterCutter_large_F") then {
deleteVehicle _x;
};
@@ -235,9 +230,9 @@ if(_cost > 0) then {
};
}else{
call {
- if(_typecls == "Camp") exitWith {"Camps cannot be near a structure you already own" call notify_minor};
- if(_typecls == "Base") exitWith {"Bases cannot be near a town, NATO installation or existing base" call notify_minor};
- "You must be near a base or owned building" call notify_minor
+ if(_typecls == "Camp") exitWith {"Camps cannot be near a structure you already own" call OT_fnc_notifyMinor};
+ if(_typecls == "Base") exitWith {"Bases cannot be near a town, NATO installation or existing base" call OT_fnc_notifyMinor};
+ "You must be near a base or owned building" call OT_fnc_notifyMinor
};
detach modeTarget;
deleteVehicle modeTarget;
@@ -245,9 +240,9 @@ if(_cost > 0) then {
};
}else{
if(_typecls != "Camp" and _typecls != "Base") then {
- "To place this item you must be near a base or a building that you own" call notify_minor;
+ "To place this item you must be near a base or a building that you own" call OT_fnc_notifyMinor;
}else{
- "You cannot place a camp/base near a building you own. Bases must also be built away from towns." call notify_minor;
+ "You cannot place a camp/base near a building you own. Bases must also be built away from towns." call OT_fnc_notifyMinor;
};
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/rearmGroup.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/rearmGroup.sqf
deleted file mode 100644
index e69de29b..00000000
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf
index 10d4f114..e4bd5e6a 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSoldier.sqf
@@ -1,19 +1,21 @@
-if !(captive player) exitWith {"You cannot recruit while wanted" call notify_minor};
+if !(captive player) exitWith {"You cannot recruit while wanted" call OT_fnc_notifyMinor};
private _cls = _this select 0;
private _pos = _this select 1;
private _group = _this select 2;
+if(({side _x == west or side _x == east} count (_pos nearEntities 50)) > 0) exitWith {"You cannot recruit with enemies nearby" call OT_fnc_notifyMinor};
+
_soldier = _cls call OT_fnc_getSoldier;
private _money = player getVariable ["money",0];
private _cost = _soldier select 0;
-if(_money < _cost) exitWith {format ["You need $%1",_cost] call notify_minor};
+if(_money < _cost) exitWith {format ["You need $%1",_cost] call OT_fnc_notifyMinor};
[-_cost] call money;
private _civ = [_soldier,_pos,_group] call OT_fnc_createSoldier;
-_civ setVariable ["owner",getplayeruid player,true];
+[_civ,getPlayerUID player] call OT_fnc_setOwner;
[_civ] spawn OT_fnc_initRecruit;
_civ setRank "SERGEANT";
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf
index 080fbac2..f1979744 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitSquad.sqf
@@ -1,9 +1,11 @@
-if !(captive player) exitWith {"You cannot recruit while wanted" call notify_minor};
+if !(captive player) exitWith {"You cannot recruit while wanted" call OT_fnc_notifyMinor};
private _cls = _this select 0;
private _pos = _this select 1;
private _cc = player getVariable ["OT_squadcount",0];
+if(({side _x == west or side _x == east} count (_pos nearEntities 50)) > 0) exitWith {"You cannot recruit squads with enemies nearby" call OT_fnc_notifyMinor};
+
_d = [];
{
_name = _x select 0;
@@ -23,7 +25,7 @@ private _cost = 0;
}foreach(_comp);
private _money = player getVariable ["money",0];
-if(_money < _cost) exitWith {format ["You need $%1",_cost] call notify_minor};
+if(_money < _cost) exitWith {format ["You need $%1",_cost] call OT_fnc_notifyMinor};
[-_cost] call money;
@@ -32,7 +34,7 @@ _leader = false;
{
_civ = [_x,_pos,_group] call OT_fnc_createSoldier;
player reveal [_civ,4];
- if(!_leader) then {_group selectLeader _civ;_civ setVariable ["owner",getplayeruid player,true],_leader=true};
+ if(!_leader) then {_group selectLeader _civ;[_civ,getPlayerUID player] call OT_fnc_setOwner,_leader=true};
}foreach(_soldiers);
_group setGroupIdGlobal [format["%1-%2",_shortname,_cc]];
@@ -45,4 +47,4 @@ _recruits = server getVariable ["squads",[]];
_recruits pushback [getplayeruid player,_cls,_group,[]];
server setVariable ["squads",_recruits,true];
-hcShowBar true;
+"Squad recruited, use ctrl + space to command" call OT_fnc_notifyMinor;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/repairAll.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/repairAll.sqf
deleted file mode 100644
index 80bf489c..00000000
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/repairAll.sqf
+++ /dev/null
@@ -1,14 +0,0 @@
-private ["_pos"];
-_pos = getpos player;
-
-{
-if (_x distance _pos < 50)
- then
- {
- _x setDamage 0;
- //_x setVehicleAmmoDef 1;
- [_x,1] remoteExec ["setVehicleAmmoDef",_x,false];
- };
-} forEach vehicles;
-
-"All vehicles within 50m have been repaired and rearmed." call notify_minor;
\ No newline at end of file
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/setHome.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/setHome.sqf
index 1a7b9c0c..995cad51 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/setHome.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/setHome.sqf
@@ -1,21 +1,20 @@
-if !(captive player) exitWith {"You cannot set home while wanted" call notify_minor};
+if !(captive player) exitWith {"You cannot set home while wanted" call OT_fnc_notifyMinor};
_buildings = (getpos player) nearObjects 15;
_handled = false;
_building = objNULL;
{
- _owner = _x getVariable "owner";
+ _owner = _x call OT_fnc_getOwner;
if(!isNil "_owner") then {
if ((typeof _x) in OT_allBuyableBuildings and _owner == getplayerUID player) exitWith {
_handled = true;
player setVariable ["home",getpos _x,true];
- "This is now your home" call notify_minor;
+ "This is now your home" call OT_fnc_notifyMinor;
};
};
-
+
}foreach(_buildings);
-if !(_handled) then {
- "You don't own any buildings nearby" call notify_minor;
+if !(_handled) then {
+ "You don't own any buildings nearby" call OT_fnc_notifyMinor;
};
-
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeMoney.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeMoney.sqf
index 6a434a69..c246756e 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeMoney.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeMoney.sqf
@@ -22,7 +22,7 @@ if(_password == "") exitWith {
inputHandler = {
private _password = OT_context getVariable ["password",""];
private _pw = ctrlText 1400;
- if(_pw != _password) exitWith {"Wrong password" call notify_minor};
+ if(_pw != _password) exitWith {"Wrong password" call OT_fnc_notifyMinor};
private _in = OT_context getVariable ["money",0];
inputHandler = {
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/airports.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/airports.sqf
index 9a963249..fda78ce7 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/airports.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/airports.sqf
@@ -1,7 +1,7 @@
OT_airportData = [
- [[7083.24,7393.07,0],"Aéroport de Tanoa"],
- [[11709,3150.79,0],"Saint-George Airstrip"],
- [[2144.06,3462.68,0],"Bala Airstrip"],
- [[11685.5,13134.1,0],"La Rochelle Aerodrome"],
- [[2430.34,13330.8,0],"Tuvanaka Airbase"]
+ [[7083.24,7393.07,0],"Aéroport de Tanoa",1500],
+ [[11709,3150.79,0],"Saint-George Airstrip",1000],
+ [[2144.06,3462.68,0],"Bala Airstrip",900],
+ [[11685.5,13134.1,0],"La Rochelle Aerodrome",900],
+ [[2430.34,13330.8,0],"Tuvanaka Airbase",3000]
];
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/objectives.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/objectives.sqf
index af0c7b29..a2394de4 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/objectives.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/data/objectives.sqf
@@ -1,11 +1,12 @@
OT_objectiveData = [
- [[10098.7,11818.1,0],"Comms Alpha"],
- [[2271.72,6331.39,0],"fuel depot"],
- [[4166.48,11723.6,0],"The Harbor Remnants"],
- [[3432.65,12893.3,0],"The Firing Range"],
- [[3870.23,13412.4,0],"The Vehicle Range"],
- [[3939.27,13915,0],"The Camp Remnants"],
- [[3166.18,11038.8,0],"Belfort Naval Base"]
+ [[10098.7,11818.1,0],"Comms Alpha",400],
+ [[2271.72,6331.39,0],"fuel depot",250],
+ [[4166.48,11723.6,0],"The Harbor Remnants",250],
+ [[3432.65,12893.3,0],"The Firing Range",250],
+ [[3870.23,13412.4,0],"The Vehicle Range",300],
+ [[3939.27,13915,0],"The Camp Remnants",250],
+ [[3166.18,11038.8,0],"Belfort Naval Base",500],
+ [[5216.9,3656.3,0],"Chemical Plant",600]
];
OT_NATOregion = "island_5";
OT_NATO_HQ = "Tuvanaka Airbase";
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext
index 0d948383..c7600782 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/description.ext
@@ -2,7 +2,7 @@ overviewPicture = "\ot\campaign\missions\Overthrow.Tanoa\overthrow_tanoa.jpg";
author="ARMAzac";
briefingName = "Overthrow Tanoa";
OnLoadName = "Overthrow Tanoa";
-OnLoadMission = "v0.7.3.5";
+OnLoadMission = "v0.7.4.0-RC1";
loadScreen = "\ot\campaign\missions\Overthrow.Tanoa\pic.jpg";
onLoadMissionTime = 1;
allowSubordinatesTakeWeapons= 1;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/buildingDamaged.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/buildingDamaged.sqf
new file mode 100644
index 00000000..d83de458
--- /dev/null
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/buildingDamaged.sqf
@@ -0,0 +1,24 @@
+params ["_obj","_sel","_dmg"];
+
+if(damage _obj == 1) then {
+ _damaged = owners getVariable ["damagedBuildings",[]];
+ _id = [_obj] call OT_fnc_getBuildID;
+ if !(_id in _damaged) then {
+ _damaged pushback _id;
+ owners setVariable ["damagedBuildings",_damaged,true];
+ _ty = typeof _obj;
+
+ if(_ty == OT_warehouseBuilding) then {
+ format ["Warehouse damaged %1",(getpos _bdg) call BIS_fnc_locationDescription] remoteExec ["OT_fnc_notifyMinor",0,false];
+ };
+ if(_ty == OT_policeStation) then {
+ _town = (getpos _obj) call OT_fnc_nearestTown;
+ _abandoned = server getVariable ["NATOabandoned",[]];
+ server setVariable [format["police%1",_town],0,true];
+ if(_town in _abandoned) then {
+ [_town,-20] call stability;
+ format ["Police station destroyed in %1",_town] remoteExec ["OT_fnc_notifyMinor",0,false];
+ };
+ };
+ };
+};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/placeExplosives.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/placeExplosives.sqf
new file mode 100644
index 00000000..a822c168
--- /dev/null
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/placeExplosives.sqf
@@ -0,0 +1,9 @@
+params ["_exp","_dir","_pitch","_unit"];
+
+if !((side _unit == resistance) or (captive _unit)) exitWith {};
+if(_unit call unitSeen) then {
+ _unit setCaptive false;
+ if((random 100) > 70 and ((typeof _exp) select [0,3] == "IED")) then {
+ [[_exp], -3] call ace_explosives_fnc_scriptedExplosive;
+ };
+};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/playerDisconnect.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/playerDisconnect.sqf
index 9f082aa4..afca2ccd 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/playerDisconnect.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/playerDisconnect.sqf
@@ -18,7 +18,7 @@ if(_me getVariable ["ACE_isUnconscious",false]) then {
_data = [];
{
- if(_x != "ot_loaded" and _x != "owner" and _x != "morale" and _x != "player_uid" and _x != "sa_tow_actions_loaded" and _x != "hiding" and _x != "randomValue" and _x != "saved3deninventory" and (_x select [0,11]) != "MissionData" and (_x select [0,4]) != "ace_" and (_x select [0,4]) != "cba_" and (_x select [0,4]) != "bis_") then {
+ if(_x != "ot_loaded" and _x != "morale" and _x != "player_uid" and _x != "sa_tow_actions_loaded" and _x != "hiding" and _x != "randomValue" and _x != "saved3deninventory" and (_x select [0,11]) != "MissionData" and (_x select [0,4]) != "ace_" and (_x select [0,4]) != "cba_" and (_x select [0,4]) != "bis_") then {
_data pushback [_x,_me getVariable _x];
};
}foreach(allVariables _me);
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/refuel.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/refuel.sqf
index ab7381b4..bd4527ce 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/refuel.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/refuel.sqf
@@ -27,7 +27,7 @@ if((typeof _source) in OT_fuelPumps) then {
if(_money < _total) then {
_nozzle setVariable ["ace_refuel_lastTickMissionTime", nil];
_nozzle setVariable ["ace_refuel_isRefueling", false, true];
- "You cannot afford fuel" remoteExec ["notify_minor",_player];
+ "You cannot afford fuel" remoteExec ["OT_fnc_notifyMinor",_player];
_sink setFuel _last;
}else{
[-_total] remoteExec ["money",_player];
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/somethingDied.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/somethingDied.sqf
index 61c01702..1a18b9ac 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/somethingDied.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/events/somethingDied.sqf
@@ -38,7 +38,7 @@ call {
_idx = _idx + 1;
}foreach(OT_NATOhvts);
OT_NATOhvts deleteAt _idx;
- format["A high-ranking NATO officer has been killed"] remoteExec ["notify_minor",0,false];
+ format["A high-ranking NATO officer has been killed"] remoteExec ["OT_fnc_notifyMinor",0,false];
server setvariable ["NATOresources",0,true];
[_killer,250] call OT_fnc_experience;
};
@@ -59,7 +59,7 @@ call {
[_killer,1500] call rewardMoney;
[_killer,100] call OT_fnc_experience;
- format["The crime leader %1 is dead, camp is cleared",(getpos _me) call BIS_fnc_locationDescription] remoteExec ["notify_minor",0,true];
+ format["The crime leader %1 is dead, camp is cleared",(getpos _me) call BIS_fnc_locationDescription] remoteExec ["OT_fnc_notifyMinor",0,true];
deleteMarker format ["mobster%1",_mobsterid];
};
if(!isNil "_employee") exitWith {
@@ -67,7 +67,7 @@ call {
if(_pop > 0) then {
server setVariable [format["employ%1",_mobsterid],_pop - 1,true];
};
- format["An employee of %1 has died",_employee] remoteExec ["notify_minor",0,false];
+ format["An employee of %1 has died",_employee] remoteExec ["OT_fnc_notifyMinor",0,false];
};
if(!isNil "_mobster") exitWith {
_killer setVariable ["OPFkills",(_killer getVariable ["BLUkills",0])+1,true];
@@ -88,7 +88,7 @@ call {
};
if((random 100) > 50) then {
[_town,1] call stability;
- format["%1 (+1 Stability)",_town] remoteExec ["notify_minor",0,false];
+ format["%1 (+1 Stability)",_town] remoteExec ["OT_fnc_notifyMinor",0,false];
};
_standingChange = 1;
[_killer,10] call rewardMoney;
@@ -97,7 +97,7 @@ call {
if(!isNil "_crimleader") exitWith {
_killer setVariable ["OPFkills",(_killer getVariable ["BLUkills",0])+1,true];
[_town,10] call stability;
- format["%1 (+10 Stability)",_town] remoteExec ["notify_minor",0,false];
+ format["%1 (+10 Stability)",_town] remoteExec ["OT_fnc_notifyMinor",0,false];
_standingChange = 10;
_bounty = server getVariable [format["CRIMbounty%1",_town],0];
@@ -105,15 +105,15 @@ call {
[_killer,_bounty] call rewardMoney;
if(isPlayer _killer) then {
if(isMultiplayer) then {
- format["%1 has claimed the bounty in %2",name _killer,_town] remoteExec ["notify_minor",0,false];
+ format["%1 has claimed the bounty in %2",name _killer,_town] remoteExec ["OT_fnc_notifyMinor",0,false];
}else{
- format["You claimed the bounty in %1",_town] call notify_minor;
+ format["You claimed the bounty in %1",_town] call OT_fnc_notifyMinor;
};
}else{
if(side _killer == west) then {
- format["NATO has removed the bounty in %1",_town] remoteExec ["notify_minor",0,true];
+ format["NATO has removed the bounty in %1",_town] remoteExec ["OT_fnc_notifyMinor",0,true];
}else{
- format["The gang leader in %1 is dead",_town] remoteExec ["notify_minor",0,true];
+ format["The gang leader in %1 is dead",_town] remoteExec ["OT_fnc_notifyMinor",0,true];
};
};
server setVariable [format["CRIMbounty%1",_town],0,true];
@@ -183,7 +183,23 @@ call {
};
};
};
+if(_standingChange != 0) then {
+ {
+ if(captive _x) then {
+ _x setCaptive false;
+ };
+ _x spawn revealToNATO;
+ if(_x isKindOf "AllVehicles") then {
+ {
+ if(captive _x) then {
+ _x setCaptive false;
+ _x spawn revealToNATO;
+ };
+ }foreach(units _x);
+ };
+ }foreach (_me nearObjects 15);
+};
if((_killer call unitSeen) or (_standingChange < -9)) then {
_killer setCaptive false;
if(vehicle _killer != _killer) then {
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf
index 73d7b976..2ab0a07c 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/GUER.sqf
@@ -24,7 +24,7 @@ while {true} do {
spawner setVariable ["track",_track,false];
private _dead = count alldeadmen;
if(_dead > 150) then {
- format["There are %1 dead bodies, loot them or clean via options",_dead] remoteExec ["notify_minor",0,false];
+ format["There are %1 dead bodies, loot them or clean via options",_dead] remoteExec ["OT_fnc_notifyMinor",0,false];
};
{
@@ -77,7 +77,7 @@ while {true} do {
if(_container isEqualTo objNull) then {
_p = _pos findEmptyPosition [0,100,OT_item_CargoContainer];
_container = OT_item_CargoContainer createVehicle _p;
- _container setVariable ["owner",(server getVariable ["generals",[]]) select 0,true];
+ [_container,(server getVariable ["generals",[]]) select 0] call OT_fnc_setOwner;
clearWeaponCargoGlobal _container;
clearMagazineCargoGlobal _container;
clearBackpackCargoGlobal _container;
@@ -110,7 +110,7 @@ while {true} do {
if(_container isEqualTo objNull) then {
_p = _pos findEmptyPosition [0,100,OT_item_CargoContainer];
_container = OT_item_CargoContainer createVehicle _p;
- _container setVariable ["owner",(server getVariable ["generals",[]]) select 0,true];
+ [_container,(server getVariable ["generals",[]]) select 0] call OT_fnc_setOwner;
clearWeaponCargoGlobal _container;
clearMagazineCargoGlobal _container;
clearBackpackCargoGlobal _container;
@@ -137,10 +137,29 @@ while {true} do {
_outnum = round (_outnum * (_inputnum / _intotal));
};
if(_output != "" and _outnum > 0) then {
+ if(_output in ["OT_Sugarcane","ACE_Banana"]) then {
+ _foundFertilizer = false;
+ {
+ _c = _x;
+ {
+ _x params ["_cls","_amt"];
+ if(_cls == "OT_Fertilizer") exitWith {
+ [_c, _cls, 1] call CBA_fnc_removeItemCargo;
+ _foundFertilizer = true;
+ };
+ }foreach(_c call OT_fnc_unitStock);
+ if(_foundFertilizer) exitWith {};
+ }foreach(_pos nearObjects [OT_item_CargoContainer, 50]);
+ if(_foundFertilizer) then {
+ _output = round(_output * 1.5);
+ };
+ };
_container addItemCargoGlobal [_output,_outnum];
};
};
};
+ }else{
+ format["Resistance was unable to pay wages at %1",_x] remoteExec ["OT_fnc_notifyMinor",0,false];
};
};
}foreach(server getVariable ["GEURowned",[]]);
@@ -150,24 +169,36 @@ while {true} do {
_lastmin = date select 4;
_stabcounter = _stabcounter + 1;
+ private _abandoned = server getVariable ["NATOabandoned",[]];
if(_stabcounter >= 10) then {
- private _abandoned = server getVariable ["NATOabandoned",[]];
+
_stabcounter = 0;
{
_town = _x;
+ _townpos = server getvariable _x;
if !(_town in _abandoned) then {
- _townpos = server getvariable _x;
if(_townpos call OT_fnc_inSpawnDistance) then {
_numcops = {side _x == west} count (_townpos nearObjects ["CAManBase",600]);
if(_numcops == 0) then {
[_town,-1] call stability;
};
};
+ }else{
+ _numcops = {side _x == west} count (_townpos nearObjects ["CAManBase",600]);
+ if(_numcops > 0) then {
+ [_town,-1] call stability;
+ };
};
}foreach(OT_allTowns);
};
+ //chemical production
+ if("Chemical Plant" in _abandoned) then {
+ private _chems = server getVariable ["reschems",0];
+ server setVariable ["reschems",_chems + 1,true];
+ };
+
//do factory
if("Factory" in (server getVariable ["GEURowned",[]])) then {
private _currentCls = server getVariable ["GEURproducing",""];
@@ -180,20 +211,20 @@ while {true} do {
};
_b = _base;
if(_base > 240) then {
- _b = 240;
+ _b = 30;
};
if(_base > 10000) then {
- _b = 360;
+ _b = 60;
};
if(_base > 20000) then {
- _b = 480;
+ _b = 120;
};
if(_base > 50000) then {
- _b = 600;
+ _b = 240;
};
- _timetoproduce = _b + (round (_wood+1)) + (round (_steel * 3)) + (round (_plastic * 10));
- if(_timetoproduce > 2880) then {_timetoproduce = 2880};
- if(_timetoproduce < 10) then {_timetoproduce = 10};
+ _timetoproduce = _b + (round (_wood+1)) + (round (_steel * 2)) + (round (_plastic * 5));
+ if(_timetoproduce > 360) then {_timetoproduce = 360};
+ if(_timetoproduce < 5) then {_timetoproduce = 5};
_timespent = server getVariable ["GEURproducetime",0];
_numtoproduce = 1;
@@ -215,13 +246,13 @@ while {true} do {
_p = OT_factoryPos findEmptyPosition [0,100,OT_item_CargoContainer];
if(count _p > 0) then {
_veh = OT_item_CargoContainer createVehicle _p;
- _veh setVariable ["owner",(server getVariable ["generals",[]]) select 0,true];
+ [_veh,(server getVariable ["generals",[]]) select 0] call OT_fnc_setOwner;
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
clearBackpackCargoGlobal _veh;
clearItemCargoGlobal _veh;
}else{
- format["Factory has no room to place container, please clear marker area"] remoteExec["notify_minor",0,false];
+ format["Factory has no room to place container, please clear marker area"] remoteExec["OT_fnc_notifyMinor",0,false];
};
};
_dowood = ["OT_wood",_wood,OT_factoryPos] call OT_fnc_hasFromContainers;
@@ -245,15 +276,15 @@ while {true} do {
_p = OT_factoryVehicleSpawn findEmptyPosition [0,100,_currentCls];
if(count _p > 0) then {
_veh = _currentCls createVehicle _p;
- _veh setVariable ["owner",(server getVariable ["generals",[]]) select 0,true];
+ [_veh,(server getVariable ["generals",[]]) select 0] call OT_fnc_setOwner;
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
clearBackpackCargoGlobal _veh;
clearItemCargoGlobal _veh;
_veh setDir OT_factoryVehicleDir;
- format["Factory has produced %1 x %2",_numtoproduce,_currentCls call ISSE_Cfg_Vehicle_GetName] remoteExec["notify_minor",0,false];
+ format["Factory has produced %1 x %2",_numtoproduce,_currentCls call ISSE_Cfg_Vehicle_GetName] remoteExec["OT_fnc_notifyMinor",0,false];
}else{
- format["Factory has no room to produce %1, please clear the road",_currentCls call ISSE_Cfg_Vehicle_GetName] remoteExec["notify_minor",0,false];
+ format["Factory has no room to produce %1, please clear the road",_currentCls call ISSE_Cfg_Vehicle_GetName] remoteExec["OT_fnc_notifyMinor",0,false];
_timespent = _timetoproduce;
};
}else{
@@ -261,7 +292,7 @@ while {true} do {
if(_veh isEqualTo objNull) then {
_p = OT_factoryPos findEmptyPosition [0,100,OT_item_CargoContainer];
_veh = OT_item_CargoContainer createVehicle _p;
- _veh setVariable ["owner",(server getVariable ["generals",[]]) select 0,true];
+ [_veh,(server getVariable ["generals",[]]) select 0] call OT_fnc_setOwner;
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
clearBackpackCargoGlobal _veh;
@@ -301,27 +332,32 @@ while {true} do {
if(_rank == "PRIVATE" and _xp > (OT_rankXP select 0)) then {
_x set [3,"CORPORAL"];
_unit setRank "CORPORAL";
- format["%1 has been promoted to Corporal",_name select 0] remoteExec ["notify_minor",_player,false];
+ format["%1 has been promoted to Corporal",_name select 0] remoteExec ["OT_fnc_notifyMinor",_player,false];
+ _unit setSkill 0.2 + (random 0.3);
};
if(_rank == "CORPORAL" and _xp > (OT_rankXP select 1)) then {
_x set [3,"SERGEANT"];
_unit setRank "SERGEANT";
- format["%1 has been promoted to Sergeant",_name select 0] remoteExec ["notify_minor",_player,false];
+ format["%1 has been promoted to Sergeant",_name select 0] remoteExec ["OT_fnc_notifyMinor",_player,false];
+ _unit setSkill 0.3 + (random 0.3);
};
if(_rank == "SERGEANT" and _xp > (OT_rankXP select 2)) then {
_x set [3,"LIEUTENANT"];
_unit setRank "LIEUTENANT";
- format["%1 has been promoted to Lieutenant",_name select 0] remoteExec ["notify_minor",_player,false];
+ format["%1 has been promoted to Lieutenant",_name select 0] remoteExec ["OT_fnc_notifyMinor",_player,false];
+ _unit setSkill 0.5 + (random 0.3);
};
if(_rank == "LIEUTENANT" and _xp > (OT_rankXP select 3)) then {
_x set [3,"CAPTAIN"];
_unit setRank "CAPTAIN";
- format["%1 has been promoted to Captain",_name select 0] remoteExec ["notify_minor",_player,false];
+ format["%1 has been promoted to Captain",_name select 0] remoteExec ["OT_fnc_notifyMinor",_player,false];
+ _unit setSkill 0.6 + (random 0.3);
};
if(_rank == "CAPTAIN" and _xp > (OT_rankXP select 4)) then {
_x set [3,"MAJOR"];
_unit setRank "MAJOR";
- format["%1 has been promoted to Major",_name select 0] remoteExec ["notify_minor",_player,false];
+ format["%1 has been promoted to Major",_name select 0] remoteExec ["OT_fnc_notifyMinor",_player,false];
+ _unit setSkill 0.8 + (random 0.2);
};
};
}foreach(server getVariable ["recruits",[]]);
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf
index 1cc59746..8e1815dc 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/factions/NATO.sqf
@@ -1,474 +1,566 @@
if (!isServer) exitwith {};
-private ["_name","_pos","_garrison","_need","_townPos","_current","_stability","_police","_civ","_units","_move","_NATObusy","_abandoned"];
-
-OT_NATOobjectives = [];
-OT_NATOcomms = [];
-
-
-private _NATObusy = false;
private _abandoned = [];
+private _resources = 0;
private _diff = server getVariable ["OT_difficulty",1];
-OT_NATOobjectives = server getVariable ["NATOobjectives",[]];
-OT_NATOcomms = server getVariable ["NATOcomms",[]];
-OT_NATOhvts = server getVariable ["NATOhvts",[]];
-OT_allObjectives = [];
-OT_allComms = [];
-
-if((server getVariable "StartupType") == "NEW" or (server getVariable ["NATOversion",0]) < OT_NATOversion) then {
- diag_log "Overthrow: Generating NATO";
- server setVariable ["NATOversion",OT_NATOversion,false];
- _abandoned = server getVariable ["NATOabandoned",[]];
-
- (OT_loadingMessages call BIS_fnc_selectRandom) remoteExec['blackFaded',0,false];
- sleep 0.1;
- {
- _stability = server getVariable format ["stability%1",_x];
- if(_stability < 11 and !(_x in _abandoned)) then {
- _abandoned pushback _x;
- };
- }foreach (OT_allTowns);
- server setVariable ["NATOabandoned",_abandoned,true];
- server setVariable ["garrisonHQ",1000,false];
- OT_NATOobjectives = [];
- OT_NATOcomms = [];
- OT_NATOhvts = [];
- server setVariable ["NATOobjectives",OT_NATOobjectives,false];
- server setVariable ["NATOcomms",OT_NATOcomms,false];
- server setVariable ["NATOhvts",OT_NATOhvts,false];
-
- _numHVTs = 6;
- if(_diff == 0) then {_numHVTs = 4};
- if(_diff == 2) then {_numHVTs = 8};
-
- //Find military objectives
- {
- _x params ["_pos","_name"];
- if !(_name in _abandoned) then {
- OT_NATOobjectives pushBack [_pos,_name];
- server setVariable [format ["vehgarrison%1",_name],[],true];
-
- _garrison = floor(4 + random(8));
- if(_name in OT_NATO_priority or _name in OT_allAirports) then {
- _garrison = floor(16 + random(8));
- server setVariable [format ["vehgarrison%1",_name],["B_T_APC_Tracked_01_AA_F","B_HMG_01_high_F","B_HMG_01_high_F","B_GMG_01_high_F"],true];
- };
- if(_name == OT_NATO_HQ) then {
- _garrison = 48;
- server setVariable [format ["vehgarrison%1",_name],["B_T_APC_Tracked_01_AA_F","B_T_APC_Tracked_01_AA_F","B_GMG_01_high_F","B_GMG_01_high_F","B_GMG_01_high_F","B_HMG_01_high_F","B_HMG_01_high_F","B_HMG_01_high_F"],true];
- server setVariable [format ["airgarrison%1",_name],[OT_NATO_Vehicle_AirTransport_Large],true];
- }else{
- server setVariable [format ["airgarrison%1",_name],[],true];
- };
- server setVariable [format ["garrison%1",_name],_garrison,true];
-
- if(_name == OT_NATO_HQ) then {
- OT_NATO_HQPos = _pos;
- };
-
- sleep 0.05;
-
- }else{
- OT_NATOobjectives pushBack [_pos,_name];
- };
- }foreach (OT_objectiveData + OT_airportData);
-
- _count = 0;
- _done = [];
- while {_count < _numHVTs} do {
- _ob = selectRandom (OT_NATOobjectives - ([[OT_NATO_HQ,OT_NATO_HQPos]] + _done));
- _name = _ob select 1;
- _done pushback _ob;
- _id = format["%1%2",_name,round(random 99999)];
- OT_NATOhvts pushback [_id,_name,""];
- _count = _count + 1;
- };
-
- (OT_loadingMessages call BIS_fnc_selectRandom) remoteExec['blackFaded',0];
- sleep 0.1;
- //Add comms towers
- {
- _x params ["_pos","_name"];
- OT_NATOcomms pushBack [_pos,_name];
- _garrison = floor(4 + random(4));
- server setVariable [format ["garrison%1",_name],_garrison,true];
- }foreach (OT_commsData);
-
- server setVariable ["NATOobjectives",OT_NATOobjectives,true];
- server setVariable ["NATOcomms",OT_NATOcomms,true];
- server setVariable ["NATOhvts",OT_NATOhvts,true];
- diag_log "Overthrow: Distributing NATO vehicles";
- //Randomly distribute NATO's vehicles
- {
- _type = _x select 0;
- _num = _x select 1;
- _count = 0;
- while {_count < _num} do {
- _obj = OT_NATOobjectives call BIS_fnc_selectRandom;
- _name = _obj select 1;
- _garrison = server getVariable format["vehgarrison%1",_name];
- _garrison pushback _type;
- _count = _count + 1;
- server setVariable [format ["vehgarrison%1",_name],_garrison,true];
- };
- }foreach(OT_NATO_Vehicles_Garrison);
-
- {
- _type = _x select 0;
- _num = _x select 1;
- _count = 0;
- while {_count < _num} do {
- _name = OT_allAirports call BIS_fnc_selectRandom;
- _garrison = server getVariable [format["airgarrison%1",_name],[]];
- _garrison pushback _type;
- _count = _count + 1;
- server setVariable [format ["airgarrison%1",_name],_garrison,true];
- };
- }foreach(OT_NATO_Vehicles_AirGarrison);
- diag_log "Overthrow: Setting up NATO checkpoints";
- {
- _garrison = floor(8 + random(6));
- if(_x in OT_NATO_priority) then {
- _garrison = floor(12 + random(6));
- };
- //_x setMarkerText format ["%1",_garrison];
- _x setMarkerAlpha 0;
- server setVariable [format ["garrison%1",_x],_garrison,true];
- sleep 0.05;
- }foreach (OT_NATO_control);
- diag_log "Overthrow: Garrisoning towns";
- {
- _town = _x;
- _garrison = 0;
- _stability = server getVariable format ["stability%1",_town];
- _population = server getVariable format ["population%1",_town];
- if(_stability > 10) then {
- _max = round(_population / 30);
- if(_max < 4) then {_max = 4};
- _garrison = 2+round((1-(_stability / 100)) * _max);
- if(_town in OT_NATO_priority) then {
- _garrison = round(_garrison * 2);
- };
- };
- server setVariable [format ["garrison%1",_x],_garrison,true];
- sleep 0.05;
- }foreach (OT_allTowns);
-};
-diag_log "Overthrow: NATO Init Done";
-
-OT_NATOInitDone = true;
-publicVariable "OT_NATOInitDone";
-
-{
- _pos = _x select 0;
- _name = _x select 1;
- _mrk = createMarker [_name,[_pos,25,270] call BIS_fnc_relPos];
- _mrk setMarkerShape "ICON";
- if(_name in (server getVariable "NATOabandoned")) then {
- _mrk setMarkerType "flag_Tanoa";
- }else{
- _mrk setMarkerType "flag_NATO";
- };
+private _nextturn = 3;
+private _count = 0;
- server setVariable [_name,_pos,true];
-
- OT_allObjectives pushback _name;
-}foreach(OT_NATOobjectives);
-
-publicVariable "OT_allObjectives";
-
-{
- _pos = _x select 0;
- _name = _x select 1;
- _mrk = createMarker [_name,_pos];
- _mrk setMarkerShape "ICON";
- _mrk setMarkerType "loc_Transmitter";
- if(_name in (server getVariable "NATOabandoned")) then {
- _mrk setMarkerColor "ColorGUER";
- }else{
- _mrk setMarkerColor "ColorBLUFOR";
- };
- server setVariable [_name,_pos,true];
- OT_allComms pushback _name;
- OT_allObjectives pushback _name;
-}foreach(OT_NATOcomms);
server setVariable ["NATOattacking","",true];
server setVariable ["NATOattackstart",0,true];
-sleep OT_NATOwait + round(random OT_NATOwait);
+private _lastmin = date select 4;
+private _lastsched = -1;
-while {true} do {
- _garrisoned = false;
- _numplayers = count([] call CBA_fnc_players);
- _resources = server getVariable ["NATOresources",1000];
- _resourceGain = server getVariable ["NATOresourceGain",0];
-
- if(_numplayers > 0) then {
- diag_log format["Overthrow: NATO turn @ %1",time];
- _abandoned = server getVariable "NATOabandoned";
+sleep 100 + (random 300);
+OT_nextNATOTurn = time+(_nextturn * 10);
+publicVariable "OT_nextNATOTurn";
- private _currentAttack = server getVariable ["NATOattacking",""];
- private _currentAttackStart = server getVariable ["NATOattackstart",0];
- if(_currentAttack != "" and (time - _currentAttackStart) > 2400) then {
- server setVariable ["NATOattacking","",true];
- _currentAttack = "";
- {
- if(side _x == west) then {
- _lead = (units _x) select 0;
- if((_lead getVariable ["garrison",""]) == "HQ") then {
- if((vehicle _lead) != _lead) then {
- [vehicle _lead] spawn OT_fnc_cleanup;
+while {sleep 10;true} do {
+ private _numplayers = count([] call CBA_fnc_players);
+ if(_numplayers > 0) then {
+ _fobs = server getVariable ["NATOfobs",[]];
+ _abandoned = server getVariable ["NATOabandoned",[]];
+ _resources = server getVariable ["NATOresources",2000];
+ private _countered = (server getVariable ["NATOattacking",""]) != "";
+ _knownTargets = spawner getVariable ["NATOknownTargets",[]];
+ _schedule = server getVariable ["NATOschedule",[]];
+
+ //scheduler
+
+ if(_lastmin != (date select 4)) then {
+ _lastmin = date select 4;
+ if(count _schedule > 0) then {
+ _item = [];
+ if((_lastsched == -1 or _lastsched == 0) and _lastmin >= 30) then {
+ _lastsched = 30;
+ _item = _schedule select 0;
+ }else{
+ if((_lastsched == -1 or _lastsched == 30) and _lastmin < 30) then {
+ _lastsched = 0;
+ _item = _schedule select 0;
+ };
+ };
+ if(count _item > 0) then {
+ _schedule deleteAt 0;
+ _item params ["_mission","_p1","_p2"];
+ if(_mission == "DESTROY") then {
+ [_p2] spawn OT_fnc_NATOMissionReconDestroy;
+ };
+ if(_mission == "CONVOY") then {
+ _vehtypes = [];
+ _numveh = round(random 2) + 2;
+ _count = 0;
+ while {_count < _numveh} do {
+ _count = _count + 1;
+ _vehtypes pushback (selectRandom OT_NATO_Vehicles_Convoy);
};
- [_x] spawn OT_fnc_cleanup;
+ [_vehtypes,[],_p1 select 1,_p2 select 1] spawn OT_fnc_NATOConvoy;
};
- }
- }foreach(allgroups);
- };
-
- if(_currentAttack == "") then {
- _resources = _resources + _resourceGain + ((count _abandoned) * 25);
- diag_log format["Overthrow: NATO resources @ %1",_resources];
- }else{
- diag_log format["Overthrow: NATO still attacking %1",_currentAttack];
+ };
+ };
};
- if(_currentAttack != "") then {
- _garrisoned = true;
- };
- //Objective response
- if !(_garrisoned) then {
+ //Objective QRF and drone intel reports
+ if !(_countered) then {
{
- _pos = _x select 0;
- _name = _x select 1;
+ _x params ["_pos","_name","_cost"];
if !(_name in _abandoned) then {
if(_pos call OT_fnc_inSpawnDistance) then {
- _nummil = {side _x == west} count (_pos nearObjects ["CAManBase",300]);
- _numres = {side _x == resistance or captive _x} count (_pos nearObjects ["CAManBase",200]);
- if(_nummil < 3 and _numres > 0) then {
- _garrisoned = true;
+ _nummil = {side _x == west} count (_pos nearObjects ["CAManBase",500]);
+ _numres = {side _x == resistance or captive _x} count (_pos nearObjects 500);
+ if(_nummil < _numres) then {
+ _countered = true;
server setVariable ["NATOattacking",_name,true];
server setVariable ["NATOattackstart",time,true];
diag_log format["Overthrow: NATO responding to %1",_name];
- [_name,_resources] spawn OT_fnc_NATOResponseObjective;
+ if(_resources < _cost) then {_cost = _resources};
+ [_name,_cost] spawn OT_fnc_NATOResponseObjective;
_name setMarkerAlpha 1;
- _resources = 0;
+ _resources = _resources - _cost;
};
};
+ //Drone intel report
+ _drone = spawner getVariable [format["drone%1",_name],objNull];
+ if((!isNull _drone) and alive _drone) then {
+ _intel = _drone getVariable ["OT_seenTargets",[]];
+ {
+ _added = false;
+ _x params ["_ty","_pos","_pri","_obj"];
+ _rem = [];
+ {
+ _o = _x select 3;
+ if (_o isEqualTo _obj) then {
+ _added = true;
+ };
+ }foreach(_knownTargets);
+
+ if !(_added) then {
+ _knownTargets pushback [_ty,_pos,_pri,_obj,false,time];
+ };
+ }foreach(_intel);
+ _drone setVariable ["OT_seenTargets",[]];
+ };
};
- if(_garrisoned) exitWith {};
- }foreach(OT_NATOobjectives);
+ if(_countered) exitWith {};
+ }foreach(OT_objectiveData + OT_airportData);
};
- if !(_garrisoned) then {
+
+ //Town QRF (over 50 pop)
+ if !(_countered) then {
+ _sorted = [OT_allTowns,[],{server getvariable format["population%1",_x]},"DESCEND"] call BIS_fnc_SortBy;
{
_town = _x;
- _townPos = server getVariable _town;
- _current = server getVariable format ["garrison%1",_town];;
+ _pos = server getVariable _town;
_stability = server getVariable format ["stability%1",_town];
_population = server getVariable format ["population%1",_town];
- if(_stability > 10 and !(_town in _abandoned)) then {
- _max = round(_population / 40);
- if(_max < 4) then {_max = 4};
- _garrison = 2+round((1-(_stability / 100)) * _max);
- if(_town in OT_NATO_priority) then {
- _garrison = round(_garrison * 2);
- };
- _need = _garrison - _current;
- if(_need < 0) then {_need = 0};
- if(_need > 1 and _resources >= 20) then {
- _resources = _resources - 20;
- _x spawn reGarrisonTown;
+ if(_pos call OT_fnc_inSpawnDistance) then {
+ if(_population > 50 and _stability < 10 and !(_town in _abandoned)) then {
+ server setVariable [format ["garrison%1",_town],0,true];
+ diag_log format["Overthrow: NATO responding to %1",_town];
+ _strength = _population;
+ if(_population > _resources) then {_strength = _resources};
+ [_town,_strength] spawn OT_fnc_NATOResponseTown;
+ server setVariable ["NATOattacking",_town,true];
+ server setVariable ["NATOattackstart",time,true];
+ _countered = true;
+ _resources = _resources - _strength;
};
};
- }foreach (OT_allTowns);
+ if(_countered) exitWith {};
+ }foreach (_sorted);
};
+
+ //Abandon towers
{
- _town = _x;
- _stability = server getVariable format ["stability%1",_town];
- _population = server getVariable format ["population%1",_town];
- if(_population < 50) then {
- if(_stability < 10 and !(_town in _abandoned)) then {
- _abandoned pushback _town;
- server setVariable [format ["garrison%1",_town],0,true];
- format["NATO has abandoned %1",_town] remoteExec ["notify_good",0,false];
- [_town,15] call stability;
+ _pos = _x select 0;
+ _name = _x select 1;
+ if !(_name in _abandoned) then {
+ if(_pos call OT_fnc_inSpawnDistance) then {
+ _nummil = {side _x == west} count (_pos nearObjects ["CAManBase",300]);
+ _numres = {side _x == resistance or captive _x} count (_pos nearObjects ["CAManBase",100]);
+ if(_nummil < _numres) then {
+ _abandoned pushback _name;
+ server setVariable ["NATOabandoned",_abandoned,true];
+ _name setMarkerColor "ColorGUER";
+ _t = _pos call OT_fnc_nearestTown;
+ format["Resistance has captured the %1 tower",_name] remoteExec ["notify_good",0,false];
+ _resources = _resources - 100;
+ _countered = true;
+ };
};
};
- }foreach (OT_allTowns);
+ if(_countered) exitWith {};
+ }foreach(OT_NATOcomms);
- //Town response
- if !(_garrisoned) then {
- _sorted = [OT_allTowns,[],{server getvariable format["population%1",_x]},"DESCEND"] call BIS_fnc_SortBy;
+
+ //Check on FOBs
+ _clearedFOBs = [];
+ {
+ _x params ["_pos","_garrison"];
+ _nummil = {side _x == west} count (_pos nearObjects ["CAManBase",300]);
+ _numres = {side _x == resistance or captive _x} count (_pos nearObjects 50);
+ if(_nummil == 0 and _numres > 0) then {
+ _clearedFOBs pushback _x;
+ "Cleared NATO FOB" remoteExec ["OT_fnc_notifyMinor",0,false];
+ _flag = _pos nearobjects [OT_flag_NATO,50];
+ if(count _flag > 0) then{
+ deleteVehicle (_flag select 0);
+ };
+ };
+ }foreach(_fobs);
+
+ {
+ _fobs deleteAt (_fobs find _x);
+ }foreach(_clearedFOBs);
+
+
+ if(_count >= _nextturn and !_countered) then {
+ OT_lastNATOTurn = time;
+ publicVariable "OT_lastNATOTurn";
+ _resourceGain = server getVariable ["NATOresourceGain",0];
+ _abandonedSomething = false;
+ //NATO turn
+ _nextturn = OT_NATOwait + random OT_NATOwait;
+ OT_nextNATOTurn = time+(_nextturn * 10);
+ publicVariable "OT_nextNATOTurn";
+
+ _count = 0;
+ _chance = 98;
+ _gain = 25;
+ _mul = 25;
+ if(_diff > 1) then {_gain = 75;_mul = 50};
+ if(_diff < 1) then {_gain = 0;_mul = 15};
+
+ //expire targets
+ private _expired = [];
+ {
+ if((_x select 4) or (time - (_x select 5)) > 2400) then {
+ _expired pushback _x;
+ };
+ }foreach(_knownTargets);
+ {
+ _knownTargets deleteAt (_knownTargets find _x);
+ }foreach(_expired);
+
+ //Recover resources
+ _resources = _resources + _gain + _resourceGain + ((count _abandoned) * _mul);
+
+ //Abandon towns (under 50 pop) and counter
+ _lastcounter = server getVariable ["NATOlastcounter",""];
{
_town = _x;
+ _pos = server getVariable _town;
_stability = server getVariable format ["stability%1",_town];
_population = server getVariable format ["population%1",_town];
- if(_population > 50 and _stability < 10 and !(_town in _abandoned) and (_resources >= _population)) exitWith {
- server setVariable [format ["garrison%1",_town],0,true];
- diag_log format["Overthrow: NATO responding to %1",_town];
- [_town,_population] spawn OT_fnc_NATOResponseTown;
- server setVariable ["NATOattacking",_town,true];
- server setVariable ["NATOattackstart",time,true];
- _garrisoned = true;
- _resources = _resources - _population;
+ if(_pos call OT_fnc_inSpawnDistance) then {
+ _nummil = {side _x == west} count (_pos nearObjects ["CAManBase",300]);
+ _numres = {side _x == resistance or captive _x} count (_pos nearObjects 200);
+ if(_nummil < 3 and _numres > 0) then {
+ if(_population < 50) then {
+ if(_stability < 10 and !(_town in _abandoned)) then {
+ //Abandon a town
+ _abandoned pushback _town;
+ server setVariable [format ["garrison%1",_town],0,true];
+ format["NATO has abandoned %1",_town] remoteExec ["notify_good",0,false];
+ [_town,15] call stability;
+ _abandonedSomething = true;
+ };
+ }else{
+ if(_town != _lastcounter) then {
+ if((_town in _abandoned) and (_resources > _population) and (random 100) > 99) then {
+ //Counter a town
+ [_town,_population] spawn OT_fnc_NATOCounterTown;
+ server setVariable ["NATOlastcounter",_town,true];
+ server setVariable ["NATOattacking",_town,true];
+ server setVariable ["NATOattackstart",time,true];
+ _resources = _resources - _population;
+ _countered = true;
+ };
+ };
+ };
+ };
+ }else{
+ if(_population < 50) then {
+ if(_stability == 0 and !(_town in _abandoned)) then {
+ //Abandon a town
+ _abandoned pushback _town;
+ server setVariable [format ["garrison%1",_town],0,true];
+ format["NATO has abandoned %1",_town] remoteExec ["notify_good",0,false];
+ _abandonedSomething = true;
+ };
+ };
};
- }foreach (_sorted);
- };
+ if(_abandonedSomething or _countered) exitWith {};
+ }foreach (OT_allTowns);
- //Objective counter-attacks
- if (!(_garrisoned) and count(_abandoned) > 2 and (_resources > 1000) and (random 100) > 95) then {
- _highest = 0;
- _high = 0;
- private _sorted = [OT_NATOobjectives,[],{(_x select 0) distance OT_NATO_HQPos},"ASCEND"] call BIS_fnc_SortBy;
+ //Spawn missing drones & counter objectives
{
- _x params ["_pos","_name"];
- if(_name != server getVariable ["NATOlastcounter",""]) then {
- if(_name in _abandoned) exitWith {
- diag_log format["Overthrow: NATO beginning attack on %1",_name];
- [_name,_resources] spawn OT_fnc_NATOCounterObjective;
- server setVariable ["NATOlastcounter",_name,true];
- server setVariable ["NATOattacking",_name,true];
- server setVariable ["NATOattackstart",time,true];
- _resources = 0;
- _garrisoned = true;
- };
+ _x params ["_pos","_name","_pri"];
+ if((_name != _lastcounter) and (_name in _abandoned) and (_resources > _pri) and (random 100) > 99) exitWith {
+ //Counter an objective
+
+ [_name,_pri] spawn OT_fnc_NATOCounterObjective;
+ server setVariable ["NATOlastcounter",_name,true];
+ server setVariable ["NATOattacking",_name,true];
+ server setVariable ["NATOattackstart",time,true];
+ _countered = true;
+ _resources = _resources - _pri;
};
- }foreach (_sorted);
- };
- //Town counter-attacks
- if (!(_garrisoned) and count(_abandoned) > 5 and (_resources > 1000) and (random 100) > 98) then {
- _highest = 0;
- _high = 0;
- {
- if(_x != server getVariable ["NATOlastcounter",""]) then {
- _pop = server getVariable[format["population%1",_x],0];
- if(_pop > 0 and _pop > _high) then {
- _high = _pop;
- _highest = _x;
+ if !(_name in _abandoned) then {
+ _drone = spawner getVariable [format["drone%1",_name],objNull];
+ if((isNull _drone or !alive _drone) and _resources > 10) then {
+ _targets = [];
+ {
+ _town = _x;
+ _p = server getVariable _town;
+ if((_p distance _pos) < 3000) then {
+ _stability = server getVariable format["stability%1",_town];
+ if((_town in _abandoned) or (_stability < 50)) then {
+ _targets pushback _p;
+ };
+ };
+ }foreach(OT_allTowns);
+
+ {
+ _x params ["_p","_name"];
+ if((_p distance _pos) < 3000) then {
+ if (_name in _abandoned) then {
+ _targets pushback _p;
+ };
+ };
+ }foreach(OT_NATOobjectives + OT_NATOcomms);
+
+ {
+ _x params ["_ty","_p"];
+ if((_ty == "FOB") and (_p distance _pos) < 3000) then {
+ _targets pushback _p;
+ };
+ }foreach(_knownTargets);
+
+ if(count _targets > 0) then {
+ _targets = [_targets,[],{random 100},"ASCEND"] call BIS_fnc_sortBy;
+ _group = createGroup blufor;
+ _p = [_pos,0,0,false,[0,0],[100,OT_NATO_Vehicles_ReconDrone]] call SHK_pos;
+ _drone = createVehicle [OT_NATO_Vehicles_ReconDrone, _p, [], 0,""];
+
+ createVehicleCrew _drone;
+ {
+ [_x] joinSilent _group;
+ }foreach(crew _drone);
+
+
+ spawner setVariable [format["drone%1",_name],_drone,false];
+ _resources = _resources - 10;
+
+ {
+ _wp = _group addWaypoint [_x,300];
+ _wp setWaypointType "MOVE";
+ _wp setWaypointBehaviour "COMBAT";
+ _wp setWaypointSpeed "FULL";
+ _wp setWaypointTimeout [20,45,60];
+ }foreach(_targets);
+
+ _wp = _group addWaypoint [_pos,300];
+ _wp setWaypointType "MOVE";
+ _wp setWaypointBehaviour "COMBAT";
+ _wp setWaypointSpeed "FULL";
+ _wp setWaypointTimeout [10,20,60];
+
+ _wp = _group addWaypoint [_pos,0];
+ _wp setWaypointType "CYCLE";
+
+ {
+ _x addCuratorEditableObjects [[_drone]];
+ }foreach(allCurators);
+
+ _drone spawn OT_fnc_initDrone;
+ };
};
};
- }foreach (_abandoned);
- if(_high > 0) then {
- diag_log format["Overthrow: NATO beginning attack on %1",_highest];
- [_highest,_resources] spawn OT_fnc_NATOCounterTown;
- server setVariable ["NATOlastcounter",_name,true];
- server setVariable ["NATOattacking",_highest,true];
- server setVariable ["NATOattackstart",time,true];
- _resources = 0;
- _garrisoned = true;
+ if(_resources <= 0) exitWith {_resources = 0};
+ }foreach(OT_objectiveData + OT_airportData);
+
+ //Decide on spend
+ _spend = 0;
+ if(_resources > 500) then {
+ _spend = 500;
+ };
+ if(_resources > 1000) then {
+ _spend = 800;
+ _chance = 95;
+ };
+ if(_resources > 1500) then {
+ _spend = 1200;
+ _chance = 90;
+ };
+ if(_resources > 2500) then {
+ _spend = 1500;
+ _chance = 80;
};
- };
- //HVT Convoys
- if (!(_garrisoned) and (_resources > 200) and (random 100) > 96) then {
- _highest = 0;
- _high = 0;
- //Move a random HVT somewhere
- _hvt = selectRandom OT_NATOhvts;
- _hvt params ["_id","_loc","_status"];
- _dest = selectRandom OT_NATOobjectives;
- if(_status == "" and (_dest select 1) != _loc) then {
- _frompos = server getVariable _loc;
- _times = 0;
- _do = true;
- while {!([_frompos,_dest select 0] call OT_fnc_regionIsConnected)} do {
- _dest = selectRandom OT_NATOobjectives;
- _times = _times + 1;
- if(_times > 50) exitWith {_do = false};
+ if(!(spawner getVariable ["NATOdeploying",false]) and (_spend > 500) and (count _fobs) < 3 and (random 100) > _chance) then {
+ //Deploy an FOB
+ _lowest = "";
+ {
+ _stability = server getVariable [format["stability%1",_x],100];
+ if((_x in _abandoned) or _stability < 50) exitWith {
+ _lowest = _x;
+ };
+ }foreach([OT_allTowns,[],{random 100},"DESCEND"] call BIS_fnc_sortBy);
+ if(_lowest != "") then {
+ _townPos = (server getVariable _lowest);
+ _pp = [_townPos,random 360,2000] call SHK_pos;
+ _gotpos = [];
+ {
+ _pos = _x select 0;
+ _pos set [2,0];
+ _bb = _pos call OT_fnc_nearestObjective;
+ _bpos = _bb select 0;
+
+ _near = false;
+ {
+ _pb = _x select 0;
+ if(_pb distance _pos < 500) then {
+ _near = true;
+ };
+ }foreach(_fobs);
+
+ if(!_near and (_pos distance _bpos) > 400 and (_pos distance _townPos) > 250) exitWith {
+ _gotpos = _pos;
+ };
+ }foreach (selectBestPlaces [_pp, 1000,"(1 - forest - trees) * (1 - houses) * (1 - sea)",5,4]);
+ if(count _gotpos > 0) then {
+ _spend = _spend - 500;
+ _resources = _resources - 500;
+ spawner setVariable ["NATOdeploying",true,false];
+ [_gotpos] spawn OT_fnc_NATOMissionDeployFOB;
+ };
};
- if (_do) then {
- diag_log format["Overthrow: NATO moving a HVT from %1 to %2",_loc,_dest select 1];
- [[],[_hvt],_loc,_dest select 1] spawn OT_fnc_NATOConvoy;
- _resources = _resources - 200;
- _garrisoned = true;
+ };
+
+ if(_spend >= 20) then {
+ {
+ _town = _x;
+ _townPos = server getVariable _town;
+ _current = server getVariable format ["garrison%1",_town];;
+ _stability = server getVariable format ["stability%1",_town];
+ _population = server getVariable format ["population%1",_town];
+ if(_stability > 10 and !(_town in _abandoned)) then {
+ _max = round(_population / 40);
+ if(_max < 4) then {_max = 4};
+ _garrison = 2+round((1-(_stability / 100)) * _max);
+ if(_town in OT_NATO_priority) then {
+ _garrison = round(_garrison * 2);
+ };
+ _need = _garrison - _current;
+ if(_need < 0) then {_need = 0};
+ if(_need > 1 and _spend >= 20) then {
+ _spend = _spend - 20;
+ _resources = _resources - 20;
+ _x spawn reGarrisonTown;
+ };
+ };
+ if(_spend < 20) exitWith {};
+ }foreach ([OT_allTowns,[],{random 100},"DESCEND"] call BIS_fnc_sortBy);
+ };
+
+ //Schedule some missions
+ if(_spend > 0) then {
+ _targets = [_knownTargets,[],{_x select 2},"DESCEND"] call BIS_fnc_sortBy;
+ {
+ _x params ["_ty","_pos","_pri","_obj","_done"];
+ if !(_done) then {
+ if(_ty == "WH" or _ty == "PS" or _ty == "WS") then {
+ if(_spend > 250 and (random 100) > _chance) then {
+ _schedule pushback ["DESTROY",_ty,_pos];
+ _spend = _spend - 250;
+ _resources = _resources -250;
+ _x set [4,true];
+ };
+ };
+ };
+ }foreach(_targets);
+ if(_spend > 500 and (random 100) > _chance) then {
+ _low = 50;
+ _lowest = "";
+ {
+ _stability = server getVariable [format["stability%1",_x],100];
+ if(!(_x in _abandoned) and _stability < _low) exitWith {
+ _lowest = _x;
+ };
+ }foreach([OT_allTowns,[],{random 100},"DESCEND"] call BIS_fnc_sortBy);
+
+ if(_lowest == "") then {
+ //Could not find NATO controlled town under 50% stability, looking for resistance-controlled town above 50%
+ {
+ _stability = server getVariable [format["stability%1",_x],100];
+ if((_x in _abandoned) and _stability > _low) exitWith {
+ _lowest = _x;
+ };
+ }foreach([OT_allTowns,[],{random 100},"DESCEND"] call BIS_fnc_sortBy);
+ };
+
+ if(_lowest != "") then {
+ _townPos = server getVariable _lowest;
+ _start = ([OT_NATOobjectives,[],{(_x select 0) distance _townPos},"ASCEND"] call BIS_fnc_SortBy) select 0;
+ _startName = _start select 1;
+ _startPos = _start select 0;
+ _end = [];
+ {
+ _x params ["_p","_n"];
+ if((_n != _startName) and !(_n in _abandoned) and ([_p,_startPos] call OT_fnc_regionIsConnected)) exitWith {
+ _end = _x;
+ };
+ }foreach([OT_NATOobjectives,[],{random 100},"DESCEND"] call BIS_fnc_sortBy);
+ if(count _end > 0) then {
+ //Schedule a convoy
+ _spend = _spend - 500;
+ _resources = _resources - 500;
+ _schedule pushback ["CONVOY",_start,_end];
+ };
+ };
};
};
- };
- //Radio tower counter-attacks
- if (!(_garrisoned) and count(_abandoned) > 2 and (_resources > 200) and (random 100) > 90) then {
- _highest = 0;
- _high = 0;
- private _sorted = [OT_NATOcomms,[],{(_x select 0) distance OT_NATO_HQPos},"ASCEND"] call BIS_fnc_SortBy;
+ //Upgrade garrisons
{
- _x params ["_pos","_name"];
- if(_pos in _abandoned) exitWith {
- diag_log format["Overthrow: NATO sending recon team to %1",_name];
- _pos spawn OT_fnc_NATOSupportRecon;
- _resources = _resources - 200;
- _garrisoned = true;
+ _x params ["_pos","_name","_pri"];
+ if !(_name in _abandoned) then {
+ _garrison = server getvariable [format["garrison%1",_name],0];
+ _max = 8;
+ if(_pri > 300) then {
+ _max = 12;
+ };
+ if(_pri > 800) then {
+ _max = 24;
+ };
+ if(_pri > 1200) then {
+ _max = 32;
+ };
+ if(!(_pos call OT_fnc_inSpawnDistance) and (_garrison < _max) and (_spend > 150) and (random 100 > _chance)) then {
+ server setvariable [format["garrison%1",_name],_garrison+4,true];
+ _spend = _spend - 150;
+ _resources = _resources - 150;
+ };
};
- }foreach (_sorted);
- };
+ }foreach(OT_NATOobjectives);
- {
- _x params ["_pos","_name"];
- _alive = 0;
- _enemy = 0;
+ //Upgrade FOBs
{
- if((side _x == west) and (alive _x) and ((_x getVariable ["garrison",""]) == "HQ")) then {
- _alive = _alive + 1;
+ _x params ["_pos","_garrison","_upgrades"];
+ _max = 16;
+ if((_garrison < _max) and (_spend > 150) and (random 100 > _chance)) exitWith {
+ _x set [1,_garrison + 4];
+ _spend = _spend - 150;
+ _resources = _resources - 150;
+ _group = creategroup blufor;
+ _count = 0;
+ while {_count < 4} do {
+ _start = [[[_pos,50]]] call BIS_fnc_randomPos;
+
+ _civ = _group createUnit [OT_NATO_Units_LevelOne call BIS_fnc_selectRandom, _start, [],0, "NONE"];
+ _civ setVariable ["garrison","HQ",false];
+ _civ setRank "LIEUTENANT";
+ _civ setVariable ["VCOM_NOPATHING_Unit",true,false];
+ _civ setBehaviour "SAFE";
+
+ _count = _count + 1;
+ };
+ _group call OT_fnc_initMilitaryPatrol;
};
- if((side _x == resistance) and (alive _x) and !(_x getvariable ["ace_isunconscious",false])) then {
- _enemy = _enemy + 1;
+ if(!("Mortar" in _upgrades) and (_spend > 300) and (random 100 > _chance)) exitWith {
+ _spend = _spend - 300;
+ _resources = _resources - 300;
+ _upgrades pushback "Mortar";
+ [_pos,["Mortar"]] spawn OT_fnc_NATOupgradeFOB;
};
- }foreach(_pos nearEntities ["CAManBase",50]);
- if(_alive > 1 and _enemy == 0) then {
- _abandoned deleteAt (_abandoned find _name);
- format["NATO has retaken control of the %1 tower",_name] remoteExec ["notify_good",0,false];
- _name setMarkerColor "ColorBLUFOR";
- _resources = _resources + 50;
- server setVariable [format["garrison%1",_name],floor(4 + random(8)),true];
- };
- }foreach(OT_NATOcomms);
-
- if !(_garrisoned) then {
- //Nothing to do, so NATO will harass
- _chance = 98;
- if(count _abandoned > 4) then {_chance = 95};
- if(count _abandoned > 8) then {_chance = 90};
- if(((random 100) > _chance) and (count _abandoned) > 0 and (_resources >= 25)) then {
- _target = _abandoned call BIS_fnc_selectRandom;
- _pos = server getvariable _target;
- if !(isNil "_pos") then {
- _pos spawn OT_fnc_NATOSupportSniper;
- _resources = _resources - 25;
+ if(!("Barriers" in _upgrades) and (_spend > 50) and (random 100 > _chance)) exitWith {
+ _spend = _spend - 50;
+ _resources = _resources - 50;
+ _upgrades pushback "Barriers";
+ [_pos,["Barriers"]] spawn OT_fnc_NATOupgradeFOB;
};
- };
- };
- };
-
- {
- _pos = _x select 0;
- _name = _x select 1;
- if !(_name in _abandoned) then {
- if(_pos call OT_fnc_inSpawnDistance) then {
- _nummil = {side _x == west} count (_pos nearObjects ["CAManBase",300]);
- _numres = {side _x == resistance or captive _x} count (_pos nearObjects ["CAManBase",100]);
- if(_nummil < 3 and _numres > 0) then {
- _abandoned pushback _name;
- server setVariable ["NATOabandoned",_abandoned,true];
- _name setMarkerColor "ColorGUER";
- _t = _pos call OT_fnc_nearestTown;
- format["Resistance has captured the %1 tower",_name] remoteExec ["notify_good",0,false];
- _resources = _resources - 100;
+ if(!("HMG" in _upgrades) and (_spend > 150) and (random 100 > _chance)) exitWith {
+ _spend = _spend - 150;
+ _resources = _resources - 150;
+ _upgrades pushback "HMG";
+ [_pos,["HMG"]] spawn OT_fnc_NATOupgradeFOB;
};
- };
+ }foreach(_fobs);
};
- }foreach(OT_NATOcomms);
- if(_resources < 0) then {_resources = 0};
-
- {
- if(count (units _x) == 0) then {
- deleteGroup _x;
- };
- }foreach(allGroups);
- if(_resources > 2500) then {_resources = 2500};
- server setVariable ["NATOresources",_resources,true];
- server setVariable ["NATOabandoned",_abandoned,true];
- sleep OT_NATOwait + round(random OT_NATOwait);
+ //Finish
+ if(_resources > 2500) then {_resources = 2500};
+ server setVariable ["NATOresources",_resources,true];
+ server setVariable ["NATOabandoned",_abandoned,true];
+ spawner setVariable ["NATOknownTargets",_knownTargets,true];
+ server setVariable ["NATOschedule",_schedule,true];
+ server setVariable ["NATOfobs",_fobs,true];
+ };
+ _count = _count + 1;
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayShopPic.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayShopPic.sqf
index de058e92..6e3f2903 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayShopPic.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/displayShopPic.sqf
@@ -48,12 +48,26 @@ if(_price > -1) then {
if(_cls isKindOf "Man") exitWith {
_txt = _cls call ISSE_Cfg_Vehicle_GetName;
- _price = format["%1 + gear",_price];
+ _soldier = _cls call OT_fnc_getSoldier;
+ _price = _soldier select 0;
_desc = "Will recruit this soldier into your group fully equipped using the warehouse where possible.";
};
if(_cls in OT_allSquads) exitWith {
+ _d = [];
+ {
+ if((_x select 0) == _cls) exitWith {_d = _x};
+ }foreach(OT_squadables);
+
+ _comp = _d select 1;
+ _price = 0;
+ {
+ _s = OT_recruitables select _x;
+
+ _soldier = (_s select 0) call OT_fnc_getSoldier;
+ _price = _price + (_soldier select 0);
+ }foreach(_comp);
+
_txt = _cls;
- _price = format["%1 + gear",_price];
_desc = "Will recruit this squad into your High-Command bar, accessible with ctrl-space.";
};
};
@@ -67,6 +81,12 @@ if !(isNil "_pic") then {
ctrlSetText [1200,_pic];
};
+if(_cls in OT_allExplosives) then {
+ _cost = cost getVariable _cls;
+ _chems = server getVariable ["reschems",0];
+ _desc = format["Required: %1 x chemicals (%2 available)
%3",_cost select 3,_chems,_desc];
+};
+
_textctrl = (findDisplay 8000) displayCtrl 1100;
_textctrl ctrlSetStructuredText parseText format["
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/dumpStuff.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/dumpStuff.sqf
index 0c7b4d12..1a6d7336 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/dumpStuff.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/dumpStuff.sqf
@@ -39,10 +39,11 @@ if(headgear _unit != "") then {
if(_full and !_istruck) exitWith {false};
if(backpack _unit != "") then {
- if !(_t canAdd backpack _unit) exitWith {
+ _cls = (backpack _unit) call BIS_fnc_basicBackpack;
+ if !(_t canAdd _cls) exitWith {
_full = true;
};
- _t addBackpackCargoGlobal [backpack _unit,1];
+ _t addBackpackCargoGlobal [_cls,1];
removeBackpack _unit;
};
if(_full and !_istruck) exitWith {false};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/giveIntel.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/giveIntel.sqf
index 6a0918e2..df14ed00 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/giveIntel.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/giveIntel.sqf
@@ -28,7 +28,7 @@ private _mrkid = format["gundealer%1",_town];
if((markerType _mrkid == "") and (count(_gundealer) > 0) and (_rnd > 60)) exitWith {
-1 call influence;
[_civ,player,["Who are you? and what's with the outfit?","Never you mind","Whatever, I saw a guy wearing similar, he's over there"],{
- "Dealer added to map" call notify_minor;
+ "Dealer added to map" call OT_fnc_notifyMinor;
private _town = player call OT_fnc_nearestTown;
private _pos = server getvariable format["gundealer%1",_town];
_mrk = createMarkerLocal [format["gundealer%1",_town],_pos];
@@ -44,7 +44,7 @@ _mrkid = format["mobster%1",_nearestMobId];
if((_nearestMobGarrison > 0) and (markerType _mrkid == "") and (isNil "_mobboss") and (isNil "_mobster") and !(isNil "_crimleader") and (side _civ == east) and (_standing > 10)) exitWith {
-1 call influence;
[_civ,player,["This and that","Cool, I'm looking for a place to offload some... stuff","Go and speak to the boss I guess"],{
- "Bandit camp added to map" call notify_minor;
+ "Bandit camp added to map" call OT_fnc_notifyMinor;
params ["_mobid","_mobpos"];
_mrk = createMarkerLocal [format["mobster%1",_mobid],_mobpos];
_mrk setMarkerType "ot_Camp";
@@ -57,7 +57,7 @@ if((_nearestMobGarrison > 0) and (markerType _mrkid == "") and (isNil "_mobboss"
if((_nearestMobGarrison > 0) and (markerType _mrkid == "") and (side _civ == civilian) and (_standing >= 0)) exitWith {
-1 call influence;
[_civ,player,["I heard there were some bandits camping in the jungle","Really? Where, exactly?"],{
- "Bandit camp added to map" call notify_minor;
+ "Bandit camp added to map" call OT_fnc_notifyMinor;
params ["_mobid","_mobpos"];
_mrk = createMarkerLocal [format["mobster%1",_mobid],_mobpos];
_mrk setMarkerType "ot_Camp";
@@ -68,5 +68,5 @@ if((_nearestMobGarrison > 0) and (markerType _mrkid == "") and (side _civ == civ
};
[_civ,player,["Not much","Cool","k"],{
- "No intel available" call notify_minor;
+ "No intel available" call OT_fnc_notifyMinor;
}] spawn doConversation;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/takeStuff.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/takeStuff.sqf
index a9e38b89..a679b6e6 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/takeStuff.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/takeStuff.sqf
@@ -10,7 +10,7 @@ if(headgear _unit != "") then {
_t addHeadgear headgear _unit;
};
if(backpack _unit != "") then {
- _t addBackpack backpack _unit;
+ _t addBackpack (backpack _unit) call BIS_fnc_basicBackpack;
};
{
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeen.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeen.sqf
index 6342616e..e1fea10d 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeen.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeen.sqf
@@ -1,2 +1,9 @@
if((vehicle _this) != _this) then {_this = vehicle _this};
-({((side _x == east) or (side _x == west)) and ((time - ((_x targetKnowledge _this) select 2)) < 10)} count (_this nearEntities ["CAManBase",500])) > 0
+
+{
+ _x = driver _x;
+ ((side _x == east) or (side _x == west)) and (
+ (_x distance _this < 7) or
+ ((time - ((_x targetKnowledge _this) select 2)) < 10)
+ )
+}count (_this nearEntities 1200) > 0;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenAny.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenAny.sqf
new file mode 100644
index 00000000..8821e2c1
--- /dev/null
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenAny.sqf
@@ -0,0 +1,9 @@
+if((vehicle _this) != _this) then {_this = vehicle _this};
+
+{
+ _x = driver _x;
+ ((side _x == east) or (side _x == west) or (side _x == civilian)) and (
+ (_x distance _this < 7) or
+ ((time - ((_x targetKnowledge _this) select 2)) < 10)
+ )
+}count (_this nearEntities 1200) > 0;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenCRIM.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenCRIM.sqf
index f98e4eba..cdb8161f 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenCRIM.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenCRIM.sqf
@@ -1,2 +1,9 @@
if((vehicle _this) != _this) then {_this = vehicle _this};
-({(side _x==east) and ((time - ((_x targetKnowledge _this) select 2)) < 10)} count (_this nearEntities ["CAManBase",500])) > 0
+
+{
+ _x = driver _x;
+ (side _x == east) and (
+ (_x distance _this < 7) or
+ ((time - ((_x targetKnowledge _this) select 2)) < 10)
+ )
+}count (_this nearEntities 1200) > 0;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenNATO.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenNATO.sqf
index 5c1053b0..9ca71259 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenNATO.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/funcs/unitSeenNATO.sqf
@@ -1,2 +1,9 @@
if((vehicle _this) != _this) then {_this = vehicle _this};
-({(side _x ==west) and ((time - ((_x targetKnowledge _this) select 2)) < 10)} count (_this nearEntities ["CAManBase",500])) > 0
+
+{
+ _x = driver _x;
+ (side _x == west) and (
+ (_x distance _this < 7) or
+ ((time - ((_x targetKnowledge _this) select 2)) < 10)
+ )
+}count (_this nearEntities 1200) > 0;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/income.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/income.sqf
index 6c641db6..f41125a5 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/income.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/income.sqf
@@ -70,7 +70,7 @@ while {true} do {
_money = _x getVariable ["money",0];
_x setVariable ["money",_money+_perPlayer,true];
}foreach([] call CBA_fnc_players);
- format ["Tax income: $%1 (+%2 Influence)",[_perPlayer, 1, 0, true] call CBA_fnc_formatNumber,_inf] remoteExec ["notify_good",0,true];
+ format ["Tax income: $%1 (+%2 Influence)",[_perPlayer, 1, 0, true] call CBA_fnc_formatNumber,_inf] remoteExec ["OT_fnc_notifyGood",0,true];
}else{
_inf remoteExec ["influence",0,false];
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/init.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/init.sqf
index a85a7a32..dd8997b2 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/init.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/init.sqf
@@ -36,6 +36,7 @@ if(!isMultiplayer) then {
};
//Init factions
+ [] call OT_fnc_initNATO;
[] execVM "factions\NATO.sqf";
[] execVM "factions\GUER.sqf";
[] execVM "factions\CRIM.sqf";
@@ -61,6 +62,7 @@ if(!isMultiplayer) then {
//ACE events
["ace_cargoLoaded",compile preprocessFileLineNumbers "events\cargoLoaded.sqf"] call CBA_fnc_addEventHandler;
["ace_common_setFuel",compile preprocessFileLineNumbers "events\refuel.sqf"] call CBA_fnc_addEventHandler;
+ ["ace_explosives_place",compile preprocessFileLineNumbers "events\placeExplosives.sqf"] call CBA_fnc_addEventHandler;
//Setup fuel pumps for interaction
{
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initEconomyLoad.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initEconomyLoad.sqf
index d9ce1313..ce68c740 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initEconomyLoad.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initEconomyLoad.sqf
@@ -33,7 +33,7 @@ if((server getVariable ["EconomyVersion",0]) < OT_economyVersion) then {
_pos = [[[getpos _building,50]]] call BIS_fnc_randomPos;
};
server setVariable [format["factionrep%1",_cls],_pos,true];
- _building setVariable ["owner","system",true];
+ [_building,"system"] call OT_fnc_setOwner;
};
}foreach(OT_allFactions);
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf
index 280be8dd..7c20e444 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initFuncs.sqf
@@ -16,6 +16,12 @@ doConversation = compileFinal preProcessFileLineNumbers "funcs\doConversation.sq
playerDecision = compileFinal preProcessFileLineNumbers "funcs\playerDecision.sqf";
OT_fnc_NATOConvoy = compileFinal preProcessFileLineNumbers "AI\fn_NATOConvoy.sqf";
+OT_fnc_NATOMissionReconDestroy = compileFinal preProcessFileLineNumbers "AI\fn_NATOMissionReconDestroy.sqf";
+OT_fnc_NATOSetExplosives = compileFinal preProcessFileLineNumbers "AI\fn_NATOSetExplosives.sqf";
+OT_fnc_NATOMissionDeployFOB = compileFinal preProcessFileLineNumbers "AI\fn_NATOMissionDeployFOB.sqf";
+OT_fnc_NATODeployFOB = compileFinal preProcessFileLineNumbers "AI\fn_NATODeployFOB.sqf";
+OT_fnc_NATOupgradeFOB = compileFinal preProcessFileLineNumbers "AI\fn_NATOupgradeFOB.sqf";
+OT_fnc_NATOMortar = compileFinal preProcessFileLineNumbers "AI\fn_NATOMortar.sqf";
//UI
mainMenu = compileFinal preProcessFileLineNumbers "UI\mainMenu.sqf";
@@ -37,15 +43,12 @@ gunDealerDialog = compileFinal preProcessFileLineNumbers "UI\gunDealerDialog.sqf
resistanceScreen = compileFinal preprocessFileLineNumbers "UI\fn_resistanceDialog.sqf";
OT_fnc_resistanceDialog = resistanceScreen;
OT_fnc_mapInfoDialog = compileFinal preprocessFileLineNumbers "actions\townInfo.sqf";
-OT_fnc_showMemberInfo = compileFinal preprocessFileLineNumbers "UI\actions\fn_showMemberInfo.sqf";
-OT_fnc_showBusinessInfo = compileFinal preprocessFileLineNumbers "UI\actions\fn_showBusinessInfo.sqf";
OT_fnc_factoryDialog = compileFinal preProcessFileLineNumbers "UI\fn_factoryDialog.sqf";
OT_fnc_reverseEngineerDialog = compileFinal preProcessFileLineNumbers "UI\fn_reverseEngineerDialog.sqf";
OT_fnc_vehicleDialog = compileFinal preProcessFileLineNumbers "UI\fn_vehicleDialog.sqf";
-OT_fnc_factoryRefresh = compileFinal preProcessFileLineNumbers "UI\actions\fn_factoryRefresh.sqf";
-OT_fnc_factorySet = compileFinal preProcessFileLineNumbers "UI\actions\fn_factorySet.sqf";
OT_fnc_newGameDialog = compileFinal preProcessFileLineNumbers "UI\fn_newGameDialog.sqf";
OT_fnc_optionsDialog = compileFinal preProcessFileLineNumbers "UI\fn_optionsDialog.sqf";
+OT_fnc_garrisonDialog = compileFinal preProcessFileLineNumbers "UI\fn_garrisonDialog.sqf";
template_playerDesk = [] call compileFinal preProcessFileLineNumbers "templates\playerdesk.sqf";
template_checkpoint = [] call compileFinal preProcessFileLineNumbers "templates\NATOcheckpoint.sqf";
@@ -65,41 +68,17 @@ initObjectLocal = compileFinal preProcessFileLineNumbers "interaction\initObject
initStaticMGLocal = compileFinal preProcessFileLineNumbers "interaction\initStaticMGLocal.sqf";
//Actions
-buy = compileFinal preProcessFileLineNumbers "actions\buy.sqf";
-sell = compileFinal preProcessFileLineNumbers "actions\sell.sqf";
-sellall = compileFinal preProcessFileLineNumbers "actions\sellall.sqf";
-workshopAdd = compileFinal preProcessFileLineNumbers "actions\workshopAdd.sqf";
-buyBuilding = compileFinal preProcessFileLineNumbers "actions\buyBuilding.sqf";
leaseBuilding = compileFinal preProcessFileLineNumbers "actions\leaseBuilding.sqf";
-recruitCiv = compileFinal preProcessFileLineNumbers "actions\recruitCiv.sqf";
-rearmGroup = compileFinal preProcessFileLineNumbers "actions\rearmGroup.sqf";
recruitSoldier = compileFinal preProcessFileLineNumbers "actions\recruitSoldier.sqf";
recruitSquad = compileFinal preProcessFileLineNumbers "actions\recruitSquad.sqf";
-fastTravel = compileFinal preProcessFileLineNumbers "actions\fastTravel.sqf";
setHome = compileFinal preProcessFileLineNumbers "actions\setHome.sqf";
-giveMoney = compileFinal preProcessFileLineNumbers "actions\giveMoney.sqf";
-saveGamePersistent = compileFinal preProcessFileLineNumbers "actions\saveGame.sqf";
-loadGamePersistent = compileFinal preProcessFileLineNumbers "actions\loadGame.sqf";
getIntel = compileFinal preProcessFileLineNumbers "actions\getIntel.sqf";
-transferFrom = compileFinal preProcessFileLineNumbers "actions\transferFrom.sqf";
-transferTo = compileFinal preProcessFileLineNumbers "actions\transferTo.sqf";
-transferLegit = compileFinal preProcessFileLineNumbers "actions\transferLegit.sqf";
-takeLegit = compileFinal preProcessFileLineNumbers "actions\takeLegit.sqf";
-talkToCiv = compileFinal preProcessFileLineNumbers "actions\talkToCiv.sqf";
addPolice = compileFinal preProcessFileLineNumbers "actions\addPolice.sqf";
-warehouseTake = compileFinal preProcessFileLineNumbers "actions\warehouseTake.sqf";
exportAll = compileFinal preProcessFileLineNumbers "actions\exportAll.sqf";
import = compileFinal preProcessFileLineNumbers "actions\import.sqf";
restoreLoadout = compileFinal preProcessFileLineNumbers "actions\restoreLoadout.sqf";
removeLoadout = compileFinal preProcessFileLineNumbers "actions\removeLoadout.sqf";
-OT_fnc_getMission = compileFinal preProcessFileLineNumbers "actions\fn_getMission.sqf";
-OT_fnc_getLocalMission = compileFinal preProcessFileLineNumbers "actions\fn_getLocalMission.sqf";
-OT_fnc_salvageWreck = compileFinal preProcessFileLineNumbers "actions\fn_salvageWreck.sqf";
-
-OT_fnc_takeFunds = compileFinal preProcessFileLineNumbers "UI\actions\fn_takeFunds.sqf";
-OT_fnc_giveFunds = compileFinal preProcessFileLineNumbers "UI\actions\fn_giveFunds.sqf";
-OT_fnc_transferFunds = compileFinal preProcessFileLineNumbers "UI\actions\fn_transferFunds.sqf";
-OT_fnc_makeGeneral = compileFinal preProcessFileLineNumbers "UI\actions\fn_makeGeneral.sqf";
+OT_fnc_addGarrison = compileFinal preProcessFileLineNumbers "actions\fn_addGarrison.sqf";
//Modes
@@ -109,6 +88,7 @@ placementMode = compileFinal preProcessFileLineNumbers "actions\placementMode.sq
unitSeen = compileFinal preProcessFileLineNumbers "funcs\unitSeen.sqf";
unitSeenCRIM = compileFinal preProcessFileLineNumbers "funcs\unitSeenCRIM.sqf";
unitSeenNATO = compileFinal preProcessFileLineNumbers "funcs\unitSeenNATO.sqf";
+unitSeenAny = compileFinal preProcessFileLineNumbers "funcs\unitSeenAny.sqf";
wantedSystem = compileFinal preProcessFileLineNumbers "wantedSystem.sqf";
//Other Systems
@@ -121,6 +101,93 @@ keyHandler = compileFinal preProcessFileLineNumbers "keyHandler.sqf";
menuHandler = {};
fnc_getBuildID = compileFinal preProcessFileLineNumbers "funcs\fnc_getBuildID.sqf";
+OT_fnc_getBuildID = fnc_getBuildID;
+
+OT_fnc_createSquad = {
+ _units = groupselectedunits player;
+ if(count _units < 2) exitWith {"You must select at least 2 recruits" call OT_fnc_notifyMinor};
+ _group = createGroup resistance;
+ _cc = player getVariable ["OT_squadcount",1];
+ {
+ if(_x != player) then {
+ _x setVariable ["NOAI",false,false];
+ [_x] joinSilent _group;
+ };
+ }foreach(_units);
+ _group setGroupIdGlobal [format["S-%1",_cc]];
+ _cc = _cc + 1;
+ player hcSetGroup [_group,groupId _group,"teamgreen"];
+
+ player setVariable ["OT_squadcount",_cc,true];
+
+ _recruits = server getVariable ["squads",[]];
+ _recruits pushback [getplayeruid player,"CUSTOM",_group,[]];
+ server setVariable ["squads",_recruits,true];
+
+ _remove = [];
+ _recruits = server getVariable ["recruits",[]];
+ {
+ if((_x select 2) in _units) then {
+ _remove pushback _x;
+ };
+ }foreach(_recruits);
+ {
+ _recruits deleteAt (_recruits find _x);
+ }foreach(_remove);
+ server setVariable ["recruits",_recruits,true];
+
+ "Squad created, use ctrl + space to command" call OT_fnc_notifyMinor;
+};
+
+OT_fnc_initDrone = {
+ _drone = _this;
+
+ _drone spawn {
+ _drone = _this;
+ _targets = [];
+ while {sleep 10; alive _drone} do {
+ {
+ _ty = typeof _x;
+ if((damage _x) < 1) then {
+ call {
+ if((_x isKindOf "StaticWeapon") and (side _x != west)) exitWith {
+ if(([_drone, "VIEW"] checkVisibility [position _drone,position _x]) > 0) then {
+ _targets pushback ["SW",position _x,100,_x];
+ };
+ };
+ if(_ty == OT_item_Flag) exitWith {
+ _targets pushback ["FOB",position _x,0,_x];
+ };
+ if(_ty == OT_warehouse) exitWith {
+ if(_x call OT_fnc_hasOwner) then {
+ _targets pushback ["WH",position _x,80,_x];
+ };
+ };
+ if(_ty == OT_policeStation) exitWith {
+ _targets pushback ["PS",position _x,90,_x];
+ };
+ if(_ty == OT_workshopBuilding) exitWith {
+ _targets pushback ["WS",position _x,50,_x];
+ };
+ if(((_x isKindOf "Car") or (_x isKindOf "Air") or (_x isKindOf "Ship")) and !(_ty in (OT_allVehicles+OT_allBoats+OT_helis))) exitWith {
+ if !(side _x == west) then {
+ if(([_drone, "VIEW"] checkVisibility [position _drone,position _x]) > 0) then {
+ _targets pushback ["V",position _x,0,_x];
+ };
+ };
+ };
+ if(_ty == OT_item_Storage) exitWith {
+ if(([_drone, "VIEW"] checkVisibility [position _drone,position _x]) > 0) then {
+ _targets pushback ["AMMO",position _x,25,_x];
+ };
+ };
+ };
+ };
+ }foreach((_drone nearObjects ["Static",500]) + (_drone nearObjects ["AllVehicles",500]));
+ _drone setVariable ["OT_seenTargets",_targets,false];
+ };
+ };
+};
OT_fnc_generateBanditPositions = {
_num = 10;
@@ -172,7 +239,7 @@ OT_fnc_generateBanditPositions = {
};
OT_fnc_playerIsOwner = {
- (_this getVariable ["owner",""]) == (getplayeruid player)
+ (_this call OT_fnc_getOwner) == (getplayeruid player)
};
OT_fnc_playerAtWarehouse = {
@@ -180,7 +247,7 @@ OT_fnc_playerAtWarehouse = {
_b = (position player) call OT_fnc_nearestRealEstate;
if(typename _b == "ARRAY") then {
_building = _b select 0;
- if((typeof _building) == OT_warehouse and _building call OT_fnc_hasOwner) then {
+ if((typeof _building) == OT_warehouse and (_building call OT_fnc_hasOwner) and (damage _building) < 1) then {
_iswarehouse = true;
};
};
@@ -189,39 +256,48 @@ OT_fnc_playerAtWarehouse = {
OT_fnc_lockVehicle = {
private _veh = vehicle player;
- if((_veh getVariable ["owner",""]) != (getplayeruid player)) exitWith {};
+ if((_veh call OT_fnc_getOwner) != (getplayeruid player)) exitWith {};
if(_veh getVariable ["OT_locked",false]) then {
_veh setVariable ["OT_locked",false,true];
- "Vehicle unlocked" call notify_minor;
+ "Vehicle unlocked" call OT_fnc_notifyMinor;
}else{
_veh setVariable ["OT_locked",true,true];
- "Vehicle locked" call notify_minor;
+ "Vehicle locked" call OT_fnc_notifyMinor;
};
};
OT_fnc_squadAssignVehicle = {
_squad = (hcselected player) select 0;
_veh = cursorObject;
- if((_veh isKindOf "Air") or (_veh isKindOf "Land") or (_veh isKindOf "Ship")) then {
+ _leader = leader _squad;
+ if(_leader distance _veh > 30) exitWith {"Squad leader must be within 30m of vehicle" call OT_fnc_notifyMinor};
+ if((_veh isKindOf "StaticWeapon") or (_veh isKindOf "Air") or (_veh isKindOf "Land") or (_veh isKindOf "Ship")) then {
+ _squad setVariable ["OT_assigned",_veh,false];
_squad addVehicle _veh;
- [] call OT_fnc_squadGetIn;
+ (units _squad) orderGetIn true;
player hcSelectGroup [_squad,false];
- format["%1 assigned to %2",(typeof _veh) call ISSE_Cfg_Vehicle_GetName,groupId _squad] call notify_minor;
+ format["%1 assigned to %2",(typeof _veh) call ISSE_Cfg_Vehicle_GetName,groupId _squad] call OT_fnc_notifyMinor;
};
};
OT_fnc_squadGetIn = {
{
- _squad = _x;
- (units _squad) orderGetIn true;
- player hcSelectGroup [_squad,false];
+ _veh = _x getVariable ["OT_assigned",objNull];
+ (units _x) allowGetIn true;
+ if !(isNull _veh) then {
+ _x addVehicle _veh;
+ (units _x) orderGetIn true;
+ };
+ player hcSelectGroup [_x,false];
}foreach(hcSelected player);
};
OT_fnc_squadGetOut = {
{
_squad = _x;
- (units _squad) orderGetIn false;
+ { unassignVehicle _x } forEach (units _squad);
+ (units _x) orderGetIn false;
+ (units _squad) allowGetIn false;
player hcSelectGroup [_squad,false];
}foreach(hcSelected player);
};
@@ -249,10 +325,10 @@ OT_fnc_regionIsConnected = {
};
OT_fnc_getRegion = {
- _pos = _this;
+ _p = _this;
_region = "";
{
- if(_pos inArea _x) exitWith {_region = _x};
+ if(_p inArea _x) exitWith {_region = _x};
}foreach(OT_regions);
_region;
};
@@ -267,7 +343,7 @@ OT_fnc_increaseTax = {
_rate = _rate + 5;
if(_rate > 100) then {_rate = 100};
server setVariable ["taxrate",_rate,true];
- format["Tax rate is now %1%2",_rate,"%"] call notify_minor;
+ format["Tax rate is now %1%2",_rate,"%"] call OT_fnc_notifyMinor;
};
OT_fnc_decreaseTax = {
@@ -275,7 +351,7 @@ OT_fnc_decreaseTax = {
_rate = _rate - 5;
if(_rate < 0) then {_rate = 0};
server setVariable ["taxrate",_rate,true];
- format["Tax rate is now %1%2",_rate,"%"] call notify_minor;
+ format["Tax rate is now %1%2",_rate,"%"] call OT_fnc_notifyMinor;
};
OT_fnc_hireEmployee = {
@@ -329,7 +405,7 @@ OT_fnc_getTaxIncome = {
private _population = server getVariable format["population%1",_town];
private _stability = server getVariable format["stability%1",_town];
private _garrison = server getVariable [format['police%1',_town],0];
- private _add = round(_population * 2 * (_stability/100));
+ private _add = round(_population * 4 * (_stability/100));
if(_stability > 49) then {
_add = round(_add * 4);
};
@@ -366,7 +442,7 @@ OT_fnc_reverseEngineer = {
_blueprints pushBack _cls;
server setVariable ["GEURblueprints",_blueprints,true];
closeDialog 0;
- "Item is now available for production" call notify_minor;
+ "Item is now available for production" call OT_fnc_notifyMinor;
if(!(_cls isKindOf "Bag_Base") and _cls isKindOf "AllVehicles") then {
private _veh = OT_factoryPos nearestObject _cls;
@@ -375,7 +451,7 @@ OT_fnc_reverseEngineer = {
player removeItem _cls;
};
}else{
- "Cannot reverse-engineer this item, please contact Overthrow Devs on Discord" call notify_minor;
+ "Cannot reverse-engineer this item, please contact Overthrow Devs on Discord" call OT_fnc_notifyMinor;
};
};
@@ -434,10 +510,10 @@ OT_fnc_getEconomicData = {
OT_fnc_getBusinessPrice = {
private _data = _this call OT_fnc_getEconomicData;
- private _baseprice = 300000;
+ private _baseprice = 100000;
if(count _data == 2) then {
//turns nothing into money
- _baseprice = round(_baseprice * 1.8);
+ _baseprice = round(_baseprice * 1.5);
};
if(count _data == 3) then {
//turns something into money
@@ -499,9 +575,9 @@ OT_fnc_initRecruit = {
[_civ, (OT_voices_local call BIS_fnc_selectRandom)] remoteExecCall ["setSpeaker", 0, _civ];
- _civ setSkill 1.0;
+ _civ setSkill 0.1 + (random 0.3);
_civ setRank "PRIVATE";
- _civ setVariable ["NOAI",false,true];
+ _civ setVariable ["NOAI",true,true];
_civ spawn wantedSystem;
@@ -578,9 +654,10 @@ mpSetDir = {
};
structureInit = {
- private _pos = _this select 0;
- private _code = compileFinal preProcessFileLineNumbers (_this select 1);
- [_pos] spawn _code;
+ private _veh = _this select 0;
+ private _pos = _this select 1;
+ private _code = compileFinal preProcessFileLineNumbers (_this select 2);
+ [_pos,_veh] spawn _code;
};
blackFaded = {
@@ -628,7 +705,7 @@ setupKeyHandler = {
};
assignedKey = {
- (cba_keybinding_dikDecToStringTable select ((actionKeys _this) select 0)+1) select 1
+ (cba_keybinding_keynames) getVariable [str ((actionKeys _this) select 0),""];
};
standing = {
@@ -640,7 +717,7 @@ standing = {
player setVariable ["rep",_totalrep,true];
if(count _this > 2) then {
- format["%1 (%2 %3)",_this select 2,_this select 1,_town] call notify_minor;
+ format["%1 (%2 %3)",_this select 2,_this select 1,_town] call OT_fnc_notifyMinor;
};
};
@@ -683,7 +760,7 @@ influence = {
if(_this > 0) then {
_plusmin = "+";
};
- format["%1%2 Influence",_plusmin,_this] call notify_minor;
+ format["%1%2 Influence",_plusmin,_this] call OT_fnc_notifyMinor;
};
influenceSilent = {
@@ -749,9 +826,9 @@ money = {
_plusmin = "+";
};
if(count _this > 1) then {
- format["%3: %1$%2",_plusmin,[_amount, 1, 0, true] call CBA_fnc_formatNumber,_this select 1] call notify_minor;
+ format["%3: %1$%2",_plusmin,[_amount, 1, 0, true] call CBA_fnc_formatNumber,_this select 1] call OT_fnc_notifyMinor;
}else{
- format["%1$%2",_plusmin,[_amount, 1, 0, true] call CBA_fnc_formatNumber] call notify_minor;
+ format["%1$%2",_plusmin,[_amount, 1, 0, true] call CBA_fnc_formatNumber] call OT_fnc_notifyMinor;
};
};
@@ -803,42 +880,4 @@ stability = {
};
};
-OT_notifies = [];
-
-notify = {
- _txt = format ["%1",_this];
- OT_notifies pushback _txt;
-};
-
-notify_good = {
- playSound "3DEN_notificationDefault";
- _txt = format ["%1",_this];
- OT_notifies pushback _txt;
-};
-
-notify_big = {
- _txt = format ["%1",_this];
- OT_notifies pushback _txt;
-};
-
-notify_minor = {
- _txt = format ["%1",_this];
- OT_notifies pushback _txt;
-};
-
-notify_vehicle = {
- _txt = format["%1
Owner: %2",(typeof vehicle player) call ISSE_Cfg_Vehicle_GetName,server getVariable "name"+((vehicle player) getVariable ["owner",""])];
- [_txt, -0.5, 1, 5, 1, 0, 5] spawn bis_fnc_dynamicText;
-};
-
-notify_long = {
- _txt = format ["%1",_this];
- [_txt, 0, -0.136, 30, 1, 0, 2] spawn bis_fnc_dynamicText;
-};
-
-notify_talk = {
- _txt = format ["%1",_this];
- OT_notifies pushback _txt;
-};
-
[] execVM "funcs\info.sqf";
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf
index feecf11d..3e77e376 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initPlayerLocal.sqf
@@ -124,38 +124,28 @@ if(isMultiplayer or _startup == "LOAD") then {
_mrkName setMarkerAlphaLocal 1;
};
if(_x in _leased) then {
- _bdg setVariable ["leased",true,true];
+ _mrkName setMarkerAlphaLocal 0.3;
};
_nowowned pushback ([_bdg] call fnc_getBuildID);
};
}else{
//new save with IDs
if (typename _x == "SCALAR") then {
- _bdg = OT_centerPos nearestObject _x;
- if !(isNil "_bdg") then {
- _mrkName = format["bdg-%1",_bdg];
- if(_bdg isKindOf "Building") then {
- if(typeof _bdg == OT_warehouse) then {
- _mrkName = createMarker [_mrkName,getpos _bdg];
- _mrkName setMarkerShape "ICON";
- _mrkName setMarkerColor "ColorWhite";
- _mrkName setMarkerType "OT_warehouse";
- _mrkName setMarkerAlpha 1;
- }else{
- if(typeof _bdg != OT_policeStation) then {
- _mrkName = createMarkerLocal [_mrkName,getpos _bdg];
- _mrkName setMarkerShape "ICON";
- _mrkName setMarkerType "loc_Tourism";
- _mrkName setMarkerColor "ColorWhite";
- _mrkName setMarkerAlpha 0;
- _mrkName setMarkerAlphaLocal 1;
- };
- };
- };
- if(_x in _leased) then {
- _bdg setVariable ["leased",true,true];
- _mrkName setMarkerAlphaLocal 0.3;
- };
+ _mrkName = format["bdg-%1",_x];
+ _pos = buildingpositions getVariable [str _x,[]];
+ if(count _pos == 0) then {
+ _bdg = OT_centerPos nearestObject _x;
+ _pos = position _bdg;
+ buildingpositions setVariable [str _x,_pos,true];
+ };
+ _mrkName = createMarkerLocal [_mrkName,_pos];
+ _mrkName setMarkerShape "ICON";
+ _mrkName setMarkerType "loc_Tourism";
+ _mrkName setMarkerColor "ColorWhite";
+ _mrkName setMarkerAlpha 0;
+ _mrkName setMarkerAlphaLocal 1;
+ if(_x in _leased) then {
+ _mrkName setMarkerAlphaLocal 0.3;
};
};
};
@@ -167,7 +157,7 @@ if(isMultiplayer or _startup == "LOAD") then {
{
if(_x call OT_fnc_hasOwner) then {
- if ((_x getVariable "owner" == getPlayerUID player) and !(_x isKindOf "LandVehicle") and !(_x isKindOf "Building")) then {
+ if ((_x call OT_fnc_playerIsOwner) and !(_x isKindOf "LandVehicle") and !(_x isKindOf "Building")) then {
_furniture pushback _x
};
};
@@ -187,10 +177,16 @@ if(isMultiplayer or _startup == "LOAD") then {
if(_owner == (getplayeruid player)) then {
if(typename _civ == "ARRAY") then {
_civ = group player createUnit [_type,_civ,[],0,"NONE"];
- _civ setVariable ["owner",getplayeruid player,true];
+ [_civ,getplayeruid player] call OT_fnc_setOwner;
_civ setVariable ["OT_xp",_xp,true];
_civ setVariable ["NOAI",true,true];
_civ setRank _rank;
+ if(_rank == "PRIVATE") then {_civ setSkill 0.1 + (random 0.3)};
+ if(_rank == "CORPORAL") then {_civ setSkill 0.2 + (random 0.3)};
+ if(_rank == "SERGEANT") then {_civ setSkill 0.3 + (random 0.3)};
+ if(_rank == "LIEUTENANT") then {_civ setSkill 0.5 + (random 0.3)};
+ if(_rank == "CAPTAIN") then {_civ setSkill 0.6 + (random 0.3)};
+ if(_rank == "MAJOR") then {_civ setSkill 0.8 + (random 0.2)};
[_civ, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _civ];
[_civ, (OT_voices_local call BIS_fnc_selectRandom)] remoteExecCall ["setSpeaker", 0, _civ];
_civ setUnitLoadout _loadout;
@@ -202,7 +198,7 @@ if(isMultiplayer or _startup == "LOAD") then {
commandStop _civ;
}else{
- if((_civ getVariable "owner") == (getplayeruid player)) then {
+ if(_civ call OT_fnc_playerIsOwner) then {
[_civ] joinSilent (group player);
};
};
@@ -229,10 +225,11 @@ if(isMultiplayer or _startup == "LOAD") then {
}foreach(OT_Squadables);
};
_group = creategroup resistance;
- _group setGroupIdGlobal [format["%1-%2",_name,_cc]];
+ _group setGroupIdGlobal [_name];
{
_x params ["_type","_pos","_loadout"];
_civ = _group createUnit [_type,_pos,[],0,"NONE"];
+ _civ setSkill 0.5 + (random 0.4);
_civ setUnitLoadout _loadout;
[_civ, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _civ];
[_civ, (OT_voices_local call BIS_fnc_selectRandom)] remoteExecCall ["setSpeaker", 0, _civ];
@@ -260,7 +257,7 @@ if (_newplayer) then {
_money = 0;
};
player setVariable ["money",_money,true];
- player setVariable ["owner",getplayerUID player,true];
+ [player,getplayeruid player] call OT_fnc_setOwner;
if(!isMultiplayer) then {
{
if(_x != player) then {
@@ -296,7 +293,7 @@ if (_newplayer) then {
_light setLightAmbient[.9, .9, .6];
_light setLightColor[.5, .5, .4];
- _house setVariable ["owner",getPlayerUID player,true];
+ [_house,getplayeruid player] call OT_fnc_setOwner;
player setVariable ["home",_housepos,true];
_furniture = (_house call OT_fnc_spawnTemplate) select 0;
@@ -310,7 +307,7 @@ if (_newplayer) then {
_x addBackpackCargoGlobal ["B_AssaultPack_khk", 1];
_x addItemCargoGlobal ["NVGoggles_INDEP", 1];
};
- _x setVariable ["owner",getplayerUID player,true];
+ [_x,getplayeruid player] call OT_fnc_setOwner;
}foreach(_furniture);
player setVariable ["owned",[[_house] call fnc_getBuildID],true];
@@ -358,17 +355,17 @@ player addEventHandler ["WeaponAssembled",{
};
};
if(isplayer _me) then {
- _wpn setVariable ["owner",getplayeruid _me,true];
+ [_wpn,getplayeruid player] call OT_fnc_setOwner;
};
}];
player addEventHandler ["InventoryOpened", {
_veh = _this select 1;
_ret = false;
- if((_veh getVariable ["owner",""]) != (getplayeruid player)) then {
+ if((_veh call OT_fnc_getOwner) != (getplayeruid player)) then {
if(_veh getVariable ["OT_locked",false]) then {
_ret = true;
- format["This inventory has been locked by %1",server getVariable "name"+(_veh getVariable ["owner",""])] call notify_minor;
+ format["This inventory has been locked by %1",server getVariable "name"+(_veh call OT_fnc_getOwner)] call OT_fnc_notifyMinor;
};
};
_ret;
@@ -380,19 +377,21 @@ player addEventHandler ["GetInMan",{
_veh = _this select 2;
_notified = false;
- call notify_vehicle;
+ call OT_fnc_notifyVehicle;
private _isgen = call OT_fnc_playerIsGeneral;
if(_position == "driver") then {
if !(_veh call OT_fnc_hasOwner) then {
- _veh setVariable ["owner",getplayeruid player,true];
+ [_veh,getplayeruid player] call OT_fnc_setOwner;
_veh setVariable ["stolen",true,true];
- [(getpos player) call OT_fnc_nearestTown,-1,"Stolen vehicle"] call standing;
+ if((_veh getVariable ["ambient",false]) and (player call unitSeenAny)) then {
+ [(getpos player) call OT_fnc_nearestTown,-1,"Stolen vehicle"] call standing;
+ };
}else{
- if((_veh getVariable ["owner",""]) != (getplayeruid player)) then {
+ if !(_veh call OT_fnc_playerIsOwner) then {
if(!_isgen and (_veh getVariable ["OT_locked",false])) then {
moveOut player;
- format["This vehicle has been locked by %1",server getVariable "name"+(_veh getVariable ["owner",""])] call notify_minor;
+ format["This vehicle has been locked by %1",server getVariable "name"+(_veh call OT_fnc_getOwner)] call OT_fnc_notifyMinor;
};
};
};
@@ -405,7 +404,7 @@ player addEventHandler ["GetInMan",{
_veh setVariable ["vehgarrison",nil,true];
{
_x setCaptive false;
- }foreach(units _veh);
+ }foreach(crew _veh);
_veh spawn revealToNATO;
};
_g = _v getVariable ["airgarrison",false];
@@ -416,7 +415,7 @@ player addEventHandler ["GetInMan",{
_veh setVariable ["airgarrison",nil,true];
{
_x setCaptive false;
- }foreach(units _veh);
+ }foreach(crew _veh);
_veh spawn revealToNATO;
};
}];
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf
index c2a7d215..86ecc4a9 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initServer.sqf
@@ -1,6 +1,8 @@
[] execVM "income.sqf";
addMissionEventHandler ["EntityKilled",compileFinal preprocessFileLineNumbers "events\somethingDied.sqf"];
+["Building", "Dammaged", compileFinal preprocessFileLineNumbers "events\buildingDamaged.sqf"] call CBA_fnc_addClassEventHandler;
+
if (!isMultiplayer) exitWith {};
//Advanced towing script, credits to Duda http://www.armaholic.com/page.php?id=30575
@@ -20,6 +22,7 @@ if(OT_fastTime) then {
waitUntil {sleep 1;server getVariable ["StartupType",""] != ""};
[] execVM "initEconomyLoad.sqf";
+[] call OT_fnc_initNATO;
[] execVM "factions\NATO.sqf";
[] execVM "factions\GUER.sqf";
[] execVM "factions\CRIM.sqf";
@@ -40,11 +43,10 @@ waitUntil {!isNil "OT_economyLoadDone" and !isNil "OT_fnc_registerSpawner"};
[] execVM "virtualization\economy.sqf";
[] execVM "virtualization\factions.sqf";
-if(OT_hasAce) then {
- //ACE events
- ["ace_cargoLoaded",compile preprocessFileLineNumbers "events\cargoLoaded.sqf"] call CBA_fnc_addEventHandler;
- ["ace_common_setFuel",compile preprocessFileLineNumbers "events\refuel.sqf"] call CBA_fnc_addEventHandler;
-};
+
+["ace_cargoLoaded",compile preprocessFileLineNumbers "events\cargoLoaded.sqf"] call CBA_fnc_addEventHandler;
+["ace_common_setFuel",compile preprocessFileLineNumbers "events\refuel.sqf"] call CBA_fnc_addEventHandler;
+["ace_explosives_place",compile preprocessFileLineNumbers "events\placeExplosives.sqf"] call CBA_fnc_addEventHandler;
addMissionEventHandler ["HandleDisconnect",compile preprocessFileLineNumbers "events\playerDisconnect.sqf"];
addMissionEventHandler ["HandleConnnect",compile preprocessFileLineNumbers "events\playerConnect.sqf"];
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf
index 811d5c38..9ed75fa7 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/initVar.sqf
@@ -27,7 +27,7 @@ OT_rankXP = [100,250,500,1000,4000,10000,100000];
//Used to control updates and persistent save compatability. When these numbers go up, that section will be reinitialized on load if required. (ie leave them alone)
OT_economyVersion = 12;
-OT_NATOversion = 7;
+OT_NATOversion = 8;
OT_CRIMversion = 1;
OT_adminMode = false;
OT_economyLoadDone = false;
@@ -58,7 +58,7 @@ OT_item_wrecks = ["Land_Wreck_HMMWV_F","Land_Wreck_Skodovka_F","Land_Wreck_Truck
OT_spawnTowns = ["Balavu","Katkoula","Savaka","Namuvaka","Katkoula","Lailai","Taga","Bua Bua","Blerick","Moddergat","Tobakoro"]; //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 = 300; //Half the Average time between NATO orders
+OT_NATOwait = 30; //Half the Average time between NATO orders (x 10 seconds)
OT_CRIMwait = 500; //Half the Average time between crim changes
//Interactable items that spawn in your house
@@ -83,16 +83,11 @@ OT_fuelPumps = ["Land_FuelStation_02_pump_F","Land_FuelStation_01_pump_F","Land_
OT_ferryDestinations = ["destination_1","destination_2","destination_3","destination_4","destination_5","destination_6"];
-OT_miscables = ["Land_PortableLight_single_F","Land_PortableLight_double_F","Land_Camping_Light_F","Land_PortableHelipadLight_01_F","PortableHelipadLight_01_blue_F",
+OT_miscables = ["ACE_Wheel","ACE_Track","Land_PortableLight_double_F","Land_PortableLight_single_F","Land_Camping_Light_F","Land_PortableHelipadLight_01_F","PortableHelipadLight_01_blue_F",
"PortableHelipadLight_01_green_F","PortableHelipadLight_01_red_F","PortableHelipadLight_01_white_F","PortableHelipadLight_01_yellow_F","Land_Campfire_F","ArrowDesk_L_F",
"ArrowDesk_R_F","ArrowMarker_L_F","ArrowMarker_R_F","Pole_F","Land_RedWhitePole_F","RoadBarrier_F","RoadBarrier_small_F","RoadCone_F","RoadCone_L_F","Land_VergePost_01_F",
"TapeSign_F","Land_WheelChock_01_F","Land_Sleeping_bag_F","Land_Sleeping_bag_blue_F","Land_WoodenLog_F","FlagChecked_F","FlagSmall_F","Land_LandMark_F","Land_Bollard_01_F"];
-if(OT_hasACE) then {
- OT_miscables pushback "ACE_Wheel";
- OT_miscables pushback "ACE_Track";
-};
-
//Items you can place
OT_Placeables = [
["Sandbags",20,["Land_BagFence_01_long_green_F","Land_BagFence_01_short_green_F","Land_BagFence_01_round_green_F","Land_BagFence_01_corner_green_F","Land_BagFence_01_end_green_F"],[0,3,0.8],"Bags filled with lots of sand. Apparently this can stop bullets or something?"],
@@ -100,7 +95,7 @@ OT_Placeables = [
["Barriers",60,["Land_HBarrier_01_line_5_green_F","Land_HBarrier_01_line_3_green_F","Land_HBarrier_01_line_1_green_F"],[0,4,1.2],"Really big sandbags, basically."],
["Map",30,[OT_item_Map],[0,2,1.2],"Use these to save your game, change options or check town info."],
["Safe",50,[OT_item_Safe],[0,2,0.5],"Store and retrieve money"],
- ["Misc",30,OT_miscables,[0,3,1.2],"Various other items, including lights"]
+ ["Misc",30,OT_miscables,[0,3,1.2],"Various other items, including spare wheels and lights"]
];
//People you can recruit, and squads are composed of
@@ -117,7 +112,8 @@ OT_Recruitables = [
["I_Soldier_AT_F","AssaultRifle","launch_I_Titan_short_F",200,"",""], //9
["I_Soldier_AA_F","AssaultRifle","launch_I_Titan_F",200,"",""], //10
["I_Soldier_AAT_F","AssaultRifle","",200,"",""], //11
- ["I_Soldier_AAA_F","AssaultRifle","",200,"",""] //12
+ ["I_Soldier_AAA_F","AssaultRifle","",200,"",""], //12
+ ["I_soldier_GL_F","GrenadeLauncher","",200,"",""] //13
];
OT_Squadables = [
@@ -144,7 +140,7 @@ OT_faces_western = ["WhiteHead_1","WhiteHead_2","WhiteHead_3","WhiteHead_4","Whi
OT_faces_eastern = ["AsianHead_A3_01","AsianHead_A3_02","AsianHead_A3_03","AsianHead_A3_04","AsianHead_A3_05","AsianHead_A3_06","AsianHead_A3_07"];
OT_face_localBoss = "TanoanBossHead";
-OT_Resources = ["OT_Wood","OT_Steel","OT_Plastic","OT_Sugarcane","OT_Sugar"];
+OT_Resources = ["OT_Wood","OT_Steel","OT_Plastic","OT_Sugarcane","OT_Sugar","OT_Fertilizer"];
OT_civType_gunDealer = "C_man_p_fugitive_F";
OT_civType_local = "C_man_1";
@@ -155,7 +151,8 @@ OT_civType_priest = "C_man_w_worker_F";
OT_vehTypes_civ = []; //populated automatically, but you can add more here and they will appear in streets
OT_vehType_distro = "C_Van_01_box_F";
OT_vehType_ferry = "C_Boat_Transport_02_F";
-OT_vehTypes_civignore = ["C_Hatchback_01_F","C_Hatchback_01_sport_F"]; //Civs cannot drive these vehicles for whatever reason
+OT_vehType_service = "C_Offroad_01_repair_F";
+OT_vehTypes_civignore = ["C_Hatchback_01_F","C_Hatchback_01_sport_F",OT_vehType_service]; //Civs cannot drive these vehicles for whatever reason
OT_item_CargoContainer = "B_Slingload_01_Cargo_F";
@@ -170,7 +167,7 @@ OT_item_BasicGun = "hgun_P07_F";//Player starts with this weapon in their ammobo
OT_item_BasicAmmo = "16Rnd_9x21_Mag";
if(OT_hasAce) then {
- OT_consumableItems = ["ACE_fieldDressing","ACE_Sandbag_empty","ACE_elasticBandage","ItemMap","ToolKit","ACE_epinephrine"]; //Shops will try to stock more of these
+ OT_consumableItems = ["ACE_fieldDressing","ACE_Sandbag_empty","ACE_elasticBandage","ItemMap","ToolKit","ACE_epinephrine","OT_Fertilizer"]; //Shops will try to stock more of these
}else{
OT_consumableItems = ["FirstAidKit","Medikit","ItemMap","ToolKit"];
};
@@ -211,10 +208,7 @@ OT_NATO_AirSpawn = "NATO_airspawn";
OT_NATO_HQPos = [0,0,0];//Dont worry this gets populated later
OT_NATO_Vehicles_Garrison = [
- ["B_T_MRAP_01_hmg_F",5],
- ["B_T_MRAP_01_gmg_F",5],
- ["B_T_Static_AT_F",7],
- ["B_HMG_01_high_F",10]
+
];
OT_NATO_Vehicles_AirGarrison = [
@@ -228,6 +222,10 @@ OT_NATO_Vehicles_AirGarrison = [
["B_Plane_CAS_01_F",1]
];
+OT_NATO_StaticGarrison_LevelOne = ["B_HMG_01_high_F"];
+OT_NATO_StaticGarrison_LevelTwo = ["B_HMG_01_high_F","B_HMG_01_high_F","B_GMG_01_high_F","B_T_MRAP_01_hmg_F"];
+OT_NATO_StaticGarrison_LevelThree = ["B_T_Static_AT_F","B_T_Static_AA_F","B_HMG_01_high_F","B_HMG_01_high_F","B_GMG_01_high_F","B_T_MRAP_01_hmg_F","B_T_MRAP_01_gmg_F"];
+
OT_NATO_CommTowers = ["Land_TTowerBig_1_F","Land_TTowerBig_2_F"];
OT_NATO_Unit_PoliceCommander = "B_Gen_Commander_F";
@@ -236,24 +234,35 @@ OT_NATO_Vehicle_PoliceHeli = "B_Heli_Light_01_F";
OT_NATO_Vehicle_Quad = "B_Quadbike_01_F";
OT_NATO_Vehicle_Police = "B_GEN_Offroad_01_gen_F";
OT_NATO_Vehicle_Transport = ["B_T_Truck_01_transport_F","B_T_Truck_01_covered_F"];
+OT_NATO_Vehicle_Transport_Light = "B_CTRG_LSV_01_light_F";
OT_NATO_Vehicles_PoliceSupport = ["B_T_MRAP_01_hmg_F","B_T_MRAP_01_gmg_F","B_T_LSV_01_armed_F","B_Heli_Light_01_armed_F"];
-OT_NATO_Vehicles_AirDrones = ["B_UAV_02_F"];
+OT_NATO_Vehicles_ReconDrone = "B_UAV_01_F";
OT_NATO_Vehicles_CASDrone = "B_UAV_02_CAS_F";
OT_NATO_Vehicles_AirSupport = ["B_Heli_Attack_01_F"];
OT_NATO_Vehicles_AirSupport_Small = ["B_Heli_Light_01_armed_F"];
OT_NATO_Vehicles_GroundSupport = ["B_T_MRAP_01_gmg_F","B_T_MRAP_01_hmg_F","B_T_LSV_01_armed_F"];
+OT_NATO_Vehicles_Convoy = ["B_UGV_01_rcws_F","B_T_MRAP_01_hmg_F","B_T_LSV_01_armed_F","B_T_LSV_01_armed_F","B_T_LSV_01_armed_F"];
OT_NATO_Vehicles_AirWingedSupport = ["B_Plane_CAS_01_F"];
OT_NATO_Vehicle_AirTransport_Small = "B_Heli_Transport_01_camo_F";
OT_NATO_Vehicle_AirTransport = ["B_Heli_Transport_03_F","B_Heli_Transport_01_F","B_Heli_Transport_01_F"];
OT_NATO_Vehicle_AirTransport_Large = "B_Heli_Transport_03_F";
OT_NATO_Vehicle_Boat_Small = "B_Boat_Armed_01_minigun_F";
+OT_NATO_Sandbag_Curved = "Land_BagFence_01_round_green_F";
+OT_NATO_Barrier_Small = "Land_HBarrier_01_line_5_green_F";
+OT_NATO_Barrier_Large = "Land_HBarrier_01_wall_6_green_F";
+
OT_NATO_GroundForces = ["B_T_InfSquad_Weapons","B_T_InfSquad","B_T_InfSquad","B_T_InfSquad","B_T_InfSquad"];
+OT_NATO_Group_Recon = (configFile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Infantry" >> "B_T_ReconTeam");
+OT_NATO_Group_Engineers = (configfile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Support" >> "B_T_Support_ENG");
+OT_NATO_Group_CTRG = (configfile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Support" >> "B_T_Support_ENG");
OT_NATO_Unit_LevelOneLeader = "B_T_Soldier_TL_F";
OT_NATO_Units_LevelOne = ["B_T_Medic_F","B_T_Soldier_F","B_T_Soldier_LAT_F","B_T_Soldier_AAT_F","B_T_Soldier_AT_F","B_T_soldier_M_F","B_T_Soldier_GL_F","B_T_Soldier_AR_F"];
OT_NATO_Units_LevelTwo = OT_NATO_Units_LevelOne + ["B_T_Soldier_AA_F","B_T_Soldier_AAR_F","B_T_Soldier_AAA_F"];
+OT_NATO_Mortar = "B_T_Mortar_01_F";
+
OT_NATO_Unit_Pilot = "B_T_Pilot_F";
OT_NATO_Unit_Sniper = "B_T_Sniper_F";
OT_NATO_Unit_Spotter = "B_T_Spotter_F";
@@ -288,6 +297,7 @@ OT_interactingWith = objNull;
//The cost to produce an item will be the Base price - player/factory bonuses + raw materials
//The wholesale sell price of an item will be the base price - local markup
//NB: the local markup can be negative, making buy prices lower and sell prices higher, in certain situations (high stability and/or player rep)
+
OT_items = [];
if(OT_hasAce) then {
OT_item_DefaultBlueprints pushback "ACE_fieldDressing";
@@ -295,8 +305,8 @@ if(OT_hasAce) then {
[OT_items,[
["ACE_fieldDressing",2,0,0,0.1],
["ACE_elasticBandage",3,0,0,0.2],
- ["ACE_morphine",40,0,0,0.2],
- ["ACE_epinephrine",40,0,0,0.2],
+ ["ACE_morphine",20,0,0,0.2],
+ ["ACE_epinephrine",50,0,0,0.2],
["ACE_adenosine",40,0,0,0.2],
["ACE_SpraypaintBlue",20,0,0,0.2],
["ACE_SpraypaintRed",20,0,0,0.2],
@@ -326,7 +336,8 @@ if(OT_hasAce) then {
["ACE_UAVBattery",14,0,0,1],
["ACE_wirecutter",4,0,0,1],
["ACE_MapTools",2,0,0,1],
- ["ACE_bloodIV",120,0,0,1]
+ ["ACE_bloodIV",80,0,0,1],
+ ["ACE_Cellphone",100,0,0,1]
]] call BIS_fnc_arrayPushStack;
}else{
OT_item_DefaultBlueprints pushback "FirstAidKit";
@@ -406,6 +417,7 @@ cost setVariable ["OT_Steel",[30,0,0,0],true];
cost setVariable ["OT_Plastic",[20,0,0,0],true];
cost setVariable ["OT_Sugarcane",[15,0,0,0],true];
cost setVariable ["OT_Sugar",[25,0,0,0],true];
+cost setVariable ["OT_Fertilizer",[30,0,0,0],true];
if(OT_hasTFAR) then {
[OT_backpacks,[
@@ -543,6 +555,12 @@ private _allOptics = "
{ getNumber ( _x >> ""ItemInfo"" >> ""optics"" ) isEqualTo 1})
" configClasses ( configFile >> "cfgWeapons" );
+private _allDetonators = "
+ ( getNumber ( _x >> ""scope"" ) isEqualTo 2
+ &&
+ { getNumber ( _x >> ""ace_explosives_Detonator"" ) isEqualTo 1})
+" configClasses ( configFile >> "cfgWeapons" );
+
private _allUniforms = "
( getNumber ( _x >> ""scope"" ) isEqualTo 2
&&
@@ -586,6 +604,10 @@ OT_allOptics = [];
OT_allHelmets = [];
OT_allHats = [];
OT_allAttachments = [];
+OT_allExplosives = [];
+OT_explosives = [];
+OT_detonators = [];
+OT_allDetonators = [];
{
_name = configName _x;
@@ -618,7 +640,7 @@ OT_allAttachments = [];
}foreach(getArray(configFile >> "CfgVehicles" >> _cls >> "weapons"));
//Get ammo
{
- if !(_x in _blacklist) then {
+ if !(_x in _blacklist or _x in OT_allExplosives) then {
if !(_x in _weapons) then {_weapons pushback _x};
};
}foreach(getArray(configFile >> "CfgVehicles" >> _cls >> "magazines"));
@@ -742,26 +764,57 @@ OT_allAttachments = [];
{
_name = configName _x;
_m = getNumber(_x >> "mass");
- if(_name isKindOf ["CA_Magazine",configFile >> "CfgMagazines"] and _name != "NLAW_F") then {
+ if(_name isKindOf ["CA_Magazine",configFile >> "CfgMagazines"] and (_name != "NLAW_F") and !(_name isKindOf ["VehicleMagazine",configFile >> "CfgMagazines"])) then {
_cost = round(_m * 4);
_desc = getText(_x >> "descriptionShort");
+ _exp = false;
+ _steel = 0.1;
+ _plastic = 0;
+ if(getNumber(_x >> "ace_explosives_Placeable") == 1) then {
+ _exp = true;
+ };
if((_desc find "Smoke") > -1) then {
_cost = round(_m * 0.5);
+ }else{
+ if((_desc find "Grenade") > -1) then {
+ _cost = round(_m * 2);
+ _exp = true;
+ };
};
- if((_desc find "Flare") > -1) then {
+ if((_desc find "Flare") > -1 or (_desc find "flare") > -1) then {
_cost = round(_m * 0.6);
+ _exp = false;
};
- if((_desc find "Grenade") > -1) then {
- _cost = round(_m * 2);
- };
+
if(_name == OT_ammo_50cal) then {_cost = 50};
+
+ if(_exp) then {
+ _steel = 0;
+ _plastic = round(_m * 0.5);
+ OT_allExplosives pushback _name;
+ OT_explosives pushback [_name,_cost,0,_steel,_plastic];
+ }else{
+ OT_allMagazines pushback _name;
+ };
if(isServer) then {
- cost setVariable [_name,[_cost,0,0.1,0],true];
+ cost setVariable [_name,[_cost,0,_steel,_plastic],true];
};
- OT_allMagazines pushback _name;
};
} foreach (_allAmmo);
+{
+ _name = configName _x;
+ _m = getNumber(_x >> "ItemInfo" >> "mass");
+ if(getNumber(_x >> "ace_explosives_Range") > 1000) then {
+ _m = _m * 10;
+ };
+ OT_allDetonators pushback _name;
+ OT_detonators pushback [_name,_m,0,0.1,0];
+ if(isServer) then {
+ cost setVariable [_name,[_m,0,0.1,0],true];
+ };
+} foreach (_allDetonators);
+
if(isServer) then {
//Remainding vehicle costs
{
@@ -828,7 +881,7 @@ OT_attachments = [];
OT_allWeapons = OT_allSubMachineGuns + OT_allAssaultRifles + OT_allMachineGuns + OT_allSniperRifles + OT_allHandGuns + OT_allMissileLaunchers + OT_allRocketLaunchers;
if(isServer) then {
- cost setVariable ["CIV",[100,0,0,0],true];
+ cost setVariable ["CIV",[80,0,0,0],true];
cost setVariable ["WAGE",[5,0,0,0],true];
cost setVariable [OT_item_UAV,[200,0,0,1],true];
cost setVariable ["FUEL",[5,0,0,0],true];
@@ -892,24 +945,28 @@ OT_portBuilding = "Land_Warehouse_02_F";
OT_policeStation = "Land_Cargo_House_V3_F";
OT_warehouse = "Land_Warehouse_03_F";
OT_barracks = "Land_Barracks_01_grey_F";
+OT_workshopBuilding = "Land_Cargo_House_V4_F";
+OT_refugeeCamp = "Land_Medevac_house_V1_F";
+OT_trainingCamp = "Land_IRMaskingCover_02_F";
OT_loadingMessages = ["Adding Hidden Agendas","Adjusting Bell Curves","Aesthesizing Industrial Areas","Aligning Covariance Matrices","Applying Feng Shui Shaders","Applying Theatre Soda Layer","Asserting Packed Exemplars","Attempting to Lock Back-Buffer","Binding Sapling Root System","Breeding Fauna","Building Data Trees","Bureacritizing Bureaucracies","Calculating Inverse Probability Matrices","Calculating Llama Expectoration Trajectory","Calibrating Blue Skies","Charging Ozone Layer","Coalescing Cloud Formations","Cohorting Exemplars","Collecting Meteor Particles","Compounding Inert Tessellations","Compressing Fish Files","Computing Optimal Bin Packing","Concatenating Sub-Contractors","Containing Existential Buffer","Debarking Ark Ramp","Debunching Unionized Commercial Services","Deciding What Message to Display Next","Decomposing Singular Values","Decrementing Tectonic Plates","Deleting Ferry Routes","Depixelating Inner Mountain Surface Back Faces","Depositing Slush Funds","Destabilizing Economic Indicators","Determining Width of Blast Fronts","Deunionizing Bulldozers","Dicing Models","Diluting Livestock Nutrition Variables","Downloading Satellite Terrain Data","Exposing Flash Variables to Streak System","Extracting Resources","Factoring Pay Scale","Fixing Election Outcome Matrix","Flood-Filling Ground Water","Flushing Pipe Network","Gathering Particle Sources","Generating Jobs","Gesticulating Mimes","Graphing Whale Migration","Hiding Willio Webnet Mask","Implementing Impeachment Routine","Increasing Accuracy of RCI Simulators","Increasing Magmafacation","Initializing Rhinoceros Breeding Timetable","Initializing Robotic Click-Path AI","Inserting Sublimated Messages","Integrating Curves","Integrating Illumination Form Factors","Integrating Population Graphs","Iterating Cellular Automata","Lecturing Errant Subsystems","Mixing Genetic Pool","Modeling Object Components","Mopping Occupant Leaks","Normalizing Power","Obfuscating Quigley Matrix","Overconstraining Dirty Industry Calculations","Partitioning City Grid Singularities","Perturbing Matrices","Pixellating Nude Patch","Polishing Water Highlights","Populating Lot Templates","Preparing Sprites for Random Walks","Prioritizing Landmarks","Projecting Law Enforcement Pastry Intake","Realigning Alternate Time Frames","Reconfiguring User Mental Processes","Relaxing Splines","Removing Road Network Speed Bumps","Removing Texture Gradients","Removing Vehicle Avoidance Behavior","Resolving GUID Conflict","Reticulating Splines","Retracting Phong Shader","Retrieving from Back Store","Reverse Engineering Image Consultant","Routing Neural Network Infanstructure","Scattering Rhino Food Sources","Scrubbing Terrain","Searching for Llamas","Seeding Architecture Simulation Parameters","Sequencing Particles","Setting Advisor ","Setting Inner Deity ","Setting Universal Physical Constants","Sonically Enhancing Occupant-Free Timber","Speculating Stock Market Indices","Splatting Transforms","Stratifying Ground Layers","Sub-Sampling Water Data","Synthesizing Gravity","Synthesizing Wavelets","Time-Compressing Simulator Clock","Unable to Reveal Current Activity","Weathering Buildings","Zeroing Crime Network"];
OT_allBuyableBuildings = OT_lowPopHouses + OT_medPopHouses + OT_highPopHouses + OT_hugePopHouses + OT_mansions + [OT_item_Tent,OT_item_Flag];
-OT_allRealEstate = OT_lowPopHouses + OT_medPopHouses + OT_highPopHouses + OT_hugePopHouses + OT_mansions + [OT_warehouse,OT_policeStation,OT_barracks,OT_barracks,"Land_Cargo_House_V4_F"];
+OT_allRealEstate = OT_lowPopHouses + OT_medPopHouses + OT_highPopHouses + OT_hugePopHouses + OT_mansions + [OT_warehouse,OT_policeStation,OT_barracks,OT_barracks,OT_workshopBuilding,OT_refugeeCamp,OT_trainingCamp];
OT_Buildables = [
- ["Training Camp",1200,[] call compileFinal preProcessFileLineNumbers "templates\military\trainingCamp.sqf","structures\trainingCamp.sqf",true,"Allows training of recruits and hiring of mercenaries"],
+ ["Training Camp",1500,[] call compileFinal preProcessFileLineNumbers "templates\military\trainingCamp.sqf","structures\trainingCamp.sqf",true,"Allows training of recruits and hiring of mercenaries"],
["Bunkers",500,["Land_BagBunker_01_small_green_F","Land_HBarrier_01_big_tower_green_F","Land_HBarrier_01_tower_green_F"],"",false,"Small Defensive Structures. Press space to change type."],
["Walls",200,["Land_ConcreteWall_01_l_8m_F","Land_ConcreteWall_01_l_gate_F","Land_HBarrier_01_wall_6_green_F","Land_HBarrier_01_wall_4_green_F","Land_HBarrier_01_wall_corner_green_F"],"",false,"Stop people (or tanks) from getting in. Press space to change type."],
- ["Helipad",50,["Land_HelipadCircle_F","Land_HelipadCivil_F","Land_HelipadRescue_F","Land_HelipadSquare_F"],"",false,"Apparently helicopter pilots need to be told where they are allowed to land"],
+ ["Helipad",50,["Land_HelipadCircle_F","Land_HelipadCivil_F","Land_HelipadRescue_F","Land_HelipadSquare_F"],"",false,"Informs helicopter pilots of where might be a nice place to land"],
["Observation Post",800,["Land_Cargo_Patrol_V4_F"],"structures\observationPost.sqf",false,"Includes unarmed personnel to keep an eye over the area and provide intel on enemy positions"],
["Barracks",5000,[OT_barracks],"",false,"Allows recruiting of squads"],
- ["Guard Tower",10000,["Land_Cargo_Tower_V4_F"],"",false,"It's a huge tower, what else do you need?."],
+ ["Guard Tower",5000,["Land_Cargo_Tower_V4_F"],"",false,"It's a huge tower, what else do you need?."],
["Hangar",1200,["Land_Airport_01_hangar_F"],"",false,"A big empty building, could probably fit a plane inside it."],
- ["Workshop",2500,[] call compileFinal preProcessFileLineNumbers "templates\military\workshop.sqf","structures\workshop.sqf",true,"Attach weapons to vehicles"],
+ ["Workshop",1000,[] call compileFinal preProcessFileLineNumbers "templates\military\workshop.sqf","structures\workshop.sqf",true,"Attach weapons to vehicles"],
["House",1100,["Land_House_Small_06_F","Land_House_Small_02_F","Land_House_Small_03_F","Land_GarageShelter_01_F","Land_Slum_04_F"],"",false,"4 walls, a roof, and if you're lucky a door that opens."],
- ["Police Station",3500,[OT_policeStation],"structures\policeStation.sqf",false,"Allows hiring of policeman to raise stability in a town and keep the peace. Comes with 2 units."],
- ["Warehouse",5000,[OT_warehouse],"structures\warehouse.sqf",false,"A house that you put wares in."]
+ ["Police Station",2500,[OT_policeStation],"structures\policeStation.sqf",false,"Allows hiring of policeman to raise stability in a town and keep the peace. Comes with 2 units."],
+ ["Warehouse",4000,[OT_warehouse],"structures\warehouse.sqf",false,"A house that you put wares in."],
+ ["Refugee Camp",600,[OT_refugeeCamp],"",false,"Attracts scared civilians that are more likely to join your cause"]
];
OT_workshop = [
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/intelSystem.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/intelSystem.sqf
index fe29f753..2d6afe9e 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/intelSystem.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/intelSystem.sqf
@@ -100,6 +100,18 @@ _handler = {
_t = _t + 1;
}foreach(units (group player));
+ {
+ (_this select 0) drawIcon [
+ "\A3\ui_f\data\map\markers\nato\b_mortar.paa",
+ [0,0.3,0.59,(2000 - (_x select 1)) / 2000],
+ _x select 2,
+ 24,
+ 24,
+ 0,
+ ""
+ ];
+ }foreach(spawner getVariable ["NATOmortars",[]]);
+
{
_passengers = "";
_color = [0,0.5,0,1];
@@ -227,7 +239,7 @@ _handler = {
}
}foreach(OT_allTowns);
{
- if !(_x getVariable ["looted",false]) then {
+ if ((typeof _x != "B_UAV_AI") and !(_x getVariable ["looted",false])) then {
(_this select 0) drawIcon [
"ot\ui\markers\death.paa",
[1,1,1,0.5],
@@ -249,23 +261,16 @@ _handler = {
getdir _x
];
};
- if(_x isKindOf "StaticWeapon" and isNull attachedTo _x) then {
- _do = false;
- _color = [0,0.5,0,1];
- if(side _x == resistance) then {
- _do = true;
- }else{
- if(resistance knowsAbout _x > 0) then {
- _do = true;
- _color = [0.5,0,0,1]
- };
- };
- if(_do) then {
+ if((_x isKindOf "StaticWeapon") and (isNull attachedTo _x) and (alive _x)) then {
+ if(side _x == civilian or side _x == resistance or captive _x) then {
+ _col = [0.5,0.5,0.5,1];
+ if(!(isNull gunner _x) and (alive gunner _x)) then {_col = [0,0.5,0,1]};
_i = "\A3\ui_f\data\map\markers\nato\o_art.paa";
if(_x isKindOf "StaticMortar") then {_i = "\A3\ui_f\data\map\markers\nato\o_mortar.paa"};
+ if !(someAmmo _x) then {_col set [3,0.4]};
(_this select 0) drawIcon [
_i,
- _color,
+ _col,
position _x,
30,
30,
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf
index feea4b6a..b2f35b6f 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initObjectLocal.sqf
@@ -1,10 +1,6 @@
if(typeof _this == OT_item_Map) then {
_this addAction ["Town Info", "actions\townInfo.sqf",nil,0,false,true,"",""];
_this addAction ["Most Wanted", "actions\mostWanted.sqf",nil,0,false,true,"",""];
- _this addAction ["Options", {
- closedialog 0;
- _nul = createDialog "OT_dialog_options";
- },nil,0,false,true,"",""];
_this addAction ["Reset UI", {
closedialog 0;
[] execVM "setupPlayer.sqf";
@@ -20,7 +16,7 @@ if(typeof _this == OT_item_Storage) then {
private _iswarehouse = call OT_fnc_playerAtWarehouse;
if !(_iswarehouse) exitWith {
- "No warehouse within range" call notify_minor;
+ "No warehouse within range or needs repair" call OT_fnc_notifyMinor;
};
OT_warehouseTarget = _this select 0;
@@ -29,17 +25,21 @@ if(typeof _this == OT_item_Storage) then {
[] call warehouseDialog;
},nil,0,false,true,"","call OT_fnc_playerAtWarehouse"];
_this addAction ["Store In Warehouse", {
+ private _iswarehouse = call OT_fnc_playerAtWarehouse;
+ if !(_iswarehouse) exitWith {
+ "No warehouse within range or needs repair" call OT_fnc_notifyMinor;
+ };
OT_warehouseTarget = _this select 0;
- [] spawn transferTo;
+ [] spawn OT_fnc_transferTo;
},nil,0,false,true,"","call OT_fnc_playerAtWarehouse"];
if(_this call OT_fnc_playerIsOwner) then {
_this addAction ["Lock", {
(_this select 0) setVariable ["OT_locked",true,true];
- "Ammobox locked" call notify_minor;
+ "Ammobox locked" call OT_fnc_notifyMinor;
},nil,0,false,true,"","!(_target getVariable ['OT_locked',false])"];
_this addAction ["Unlock", {
(_this select 0) setVariable ["OT_locked",false,true];
- "Ammobox unlocked" call notify_minor;
+ "Ammobox unlocked" call OT_fnc_notifyMinor;
},nil,0,false,true,"","(_target getVariable ['OT_locked',false])"];
};
};
@@ -63,6 +63,4 @@ if(OT_hasACE) then {
_dir = 90;
};
[_this, true, [0, 2, 0.4],_dir] call ace_dragging_fnc_setCarryable;
-}else{
- _this addAction ["Move this", "actions\move.sqf",nil,0,false,true,"",""];
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initStaticMGLocal.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initStaticMGLocal.sqf
index 51320ba7..5ad74375 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initStaticMGLocal.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/interaction/initStaticMGLocal.sqf
@@ -15,15 +15,15 @@ if !(_wpn getVariable ["actioned",false]) then {
_p removeMagazineGlobal OT_ammo_50cal;
_p removeMagazineGlobal OT_ammo_50cal;
_w spawn {
- "Rearming MG..." call notify_minor;
+ "Rearming MG..." call OT_fnc_notifyMinor;
[15,false] call progressBar;
sleep 15;
[_this,1] remoteExec ["setVehicleAmmoDef",_this,_this];
- "MG rearmed" call notify_minor;
+ "MG rearmed" call OT_fnc_notifyMinor;
disableUserInput false;
};
}else{
- "You need 4 x 12.7mm M2 HMG Belts to rearm this MG" call notify_minor;
+ "You need 4 x 12.7mm M2 HMG Belts to rearm this MG" call OT_fnc_notifyMinor;
};
},[],1.5,false,true,"","(alive _target)",5];
_wpn setVariable ["actioned",true,false];
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf
index 8443129e..ca9c1804 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/keyHandler.sqf
@@ -6,7 +6,7 @@ _key = _this select 1;
if (_key == 21) then
{
if(!dialog) then {
- if(count (player nearObjects ["Land_Cargo_House_V4_F",10]) > 0) then {
+ if(count (player nearObjects [OT_workshopBuilding,10]) > 0) then {
[] call workshopDialog;
}else{
if((vehicle player) != player and count (player nearObjects [OT_portBuilding,30]) > 0) then {
@@ -34,7 +34,7 @@ if (_key == 21) then
private _cost = player getVariable ["OT_ferryCost",0];
if((player getVariable "money") < _cost) exitWith {
- "You cannot afford that!" call notify_minor;
+ "You cannot afford that!" call OT_fnc_notifyMinor;
};
[-_cost] call money;
cutText [format["Skipping ferry to %1",_town],"BLACK",2];
@@ -55,15 +55,7 @@ if (_key == 21) then
deleteVehicle _veh;
};
};
- _b = player call OT_fnc_nearestRealEstate;
- _iswarehouse = false;
- if(typename _b == "ARRAY") then {
- _building = _b select 0;
- if((typeof _building) == OT_warehouse and _building call OT_fnc_hasOwner) then {
- _iswarehouse = true;
- };
- };
- if(_iswarehouse) then {
+ if(call OT_fnc_playerAtWarehouse) then {
createDialog "OT_dialog_vehiclewarehouse";
}else{
createDialog "OT_dialog_vehicle";
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm
index b9f2d0ab..54c80adf 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/mission.sqm
@@ -8,7 +8,7 @@ class EditorData
toggles=522;
class ItemIDProvider
{
- nextID=2092;
+ nextID=2109;
};
class MarkerIDProvider
{
@@ -16,14 +16,14 @@ class EditorData
};
class LayerIndexProvider
{
- nextID=244;
+ nextID=299;
};
class Camera
{
- pos[]={4243.1357,213.96484,8514.3701};
- dir[]={-0.18939824,-0.81224841,-0.55183423};
- up[]={-0.26368478,0.58325732,-0.7682761};
- aside[]={-0.94591063,4.8257789e-007,0.3246502};
+ pos[]={12880.063,4.9866929,4514.0859};
+ dir[]={-0.39422134,-0.028979944,0.91865265};
+ up[]={-0.011464994,0.99956822,0.026719522};
+ aside[]={0.919052,-4.5984052e-009,0.39439592};
};
};
binarizationWanted=0;
@@ -1205,6 +1205,7 @@ class Mission
flags=2;
class Attributes
{
+ rank="COLONEL";
init="this setCaptive true;";
name="bigboss";
description="Host";
@@ -2462,6 +2463,7 @@ class Mission
flags=2;
class Attributes
{
+ rank="COLONEL";
init="this setCaptive true;";
isPlayable=1;
class Inventory
@@ -2661,6 +2663,7 @@ class Mission
flags=2;
class Attributes
{
+ rank="COLONEL";
init="this setCaptive true;";
isPlayable=1;
class Inventory
@@ -2925,6 +2928,7 @@ class Mission
flags=6;
class Attributes
{
+ rank="COLONEL";
init="this setCaptive true;";
isPlayable=1;
class Inventory
@@ -3124,6 +3128,7 @@ class Mission
flags=6;
class Attributes
{
+ rank="COLONEL";
init="this setCaptive true;";
isPlayable=1;
class Inventory
@@ -3316,13 +3321,14 @@ class Mission
dataType="Object";
class PositionInfo
{
- position[]={8256.2539,2.3171685,1133.2538};
- angles[]={0,2.4981525,0};
+ position[]={8256.2539,2.3174651,1133.254};
+ angles[]={0,2.4981596,0};
};
side="Independent";
flags=2;
class Attributes
{
+ rank="COLONEL";
init="this setCaptive true;";
isPlayable=1;
class Inventory
@@ -3346,7 +3352,7 @@ class Mission
};
id=1788;
type="I_G_Soldier_F";
- atlOffset=0.25373316;
+ atlOffset=0.25399995;
class CustomAttributes
{
class Attribute0
@@ -3490,7 +3496,7 @@ class Mission
{
};
id=1787;
- atlOffset=0.25373316;
+ atlOffset=0.25399995;
};
class Item43
{
@@ -3515,13 +3521,14 @@ class Mission
dataType="Object";
class PositionInfo
{
- position[]={8254.4824,1.3515821,1124.9368};
- angles[]={0,2.4981525,0};
+ position[]={8254.4824,1.3518713,1124.937};
+ angles[]={0,2.4981596,0};
};
side="Independent";
flags=6;
class Attributes
{
+ rank="COLONEL";
init="this setCaptive true;";
isPlayable=1;
class Inventory
@@ -3545,7 +3552,7 @@ class Mission
};
id=1791;
type="I_G_Soldier_F";
- atlOffset=0.108729;
+ atlOffset=0.10899997;
class CustomAttributes
{
class Attribute0
@@ -3689,7 +3696,7 @@ class Mission
{
};
id=1790;
- atlOffset=0.108729;
+ atlOffset=0.10899997;
};
class Item45
{
@@ -3714,13 +3721,14 @@ class Mission
dataType="Object";
class PositionInfo
{
- position[]={8252.9834,1.5238681,1126.812};
- angles[]={0,2.4981525,0};
+ position[]={8252.9834,1.5235863,1126.812};
+ angles[]={0,2.4981596,0};
};
side="Independent";
flags=6;
class Attributes
{
+ rank="COLONEL";
init="this setCaptive true;";
isPlayable=1;
class Inventory
@@ -3744,7 +3752,7 @@ class Mission
};
id=1794;
type="I_G_Soldier_F";
- atlOffset=0.14028168;
+ atlOffset=0.13999987;
class CustomAttributes
{
class Attribute0
@@ -3888,7 +3896,7 @@ class Mission
{
};
id=1793;
- atlOffset=0.14028168;
+ atlOffset=0.13999987;
};
class Item47
{
@@ -3913,13 +3921,14 @@ class Mission
dataType="Object";
class PositionInfo
{
- position[]={8250.415,1.6760843,1130.4153};
- angles[]={0,2.4981525,0};
+ position[]={8250.415,1.6765374,1130.415};
+ angles[]={0,2.4981596,0};
};
side="Independent";
flags=6;
class Attributes
{
+ rank="COLONEL";
init="this setCaptive true;";
isPlayable=1;
class Inventory
@@ -3943,7 +3952,7 @@ class Mission
};
id=1797;
type="I_G_Soldier_F";
- atlOffset=0.12352729;
+ atlOffset=0.12399995;
class CustomAttributes
{
class Attribute0
@@ -4087,7 +4096,7 @@ class Mission
{
};
id=1796;
- atlOffset=0.12352729;
+ atlOffset=0.12399995;
};
class Item49
{
@@ -4112,13 +4121,14 @@ class Mission
dataType="Object";
class PositionInfo
{
- position[]={8253.6445,2.5550501,1134.1543};
- angles[]={0,2.4981525,0};
+ position[]={8253.6445,2.5549362,1134.1541};
+ angles[]={0,2.4981596,0};
};
side="Independent";
flags=2;
class Attributes
{
+ rank="COLONEL";
init="this setCaptive true;";
isPlayable=1;
class Inventory
@@ -4142,7 +4152,7 @@ class Mission
};
id=1800;
type="I_G_Soldier_F";
- atlOffset=0.40408397;
+ atlOffset=0.40399981;
class CustomAttributes
{
class Attribute0
@@ -4286,7 +4296,7 @@ class Mission
{
};
id=1799;
- atlOffset=0.40408397;
+ atlOffset=0.40399981;
};
class Item51
{
@@ -4311,13 +4321,14 @@ class Mission
dataType="Object";
class PositionInfo
{
- position[]={8258.5771,0.14868355,1134.9779};
- angles[]={0,2.4981525,0};
+ position[]={8258.5771,0.14835906,1134.978};
+ angles[]={0,2.4981596,0};
};
side="Independent";
flags=6;
class Attributes
{
+ rank="COLONEL";
init="this setCaptive true;";
isPlayable=1;
class Inventory
@@ -4341,7 +4352,7 @@ class Mission
};
id=1803;
type="I_G_Soldier_F";
- atlOffset=-2.4196291;
+ atlOffset=-2.4200001;
class CustomAttributes
{
class Attribute0
@@ -4485,7 +4496,7 @@ class Mission
{
};
id=1802;
- atlOffset=-2.4196291;
+ atlOffset=-2.4200001;
};
class Item53
{
@@ -4510,13 +4521,14 @@ class Mission
dataType="Object";
class PositionInfo
{
- position[]={8257.6729,1.984525,1129.015};
- angles[]={0,2.4981525,0};
+ position[]={8257.6729,1.9845835,1129.015};
+ angles[]={0,2.4981596,0};
};
side="Independent";
flags=2;
class Attributes
{
+ rank="COLONEL";
init="this setCaptive true;";
isPlayable=1;
class Inventory
@@ -4540,7 +4552,7 @@ class Mission
};
id=1806;
type="I_G_Soldier_F";
- atlOffset=0.42794144;
+ atlOffset=0.42799997;
class CustomAttributes
{
class Attribute0
@@ -4684,7 +4696,7 @@ class Mission
{
};
id=1805;
- atlOffset=0.42794144;
+ atlOffset=0.42799997;
};
class Item55
{
@@ -6058,13 +6070,14 @@ class Mission
dataType="Object";
class PositionInfo
{
- position[]={8256.4756,1.618032,1126.9211};
- angles[]={0,2.4981525,0};
+ position[]={8256.4756,1.6179008,1126.921};
+ angles[]={0,2.4981596,0};
};
side="Independent";
flags=2;
class Attributes
{
+ rank="COLONEL";
init="this setCaptive true;";
isPlayable=1;
class Inventory
@@ -6088,7 +6101,7 @@ class Mission
};
id=1809;
type="I_G_Soldier_F";
- atlOffset=0.2501204;
+ atlOffset=0.25;
class CustomAttributes
{
class Attribute0
@@ -6232,7 +6245,7 @@ class Mission
{
};
id=1808;
- atlOffset=0.2501204;
+ atlOffset=0.25;
};
class Item70
{
@@ -6246,13 +6259,14 @@ class Mission
dataType="Object";
class PositionInfo
{
- position[]={8251.585,1.2179973,1124.9506};
- angles[]={0,2.4981525,0};
+ position[]={8251.585,1.2179425,1124.951};
+ angles[]={0,2.4981596,0};
};
side="Independent";
flags=6;
class Attributes
{
+ rank="COLONEL";
init="this setCaptive true;";
isPlayable=1;
class Inventory
@@ -6276,7 +6290,7 @@ class Mission
};
id=1812;
type="I_G_Soldier_F";
- atlOffset=0.07810235;
+ atlOffset=0.077999949;
class CustomAttributes
{
class Attribute0
@@ -6420,7 +6434,7 @@ class Mission
{
};
id=1811;
- atlOffset=0.07810235;
+ atlOffset=0.077999949;
};
class Item71
{
@@ -6445,13 +6459,14 @@ class Mission
dataType="Object";
class PositionInfo
{
- position[]={8253.5996,0.81719291,1120.6194};
- angles[]={0,2.4981525,0};
+ position[]={8253.5996,0.81686687,1120.619};
+ angles[]={0,2.4981596,0};
};
side="Independent";
flags=6;
class Attributes
{
+ rank="COLONEL";
init="this setCaptive true;";
isPlayable=1;
class Inventory
@@ -6475,7 +6490,7 @@ class Mission
};
id=1940;
type="I_G_Soldier_F";
- atlOffset=-0.013695061;
+ atlOffset=-0.014000058;
class CustomAttributes
{
class Attribute0
@@ -6619,7 +6634,7 @@ class Mission
{
};
id=1939;
- atlOffset=-0.013695061;
+ atlOffset=-0.014000058;
};
class Item73
{
@@ -6644,13 +6659,14 @@ class Mission
dataType="Object";
class PositionInfo
{
- position[]={8257.1074,0.86964691,1121.6503};
- angles[]={0,2.4981525,0};
+ position[]={8257.1074,0.86989158,1121.65};
+ angles[]={0,2.4981596,0};
};
side="Independent";
flags=6;
class Attributes
{
+ rank="COLONEL";
init="this setCaptive true;";
isPlayable=1;
class Inventory
@@ -6674,7 +6690,7 @@ class Mission
};
id=1943;
type="I_G_Soldier_F";
- atlOffset=-0.039268434;
+ atlOffset=-0.038999975;
class CustomAttributes
{
class Attribute0
@@ -6818,7 +6834,7 @@ class Mission
{
};
id=1942;
- atlOffset=-0.039268434;
+ atlOffset=-0.038999975;
};
class Item75
{
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/fugitive.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/fugitive.sqf
index 5e60f445..05b69479 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/fugitive.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/fugitive.sqf
@@ -77,7 +77,7 @@ _difficulty = 1.8;
//If mission was not a success
if !(_wassuccess) then {
- format ["Incoming message from %1: 'Abort mission. You have been spotted.'",_factionName] call notify_minor;
+ format ["Incoming message from %1: 'Abort mission. You have been spotted.'",_factionName] call OT_fnc_notifyMinor;
//Get outta here
_group = group (player getVariable [format["fugitive%1",_faction],objNull]);
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/medicalsupplies.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/medicalsupplies.sqf
index 79690b53..27f7a69e 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/medicalsupplies.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/missions/medicalsupplies.sqf
@@ -51,7 +51,7 @@ _difficulty = 0.5;
if((time - _lastwarning) > 5) then {
if((_numavailable > 0) and _numavailable < _threshold) then {
- "At least 10 bandages required to complete mission" call notify_minor;
+ "At least 10 bandages required to complete mission" call OT_fnc_notifyMinor;
};
_p set [2,time];
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/onPlayerRespawn.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/onPlayerRespawn.sqf
index e10ae687..8c5657ec 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/onPlayerRespawn.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/onPlayerRespawn.sqf
@@ -21,7 +21,7 @@ _newrecruits = [];
_civ = _x select 2;
if(_owner == (getplayeruid player)) then {
if(typename _civ == "OBJECT") then {
- if((_civ getVariable "owner") == (getplayeruid player)) then {
+ if(_civ call OT_fnc_playerIsOwner) then {
[_civ] joinSilent (group player);
};
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/ambientVehicles.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/ambientVehicles.sqf
index bd767db3..4612f84b 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/ambientVehicles.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/ambientVehicles.sqf
@@ -44,6 +44,7 @@ while {(_count < _numVeh)} do {
if(count _posVeh > 0) then {
_veh = _vehtype createVehicle _posVeh;
+ _veh setVariable ["ambient",true,true];
clearItemCargoGlobal _veh;
_veh setFuel (0.2 + (random 0.5));
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/gunDealer.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/gunDealer.sqf
index 40eb178a..4b9febc8 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/gunDealer.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/gunDealer.sqf
@@ -14,7 +14,7 @@ if(isNil "_gundealerpos") then {
_building = [_posTown,OT_gunDealerHouses] call OT_fnc_getRandomBuilding;
_gundealerpos = (_building call BIS_fnc_buildingPositions) call BIS_fnc_selectRandom;
server setVariable [format["gundealer%1",_town],_gundealerpos,true];
- _building setVariable ["owner","system",true];
+ [_building,"system"] call OT_fnc_setOwner;
};
_group = createGroup civilian;
_groups pushback _group;
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 32741247..d405e4fe 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
@@ -17,8 +17,8 @@ private _attacking = server getVariable["NATOattacking",""];
_pos = _x select 0;
_name = _x select 1;
_garrison = server getVariable[format["garrison%1",_name],0];
- if(_name != _attacking and _garrison > 3) then {
- if(_pos inArea _region and !(_name in _abandoned)) then {
+ if(_name != _attacking) then {
+ if(([_pos,_townPos] call OT_fnc_regionIsConnected) and !(_name in _abandoned)) then {
_d = (_pos distance _townPos);
if(_d < _dist) then {
_dist = _d;
@@ -30,14 +30,6 @@ private _attacking = server getVariable["NATOattacking",""];
}foreach(OT_NATOobjectives);
if(!isNil "_close") then {
- if((_close distance _townPos) > 2000) then {
- _closestTown = [_townPos,true] call OT_fnc_nearestTown;
- if !(_closestTown in _abandoned) then {
- _close = server getVariable _closestTown;
- _closest = _closestTown;
- };
- };
-
_current = server getVariable [format ["garrison%1",_town],0];
server setVariable [format ["garrison%1",_town],_current+4,true];
if !(_townPos call OT_fnc_inSpawnDistance) exitWith {};
@@ -45,6 +37,17 @@ if(!isNil "_close") then {
_start = [_close,0,200, 1, 0, 0, 0] call BIS_fnc_findSafePos;
_group = creategroup blufor;
_groups pushback _group;
+ _usecar = false;
+ _veh = objNull;
+
+ if(((_close distance _townPos) > 2000) and (random 100) > 50) then {
+ _spawnpos = _start findEmptyPosition [0,100,OT_NATO_Vehicle_Police];
+ _veh = OT_NATO_Vehicle_Police createVehicle _spawnpos;
+ _veh setDir (random 360);
+ _group addVehicle _veh;
+ _usecar = true;
+ _groups pushback _veh;
+ };
_civ = _group createUnit [OT_NATO_Unit_PoliceCommander, _start, [],0, "NONE"];
_police pushBack _civ;
@@ -73,6 +76,21 @@ if(!isNil "_close") then {
[_civ,_town] call OT_fnc_initGendarm;
_civ setBehaviour "SAFE";
+ if(_usecar) then {
+ {
+ _x moveInAny _veh;
+ }foreach(units _group);
+
+ _drop = (([_townPos, 50, 350, 1, 0, 0, 0] call BIS_fnc_findSafePos) nearRoads 500) select 0;
+
+ _move = _group addWaypoint [_drop,0];
+ _move setWaypointType "MOVE";
+ _move setWaypointBehaviour "CARELESS";
+
+ _move = _group addWaypoint [_drop,0];
+ _move setWaypointType "UNLOAD";
+ };
+
sleep 1;
_group call OT_fnc_initGendarmPatrol;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryGarrison.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryGarrison.sqf
index 029bc769..ecef9b6b 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryGarrison.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/spawners/militaryGarrison.sqf
@@ -158,12 +158,12 @@ _road = objNull;
if(count _pos > 0) then {
_dir = [_posTown,_pos] call BIS_fnc_dirTo;
_p = [_pos,1.5,_dir] call BIS_fnc_relPos;
- _veh = "Land_BagFence_Round_F" createVehicle _p;
+ _veh = OT_NATO_Sandbag_Curved createVehicle _p;
_veh setpos _p;
_veh setDir (_dir-180);
_groups pushback _veh;
_p = [_pos,-1.5,_dir] call BIS_fnc_relPos;
- _veh = "Land_BagFence_Round_F" createVehicle _p;
+ _veh = OT_NATO_Sandbag_Curved createVehicle _p;
_veh setpos _p;
_veh setDir (_dir);
_groups pushback _veh;
@@ -202,7 +202,7 @@ _road = objNull;
_civ setVariable ["garrison","HQ",false];
_civ setVariable ["hvt",true,true];
_civ setVariable ["hvt_id",_id,true];
- _civ setVariable ["VCOM_NOPATHING_Unit",true,false];
+ _civ setVariable ["NOAI",true,true];
_civ setRank "COLONEL";
_civ setBehaviour "SAFE";
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/structures/workshop.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/structures/workshop.sqf
index d2e54fe8..181aa6d2 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/structures/workshop.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/structures/workshop.sqf
@@ -1,8 +1,3 @@
-private ["_pos","_shop"];
+params ["_pos","_shop"];
-_pos = _this select 0;
-_shop = (_pos nearObjects ["Land_Cargo_House_V4_F",10]) select 0;
-
-if(OT_hasACE) then {
- [_shop] call ace_repair_fnc_moduleAssignRepairFacility;
-};
+_shop setVariable ["ACE_isRepairFacility",1,true];
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/military/trainingCamp.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/military/trainingCamp.sqf
index 5f83b5ac..c678b2c3 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/military/trainingCamp.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/templates/military/trainingCamp.sqf
@@ -1,24 +1,8 @@
[
- ["Land_IRMaskingCover_02_F",[-0.039865,0.14918,0],0,1,0,[],"","",true,false],
- ["Box_NATO_Grenades_F",[1.23933,-1.05774,0],93.4866,1,0,[],"","",true,false],
+ ["Land_IRMaskingCover_02_F",[-0.039865,0.14918,0],0,1,0,[],"","",true,false],
+ ["Box_NATO_Grenades_F",[1.23933,-1.05774,0],93.4866,1,0,[],"","",true,false],
["Land_CampingTable_F",[-0.0490456,-1.74478,0],0,1,0,[],"","",true,false],
- ["Land_CampingChair_V2_F",[-1.44146,-1.7173,0],223.485,1,0,[],"","",true,false],
- ["B_CargoNet_01_ammo_F",[2.59602,-1.49866,0],0,1,0,[],"","",true,false],
- ["Box_NATO_Equip_F",[4.0512,-1.09256,0],90.3535,1,0,[],"","",true,false],
- ["Box_T_NATO_Wps_F",[-4.59645,-1.78761,0],205.797,1,0,[],"","",true,false],
- ["Land_ClutterCutter_large_F",[-0.694746,-6.60154,-7.9155e-005],0,1,0,[],"","",true,false],
- ["Land_Obstacle_Pass_F",[1.7224,6.14434,0],90,1,0,[],"","",true,false],
- ["Land_Obstacle_Crawl_F",[-3.78085,6.02422,0],90,1,0,[],"","",true,false],
- ["Land_Portable_generator_F",[-5.7769,-4.06599,0],0,1,0,[],"","",true,false],
- ["Land_SatelliteAntenna_01_F",[-6.41051,-3.00256,0],212.621,1,0,[],"","",true,false],
- ["Target_F",[6.05507,-5.10407,0],90,1,0,[],"","",true,false],
- ["Land_Obstacle_Saddle_F",[5.46514,6.16445,0],90,1,0,[],"","",true,false],
- ["Target_F",[6.05507,-6.10407,0],90,1,0,[],"","",true,false],
- ["Land_ClutterCutter_large_F",[2.68296,8.92177,0],0,1,0,[],"","",true,false],
- ["Target_F",[6.05507,-7.10407,0],90,1,0,[],"","",true,false],
- ["Land_ClutterCutter_large_F",[-4.15402,8.36712,0],0,1,0,[],"","",true,false],
- ["Target_F",[6.05507,-8.10407,0],90,1,0,[],"","",true,false],
- ["Land_Obstacle_RunAround_F",[-3.47784,10.3439,0],90,1,0,[],"","",true,false],
- ["Land_Obstacle_Climb_F",[4.86212,10.1031,0],0,1,0,[],"","",true,false]
-]
\ No newline at end of file
+ ["Land_CampingChair_V2_F",[-1.44146,-1.7173,0],223.485,1,0,[],"","",true,false],
+ ["Land_ClutterCutter_large_F",[0,0,0],0,1,0,[],"","",true,false]
+]
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf
index 91b220e3..166c7b48 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf
+++ b/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/wantedSystem.sqf
@@ -49,80 +49,89 @@ _unit addEventHandler ["Fired", {
};
}];
-private _delay = 3;
-while {alive _unit} do {
- sleep 3;
- //check wanted status
- if(isplayer _unit and !(_unit getVariable["OT_healed",false])) then {
- if(_unit getVariable ["ACE_isUnconscious", false]) then {
- //Look for a medic
- private _medic = objNull;
- private _havepi = false;
- if((items player) find "ACE_epinephrine" > -1) then {_havepi = true};
- {
- if(_havepi or ((side _x == resistance or (_x call OT_fnc_hasOwner)) and !(isPlayer _x))) then {
- if(_havepi or ((items _x) find "ACE_epinephrine" > -1)) then {
- _medic = _x;
- };
- };
- if(!isNull _medic) exitWith{};
- }foreach(player nearentities["CAManBase",50]);
- if(!isNull _medic) then {
- _medic globalchat "On my way to help you";
- [_medic,_unit] call OT_fnc_orderRevivePlayer;
- }else{
- if(isMultiplayer) then {
- _numplayers = count([] call CBA_fnc_players);
- if(_numplayers > 1) then {
- format["%1 is unconscious",name player] remoteExec ["systemChat",0,false];
- _unit setVariable ["OT_healed",true,true];
- }else{
- "You are unconscious, there is no one nearby with Epinephrine to revive you" call notify_minor;
- sleep 5;
- _unit setDamage 1; //rip
- }
- }else{
- player allowdamage false;
- titleText ["You are unconscious, there is no one nearby with Epinephrine to revive you. Respawning...", "BLACK FADED", 2];
+if(isPlayer _unit) then {
+ [] spawn {
+ private _unit = player;
+ while {sleep 0.1;alive _unit} do {
+ if!(_unit getVariable["OT_healed",false]) then {
+ if(_unit getVariable ["ACE_isUnconscious", false]) then {
+ //Look for a medic
+ private _medic = objNull;
+ private _havepi = false;
+ if((items player) find "ACE_epinephrine" > -1) then {_havepi = true};
{
- if((_x select [0,4]) == "ace_") then {
- player setVariable [_x,nil];
+ if(_havepi or ((side _x == resistance or (_x call OT_fnc_hasOwner)) and !(isPlayer _x))) then {
+ if(_havepi or ((items _x) find "ACE_epinephrine" > -1)) then {
+ _medic = _x;
+ };
};
- }foreach(allvariables player);
- player setdamage 0;
- player setCaptive true;
- sleep 5;
- player setpos (player getVariable "home");
- removeAllWeapons player;
- removeAllItems player;
- removeAllAssignedItems player;
- removeBackpack player;
- removeVest player;
- removeGoggles player;
- removeHeadgear player;
+ if(!isNull _medic) exitWith{};
+ }foreach(player nearentities["CAManBase",50]);
+ if(!isNull _medic) then {
+ _medic globalchat "On my way to help you";
+ [_medic,_unit] call OT_fnc_orderRevivePlayer;
+ }else{
+ if(isMultiplayer) then {
+ _numplayers = count([] call CBA_fnc_players);
+ if(_numplayers > 1) then {
+ format["%1 is unconscious",name player] remoteExec ["systemChat",0,false];
+ _unit setVariable ["OT_healed",true,true];
+ }else{
+ "You are unconscious, there is no one nearby with Epinephrine to revive you" call OT_fnc_notifyMinor;
+ sleep 5;
+ _unit setDamage 1; //rip
+ }
+ }else{
+ player allowdamage false;
+ titleText ["You are unconscious, there is no one nearby with Epinephrine to revive you. Respawning...", "BLACK FADED", 2];
+ {
+ if((_x select [0,4]) == "ace_") then {
+ player setVariable [_x,nil];
+ };
+ }foreach(allvariables player);
+ player setdamage 0;
+ player setCaptive true;
+ sleep 5;
+ player setpos (player getVariable "home");
+ removeAllWeapons player;
+ removeAllItems player;
+ removeAllAssignedItems player;
+ removeBackpack player;
+ removeVest player;
+ removeGoggles player;
+ removeHeadgear player;
- {
- if((_x select [0,4]) == "ace_") then {
- player setVariable [_x,nil];
- };
- }foreach(allvariables player);
- player setDamage 0;
+ {
+ if((_x select [0,4]) == "ace_") then {
+ player setVariable [_x,nil];
+ };
+ }foreach(allvariables player);
+ player setDamage 0;
- -1 call influence;
- sleep 2;
- player setDamage 0;
- player linkItem "ItemMap";
- player switchMove "";
- titleText ["", "BLACK IN", 5];
- sleep 10;
- player allowdamage true;
+ -1 call influence;
+ sleep 2;
+ player setDamage 0;
+ player linkItem "ItemMap";
+ player switchMove "";
+ titleText ["", "BLACK IN", 5];
+ sleep 10;
+ player allowdamage true;
+ };
+ }
+ }else{
+ _unit setVariable ["OT_healed",false,true];
};
- }
- }else{
- _unit setVariable ["OT_healed",false,true];
+ };
};
};
+};
+
+private _delay = 3;
+
+while {alive _unit} do {
+ sleep 3;
+ //check wanted status
if !(captive _unit) then {
//CURRENTLY WANTED
@@ -160,7 +169,7 @@ while {alive _unit} do {
if !(_obname in (server getVariable ["NATOabandoned",[]])) then {
if(_obpos distance _playerpos < 2000) exitWith {
if(isPlayer _unit) then {
- "This is a no-fly zone" call notify_minor;
+ "This is a no-fly zone" call OT_fnc_notifyMinor;
};
_unit setCaptive false;
(vehicle _unit) spawn revealToNATO;
@@ -180,7 +189,7 @@ while {alive _unit} do {
_unit setCaptive false;
_unit spawn revealToNATO;
if(isPlayer _unit) then {
- "A gang has seen the static weapon" call notify_minor;
+ "A gang has seen the static weapon" call OT_fnc_notifyMinor;
};
};
}foreach(attachedObjects _unit);
@@ -207,7 +216,7 @@ while {alive _unit} do {
};
if ((primaryWeapon _unit != "") or (secondaryWeapon _unit != "") or (handgunWeapon _unit != "")) exitWith {
if(isPlayer _unit) then {
- "A gang has seen your weapon" call notify_minor;
+ "A gang has seen your weapon" call OT_fnc_notifyMinor;
};
_unit setCaptive false;
_unit spawn revealToNATO;
@@ -223,7 +232,7 @@ while {alive _unit} do {
if((_totalrep > _replim) and (random 1000 < _totalrep)) exitWith {
_unit setCaptive false;
if(isPlayer _unit) then {
- "A gang has recognized you" call notify_minor;
+ "A gang has recognized you" call OT_fnc_notifyMinor;
};
_unit spawn revealToCRIM;
};
@@ -245,7 +254,7 @@ while {alive _unit} do {
if((_totalrep > _replim) and (random 1000 < _totalrep)) exitWith {
_unit setCaptive false;
if(isPlayer _unit) then {
- "NATO has recognized you" call notify_minor;
+ "NATO has recognized you" call OT_fnc_notifyMinor;
};
_unit spawn revealToNATO;
}
@@ -256,7 +265,7 @@ while {alive _unit} do {
_unit setCaptive false;
_unit spawn revealToNATO;
if(isPlayer _unit) then {
- "NATO has seen the static weapon" call notify_minor;
+ "NATO has seen the static weapon" call OT_fnc_notifyMinor;
};
};
}foreach(attachedObjects _unit);
@@ -294,7 +303,14 @@ while {alive _unit} do {
};
if ((headgear _unit in OT_illegalHeadgear) or (vest _unit in OT_illegalVests)) exitWith {
if(isPlayer _unit) then {
- "You are wearing Gendarmerie gear" call notify_minor;
+ "You are wearing Gendarmerie gear" call OT_fnc_notifyMinor;
+ };
+ _unit setCaptive false;
+ _unit spawn revealToNATO;
+ };
+ if (hmd _unit != "") exitWith {
+ if(isPlayer _unit) then {
+ "NATO has spotted your NV Goggles" call OT_fnc_notifyMinor;
};
_unit setCaptive false;
_unit spawn revealToNATO;
@@ -312,7 +328,7 @@ while {alive _unit} do {
};
if(_obpos distance (getpos player) < _dist) exitWith {
if(isPlayer _unit) then {
- "You are in a restricted area" call notify_minor;
+ "You are in a restricted area" call OT_fnc_notifyMinor;
};
_unit setCaptive false;
_unit spawn revealToNATO;
@@ -327,11 +343,11 @@ while {alive _unit} do {
if(_attack != "") then {
_pos = server getVariable _attack;
private _playerpos = getpos _unit;
- if(_pos distance _playerpos < 500) then {
+ if(_pos distance _playerpos < 1000) then {
private _altitude = _playerpos select 2;
- _unit setCaptive false;
- _unit setVariable ["hiding",30,false];
if(_altitude > 5) then {
+ _unit setCaptive false;
+ _unit setVariable ["hiding",30,false];
//Radar is active here
(vehicle _unit) spawn revealToNATO;
};
diff --git a/addons/overthrow_main/config.cpp b/addons/overthrow_main/config.cpp
index 3ea31e3c..7df2cade 100644
--- a/addons/overthrow_main/config.cpp
+++ b/addons/overthrow_main/config.cpp
@@ -22,7 +22,7 @@ class CfgPatches
"cba_xeh",
"cba_jr"
};
- requiredVersion=1.66;
+ requiredVersion=1.69;
units[] = {"OT_GanjaItem","OT_BlowItem"};
weapons[] = {"OT_Ganja","OT_Blow"};
};
diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initCarDealer.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initCarDealer.sqf
index fa903c9a..c6ca2116 100644
--- a/addons/overthrow_main/functions/AI/NPC/fn_initCarDealer.sqf
+++ b/addons/overthrow_main/functions/AI/NPC/fn_initCarDealer.sqf
@@ -19,9 +19,9 @@ removeVest _unit;
_unit forceAddUniform (OT_clothes_carDealers call BIS_fnc_selectRandom);
-_unit setvariable ["owner","self"];
+[_unit,"self"] call OT_fnc_setOwner;
_unit addEventHandler ["FiredNear", {
- _u = _this select 0;
+ _u = _this select 0;
_u setUnitPos "DOWN";
-}];
\ No newline at end of file
+}];
diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initCivilian.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initCivilian.sqf
index d1326d67..84fe5a9f 100644
--- a/addons/overthrow_main/functions/AI/NPC/fn_initCivilian.sqf
+++ b/addons/overthrow_main/functions/AI/NPC/fn_initCivilian.sqf
@@ -24,11 +24,21 @@ _unit forceAddUniform (OT_clothes_locals call BIS_fnc_selectRandom);
_unit addEventHandler ["FiredNear", {
_u = _this select 0;
- if !(_u getVariable ["fleeing",false]) then {
- _u setVariable ["fleeing",true,false];
- _u setBehaviour "COMBAT";
- _by = _this select 1;
- _u allowFleeing 1;
- _u setskill ["courage",0];
+ _group = group _u;
+ if !(_group getVariable ["fleeing",false]) then {
+ _group setVariable ["fleeing",true,false];
+ _group setBehaviour "COMBAT";
+ _by = _this select 1;
+ _camps = _u nearObjects [OT_refugeeCamp,2500];
+ if(count _camps > 0) then {
+ _camp = _camps select 0;
+ while {(count (waypoints _group)) > 0} do {
+ deleteWaypoint ((waypoints _group) select 0);
+ };
+ _wp = _group addWaypoint [position _camp,30];
+ _wp setWaypointBehaviour "COMBAT";
+ _wp setWaypointType "MOVE";
+ _wp setWaypointSpeed "FULL";
+ };
};
-}];
\ No newline at end of file
+}];
diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initCivilianGroup.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initCivilianGroup.sqf
index 275ef4d5..99db581d 100644
--- a/addons/overthrow_main/functions/AI/NPC/fn_initCivilianGroup.sqf
+++ b/addons/overthrow_main/functions/AI/NPC/fn_initCivilianGroup.sqf
@@ -12,7 +12,7 @@ private _hour = date select 3;
private _start = getpos ((units _g) select 0);
if(isNil "_start") exitWith {};
private _dest = [_start,[0,100]] call SHK_pos;
-private _bdg = [_start,OT_allShops + OT_offices] call OT_fnc_getRandomBuilding;
+private _bdg = [_start,OT_allShops + OT_offices + [OT_refugeeCamp]] call OT_fnc_getRandomBuilding;
if(typename _bdg != "BOOL") then { _dest = getpos(_bdg)};
private _wp = _g addWaypoint [_dest,0];
diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initGendarmPatrol.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initGendarmPatrol.sqf
index 3c66caa7..0eebdde8 100644
--- a/addons/overthrow_main/functions/AI/NPC/fn_initGendarmPatrol.sqf
+++ b/addons/overthrow_main/functions/AI/NPC/fn_initGendarmPatrol.sqf
@@ -1,6 +1,12 @@
private _group = _this;
private _garrison = ((units _group) select 0) getvariable ["garrison",""];
+if(isNil "_garrison") exitWith {
+ {
+ deleteVehicle _x;
+ }foreach(units _group);
+ deleteGroup _group;
+};
private _start = server getVariable [_garrison,position ((units _group) select 0)];
if(isNil "_start") exitWith {};
diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initGunDealer.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initGunDealer.sqf
index adfd06d4..a4d071cb 100644
--- a/addons/overthrow_main/functions/AI/NPC/fn_initGunDealer.sqf
+++ b/addons/overthrow_main/functions/AI/NPC/fn_initGunDealer.sqf
@@ -24,5 +24,5 @@ _unit forceAddUniform (OT_clothes_guerilla call BIS_fnc_selectRandom);
_group = group _unit;
_group setBehaviour "CARELESS";
-_unit setvariable ["owner","self",true];
-(group _unit) allowFleeing 0;
\ No newline at end of file
+[_unit,"self"] call OT_fnc_setOwner;
+(group _unit) allowFleeing 0;
diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initHarbor.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initHarbor.sqf
index 7aed0acb..e0de1501 100644
--- a/addons/overthrow_main/functions/AI/NPC/fn_initHarbor.sqf
+++ b/addons/overthrow_main/functions/AI/NPC/fn_initHarbor.sqf
@@ -19,9 +19,9 @@ removeVest _unit;
_unit forceAddUniform (OT_clothes_harbor call BIS_fnc_selectRandom);
-_unit setvariable ["owner","self"];
+[_unit,"self"] call OT_fnc_setOwner;
_unit addEventHandler ["FiredNear", {
- _u = _this select 0;
+ _u = _this select 0;
_u setUnitPos "DOWN";
}];
diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initMilitaryPatrol.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initMilitaryPatrol.sqf
index 95dafe20..b9bfbc71 100644
--- a/addons/overthrow_main/functions/AI/NPC/fn_initMilitaryPatrol.sqf
+++ b/addons/overthrow_main/functions/AI/NPC/fn_initMilitaryPatrol.sqf
@@ -1,11 +1,10 @@
private _group = _this;
-private _garrison = ((units _group) select 0) getvariable ["garrison",""];
private _start = position ((units _group) select 0);
if(isNil "_start") exitWith {};
-_wp = _group addWaypoint [_start,5];
+_wp = _group addWaypoint [_start,40];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "SAFE";
_wp setWaypointSpeed "LIMITED";
@@ -13,7 +12,7 @@ _wp setWaypointTimeout [10,20,60];
_dest = [_start,[50,75],45] call SHK_pos;
-_wp = _group addWaypoint [_dest,10];
+_wp = _group addWaypoint [_dest,40];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "SAFE";
_wp setWaypointSpeed "LIMITED";
@@ -21,7 +20,7 @@ _wp setWaypointTimeout [10,20,60];
_dest = [_start,[100,200],180] call SHK_pos;
-_wp = _group addWaypoint [_dest,10];
+_wp = _group addWaypoint [_dest,40];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "SAFE";
_wp setWaypointSpeed "LIMITED";
@@ -29,7 +28,7 @@ _wp setWaypointTimeout [10,20,60];
_dest = [_start,[100,200],270] call SHK_pos;
-_wp = _group addWaypoint [_dest,10];
+_wp = _group addWaypoint [_dest,40];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "SAFE";
_wp setWaypointSpeed "LIMITED";
@@ -37,7 +36,7 @@ _wp setWaypointTimeout [10,20,60];
_dest = [_start,[100,200],0] call SHK_pos;
-_wp = _group addWaypoint [_dest,10];
+_wp = _group addWaypoint [_dest,40];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "SAFE";
_wp setWaypointSpeed "LIMITED";
diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initMobBoss.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initMobBoss.sqf
index 21385f8a..f38d7fdb 100644
--- a/addons/overthrow_main/functions/AI/NPC/fn_initMobBoss.sqf
+++ b/addons/overthrow_main/functions/AI/NPC/fn_initMobBoss.sqf
@@ -13,9 +13,9 @@ _unit addEventHandler ["HandleDamage", {
_src = _this select 3;
if(captive _src) then {
if((vehicle _src) != _src or (_src call unitSeenCRIM)) then {
- _src setCaptive false;
- };
- };
+ _src setCaptive false;
+ };
+ };
}];
[_unit, OT_face_localBoss] remoteExecCall ["setFace", 0, _unit];
@@ -49,7 +49,7 @@ if(OT_hasACE) then {
}else{
_unit linkItem "ItemWatch";
};
-
+_unit linkItem "ACE_Cellphone";
_weapon = (OT_CRIM_Weapons + OT_allCheapRifles) call BIS_fnc_selectRandom;
_base = [_weapon] call BIS_fnc_baseWeapon;
@@ -66,7 +66,7 @@ _unit addWeapon _weapon;
_config = configfile >> "CfgWeapons" >> _weapon >> "WeaponSlotsInfo";
_numslots = count(_config);
for "_i" from 0 to (_numslots-1) do {
- if (isClass (_config select _i)) then {
+ if (isClass (_config select _i)) then {
_slot = configName(_config select _i);
_com = _config >> _slot >> "compatibleItems";
_items = [];
@@ -76,9 +76,9 @@ for "_i" from 0 to (_numslots-1) do {
};
}else{
_items = getArray(_com);
- };
- if(count _items > 0) then {
- _cls = _items call BIS_fnc_selectRandom;
+ };
+ if(count _items > 0) then {
+ _cls = _items call BIS_fnc_selectRandom;
_unit addPrimaryWeaponItem _cls;
};
};
@@ -91,4 +91,3 @@ _magazine = (getArray (configFile / "CfgWeapons" / _base / "magazines")) select
if !(isNil "_magazine") then {
_unit addItem _magazine;
};
-
diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initNATOCheckpoint.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initNATOCheckpoint.sqf
index 4a9b7535..fa3ae4bd 100644
--- a/addons/overthrow_main/functions/AI/NPC/fn_initNATOCheckpoint.sqf
+++ b/addons/overthrow_main/functions/AI/NPC/fn_initNATOCheckpoint.sqf
@@ -15,6 +15,7 @@ private _bargates = _start nearobjects ["Land_BarGate_F",50];
while {!(isNil "_group") and count (units _group) > 0} do {
_vehs = [];
+ _friendly = [];
private _leader = leader _group;
{
@@ -29,6 +30,9 @@ while {!(isNil "_group") and count (units _group) > 0} do {
_vehs pushBack _x;
};
};
+ if(_unit isKindOf "LandVehicle" and (side _x == west)) then {
+ _friendly pushback _x;
+ };
if !(_unit in _inrange or _unit in _searching or _unit in _searched) then {
if(_unit call unitSeenNATO) then {
@@ -45,7 +49,7 @@ while {!(isNil "_group") and count (units _group) > 0} do {
};
}foreach(_start nearentities [["CaManBase","LandVehicle"],_outerRange]);
- if((count _vehs) > 0) then {
+ if((count _vehs) > 0 or (count _friendly) > 0) then {
{
_x animate ["Door_1_rot",1];
}foreach(_bargates);
@@ -131,14 +135,14 @@ while {!(isNil "_group") and count (units _group) > 0} do {
_msg = "We found some illegal items and confiscated them, be on your way";
};
};
- _msg remoteExec ["notify_talk",_x,true];
+ _msg remoteExec ["OT_fnc_notifyMinor",_x,true];
_searched pushback _x;
_searching deleteAt(_searching find _x);
};
};
}else{
if (_x in _searching and isPlayer _x) then {
- "Return to the checkpoint immediately and wait while you are searched" remoteExec ["notify_talk",_x,true];
+ "Return to the checkpoint immediately and wait while you are searched" remoteExec ["OT_fnc_notifyMinor",_x,true];
_searching deleteAt(_searching find _x);
}
};
diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initPolice.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initPolice.sqf
index 2215f05c..d96cb266 100644
--- a/addons/overthrow_main/functions/AI/NPC/fn_initPolice.sqf
+++ b/addons/overthrow_main/functions/AI/NPC/fn_initPolice.sqf
@@ -24,60 +24,53 @@ _unit addEventHandler ["HandleDamage", {
_src = _this select 3;
if(captive _src) then {
if((vehicle _src) != _src or (_src call unitSeenNATO)) then {
- _src setCaptive false;
- };
- };
+ _src setCaptive false;
+ };
+ };
}];
removeAllWeapons _unit;
-_numweap = (count OT_NATO_weapons_Police)-1;
-_idx = _numweap - 4;
-
-if(_stability > 85) then {
- _idx = _numweap;
+private _cost = 0;
+private _wpn = ["SubmachineGun"] call OT_fnc_findWeaponInWarehouse;
+if(_wpn == "") then {
+ _possible = [];
+ {
+ _weapon = [_x] call BIS_fnc_itemType;
+ _weaponType = _weapon select 1;
+ if(_weaponType == "AssaultRifle" and (_x find "_GL_") > -1) then {_weaponType = "GrenadeLauncher"};
+ if(_weaponType == _primary) then {_possible pushback _x};
+ }foreach(OT_allWeapons);
+ _sorted = [_possible,[],{(cost getvariable [_x,[200]]) select 0},"ASCEND"] call BIS_fnc_SortBy;
+ _wpn = _sorted select 0;
+}else{
+ _warehouseWpn = true;
};
+_unit addWeapon _wpn;
+
+[_wpn,1] call OT_fnc_removeFromWarehouse;
+
_hour = date select 3;
-if(_stability > 80) then {
- if(_hour > 17 or _hour < 6) then {
- _unit linkItem "NVGoggles_OPFOR";
- };
- _unit addGoggles "G_Bandanna_aviator";
- _unit addWeapon "Rangefinder";
- _idx = _numweap - 1;
- if(OT_hasAce) then {
- _unit addItemToUniform "ACE_rangeCard";
- _unit addItem "ACE_morphine";
- };
-}else{
- if(_stability > 70) then {
- _idx = _numweap - 2;
- }else{
- if(_stability > 60) then {
- _idx = _numweap - 3;
- _unit linkItem "ItemGPS";
- };
- };
-};
+
+_unit addPrimaryWeaponItem "acc_flashlight";
+_unit addGoggles "G_Bandanna_aviator";
+_idx = _numweap - 1;
+_unit addItem "ACE_morphine";
+_unit addItem "ACE_epinephrine";
+
if(OT_hasACE) then {
_unit addItem "ACE_fieldDressing";
_unit addItem "ACE_fieldDressing";
};
-_weapon = OT_NATO_weapons_Police select round(random(_idx));
-_base = [_weapon] call BIS_fnc_baseWeapon;
+_base = [_wpn] call BIS_fnc_baseWeapon;
_magazine = (getArray (configFile / "CfgWeapons" / _base / "magazines")) select 0;
_unit addMagazine _magazine;
_unit addMagazine _magazine;
_unit addMagazine _magazine;
_unit addMagazine _magazine;
_unit addMagazine _magazine;
-_unit addWeapon _weapon;
-
-if(_hour > 17 or _hour < 6) then {
- _unit addPrimaryWeaponItem "acc_flashlight";
-};
_weapon = OT_NATO_weapons_Pistols call BIS_fnc_selectRandom;
_base = [_weapon] call BIS_fnc_baseWeapon;
@@ -85,9 +78,3 @@ _magazine = (getArray (configFile / "CfgWeapons" / _base / "magazines")) select
_unit addMagazine _magazine;
_unit addMagazine _magazine;
_unit addWeapon _weapon;
-
-if(_stability > 80) then {
- _unit addPrimaryWeaponItem "optic_Holosight_blk_F";
-}else{
- _unit addPrimaryWeaponItem "optic_Aco";
-};
diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initPriest.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initPriest.sqf
index ecaba026..87e37646 100644
--- a/addons/overthrow_main/functions/AI/NPC/fn_initPriest.sqf
+++ b/addons/overthrow_main/functions/AI/NPC/fn_initPriest.sqf
@@ -14,7 +14,7 @@ removeBackpack _unit;
removeHeadgear _unit;
removeVest _unit;
-_unit setVariable ["owner","self"];
+[_unit,"self"] call OT_fnc_setOwner;
[_unit, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _unit];
[_unit, "NoVoice"] remoteExecCall ["setSpeaker", 0, _unit];
@@ -26,8 +26,8 @@ _unit addEventHandler ["FiredNear", {
if !(_u getVariable ["fleeing",false]) then {
_u setVariable ["fleeing",true,false];
_u setBehaviour "COMBAT";
- _by = _this select 1;
+ _by = _this select 1;
_u allowFleeing 1;
_u setskill ["courage",0];
};
-}];
\ No newline at end of file
+}];
diff --git a/addons/overthrow_main/functions/AI/NPC/fn_initShopkeeper.sqf b/addons/overthrow_main/functions/AI/NPC/fn_initShopkeeper.sqf
index 711109cf..7bd16c6e 100644
--- a/addons/overthrow_main/functions/AI/NPC/fn_initShopkeeper.sqf
+++ b/addons/overthrow_main/functions/AI/NPC/fn_initShopkeeper.sqf
@@ -20,9 +20,9 @@ removeVest _unit;
_unit forceAddUniform (OT_clothes_shops call BIS_fnc_selectRandom);
-_unit setvariable ["owner","self"];
+[_unit,"self"] call OT_fnc_setOwner;
_unit addEventHandler ["FiredNear", {
- _u = _this select 0;
+ _u = _this select 0;
_u setUnitPos "DOWN";
-}];
\ No newline at end of file
+}];
diff --git a/addons/overthrow_main/functions/AI/fn_createSoldier.sqf b/addons/overthrow_main/functions/AI/fn_createSoldier.sqf
index 5171ea36..2ec6b299 100644
--- a/addons/overthrow_main/functions/AI/fn_createSoldier.sqf
+++ b/addons/overthrow_main/functions/AI/fn_createSoldier.sqf
@@ -25,6 +25,7 @@ private _lastname = OT_lastNames_local call BIS_fnc_selectRandom;
private _fullname = [format["%1 %2",_firstname,_lastname],_firstname,_lastname];
[_civ,_fullname] remoteExec ["setCivName",0,false];
_civ setRank "LIEUTENANT";
+_civ setSkill 0.5 + (random 0.4);
[_civ, (OT_faces_local call BIS_fnc_selectRandom)] remoteExecCall ["setFace", 0, _civ];
diff --git a/addons/overthrow_main/functions/AI/fn_getSoldier.sqf b/addons/overthrow_main/functions/AI/fn_getSoldier.sqf
index 391eea2b..fbe6ce5f 100644
--- a/addons/overthrow_main/functions/AI/fn_getSoldier.sqf
+++ b/addons/overthrow_main/functions/AI/fn_getSoldier.sqf
@@ -25,6 +25,7 @@ if(_wpn == "") then {
{
_weapon = [_x] call BIS_fnc_itemType;
_weaponType = _weapon select 1;
+ if(_weaponType == "AssaultRifle" and (_x find "_GL_") > -1) then {_weaponType = "GrenadeLauncher"};
if(_weaponType == _primary) then {_possible pushback _x};
}foreach(OT_allWeapons);
_sorted = [_possible,[],{(cost getvariable [_x,[200]]) select 0},"ASCEND"] call BIS_fnc_SortBy;
diff --git a/addons/overthrow_main/functions/AI/fn_initVCOMAI.sqf b/addons/overthrow_main/functions/AI/fn_initVCOMAI.sqf
index 30283b71..d27524c3 100644
--- a/addons/overthrow_main/functions/AI/fn_initVCOMAI.sqf
+++ b/addons/overthrow_main/functions/AI/fn_initVCOMAI.sqf
@@ -11,7 +11,7 @@ VCOM_AIDEBUG = 0;
//Turn on map markers that track AI movement
VCOM_UseMarkers = false;
//Turns off VCOMAI for AI units in a players squad
-NOAI_FOR_PLAYERLEADERS = 0;
+NOAI_FOR_PLAYERLEADERS = 1;
//Will AI garrison static weapons nearby?
VCOM_STATICGARRISON = 1;
//How far can the AI hear gunshots from?
@@ -51,7 +51,7 @@ VCOM_IncreasingAccuracy = true;
//VCOM_SideBasedMovement- Remove sides from the array below to force that specific AI side to not execute any advance movement code. (I.E. Moving to reinforce allies, being alerted by distant gunshots and etc). AI with this will still react normally in combat. DEFAULT = [WEST,EAST,CIVILIAN,RESISTANCE];
VCOM_SideBasedMovement = [WEST,EAST];
//VCOM_SideBasedExecution- Remove sides from the array below to remove that specific AI side from executing any of the VCOMAI scripts at all. DEFAULT = [WEST,EAST,CIVILIAN,RESISTANCE];
-VCOM_SideBasedExecution = [WEST,EAST,RESISTANCE];
+VCOM_SideBasedExecution = [WEST,EAST];
//Distance AI will respond to call of help from each other
VCOM_Unit_AIWarnDistance = 600;
diff --git a/addons/overthrow_main/functions/AI/fn_parachuteAll.sqf b/addons/overthrow_main/functions/AI/fn_parachuteAll.sqf
index 4877b460..e88c0184 100644
--- a/addons/overthrow_main/functions/AI/fn_parachuteAll.sqf
+++ b/addons/overthrow_main/functions/AI/fn_parachuteAll.sqf
@@ -11,18 +11,19 @@ paraLandSafe =
_unit = _this select 0;
_chuteheight = _this select 1;
if (isPlayer _unit) then {[_unit,_chuteheight] spawn OpenPlayerchute};
+ waitUntil { !(alive _unit) or isTouchingGround _unit or (position _unit select 2) < 20 };
+
+ _unit allowDamage false; //So they dont hit trees or die on ground impact
+
waitUntil { !(alive _unit) or isTouchingGround _unit or (position _unit select 2) < 1 };
- if(!alive _unit) then {
- deleteVehicle _unit;
- }else{
- _unit action ["eject",_unit];
- sleep 1;
- _inv = name _unit;
- _id = [_unit] call fnc_getBuildID;
- _unit setUnitLoadout (spawner getvariable [format["eject_%1",_id],[]]);
- spawner setvariable [format["eject_%1",_id],nil,false];
- };
+ _unit action ["eject",_unit];
+ sleep 1;
+ _inv = name _unit;
+ _id = [_unit] call fnc_getBuildID;
+ _unit setUnitLoadout (spawner getvariable [format["eject_%1",_id],[]]);
+ spawner setvariable [format["eject_%1",_id],nil,false];
+ _unit allowDamage true;
};
OpenPlayerChute =
diff --git a/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf b/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf
index b05c1df5..c60c7047 100644
--- a/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf
+++ b/addons/overthrow_main/functions/AI/orders/fn_orderLoot.sqf
@@ -13,7 +13,7 @@ if(vehicle _tt != _tt) then {
}else{
_objects = _tt nearEntities [["Car","ReammoBox_F","Air","Ship"],20];
if(count _objects == 0) exitWith {
- "Cannot find any containers or vehicles within 20m of first selected unit" call notify_minor;
+ "Cannot find any containers or vehicles within 20m of first selected unit" call OT_fnc_notifyMinor;
};
_sorted = [_objects,[],{_x distance _tt},"ASCEND"] call BIS_fnc_SortBy;
};
@@ -21,7 +21,7 @@ if(vehicle _tt != _tt) then {
if(count _sorted == 0) exitWith {};
private _target = _sorted select 0;
-format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicle_GetName] call notify_minor;
+format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicle_GetName] call OT_fnc_notifyMinor;
{
[_x,_target] spawn {
@@ -74,14 +74,8 @@ format["Looting nearby bodies into the %1",(typeof _target) call ISSE_Cfg_Vehicl
if((!alive _unit) or (_timeOut < time)) exitWith {};
[_deadguy,_unit] call takeStuff;
- [_deadguy] spawn {
- sleep 30;
- _n = _this select 0;
- if !(isNil "_n") then {
- hideBody (_this select 0);
- }
- };
sleep 2;
+ hideBody _deadguy;
if(primaryWeapon _unit == "") then {
_weapon = objNull;
{
diff --git a/addons/overthrow_main/functions/AI/orders/fn_orderOpenInventory.sqf b/addons/overthrow_main/functions/AI/orders/fn_orderOpenInventory.sqf
index 9a328a86..548cb68a 100644
--- a/addons/overthrow_main/functions/AI/orders/fn_orderOpenInventory.sqf
+++ b/addons/overthrow_main/functions/AI/orders/fn_orderOpenInventory.sqf
@@ -10,7 +10,7 @@ if((vehicle _unit) != _unit) then {
}else{
_objects = _unit nearEntities [["LandVehicle",OT_item_Storage],20];
if(count _objects == 0) exitWith {
- "Cannot find any containers or vehicles within 20m of first selected unit" call notify_minor;
+ "Cannot find any containers or vehicles within 20m of first selected unit" call OT_fnc_notifyMinor;
};
_sorted = [_objects,[],{_x distance _unit},"ASCEND"] call BIS_fnc_SortBy;
};
diff --git a/addons/overthrow_main/functions/UI/fn_notifyBig.sqf b/addons/overthrow_main/functions/UI/fn_notifyBig.sqf
new file mode 100644
index 00000000..61788cf0
--- /dev/null
+++ b/addons/overthrow_main/functions/UI/fn_notifyBig.sqf
@@ -0,0 +1,2 @@
+_txt = format ["%1",_this];
+OT_notifies pushback _txt;
diff --git a/addons/overthrow_main/functions/UI/fn_notifyGood.sqf b/addons/overthrow_main/functions/UI/fn_notifyGood.sqf
new file mode 100644
index 00000000..d637b7de
--- /dev/null
+++ b/addons/overthrow_main/functions/UI/fn_notifyGood.sqf
@@ -0,0 +1,3 @@
+playSound "3DEN_notificationDefault";
+_txt = format ["%1",_this];
+OT_notifies pushback _txt;
diff --git a/addons/overthrow_main/functions/UI/fn_notifyLong.sqf b/addons/overthrow_main/functions/UI/fn_notifyLong.sqf
new file mode 100644
index 00000000..02742d63
--- /dev/null
+++ b/addons/overthrow_main/functions/UI/fn_notifyLong.sqf
@@ -0,0 +1,2 @@
+_txt = format ["%1",_this];
+[_txt, 0, -0.136, 30, 1, 0, 2] spawn bis_fnc_dynamicText;
diff --git a/addons/overthrow_main/functions/UI/fn_notifyMinor.sqf b/addons/overthrow_main/functions/UI/fn_notifyMinor.sqf
new file mode 100644
index 00000000..af2d1279
--- /dev/null
+++ b/addons/overthrow_main/functions/UI/fn_notifyMinor.sqf
@@ -0,0 +1,2 @@
+_txt = format ["%1",_this];
+OT_notifies pushback _txt;
diff --git a/addons/overthrow_main/functions/UI/fn_notifyVehicle.sqf b/addons/overthrow_main/functions/UI/fn_notifyVehicle.sqf
new file mode 100644
index 00000000..6f9467ac
--- /dev/null
+++ b/addons/overthrow_main/functions/UI/fn_notifyVehicle.sqf
@@ -0,0 +1,2 @@
+_txt = format["%1
Owner: %2",(typeof vehicle player) call ISSE_Cfg_Vehicle_GetName,server getVariable "name"+((vehicle player) call OT_fnc_getOwner)];
+[_txt, -0.5, 1, 5, 1, 0, 5] spawn bis_fnc_dynamicText;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buy.sqf b/addons/overthrow_main/functions/actions/fn_buy.sqf
similarity index 80%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buy.sqf
rename to addons/overthrow_main/functions/actions/fn_buy.sqf
index 5c545d3c..d0732ede 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/buy.sqf
+++ b/addons/overthrow_main/functions/actions/fn_buy.sqf
@@ -8,17 +8,21 @@ _standing = player getVariable format['rep%1',_town];
_price = lbValue [1500,_idx];
if(_price == -1) exitWith {};
+private _chems = server getVariable ["reschems",0];
+private _cost = cost getVariable [_cls,[0,0,0,0]];
+if(_cls in OT_allExplosives and _chems < (_cost select 3)) exitWith {format["You need %1 chemicals",_cost select 3] call OT_fnc_notifyMinor};
+
_money = player getVariable "money";
-if(_money < _price) exitWith {"You cannot afford that!" call notify_minor};
+if(_money < _price) exitWith {"You cannot afford that!" call OT_fnc_notifyMinor};
call {
if(_cls == "Set_HMG") exitWith {
_pos = (getpos player) findEmptyPosition [5,100,"C_Quadbike_01_F"];
- if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call notify_minor};
+ if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call OT_fnc_notifyMinor};
player setVariable ["money",_money-_price,true];
_veh = "C_Quadbike_01_F" createVehicle _pos;
- _veh setVariable ["owner",getPlayerUID player,true];
+ [_veh,getPlayerUID player] call OT_fnc_setOwner;
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
clearBackpackCargoGlobal _veh;
@@ -27,7 +31,7 @@ call {
_veh addBackpackCargoGlobal ["I_HMG_01_support_high_F", 1];
player reveal _veh;
- format["You bought a Quad Bike w/ HMG for $%1",_price] call notify_minor;
+ format["You bought a Quad Bike w/ HMG for $%1",_price] call OT_fnc_notifyMinor;
playSound "3DEN_notificationDefault";
};
if(OT_interactingWith getVariable ["factionrep",false] and ((_cls isKindOf "Land") or (_cls isKindOf "Air"))) exitWith {
@@ -36,7 +40,7 @@ call {
_blueprints pushback _cls;
server setVariable ["GEURblueprints",_blueprints,true];
_factionName = OT_interactingWith getVariable ["factionrepname",""];
- format["%1 has bought %2 blueprint from %3",name player,_cls call ISSE_Cfg_Vehicle_GetName,_factionName] remoteExec ["notify_minor",0,false];
+ format["%1 has bought %2 blueprint from %3",name player,_cls call ISSE_Cfg_Vehicle_GetName,_factionName] remoteExec ["OT_fnc_notifyMinor",0,false];
closeDialog 0;
};
};
@@ -48,17 +52,17 @@ call {
};
if(_cls == OT_item_UAV) exitWith {
_pos = (getpos player) findEmptyPosition [5,100,_cls];
- if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call notify_minor};
+ if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call OT_fnc_notifyMinor};
player setVariable ["money",_money-_price,true];
_veh = createVehicle [_cls, _pos, [], 0,""];
_crew = createVehicleCrew _veh;
{
- _x setVariable ["owner",getplayeruid player,true];
+ [_x,getPlayerUID player] call OT_fnc_setOwner;
}foreach(crew _veh);
- _veh setVariable ["owner",getPlayerUID player,true];
+ [_veh,getPlayerUID player] call OT_fnc_setOwner;
if("ItemGPS" in (assignedItems player)) then {
player addItem OT_item_UAVterminal;
@@ -71,40 +75,45 @@ call {
player connectTerminalToUAV _veh;
player reveal _veh;
- format["You bought a Quadcopter",_cls call ISSE_Cfg_Vehicle_GetName] call notify_minor;
+ format["You bought a Quadcopter",_cls call ISSE_Cfg_Vehicle_GetName] call OT_fnc_notifyMinor;
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];
- if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call notify_minor};
+ if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call OT_fnc_notifyMinor};
player setVariable ["money",_money-_price,true];
_veh = _cls createVehicle _pos;
- _veh setVariable ["owner",getPlayerUID player,true];
+ [_veh,getPlayerUID player] call OT_fnc_setOwner;
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
clearBackpackCargoGlobal _veh;
clearItemCargoGlobal _veh;
+ if(_cls == OT_vehType_service) then {
+ _veh addItemCargoGlobal ["ToolKit", 1];
+ [_veh,3,"ACE_Wheel"] call ace_repair_fnc_addSpareParts;
+ };
+
player reveal _veh;
- format["You bought a %1 for $%2",_cls call ISSE_Cfg_Vehicle_GetName,_price] call notify_minor;
+ format["You bought a %1 for $%2",_cls call ISSE_Cfg_Vehicle_GetName,_price] call OT_fnc_notifyMinor;
playSound "3DEN_notificationDefault";
};
if(_cls isKindOf "Ship") exitWith {
_pos = (getpos player) findEmptyPosition [5,100,_cls];
- if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call notify_minor};
+ if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call OT_fnc_notifyMinor};
player setVariable ["money",_money-_price,true];
_veh = _cls createVehicle _pos;
- _veh setVariable ["owner",getPlayerUID player,true];
+ [_veh,getPlayerUID player] call OT_fnc_setOwner;
clearWeaponCargoGlobal _veh;
clearMagazineCargoGlobal _veh;
clearBackpackCargoGlobal _veh;
clearItemCargoGlobal _veh;
player reveal _veh;
- format["You bought a %1",_cls call ISSE_Cfg_Vehicle_GetName] call notify_minor;
+ format["You bought a %1",_cls call ISSE_Cfg_Vehicle_GetName] call OT_fnc_notifyMinor;
playSound "3DEN_notificationDefault";
};
if(_cls in OT_allClothing) exitWith {
@@ -112,7 +121,7 @@ call {
if((backpack player != "") and (player canAdd _cls)) then {
player addItemToBackpack _cls;
- "Clothing added to your backpack" call notify_minor;
+ "Clothing added to your backpack" call OT_fnc_notifyMinor;
}else{
player forceAddUniform _cls;
};
@@ -123,7 +132,7 @@ call {
if((backpack player != "") and (player canAdd _cls)) then {
player addItemToBackpack _cls;
- "Rebreather added to your backpack" call notify_minor;
+ "Rebreather added to your backpack" call OT_fnc_notifyMinor;
}else{
player addVest _cls;
};
@@ -134,7 +143,7 @@ call {
_box = false;
{
- _owner = _x getVariable "owner";
+ _owner = _x call OT_fnc_getOwner;
if(!isNil "_owner") then {
if(_owner == getplayerUID player) exitWith {_box = _x};
};
@@ -145,15 +154,18 @@ call {
playSound "3DEN_notificationDefault";
};
if(_cls isKindOf ["CA_Magazine",configFile >> "CfgMagazines"]) exitWith {
+ if(_cls in OT_allExplosives) then {
+ _server setVariable ["reschems",_chems - (_cost select 3),true];
+ };
[-_price] call money;
player addMagazine _cls;
playSound "3DEN_notificationDefault";
};
_handled = true;
if(_cls isKindOf "Bag_Base") then {
- if(backpack player != "") exitWith {"You already have a backpack" call notify_minor;_handled = false};
+ if(backpack player != "") exitWith {"You already have a backpack" call OT_fnc_notifyMinor;_handled = false};
}else{
- if !(player canAdd [_cls,1]) exitWith {"There is not enough room in your inventory" call notify_minor;_handled = false};
+ if !(player canAdd [_cls,1]) exitWith {"There is not enough room in your inventory" call OT_fnc_notifyMinor;_handled = false};
};
if(_handled) then {
@@ -161,6 +173,7 @@ call {
if (_cls in OT_illegalItems) exitWith {
[-_price] call money;
player addItem _cls;
+
if(player call unitSeenNATO) then {
[player] remoteExec ["OT_fnc_NATOsearch",2,false];
};
diff --git a/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf b/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf
new file mode 100644
index 00000000..73bb576c
--- /dev/null
+++ b/addons/overthrow_main/functions/actions/fn_buyBuilding.sqf
@@ -0,0 +1,149 @@
+_b = player call OT_fnc_nearestRealEstate;
+private _handled = false;
+private _type = "buy";
+private _err = false;
+private _isfactory = false;
+if(typename _b == "ARRAY") then {
+ _building = (_b select 0);
+ if(typeof _building == OT_item_Flag) then {
+ _err = true;
+ [] call OT_fnc_garrisonDialog;
+ }else{
+ if !(_building call OT_fnc_hasOwner) then {
+ _handled = true;
+ }else{
+ _owner = _building call OT_fnc_getOwner;
+ if(_owner == getplayeruid player) then {
+ _home = player getVariable "home";
+ if(_home distance _building < 5) exitWith {"You cannot sell your home" call OT_fnc_notifyMinor;_err = true};
+ _type = "sell";
+ _handled = true;
+ };
+ };
+ };
+}else{
+ _ob = (position player) call OT_fnc_nearestObjective;
+ _dist = (_ob select 0) distance player;
+ _name = _ob select 1;
+
+ if (_dist < 250 and _name in (server getVariable ["NATOabandoned",[]])) then {
+ _err = true;
+ [] call OT_fnc_garrisonDialog;
+ }else{
+ _b = (position player) call OT_fnc_nearestLocation;
+ if((_b select 1) == "Business") then {
+ if (call OT_fnc_playerIsGeneral) then {
+ _name = (_b select 0);
+ _pos = (_b select 2) select 0;
+ _price = _name call OT_fnc_getBusinessPrice;
+ _err = true;
+ _money = [] call OT_fnc_resistanceFunds;
+ if(_money >= _price) then {
+ [-_price] call OT_fnc_resistanceFunds;
+ _owned = server getVariable ["GEURowned",[]];
+ if(_owned find _name == -1) then {
+ server setVariable ["GEURowned",_owned + [_name],true];
+ server setVariable [format["%1employ",_name],2];
+ _pos remoteExec ["OT_fnc_resetSpawn",2,false];
+ format["%1 is now operational",_name] remoteExec ["OT_fnc_notifyMinor",0,true];
+ _name setMarkerColor "ColorGUER";
+ };
+ }else{
+ "The resistance cannot afford this" call OT_fnc_notifyMinor;
+ };
+ };
+ }else{
+ if((getpos player) distance OT_factoryPos < 150) then {
+ if (call OT_fnc_playerIsGeneral) then {
+ _name = "Factory";
+
+ _owned = server getVariable ["GEURowned",[]];
+ if(_owned find _name == -1) then {
+ _pos = OT_factoryPos;
+ _price = _name call OT_fnc_getBusinessPrice;
+ _err = true;
+ _money = [] call OT_fnc_resistanceFunds;
+ if(_money >= _price) then {
+ [-_price] call OT_fnc_resistanceFunds;
+ server setVariable ["GEURowned",_owned + [_name],true];
+ server setVariable [format["%1employ",_name],2];
+ _pos remoteExec ["OT_fnc_resetSpawn",2,false];
+ format["%1 is now operational",_name] remoteExec ["OT_fnc_notifyMinor",0,true];
+ _name setMarkerColor "ColorGUER";
+ }else{
+ "The resistance cannot afford this" call OT_fnc_notifyMinor;
+ };
+ }else{
+ //Manage
+ [] spawn OT_fnc_factoryDialog;
+ _isfactory = true;
+ };
+ };
+ };
+ };
+ };
+};
+if(_err) exitWith {};
+if(_handled) then {
+ _building = _b select 0;
+ _price = _b select 1;
+ _sell = _b select 2;
+ _lease = _b select 3;
+ _totaloccupants = _b select 4;
+ _town = (getpos _building) call OT_fnc_nearestTown;
+
+ _money = player getVariable "money";
+
+ if(_type == "buy" and _money < _price) exitWith {"You cannot afford that" call OT_fnc_notifyMinor};
+
+
+ _mrkid = format["bdg-%1",_building];
+ _owned = player getVariable "owned";
+
+ if(_type == "buy") then {
+ [_building,getPlayerUID player] call OT_fnc_setOwner;
+ [-_price] call money;
+
+ _mrk = createMarkerLocal [_mrkid,getpos _building];
+ _mrk setMarkerShape "ICON";
+ _mrk setMarkerColor "ColorWhite";
+ if(typeof _building == OT_warehouse) then {
+ _mrk setMarkerType "OT_warehouse";
+ }else{
+ _mrk setMarkerType "loc_Tourism";
+ _mrk setMarkerAlpha 0;
+ _mrk setMarkerAlphaLocal 1;
+ };
+ _id = [_building] call fnc_getBuildID;
+ buildingpositions setVariable [str _id,position _building,true];
+ _owned pushback _id;
+ [player,"Building Purchased",format["Bought: %1 in %2 for $%3",getText(configFile >> "CfgVehicles" >> (typeof _building) >> "displayName"),(getpos _building) call OT_fnc_nearestTown,_price]] call BIS_fnc_createLogRecord;
+ if(_price > 10000) then {
+ [_town,round(_price / 10000)] call standing;
+ };
+ _bdg addEventHandler ["Dammaged",compileFinal preprocessFileLineNumbers "events\buildingDamaged.sqf"];
+ }else{
+ if ((typeof _building) in OT_allRealEstate) then {
+ [_building,nil] call OT_fnc_setOwner;
+ _id = [_building] call fnc_getBuildID;
+ _leased = player getVariable ["leased",[]];
+ _leased deleteAt (_leased find _id);
+ player setVariable ["leased",_leased,true];
+ deleteMarker _mrkid;
+ _owned deleteAt (_owned find _id);
+ [player,"Building Sold",format["Sold: %1 in %2 for $%3",getText(configFile >> "CfgVehicles" >> (typeof _building) >> "displayName"),(getpos _building) call OT_fnc_nearestTown,_sell]] call BIS_fnc_createLogRecord;
+ [_sell] call money;
+ }else{
+ deleteVehicle _building;
+ _owned deleteAt (_owned find ([_building] call fnc_getBuildID));
+ };
+ };
+
+ player setVariable ["owned",_owned,true];
+
+
+}else{
+ if !(_isfactory) then {
+ "There are no buildings for sale nearby" call OT_fnc_notifyMinor;
+ };
+};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_factoryRefresh.sqf b/addons/overthrow_main/functions/actions/fn_factoryRefresh.sqf
similarity index 90%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_factoryRefresh.sqf
rename to addons/overthrow_main/functions/actions/fn_factoryRefresh.sqf
index abaebaac..a992949f 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_factoryRefresh.sqf
+++ b/addons/overthrow_main/functions/actions/fn_factoryRefresh.sqf
@@ -33,20 +33,20 @@ if(_currentCls != "") then {
};
_b = _base;
if(_base > 240) then {
- _b = 240;
+ _b = 30;
};
if(_base > 10000) then {
- _b = 360;
+ _b = 60;
};
if(_base > 20000) then {
- _b = 480;
+ _b = 120;
};
if(_base > 50000) then {
- _b = 600;
+ _b = 240;
};
- _timetoproduce = _b + (round (_wood+1)) + (round (_steel * 3)) + (round (_plastic * 10));
- if(_timetoproduce > 2880) then {_timetoproduce = 2880};
- if(_timetoproduce < 10) then {_timetoproduce = 10};
+ _timetoproduce = _b + (round (_wood+1)) + (round (_steel * 2)) + (round (_plastic * 5));
+ if(_timetoproduce > 360) then {_timetoproduce = 360};
+ if(_timetoproduce < 5) then {_timetoproduce = 5};
_timespent = server getVariable ["GEURproducetime",0];
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_factorySet.sqf b/addons/overthrow_main/functions/actions/fn_factorySet.sqf
similarity index 100%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_factorySet.sqf
rename to addons/overthrow_main/functions/actions/fn_factorySet.sqf
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fastTravel.sqf b/addons/overthrow_main/functions/actions/fn_fastTravel.sqf
similarity index 82%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fastTravel.sqf
rename to addons/overthrow_main/functions/actions/fn_fastTravel.sqf
index e1148819..b48f63db 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fastTravel.sqf
+++ b/addons/overthrow_main/functions/actions/fn_fastTravel.sqf
@@ -1,15 +1,15 @@
-if !(captive player) exitWith {"You cannot fast travel while wanted" call notify_minor};
-if !("ItemMap" in assignedItems player) exitWith {"You need a map to fast travel" call notify_minor};
+if !(captive player) exitWith {"You cannot fast travel while wanted" call OT_fnc_notifyMinor};
+if !("ItemMap" in assignedItems player) exitWith {"You need a map to fast travel" call OT_fnc_notifyMinor};
if((vehicle player) != player) then {
- if (driver (vehicle player) != player) exitWith {"You are not the driver of this vehicle" call notify_minor};
- if({!captive _x} count (crew vehicle player) != 0) exitWith {"There are wanted people in this vehicle" call notify_minor};
+ if (driver (vehicle player) != player) exitWith {"You are not the driver of this vehicle" call OT_fnc_notifyMinor};
+ if({!captive _x} count (crew vehicle player) != 0) exitWith {"There are wanted people in this vehicle" call OT_fnc_notifyMinor};
};
-if(((vehicle player) != player) and (vehicle player) isKindOf "Ship") exitWith {"You cannot fast travel in a boat" call notify_minor};
+if(((vehicle player) != player) and (vehicle player) isKindOf "Ship") exitWith {"You cannot fast travel in a boat" call OT_fnc_notifyMinor};
-"Click near a friendly base/camp or a building you own" call notify_minor;
+"Click near a friendly base/camp or a building you own" call OT_fnc_notifyMinor;
openMap true;
["fastTravel", "onMapSingleClick", {
@@ -42,14 +42,14 @@ openMap true;
if (!OT_adminMode and !(_pos inArea _region)) then {
if !([_region,_pos] call OT_fnc_regionIsConnected) then {
_valid = false;
- "You cannot fast travel between islands unless there is a bridge or your destination is a controlled airfield" call notify_minor;
+ "You cannot fast travel between islands unless there is a bridge or your destination is a controlled airfield" call OT_fnc_notifyMinor;
openMap false;
};
};
};
if(!_valid) exitWith {};
if(_pos distance player < 150) exitWith {
- "You cannot fast travel less than 150m. Just walk!" call notify_minor;
+ "You cannot fast travel less than 150m. Just walk!" call OT_fnc_notifyMinor;
openMap false;
};
@@ -57,7 +57,7 @@ openMap true;
if !(_handled) then {
- "You must click near a friendly base/camp or a building you own" call notify_minor;
+ "You must click near a friendly base/camp or a building you own" call OT_fnc_notifyMinor;
openMap false;
}else{
player allowDamage false;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_getLocalMission.sqf b/addons/overthrow_main/functions/actions/fn_getLocalMission.sqf
similarity index 97%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_getLocalMission.sqf
rename to addons/overthrow_main/functions/actions/fn_getLocalMission.sqf
index 1035c0d5..b0f8b147 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_getLocalMission.sqf
+++ b/addons/overthrow_main/functions/actions/fn_getLocalMission.sqf
@@ -1,7 +1,7 @@
private _faction = "PLAYER";
private _factionName = "Tanoa";
private _haveMission = player getVariable [format["MissionData%1",_faction],[]];
-if(count _haveMission > 0) exitWith {"You already have an active mission for the resistance" call notify_minor};
+if(count _haveMission > 0) exitWith {"You already have an active mission for the resistance" call OT_fnc_notifyMinor};
private _standing = 1;
if(_faction != OT_currentMissionFaction) then {OT_currentMissionData = nil};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_getMission.sqf b/addons/overthrow_main/functions/actions/fn_getMission.sqf
similarity index 96%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_getMission.sqf
rename to addons/overthrow_main/functions/actions/fn_getMission.sqf
index f4b1f3e7..90571882 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_getMission.sqf
+++ b/addons/overthrow_main/functions/actions/fn_getMission.sqf
@@ -1,7 +1,7 @@
params ["_faction","_factionName"];
private _haveMission = player getVariable [format["MissionData%1",_faction],[]];
-if(count _haveMission > 0) exitWith {"You already have an active mission for this faction" call notify_minor};
+if(count _haveMission > 0) exitWith {"You already have an active mission for this faction" call OT_fnc_notifyMinor};
private _standing = server getvariable [format["standing%1",_faction],0];
if(_faction != OT_currentMissionFaction) then {OT_currentMissionData = nil};
@@ -46,7 +46,7 @@ _options pushback ["Accept",{
_rewardStanding = _rewards select 0;
_standing = server getvariable [format["standing%1",_faction],0];
server setvariable [format["standing%1",_faction],_standing+_rewardStanding,true];
- format["%1 completed a mission (+%2 %3)",name player,_rewardStanding,_factionName] remoteExec ["notify_minor",0,false];
+ format["%1 completed a mission (+%2 %3)",name player,_rewardStanding,_factionName] remoteExec ["OT_fnc_notifyMinor",0,false];
};
OT_currentMissionData = nil;
},_success,OT_currentMissionRewards select 1,0,_fail,[OT_currentMissionData select 6,OT_currentMissionFaction,OT_currentMissionFactionName,OT_currentMissionData select 5,OT_currentMissionRewards]] spawn OT_fnc_assignMission;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_giveFunds.sqf b/addons/overthrow_main/functions/actions/fn_giveFunds.sqf
similarity index 81%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_giveFunds.sqf
rename to addons/overthrow_main/functions/actions/fn_giveFunds.sqf
index 5145a7d8..2c57b681 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_giveFunds.sqf
+++ b/addons/overthrow_main/functions/actions/fn_giveFunds.sqf
@@ -6,7 +6,7 @@ inputHandler = {
if(_val > 0) then {
[_val] call OT_fnc_resistanceFunds;
[-_val] call money;
- format ["%1 donated $%2 to the resistance",name player,[_val, 1, 0, true] call CBA_fnc_formatNumber] remoteExec ["notify_minor",0,false];
+ format ["%1 donated $%2 to the resistance",name player,[_val, 1, 0, true] call CBA_fnc_formatNumber] remoteExec ["OT_fnc_notifyMinor",0,false];
};
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_makeGeneral.sqf b/addons/overthrow_main/functions/actions/fn_makeGeneral.sqf
similarity index 100%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_makeGeneral.sqf
rename to addons/overthrow_main/functions/actions/fn_makeGeneral.sqf
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitCiv.sqf b/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf
similarity index 56%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitCiv.sqf
rename to addons/overthrow_main/functions/actions/fn_recruitCiv.sqf
index 7a6cade2..b7681a1a 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/recruitCiv.sqf
+++ b/addons/overthrow_main/functions/actions/fn_recruitCiv.sqf
@@ -1,12 +1,16 @@
-if !(captive player) exitWith {"You cannot recruit while wanted" call notify_minor};
-
_town = (getpos player) call OT_fnc_nearestTown;
_standing = player getVariable format['rep%1',_town];
+if(_standing < 10 and count (player nearObjects [OT_refugeeCamp,20]) == 0) exitWith {
+ "+10 Standing required to recruit. Try building a refugee camp at an FOB." call OT_fnc_notifyMinor
+};
+
+if(({side _x == west or side _x == east} count (_pos nearEntities 50)) > 0) exitWith {"You cannot recruit with enemies nearby" call OT_fnc_notifyMinor};
+
_price = [_town,"CIV",_standing] call OT_fnc_getPrice;
_money = player getVariable ["money",0];
-if(_money < _price) exitWith {"You cannot afford that" call notify_minor};
+if(_money < _price) exitWith {"You cannot afford that" call OT_fnc_notifyMinor};
playSound "3DEN_notificationDefault";
player setVariable ["money",_money-_price,true];
@@ -15,14 +19,15 @@ if(random 100 > 80) then {
};
_civ = player getvariable "hiringciv";
-_civ setVariable ["owner",getPlayerUID player,true];
+[_civ,getPlayerUID player] call OT_fnc_setOwner;
_civ removeAllEventHandlers "FiredNear";
[_civ] joinSilent grpNull;
[_civ] joinSilent (group player);
+_civ setCaptive true;
[_civ] spawn OT_fnc_initRecruit;
[player,format["New Recruit: %1",name _civ],format["Recruited: %1 for $%2",name _civ,_price]] call BIS_fnc_createLogRecord;
-format["%1 has been recruited",name _civ] call notify_minor;
+format["%1 has been recruited",name _civ] call OT_fnc_notifyMinor;
_civ setBehaviour "SAFE";
[[_civ,""],"switchMove",TRUE,FALSE] spawn BIS_fnc_MP;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_salvageWreck.sqf b/addons/overthrow_main/functions/actions/fn_salvageWreck.sqf
similarity index 85%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_salvageWreck.sqf
rename to addons/overthrow_main/functions/actions/fn_salvageWreck.sqf
index aaa60f0c..f2a1e7c8 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/fn_salvageWreck.sqf
+++ b/addons/overthrow_main/functions/actions/fn_salvageWreck.sqf
@@ -20,11 +20,11 @@ private _doSalvage = {
private _veh = _this;
if(!(_veh isKindOf "Truck_F" or _veh isKindOf "ReammoBox_F") and !(_veh canAdd "OT_Steel")) exitWith {
- "Vehicle is full, use a truck or ammobox for more storage" call notify_minor;
+ "Vehicle is full, use a truck or ammobox for more storage" call OT_fnc_notifyMinor;
};
private _toname = (typeof _veh) call ISSE_Cfg_Vehicle_GetName;
- format["Salvaging wreck into %1",_toname] call notify_minor;
+ format["Salvaging wreck into %1",_toname] call OT_fnc_notifyMinor;
player playMove "AinvPknlMstpSnonWnonDnon_medic_1";
[14,false] call progressBar;
sleep 7;
@@ -33,9 +33,9 @@ private _doSalvage = {
_veh addItemCargoGlobal ["OT_Steel", _steel];
if(_plastic > 0) then {
_veh addItemCargoGlobal ["OT_Plastic", _plastic];
- format["Salvaged: %1 x Steel, %1 x Plastic",_steel,_plastic] call notify_minor;
+ format["Salvaged: %1 x Steel, %1 x Plastic",_steel,_plastic] call OT_fnc_notifyMinor;
}else{
- format["Salvaged: %1 x Steel",_steel] call notify_minor;
+ format["Salvaged: %1 x Steel",_steel] call OT_fnc_notifyMinor;
};
deleteVehicle _wreck;
};
@@ -50,9 +50,9 @@ if(count _objects == 1) then {
{
_options pushback [format["%1 (%2m)",(typeof _x) call ISSE_Cfg_Vehicle_GetName,round (_x distance player)],_doSalvage,_x];
}foreach(_objects);
- "Salvage to which container?" call notify_big;
+ "Salvage to which container?" call OT_fnc_notifyBig;
_options spawn playerDecision;
}else{
- "No nearby containers or vehicles to put salvaged items" call notify_minor;
+ "No nearby containers or vehicles to put salvaged items" call OT_fnc_notifyMinor;
};
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sell.sqf b/addons/overthrow_main/functions/actions/fn_sell.sqf
similarity index 90%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sell.sqf
rename to addons/overthrow_main/functions/actions/fn_sell.sqf
index 5d39df26..b9246aa3 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sell.sqf
+++ b/addons/overthrow_main/functions/actions/fn_sell.sqf
@@ -30,9 +30,9 @@ if(isNil "_price") exitWith {OT_selling = false};
{
_c = _x select 0;
- if(_c == _cls) exitWith {_mynum = _x select 1};
+ if(_c == _cls) exitWith {_mynum = _x select 1};
}foreach(_s);
-
+
if(_mynum > 50) then {
_price = ceil(_price * 0.75);
};
@@ -45,9 +45,9 @@ if(_mynum > 200) then {
if(_price <= 0) then {_price = 1};
_stockidx = 0;
-{
+{
if(((_x select 0) == _cls) && ((_x select 1) > 0)) exitWith {
- _num = (_x select 1)+1;
+ _num = (_x select 1)+1;
_x set [1,_num];
_done = true;
};
@@ -61,10 +61,12 @@ if !(_done) then {
[_price] call money;
_b setVariable ["stock",_s,true];
+if(_price > 1000) then {[_town,1] call standing};
+
if(OT_hasTFAR) then {
_c = _cls splitString "_";
if((_c select 0) == "tf") then {
- {
+ {
if(_x find _cls == 0) exitWith {_cls = _x};
}foreach(items player);
};
@@ -73,4 +75,4 @@ player removeItem _cls;
lbClear 1500;
_mystock = player call OT_fnc_unitStock;
[_mystock,_town,_standing,_s] call sellDialog;
-OT_selling = false;
\ No newline at end of file
+OT_selling = false;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sellall.sqf b/addons/overthrow_main/functions/actions/fn_sellAll.sqf
similarity index 90%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sellall.sqf
rename to addons/overthrow_main/functions/actions/fn_sellAll.sqf
index 41f71b43..a44149df 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/sellall.sqf
+++ b/addons/overthrow_main/functions/actions/fn_sellAll.sqf
@@ -31,16 +31,16 @@ if(isNil "_price") exitWith {OT_selling = false};
_qty = 0;
{
_c = _x select 0;
- if(_c == _sellcls) exitWith {_qty = _x select 1};
+ if(_c == _sellcls) exitWith {_qty = _x select 1};
}foreach(player call OT_fnc_unitStock);
if(_qty == 0) exitWith {[_mystock,_town,_standing,_s] call sellDialog};
{
_c = _x select 0;
- if(_c == _sellcls) exitWith {_mynum = _x select 1};
+ if(_c == _sellcls) exitWith {_mynum = _x select 1};
}foreach(_s);
-
+
if(_mynum > 50) then {
_price = ceil(_price * 0.75);
};
@@ -54,9 +54,9 @@ if(_price <= 0) then {_price = 1};
_done = false;
_stockidx = 0;
-{
+{
if(((_x select 0) == _sellcls) && ((_x select 1) > 0)) exitWith {
- _num = (_x select 1)+_qty;
+ _num = (_x select 1)+_qty;
_x set [1,_num];
_done = true;
};
@@ -68,17 +68,18 @@ if !(_done) then {
};
[(_price*_qty)] call money;
+if((_price*_qty) > 1000) then {[_town,1] call standing};
_ocls = _sellcls;
_b setVariable ["stock",_s,true];
for "_i" from 0 to _qty do {
if(OT_hasTFAR) then {
_c = _ocls splitString "_";
if((_c select 0) == "tf") then {
- {
+ {
if(_x find _ocls == 0) exitWith {_sellcls = _x};
}foreach(items player);
};
- };
+ };
player removeItem _sellcls;
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_showBusinessInfo.sqf b/addons/overthrow_main/functions/actions/fn_showBusinessInfo.sqf
similarity index 100%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_showBusinessInfo.sqf
rename to addons/overthrow_main/functions/actions/fn_showBusinessInfo.sqf
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_showMemberInfo.sqf b/addons/overthrow_main/functions/actions/fn_showMemberInfo.sqf
similarity index 100%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_showMemberInfo.sqf
rename to addons/overthrow_main/functions/actions/fn_showMemberInfo.sqf
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_takeFunds.sqf b/addons/overthrow_main/functions/actions/fn_takeFunds.sqf
similarity index 100%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_takeFunds.sqf
rename to addons/overthrow_main/functions/actions/fn_takeFunds.sqf
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeLegit.sqf b/addons/overthrow_main/functions/actions/fn_takeLegit.sqf
similarity index 81%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeLegit.sqf
rename to addons/overthrow_main/functions/actions/fn_takeLegit.sqf
index 7cb5b415..819c3abc 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/takeLegit.sqf
+++ b/addons/overthrow_main/functions/actions/fn_takeLegit.sqf
@@ -2,7 +2,7 @@ _veh = vehicle player;
if(_veh == player) exitWith {};
-format["Taking legal inventory from vehicle"] call notify_minor;
+format["Taking legal inventory from vehicle"] call OT_fnc_notifyMinor;
[5,false] call progressBar;
sleep 5;
@@ -25,4 +25,4 @@ sleep 5;
};
}foreach(_veh call OT_fnc_unitStock);
-"Inventory Transfer done" call notify_minor;
+"Inventory Transfer done" call OT_fnc_notifyMinor;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/talkToCiv.sqf b/addons/overthrow_main/functions/actions/fn_talkToCiv.sqf
similarity index 98%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/talkToCiv.sqf
rename to addons/overthrow_main/functions/actions/fn_talkToCiv.sqf
index c46dc027..be5d2487 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/talkToCiv.sqf
+++ b/addons/overthrow_main/functions/actions/fn_talkToCiv.sqf
@@ -40,7 +40,7 @@ if !((_civ getvariable ["garrison",""]) isEqualTo "") then {_canRecruit = false;
if (_canRecruit) then {
_options pushBack [
- format["Recruit Civilian (-$%1)",_civprice],recruitCiv
+ format["Recruit Civilian (-$%1)",_civprice],OT_fnc_recruitCiv
];
};
@@ -180,7 +180,7 @@ if (_canBuyBoats) then {
];
_options pushBack [
"Ferry Service",{
- "Where do you want to go?" call notify_minor;
+ "Where do you want to go?" call OT_fnc_notifyMinor;
_ferryoptions = [];
{
private _p = markerPos(_x);
@@ -192,11 +192,11 @@ if (_canBuyBoats) then {
player setVariable ["OT_ferryDestination",_destpos,false];
private _desttown = _destpos call OT_fnc_nearestTown;
private _pos = (getpos player) findEmptyPosition [10,100,OT_vehType_ferry];
- if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call notify_minor};
+ if (count _pos == 0) exitWith {"Not enough space, please clear an area nearby" call OT_fnc_notifyMinor};
private _cost = floor((player distance _destpos) * 0.005);
player setVariable ["OT_ferryCost",_cost,false];
_money = player getVariable "money";
- if(_money < _cost) exitWith {"You cannot afford that!" call notify_minor};
+ if(_money < _cost) exitWith {"You cannot afford that!" call OT_fnc_notifyMinor};
[-_cost] call money;
_veh = OT_vehType_ferry createVehicle _pos;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferFrom.sqf b/addons/overthrow_main/functions/actions/fn_transferFrom.sqf
similarity index 91%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferFrom.sqf
rename to addons/overthrow_main/functions/actions/fn_transferFrom.sqf
index 5fcc8a5b..e70cd452 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferFrom.sqf
+++ b/addons/overthrow_main/functions/actions/fn_transferFrom.sqf
@@ -8,7 +8,7 @@ _objects = [];
}foreach(player nearEntities [["Car","ReammoBox_F","Air","Ship"],20]);
if(count _objects == 0) exitWith {
- "Cannot find any containers or other vehicles within 20m of this vehicle" call notify_minor;
+ "Cannot find any containers or other vehicles within 20m of this vehicle" call OT_fnc_notifyMinor;
};
_sorted = [_objects,[],{_x distance player},"ASCEND"] call BIS_fnc_SortBy;
_target = _sorted select 0;
@@ -17,7 +17,7 @@ if(_veh call unitSeen) then {
if(typename (_target getVariable ["stockof",""]) == "SCALAR") then {
{
_x setCaptive false;
- }foreach(units _veh);
+ }foreach(crew _veh);
_veh spawn revealToNATO;
hint "You were caught stealing!";
};
@@ -25,9 +25,10 @@ if(_veh call unitSeen) then {
_doTransfer = {
private _target = _this;
+ private _veh = vehicle player;
disableUserInput true;
- format["Transferring inventory from %1",(typeof _target) call ISSE_Cfg_Vehicle_GetName] call notify_minor;
+ format["Transferring inventory from %1",(typeof _target) call ISSE_Cfg_Vehicle_GetName] call OT_fnc_notifyMinor;
[5,false] call progressBar;
_end = time + 5;
{
@@ -80,7 +81,7 @@ _doTransfer = {
if(_full) exitWith {hint "This vehicle is full, use a truck for more storage"};
}foreach(_target call OT_fnc_unitStock);
waitUntil {time > _end};
- "Inventory Transfer done" call notify_minor;
+ "Inventory Transfer done" call OT_fnc_notifyMinor;
disableUserInput false;
};
@@ -92,6 +93,6 @@ if(count _objects == 1) then {
{
_options pushback [format["%1 (%2m)",(typeof _x) call ISSE_Cfg_Vehicle_GetName,round (_x distance player)],_doTransfer,_x];
}foreach(_objects);
- "Transfer from which container?" call notify_big;
+ "Transfer from which container?" call OT_fnc_notifyBig;
_options spawn playerDecision;
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_transferFunds.sqf b/addons/overthrow_main/functions/actions/fn_transferFunds.sqf
similarity index 94%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_transferFunds.sqf
rename to addons/overthrow_main/functions/actions/fn_transferFunds.sqf
index 502f078b..bd9e3a1c 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/UI/actions/fn_transferFunds.sqf
+++ b/addons/overthrow_main/functions/actions/fn_transferFunds.sqf
@@ -18,7 +18,7 @@ inputHandler = {
private _money = [_uid,"money"] call OT_fnc_getOfflinePlayerAttribute;
[_uid,"money",_money+_val] call OT_fnc_setOfflinePlayerAttribute;
};
- format["Transferred $%1 resistance funds to %2",[_val, 1, 0, true] call CBA_fnc_formatNumber,server getvariable [format["name%1",_uid],"player"]] call notify_minor;
+ format["Transferred $%1 resistance funds to %2",[_val, 1, 0, true] call CBA_fnc_formatNumber,server getvariable [format["name%1",_uid],"player"]] call OT_fnc_notifyMinor;
};
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferLegit.sqf b/addons/overthrow_main/functions/actions/fn_transferLegit.sqf
similarity index 91%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferLegit.sqf
rename to addons/overthrow_main/functions/actions/fn_transferLegit.sqf
index e00c4826..7adbc63b 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferLegit.sqf
+++ b/addons/overthrow_main/functions/actions/fn_transferLegit.sqf
@@ -19,7 +19,7 @@ if(typename _b == "ARRAY") then {
}foreach(player nearEntities [["Car","ReammoBox_F","Air","Ship"],20]);
if(count _objects == 0) exitWith {
- "Cannot find any containers or other vehicles within 20m of this vehicle" call notify_minor;
+ "Cannot find any containers or other vehicles within 20m of this vehicle" call OT_fnc_notifyMinor;
};
_sorted = [_objects,[],{_x distance player},"ASCEND"] call BIS_fnc_SortBy;
_target = _sorted select 0;
@@ -30,7 +30,7 @@ _doTransfer = {
private _toname = (typeof _target) call ISSE_Cfg_Vehicle_GetName;
private _iswarehouse = (_target isKindOf "OT_warehouse");
if(_iswarehouse) then {_toname = "Warehouse"};
- format["Transferring legal inventory from %1",_toname] call notify_minor;
+ format["Transferring legal inventory from %1",_toname] call OT_fnc_notifyMinor;
[5,false] call progressBar;
@@ -76,7 +76,7 @@ _doTransfer = {
}foreach(_target call OT_fnc_unitStock);
};
if(_full) then {hint "This vehicle is full, use a truck for more storage"};
- "Inventory Transfer done" call notify_minor;
+ "Inventory Transfer done" call OT_fnc_notifyMinor;
};
if(count _objects == 1) then {
@@ -86,6 +86,6 @@ if(count _objects == 1) then {
{
_options pushback [format["%1 (%2m)",(typeof _x) call ISSE_Cfg_Vehicle_GetName,round (_x distance player)],_doTransfer,_x];
}foreach(_objects);
- "Transfer legal items from which container?" call notify_big;
+ "Transfer legal items from which container?" call OT_fnc_notifyBig;
_options spawn playerDecision;
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferTo.sqf b/addons/overthrow_main/functions/actions/fn_transferTo.sqf
similarity index 93%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferTo.sqf
rename to addons/overthrow_main/functions/actions/fn_transferTo.sqf
index 3db49248..be7ee3e5 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/transferTo.sqf
+++ b/addons/overthrow_main/functions/actions/fn_transferTo.sqf
@@ -28,11 +28,11 @@ if(!_iswarehouse and !_notvehicle) then {
if(!_notvehicle and count _objects == 0) exitWith {
- "Cannot find any containers or other vehicles within 20m of this vehicle" call notify_minor;
+ "Cannot find any containers or other vehicles within 20m of this vehicle" call OT_fnc_notifyMinor;
};
if(_notvehicle and count _objects == 0) exitWith {
- "No warehouse within range" call notify_minor;
+ "No warehouse within range" call OT_fnc_notifyMinor;
};
private _doTransfer = {
@@ -49,7 +49,7 @@ private _doTransfer = {
_target = OT_warehouseTarget;
};
- format["Transferring inventory to %1",_toname] call notify_minor;
+ format["Transferring inventory to %1",_toname] call OT_fnc_notifyMinor;
[5,false] call progressBar;
sleep 5;
if(_iswarehouse) then {
@@ -116,7 +116,7 @@ private _doTransfer = {
}foreach(_target call OT_fnc_unitStock);
};
- "Inventory Transfer done" call notify_minor;
+ "Inventory Transfer done" call OT_fnc_notifyMinor;
};
@@ -129,6 +129,6 @@ if(count _objects == 1) then {
{
_options pushback [format["%1 (%2m)",(typeof _x) call ISSE_Cfg_Vehicle_GetName,round (_x distance player)],_doTransfer,_x];
}foreach(_objects);
- "Transfer to which container?" call notify_big;
+ "Transfer to which container?" call OT_fnc_notifyBig;
_options spawn playerDecision;
};
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/warehouseTake.sqf b/addons/overthrow_main/functions/actions/fn_warehouseTake.sqf
similarity index 96%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/warehouseTake.sqf
rename to addons/overthrow_main/functions/actions/fn_warehouseTake.sqf
index 7c03618b..342d43cd 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/warehouseTake.sqf
+++ b/addons/overthrow_main/functions/actions/fn_warehouseTake.sqf
@@ -25,7 +25,7 @@ if(_veh == player) then {
};
};
if(_veh == player) exitWith {
- "No warehouse within range" call notify_minor;
+ "No warehouse within range" call OT_fnc_notifyMinor;
};
while {_count < _num} do {
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/workshopAdd.sqf b/addons/overthrow_main/functions/actions/fn_workshopAdd.sqf
similarity index 92%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/workshopAdd.sqf
rename to addons/overthrow_main/functions/actions/fn_workshopAdd.sqf
index cdd2409c..e45e3b59 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/workshopAdd.sqf
+++ b/addons/overthrow_main/functions/actions/fn_workshopAdd.sqf
@@ -3,7 +3,7 @@ private _cls = lbData [1500,_idx];
private _price = lbValue [1500,_idx];
private _money = player getVariable "money";
-if(_money < _price) exitWith {"You cannot afford that!" call notify_minor};
+if(_money < _price) exitWith {"You cannot afford that!" call OT_fnc_notifyMinor};
_veh = cursorTarget;
if(_veh getVariable ["OT_attached",""] != "") exitWith {hint "This vehicle already has a weapon attached"};
@@ -33,7 +33,7 @@ if(!alive _veh) exitWith {};
disableUserInput true;
- "Attaching weapon to vehicle" call notify_minor;
+ "Attaching weapon to vehicle" call OT_fnc_notifyMinor;
[30,false] call progressBar;
sleep 30;
disableUserInput false;
diff --git a/addons/overthrow_main/functions/economy/fn_getRealEstateData.sqf b/addons/overthrow_main/functions/economy/fn_getRealEstateData.sqf
index 3e12beb0..2eace9aa 100644
--- a/addons/overthrow_main/functions/economy/fn_getRealEstateData.sqf
+++ b/addons/overthrow_main/functions/economy/fn_getRealEstateData.sqf
@@ -29,8 +29,8 @@ if !(_type in OT_spawnHouses) then {
};
private _price = round(_baseprice + ((_baseprice * _stability * _population) * (1+OT_standardMarkup)));
private _sell = round(_baseprice + (_baseprice * _stability * _population));
-private _lease = round((_stability * _population) * (_baseprice * _totaloccupants * 0.1));
-if !(_town in (server getvariable ["NATOabandoned",[]])) then {_lease = round(_lease * 0.6)};
+private _lease = round((_stability * _population) * ((_baseprice * 0.2) * _totaloccupants * 0.1));
+if !(_town in (server getvariable ["NATOabandoned",[]])) then {_lease = round(_lease * 0.2)};
private _diff = server getVariable ["OT_difficulty",1];
if(_diff == 0) then {_lease = round(_lease * 1.2)};
if(_diff == 2) then {_lease = round(_lease * 0.8)};
diff --git a/addons/overthrow_main/functions/events/fn_preInit.sqf b/addons/overthrow_main/functions/events/fn_preInit.sqf
index a21fcb99..78dfd35a 100644
--- a/addons/overthrow_main/functions/events/fn_preInit.sqf
+++ b/addons/overthrow_main/functions/events/fn_preInit.sqf
@@ -9,12 +9,23 @@ if(isServer) then {
warehouse = _group createUnit ["LOGIC",[2,0,0] , [], 0, ""];
spawner = _group createUnit ["LOGIC",[3,0,0] , [], 0, ""];
templates = _group createUnit ["LOGIC",[4,0,0] , [], 0, ""];
+ owners = _group createUnit ["LOGIC",[5,0,0] , [], 0, ""];
+ buildingpositions = _group createUnit ["LOGIC",[5,0,0] , [], 0, ""];
publicVariable "server";
publicVariable "cost";
publicVariable "warehouse";
publicVariable "spawner";
publicVariable "templates";
+ publicVariable "owners";
+ publicVariable "buildingpositions";
+
+ if(!isMultiplayer) then {
+ addMissionEventHandler ["Loaded", {
+ [] execVM "setupPlayer.sqf";
+ [] spawn setupKeyHandler;
+ }];
+ };
};
//VCOM AI, huge credits to Genesis, without VCOM this campaign would be so much less
@@ -28,3 +39,5 @@ if(isServer) then {
server setVariable ["StartupType","",true];
call OT_fnc_initVirtualization;
};
+
+OT_notifies = [];
diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOAirSupport.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOAirSupport.sqf
index f396f7ad..067662d4 100644
--- a/addons/overthrow_main/functions/factions/NATO/fn_NATOAirSupport.sqf
+++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOAirSupport.sqf
@@ -10,6 +10,11 @@ _group = creategroup blufor;
_veh = createVehicle [_vehtype, _pos, [], 0,""];
_veh setVariable ["garrison","HQ",false];
+clearWeaponCargoGlobal _veh;
+clearMagazineCargoGlobal _veh;
+clearItemCargoGlobal _veh;
+clearBackpackCargoGlobal _veh;
+
_veh setDir (_dir);
_group addVehicle _veh;
createVehicleCrew _veh;
diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOCounterObjective.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOCounterObjective.sqf
index d1d9b0a7..d546bece 100644
--- a/addons/overthrow_main/functions/factions/NATO/fn_NATOCounterObjective.sqf
+++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOCounterObjective.sqf
@@ -22,5 +22,8 @@ _success = {
_count = {(_x getVariable ["garrison",""]) == _objective} count (allunits);
server setVariable [format["garrison%1",_objective],_count,true];
_objective setMarkerType "flag_NATO";
+ if(_objective == "Chemical Plant") then {
+ server setVariable ["reschems",0,true];
+ };
};
[_posObjective,_strength,_success,_fail,[_tskid,_objective],_objective] spawn OT_fnc_NATOQRF;
diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf
index db389542..5d436b8f 100644
--- a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf
+++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundForces.sqf
@@ -8,7 +8,7 @@ private _tgroup = false;
if !(_byair) then {
sleep 0.2;
_squadtype = OT_NATO_GroundForces call BIS_fnc_SelectRandom;
- _spawnpos = [_spawnpos,[0,50]] call SHK_pos;
+ _spawnpos = [_frompos,[50,75]] call SHK_pos;
_group2 = [_spawnpos, WEST, (configFile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Infantry" >> _squadtype)] call BIS_fnc_spawnGroup;
};
sleep 0.5;
@@ -34,6 +34,10 @@ if(_frompos distance _attackpos > 600) then {
_veh = createVehicle [_vehtype, _pos, [], 0,""];
_veh setVariable ["garrison","HQ",false];
+ clearWeaponCargoGlobal _veh;
+ clearMagazineCargoGlobal _veh;
+ clearItemCargoGlobal _veh;
+ clearBackpackCargoGlobal _veh;
_veh setDir (_dir);
_tgroup addVehicle _veh;
@@ -64,19 +68,14 @@ if !(_byair) then {
if(typename _tgroup == "GROUP") then {
_x moveInCargo _veh;
};
- [_x] joinSilent _group1;
_x setVariable ["VCOM_NOPATHING_Unit",true,false];
_allunits pushback _x;
_x setVariable ["garrison","HQ",false];
}foreach(units _group2);
+ spawner setVariable ["NATOattackforce",(spawner getVariable ["NATOattackforce",[]])+[_group2],false];
};
-
-
-{
- _x addCuratorEditableObjects [_allunits,true];
-} forEach allCurators;
-sleep 1;
+sleep 5;
if(_byair and (typename _tgroup == "GROUP")) then {
_wp = _tgroup addWaypoint [_frompos,0];
_wp setWaypointType "MOVE";
@@ -117,36 +116,87 @@ if(_byair and (typename _tgroup == "GROUP")) then {
if(typename _tgroup == "GROUP") then {
_veh setdamage 0;
_dir = [_attackpos,_frompos] call BIS_fnc_dirTo;
- _roads = ([_attackpos,200,_dir] call BIS_fnc_relPos) nearRoads 200;
+ _roads = _ao nearRoads 50;
private _dropos = _ao;
if(count _roads > 0) then {
_dropos = getpos(_roads select (count _roads - 1));
};
+ _move = _tgroup addWaypoint [_dropos,0];
+ _move setWaypointBehaviour "CARELESS";
+ _move setWaypointType "MOVE";
+
_move = _tgroup addWaypoint [_dropos,0];
_move setWaypointTimeout [30,30,30];
_move setWaypointType "TR UNLOAD";
_wp = _tgroup addWaypoint [_frompos,0];
_wp setWaypointType "MOVE";
- _wp setWaypointSpeed "LIMITED";
+ _wp setWaypointBehaviour "CARELESS";
_wp setWaypointCompletionRadius 25;
_wp = _tgroup addWaypoint [_frompos,0];
_wp setWaypointType "SCRIPTED";
+ _wp setWaypointCompletionRadius 25;
_wp setWaypointStatements ["true","[vehicle this] spawn OT_fnc_cleanup"];
+
+ {
+ _x addCuratorEditableObjects [(units _tgroup)+[_veh],true];
+ } forEach allCurators;
};
};
sleep 10;
-_wp = _group1 addWaypoint [asltoatl _attackpos,20];
+_wp = _group1 addWaypoint [_attackpos,100];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "COMBAT";
_wp setWaypointSpeed "FULL";
-_wp = _group1 addWaypoint [asltoatl _attackpos,0];
+_wp = _group1 addWaypoint [_attackpos,0];
_wp setWaypointType "GUARD";
_wp setWaypointBehaviour "COMBAT";
_group1 call distributeAILoad;
if(typename _tgroup == "GROUP") then {
_tgroup call distributeAILoad;
+ [_veh,_tgroup,_frompos] spawn {
+ params ["_veh","_tgroup","_frompos"];
+ private _done = false;
+ while{sleep 10;!_done} do {
+ if(isNull _veh) exitWith {};
+ if(isNull _tgroup) exitWith {};
+ if((damage _veh) > 0 and ((getpos _veh) select 2) < 2) then {
+ while {(count (waypoints _tgroup)) > 0} do {
+ deleteWaypoint ((waypoints _tgroup) select 0);
+ };
+ commandStop (driver _veh);
+ {
+ unassignVehicle _x;
+ commandGetOut _x;
+ }foreach((crew _veh) - (units _tgroup));
+ _done = true;
+
+ _wp = _tgroup addWaypoint [_frompos,0];
+ _wp setWaypointType "MOVE";
+ _wp setWaypointBehaviour "CARELESS";
+ _wp setWaypointCompletionRadius 50;
+
+ _wp = _tgroup addWaypoint [_frompos,0];
+ _wp setWaypointType "SCRIPTED";
+ _wp setWaypointCompletionRadius 50;
+ _wp setWaypointStatements ["true","[vehicle this] spawn OT_fnc_cleanup"];
+ };
+ };
+ };
+};
+
+if !(_byair) then {
+ _wp = _group2 addWaypoint [_attackpos,100];
+ _wp setWaypointType "MOVE";
+ _wp setWaypointBehaviour "COMBAT";
+ _wp setWaypointSpeed "FULL";
+
+ _wp = _group2 addWaypoint [_attackpos,0];
+ _wp setWaypointType "GUARD";
+ _wp setWaypointBehaviour "COMBAT";
+
+ _group2 call distributeAILoad;
};
diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundSupport.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundSupport.sqf
index 71a367f3..d9a01d2f 100644
--- a/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundSupport.sqf
+++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOGroundSupport.sqf
@@ -17,6 +17,11 @@ while {_count < _num} do {
_veh = createVehicle [_vehtype, _pos, [], 0,""];
_veh setVariable ["garrison","HQ",false];
+ clearWeaponCargoGlobal _veh;
+ clearMagazineCargoGlobal _veh;
+ clearItemCargoGlobal _veh;
+ clearBackpackCargoGlobal _veh;
+
_veh setDir (_dir);
_group addVehicle _veh;
createVehicleCrew _veh;
@@ -29,7 +34,11 @@ while {_count < _num} do {
sleep 0.1;
};
-_wp = _group addWaypoint [asltoatl _attackpos,20];
+_wp = _group addWaypoint [_attackpos,20];
+_wp setWaypointType "MOVE";
+_wp setWaypointBehaviour "CARELESS";
+
+_wp = _group addWaypoint [_attackpos,20];
_wp setWaypointType "SAD";
_wp setWaypointBehaviour "COMBAT";
_wp setWaypointTimeout [600,600,600];
diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf
index 7540d957..0ea1f379 100644
--- a/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf
+++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOQRF.sqf
@@ -1,15 +1,8 @@
params ["_pos","_strength","_success","_fail","_params","_garrison"];
private _numPlayers = count([] call CBA_fnc_players);
-if(_numPlayers < 3) then {
- _strength = round(_strength * 0.4);
-}else{
- if(_numPlayers < 6) then {
- _strength = round(_strength * 0.7);
- }else{
- if(_numPlayers > 10) then {
- _strength = round(_strength * 1.5);
- };
- }
+
+if(_numPlayers > 3) then {
+ _strength = round(_strength * 1.5);
};
private _diff = server getVariable ["OT_difficulty",1];
if(_diff == 0) then {
@@ -19,184 +12,139 @@ if(_diff == 2) then {
_strength = round(_strength * 2);
};
-spawner setVariable ["NATOattackforce",[],false];
-//determine possible vectors for non-infantry assets and distribute strength to each
-
-private _isCoastal = false;
-private _objectiveIsControlled = false;
-private _airfieldIsControlled = false;
-
-private _seaStrength = 0;
-private _landStrength = 0;
-private _airStrength = 0;
-
-//Sea?
-if(surfaceIsWater ([_pos,500,0] call BIS_fnc_relPos) or surfaceIsWater ([_pos,500,90] call BIS_fnc_relPos) or surfaceIsWater ([_pos,500,180] call BIS_fnc_relPos) or surfaceIsWater ([_pos,500,270] call BIS_fnc_relPos)) then {
- _isCoastal = true;
-};
+if(_strength < 150) then {_strength = 150};
+if(_strength > 2500) then {_strength = 2500};
-if(OT_NATO_Navy_HQ in (server getvariable ["NATOabandoned",[]])) then {
- _isCoastal = false;
-};
-
-//Land?
+spawner setVariable ["NATOattackforce",[],false];
+//determine possible vectors and distribute strength to each
private _town = _pos call OT_fnc_nearestTown;
private _region = server getVariable format["region_%1",_town];
-private _closestObjectivePos = [];
-private _closestObjective = "";
-private _dist = 20000;
+
+_ground = [];
+_air = [];
+_abandoned = server getvariable ["NATOabandoned",[]];
{
- _p = _x select 0;
- _name = _x select 1;
- if(_p inArea _region and !(_name in (server getvariable ["NATOabandoned",[]]))) then {
- _d = (_p distance _pos);
- if(_d < _dist and _d > 500) then {
- _dist = _d;
- _closestObjectivePos = _p;
- _closestObjective = _name;
+ _x params ["_obpos","_name","_pri"];
+ if !(_name in _abandoned) then {
+ if([_pos,_obpos] call OT_fnc_regionIsConnected) then {
+ _ground pushback _x;
+ };
+ if(_x in OT_airportData) then {
+ _air pushback _x;
};
};
-}foreach(OT_NATOobjectives);
-
-if (count _closestObjectivePos > 0) then {
- _objectiveIsControlled = true;
+}foreach([OT_objectiveData + OT_airportData,[],{_pos distance (_x select 0)},"ASCEND"] call BIS_fnc_SortBy);
+diag_log format["Overthrow: NATO QRF spend is %1",_strength];
+
+if(_strength > 250 and (count _air) > 0) then {
+ //Send CAS
+ _obpos = (_air select 0) select 0;
+ _name = (_air select 0) select 1;
+ [[_obpos,[0,100],random 360] call SHK_pos,_pos,10] spawn OT_fnc_NATOAirSupport;
+ diag_log format["Overthrow: NATO Sent CAS from %1",_name];
};
-private _closestAirfieldPos = [];
-private _closestAirfield = "";
-private _dist = 20000;
-{
- _p = _x select 0;
- _name = _x select 1;
- if(_name in OT_allAirports) then {
- _d = (_p distance _pos);
- if(_d < _dist and _d > 1500) then {
- _dist = _d;
- _closestAirfieldPos = _p;
- _closestAirfield = _name;
- };
+//Send ground support
+if(count _ground > 0) then {
+ _obpos = (_ground select 0) select 0;
+ _name = (_ground select 0) select 1;
+ _send = 100;
+ if(_strength > 500) then {
+ _send = 300;
};
-}foreach(OT_NATOobjectives);
-
-if (_closestAirfield != "") then {
- if !(_closestAirfield in (server getvariable ["NATOabandoned",[]])) then {
- _airfieldIsControlled = true;
+ if(_strength > 1000) then {
+ _send = 500;
};
+ [_obpos,_pos,_send,0] spawn OT_fnc_NATOGroundSupport;
+ diag_log format["Overthrow: NATO Sent ground support from %1",_name];
};
-private _s = _strength;
-
-if(_isCoastal) then {
- _seaStrength = round(random _s);
- _s = _s - _seaStrength;
-};
-
-if(_s > 0 and _objectiveIsControlled) then {
- _landStrength = round(random _s);
- _s = _s - _landStrength;
-};
-
-if(_s > 0) then {
- _airStrength = _s;
-};
-diag_log format["Overthrow: Attack start on %1 (sea:%2 land:%3 air:%4)",_pos,_seaStrength,_landStrength,_airStrength];
-private _delay = 0;
-
-if(_seaStrength > 0) then {
- private _numgroups = 1;
- if(_seaStrength > 50) then {_numgroups = 2};
- if(_seaStrength > 150) then {_numgroups = 3};
+{
+ _x params ["_obpos","_name","_pri"];
- private _p = getMarkerPos OT_NATO_Navy_HQ;
- private _count = 0;
- while {_count < _numgroups} do {
- diag_log format["Overthrow: Sending sea support %1",_p];
- [[_p,[0,100],random 360] call SHK_pos,_pos,_delay] spawn OT_fnc_NATOSeaSupport;
- _count = _count + 1;
- _delay = _delay + 20;
+ _dir = [_pos,_obpos] call BIS_fnc_dirTo;
+ _ao = [_pos,_dir] call OT_fnc_getAO;
+ [_obpos,_ao,_pos,false,10] spawn OT_fnc_NATOGroundForces;
+ diag_log format["Overthrow: NATO Sent ground forces from %1",_name];
+ _strength = _strength - 150;
+ if((_obpos inArea _region) and _strength >= 150) then {
+ _ao = [_pos,_dir] call OT_fnc_getAO;
+ [_obpos,_ao,_pos,false,30] spawn OT_fnc_NATOGroundForces;
+ _strength = _strength - 150;
+ diag_log format["Overthrow: NATO Sent extra ground forces from %1",_name];
};
-};
+ if(_strength <=0) exitWith {};
+}foreach(_ground);
-//Ground units
+if(_strength >= 75) then {
+ {
+ _x params ["_obpos","_name","_pri"];
-//Send main force via HQ by air
-private _dir = [_pos,OT_NATO_HQPos] call BIS_fnc_dirTo;
-private _ao = [_pos,_dir] call OT_fnc_getAO;
+ _dir = [_pos,_obpos] call BIS_fnc_dirTo;
+ _ao = [_pos,_dir] call OT_fnc_getAO;
+ [_obpos,_ao,_pos,true,0] spawn OT_fnc_NATOGroundForces;
+ diag_log format["Overthrow: NATO Sent ground forces by air from %1",_name];
+ _strength = _strength - 75;
+
+ if(_pri > 600 and _strength >= 75) then {
+ _ao = [_pos,_dir] call OT_fnc_getAO;
+ [_obpos,_ao,_pos,true,30] spawn OT_fnc_NATOGroundForces;
+ _strength = _strength - 75;
+ diag_log format["Overthrow: NATO Sent extra ground forces by air from %1",_name];
+ };
-private _max = 5;
-if(_numPlayers < 3 or _diff == 0) then {
- _max = 3;
-};
-if(_numPlayers > 10 or _diff > 1) then {
- _max = 7;
-};
-private _numgroups = 1+floor(_strength / 100);
-if(_numgroups > _max) then {
- _numgroups = _max;
-};
-private _count = 0;
-if(_delay > 0) then {
- _delay = _delay + 10;
-};
-while {_count < _numgroups} do {
- //diag_log format["Overthrow: Sending HQ ground forces %1",_ao];
- [OT_NATO_HQPos,_ao,_pos,true,_delay] spawn OT_fnc_NATOGroundForces;
- _ao = [_pos,_dir] call OT_fnc_getAO;
- _count = _count + 1;
- _delay = _delay + 20;
+ if(_strength <=0) exitWith {};
+ }foreach(_air);
};
-if(_objectiveIsControlled) then {
- //send some units by ground from the closest objective
- _dir = [_pos,_closestObjectivePos] call BIS_fnc_dirTo;
- _ao = [_pos,_dir] call OT_fnc_getAO;
- [_closestObjectivePos,_pos,_landStrength,0] spawn OT_fnc_NATOGroundSupport;
+private _isCoastal = false;
+private _seaAO = [];
+
+//Sea?
- _numgroups = 1+floor(_landStrength / 250);
- if(_numgroups > 2) then {
- _numgroups = 2;
+call {
+ private _p = [_pos,500,0] call BIS_fnc_relPos;
+ if(surfaceIsWater _p) exitWith {
+ _isCoastal = true;
+ _seaAO = _p;
};
- _count = 0;
- _delay = 20;
- while {_count < _numgroups} do {
- //diag_log format["Overthrow: Sending ground forces %1",_closestObjectivePos];
- [_closestObjectivePos,_ao,_pos,false,_delay] spawn OT_fnc_NATOGroundForces;
- _ao = [_pos,_dir] call OT_fnc_getAO;
- _count = _count + 1;
- _delay = _delay + 10;
+ _p = [_pos,500,90] call BIS_fnc_relPos;
+ if(surfaceIsWater _p) exitWith {
+ _isCoastal = true;
+ _seaAO = _p;
};
-};
-
-if(_airfieldIsControlled) then {
- //send some units by air from the closest airfield
- _dir = [_pos,_closestAirfieldPos] call BIS_fnc_dirTo;
- _ao = [_pos,_dir] call OT_fnc_getAO;
- _numgroups = 1;
- if(_airStrength < 60) then {_numgroups = 0};
- _count = 0;
- _delay = 0;
- while {_count < _numgroups} do {
- //diag_log format["Overthrow: Sending Air support %1",_closestAirfieldPos];
- [[_closestAirfieldPos,[0,100],random 360] call SHK_pos,_pos,_delay] spawn OT_fnc_NATOAirSupport;
- _count = _count + 1;
- _delay = _delay + 20;
+ _p = [_pos,500,180] call BIS_fnc_relPos;
+ if(surfaceIsWater _p) exitWith {
+ _isCoastal = true;
+ _seaAO = _p;
};
- _numgroups = floor(_strength / 150);
- if(_numgroups > 2) then {
- _numgroups = 2;
+ _p = [_pos,500,270] call BIS_fnc_relPos;
+ if(surfaceIsWater _p) exitWith {
+ _isCoastal = true;
+ _seaAO = _p;
};
- _count = 0;
- _delay = 0;
+};
+
+diag_log format["Overthrow: Attack start on %1",_pos];
+private _delay = 0;
+
+if(_isCoastal and !(OT_NATO_Navy_HQ in _abandoned) and (random 100) > 70) then {
+ private _numgroups = 1;
+ if(_strength > 100) then {_numgroups = 2};
+ if(_strength > 200) then {_numgroups = 3};
+
+ private _p = getMarkerPos OT_NATO_Navy_HQ;
+ private _count = 0;
while {_count < _numgroups} do {
- [_closestAirfieldPos,_ao,_pos,true,_delay] spawn OT_fnc_NATOGroundForces;
- _ao = [_pos,_dir] call OT_fnc_getAO;
+ diag_log format["Overthrow: NATO Sent navy support from %1",OT_NATO_Navy_HQ];
+ [[_p,[0,100],random 360] call SHK_pos,_seaAO,_delay] spawn OT_fnc_NATOSeaSupport;
_count = _count + 1;
_delay = _delay + 20;
};
};
-sleep 200; //Give NATO some time to get their shit together
+sleep 300; //Give NATO some time to get their shit together
private _timeout = time + 800;
@@ -208,6 +156,14 @@ waitUntil {
{
_numalive = _numalive + ({alive _x} count (units _x));
_numin = _numin + ({alive _x and _x distance _pos < 150} count (units _x));
+ {
+ if(vehicle _x != _x) then {
+ if(((vehicle _x) isKindOf "Air") and (position _x select 2) < 4) then {
+ //Downed heli
+ doGetout _x;
+ }
+ };
+ }foreach(units _x);
}foreach(_force);
(_numalive < 4) or (time > _timeout) or (_numin > 4)
};
@@ -216,7 +172,7 @@ private _force = spawner getVariable["NATOattackforce",[]];
{
_target = leader _x;
{
- if((side _x == resistance) and (alive _x) and !(_x getvariable ["ace_isunconscious",false])) then {
+ if((side _x == resistance or captive _x) and (alive _x) and !(_x getvariable ["ace_isunconscious",false])) then {
_x reveal [_target,3];
};
}foreach(allunits);
@@ -246,7 +202,7 @@ while {sleep 5;time < _timeout and !_won} do {
_alivein = _alivein + 1;
};
};
- if((side _x == resistance) and (alive _x) and !(_x getvariable ["ace_isunconscious",false])) then {
+ if((side _x == resistance or captive _x) and (alive _x) and !(_x getvariable ["ace_isunconscious",false])) then {
_enemy = _enemy + 1;
if(_x distance _pos < 400) then {
_enemyin = _enemyin + 1;
@@ -254,7 +210,7 @@ while {sleep 5;time < _timeout and !_won} do {
};
};
}foreach(allunits);
- if(_natowin and (_alivein == 0 or _enemy > 0)) then {
+ if(_natowin and (_alivein < _enemy)) then {
_natowin = false;
};
@@ -295,12 +251,12 @@ while {sleep 5;time < _timeout and !_won} do {
}foreach(vehicles);
_won = true;
};
- if(_alivein > 0 and _enemy == 0) then {
+ if(_alivein > _enemy) then {
sleep 30; //Buffer zone
_natowin = true;
};
//diag_log format["Overthrow: Win/Loss BLU %1 RES %2",_alive,_enemy];
- if(_alive < 4 or (_enemyin > 0 and _alivein < 4)) exitWith{};
+ if(_alive < 4) exitWith{};
};
if !(_won) then {
_params call _fail;
diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOResponseObjective.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOResponseObjective.sqf
index 4fa334a4..06d0c846 100644
--- a/addons/overthrow_main/functions/factions/NATO/fn_NATOResponseObjective.sqf
+++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOResponseObjective.sqf
@@ -14,7 +14,7 @@ _fail = {
if(_objective == "The Fuel Depot") then {
_effect = "(Vehicles are now cheaper)";
};
- format["Resistance has captured %1 (+100 Influence) %2",_objective,_effect] remoteExec ["notify_good",0,false];
+ format["Resistance has captured %1 (+100 Influence) %2",_objective,_effect] remoteExec ["OT_fnc_notifyGood",0,false];
100 remoteExec ["influenceSilent",0,false];
private _posTown = getMarkerPos _objective;
_flag = _posTown nearobjects [OT_flag_NATO,500];
diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOResponseTown.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOResponseTown.sqf
index 0787d743..1e60c43f 100644
--- a/addons/overthrow_main/functions/factions/NATO/fn_NATOResponseTown.sqf
+++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOResponseTown.sqf
@@ -16,7 +16,7 @@ private _fail = {
params ["_tskid","_town"];
private _townpop = server getVariable format["population%1",_town];
_townpop remoteExec ["influenceSilent",0,false];
- format["NATO has abandoned %1 (+%2 Influence)",_town,_townpop] remoteExec ["notify_good",0,false];
+ format["NATO has abandoned %1 (+%2 Influence)",_town,_townpop] remoteExec ["OT_fnc_notifyGood",0,false];
[_tskid, "SUCCEEDED",true] spawn BIS_fnc_taskSetState;
_abandoned = server getVariable "NATOabandoned";
_abandoned pushback _town;
diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportRecon.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportRecon.sqf
index 7ea5b85f..9444a87c 100644
--- a/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportRecon.sqf
+++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportRecon.sqf
@@ -1,16 +1,14 @@
-private _posTown = _this;
+private _posTarget = _this;
private _close = nil;
-private _dist = 8000;
+private _dist = 4000;
private _closest = "";
private _abandoned = server getVariable["NATOabandoned",[]];
-private _town = _posTown call OT_fnc_nearestTown;
-private _region = server getVariable format["region_%1",_town];
{
_pos = _x select 0;
_name = _x select 1;
- if(_pos inArea _region and !(_name in _abandoned)) then {
- _d = (_pos distance _posTown);
+ if(([_pos,_posTarget] call OT_fnc_regionIsConnected) and !(_name in _abandoned)) then {
+ _d = (_pos distance _posTarget);
if(_d < _dist) then {
_dist = _d;
_close = _pos;
@@ -18,41 +16,51 @@ private _region = server getVariable format["region_%1",_town];
};
};
}foreach(OT_NATOobjectives);
-_isHQ = false;
+_isAir = false;
if(isNil "_close") then {
- _isHQ = true;
- _close = OT_NATO_HQPos;
+ _isAir = true;
+ {
+ _x params ["_obpos","_name","_pri"];
+ if !(_name in _abandoned) exitWith {
+ _close = _obpos;
+ };
+ }foreach([OT_airportData,[],{random 100},"ASCEND"] call BIS_fnc_SortBy);
};
_start = [_close,50,200, 1, 0, 0, 0] call BIS_fnc_findSafePos;
-_group = [_start, WEST, (configFile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Infantry" >> "B_T_ReconTeam")] call BIS_fnc_spawnGroup;
+_group = [_start, WEST, OT_NATO_Group_CTRG] call BIS_fnc_spawnGroup;
_group call distributeAILoad;
sleep 0.5;
-_dir = [_start,_posTown] call BIS_fnc_dirTo;
+_dir = [_start,_posTarget] call BIS_fnc_dirTo;
-if(_isHQ) then {
- _attackpos = [_posTown,[0,150]] call SHK_pos;
+if(_isAir) then {
+ _attackpos = [_posTarget,[0,150]] call SHK_pos;
//Determine direction to attack from (preferrably away from water)
_attackdir = random 360;
- if(surfaceIsWater ([_posTown,150,_attackDir] call BIS_fnc_relPos)) then {
+ if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then {
_attackdir = _attackdir + 180;
if(_attackdir > 359) then {_attackdir = _attackdir - 359};
- if(surfaceIsWater ([_posTown,150,_attackDir] call BIS_fnc_relPos)) then {
+ if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then {
_attackdir = _attackdir + 90;
if(_attackdir > 359) then {_attackdir = _attackdir - 359};
- if(surfaceIsWater ([_posTown,150,_attackDir] call BIS_fnc_relPos)) then {
+ if(surfaceIsWater ([_posTarget,150,_attackDir] call BIS_fnc_relPos)) then {
_attackdir = _attackdir + 180;
if(_attackdir > 359) then {_attackdir = _attackdir - 359};
};
};
};
_attackdir = _attackdir - 45;
- _ao = [_posTown,[350,500],_attackdir + (random 90)] call SHK_pos;
+ _ao = [_posTarget,[350,500],_attackdir + (random 90)] call SHK_pos;
_tgroup = creategroup blufor;
- _spawnpos = OT_NATO_HQPos findEmptyPosition [0,100,OT_NATO_Vehicle_AirTransport_Small];
- _veh = OT_NATO_Vehicle_AirTransport_Small createVehicle _spawnpos;
+ _spawnpos = _close findEmptyPosition [0,100,OT_NATO_Vehicle_CTRGTransport];
+ _veh = OT_NATO_Vehicle_CTRGTransport createVehicle _spawnpos;
+ clearWeaponCargoGlobal _veh;
+ clearMagazineCargoGlobal _veh;
+ clearItemCargoGlobal _veh;
+ clearBackpackCargoGlobal _veh;
+
_veh setDir _dir;
_tgroup addVehicle _veh;
@@ -72,7 +80,7 @@ if(_isHQ) then {
sleep 2;
- _moveto = [OT_NATO_HQPos,500,_dir] call SHK_pos;
+ _moveto = [_close,500,_dir] call SHK_pos;
_wp = _tgroup addWaypoint [_moveto,0];
_wp setWaypointType "MOVE";
_wp setWaypointBehaviour "COMBAT";
@@ -97,7 +105,7 @@ if(_isHQ) 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;
+ _moveto = [_close,200,_dir] call SHK_pos;
_wp = _tgroup addWaypoint [_moveto,0];
_wp setWaypointType "LOITER";
@@ -113,10 +121,23 @@ if(_isHQ) then {
_x addCuratorEditableObjects [units _tgroup,true];
} forEach allCurators;
}else{
- _moveto = [_start,50,_dir] call SHK_pos;
- _wp = _group addWaypoint [_moveto,5];
- _wp setWaypointType "MOVE";
- _wp setWaypointBehaviour "SAFE";
+ _convoypos = [_close,random 360,120] call SHK_pos;
+ private _road = [_convoypos] call BIS_fnc_nearestRoad;
+ if (!isNull _road) then {
+ _convoypos = (getpos _road);
+ };
+ _spawnpos = _convoypos findEmptyPosition [0,100,OT_NATO_Vehicle_Transport_Light];
+ _veh = OT_NATO_Vehicle_Transport_Light createVehicle _spawnpos;
+ _group addVehicle _veh;
+
+ _wp = _group addWaypoint [_posTarget,700];
+ _wp setWaypointType "UNLOAD";
+ _wp setWaypointBehaviour "CARELESS";
+ _wp setWaypointSpeed "FULL";
+
+ {
+ _x moveInAny _veh;
+ }foreach(units _group);
};
{
_x addCuratorEditableObjects [units _group,true];
@@ -128,20 +149,6 @@ sleep 2;
_x setVariable ["VCOM_NOPATHING_Unit",true,false];
}foreach(units _group);
-
-_wp = _group addWaypoint [_posTown,100];
-_wp setWaypointType "HOLD";
-_wp setWaypointBehaviour "STEALTH";
-_wp setWaypointTimeout [60,120,600];
-
-_dest = getpos([_posTown,OT_allHouses + OT_allShops + OT_offices + OT_portBuildings] call OT_fnc_getRandomBuilding);
-_wp = _group addWaypoint [_posTown,100];
-_wp setWaypointType "HOLD";
-_wp setWaypointBehaviour "STEALTH";
-_wp setWaypointTimeout [60,120,600];
-
-_dest = getpos([_posTown,OT_allHouses + OT_allShops + OT_offices + OT_portBuildings] call OT_fnc_getRandomBuilding);
-_wp = _group addWaypoint [_posTown,100];
-_wp setWaypointType "HOLD";
-_wp setWaypointBehaviour "STEALTH";
-_wp setWaypointTimeout [60,120,600];
+_wp = _group addWaypoint [_posTarget,0];
+_wp setWaypointType "GUARD";
+_wp setWaypointBehaviour "COMBAT";
diff --git a/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportSniper.sqf b/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportSniper.sqf
index a182ecf4..bf0aae33 100644
--- a/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportSniper.sqf
+++ b/addons/overthrow_main/functions/factions/NATO/fn_NATOSupportSniper.sqf
@@ -26,7 +26,7 @@ if(isNil "_close") then {
_close = OT_NATO_HQPos;
};
_start = [_close,50,200, 1, 0, 0, 0] call BIS_fnc_findSafePos;
-_group = [_start, WEST, (configFile >> "CfgGroups" >> "West" >> "BLU_T_F" >> "Infantry" >> "B_T_SniperTeam")] call BIS_fnc_spawnGroup;
+_group = [_start, WEST, OT_NATO_Group_Recon] call BIS_fnc_spawnGroup;
sleep 0.5;
diff --git a/addons/overthrow_main/functions/factions/NATO/fn_initNATO.sqf b/addons/overthrow_main/functions/factions/NATO/fn_initNATO.sqf
new file mode 100644
index 00000000..e6ef676a
--- /dev/null
+++ b/addons/overthrow_main/functions/factions/NATO/fn_initNATO.sqf
@@ -0,0 +1,221 @@
+if (!isServer) exitwith {};
+
+OT_NATOobjectives = [];
+OT_NATOcomms = [];
+
+OT_NATOobjectives = server getVariable ["NATOobjectives",[]];
+OT_NATOcomms = server getVariable ["NATOcomms",[]];
+OT_NATOhvts = server getVariable ["NATOhvts",[]];
+OT_allObjectives = [];
+OT_allComms = [];
+
+private _diff = server getVariable ["OT_difficulty",1];
+
+if((server getVariable "StartupType") == "NEW" or (server getVariable ["NATOversion",0]) < OT_NATOversion) then {
+ diag_log "Overthrow: Generating NATO";
+ server setVariable ["NATOversion",OT_NATOversion,false];
+ _abandoned = server getVariable ["NATOabandoned",[]];
+
+ (OT_loadingMessages call BIS_fnc_selectRandom) remoteExec['blackFaded',0,false];
+ sleep 0.1;
+ {
+ _stability = server getVariable format ["stability%1",_x];
+ if(_stability < 11 and !(_x in _abandoned)) then {
+ _abandoned pushback _x;
+ };
+ }foreach (OT_allTowns);
+ server setVariable ["NATOabandoned",_abandoned,true];
+ server setVariable ["NATOresources",2000,true];
+ server setVariable ["garrisonHQ",1000,false];
+ OT_NATOobjectives = [];
+ OT_NATOcomms = [];
+ OT_NATOhvts = [];
+ server setVariable ["NATOobjectives",OT_NATOobjectives,false];
+ server setVariable ["NATOcomms",OT_NATOcomms,false];
+ server setVariable ["NATOhvts",OT_NATOhvts,false];
+
+ _numHVTs = 6;
+ if(_diff == 0) then {_numHVTs = 4};
+ if(_diff == 2) then {_numHVTs = 8};
+
+ //Find military objectives
+ {
+ _x params ["_pos","_name","_worth"];
+ if !(_name in _abandoned) then {
+ OT_NATOobjectives pushBack _x;
+ server setVariable [format ["vehgarrison%1",_name],[],true];
+
+ _base = 8;
+ _statics = OT_NATO_StaticGarrison_LevelOne;
+ if(_worth > 500) then {
+ _base = 16;
+ _statics = OT_NATO_StaticGarrison_LevelTwo;
+ };
+ if(_worth > 1000) then {
+ _base = 24;
+ _statics = OT_NATO_StaticGarrison_LevelThree;
+ };
+ _garrison = floor(_base + random(8));
+ server setVariable [format ["vehgarrison%1",_name],_statics,true];
+
+ if(_name == OT_NATO_HQ) then {
+ _garrison = 48;
+ server setVariable [format ["vehgarrison%1",_name],["B_T_APC_Tracked_01_AA_F","B_T_APC_Tracked_01_AA_F","B_GMG_01_high_F","B_GMG_01_high_F","B_GMG_01_high_F","B_HMG_01_high_F","B_HMG_01_high_F","B_HMG_01_high_F"],true];
+ server setVariable [format ["airgarrison%1",_name],[OT_NATO_Vehicle_AirTransport_Large],true];
+ }else{
+ server setVariable [format ["airgarrison%1",_name],[],true];
+ };
+ server setVariable [format ["garrison%1",_name],_garrison,true];
+
+ if(_name == OT_NATO_HQ) then {
+ OT_NATO_HQPos = _pos;
+ };
+ }else{
+ OT_NATOobjectives pushBack _x;
+ };
+ }foreach (OT_objectiveData + OT_airportData);
+
+ _count = 0;
+ _done = [];
+ while {_count < _numHVTs} do {
+ _ob = selectRandom (OT_NATOobjectives - ([[OT_NATO_HQ,OT_NATO_HQPos]] + _done));
+ _name = _ob select 1;
+ _done pushback _ob;
+ _id = format["%1%2",_name,round(random 99999)];
+ OT_NATOhvts pushback [_id,_name,""];
+ _count = _count + 1;
+ };
+
+ (OT_loadingMessages call BIS_fnc_selectRandom) remoteExec['blackFaded',0];
+ sleep 0.1;
+ //Add comms towers
+ {
+ _x params ["_pos","_name"];
+ OT_NATOcomms pushBack [_pos,_name];
+ _garrison = floor(4 + random(4));
+ server setVariable [format ["garrison%1",_name],_garrison,true];
+ }foreach (OT_commsData);
+
+ server setVariable ["NATOobjectives",OT_NATOobjectives,true];
+ server setVariable ["NATOcomms",OT_NATOcomms,true];
+ server setVariable ["NATOhvts",OT_NATOhvts,true];
+ diag_log "Overthrow: Distributing NATO vehicles";
+
+ //Weighted airport list to distribute air vehicles
+ _prilist = [];
+ {
+ _x params ["_pos","_name","_worth"];
+ _prilist pushback _name;
+ if(_worth > 500) then {
+ _prilist pushback _name;
+ };
+ if(_worth > 800) then {
+ _prilist pushback _name;
+ };
+ if(_worth > 1000) then {
+ _prilist pushback _name;
+ };
+ }foreach(OT_airportData);
+
+ {
+ _type = _x select 0;
+ _num = _x select 1;
+ _count = 0;
+ while {_count < _num} do {
+ _name = _prilist call BIS_fnc_selectRandom;
+ _garrison = server getVariable [format["airgarrison%1",_name],[]];
+ _garrison pushback _type;
+ _count = _count + 1;
+ server setVariable [format ["airgarrison%1",_name],_garrison,true];
+ };
+ }foreach(OT_NATO_Vehicles_AirGarrison);
+
+
+ diag_log "Overthrow: Setting up NATO checkpoints";
+ {
+ _garrison = floor(8 + random(6));
+ if(_x in OT_NATO_priority) then {
+ _garrison = floor(12 + random(6));
+ };
+
+ //_x setMarkerText format ["%1",_garrison];
+ _x setMarkerAlpha 0;
+ server setVariable [format ["garrison%1",_x],_garrison,true];
+ }foreach (OT_NATO_control);
+
+ diag_log "Overthrow: Garrisoning towns";
+ {
+ _town = _x;
+ _garrison = 0;
+ _stability = server getVariable format ["stability%1",_town];
+ _population = server getVariable format ["population%1",_town];
+ if(_stability > 10) then {
+ _max = round(_population / 30);
+ if(_max < 4) then {_max = 4};
+ _garrison = 2+round((1-(_stability / 100)) * _max);
+ if(_town in OT_NATO_priority) then {
+ _garrison = round(_garrison * 2);
+ };
+ };
+ server setVariable [format ["garrison%1",_x],_garrison,true];
+ }foreach (OT_allTowns);
+};
+diag_log "Overthrow: NATO Init Done";
+
+OT_NATOInitDone = true;
+publicVariable "OT_NATOInitDone";
+
+{
+ _pos = _x select 0;
+ _name = _x select 1;
+ _mrk = createMarker [_name,[_pos,25,270] call BIS_fnc_relPos];
+ _mrk setMarkerShape "ICON";
+ if(_name in (server getVariable "NATOabandoned")) then {
+ _mrk setMarkerType "flag_Tanoa";
+ }else{
+ _mrk setMarkerType "flag_NATO";
+ };
+
+ server setVariable [_name,_pos,true];
+
+ OT_allObjectives pushback _name;
+}foreach(OT_NATOobjectives);
+
+publicVariable "OT_allObjectives";
+
+{
+ _pos = _x select 0;
+ _name = _x select 1;
+ _mrk = createMarker [_name,_pos];
+ _mrk setMarkerShape "ICON";
+ _mrk setMarkerType "loc_Transmitter";
+ if(_name in (server getVariable "NATOabandoned")) then {
+ _mrk setMarkerColor "ColorGUER";
+ }else{
+ _mrk setMarkerColor "ColorBLUFOR";
+ };
+ server setVariable [_name,_pos,true];
+ OT_allComms pushback _name;
+ OT_allObjectives pushback _name;
+}foreach(OT_NATOcomms);
+
+{
+ _x params ["_pos","_garrison","_upgrades"];
+ OT_flag_NATO createVehicle _pos;
+ _count = 0;
+ _group = creategroup blufor;
+ while {_count < _garrison} do {
+ _start = [[[_pos,50]]] call BIS_fnc_randomPos;
+
+ _civ = _group createUnit [OT_NATO_Units_LevelOne call BIS_fnc_selectRandom, _start, [],0, "NONE"];
+ _civ setVariable ["garrison","HQ",false];
+ _civ setRank "LIEUTENANT";
+ _civ setVariable ["VCOM_NOPATHING_Unit",true,false];
+ _civ setBehaviour "SAFE";
+
+ _count = _count + 1;
+ };
+ _group call OT_fnc_initMilitaryPatrol;
+
+ [_pos,_upgrades] call OT_fnc_NATOupgradeFOB;
+}foreach(server getVariable ["NATOfobs",[]]);
diff --git a/addons/overthrow_main/functions/fn_canPlace.sqf b/addons/overthrow_main/functions/fn_canPlace.sqf
index 793c54e7..182dfd8b 100644
--- a/addons/overthrow_main/functions/fn_canPlace.sqf
+++ b/addons/overthrow_main/functions/fn_canPlace.sqf
@@ -40,6 +40,7 @@ if(_typecls != "Base") then {
};
};
}else{
+ _isbase = true;
_base = _pos call OT_fnc_nearestBase;
if !(isNil "_base") then {
if((_base select 0) distance _pos < 300) then {
@@ -61,10 +62,9 @@ if !(_isbase) then {
_estate = _pos call OT_fnc_nearestRealEstate;
if(typename _estate == "ARRAY") then {
_b = _estate select 0;
- if(_b getVariable ["leased",false]) exitWith {_canplace = false};
if(typeof _b == OT_item_Tent) exitWith {_canplace = false};
if(_b call OT_fnc_hasOwner) then {
- _owner = _b getVariable "owner";
+ _owner = _b call OT_fnc_getOwner;
if(_owner != getplayeruid player) then {
if(_typecls != "Camp" and _typecls != "Base") then {
_canplace = false;
@@ -88,7 +88,7 @@ if !(_isbase) then {
if(_typecls == "Base") then {
_town = _pos call OT_fnc_nearestTown;
_postown = server getVariable _town;
- _dist = 250;
+ _dist = 200;
if((_postown distance _pos) < _dist) then {_canplace = false};
};
diff --git a/addons/overthrow_main/functions/fn_cleanup.sqf b/addons/overthrow_main/functions/fn_cleanup.sqf
index 37ae6b9f..805b9804 100644
--- a/addons/overthrow_main/functions/fn_cleanup.sqf
+++ b/addons/overthrow_main/functions/fn_cleanup.sqf
@@ -29,7 +29,7 @@ if(_vehicle isKindOf "CAManBase") then {
if !(_x call OT_fnc_hasOwner) then {
deleteVehicle _x;
};
- }foreach(units _vehicle);
+ }foreach(crew _vehicle);
};
if !(_vehicle call OT_fnc_hasOwner) then {
deleteVehicle _vehicle;
diff --git a/addons/overthrow_main/functions/fn_getOwner.sqf b/addons/overthrow_main/functions/fn_getOwner.sqf
new file mode 100644
index 00000000..6533f4f4
--- /dev/null
+++ b/addons/overthrow_main/functions/fn_getOwner.sqf
@@ -0,0 +1,8 @@
+if(typename _this == "SCALAR") exitWith {
+ owners getVariable [str _this,nil];
+};
+if((getObjectType _this) != 8 and (_this isKindOf "Building")) exitWith {
+ _id = [_this] call OT_fnc_getBuildID;
+ owners getVariable [str _id,nil];
+};
+_this getVariable ["owner",nil];
diff --git a/addons/overthrow_main/functions/fn_hasOwner.sqf b/addons/overthrow_main/functions/fn_hasOwner.sqf
index 73ae98cd..84c6e0b3 100644
--- a/addons/overthrow_main/functions/fn_hasOwner.sqf
+++ b/addons/overthrow_main/functions/fn_hasOwner.sqf
@@ -12,7 +12,7 @@ Author:
private _item = _this;
-private _owner = _item getVariable "owner";
+private _owner = _item call OT_fnc_getOwner;
private _ret = false;
if !(isNil "_owner") then {
if(typename _owner == "STRING") then {
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/loadGame.sqf b/addons/overthrow_main/functions/fn_loadGame.sqf
similarity index 64%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/loadGame.sqf
rename to addons/overthrow_main/functions/fn_loadGame.sqf
index ae1d101e..60795493 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/loadGame.sqf
+++ b/addons/overthrow_main/functions/fn_loadGame.sqf
@@ -6,7 +6,7 @@ private ["_data"];
_data = profileNameSpace getVariable ["Overthrow.save.001",""];
if(typename _data != "ARRAY") exitWith {
[] remoteExec ['newGame',2];
- "No save found, starting new game" remoteExec ["hint",bigboss,true];
+ "No save found, starting new game" remoteExec ["hint",0,true];
};
private _cc = 0;
@@ -14,7 +14,20 @@ private _cc = 0;
{
_key = _x select 0;
_val = _x select 1;
+ if(typename _val == "ARRAY") then {
+ _new = [];
+ {
+ _new pushback _x;
+ }foreach(_val);
+ _val = _new;
+ };
_set = true;
+ if(_key == "buildingpositions") then {
+ {
+ buildingpositions setVariable [_x select 0,_x select 1,true];
+ }foreach(_val);
+ _set = false;
+ };
if(_key == "bases") then {
{
_pos = _x select 0;
@@ -23,7 +36,7 @@ private _cc = 0;
_veh = createVehicle [OT_Item_Flag, _pos, [], 0, "CAN_COLLIDE"];
_veh enableDynamicSimulation true;
- _veh setVariable ["owner",_owner,true];
+ [_veh,_owner] call OT_fnc_setOwner;
_veh = createVehicle ["Land_ClutterCutter_large_F", _pos, [], 0, "CAN_COLLIDE"];
_veh enableDynamicSimulation true;
@@ -66,16 +79,26 @@ private _cc = 0;
if(count _x > 7) then {
(_x select 7) params ["_fuel","_dmg"];
+ //Fuel in tank
_veh setFuel _fuel;
{
- _veh setHitPointDamage [_x, (_dmg select 2) select _forEachIndex]
+ _veh setHitPointDamage [_x, (_dmg select 2) select _forEachIndex,false]
}foreach(_dmg select 0);
if(count (_x select 7) > 2) then {
+ //ACE refuel (fuel trucks)
[_veh, (_x select 7) select 2] call ace_refuel_fnc_setFuel;
};
if(count (_x select 7) > 3) then {
+ //Lock/unlock
_veh setVariable ["OT_locked",(_x select 7) select 3,true];
};
+ if(count (_x select 7) > 4) then {
+ //Ammo
+ _ammo = (_x select 7) select 4;
+ {
+ _veh setAmmo [_x select 0,_x select 1];
+ }foreach((_x select 7) select 4);
+ };
};
_veh setPosATL _pos;
@@ -102,7 +125,7 @@ private _cc = 0;
_veh setObjectTextureGlobal [0,"\ot\ui\maptanoa.paa"];
};
- _veh setVariable ["owner",_owner,true];
+ [_veh,_owner] call OT_fnc_setOwner;
{
_cls = _x select 0;
_num = _x select 1;
@@ -136,7 +159,7 @@ private _cc = 0;
if(count _x > 6) then {
_code = (_x select 6);
if(_code != "") then {
- [getpos _veh,_code] call structureInit;
+ [_veh,getpos _veh,_code] call structureInit;
};
_veh setVariable ["OT_init",_code,true];
};
@@ -196,11 +219,64 @@ private _cc = 0;
};
}foreach(_data);
sleep 0.1;
+
{
- _uid = _x;
- _vars = server getVariable [_uid,[]];
- _leased = [_uid,"leased",[]] call OT_fnc_getOfflinePlayerAttribute;
- _leasedata = [];
+ _pos = _x select 0;
+ _code = format["fob%1",_pos];
+ _garrison = server getVariable [format["resgarrison%1",_code],[]];
+ if(count _garrison > 0) then {
+ _group = creategroup resistance;
+ spawner setVariable [format["resgarrison",_code],_group,true];
+ {
+ _x params ["_cls","_loadout"];
+ call {
+ if(_cls == "HMG") exitWith {
+ _p = _pos findEmptyPosition [0,50,"I_HMG_01_high_F"];
+ _gun = "I_HMG_01_high_F" createVehicle _p;
+ createVehicleCrew _gun;
+ {
+ [_x] joinSilent _group;
+ }foreach(crew _gun);
+ };
+ if(_cls == "GMG") exitWith {
+ _p = _pos findEmptyPosition [0,50,"I_GMG_01_high_F"];
+ _gun = "I_GMG_01_high_F" createVehicle _p;
+ createVehicleCrew _gun;
+ {
+ [_x] joinSilent _group;
+ }foreach(crew _gun);
+ };
+ private _start = [[[_pos,30]]] call BIS_fnc_randomPos;
+ private _civ = _group createUnit [_cls, _start, [],0, "NONE"];
+ _civ setUnitLoadout [_loadout,true];
+ };
+ }foreach(_garrison);
+ };
+}foreach(server getvariable ["bases",[]]);
+
+{
+ _pos = _x select 0;
+ _code = _x select 1;
+ _garrison = server getVariable [format["resgarrison%1",_code],[]];
+ if(count _garrison > 0) then {
+ _group = creategroup resistance;
+ spawner setVariable [format["resgarrison",_code],_group,true];
+ {
+ _x params ["_cls","_loadout"];
+ private _start = [[[_pos,30]]] call BIS_fnc_randomPos;
+ private _civ = _group createUnit [_cls, _start, [],0, "NONE"];
+ _civ setUnitLoadout [_loadout,true];
+ }foreach(_garrison);
+ };
+}foreach(OT_objectiveData + OT_airportData);
+
+private _built = (allMissionObjects "Static");
+{
+ private _uid = _x;
+ private _vars = server getVariable [_uid,[]];
+ private _leased = [_uid,"leased",[]] call OT_fnc_getOfflinePlayerAttribute;
+ private _leasedata = [];
+ private _handler = compileFinal preprocessFileLineNumbers "events\buildingDamaged.sqf";
{
_x params ["_name","_val"];
if(_name == "owned") then {
@@ -210,16 +286,26 @@ sleep 0.1;
_buildings = (_x nearObjects ["Building",8]);
if(count _buildings > 0) then {
_bdg = _buildings select 0;
- _bdg setVariable ["owner",_uid,true];
+ [_bdg,_uid] call OT_fnc_setOwner;
};
}else{
//new save with IDs
if (typename _x == "SCALAR") then {
- _bdg = OT_centerPos nearestObject _x;
- _bdg setVariable ["owner",_uid,true];
+ [_x,_uid] call OT_fnc_setOwner;
+
+ _pos = buildingpositions getVariable [str _x,[]];
+ _bdg = objNull;
+ if(count _pos == 0) then {
+ _bdg = OT_centerPos nearestObject _x;
+ buildingpositions setVariable [str _x,position _bdg,true];
+ }else{
+ _bdg = _pos nearestObject _x;
+ };
+ if !(_bdg in _built) then {
+ _bdg addEventHandler ["Dammaged",_handler];
+ };
if(_x in _leased) then {
- _bdg setVariable ["leased",true,true];
- _leasedata pushback [_x,typeof _bdg,getpos _bdg,(getpos _bdg) call OT_fnc_nearestTown];
+ _leasedata pushback [_x,typeof _bdg,_pos,_pos call OT_fnc_nearestTown];
};
};
};
diff --git a/addons/overthrow_main/functions/fn_notifyMinor.sqf b/addons/overthrow_main/functions/fn_notifyMinor.sqf
new file mode 100644
index 00000000..af2d1279
--- /dev/null
+++ b/addons/overthrow_main/functions/fn_notifyMinor.sqf
@@ -0,0 +1,2 @@
+_txt = format ["%1",_this];
+OT_notifies pushback _txt;
diff --git a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/saveGame.sqf b/addons/overthrow_main/functions/fn_saveGame.sqf
similarity index 57%
rename from addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/saveGame.sqf
rename to addons/overthrow_main/functions/fn_saveGame.sqf
index cf04a8d5..0d0adb07 100644
--- a/addons/overthrow_main/campaign/missions/Overthrow.Tanoa/actions/saveGame.sqf
+++ b/addons/overthrow_main/functions/fn_saveGame.sqf
@@ -2,14 +2,14 @@ if(OT_saving) exitWith {"Please wait, save still in progress" remoteExec ["hint"
OT_saving = true;
publicVariable "OT_saving";
-"Persistent Saving..." remoteExec ["notify_long",0,true];
+"Persistent Saving..." remoteExec ["OT_fnc_notifyMinor",0,true];
sleep 0.1;
waitUntil {!isNil "OT_NATOInitDone"};
private _data = [];
//get all server data
{
- if !(_x == "StartupType" or _x == "recruits" or _x == "squads") then {
+ if !(_x == "StartupType" or _x == "recruits" or _x == "squads" or (_x select [0,11]) == "resgarrison") then {
_val = server getVariable _x;
if(typename _val == "ARRAY") then {
//Copy the array
@@ -26,6 +26,12 @@ private _data = [];
};
}foreach(allVariables server);
+_poses = [];
+{
+ _poses pushback [_x,buildingpositions getVariable _x];
+}foreach(allVariables buildingpositions);
+_data pushback ["buildingpositions",_poses];
+
//get all online player data
{
_uid = getPlayerUID _x;
@@ -34,7 +40,7 @@ private _data = [];
_d = [];
_all = [];
{
- if(_x != "ot_loaded" and _x != "owner" and _x != "morale" and _x != "player_uid" and _x != "sa_tow_actions_loaded" and _x != "hiding" and _x != "randomValue" and _x != "saved3deninventory" and (_x select [0,11]) != "MissionData" and (_x select [0,4]) != "ace_" and (_x select [0,4]) != "cba_" and (_x select [0,4]) != "bis_") then {
+ if(_x != "ot_loaded" and _x != "morale" and _x != "player_uid" and _x != "sa_tow_actions_loaded" and _x != "hiding" and _x != "randomValue" and _x != "saved3deninventory" and (_x select [0,11]) != "MissionData" and (_x select [0,4]) != "ace_" and (_x select [0,4]) != "cba_" and (_x select [0,4]) != "bis_") then {
_all pushback _x;
_val = _me getVariable _x;
if !(isNil "_val") then {
@@ -52,20 +58,26 @@ private _vehicles = [];
_count = 10001;
{
if(!(_x isKindOf "Man") and (alive _x) and (_x call OT_fnc_hasOwner) and (typeof _x != OT_item_Flag)) then {
- _owner = _x getVariable ["owner",false];
+ _owner = _x call OT_fnc_getOwner;
_s = _x call OT_fnc_unitStock;
+
if(typeof _x == OT_item_safe) then {
_s pushback ["money",_x getVariable ["money",0]];
_s pushback ["password",_x getVariable ["password",""]];
};
_params = [typeof _x,getposatl _x,[vectorDir _x,vectorUp _x],_s,_owner,_x getVariable ["name",""],_x getVariable ["OT_init",""]];
if(_x isKindOf "AllVehicles") then {
- _params pushback [fuel _x,getAllHitPointsDamage _x,_x call ace_refuel_fnc_getFuel,_x getVariable ["OT_locked",false]];
+ _ammo = [];
+ _veh = _x;
+ {
+ _ammo pushback [_x,_veh ammo _x];
+ }foreach(_x weaponsTurret [0]);
+ _params pushback [fuel _x,getAllHitPointsDamage _x,_x call ace_refuel_fnc_getFuel,_x getVariable ["OT_locked",false],_ammo];
};
_vehicles pushback _params;
};
if(_count > 2000) then {
- "Still persistent Saving... please wait" remoteExec ["notify_long",0,true];
+ "Still persistent Saving... please wait" remoteExec ["OT_fnc_notifyMinor",0,true];
_count = 0;
sleep 0.01;
};
@@ -131,6 +143,60 @@ private _squads = [];
_data pushback ["squads",_squads];
+{
+ _pos = _x select 0;
+ _code = format["fob%1",_pos];
+ _group = spawner getvariable [format["resgarrison%1",_code],grpNull];
+ if !(isNull _group) then {
+ _soldiers = [];
+ {
+ if(alive _x) then {
+ if(vehicle _x == _x) then {
+ _soldiers pushback [typeof _x,getUnitLoadout _x];
+ }else{
+ _veh = vehicle _x;
+ if(someAmmo _veh and (typeof _veh == "I_HMG_01_high_F")) then {
+ _soldiers pushback ["HMG",[]];
+ };
+ if(someAmmo _veh and (typeof _veh == "I_GMG_01_high_F")) then {
+ _soldiers pushback ["GMG",[]];
+ };
+ };
+ };
+ }foreach(units _group);
+ if(count _soldiers > 0) then {
+ _data pushback [format["resgarrison%1",_code],_soldiers];
+ };
+ };
+}foreach(server getVariable ["bases",[]]);
+
+{
+ _pos = server getvariable _x;
+ _code = _x;
+ _group = spawner getvariable [format["resgarrison%1",_code],grpNull];
+ if !(isNull _group) then {
+ _soldiers = [];
+ {
+ if(alive _x) then {
+ if(vehicle _x == _x) then {
+ _soldiers pushback [typeof _x,getUnitLoadout _x];
+ }else{
+ _veh = vehicle _x;
+ if(someAmmo _veh and (typeof _veh == "I_HMG_01_high_F")) then {
+ _soldiers pushback ["HMG",[]];
+ };
+ if(someAmmo _veh and (typeof _veh == "I_GMG_01_high_F")) then {
+ _soldiers pushback ["GMG",[]];
+ };
+ };
+ };
+ }foreach(units _group);
+ if(count _soldiers > 0) then {
+ _data pushback [format["resgarrison%1",_code],_soldiers];
+ };
+ };
+}foreach(OT_allObjectives);
+
_data pushback ["timedate",date];
{
@@ -139,12 +205,12 @@ _data pushback ["timedate",date];
profileNameSpace setVariable ["Overthrow.save.001",_data];
if (isDedicated) then {
- "Saving to dedicated server.. not long now" remoteExec ["notify_long",0,true];
+ "Saving to dedicated server.. not long now" remoteExec ["OT_fnc_notifyMinor",0,true];
sleep 0.01;
saveProfileNamespace
};
-"Persistent Save Completed" remoteExec ["notify_minor",0,true];
+"Persistent Save Completed" remoteExec ["OT_fnc_notifyMinor",0,true];
OT_saving = false;
publicVariable "OT_saving";
diff --git a/addons/overthrow_main/functions/fn_setOwner.sqf b/addons/overthrow_main/functions/fn_setOwner.sqf
new file mode 100644
index 00000000..5534b0d7
--- /dev/null
+++ b/addons/overthrow_main/functions/fn_setOwner.sqf
@@ -0,0 +1,9 @@
+params ["_obj","_owner"];
+if(typename _obj == "SCALAR") exitWith {
+ owners setVariable [str _obj,_owner,true];
+};
+if((getObjectType _obj) != 8 and (_obj isKindOf "Building")) exitWith {
+ _id = [_obj] call OT_fnc_getBuildID;
+ owners setVariable [str _id,_owner,true];
+};
+_obj setVariable ["owner",_owner,true];
diff --git a/addons/overthrow_main/functions/geography/fn_nearestBase.sqf b/addons/overthrow_main/functions/geography/fn_nearestBase.sqf
index c9a8c1b9..fbc1fba5 100644
--- a/addons/overthrow_main/functions/geography/fn_nearestBase.sqf
+++ b/addons/overthrow_main/functions/geography/fn_nearestBase.sqf
@@ -1,2 +1,2 @@
private _pos = _this;
-([server getVariable ["bases",[]],[],{(_x select 0) distance _pos},"ASCEND"] call BIS_fnc_SortBy) select 0
+([server getVariable ["bases",[[[0,0,0]]]],[],{(_x select 0) distance _pos},"ASCEND"] call BIS_fnc_SortBy) select 0
diff --git a/addons/overthrow_main/functions/warehouse/fn_findWeaponInWarehouse.sqf b/addons/overthrow_main/functions/warehouse/fn_findWeaponInWarehouse.sqf
index c5e3436d..4ffa404f 100644
--- a/addons/overthrow_main/functions/warehouse/fn_findWeaponInWarehouse.sqf
+++ b/addons/overthrow_main/functions/warehouse/fn_findWeaponInWarehouse.sqf
@@ -8,6 +8,7 @@ private _possible = [];
if(_num > 0) then {
private _weapon = [_cls] call BIS_fnc_itemType;
private _weaponType = _weapon select 1;
+ if(_weaponType == "AssaultRifle" and (_cls find "_GL_") > -1) then {_weaponType = "GrenadeLauncher"};
if(_weaponType == _type) then {_possible pushback _cls};
};
}foreach(allvariables warehouse);
diff --git a/addons/overthrow_main/ui/dialogs/build.hpp b/addons/overthrow_main/ui/dialogs/build.hpp
index a4e7e429..faa9f5c4 100644
--- a/addons/overthrow_main/ui/dialogs/build.hpp
+++ b/addons/overthrow_main/ui/dialogs/build.hpp
@@ -64,14 +64,50 @@ class OT_dialog_buildbase
class RscButton_1604: RscOverthrowButton
{
idc = 1604;
+ action = "'Workshop' call build";
+
+ text = "Workshop"; //--- ToDo: Localize;
+ x = 0.891875 * safezoneW + safezoneX;
+ y = 0.324 * safezoneH + safezoneY;
+ w = 0.0876563 * safezoneW;
+ h = 0.077 * safezoneH;
+ tooltip = "Modify vehicles"; //--- ToDo: Localize;
+ };
+ class RscButton_1605: RscOverthrowButton
+ {
+ idc = 1605;
action = "'Helipad' call build";
text = "Helipad"; //--- ToDo: Localize;
- x = 0.0204687 * safezoneW + safezoneX;
- y = 0.676 * safezoneH + safezoneY;
+ x = 0.891875 * safezoneW + safezoneX;
+ y = 0.412 * safezoneH + safezoneY;
+ w = 0.0876563 * safezoneW;
+ h = 0.077 * safezoneH;
+ tooltip = "Apparently helicopters need a place to land"; //--- ToDo: Localize;
+ };
+ class RscButton_1606: RscOverthrowButton
+ {
+ idc = 1606;
+ action = "'Refugee Camp' call build";
+
+ text = "Refugee Camp"; //--- ToDo: Localize;
+ x = 0.891875 * safezoneW + safezoneX;
+ y = 0.5 * safezoneH + safezoneY;
+ w = 0.0876563 * safezoneW;
+ h = 0.077 * safezoneH;
+ tooltip = "Helps with recruiting local civilians to your cause."; //--- ToDo: Localize;
+ };
+ class RscButton_1607: RscOverthrowButton
+ {
+ idc = 1607;
+ action = "'Training Camp' call build";
+
+ text = "Training Camp"; //--- ToDo: Localize;
+ x = 0.891875 * safezoneW + safezoneX;
+ y = 0.588 * safezoneH + safezoneY;
w = 0.0876563 * safezoneW;
h = 0.077 * safezoneH;
- tooltip = "Apparently helicopter pilots need to be told where they are allowed to land"; //--- ToDo: Localize;
+ tooltip = "Recruit trained and pre-equipped soldiers"; //--- ToDo: Localize;
};
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT END
diff --git a/addons/overthrow_main/ui/dialogs/main.hpp b/addons/overthrow_main/ui/dialogs/main.hpp
index 7a39ef29..61ed1cab 100644
--- a/addons/overthrow_main/ui/dialogs/main.hpp
+++ b/addons/overthrow_main/ui/dialogs/main.hpp
@@ -25,7 +25,7 @@ class OT_dialog_start
class RscButton_1600: RscOverthrowButton
{
idc = 1600;
- action = "closeDialog 0;'actions\loadGame.sqf' remoteExec ['execVM',2,false];";
+ action = "closeDialog 0;[] remoteExec ['OT_fnc_loadGame',2,false];";
text = "Load Persistent Save"; //--- ToDo: Localize;
x = 0.448438 * safezoneW + safezoneX;
@@ -94,7 +94,7 @@ class OT_dialog_vehicle
y = 0.302 * safezoneH + safezoneY;
w = 0.149531 * safezoneW;
h = 0.077 * safezoneH;
- action = "closeDialog 0;[] spawn fastTravel;";
+ action = "closeDialog 0;[] spawn OT_fnc_fastTravel;";
tooltip = "Fast travels this vehicle and it's occupants"; //--- ToDo: Localize;
};
class RscButton_1601: RscOverthrowButton
@@ -106,7 +106,7 @@ class OT_dialog_vehicle
w = 0.149531 * safezoneW;
h = 0.077 * safezoneH;
tooltip = "Transfers the contents of the closest container into this vehicle"; //--- ToDo: Localize;
- action = "closeDialog 0;[] spawn transferFrom;";
+ action = "closeDialog 0;[] spawn OT_fnc_transferFrom;";
};
class RscButton_1602: RscOverthrowButton
{
@@ -117,7 +117,7 @@ class OT_dialog_vehicle
w = 0.149531 * safezoneW;
h = 0.077 * safezoneH;
tooltip = "Transfers the contents of this vehicle into the closest container"; //--- ToDo: Localize;
- action = "closeDialog 0;[] spawn transferTo;";
+ action = "closeDialog 0;[] spawn OT_fnc_transferTo;";
};
class RscButton_1603: RscOverthrowButton
{
@@ -128,7 +128,7 @@ class OT_dialog_vehicle
w = 0.149531 * safezoneW;
h = 0.077 * safezoneH;
tooltip = "Transfers only legal (sellable) items from the closest container into this vehicle"; //--- ToDo: Localize;
- action = "closeDialog 0;[] spawn transferLegit;";
+ action = "closeDialog 0;[] spawn OT_fnc_transferLegit;";
};
class RscButton_1604: RscOverthrowButton
{
@@ -139,7 +139,7 @@ class OT_dialog_vehicle
w = 0.149531 * safezoneW;
h = 0.077 * safezoneH;
tooltip = "Takes legal (sellable) items from the vehicle into your inventory"; //--- ToDo: Localize;
- action = "closeDialog 0;[] spawn takeLegit;";
+ action = "closeDialog 0;[] spawn OT_fnc_takeLegit;";
};
class RscButton_1605: RscOverthrowButton
{
@@ -203,7 +203,7 @@ class OT_dialog_vehiclewarehouse
y = 0.39 * safezoneH + safezoneY;
w = 0.149531 * safezoneW;
h = 0.077 * safezoneH;
- action = "closeDialog 0;[] spawn fastTravel;";
+ action = "closeDialog 0;[] spawn OT_fnc_fastTravel;";
tooltip = "Fast travels this vehicle and it's occupants"; //--- ToDo: Localize;
};
class RscButton_1601: RscOverthrowButton
@@ -226,7 +226,7 @@ class OT_dialog_vehiclewarehouse
w = 0.149531 * safezoneW;
h = 0.077 * safezoneH;
tooltip = "Stores the contents of this vehicle in the warehouse"; //--- ToDo: Localize;
- action = "closeDialog 0;[] spawn transferTo;";
+ action = "closeDialog 0;[] spawn OT_fnc_transferTo;";
};
class RscButton_1603: RscOverthrowButton
{
@@ -237,7 +237,7 @@ class OT_dialog_vehiclewarehouse
w = 0.149531 * safezoneW;
h = 0.077 * safezoneH;
tooltip = "Takes all legal (sellable) items from the warehouse"; //--- ToDo: Localize;
- action = "closeDialog 0;[] spawn transferLegit;";
+ action = "closeDialog 0;[] spawn OT_fnc_transferLegit;";
};
class RscButton_1612: RscOverthrowButton
{
@@ -290,7 +290,7 @@ class OT_dialog_vehicleport
y = 0.39 * safezoneH + safezoneY;
w = 0.149531 * safezoneW;
h = 0.077 * safezoneH;
- action = "closeDialog 0;[] spawn fastTravel;";
+ action = "closeDialog 0;[] spawn OT_fnc_fastTravel;";
tooltip = "Fast travels this vehicle and it's occupants"; //--- ToDo: Localize;
};
class RscButton_1601: RscOverthrowButton
@@ -363,7 +363,7 @@ class OT_dialog_command
idc = 1601;
text = "Loot"; //--- ToDo: Localize;
x = 0.005 * safezoneW + safezoneX;
- y = 0.654 * safezoneH + safezoneY;
+ y = 0.412 * safezoneH + safezoneY;
w = 0.149531 * safezoneW;
h = 0.077 * safezoneH;
tooltip = "Commands all selected units to loot bodies and fill closest container to them"; //--- ToDo: Localize;
@@ -374,12 +374,23 @@ class OT_dialog_command
idc = 1602;
text = "Open Inventory"; //--- ToDo: Localize;
x = 0.005 * safezoneW + safezoneX;
- y = 0.478 * safezoneH + safezoneY;
+ y = 0.324 * safezoneH + safezoneY;
w = 0.149531 * safezoneW;
h = 0.077 * safezoneH;
tooltip = "Commands first unit selected to walk to and open the closest container to them"; //--- ToDo: Localize;
action = "closeDialog 0;[] spawn OT_fnc_orderOpenInventory;";
};
+ class RscButton_1603: RscOverthrowButton
+ {
+ idc = 1603;
+ text = "Create Squad"; //--- ToDo: Localize;
+ x = 0.005 * safezoneW + safezoneX;
+ y = 0.5 * safezoneH + safezoneY;
+ w = 0.149531 * safezoneW;
+ h = 0.077 * safezoneH;
+ tooltip = "Splits selected units off into a new squad"; //--- ToDo: Localize;
+ action = "closeDialog 0;[] spawn OT_fnc_createSquad;";
+ };
class RscButton_1612: RscOverthrowButton
{
idc = 1612;
@@ -428,7 +439,7 @@ class OT_dialog_squad
idc = 1601;
text = "Assign Vehicle"; //--- ToDo: Localize;
x = 0.005 * safezoneW + safezoneX;
- y = 0.654 * safezoneH + safezoneY;
+ y = 0.324 * safezoneH + safezoneY;
w = 0.149531 * safezoneW;
h = 0.077 * safezoneH;
tooltip = "Assigns vehicle you are looking at to squad"; //--- ToDo: Localize;
@@ -439,7 +450,7 @@ class OT_dialog_squad
idc = 1602;
text = "Get In"; //--- ToDo: Localize;
x = 0.005 * safezoneW + safezoneX;
- y = 0.478 * safezoneH + safezoneY;
+ y = 0.412 * safezoneH + safezoneY;
w = 0.149531 * safezoneW;
h = 0.077 * safezoneH;
tooltip = "Orders squad to board assigned vehicle"; //--- ToDo: Localize;
@@ -450,7 +461,7 @@ class OT_dialog_squad
idc = 1603;
text = "Get Out"; //--- ToDo: Localize;
x = 0.005 * safezoneW + safezoneX;
- y = 0.566 * safezoneH + safezoneY;
+ y = 0.5 * safezoneH + safezoneY;
w = 0.149531 * safezoneW;
h = 0.077 * safezoneH;
tooltip = "Orders squad to disembark assigned vehicle"; //--- ToDo: Localize;
@@ -488,7 +499,7 @@ class OT_dialog_options
class RscButton_1600: RscOverthrowButton
{
idc = 1600;
- action = "closeDialog 0;'actions\saveGame.sqf' remoteExec ['execVM',2];";
+ action = "closeDialog 0;[] remoteExec ['OT_fnc_saveGame',2,false];";
text = "Persistent Save"; //--- ToDo: Localize;
x = 0.448438 * safezoneW + safezoneX;
@@ -548,7 +559,7 @@ class OT_dialog_options
class RscButton_1605: RscOverthrowButton
{
idc = 1605;
- action = "{if !(alive _x) then {deletevehicle _x}} foreach(vehicles);{if !(_x call canDrive) then {deletevehicle _x}} foreach(vehicles);{deleteVehicle _x} foreach(alldeadmen);""Cleaned bodies/wrecks"" remoteExec [""notify_minor"",0,false];";
+ action = "{if !(alive _x) then {deletevehicle _x}} foreach(vehicles);{if !(_x call canDrive) then {deletevehicle _x}} foreach(vehicles);{deleteVehicle _x} foreach(alldeadmen);""Cleaned bodies/wrecks"" remoteExec [""OT_fnc_notifyMinor"",0,false];";
text = "Clean bodies/wrecks"; //--- ToDo: Localize;
x = 0.386562 * safezoneW + safezoneX;
@@ -560,14 +571,14 @@ class OT_dialog_options
class RscButton_1606: RscOverthrowButton
{
idc = 1606;
- action = "{if ((side _x == civilian and !(_x call OT_fnc_hasOwner))) then {deletevehicle _x}} foreach(vehicles);{if(side _x == civilian and !(_x call OT_fnc_hasOwner) and !(_x call OT_fnc_inSpawnDistance)) then {deletevehicle _x}} foreach(allunits);{if (side _x == civilian and !(_x call OT_fnc_hasOwner) and (_x getvariable [""owner"",""""] != ""self"")) then {deletevehicle _x}} foreach(allunits);""Cleaned other"" remoteExec [""notify_minor"",0,false];";
+ action = "[[0,0],""setFog"",TRUE,FALSE] spawn BIS_fnc_MP";
- text = "Clean other"; //--- ToDo: Localize;
+ text = "Clean fog"; //--- ToDo: Localize;
x = 0.515469 * safezoneW + safezoneX;
y = 0.412 * safezoneH + safezoneY;
w = 0.118594 * safezoneW;
h = 0.077 * safezoneH;
- tooltip = "Removes all unowned civilian vehicles and civilians"; //--- ToDo: Localize;
+ tooltip = "Clears fog"; //--- ToDo: Localize;
};
////////////////////////////////////////////////////////
// GUI EDITOR OUTPUT END
@@ -624,7 +635,7 @@ class OT_dialog_main
class RscButton_1600: RscOverthrowButton
{
idc = 1600;
- action = "closeDialog 0;[] spawn fastTravel";
+ action = "closeDialog 0;[] spawn OT_fnc_fastTravel";
text = "Fast Travel"; //--- ToDo: Localize;
x = 0.005 * safezoneW + safezoneX;
@@ -691,7 +702,7 @@ class OT_dialog_main
class RscButton_1605: RscOverthrowButton
{
idc = 1605;
- action = "closeDialog 0;[] spawn talkToCiv";
+ action = "closeDialog 0;[] spawn OT_fnc_talkToCiv";
text = "Talk"; //--- ToDo: Localize;
x = 0.881562 * safezoneW + safezoneX;
@@ -712,7 +723,7 @@ class OT_dialog_main
class RscButton_1608: RscOverthrowButton
{
idc = 1608;
- action = "closeDialog 0;[] call buyBuilding";
+ action = "closeDialog 0;[] call OT_fnc_buyBuilding";
text = "Buy"; //--- ToDo: Localize;
x = 0.881562 * safezoneW + safezoneX;
diff --git a/addons/overthrow_main/ui/dialogs/resistance.hpp b/addons/overthrow_main/ui/dialogs/resistance.hpp
index 3b83d803..b5cee0f7 100644
--- a/addons/overthrow_main/ui/dialogs/resistance.hpp
+++ b/addons/overthrow_main/ui/dialogs/resistance.hpp
@@ -168,3 +168,134 @@ class OT_dialog_resistance
////////////////////////////////////////////////////////
}
}
+
+
+class OT_dialog_garrison
+{
+ idd=9000;
+ movingenable=false;
+ class controlsBackground
+ {
+ class RscStructuredText_1199: RscOverthrowStructuredText
+ {
+ idc = 1199;
+
+ text = ""; //--- ToDo: Localize;
+ x = 0.288594 * safezoneW + safezoneX;
+ y = 0.214 * safezoneH + safezoneY;
+ w = 0.422812 * safezoneW;
+ h = 0.572 * safezoneH;
+ colorBackground[] = {0.1,0.1,0.1,1};
+ colorActive[] = {0.1,0.1,0.1,1};
+ };
+ }
+ class controls
+ {
+ ////////////////////////////////////////////////////////
+ // GUI EDITOR OUTPUT START (by ARMAzac, v1.063, #Niwire)
+ ////////////////////////////////////////////////////////
+
+ class RscStructuredText_1100: RscOverthrowStructuredText
+ {
+ idc = 1100;
+ text = "Base"; //--- ToDo: Localize;
+ x = 0.298906 * safezoneW + safezoneX;
+ y = 0.236 * safezoneH + safezoneY;
+ w = 0.402187 * safezoneW;
+ h = 0.033 * safezoneH;
+ colorBackground[] = {0,0,0,0};
+ };
+ class RscButton_1600: RscOverthrowButton
+ {
+ idc = 1600;
+ text = "+1 Rifleman"; //--- ToDo: Localize;
+ x = 0.37625 * safezoneW + safezoneX;
+ y = 0.291 * safezoneH + safezoneY;
+ w = 0.0567187 * safezoneW;
+ h = 0.077 * safezoneH;
+ action = "[0] spawn OT_fnc_addGarrison";
+ };
+ class RscButton_1601: RscOverthrowButton
+ {
+ idc = 1601;
+ text = "+1 Autorifleman"; //--- ToDo: Localize;
+ x = 0.438125 * safezoneW + safezoneX;
+ y = 0.291 * safezoneH + safezoneY;
+ w = 0.0567187 * safezoneW;
+ h = 0.077 * safezoneH;
+ action = "[1] spawn OT_fnc_addGarrison";
+ };
+ class RscButton_1602: RscOverthrowButton
+ {
+ idc = 1602;
+ text = "+1 Grenadier"; //--- ToDo: Localize;
+ x = 0.5 * safezoneW + safezoneX;
+ y = 0.291 * safezoneH + safezoneY;
+ w = 0.0567187 * safezoneW;
+ h = 0.077 * safezoneH;
+ action = "[13] spawn OT_fnc_addGarrison";
+ };
+ class RscButton_1603: RscOverthrowButton
+ {
+ idc = 1603;
+ text = "+1 Medic"; //--- ToDo: Localize;
+ x = 0.561875 * safezoneW + safezoneX;
+ y = 0.291 * safezoneH + safezoneY;
+ w = 0.0567187 * safezoneW;
+ h = 0.077 * safezoneH;
+ action = "[8] spawn OT_fnc_addGarrison";
+ };
+ class RscButton_1604: RscOverthrowButton
+ {
+ idc = 1604;
+ text = "+1 Anti-Tank"; //--- ToDo: Localize;
+ x = 0.37625 * safezoneW + safezoneX;
+ y = 0.379 * safezoneH + safezoneY;
+ w = 0.0567187 * safezoneW;
+ h = 0.077 * safezoneH;
+ action = "[9] spawn OT_fnc_addGarrison";
+ };
+ class RscButton_1605: RscOverthrowButton
+ {
+ idc = 1605;
+ text = "+1 Anti-Air"; //--- ToDo: Localize;
+ x = 0.438125 * safezoneW + safezoneX;
+ y = 0.379 * safezoneH + safezoneY;
+ w = 0.0567187 * safezoneW;
+ h = 0.077 * safezoneH;
+ action = "[10] spawn OT_fnc_addGarrison";
+ };
+ class RscButton_1606: RscOverthrowButton
+ {
+ idc = 1606;
+ text = "+1 HMG"; //--- ToDo: Localize;
+ x = 0.5 * safezoneW + safezoneX;
+ y = 0.379 * safezoneH + safezoneY;
+ w = 0.0567187 * safezoneW;
+ h = 0.077 * safezoneH;
+ action = "['HMG'] spawn OT_fnc_addGarrison";
+ };
+ class RscButton_1607: RscOverthrowButton
+ {
+ idc = 1607;
+ text = "+1 GMG"; //--- ToDo: Localize;
+ x = 0.561875 * safezoneW + safezoneX;
+ y = 0.379 * safezoneH + safezoneY;
+ w = 0.0567187 * safezoneW;
+ h = 0.077 * safezoneH;
+ action = "['GMG'] spawn OT_fnc_addGarrison";
+ };
+ class RscStructuredText_1101: RscOverthrowStructuredText
+ {
+ idc = 1101;
+ x = 0.314375 * safezoneW + safezoneX;
+ y = 0.489 * safezoneH + safezoneY;
+ w = 0.37125 * safezoneW;
+ h = 0.264 * safezoneH;
+ colorBackground[] = {0,0,0,0.3};
+ };
+ ////////////////////////////////////////////////////////
+ // GUI EDITOR OUTPUT END
+ ////////////////////////////////////////////////////////
+ };
+};
diff --git a/addons/overthrow_main/ui/dialogs/shop.hpp b/addons/overthrow_main/ui/dialogs/shop.hpp
index 3a274bc1..dac23962 100644
--- a/addons/overthrow_main/ui/dialogs/shop.hpp
+++ b/addons/overthrow_main/ui/dialogs/shop.hpp
@@ -51,7 +51,7 @@ class OT_dialog_buy
w = 0.139219 * safezoneW;
h = 0.099 * safezoneH;
colorBackground[] = {0,0,0,0.8};
- action = "[] call buy;";
+ action = "[] call OT_fnc_buy;";
};
class RscStructuredText_1100: RscOverthrowStructuredText
{
@@ -105,7 +105,7 @@ class OT_dialog_sell
class RscButton_1600: RscOverthrowButton
{
idc = 1600;
- action = "[] call sell;";
+ action = "[] call OT_fnc_sell;";
text = "Sell 1"; //--- ToDo: Localize;
x = 0.515469 * safezoneW + safezoneX;
@@ -127,7 +127,7 @@ class OT_dialog_sell
class RscButton_1602: RscOverthrowButton
{
idc = 1600;
- action = "[] call sellall;";
+ action = "[] call OT_fnc_sellAll;";
text = "Sell All"; //--- ToDo: Localize;
x = 0.613437 * safezoneW + safezoneX;
@@ -189,7 +189,7 @@ class OT_dialog_workshop
class RscButton_1600: RscOverthrowButton
{
idc = 1600;
- action = "[] call workshopAdd;";
+ action = "[] call OT_fnc_workshopAdd;";
text = "Add"; //--- ToDo: Localize;
x = 0.752656 * safezoneW + safezoneX;
@@ -293,7 +293,7 @@ class OT_dialog_warehouse
class RscButton_1600: RscOverthrowButton
{
idc = 1600;
- action = "[-1] call warehouseTake;";
+ action = "[-1] call OT_fnc_warehouseTake;";
text = "Take All"; //--- ToDo: Localize;
x = 0.840312 * safezoneW + safezoneX;
@@ -315,7 +315,7 @@ class OT_dialog_warehouse
class RscButton_1601: RscOverthrowButton
{
idc = 1600;
- action = "[100] call warehouseTake;";
+ action = "[100] call OT_fnc_warehouseTake;";
text = "Take 100"; //--- ToDo: Localize;
x = 0.778437 * safezoneW + safezoneX;
@@ -327,7 +327,7 @@ class OT_dialog_warehouse
class RscButton_1602: RscOverthrowButton
{
idc = 1600;
- action = "[10] call warehouseTake;";
+ action = "[10] call OT_fnc_warehouseTake;";
text = "Take 10"; //--- ToDo: Localize;
x = 0.716563 * safezoneW + safezoneX;
@@ -339,7 +339,7 @@ class OT_dialog_warehouse
class RscButton_1603: RscOverthrowButton
{
idc = 1600;
- action = "[1] call warehouseTake;";
+ action = "[1] call OT_fnc_warehouseTake;";
text = "Take 1"; //--- ToDo: Localize;
x = 0.654688 * safezoneW + safezoneX;
diff --git a/addons/overthrow_main/ui/dialogs/stats.hpp b/addons/overthrow_main/ui/dialogs/stats.hpp
index 38b8c207..a1729595 100644
--- a/addons/overthrow_main/ui/dialogs/stats.hpp
+++ b/addons/overthrow_main/ui/dialogs/stats.hpp
@@ -52,7 +52,7 @@ class RscTitles {
w = 0.139219 * safezoneW;
h = 0.099 * safezoneH;
colorBackground[] = {0,0,0,0.8};
- action = "[] call buy;";
+ action = "[] call OT_fnc_buy;";
};
class RscStructuredText_1100: RscOverthrowStructuredText
{
diff --git a/addons/overthrow_main/ui/items/fertilizer_x_ca.paa b/addons/overthrow_main/ui/items/fertilizer_x_ca.paa
new file mode 100644
index 00000000..3d541a4c
Binary files /dev/null and b/addons/overthrow_main/ui/items/fertilizer_x_ca.paa differ
diff --git a/mod.cpp b/mod.cpp
index 6d6f8261..da91e083 100644
--- a/mod.cpp
+++ b/mod.cpp
@@ -1,10 +1,10 @@
-name = "Overthrow 0.7.3"; //This name will be displayed only in game , specifically the expansion menu
+name = "Overthrow 0.7.4"; //This name will be displayed only in game , specifically the expansion menu
picture = "logo_overthrow.paa"; //Location of your addon's icon
logo = "logo_overthrow.paa";
logoOver = "logo_overthrow.paa";
actionName = "Github"; //The name of the action
action = "https://github.com/armazac/Overthrow.Tanoa"; //The action , "Authors Website Link"
-description = "Overthrow - Version 0.7.3"; // Addon Description
+description = "Overthrow - Version 0.7.4"; // Addon Description
overview = "A Revolution Simulator for Arma 3";
author = "ARMAzac";
overviewPicture = "logo_overthrow.paa";