Advertisement
Guest User

Untitled

a guest
Sep 1st, 2015
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. ALiVE_fnc_INS_suicide = {
  2. private ["_timeTaken","_pos","_id","_size","_faction","_sides","_agents","_building","_objective","_civFactions"];
  3.  
  4. _timeTaken = _this select 0;
  5. _pos = _this select 1;
  6. _id = _this select 2;
  7. _size = _this select 3;
  8. _faction = _this select 4;
  9. _factory = _this select 5;
  10. _sides = _this select 6;
  11. _agents = _this select 7;
  12. _civFactions = _this select 8;
  13. _side = _faction call ALiVE_fnc_factionSide;
  14. _allSides = ["EAST","WEST","GUER"];
  15. _objective = [[],"getobjectivebyid",_id] call ALiVE_fnc_OPCOM;
  16.  
  17. // Convert to data that can be persistet
  18. _factory = [[],"convertObject",_factory] call ALiVE_fnc_OPCOM;
  19.  
  20. // Timeout
  21. waituntil {time - _timeTaken > 120};
  22.  
  23. // Place ambient suiciders trigger
  24. if (!isnil "ALiVE_mil_IED") then {
  25. _trg = createTrigger ["EmptyDetector",_pos];
  26. _trg setTriggerArea [_size + 250, _size + 250,0,false];
  27. _trg setTriggerActivation ["ANY","PRESENT",false];
  28. _trg setTriggerStatements [
  29. "this && ({(vehicle _x in thisList) && ((getposATL _x) select 2 < 25)} count ([] call BIS_fnc_listPlayers) > 0)",
  30. format ["null = [[getpos thisTrigger,%1,'%2'],thisList] call ALIVE_fnc_createBomber", _size, _civFactions call BIS_fnc_SelectRandom],
  31. ""
  32. ];
  33.  
  34. _placeholders = ((nearestobjects [_pos,["Static"],150]) + (_pos nearRoads 150));
  35. if (!isnil "_placeholders" && {count _placeholders > 0}) then {_trg = _placeholders select 0};
  36.  
  37. [_objective,"suicide",[[],"convertObject",_trg] call ALiVE_fnc_OPCOM] call ALiVE_fnc_HashSet;
  38. };
  39.  
  40. // Add TACOM suicide command on one ambient civilian agents
  41. {
  42. private ["_agent"];
  43. _agent = [ALiVE_AgentHandler,"getAgent",_x] call ALiVE_fnc_AgentHandler;
  44.  
  45. if (!isnil "_agent" && {([_agent,"type",""] call ALiVE_fnc_HashGet) == "agent"}) exitwith {
  46. [_agent, "setActiveCommand", ["ALIVE_fnc_cc_suicideTarget", "managed", [_sides]]] call ALIVE_fnc_civilianAgent;
  47. };
  48. } foreach _agents;
  49.  
  50. _event = ['OPCOM_TERRORIZE',[_side,_objective],"OPCOM"] call ALIVE_fnc_event;
  51. _eventID = [ALIVE_eventLog, "addEvent",_event] call ALIVE_fnc_eventLog;
  52.  
  53. [_pos,_sides, 20] call ALiVE_fnc_updateSectorHostility;
  54. [_pos, _allSides - _sides, -20] call ALiVE_fnc_updateSectorHostility;
  55. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement