Advertisement
Guest User

emp blast

a guest
Jul 30th, 2021
908
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 2.28 KB | None | 0 0
  1. span class="re5"> params
  2. [
  3.     "_source",
  4.     ["_radius", 200]
  5. ];
  6.  
  7. _source say3D ["DEDZ_QUEST_11_EMP_REVERB", 2000, 1, false];
  8. _source say3D ["DEDZ_QUEST_11_EMP_SOURCE", 1000, 1, false];
  9. _source say3D ["DEDZ_EXPLOSION_AMBIENT", 1000, 1, false];
  10.  
  11. _lightsOnMen = ( allMissionObjects "#lightpoint" select { _x distance _source <= _radius } );
  12.  
  13. { deleteVehicle _x } forEach _lightsOnMen;
  14.  
  15. _lampsToPop = (nearestObjects [getPosWorld _source, [], _radius])  select {
  16.  
  17.     "lamp" in tolower ( getText ( configFile >> "CfgVehicles" >> typeOf _x >> "editorSubcategory" ) )
  18.  
  19. };
  20.  
  21. _lampsToDisable = (nearestObjects [getPosWorld _source, [], _radius])  select {
  22.  
  23.     lightIsOn _x in ["AUTO", "ON"];
  24.  
  25. };
  26.  
  27. private _handle = _lampsToPop spawn {
  28.  
  29.     sleep 0.5;
  30.     {
  31.         _x switchLight "OFF";
  32.         _x say3D
  33.         [
  34.             selectRandom ["DEDZ_LIGHTPOP_1","DEDZ_LIGHTPOP_2","DEDZ_LIGHTPOP_3","DEDZ_LIGHTPOP_4"],
  35.             300,
  36.             0.9+ random 0.2,
  37.             false
  38.         ];
  39.         sleep 0.05;
  40.  
  41.         _light = "#lightpoint" createVehicle position _x;
  42.         _light setPosWorld getPosWorld _x;
  43.        
  44.         _light setLightAmbient [0.25,0.5,1];  
  45.         _light setLightColor [0.25,0.5,1];  
  46.         _light setLightIntensity 10;  
  47.         _light setLightAttenuation [50, 0, 0, 0, 1, 10];
  48.        
  49.         _light spawn {
  50.            
  51.             for "_i" from 50 to 0 step -10 do {
  52.            
  53.             _this setLightIntensity _i * 5;  
  54.             _this setLightAttenuation [_i^2, 0, 0, 0, 1, _i^5];
  55.             sleep 0.0015;
  56.            
  57.             };
  58.            
  59.             deleteVehicle _this;
  60.         };
  61.  
  62.     } forEach _this;
  63.  
  64. };
  65.  
  66.  
  67. [_handle, _lampsToDisable] spawn {
  68.     params ["_handle", "_lampsToDisable"];
  69.     waitUntil { scriptDone _handle };
  70.  
  71.     {
  72.         _x switchLight "OFF";
  73.     } forEach _lampsToDisable;
  74.  
  75. };
  76.  
  77.  
  78. _empLight = "#lightpoint" createVehicle position _source;
  79. _empLight setPosWorld getPosWorld _source;
  80.  
  81. _empLight setLightAmbient [0.25,0.5,1];  
  82. _empLight setLightColor [0.25,0.5,1];  
  83. _empLight setLightIntensity 0;  
  84. _empLight setLightAttenuation [50, 0, 0, 0, 1, 100];
  85.  
  86.  
  87. _empLight spawn {
  88.    
  89.     for "_i" from 0 to 50 do {
  90.    
  91.     _this setLightIntensity _i * 5;  
  92.     _this setLightAttenuation [_i^2, 0, 0, 0, 1, _i^10];
  93.     sleep 0.0015;
  94.    
  95.     };
  96.    
  97.     for "_i" from 50 to 0 step -5 do {
  98.    
  99.     _this setLightIntensity _i * 5;  
  100.     _this setLightAttenuation [_i^2, 0, 0, 0, 1, _i^10];
  101.     sleep 0.0015;
  102.    
  103.     };
  104.    
  105.     deleteVehicle _this;
  106.  
  107. };
  108.  
  109.  
  110. _handle
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement