Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ALiVE_fnc_INS_suicide = {
- private ["_timeTaken","_pos","_id","_size","_faction","_sides","_agents","_building","_objective","_civFactions"];
- _timeTaken = _this select 0;
- _pos = _this select 1;
- _id = _this select 2;
- _size = _this select 3;
- _faction = _this select 4;
- _factory = _this select 5;
- _sides = _this select 6;
- _agents = _this select 7;
- _civFactions = _this select 8;
- _side = _faction call ALiVE_fnc_factionSide;
- _allSides = ["EAST","WEST","GUER"];
- _objective = [[],"getobjectivebyid",_id] call ALiVE_fnc_OPCOM;
- // Convert to data that can be persistet
- _factory = [[],"convertObject",_factory] call ALiVE_fnc_OPCOM;
- // Timeout
- waituntil {time - _timeTaken > 120};
- // Place ambient suiciders trigger
- if (!isnil "ALiVE_mil_IED") then {
- _trg = createTrigger ["EmptyDetector",_pos];
- _trg setTriggerArea [_size + 250, _size + 250,0,false];
- _trg setTriggerActivation ["ANY","PRESENT",false];
- _trg setTriggerStatements [
- "this && ({(vehicle _x in thisList) && ((getposATL _x) select 2 < 25)} count ([] call BIS_fnc_listPlayers) > 0)",
- format ["null = [[getpos thisTrigger,%1,'%2'],thisList] call ALIVE_fnc_createBomber", _size, _civFactions call BIS_fnc_SelectRandom],
- ""
- ];
- _placeholders = ((nearestobjects [_pos,["Static"],150]) + (_pos nearRoads 150));
- if (!isnil "_placeholders" && {count _placeholders > 0}) then {_trg = _placeholders select 0};
- [_objective,"suicide",[[],"convertObject",_trg] call ALiVE_fnc_OPCOM] call ALiVE_fnc_HashSet;
- };
- // Add TACOM suicide command on one ambient civilian agents
- {
- private ["_agent"];
- _agent = [ALiVE_AgentHandler,"getAgent",_x] call ALiVE_fnc_AgentHandler;
- if (!isnil "_agent" && {([_agent,"type",""] call ALiVE_fnc_HashGet) == "agent"}) exitwith {
- [_agent, "setActiveCommand", ["ALIVE_fnc_cc_suicideTarget", "managed", [_sides]]] call ALIVE_fnc_civilianAgent;
- };
- } foreach _agents;
- _event = ['OPCOM_TERRORIZE',[_side,_objective],"OPCOM"] call ALIVE_fnc_event;
- _eventID = [ALIVE_eventLog, "addEvent",_event] call ALIVE_fnc_eventLog;
- [_pos,_sides, 20] call ALiVE_fnc_updateSectorHostility;
- [_pos, _allSides - _sides, -20] call ALiVE_fnc_updateSectorHostility;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement