Mofasa

Blackfish

Jul 21st, 2016
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.10 KB | None | 0 0
  1. ///////////////////////////////////////////////////
  2.  
  3. if (_obj_type in IL_Supported_Vehicles_BLACKFISH) then
  4. {
  5. if ((isNil {_obj getVariable "box_num"}) || (_force)) then {_obj setVariable["box_num", 0, true];};
  6. if ((isNil {_obj getVariable "slots_num"}) || (_force)) then {_obj setVariable["slots_num", IL_Num_Slots_BLACKFISH, true];};
  7. if ((isNil {_obj getVariable "can_load"}) || (_force)) then {_obj setVariable["can_load", true, true];};
  8. if ((isNil {_obj getVariable "can_copilot"}) || (_force)) then {_obj setVariable["can_copilot", IL_Can_CoPilot, true];};
  9. if ((isNil {_obj getVariable "can_outside"}) || (_force)) then {_obj setVariable["can_outside", IL_Can_Outside, true];};
  10. if ((isNil {_obj getVariable "zload"}) || (_force)) then {_obj setVariable["zload", -5.75, true];};
  11. if ((isNil {_obj getVariable "load_offset"}) || (_force)) then {_obj setVariable["load_offset", 7.5, true];};
  12. if ((isNil {_obj getVariable "usable_ramp"}) || (_force)) then {_obj setVariable["usable_ramp", IL_Ramp, true];};
  13. };
  14.  
  15. //////////////////////////////////////////////////
  16.  
  17. if ((_obj_type in IL_Supported_Vehicles_BLACKFISH) && (_doors == "B")) then
  18. {
  19. _sdist = IL_SDistL + IL_SDistL_Heli_offset;
  20. _spoint = _v modelToWorld [0,-9,-5.4];
  21. _box_num = _v getVariable "box_num";
  22. _slot_num = _v getVariable "slots_num";
  23. };
  24.  
  25. ////////////////////////////////////////////////////
  26.  
  27. if ((_obj_type in IL_Supported_Vehicles_BLACKFISH) && (_doors == "B")) then
  28. {
  29. [_v, _x, [_x_cargo_offset,-9,-0.93 + _zload], [_x_cargo_offset,-8,-0.93 + _zload], 1, _turn] call IL_Move_Attach;
  30. [_v, _x, [_x_cargo_offset,-7,-0.93 + _zload], [_x_cargo_offset,-3.5,_zload], 1, _turn] call IL_Move_Attach;
  31. [_v, _x, [_x_cargo_offset,-2.5,_zload], [_x_cargo_offset,_counter + 17 - _cargo_offset,_zload], 1, _turn] call IL_Move_Attach;
  32. };
  33.  
  34. /////////////////////////////////////////////////////
  35.  
  36. if ((_obj_type in IL_Supported_Vehicles_BLACKFISH) && (_doors == "B")) then
  37. {
  38. if !(_para) then
  39. {
  40. [_v, _x, [_x_cargo_offset,_counter + 9 - _cargo_offset,_zload], [_x_cargo_offset,-12.5,_zload], 1, _turn] call IL_Move_Attach;
  41. };
  42. [_v, _x, [_x_cargo_offset,-4.5,_zload], [_x_cargo_offset,-7,-0.75 + _zload], 1, _turn] call IL_Move_Attach;
  43. [_v, _x, [_x_cargo_offset,-4.5,-0.75 + _zload], [_x_cargo_offset,-12.5,-0.75 + _zload], 1, _turn] call IL_Move_Attach;
  44. if ((_para) && (_obj_type in IL_Para_Drop_Vehicles)) then
  45. {
  46. _last_attach_pos = [_x_cargo_offset,-10,-0.75 + _zload];
  47. };
  48. };
  49.  
  50. //////////////////////////////////////////////////////
  51.  
  52. if ((typeOf _v) in IL_Supported_Vehicles_BLACKFISH) then
  53. {
  54. _dist_out = 14;
  55. _dist_out_para = 17;
  56. };
  57.  
  58. /////////////////////////////////////////////////////
  59.  
  60. if (_obj_main_type in IL_Supported_Vehicles_BLACKFISH) then
  61. {
  62.  
  63. _vsupported = true;
  64. [_obj_main] call IL_Init_Veh;
  65.  
  66. _obj_main addAction [
  67. "<img image='IgiLoad\images\load.paa' /><t color=""#007f0e"">Load cargo on Blackfish</t>",
  68. {
  69. [_this select 0, IL_Supported_Cargo_NonVeh_BLACKFISH] call IL_Do_Load;
  70. },[],IL_Action_LU_Priority,true,true,"",
  71. "(count(nearestObjects[ _target modelToWorld [0,-9,-5.4], IL_Supported_Cargo_NonVeh_BLACKFISH, IL_SDistL + IL_SDistL_Heli_offset]) > 0) && (abs(speed _target) <= IL_LU_Speed) && ((IL_Can_Inside && (driver _target == _this)) || (IL_Can_Inside && ('Turret' in (assignedVehicleRole _this)) && (vehicle _this == _target) && (_target getVariable 'can_copilot')) || ((_this in (nearestObjects[ _target modelToWorld [0,-6,-3], [], IL_SDistL + IL_SDistL_Heli_offset])) && (_target getVariable 'can_outside'))) && (_target getVariable 'box_num' > _target getVariable 'slots_num') && (_target getVariable 'can_load') && (((getPos _target) select 2) <= IL_LU_Alt) && (_target doorPhase 'Door_1_source' == 1)"
  72. ];
  73.  
  74. _obj_main addAction [
  75. "<img image='IgiLoad\images\load.paa' /><t color=""#007f0e"">Load vehicle on Blackfish</t>",
  76. {
  77. [_this select 0, IL_Supported_Cargo_Veh_BLACKFISH] call IL_Do_Load;
  78. },[],IL_Action_LU_Priority,true,true,"",
  79. "(count(nearestObjects[ _target modelToWorld [0,-9,-5.4], IL_Supported_Cargo_Veh_BLACKFISH, IL_SDistL + IL_SDistL_Heli_offset]) > 0) && (abs(speed _target) <= IL_LU_Speed) && ((IL_Can_Inside && (driver _target == _this)) || (IL_Can_Inside && ('Turret' in (assignedVehicleRole _this)) && (vehicle _this == _target) && (_target getVariable 'can_copilot')) || ((_this in (nearestObjects[ _target modelToWorld [0,-6,-3], [], IL_SDistL + IL_SDistL_Heli_offset])) && (_target getVariable 'can_outside'))) && (_target getVariable 'box_num' > _target getVariable 'slots_num') && (_target getVariable 'can_load') && (((getPos _target) select 2) <= IL_LU_Alt) && (_target doorPhase 'Door_1_source' == 1)"
  80. ];
  81.  
  82. _obj_main addAction [
  83. "<t color=""#007f0e"">Get in Blackfish</t>",
  84. {
  85. (_this select 1) moveInCargo (_this select 0);
  86. },[],IL_Action_LU_Priority,false,true,"",
  87. "(_this in (nearestObjects[ _target modelToWorld [0,-9,-5.4], [], IL_SDistL + IL_SDistL_Heli_offset])) && ((_target emptyPositions 'cargo') > 0) && (abs(speed _target) <= IL_LU_Speed) && (((getPos _target) select 2) <= IL_LU_Alt) && (_target doorPhase 'Door_1_source' > 0.43) && (_target getVariable 'usable_ramp')"
  88. ];
  89.  
  90. _obj_main addAction [
  91. "<t color=""#ff0000"">Get out Blackfish</t>",
  92. {
  93. [_this select 0, _this select 1, false] call IL_GetOut;
  94. },[],IL_Action_LU_Priority,false,true,"",
  95. "('cargo' in (assignedVehicleRole _this)) && (vehicle _this == _target) && (abs(speed _target) <= IL_LU_Speed) && (((getPos _target) select 2) <= IL_LU_Alt) && (_target doorPhase 'Door_1_source' > 0.43) && (_target getVariable 'usable_ramp')"
  96. ];
  97.  
  98. _obj_main addAction [
  99. "<img image='IgiLoad\images\unload_para.paa' /><t color=""#b200ff"">Eject</t>",
  100. {
  101. [_this select 0, _this select 1, true] call IL_GetOut;
  102. },[],IL_Action_LU_Priority,false,true,"",
  103. "('cargo' in (assignedVehicleRole _this)) && (vehicle _this == _target) && (((getPosATL _target) select 2) >= IL_Para_Jump_ATL) && (_target doorPhase 'Door_1_source' > 0.43) && (_target getVariable 'usable_ramp')"
  104. ];
  105.  
  106. _obj_main addAction [
  107. "<img image='IgiLoad\images\unload.paa' /><t color=""#ff0000"">Unload cargo from Blackfish</t>",
  108. {
  109. [_this select 0] call IL_Do_Unload;
  110. },[],IL_Action_LU_Priority,false,true,"",
  111. "(_target getVariable 'box_num' < 0) && ((IL_Can_Inside && (driver _target == _this)) || (IL_Can_Inside && ('Turret' in (assignedVehicleRole _this)) && (vehicle _this == _target) && (_target getVariable 'can_copilot')) || ((_this in (nearestObjects[ _target modelToWorld [0,-9,-5.4], [], IL_SDistL + IL_SDistL_Heli_offset])) && (_target getVariable 'can_outside'))) && (_target getVariable 'can_load') && (abs(speed _target) <= IL_LU_Speed) && (((getPos _target) select 2) <= IL_LU_Alt) && (_target doorPhase 'Door_1_source' == 1)"
  112. ];
  113.  
  114. _obj_main addAction [
  115. "<img image='IgiLoad\images\unload_para.paa' /><t color=""#b200ff"">Unload cargo with parachute</t>",
  116. {
  117. [_this select 0, true] call IL_Do_Unload;
  118. },[],IL_Action_LU_Priority,false,true,"",
  119. "(_target getVariable 'box_num' < 0) && ((driver _target == _this) || (('Turret' in (assignedVehicleRole _this)) && (vehicle _this == _target) && (_target getVariable 'can_copilot'))) && (_target getVariable 'can_load') && (((getPosATL _target) select 2) >= IL_Para_Drop_ATL) && (_target doorPhase 'Door_1_source' == 1)"
  120. ];
  121.  
  122. _obj_main addAction [
  123. "<img image='IgiLoad\images\unload_all_para.paa' /><t color=""#a50b00"">Unload ALL cargo with parachute</t>",
  124. {
  125. while {((_this select 0) getVariable "box_num") != 0} do
  126. {
  127. [_this select 0, true] call IL_Do_Unload;
  128. };
  129. },[],IL_Action_LU_Priority,false,true,"",
  130. "(_target getVariable 'box_num' < 0) && ((driver _target == _this) || (('Turret' in (assignedVehicleRole _this)) && (vehicle _this == _target) && (_target getVariable 'can_copilot'))) && (_target getVariable 'can_load') && (((getPosATL _target) select 2) >= IL_Para_Drop_ATL) && (_target doorPhase 'Door_1_source' == 1)"
  131. ];
  132.  
  133. _obj_main addAction [
  134. "<t color=""#0000ff"">Open cargo ramp in Blackfish</t>",
  135. {
  136. _this select 0 animatedoor ['Door_1_source', 1];
  137. },[],IL_Action_O_Priority,false,true,"",
  138. "((driver _target == _this) || (('Turret' in (assignedVehicleRole _this)) && (vehicle _this == _target) && (_target getVariable 'can_copilot')) || ((_this in (nearestObjects[ _target modelToWorld [0,-9,-5.4], [], IL_SDistL + IL_SDistL_Heli_offset])) && (_target getVariable 'can_outside'))) && (_target doorPhase 'Door_1_source' == 0) && (_target getVariable 'can_load')"
  139. ];
  140.  
  141. _obj_main addAction [
  142. "<t color=""#0000ff"">Close cargo ramp in Blackfish</t>",
  143. {
  144. _this select 0 animatedoor ['Door_1_source', 0];
  145. },[],IL_Action_O_Priority,false,true,"",
  146. "((driver _target == _this) || (('Turret' in (assignedVehicleRole _this)) && (vehicle _this == _target) && (_target getVariable 'can_copilot')) || ((_this in (nearestObjects[ _target modelToWorld [0,-9,-5.4], [], IL_SDistL + IL_SDistL_Heli_offset])) && (_target getVariable 'can_outside'))) && (_target doorPhase 'Door_1_source' == 1) && (_target getVariable 'can_load')"
  147. ];
  148.  
  149. _obj_main addAction [
  150. "<t color=""#0000ff"">Enable loading for Co-Pilot</t>",
  151. {
  152. (_this select 0) setVariable["can_copilot", true, true];;
  153. },[],IL_Action_S_Priority,false,true,"",
  154. "((driver _target == _this) && !(_target getVariable 'can_copilot') && IL_Can_CoPilot)"
  155. ];
  156.  
  157. _obj_main addAction [
  158. "<t color=""#0000ff"">Disable loading for Co-Pilot</t>",
  159. {
  160. (_this select 0) setVariable["can_copilot", false, true];;
  161. },[],IL_Action_S_Priority,false,true,"",
  162. "((driver _target == _this) && (_target getVariable 'can_copilot') && IL_Can_CoPilot)"
  163. ];
  164.  
  165. _obj_main addAction [
  166. "<t color=""#0000ff"">Enable loading from outside</t>",
  167. {
  168. (_this select 0) setVariable["can_outside", true, true];;
  169. },[],IL_Action_S_Priority,false,true,"",
  170. "(((driver _target == _this) || (('Turret' in (assignedVehicleRole _this)) && (vehicle _this == _target) && (_target getVariable 'can_copilot'))) && !(_target getVariable 'can_outside') && IL_Can_Outside)"
  171. ];
  172.  
  173. _obj_main addAction [
  174. "<t color=""#0000ff"">Disable loading from outside</t>",
  175. {
  176. (_this select 0) setVariable["can_outside", false, true];;
  177. },[],IL_Action_S_Priority,false,true,"",
  178. "(((driver _target == _this) || (('Turret' in (assignedVehicleRole _this)) && (vehicle _this == _target) && (_target getVariable 'can_copilot'))) && (_target getVariable 'can_outside') && IL_Can_Outside)"
  179. ];
  180.  
  181. _obj_main addAction [
  182. "<t color=""#0000ff"">Enable usable ramp</t>",
  183. {
  184. (_this select 0) setVariable["usable_ramp", true, true];;
  185. },[],IL_Action_S_Priority,false,true,"",
  186. "(((driver _target == _this) || (('Turret' in (assignedVehicleRole _this)) && (vehicle _this == _target) && (_target getVariable 'can_copilot'))) && !(_target getVariable 'usable_ramp') && IL_Ramp)"
  187. ];
  188.  
  189. _obj_main addAction [
  190. "<t color=""#0000ff"">Disable usable ramp</t>",
  191. {
  192. (_this select 0) setVariable["usable_ramp", false, true];;
  193. },[],IL_Action_S_Priority,false,true,"",
  194. "(((driver _target == _this) || (('Turret' in (assignedVehicleRole _this)) && (vehicle _this == _target) && (_target getVariable 'can_copilot'))) && (_target getVariable 'usable_ramp') && IL_Ramp)"
  195. ];
  196. };
Advertisement
Add Comment
Please, Sign In to add comment