diff --git a/core.liberation/scripts/server/ai/add_civ_waypoints.sqf b/core.liberation/scripts/server/ai/add_civ_waypoints.sqf index 6dd94fe79..026126d9a 100644 --- a/core.liberation/scripts/server/ai/add_civ_waypoints.sqf +++ b/core.liberation/scripts/server/ai/add_civ_waypoints.sqf @@ -4,7 +4,7 @@ if (isNull _grp) exitWith {}; if (!local _grp) exitWith { [_grp, _basepos] remoteExec ["add_civ_waypoints", groupOwner _grp] }; private _civ_veh = objectParent (leader _grp); -if (_civ_veh isKindOf "Ship") exitWith { [_grp, getPosATL _civ_veh, 80] spawn patrol_ai }; +if (_civ_veh isKindOf "Ship") exitWith { [_grp, getPosATL _civ_veh, 120] spawn patrol_ai }; [_grp] call F_deleteWaypoints; diff --git a/core.liberation/scripts/server/ai/battlegroup_ai.sqf b/core.liberation/scripts/server/ai/battlegroup_ai.sqf index 211c78a94..cba0d1900 100644 --- a/core.liberation/scripts/server/ai/battlegroup_ai.sqf +++ b/core.liberation/scripts/server/ai/battlegroup_ai.sqf @@ -19,6 +19,7 @@ private _attack = true; private _timer = 0; private _last_pos = getPosATL (leader _grp); diag_log format ["Group %1 (%2) - Attack: %3 - Distance: %4m", _grp, _veh_type, _objective_pos, round (_last_pos distance2D _objective_pos)]; +sleep (5 + floor random 30); private ["_waypoint", "_wp0", "_next_objective", "_timer", "_sleep", "_target"]; while {(count _objective_pos > 0)} do { @@ -59,7 +60,7 @@ while {(count _objective_pos > 0)} do { if (_vehicle isKindOf "AllVehicles") then { (driver _vehicle) doMove _objective_pos; } else { - [_objective_pos] call F_getEmptyArmored; + [_objective_pos] spawn F_getEmptyArmored; }; _timer = round (time + (15 * 60)); diff --git a/core.liberation/scripts/server/ai/defence_ai.sqf b/core.liberation/scripts/server/ai/defence_ai.sqf index 691db4ad2..aa7d4e423 100644 --- a/core.liberation/scripts/server/ai/defence_ai.sqf +++ b/core.liberation/scripts/server/ai/defence_ai.sqf @@ -2,11 +2,12 @@ params ["_grp", "_flagpos", ["_radius", 100]]; if (isNil "_grp" || isNil "_flagpos") exitWith {}; if (isNull _grp) exitWith {}; +private _grp_veh = objectParent (leader _grp); +if (_grp_veh isKindOf "Ship") exitWith { [_grp, getPosATL _grp_veh, 200] spawn patrol_ai }; + _flagpos = _flagpos getPos [5, random 360]; diag_log format ["Group %1 - Defend: %2", _grp, _flagpos]; - -private _grp_veh = objectParent (leader _grp); -if (_grp_veh isKindOf "Ship") exitWith { [_grp, getPosATL _grp_veh, _radius] spawn patrol_ai }; +sleep (5 + floor random 30); private _timer = 0; private _patrol = false; @@ -14,7 +15,7 @@ private ["_target", "_basepos", "_waypoint", "_wp0"]; while { GRLIB_endgame == 0 && ({alive _x} count (units _grp) > 0) } do { if (side _grp == GRLIB_side_enemy) then { - [_flagpos] call F_getEmptyArmored; + [_flagpos] spawn F_getEmptyArmored; _target = [_flagpos] call F_getNearestBlufor; }; if (side _grp == GRLIB_side_friendly) then { diff --git a/core.liberation/scripts/server/ai/patrol_ai.sqf b/core.liberation/scripts/server/ai/patrol_ai.sqf index 70fa979a8..e1cc2b919 100644 --- a/core.liberation/scripts/server/ai/patrol_ai.sqf +++ b/core.liberation/scripts/server/ai/patrol_ai.sqf @@ -12,7 +12,6 @@ if (_grp_veh isKindOf "Ship") then { _flagpos = getPosATL _grp_veh; _patrol_in_water = true; }; -if (_patrol_in_water) then { _radius = 160 }; private _patrolcorners = [ [ (_flagpos select 0) - _radius, (_flagpos select 1) - _radius, 0 ], diff --git a/core.liberation/scripts/shared/functions/F_getEmptyArmored.sqf b/core.liberation/scripts/shared/functions/F_getEmptyArmored.sqf index ca8f65a4c..176a51e64 100644 --- a/core.liberation/scripts/shared/functions/F_getEmptyArmored.sqf +++ b/core.liberation/scripts/shared/functions/F_getEmptyArmored.sqf @@ -7,5 +7,5 @@ private _armed_veh = vehicles select { }; if (count _armed_veh > 0) then { - [_armed_veh select 0] call F_searchGunner; + [selectRandom _armed_veh] call F_searchGunner; }; \ No newline at end of file