#include "..\script_component.hpp" // executed on all clients with an interface // flickers lights for light props/streetlamps and plays a spark sound if (!hasInterface) exitWith {}; params [["_object", objNull, [objNull]]]; if (isNull _object) exitWith {}; // if player is within object view distance of the object, flicker the lights private _flickerHandle = [_object] spawn { params ["_object"]; for "_i" from 1 to 3 do { _object switchLight "OFF"; sleep (random 0.3); _object switchLight "ON"; sleep (random 0.3); }; // always finish by shutting off _object switchLight "OFF"; }; _object setVariable [QGVAR(flickerHandle), _flickerHandle]; // sound private _spark_sound = GVAR(zapSounds) call BIS_fnc_selectRandom; playSound3D [_spark_sound, _object, false, getPosASL _object, 1, 1, 20, 0, true]; // particle effect private _e_static = "#particlesource" createVehicleLocal (getPosATL _object); _e_static setParticleCircle [1, [0, 0, 0]]; _e_static setParticleRandom [0.2, [1.5,1.5,0], [0.175, 0.175, 0], 0.15, 0.2, [0, 0, 0, 1], 1, 0]; _e_static setParticleParams [["\A3\data_f\blesk1", 1, 0, 1], "", "SpaceObject", 1, 0.05, [0, 0, 0], [0, 0, 0], 0, 10, 7.9,0, [0.01, 0.02, 0.01], [[1, 1, 0.1, 1], [1, 1, 1, 1]], [0.025], 1, 0, "", "", _object,0,false,-1,[[100,100,100,1],[0,0,1,0.01]]]; _e_static setDropInterval 0.025; [{deleteVehicle _this;}, _e_static, 1] call CBA_fnc_waitAndExecute; // play additional spark _bbr = boundingBoxReal vehicle _object; _p1 = _bbr select 0; _p2 = _bbr select 1; _maxHeight = abs ((_p2 select 2) - (_p1 select 2)); //_spark_poz_rel = [getPos _lamp select 0,getPos _lamp select 1,_maxHeight-0.5]; private _spark_poz_rel = (_maxHeight/2)-0.45; private _spark_type = ["white","orange"] call BIS_fnc_selectRandom; private _drop = 0.001+(random 0.05); private _scantei_spark = "#particlesource" createVehicleLocal (getPosATL _object); if (_spark_type=="orange") then { _scantei_spark setParticleCircle [0, [0, 0, 0]]; _scantei_spark setParticleRandom [1, [0.1, 0.1, 0.1], [0, 0, 0], 0, 0.25, [0, 0, 0, 0], 0, 0]; _scantei_spark setParticleParams [["\A3\data_f\proxies\muzzle_flash\muzzle_flash_silencer.p3d", 1, 0, 1], "", "SpaceObject", 1, 1, [0, 0,_spark_poz_rel], [0, 0, 0], 0, 15, 7.9, 0, [0.5,0.5,0.05], [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0]], [0.08], 1, 0, "", "", _object,0,true,0.3,[[1,1,1,1]]]; _scantei_spark setDropInterval _drop; } else { //hint "alb"; _scantei_spark setParticleCircle [0, [0, 0, 0]]; _scantei_spark setParticleRandom [1, [0.05, 0.05, 0.1], [5, 5, 3], 0, 0.0025, [0, 0, 0, 0], 0, 0]; _scantei_spark setParticleParams [["\A3\data_f\proxies\muzzle_flash\muzzle_flash_silencer.p3d", 1, 0, 1], "", "SpaceObject", 1, 1, [0, 0,_spark_poz_rel], [0, 0, 0], 0, 20, 7.9, 0, [0.5,0.5,0.05], [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 0]], [0.08], 1, 0, "", "", _object,0,true,0.3,[[5,5,3,1]]]; _scantei_spark setDropInterval 0.001; }; private _spark_sound = GVAR(zapSounds) call BIS_fnc_selectRandom; playSound3D [_spark_sound, _scantei_spark, false, getPosASL _object, 1, 1, 20, 0, true]; [{deleteVehicle _this;}, _scantei_spark, 0.4 + (random 0.7)] call CBA_fnc_waitAndExecute;