initial files
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
if ( GRLIB_civilian_activity > 0 ) then {
|
||||
for [ {_i=0}, {_i < GRLIB_civilians_amount}, {_i=_i+1} ] do { [] spawn manage_one_civilian_patrol };
|
||||
};
|
||||
@@ -0,0 +1,120 @@
|
||||
private [ "_spawnsector", "_grp", "_usable_sectors", "_spawntype", "_civnumber", "_vehdriver", "_spawnpos", "_civveh", "_sectors_patrol",
|
||||
"_patrol_startpos", "_waypoint", "_grpspeed", "_sectors_patrol_random", "_sectorcount", "_nextsector", "_nearestroad" ];
|
||||
|
||||
_civveh = objNull;
|
||||
|
||||
sleep (150 + (random 150));
|
||||
_spawnsector = "";
|
||||
|
||||
if ( isNil "active_sectors" ) then { active_sectors = [] };
|
||||
|
||||
while { GRLIB_endgame == 0 } do {
|
||||
|
||||
_spawnsector = "";
|
||||
_usable_sectors = [];
|
||||
{
|
||||
if ((([markerPos _x, 1000, GRLIB_side_friendly] call KPLIB_fnc_getUnitsCount) == 0) && (count ([markerPos _x, 3500] call KPLIB_fnc_getNearbyPlayers) > 0)) then {
|
||||
_usable_sectors pushback _x;
|
||||
}
|
||||
|
||||
} foreach ((sectors_bigtown + sectors_capture + sectors_factory) - (active_sectors));
|
||||
|
||||
if ( count _usable_sectors > 0 ) then {
|
||||
_spawnsector = selectRandom _usable_sectors;
|
||||
|
||||
_grp = createGroup [GRLIB_side_civilian, true];
|
||||
if ( random 100 < 33) then {
|
||||
_civnumber = 1 + (floor (random 2));
|
||||
while { count units _grp < _civnumber } do {
|
||||
[selectRandom civilians, markerPos _spawnsector, _grp, "PRIVATE", 0.5] call KPLIB_fnc_createManagedUnit;
|
||||
};
|
||||
_grpspeed = "LIMITED";
|
||||
} else {
|
||||
|
||||
_nearestroad = objNull;
|
||||
while { isNull _nearestroad } do {
|
||||
_nearestroad = [(markerPos (_spawnsector)) getPos [random (100), random (360)], 200, []] call BIS_fnc_nearestRoad;
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
_spawnpos = getpos _nearestroad;
|
||||
|
||||
[selectRandom civilians, _spawnpos, _grp, "PRIVATE", 0.5] call KPLIB_fnc_createManagedUnit;
|
||||
_civveh = (selectRandom civilian_vehicles) createVehicle _spawnpos;
|
||||
_civveh setpos _spawnpos;
|
||||
_civveh addMPEventHandler ['MPKilled', {_this spawn kill_manager}];
|
||||
_civveh addEventHandler ["HandleDamage", { private [ "_damage" ]; if (( side (_this select 3) != GRLIB_side_friendly ) && ( side (_this select 3) != GRLIB_side_enemy )) then { _damage = 0 } else { _damage = _this select 2 }; _damage } ];
|
||||
((units _grp) select 0) moveInDriver _civveh;
|
||||
((units _grp) select 0) disableAI "FSM";
|
||||
((units _grp) select 0) disableAI "AUTOCOMBAT";
|
||||
_grpspeed = "LIMITED";
|
||||
|
||||
};
|
||||
|
||||
{ _x addEventHandler ["HandleDamage", { private [ "_damage" ]; if (( side (_this select 3) != GRLIB_side_friendly ) && ( side (_this select 3) != GRLIB_side_enemy )) then { _damage = 0 } else { _damage = _this select 2 }; _damage } ]; } foreach units _grp;
|
||||
|
||||
_sectors_patrol = [];
|
||||
_patrol_startpos = getpos (leader _grp);
|
||||
{
|
||||
if ((_patrol_startpos distance (markerpos _x) < 5000) && (count ([markerPos _x, 4000] call KPLIB_fnc_getNearbyPlayers) > 0)) then {
|
||||
_sectors_patrol pushback _x;
|
||||
};
|
||||
} foreach (sectors_bigtown + sectors_capture + sectors_factory);
|
||||
|
||||
_sectors_patrol_random = [];
|
||||
_sectorcount = count _sectors_patrol;
|
||||
while { count _sectors_patrol_random < _sectorcount } do {
|
||||
_nextsector = selectRandom _sectors_patrol;
|
||||
_sectors_patrol_random pushback _nextsector;
|
||||
_sectors_patrol = _sectors_patrol - [_nextsector];
|
||||
|
||||
};
|
||||
|
||||
while {(count (waypoints _grp)) != 0} do {deleteWaypoint ((waypoints _grp) select 0);};
|
||||
{_x doFollow leader _grp} foreach units _grp;
|
||||
|
||||
{
|
||||
_nearestroad = [(markerPos _x) getPos [random(100), random(360)], 200, []] call BIS_fnc_nearestRoad;
|
||||
if ( isNull _nearestroad ) then {
|
||||
_waypoint = _grp addWaypoint [ markerpos _x, 100 ];
|
||||
} else {
|
||||
_waypoint = _grp addWaypoint [ getpos _nearestroad, 0 ];
|
||||
};
|
||||
_waypoint setWaypointType "MOVE";
|
||||
_waypoint setWaypointSpeed _grpspeed;
|
||||
_waypoint setWaypointBehaviour "SAFE";
|
||||
_waypoint setWaypointCombatMode "BLUE";
|
||||
_waypoint setWaypointCompletionRadius 100;
|
||||
} foreach _sectors_patrol_random;
|
||||
|
||||
_waypoint = _grp addWaypoint [_patrol_startpos , 100];
|
||||
_waypoint setWaypointType "CYCLE";
|
||||
|
||||
if ( local _grp ) then {
|
||||
_headless_client = [] call KPLIB_fnc_getLessLoadedHC;
|
||||
if ( !isNull _headless_client ) then {
|
||||
_grp setGroupOwner ( owner _headless_client );
|
||||
};
|
||||
};
|
||||
|
||||
waitUntil {
|
||||
sleep (30 + (random 30));
|
||||
((({alive _x} count (units _grp)) == 0) || (count ([getpos leader _grp, 4000] call KPLIB_fnc_getNearbyPlayers) == 0))
|
||||
};
|
||||
|
||||
if ( count (units _grp) > 0 ) then {
|
||||
if (count ([getpos leader _grp, 4000] call KPLIB_fnc_getNearbyPlayers) == 0) then {
|
||||
|
||||
if ( !(isNull _civveh) ) then {
|
||||
if ( { ( alive _x ) && (side group _x == GRLIB_side_friendly ) } count (crew _civveh) == 0 ) then {
|
||||
deleteVehicle _civveh
|
||||
};
|
||||
};
|
||||
|
||||
{ deletevehicle _x } foreach units _grp;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sleep 150 + (random (150));
|
||||
};
|
||||
@@ -0,0 +1,83 @@
|
||||
params [ "_minimum_readiness", "_is_infantry" ];
|
||||
private [ "_headless_client" ];
|
||||
|
||||
waitUntil { !isNil "blufor_sectors" };
|
||||
waitUntil { !isNil "combat_readiness" };
|
||||
|
||||
while { GRLIB_endgame == 0 } do {
|
||||
waitUntil { sleep 0.3; count blufor_sectors >= 3; };
|
||||
waitUntil { sleep 0.3; combat_readiness >= (_minimum_readiness / GRLIB_difficulty_modifier); };
|
||||
|
||||
sleep (random 30);
|
||||
|
||||
while { [] call KPLIB_fnc_getOpforCap > GRLIB_patrol_cap } do {
|
||||
sleep (random 30);
|
||||
};
|
||||
|
||||
_grp = grpNull;
|
||||
|
||||
_spawn_marker = "";
|
||||
while { _spawn_marker == "" } do {
|
||||
_spawn_marker = [2000,5000,true] call KPLIB_fnc_getOpforSpawnPoint;
|
||||
if ( _spawn_marker == "" ) then {
|
||||
sleep (150 + (random 150));
|
||||
};
|
||||
};
|
||||
|
||||
_sector_spawn_pos = [(((markerpos _spawn_marker) select 0) - 500) + (random 1000),(((markerpos _spawn_marker) select 1) - 500) + (random 1000),0];
|
||||
|
||||
if (_is_infantry) then {
|
||||
_grp = createGroup [GRLIB_side_enemy, true];
|
||||
_squad = [] call KPLIB_fnc_getSquadComp;
|
||||
{
|
||||
[_x, _sector_spawn_pos, _grp, "PRIVATE", 0.5] call KPLIB_fnc_createManagedUnit;
|
||||
} foreach _squad;
|
||||
} else {
|
||||
|
||||
private [ "_vehicle_object" ];
|
||||
if ((combat_readiness > 75) && ((random 100) > 85) && !(opfor_choppers isEqualTo [])) then {
|
||||
_vehicle_object = [_sector_spawn_pos, selectRandom opfor_choppers] call KPLIB_fnc_spawnVehicle;
|
||||
} else {
|
||||
_vehicle_object = [_sector_spawn_pos, [] call KPLIB_fnc_getAdaptiveVehicle] call KPLIB_fnc_spawnVehicle;
|
||||
};
|
||||
|
||||
sleep 0.5;
|
||||
_grp = group ((crew _vehicle_object) select 0);
|
||||
};
|
||||
|
||||
[_grp] spawn patrol_ai;
|
||||
|
||||
_started_time = time;
|
||||
_patrol_continue = true;
|
||||
|
||||
if ( local _grp ) then {
|
||||
_headless_client = [] call KPLIB_fnc_getLessLoadedHC;
|
||||
if ( !isNull _headless_client ) then {
|
||||
_grp setGroupOwner ( owner _headless_client );
|
||||
};
|
||||
};
|
||||
|
||||
while { _patrol_continue } do {
|
||||
sleep 60;
|
||||
if ( count (units _grp) == 0 ) then {
|
||||
_patrol_continue = false;
|
||||
} else {
|
||||
if ( time - _started_time > 900 ) then {
|
||||
if ( [ getpos (leader _grp) , 4000 , GRLIB_side_friendly ] call KPLIB_fnc_getUnitsCount == 0 ) then {
|
||||
_patrol_continue = false;
|
||||
{
|
||||
if ( vehicle _x != _x ) then {
|
||||
[(vehicle _x)] call KPLIB_fnc_cleanOpforVehicle;
|
||||
};
|
||||
deleteVehicle _x;
|
||||
} foreach (units _grp);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
if ( !([] call KPLIB_fnc_isBigtownActive) ) then {
|
||||
sleep (600.0 / GRLIB_difficulty_modifier);
|
||||
};
|
||||
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
_combat_triggers = [20,40,50,65,80,95];
|
||||
if ( GRLIB_unitcap < 0.9 ) then { _combat_triggers = [20,45,90]; };
|
||||
if ( GRLIB_unitcap > 1.3 ) then { _combat_triggers = [15,25,40,65,75,85,95]; };
|
||||
|
||||
_combat_triggers_infantry = [15,35,45,60,70,85];
|
||||
if ( GRLIB_unitcap < 0.9 ) then { _combat_triggers_infantry = [15,40,80]; };
|
||||
if ( GRLIB_unitcap > 1.3 ) then { _combat_triggers_infantry = [10,20,35,55,70,80,90]; };
|
||||
|
||||
sleep 5;
|
||||
|
||||
waitUntil { sleep 0.3; !isNil "blufor_sectors" };
|
||||
waitUntil { sleep 0.3; count blufor_sectors > 3 };
|
||||
|
||||
if (worldName != "song_bin_tanh") then {
|
||||
{
|
||||
[_x, false] spawn manage_one_patrol;
|
||||
sleep 1;
|
||||
} foreach _combat_triggers;
|
||||
};
|
||||
|
||||
{
|
||||
[_x, true] spawn manage_one_patrol;
|
||||
sleep 1;
|
||||
} foreach _combat_triggers_infantry;
|
||||
@@ -0,0 +1,39 @@
|
||||
params ["_targetsector"];
|
||||
|
||||
if (combat_readiness > 15) then {
|
||||
|
||||
private _init_units_count = (([markerPos _targetsector, GRLIB_capture_size, GRLIB_side_enemy] call KPLIB_fnc_getUnitsCount));
|
||||
|
||||
if !(_targetsector in sectors_bigtown) then {
|
||||
while {(_init_units_count * 0.75) <= ([markerPos _targetsector, GRLIB_capture_size, GRLIB_side_enemy] call KPLIB_fnc_getUnitsCount)} do {
|
||||
sleep 5;
|
||||
};
|
||||
};
|
||||
|
||||
if (_targetsector in active_sectors) then {
|
||||
|
||||
private _nearestower = [markerpos _targetsector, GRLIB_side_enemy, GRLIB_radiotower_size * 1.4] call KPLIB_fnc_getNearestTower;
|
||||
|
||||
if !(isNil "_nearestower") then {
|
||||
private _reinforcements_time = (((((markerpos _nearestower) distance (markerpos _targetsector)) / 1000) ^ 1.66 ) * 120) / (GRLIB_difficulty_modifier * GRLIB_csat_aggressivity);
|
||||
if (_targetsector in sectors_bigtown) then {
|
||||
_reinforcements_time = _reinforcements_time * 0.35;
|
||||
};
|
||||
private _current_timer = time;
|
||||
|
||||
waitUntil {sleep 1; (_current_timer + _reinforcements_time < time) || (_targetsector in blufor_sectors) || (_nearestower in blufor_sectors)};
|
||||
|
||||
sleep 15;
|
||||
|
||||
if ((_targetsector in active_sectors) && !(_targetsector in blufor_sectors) && !(_nearestower in blufor_sectors) && (!([] call KPLIB_fnc_isBigtownActive) || _targetsector in sectors_bigtown)) then {
|
||||
reinforcements_sector_under_attack = _targetsector;
|
||||
reinforcements_set = true;
|
||||
["lib_reinforcements",[markertext _targetsector]] remoteExec ["bis_fnc_shownotification"];
|
||||
if ((random combat_readiness) > (20 + (30 / GRLIB_csat_aggressivity))) then {
|
||||
[_targetsector] spawn send_paratroopers;
|
||||
};
|
||||
stats_reinforcements_called = stats_reinforcements_called + 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
_reset_time = 1800;
|
||||
|
||||
reinforcements_set = false;
|
||||
|
||||
while { true } do {
|
||||
|
||||
waitUntil { sleep 0.3; reinforcements_set };
|
||||
reinforcements_set = false;
|
||||
|
||||
_localtime = time;
|
||||
|
||||
waitUntil { sleep 0.3; ( time > ( _localtime + _reset_time ) ) || reinforcements_set };
|
||||
|
||||
if ( !reinforcements_set && !([] call KPLIB_fnc_isBigtownActive) ) then { reinforcements_sector_under_attack = ""; }
|
||||
|
||||
};
|
||||
@@ -0,0 +1,140 @@
|
||||
params [
|
||||
["_targetsector", "", ["",[]]],
|
||||
["_chopper_type", objNull, [objNull]]
|
||||
];
|
||||
|
||||
if (_targetsector isEqualTo "" || opfor_choppers isEqualTo []) exitWith {false};
|
||||
|
||||
private _targetpos = _targetsector;
|
||||
if (_targetpos isEqualType "") then {
|
||||
_targetpos = markerPos _targetsector;
|
||||
};
|
||||
private _spawnsector = ([sectors_airspawn, [_targetpos], {(markerpos _x) distance _input0}, "ASCEND"] call BIS_fnc_sortBy) select 0;
|
||||
private _newvehicle = objNull;
|
||||
private _pilot_group = grpNull;
|
||||
if (isNull _chopper_type) then {
|
||||
_chopper_type = selectRandom opfor_choppers;
|
||||
|
||||
while {!(_chopper_type in opfor_troup_transports)} do {
|
||||
_chopper_type = selectRandom opfor_choppers;
|
||||
};
|
||||
|
||||
_newvehicle = createVehicle [_chopper_type, markerpos _spawnsector, [], 0, "FLY"];
|
||||
createVehicleCrew _newvehicle;
|
||||
sleep 0.1;
|
||||
|
||||
_pilot_group = createGroup [GRLIB_side_enemy, true];
|
||||
(crew _newvehicle) joinSilent _pilot_group;
|
||||
|
||||
_newvehicle addMPEventHandler ["MPKilled", {_this spawn kill_manager}];
|
||||
{_x addMPEventHandler ["MPKilled", {_this spawn kill_manager}];} forEach (crew _newvehicle);
|
||||
} else {
|
||||
_newvehicle = _chopper_type;
|
||||
_pilot_group = group _newvehicle;
|
||||
};
|
||||
|
||||
private _para_group = createGroup [GRLIB_side_enemy, true];
|
||||
|
||||
while {(count (units _para_group)) < 8} do {
|
||||
[opfor_paratrooper, markerPos _spawnsector, _para_group] call KPLIB_fnc_createManagedUnit;
|
||||
};
|
||||
|
||||
{removeBackpack _x; _x addBackPack "B_parachute"; _x moveInCargo _newvehicle;} forEach (units _para_group);
|
||||
|
||||
while {(count (waypoints _pilot_group)) != 0} do {deleteWaypoint ((waypoints _pilot_group) select 0);};
|
||||
while {(count (waypoints _para_group)) != 0} do {deleteWaypoint ((waypoints _para_group) select 0);};
|
||||
sleep 0.2;
|
||||
{_x doFollow leader _pilot_group} forEach units _pilot_group;
|
||||
{_x doFollow leader _para_group} forEach units _para_group;
|
||||
sleep 0.2;
|
||||
|
||||
_newvehicle flyInHeight 100;
|
||||
|
||||
_waypoint = _pilot_group addWaypoint [_targetpos, 25];
|
||||
_waypoint setWaypointType "MOVE";
|
||||
_waypoint setWaypointSpeed "FULL";
|
||||
_waypoint setWaypointBehaviour "CARELESS";
|
||||
_waypoint setWaypointCombatMode "BLUE";
|
||||
_waypoint setWaypointCompletionRadius 100;
|
||||
_waypoint = _pilot_group addWaypoint [_targetpos, 25];
|
||||
_waypoint setWaypointType "MOVE";
|
||||
_waypoint setWaypointSpeed "FULL";
|
||||
_waypoint setWaypointBehaviour "CARELESS";
|
||||
_waypoint setWaypointCombatMode "BLUE";
|
||||
_waypoint setWaypointCompletionRadius 100;
|
||||
_waypoint = _pilot_group addWaypoint [_targetpos, 700];
|
||||
_waypoint setWaypointType "MOVE";
|
||||
_waypoint setWaypointCompletionRadius 100;
|
||||
_waypoint = _pilot_group addWaypoint [_targetpos, 700];
|
||||
_waypoint setWaypointType "MOVE";
|
||||
_waypoint setWaypointCompletionRadius 100;
|
||||
_waypoint = _pilot_group addWaypoint [_targetpos, 700];
|
||||
_waypoint setWaypointType "MOVE";
|
||||
_waypoint setWaypointCompletionRadius 100;
|
||||
_pilot_group setCurrentWaypoint [_pilot_group, 1];
|
||||
|
||||
_waypoint = _para_group addWaypoint [_targetpos, 100];
|
||||
_waypoint setWaypointType "MOVE";
|
||||
_waypoint setWaypointSpeed "NORMAL";
|
||||
_waypoint setWaypointBehaviour "COMBAT";
|
||||
_waypoint setWaypointCombatMode "YELLOW";
|
||||
_waypoint setWaypointCompletionRadius 50;
|
||||
_waypoint = _para_group addWaypoint [_targetpos, 100];
|
||||
_waypoint setWaypointType "MOVE";
|
||||
_waypoint setWaypointCompletionRadius 50;
|
||||
_pilot_group setCurrentWaypoint [_para_group, 1];
|
||||
|
||||
_newvehicle flyInHeight 100;
|
||||
|
||||
waitUntil {sleep 1;
|
||||
!(alive _newvehicle) || (damage _newvehicle > 0.2 ) || (_newvehicle distance _targetpos < 400)
|
||||
};
|
||||
|
||||
_newvehicle flyInHeight 100;
|
||||
|
||||
{
|
||||
unassignVehicle _x;
|
||||
moveout _x;
|
||||
sleep 0.5;
|
||||
} forEach (units _para_group);
|
||||
|
||||
_newvehicle flyInHeight 100;
|
||||
|
||||
sleep 0.2;
|
||||
while {(count (waypoints _pilot_group)) != 0} do {deleteWaypoint ((waypoints _pilot_group) select 0);};
|
||||
while {(count (waypoints _para_group)) != 0} do {deleteWaypoint ((waypoints _para_group) select 0);};
|
||||
sleep 0.2;
|
||||
{_x doFollow leader _pilot_group} foreach units _pilot_group;
|
||||
{_x doFollow leader _para_group} foreach units _para_group;
|
||||
sleep 0.2;
|
||||
|
||||
_newvehicle flyInHeight 100;
|
||||
|
||||
_waypoint = _pilot_group addWaypoint [_targetpos, 200];
|
||||
_waypoint setWaypointBehaviour "COMBAT";
|
||||
_waypoint setWaypointCombatMode "RED";
|
||||
_waypoint setWaypointType "SAD";
|
||||
_waypoint = _pilot_group addWaypoint [_targetpos, 200];
|
||||
_waypoint setWaypointBehaviour "COMBAT";
|
||||
_waypoint setWaypointCombatMode "RED";
|
||||
_waypoint setWaypointType "SAD";
|
||||
_waypoint = _pilot_group addWaypoint [_targetpos, 200];
|
||||
_waypoint setWaypointBehaviour "COMBAT";
|
||||
_waypoint setWaypointCombatMode "RED";
|
||||
_waypoint setWaypointType "SAD";
|
||||
_waypoint = _pilot_group addWaypoint [_targetpos, 200];
|
||||
_waypoint setWaypointType "SAD";
|
||||
_waypoint = _pilot_group addWaypoint [_targetpos, 200];
|
||||
_waypoint setWaypointType "SAD";
|
||||
_pilot_group setCurrentWaypoint [_pilot_group, 1];
|
||||
_waypoint = _para_group addWaypoint [_targetpos, 100];
|
||||
_waypoint setWaypointType "SAD";
|
||||
_waypoint = _para_group addWaypoint [_targetpos, 100];
|
||||
_waypoint setWaypointType "SAD";
|
||||
_waypoint = _para_group addWaypoint [_targetpos, 100];
|
||||
_waypoint setWaypointType "SAD";
|
||||
_waypoint = _para_group addWaypoint [_targetpos, 100];
|
||||
_waypoint setWaypointType "SAD";
|
||||
_waypoint = _para_group addWaypoint [_targetpos, 100];
|
||||
_waypoint setWaypointType "SAD";
|
||||
_pilot_group setCurrentWaypoint [_para_group, 1];
|
||||
Reference in New Issue
Block a user