2015-01-11 19:32:51 +00:00
|
|
|
/*
|
|
|
|
* Author: KoffeinFlummi
|
2015-05-09 02:47:15 +00:00
|
|
|
* Sends a civilian crowd away with a chance of failure
|
2015-01-11 23:13:47 +00:00
|
|
|
*
|
2015-01-11 19:32:51 +00:00
|
|
|
* Arguments:
|
2015-05-09 02:47:15 +00:00
|
|
|
* 0: Unit <OBJECT>
|
2015-01-11 19:32:51 +00:00
|
|
|
*
|
|
|
|
* Return value:
|
2015-05-09 02:47:15 +00:00
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [target] call ace_interaction_fnc_sendAway
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-01-11 23:13:47 +00:00
|
|
|
#include "script_component.hpp"
|
2015-01-11 19:32:51 +00:00
|
|
|
|
|
|
|
#define DISTANCE 50
|
|
|
|
#define RADIUS 10
|
|
|
|
|
2015-05-09 20:14:00 +00:00
|
|
|
PARAMS_1(_unit);
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2015-05-09 20:14:00 +00:00
|
|
|
private ["_chance", "_x"];
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2015-01-12 04:20:02 +00:00
|
|
|
ACE_player playActionNow "GestureGo";
|
2015-01-11 19:32:51 +00:00
|
|
|
|
2015-01-12 04:20:02 +00:00
|
|
|
if (count weapons ACE_player > 0) then {
|
2015-05-09 02:47:15 +00:00
|
|
|
_chance = 0.8;
|
2015-01-11 19:32:51 +00:00
|
|
|
} else {
|
2015-05-09 02:47:15 +00:00
|
|
|
_chance = 0.5;
|
2015-01-11 19:32:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
{
|
2015-05-09 02:47:15 +00:00
|
|
|
if (count (weapons _unit) == 0 and random 1 < _chance) then {
|
|
|
|
[-2, {
|
|
|
|
(_this select 0) setUnitPos "AUTO";
|
|
|
|
(_this select 0) doMove [(getPos (_this select 0) select 0) + DISTANCE * (eyeDirection (_this select 1) select 0), (getPos (_this select 0) select 1) + DISTANCE * (eyeDirection (_this select 1) select 1), 0];
|
|
|
|
}, [_x, ACE_player]] call CBA_fnc_globalExecute;
|
|
|
|
};
|
|
|
|
} forEach (_unit nearEntities ["Civilian", RADIUS]);
|