Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- flareHoverHeight = 3;
- createRocketFlare = {
- sleep 0.65;
- [_this, 0, 0] spawn createRocketFlareSub;
- sleep 0.8;
- [_this, 90, 10] spawn createRocketFlareSub;
- [_this, -90, 10] spawn createRocketFlareSub;
- [_this, 0, 0] spawn createRocketFlareSub;
- sleep 0.8;
- [_this, 90, 15] spawn createRocketFlareSub;
- [_this, -90, 15] spawn createRocketFlareSub;
- [_this, 0, 0] spawn createRocketFlareSub;
- sleep 0.8;
- [_this, 90, 20] spawn createRocketFlareSub;
- [_this, -90, 20] spawn createRocketFlareSub;
- [_this, 0, 0] spawn createRocketFlareSub;
- sleep 0.8;
- [_this, 90, 20] spawn createRocketFlareSub;
- [_this, -90, 20] spawn createRocketFlareSub;
- [_this, 0, 0] spawn createRocketFlareSub;
- sleep 0.8;
- [_this, 90, 20] spawn createRocketFlareSub;
- [_this, -90, 20] spawn createRocketFlareSub;
- [_this, 0, 0] spawn createRocketFlareSub;
- sleep 0.8;
- [_this, 90, 20] spawn createRocketFlareSub;
- [_this, -90, 20] spawn createRocketFlareSub;
- [_this, 0, 0] spawn createRocketFlareSub;
- }
- createRocketFlareSub = {
- _rocket = _this select 0;
- _dirMod = _this select 1;
- _speed = _this select 2;
- if(_speed == 0) then {
- _speed = 0.001;
- };
- _pos = position _rocket;
- _rDir = vectorDir _rocket;
- _rUp = vectorUp _rocket;
- _stone1="F_40mm_White" createVehicleLocal(_pos);
- _stone1 setVectorDirAndUp [_rDir, _rUp];
- _vel = (velocity _rocket) vectorMultiply 0.5;
- _dir = direction _rocket + _dirMod;
- _stone1 setVelocity [
- (sin _dir * _speed),
- (cos _dir * _speed),
- (_vel select 2) + 30
- ];
- sleep 10;
- _stone2="F_40mm_White" createVehicleLocal(_pos);
- _stone2 setVectorDirAndUp [_rDir, _rUp];
- _stone2 setVelocity [
- (sin _dir * _speed),
- (cos _dir * _speed),
- (_vel select 2) + 30
- ];
- sleep 5;
- deleteVehicle _stone1;
- };
- flarePossible = ["F_40mm_Red", "F_40mm_White", "F_40mm_Green", "F_40mm_Yellow", "R_PG32V_F", "R_TBG32V_F"];
- flareClusterFunction = {
- [_this, [-20, 0, 0]] spawn flareClusterSubFunction;
- [_this, [20, 0, 0]] spawn flareClusterSubFunction;
- [_this, [0, 20, 0]] spawn flareClusterSubFunction;
- [_this, [0, -20, 0]] spawn flareClusterSubFunction;
- };
- flareClusterSubFunction = {
- _flare = _this select 0;
- _light = (typeOf _flare) createVehicle (position _flare vectorAdd (_this select 1));
- _light setVelocity (velocity _flare);
- _light setVectorDirAndUp [vectorDir _flare, vectorUp _flare];
- sleep 3;
- _light remoteExec ["flareHoverFunction", 0];
- };
- flareHoverFunction = {
- _start = time;
- if(((getPosATL _this) select 2) < flareHoverHeight) then {
- _this setPosATL ( getPosATL _this vectorAdd [0,0, flareHoverHeight]);
- _this enableSimulation false;
- sleep 22;
- deleteVehicle _this;
- }else {
- waitUntil {((getPosATL _this) select 2) < flareHoverHeight};
- _delay = 25 - (time - _start);
- _this enableSimulation false;
- sleep _delay;
- deleteVehicle _this;
- }
- };
- flareFunction = {
- if(typeOf _this == "R_PG32V_F" || typeOf _this == "R_TBG32V_F") then {
- _this call createRocketFlare;
- }else {
- sleep 0.2;
- _this spawn flareClusterFunction;
- sleep 3;
- _this remoteExec ["flareHoverFunction", 0];
- };
- };
- {
- _x addEventHandler ["Fired", {
- if((typeOf (_this select 6)) in flarePossible) then {
- (_this select 6) spawn flareFunction;
- }
- }];
- } forEach allUnits;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement