Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- fnc_avoid_worm = {
- private ["_danger_close","_op_dir","_chased_units","_fct","_reldir","_avoid_poz"];
- _danger_close = _this select 0;
- _chased_units = _this select 1;
- {
- _reldir = [_x, getPos _danger_close] call BIS_fnc_dirTo;
- _fct = [30,-30] call BIS_fnc_selectRandom;
- if (_reldir<180) then {_op_dir=_reldir+180 +_fct} else {_op_dir=_reldir-180+_fct};
- _avoid_poz = [getposATL _x,20+random 50, _op_dir] call BIS_fnc_relPos;
- _x doMove _avoid_poz;
- _x setSkill ["commanding", 1];
- } foreach _chased_units;
- };
- Worm_fnc_mainFunction = {
- params["_markerName"];
- [_this select 0] spawn
- {
- params ["_press_implicit_x","_press_implicit_y"];
- if (!isServer) exitWith {};
- _poz_worm = _this select 0;
- _cap = createVehicle ["Land_CanOpener_F",getmarkerpos _poz_worm,[],0,"CAN_COLLIDE"];
- _coada = createVehicle ["Land_CanOpener_F",getmarkerpos _poz_worm,[],0,"CAN_COLLIDE"];
- _coada_01= createVehicle ["Land_CanOpener_F",getmarkerpos _poz_worm,[],0,"CAN_COLLIDE"];
- _coada attachTo [_cap,[0,-1,1]];
- _coada_01 attachTo [_coada,[0,-1,1]];
- [_coada, true] remoteExec ["hideObjectGlobal",0,true];
- [_coada_01, true] remoteExec ["hideObjectGlobal",0,true];
- _hide_me = true;
- while {_hide_me} do {
- sleep 2;
- _list_ai_in_range_worm = (position _cap) nearEntities [["Man","LandVehicle"],100];
- if (count _list_ai_in_range_worm > 0) then {
- _hide_me = false;
- _tgt_worm = _list_ai_in_range_worm call BIS_fnc_selectRandom;
- _dir_move = [getPos _cap,_tgt_worm] call BIS_fnc_dirTo;
- _dir_move = _dir_move+45;
- if (_dir_move<=90) then {
- _press_implicit_x = linearConversion [0, 90,_dir_move, 0, 1, true];
- _press_implicit_y = 1-_press_implicit_x;
- };
- if ((_dir_move>90)and(_dir_move<180)) then {
- _dir_move = _dir_move-90;
- _press_implicit_x = linearConversion [0, 90,_dir_move, 1, 0, true];
- _press_implicit_y = _press_implicit_x-1;
- };
- if ((_dir_move>180)and(_dir_move<270)) then {
- _dir_move = _dir_move-180;
- _press_implicit_x = linearConversion [0, 90,_dir_move, 0, -1, true];
- _press_implicit_y = (-1*_press_implicit_x)-1;
- };
- if ((_dir_move>270)and(_dir_move<360)) then {
- _dir_move = _dir_move-270;
- _press_implicit_x = linearConversion [0, 90,_dir_move, -1, 0, true];
- _press_implicit_y = 1+_press_implicit_x;
- };
- [_cap,_coada,_coada_01] remoteExec["Worm_fnc_effect",0];
- [_cap,_coada] remoteExec ["Worm_fnc_attack",0];
- _cap setposATL [getPosATL _cap select 0,getPosATL _cap select 1,2];
- _cap setVelocity [_press_implicit_x*5,_press_implicit_y*5,20+random 10];
- sleep 1;
- };
- };
- sleep 1;
- enableCamShake false;
- waitUntil {(getPosATL _cap select 2) < 1};
- addCamShake [1,4,23];
- [_cap,_coada] remoteExec ["Worm_fnc_attack",0];
- [_cap] remoteExec ["Worm_fnc_bump",0];
- sleep 1;
- while {!isNull _cap} do
- {
- _tgt_worm = [];
- _list_ai_in_range_worm = (position _cap) nearEntities [["Man","LandVehicle"],150];
- _tgt_worm = _list_ai_in_range_worm call BIS_fnc_selectRandom;
- if (count _list_ai_in_range_worm > 0) then {
- if ((_tgt_worm distance _cap < 15)&&!(surfaceIsWater getPos _tgt_worm)) then
- {
- [_cap,_list_ai_in_range_worm] call fnc_avoid_worm;
- _dir_move = [getPos _cap,_tgt_worm] call BIS_fnc_dirTo;
- if (_dir_move<=90) then {
- _press_implicit_x = linearConversion [0, 90,_dir_move, 0, 1, true];
- _press_implicit_y = 1-_press_implicit_x;
- };
- if ((_dir_move>90)and(_dir_move<180)) then {
- _dir_move = _dir_move-90;
- _press_implicit_x = linearConversion [0, 90,_dir_move, 1, 0, true];
- _press_implicit_y = _press_implicit_x-1;
- };
- if ((_dir_move>180)and(_dir_move<270)) then {
- _dir_move = _dir_move-180;
- _press_implicit_x = linearConversion [0, 90,_dir_move, 0, -1, true];
- _press_implicit_y = (-1*_press_implicit_x)-1;
- };
- if ((_dir_move>270)and(_dir_move<360)) then {
- _dir_move = _dir_move-270;
- _press_implicit_x = linearConversion [0, 90,_dir_move, -1, 0, true];
- _press_implicit_y = 1+_press_implicit_x;
- };
- _cap setVelocity [_press_implicit_x*5,_press_implicit_y*5,15+random 10];
- sleep 0.5;
- waitUntil {(getPosATL _cap select 2) < 1};
- [_cap,_coada] remoteExec ["Worm_fnc_attack",0];
- _nearobj_wrom = nearestObjects [getposATL _cap, [], 20];
- { if ((_x!=_cap)&&(_x!=_coada)&&(_x!=_coada_01)&&!(surfaceIsWater getPos _x)) then {if (_x isKindOf "LandVehicle") then {_x setVelocity [1+random 3,1+random 3,5+random 17]; _x setDammage ((getDammage _x) + 0.5)} else {_x setVelocity [1+random 3,1+random 3,1+random 5]}; _x setDammage ((getDammage _x) + 0.5)};} foreach _nearobj_wrom;
- sleep 1;
- [_cap,_list_ai_in_range_worm] call fnc_avoid_worm;
- if (((getPosatl _cap select 2) <0)or((getPosatl _cap select 2) >2)) then {_cap setpos ([getpos _cap,0.5,50,10,0,1,0] call BIS_fnc_findSafePos)};
- sleep 8;
- _cap setposATL [getPosATL _cap select 0,getPosATL _cap select 1,2];
- };
- if ((!isNull _tgt_worm)&&(_tgt_worm distance _cap > 15)&&!(surfaceIsWater getPos _tgt_worm)) then
- {
- [_cap,_list_ai_in_range_worm] call fnc_avoid_worm;
- _fct_move = 8+random 8;
- _fct = [+10+random -35,10+random 45] call BIS_fnc_selectRandom;
- _dir_move = [getPos _cap,_tgt_worm] call BIS_fnc_dirTo;
- _dir_move = _dir_move+_fct;
- if (_dir_move<=90) then {
- _press_implicit_x = linearConversion [0, 90,_dir_move, 0, 1, true];
- _press_implicit_y = 1-_press_implicit_x;
- };
- if ((_dir_move>90)and(_dir_move<180)) then {
- _dir_move = _dir_move-90;
- _press_implicit_x = linearConversion [0, 90,_dir_move, 1, 0, true];
- _press_implicit_y = _press_implicit_x-1;
- };
- if ((_dir_move>180)and(_dir_move<270)) then {
- _dir_move = _dir_move-180;
- _press_implicit_x = linearConversion [0, 90,_dir_move, 0, -1, true];
- _press_implicit_y = (-1*_press_implicit_x)-1;
- };
- if ((_dir_move>270)and(_dir_move<360)) then {
- _dir_move = _dir_move-270;
- _press_implicit_x = linearConversion [0, 90,_dir_move, -1, 0, true];
- _press_implicit_y = 1+_press_implicit_x;
- };
- _cap setVelocity [_press_implicit_x*_fct_move,_press_implicit_y*_fct_move,5+random 5];
- sleep 2;
- _cap setposATL [getPosATL _cap select 0,getPosATL _cap select 1,2];
- };
- } else {sleep 10};
- };
- };
- };
- Worm_fnc_effect = {
- params["_i","_ii","_iii"];
- [_this select 0, _this select 1, _this select 2] spawn
- {
- if (!hasInterface) exitWith {};
- _head_worm = _this select 0;
- _tail_worm = _this select 1;
- _voce_idle = _this select 2;
- [_voce_idle, true] remoteExec ["hideObjectGlobal",0,true];
- while {!isnull _head_worm} do
- {
- comment "sunOrMoon==0";
- if (true) then
- {
- _smoke_head = "#particlesource" createVehicleLocal (getPosATL _head_worm);
- _smoke_head setParticleCircle [0, [0, 0, 0]];
- _smoke_head setParticleRandom [3, [0.25, 0.25, 0.25], [0.1, 0.1, 0.1], 5, 0.25, [0.1, 0.1, 0.05, 0.1], 1, 0];
- _smoke_head setParticleParams [["\A3\data_f\cl_basic", 1, 0, 1], "", "Billboard", 1, 11, [0, 0, 0], [0, 0, 1], 7, 11, 7.9, 0.0001, [4, 3, 0.5], [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1]], [0.08], 1, 0, "", "", _head_worm,0,true,0.1,[[0,0,0,0]]];
- _smoke_head setDropInterval 0.01;
- _spot_lit = "#lightpoint" createVehicle (getPosATL _head_worm);
- _spot_lit lightAttachObject [_head_worm, [0.1,0.1,5]];
- _spot_lit setLightUseFlare false;
- _spot_lit setLightDayLight true;
- _spot_lit setLightFlareSize 1;
- _spot_lit setLightFlareMaxDistance 1500;
- _spot_lit setLightAttenuation [0,0,50,1000,1,50];
- while {player distance _head_worm <2000} do
- {
- _r_col_burp=random 1;
- _g_col_burp=random 1;
- _b_col_burp=random 1;
- _spot_lit setLightColor [_r_col_burp,_g_col_burp,_b_col_burp];
- _spot_lit setLightAmbient [_g_col_burp,_r_col_burp,_b_col_burp];
- _flick = 1+floor (random 9);
- _fl_inc = 0;
- while {_fl_inc<_flick} do
- {
- _spot_lit setLightBrightness (10+random 30);
- _fl_inc = _fl_inc+1;
- sleep 0.1+random 0.2;
- };
- _spot_lit setLightBrightness 0;
- sleep 3+ (random 10);
- };
- deleteVehicle _smoke_head;
- deleteVehicle _spot_lit;
- } else {
- _smoke_head = "#particlesource" createVehicleLocal (getPosATL _head_worm);
- _smoke_head setParticleCircle [0, [0, 0, 0]];
- _smoke_head setParticleRandom [3, [0.25, 0.25, 0.25], [0.1, 0.1, 0.1], 5, 0.25, [0.1, 0.1, 0.05, 0.1], 1, 0];
- _smoke_head setParticleParams [["\A3\data_f\cl_basic", 1, 0, 1], "", "Billboard", 1, 11, [0, 0, 0], [0, 0, 1], 7, 11, 7.9, 0.0001, [4, 3, 0.5], [[0, 0, 0, 1], [0, 0, 0, 1], [0, 0, 0, 1]], [0.08], 1, 0, "", "", _head_worm,0,true,0.1,[[0,0,0,0]]];
- _smoke_head setDropInterval 0.01;
- while {player distance _head_worm <2000} do {sleep 30};
- deleteVehicle _smoke_head;
- };
- waitUntil {player distance _head_worm <2000};
- };
- };
- };
- Worm_fnc_attack = {
- params ["_i","_ii"];
- [_this select 0,_this select 1] spawn
- {
- private ["_crater_impact"];
- if (!hasInterface) exitWith {};
- _head_worm = _this select 0;
- _tail_worm = _this select 1;
- enableCamShake true;
- comment "Add Impact Sound Below HERE";
- _blast_dust = "#particlesource" createVehicleLocal (getPosATL _head_worm);
- _blast_dust setParticleCircle [6, [-3, -3, 0]];
- _blast_dust setParticleRandom [2, [2, 2, 0], [-15, -15, 0], 5, 1, [0, 0, 0, 1], 1, 0];
- _blast_dust setParticleParams [["\A3\data_f\cl_basic", 1, 0, 1], "", "Billboard", 1, 7, [0, 0, 0], [0, 0, 0.1], 7, 10, 7.9, 0.005, [5, 7, 13], [[0.3, 0.27, 0.15, 1], [0.3, 0.27, 0.15, 0.5], [0.3, 0.27, 0.15, 0]], [0.08], 1, 0, "", "", _head_worm];
- _blast_dust setDropInterval 0.002;
- _dist_worm = player distance _head_worm;
- _shake_power = linearConversion [0, 1000,_dist_worm, 5, 0, true];
- addCamShake [_shake_power,4,13+(random 33)];
- _bolovani_blast = "#particlesource" createVehicleLocal (getPosATL _head_worm);
- _bolovani_blast setParticleCircle [2, [0, 0, 0]];
- _bolovani_blast setParticleRandom [1, [0.25, 0.25, 0], [10, 10, 15], 0.5, 0.25, [0, 0, 0, 0.1], 0, 0];
- _bolovani_blast setParticleParams [["\A3\data_f\ParticleEffects\Universal\Mud.p3d", 1, 0, 1], "", "SpaceObject", 1, 10, [0, 0, 0], [0, 0, 13], 3, 20, 7.9, 0.0001, [.6, .6, .6], [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]], [0.08], 1, 0, "", "", _head_worm,0,true,0.3,[[0,0,0,0]]];
- _bolovani_blast setDropInterval 0.007;
- sleep 0.25;
- deletevehicle _bolovani_blast;
- _crater_impact = createVehicle ["CraterLong",[getpos _head_worm select 0,getpos _head_worm select 1,0],[],0,"CAN_COLLIDE"];
- _crater_impact setDir (random 360);
- sleep 0.5;
- deletevehicle _blast_dust;
- if (player distance _head_worm < 1500) then {
- };
- sleep 300;
- deletevehicle _crater_impact;
- };
- };
- Worm_fnc_bump = {
- params["_i"];
- [_this select 0] spawn
- {
- if (!hasInterface) exitWith {};
- _head_worm = _this select 0;
- _blast_dust = "#particlesource" createVehicleLocal (getPosATL _head_worm);
- _blast_dust setParticleCircle [3, [-3, -3, 0]];
- _blast_dust setParticleRandom [2, [2, 2, 0], [-15, -15, 0], 5, 1, [0, 0, 0, 1], 1, 0];
- _blast_dust setParticleParams [["\A3\data_f\cl_basic", 1, 0, 1], "", "Billboard", 1, 3, [0, 0, 0], [0, 0, 0.1], 7, 10, 7.9, 0.005, [5, 7, 13], [[0.3, 0.27, 0.15, 1], [0.3, 0.27, 0.15, 0.5], [0.3, 0.27, 0.15, 0]], [0.08], 1, 0, "", "", _head_worm];
- _blast_dust setDropInterval 0.002;
- sleep 0.2;
- deleteVehicle _blast_dust;
- };
- };
- } remoteExec["BIS_fnc_call",0];
- onMapSingleClick
- {
- if(isNil "isWormActive") then {isWormActive = false;};
- if(!isWormActive) then
- {
- wormMarker = createMarkerLocal["worm_start",_pos];
- wormMarker setMarkerType "mil_dot";
- wormMarker setMarkerText "Worm Start";
- [wormMarker] remoteExec["Worm_fnc_mainFunction",0];
- playsound "hint";
- isWormActive = true;
- }
- else
- {
- deleteMarker wormMarker;
- isWormActive = false;
- onMapSingleClick{};
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement