initial files

This commit is contained in:
Samuele Lorefice
2025-05-24 16:17:33 +02:00
commit 9e023649ac
477 changed files with 118566 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
params ["_sector"];
if (KP_liberation_asymmetric_debug > 0) then {[format ["asym_sector_ambush.sqf for %1 spawned on: %2 - Time: %3", markerText _sector, debug_source, diag_tickTime], "ASYMMETRIC"] remoteExecCall ["KPLIB_fnc_log", 2];};
waitUntil {sleep 1; _sector in KP_liberation_asymmetric_sectors};
private _buildings = (nearestObjects [(markerPos _sector), ["House"], 75]) select {(alive _x) && !((typeOf _x) in KP_liberation_cr_ign_buildings)};
private _positions = [];
{
_positions = _positions + ([_x] call BIS_fnc_buildingPositions);
} forEach _buildings;
if (KP_liberation_asymmetric_debug > 0) then {[format ["asym_sector_ambush.sqf -> Found %1 suitable buildings in %2 - Time: %3", count _buildings, markerText _sector, diag_tickTime], "ASYMMETRIC"] remoteExecCall ["KPLIB_fnc_log", 2];};
private _position_indexes = [];
private _position_count = count _positions;
while {count _position_indexes < 10} do {
private _nextposit = floor (random _position_count);
if !(_nextposit in _position_indexes) then {
_position_indexes pushback _nextposit;
};
};
private _grp = [(markerPos _sector)] call KPLIB_fnc_spawnGuerillaGroup;
_grp setBehaviour "STEALTH";
private _idxposit = 0;
{
_x setpos (_positions select (_position_indexes select _idxposit));
_x setUnitPos "UP";
doStop _x;
_idxposit = _idxposit + 1;
} forEach (units _grp);
if (KP_liberation_asymmetric_debug > 0) then {[format ["asym_sector_ambush.sqf -> Units spawned in %1 - Time: %2", markerText _sector, diag_tickTime], "ASYMMETRIC"] remoteExecCall ["KPLIB_fnc_log", 2];};
private _attack = false;
while {(_sector in KP_liberation_asymmetric_sectors) && (!isNull _grp)} do {
private _blufor_near = {alive _x && side _x == GRLIB_side_friendly} count ((getpos (leader _grp)) nearEntities [["LAND"], 140]);
if ((_blufor_near > 0) && !_attack) then {
_attack = true;
{
_x setUnitPos "AUTO";
} forEach (units _grp);
(units _grp) doFollow (leader _grp);
_grp setBehaviour "COMBAT";
_grp setCombatMode "RED";
private _waypoint = _grp addWaypoint [markerpos _sector, 20];
_waypoint setWaypointType "SAD";
_waypoint setWaypointSpeed "FULL";
_waypoint = _grp addWaypoint [markerpos _sector, 150];
_waypoint setWaypointType "SAD";
_waypoint = _grp addWaypoint [markerpos _sector, 150];
_waypoint setWaypointType "SAD";
_waypoint = _grp addWaypoint [markerpos _sector, 150];
_waypoint setWaypointType "SAD";
};
sleep 1;
};
if (KP_liberation_asymmetric_debug > 0) then {[format ["asym_sector_ambush.sqf -> Exit Loop in %1 - Time: %2", markerText _sector, diag_tickTime], "ASYMMETRIC"] remoteExecCall ["KPLIB_fnc_log", 2];};
sleep 60;
if (!isNull _grp) then {
{
if (alive _x) then {
deleteVehicle _x;
};
} forEach (units _grp);
};
if (KP_liberation_asymmetric_debug > 0) then {[format ["asym_sector_ambush.sqf -> Ambush dropped in %1 - Time: %2", markerText _sector, diag_tickTime], "ASYMMETRIC"] remoteExecCall ["KPLIB_fnc_log", 2];};

View File

@@ -0,0 +1,131 @@
params ["_sector"];
if (KP_liberation_asymmetric_debug > 0) then {[format ["Sector %1 (%2) - sector_guerilla spawned on: %3", (markerText _sector), _sector, debug_source], "ASYMMETRIC"] remoteExecCall ["KPLIB_fnc_log", 2];};
private _startpos = (markerPos _sector) getPos [(1200 + (round (random 400))), (random 360)];
while {(([_startpos, 500, GRLIB_side_friendly] call KPLIB_fnc_getUnitsCount) > 0) || (surfaceIsWater _startpos)} do {
_startpos = (markerPos _sector) getPos [(1200 + (round (random 400))), (random 360)];
};
private _incDir = (markerPos _sector) getDir _startpos;
private _incString = "unknown";
if (_incDir < 23) then {
_incString = "N";
} else {
if (_incDir < 68) then {
_incString = "NE";
} else {
if (_incDir < 113) then {
_incString = "E";
} else {
if (_incDir < 158) then {
_incString = "SE";
} else {
if (_incDir < 203) then {
_incString = "S";
} else {
if (_incDir < 248) then {
_incString = "SW";
} else {
if (_incDir < 293) then {
_incString = "W";
} else {
if (_incDir < 338) then {
_incString = "NW";
} else {
_incString = "N";
};
};
};
};
};
};
};
};
[5, [(markerText _sector), _incString]] remoteExec ["KPLIB_fnc_crGlobalMsg"];
private _spawnedGroups = [];
private _grp = [_startpos] call KPLIB_fnc_spawnGuerillaGroup;
while {(count (waypoints _grp)) != 0} do {deleteWaypoint ((waypoints _grp) select 0);};
{_x doFollow (leader _grp)} forEach (units _grp);
private _waypoint = _grp addWaypoint [markerpos _sector, 100];
_waypoint setWaypointType "MOVE";
_waypoint setWaypointSpeed "FULL";
_waypoint setWaypointBehaviour "AWARE";
_waypoint setWaypointCombatMode "YELLOW";
_waypoint setWaypointCompletionRadius 30;
_waypoint = _grp addWaypoint [markerpos _sector, 200];
_waypoint setWaypointSpeed "NORMAL";
_waypoint setWaypointType "SAD";
_waypoint = _grp addWaypoint [markerpos _sector, 200];
_waypoint setWaypointSpeed "NORMAL";
_waypoint setWaypointType "SAD";
_waypoint = _grp addWaypoint [markerpos _sector, 200];
_waypoint setWaypointSpeed "NORMAL";
_waypoint setWaypointType "SAD";
_waypoint = _grp addWaypoint [markerpos _sector, 200];
_waypoint setWaypointSpeed "NORMAL";
_waypoint setWaypointType "CYCLE";
_spawnedGroups pushBack _grp;
sleep 30;
if (((random 100) <= 25) && !(KP_liberation_guerilla_vehicles isEqualTo [])) then {
private _vehicle = (selectRandom KP_liberation_guerilla_vehicles) createVehicle _startpos;
[_vehicle] call KPLIB_fnc_allowCrewInImmobile;
private _grp = [_startpos, 2] call KPLIB_fnc_spawnGuerillaGroup;
((units _grp) select 0) moveInDriver _vehicle;
((units _grp) select 1) moveInGunner _vehicle;
_waypoint = _grp addWaypoint [markerpos _sector, 100];
_waypoint setWaypointType "MOVE";
_waypoint setWaypointSpeed "LIMITED";
_waypoint setWaypointBehaviour "AWARE";
_waypoint setWaypointCombatMode "YELLOW";
_waypoint setWaypointCompletionRadius 30;
_waypoint = _grp addWaypoint [markerpos _sector, 300];
_waypoint setWaypointSpeed "LIMITED";
_waypoint setWaypointType "SAD";
_waypoint = _grp addWaypoint [markerpos _sector, 300];
_waypoint setWaypointSpeed "LIMITED";
_waypoint setWaypointType "SAD";
_waypoint = _grp addWaypoint [markerpos _sector, 300];
_waypoint setWaypointSpeed "LIMITED";
_waypoint setWaypointType "SAD";
_waypoint = _grp addWaypoint [markerpos _sector, 300];
_waypoint setWaypointSpeed "LIMITED";
_waypoint setWaypointType "CYCLE";
_spawnedGroups pushBack _grp;
};
waitUntil {sleep 60; !(_sector in active_sectors)};
sleep 60;
private _strengthChanged = false;
{
if (!isNull _x) then {
{
if (alive _x) then {
deleteVehicle _x;
KP_liberation_guerilla_strength = KP_liberation_guerilla_strength + 2;
_strengthChanged = true;
};
} forEach (units _x);
};
} forEach _spawnedGroups;
if (!isServer && _strengthChanged) then {
publicVariableServer "KP_liberation_guerilla_strength";
};
if (KP_liberation_asymmetric_debug > 0) then {[format ["Sector %1 (%2) - sector_guerilla dropped on: %3", (markerText _sector), _sector, debug_source], "ASYMMETRIC"] remoteExecCall ["KPLIB_fnc_log", 2];};