Commit ac82b299 authored by Mark Broome's avatar Mark Broome

begin make 1-4 uber

parent d3a8689d
_pelican = _this select 0;
_veh = _this select 1;
_loaded = false;
switch true do {
case (_veh isKindOf "OPTRE_M808B_base"):
{
_veh attachTo [_pelican,[0,-7.2, -0.4]];
_veh setDir 180;
_loaded = true;
};
case (_veh isKindOf "OPTRE_M12A1_LRV" or _veh isKindOf "OPTRE_M12_LRV" or _veh isKindOf "OPTRE_M12G1_LRV" or _veh isKindOf "OPTRE_M12R_AA" or _veh isKindOf "OPTRE_M12_FAV_APC" or _veh isKindOf "OPTRE_M12_FAV"):
{
_veh attachTo [_pelican,[0.15,-5,.44]];
_loaded = true;
};
case (_veh isKindOf "OPTRE_M813_TT"):
{
_veh attachTo [_pelican,[0,-5,.25]];
_loaded = true;
};
case (_veh isKindOf "OPTRE_M413_base"):
{
_veh attachTo [_pelican,[0,-3.6,0.30]];
_loaded = true;
};
case (_veh isKindOf "OPTRE_EscapePod"):
{
_veh attachTo [_pelican,[0,-6,-.80]];
_loaded = true;
};
case (_veh isKindOf "VES_IFV76_A"):
{
_veh attachTo [_pelican,[0,-4.6,.30]];
_loaded = true;
};
case (_veh isKindOf "Truck_03_base_F"):
{
_veh attachTo [_pelican,[0,-5,-.4]];
_loaded = true;
};
case (_veh isKindOf "B_Boat_Armed_01_minigun_F"):
{
_veh attachTo [_pelican,[0,-6.5, -0.37105]];
_veh setDir 180;
_loaded = true;
};
case (_veh isKindOf "B_Boat_Transport_01_F"):
{
_veh attachTo [_pelican,[0,-5,.40]];
_loaded = true;
};
case (_veh isKindOf "optre_hornet_base"):
{
_veh attachTo [_pelican,[0,-5,-0.8]];
_loaded = true;
};
};
if (_loaded) then
{
_pelican setVariable ["OPTRE_Pelican_AttachedToVehiclesEffect", [vehicle player], true];
titleText ["-------------------------------------------<br/><t color='#ff0000' size='1.5'>MAGLOCK SUCCESSFUL!</t><br/>-------------------------------------------<br/>", "PLAIN DOWN", -1, true, true];
playSound "FD_Finish_F";
_pelican addEventHandler ["Killed",
{
params ["_unit", "_killer", "_instigator", "_useEffects"];
{
if !(_x isKindof "OPTRE_Static_M247H_Shielded_Tripod") then {detach _x;};
} forEach attachedObjects _unit;
}];
} else {
titleText ["-------------------------------------------<br/><t color='#ff0000' size='1.5'>CARGO UNSUPPORTED!</t><br/>-------------------------------------------<br/>Your vehicle has not been design to be mag lifted by the pelican.", "PLAIN DOWN", -1, true, true];
//hint "Your vehicle has not been designed to be lifted via maglock. Operation aborted.";
playSound "FD_CP_Not_Clear_F";
};
\ No newline at end of file
_vehicles = ((_this select 0) getVariable ["OPTRE_Pelican_AttachedToVehiclesEffect",[]]);
if (
(
{
(_x isKindOf "OPTRE_M808B_base") OR
(_x isKindOf "OPTRE_M12A1_LRV") OR
(_x isKindOf "OPTRE_M12_LRV") OR
(_x isKindOf "OPTRE_M12G1_LRV") OR
(_x isKindOf "OPTRE_M12R_AA") OR
(_x isKindOf "OPTRE_M12_FAV_APC") OR
(_x isKindOf "OPTRE_M12_FAV") OR
(_x isKindOf "OPTRE_M813_TT") OR
(_x isKindOf "OPTRE_M413_base") OR
(_x isKindOf "OPTRE_EscapePod") OR
(_x isKindOf "VES_IFV76_A") OR
(_x isKindOf "Truck_03_base_F") OR
(_x isKindOf "B_Boat_Armed_01_minigun_F") OR
(_x isKindOf "B_Boat_Transport_01_F") OR
(_x isKindOf "Land_Device_slingloadable_F")
} count _vehicles > 0
)
) then {
if ((((getPos (_this select 0)) select 2) < 2) and ((_this animationPhase "frontgear") == 1) and ({(_x isKindOf "OPTRE_M808B_base") OR (_x isKindOf "optre_hornet_base")} count _vehicles > 0)) then {
titleText ["-------------------------------------------<br/><t color='#ff0000' size='1.5'>RELEASE FAILED!</t><br/>-------------------------------------------<br/>Your landing gears must be raised to unload larger vehicles!", "PLAIN DOWN", -1, true, true];
playSound "FD_CP_Not_Clear_F";
} else {
(_this select 0) allowDamage false;
(_this select 0) setVariable ["OPTRE_Pelican_AttachedToVehiclesEffect", [], true];
if ((((getPosATL (_this select 0)) select 2) >= 200) and !({(_x isKindOf "optre_hornet_base") OR (_x isKindOf "OPTRE_EscapePod") OR (_x isKindOf "Land_Device_slingloadable_F")} count _vehicles > 0)) then
{
titleText ["-------------------------------------------<br/><t color='#ff0000' size='1.5'>MAGLIFT AIRDROPPED!</t><br/>-------------------------------------------", "PLAIN DOWN", -1, true, true];
playSound "FD_Finish_F";
{
if ({(_x isKindOf "OPTRE_M808B_base") OR (_x isKindOf "optre_hornet_base")} count _vehicles > 0) then {player action ["LandGearUp", (_this select 0)]; Sleep 2;};
detach _x;
_vel = velocity (_this select 0);
_x setVelocity [(_vel select 0) / 2, (_vel select 1) / 2, (_vel select 2) -25];
_x allowDamage false;
sleep .2;
waitUntil {((position _x) select 2) <= 185};
_para = createVehicle ["B_Parachute_02_F", position _x, [], 0, "CAN_COLLIDE"];
_velx = velocity _x;
_para setVelocity [(_velx select 0), (_velx select 1), (_velx select 2)];
_para setDir (direction _x);
_x attachTo [_para, [0,0,1]];
sleep 2;
_smoke = createVehicle ["SmokeShellRed", position _x, [], 0, "CAN_COLLIDE"];
_smoke attachTo [_x, [0,0,0]];
if ((daytime > 17.5) OR (daytime < 7)) then {_flare = createVehicle ["F_20mm_Red", position _smoke, [], 0, "CAN_COLLIDE"]; _flare attachTo [_smoke, [0,0,0]];};
sleep 1;
waitUntil {(((position _x) select 2) < 8) AND (((position _x) select 2) > 4)};
detach _x;
waitUntil {(((position _smoke) select 2) < 2) AND (((position _smoke) select 2) > 1)};
detach _smoke;
} forEach _vehicles;
} else {
titleText ["-------------------------------------------<br/><t color='#ff0000' size='1.5'>MAGLIFT RELEASED!</t><br/>-------------------------------------------", "PLAIN DOWN", -1, true, true];
playSound "FD_Finish_F";
{
if (_x isKindOf "Land_Device_slingloadable_F") then {_x setVectorUp [0,0,1]};
detach _x;
_vel = velocity (_this select 0);
_x setVelocity [(_vel select 0) / 1.5, (_vel select 1) / 1.5, (_vel select 2) / 1.5];
_x allowDamage false;
} forEach _vehicles;
};
sleep 0.5;
{
_x allowDamage true;
} forEach _vehicles;
(_this select 0) allowDamage true;
};
} else {
0 = (_this select 0) spawn OPTRE_fnc_PelicanLoad_UnloadAllSupplyPods;
};
\ No newline at end of file
......@@ -28,4 +28,18 @@ class cfgPatches
"OPTRE_Modules"
};
};
};
\ No newline at end of file
};
class CfgFunctions
{
class V_FZ
{
class PelicanMagLiftSystem
{
file = "first_meu_aux\Functions";
class PelicanLoadValidate{};
class PelicanUnLoadValidate{};
class SlipspaceRuptureDetected{};
};
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment