Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQF 3.57 KB | None | 0 0
  1. span class="re5"> GeneratePos = {
  2.     _center = [7100, 7750, 0];
  3.     _mapRadii = 6250;
  4.     _pos = [_center,0,_mapRadii,20,0,20,0] call BIS_fnc_findSafePos;
  5.     _pos
  6. };
  7.  
  8.  
  9. Make_Em_Spin = {
  10.     private ["_group","_position","_xpos","_ypos","_quad1","_quad2","_quad3","_quad4","_wp1","_wp2","_wp3","_wp4","_center","_radius"];
  11.     _group = _this select 0;
  12.     _position = _this select 1;
  13.  
  14.     _xpos = _position select 0;
  15.     _ypos = _position select 1;
  16.    
  17.     _radius = 50;
  18.  
  19.     _quad1 = [_xpos, _ypos+20, 0];
  20.     _quad2 = [_xpos+20, _ypos, 0];
  21.     _quad3 = [_xpos, _ypos-20, 0];
  22.     _quad4 = [_xpos-20, _ypos, 0];
  23.  
  24.     _wp1 = _group addWaypoint [_quad1, _radius];
  25.     _wp1 setWaypointType "MOVE";
  26.     _wp2 = _group addWaypoint [_quad2, _radius];
  27.     _wp2 setWaypointType "MOVE";
  28.     _wp3 = _group addWaypoint [_quad3, _radius];
  29.     _wp3 setWaypointType "MOVE";
  30.     _wp4 = _group addWaypoint [_quad4, _radius];
  31.     _wp4 setWaypointType "MOVE";
  32.  
  33.     _center = _group addWaypoint [[_xpos,_ypos, 0], _radius];
  34.     _center setWaypointType "CYCLE";
  35. };
  36.  
  37. Spawn_Rabbits = {
  38.     private ["_this","_rabbitcount","_group","_rabbit"];
  39.     _group = createGroup West;
  40.    
  41.     _rabbitcount = 5;
  42.    
  43.     for "_x" from 1 to _rabbitcount do {
  44.         _rabbit = _group createUnit ["Rabbit", _this, [], 1, "FORM"];
  45.        
  46.         [_group,_this] call Make_Em_Spin;
  47.        
  48.         [_rabbit] joinSilent UnitGroup;
  49.        
  50.         MyRabbits = MyRabbits + [_rabbit];
  51.        
  52.         _rabbit addEventHandler ["Killed",{ [(_this select 0), (_this select 1)] call Rabbit_Death; }];
  53.     };
  54.  
  55.     _hint = parseText format["<t align='center' color='#00FFF5' shadow='2' size='1.75'>Combat Wolf</t><br/><t align='center' color='#ffffff'>Bugs Bunny Isn't going to be happy, Check map for details!</t>"];
  56.     customRemoteMessage = ['hint', _hint];
  57.     publicVariable "customRemoteMessage";
  58. };
  59.  
  60. Rabbit_Death = {
  61.     private ["_rabbit","_player"];
  62.     _rabbit = _this select 0;
  63.     _player = _this select 1;
  64.    
  65.     MyRabbits = MyRabbits - [_rabbit];
  66.    
  67.     systemChat format ["%1",(count MyRabbits)];
  68. };
  69.  
  70. Clear_Marker =  {
  71.     private ["_markername","_dotname","_pos"];
  72.     _markername = _this select 0;
  73.     _dotname    = _this select 1;
  74.     _pos        = _this select 2;
  75.    
  76.     waitUntil {
  77.         sleep 1;
  78.         (count MyRabbits <= 1);
  79.     };
  80.    
  81.     deleteMarker _markername;
  82.     deleteMarker _dotname;
  83.    
  84.     [nil,nil,rTitleText,"Bugs Bunny Isn't going to be happy, Check map for details!", "PLAIN",10] call RE;
  85.    
  86.     _hint = parseText format["<t align='center' color='#00FFF5' shadow='2' size='1.75'>Combat Wolf</t><br/><t align='center' color='#ffffff'>All the rabbits have migrated.</t>"];
  87.     customRemoteMessage = ['hint', _hint];
  88.     publicVariable "customRemoteMessage";
  89.    
  90.     EPOCH_EVENT_RUNNING = false;
  91. };
  92.  
  93. Rabbit_Mission = {
  94.  
  95.     if (isNil "EPOCH_EVENT_RUNNING") then {
  96.         EPOCH_EVENT_RUNNING = false;
  97.     };
  98.      
  99.     if (EPOCH_EVENT_RUNNING) exitWith {
  100.         diag_log("Event already running");
  101.     };
  102.    
  103.     EPOCH_EVENT_RUNNING = true;
  104.  
  105.     private ["_pos","_rabbit_pos","_name","_nul"];
  106.    
  107.     MyRabbits = [];
  108.    
  109.     _pos = [] call GeneratePos;
  110.     createVehicle ["Land_Misc_deerstand", _pos, [], 0, "CAN_COLLIDE"];
  111.    
  112.     for "_i" from 1 to 2 do {
  113.         _rabbit_pos = [_pos,0,50,10,0,2000,0] call BIS_fnc_findSafePos;
  114.         _rabbit_pos call Spawn_Rabbits;
  115.     };
  116.  
  117.     _name = "RabbitHole_" + str(random(round(500)));
  118.     _nul = createMarker [_name, _pos];
  119.     _name setMarkerColor "ColorYellow";
  120.     _name setMarkerShape "ELLIPSE";
  121.     _name setMarkerSize [350,350];
  122.  
  123.     _dotname = "RabbitHoleDot_" + str(random(round(500)));
  124.     _nil = createMarker [_dotname, _pos];
  125.     _dotname setMarkerColor "ColorBlack";
  126.     _dotname setMarkerType "Vehicle";
  127.     _dotname setMarkerText "Rabbit Breeding Hole";
  128.  
  129.     [_name,_dotname,_pos] spawn Clear_Marker;
  130.  
  131. };
  132.  
  133.  
  134. [] call Rabbit_Mission;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement