diff --git a/mpmissions/Exile.Altis/ExAdClient/HaloParachute/CfgFunctions.cpp b/mpmissions/Exile.Altis/ExAdClient/HaloParachute/CfgFunctions.cpp new file mode 100644 index 0000000..67bc170 --- /dev/null +++ b/mpmissions/Exile.Altis/ExAdClient/HaloParachute/CfgFunctions.cpp @@ -0,0 +1,28 @@ +/* + CfgFunctions.cpp + + Copyright 2016 Jan Babor + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + + +class HaloParachute +{ + file = "ExHP\Functions"; + class ejectPlayer {}; + class pullParachute {}; + class showEject {}; + class showParachute {}; + class customize {file = "ExAd\HaloParachute\postInit.sqf"; postInit = 1;}; +}; \ No newline at end of file diff --git a/mpmissions/Exile.Altis/ExAdClient/HaloParachute/Functions/fn_ejectPlayer.sqf b/mpmissions/Exile.Altis/ExAdClient/HaloParachute/Functions/fn_ejectPlayer.sqf new file mode 100644 index 0000000..79760b1 --- /dev/null +++ b/mpmissions/Exile.Altis/ExAdClient/HaloParachute/Functions/fn_ejectPlayer.sqf @@ -0,0 +1,35 @@ +/* + fn_ejectPayer.sqf + + Copyright 2016 Jan Babor + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +private ["_vehicleObj", "_push", "_vecDir"]; + +_vehicleObj = vehicle player; +if (_vehicleObj == player) exitWith {false}; + +moveOut player; + +_push = if (_vehicleObj isKindOf "Plane") then { + player setDir getDir _vehicleObj; + ((vectorUp _vehicleObj) vectorMultiply 40) +} else { + _vecDir = (getPosASL player) vectorDiff (getPosASL _vehicleObj); + (_vecDir vectorMultiply (5 / vectorMagnitude _vecDir)) +}; + +player setVelocity ((velocity player) vectorAdd _push); + +true \ No newline at end of file diff --git a/mpmissions/Exile.Altis/ExAdClient/HaloParachute/Functions/fn_pullParachute.sqf b/mpmissions/Exile.Altis/ExAdClient/HaloParachute/Functions/fn_pullParachute.sqf new file mode 100644 index 0000000..6a3c3b4 --- /dev/null +++ b/mpmissions/Exile.Altis/ExAdClient/HaloParachute/Functions/fn_pullParachute.sqf @@ -0,0 +1,36 @@ +/* + fn_pullParachute.sqf + + Copyright 2016 Jan Babor + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +private ["_parachuteObject"]; + +waitUntil {sleep 0.1; {player distance _x < 10 max (sizeOf typeOf _x)} count (player nearEntities ["Helicopter_Base_F", 20]) == 0}; + +if (!alive player || vehicle player != player) exitWith {}; + +_parachuteObject = createVehicle ["Steerable_Parachute_F", getPosATL player, [], 0, "CAN_COLLIDE"]; +_parachuteObject setDir getDir player; + +_parachuteObject disableCollisionWith player; + +player action ["GetinDriver", _parachuteObject]; +player switchmove ""; +player switchmove "HaloFreeFall_non"; +player setVelocity [(sin (getDir player)) * 50, (cos (getDir player)) * 50, -5]; +ExileJobParachuteFix = [0.25, ExileClient_object_player_parachuteFix, [], true] call ExileClient_system_thread_addtask; + +true \ No newline at end of file diff --git a/mpmissions/Exile.Altis/ExAdClient/HaloParachute/Functions/fn_showEject.sqf b/mpmissions/Exile.Altis/ExAdClient/HaloParachute/Functions/fn_showEject.sqf new file mode 100644 index 0000000..a7a03b7 --- /dev/null +++ b/mpmissions/Exile.Altis/ExAdClient/HaloParachute/Functions/fn_showEject.sqf @@ -0,0 +1,27 @@ +/* + fn_showEject.sqf + + Copyright 2016 Jan Babor + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +if(vehicle player == player)exitWith{false}; + +_condition = false; + +if((getPos player) select 2 > ExAd_ACTION_EJECT_HEIGHT)then{ + _role = assignedVehicleRole player; + _condition = if(count _role > 0)then{if(_role select 0 == "cargo")then{false}else{true}}else{true} +}; + +_condition \ No newline at end of file diff --git a/mpmissions/Exile.Altis/ExAdClient/HaloParachute/Functions/fn_showParachute.sqf b/mpmissions/Exile.Altis/ExAdClient/HaloParachute/Functions/fn_showParachute.sqf new file mode 100644 index 0000000..815e0b2 --- /dev/null +++ b/mpmissions/Exile.Altis/ExAdClient/HaloParachute/Functions/fn_showParachute.sqf @@ -0,0 +1,34 @@ +/* + fn_showParachute.sqf + + Copyright 2016 Jan Babor + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +if(vehicle player != player)exitWith{false}; + +_condition = false; + +if((getPos player) select 2 > ExAd_ACTION_PARACHUTE_HEIGHT)then{ + _states = [ + "ladderriflestatic", + "ladderrifledownloop", + "ladderrifleuploop", + "laddercivilstatic", + "laddercivildownloop", + "ladderciviluploop" + ]; + _condition = !((animationState player) in _states); +}; + +_condition \ No newline at end of file diff --git a/mpmissions/Exile.Altis/ExAdClient/HaloParachute/customize.sqf b/mpmissions/Exile.Altis/ExAdClient/HaloParachute/customize.sqf new file mode 100644 index 0000000..164410b --- /dev/null +++ b/mpmissions/Exile.Altis/ExAdClient/HaloParachute/customize.sqf @@ -0,0 +1,22 @@ +/* + customize.sqf + + Copyright 2016 Jan Babor + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +ExAd_ACTION_PARACHUTE_HEIGHT = 10; +ExAd_ACTION_EJECT_HEIGHT = 100; + \ No newline at end of file diff --git a/mpmissions/Exile.Altis/ExAdClient/HaloParachute/postInit.sqf b/mpmissions/Exile.Altis/ExAdClient/HaloParachute/postInit.sqf new file mode 100644 index 0000000..134151d --- /dev/null +++ b/mpmissions/Exile.Altis/ExAdClient/HaloParachute/postInit.sqf @@ -0,0 +1,37 @@ +/* + postInit.sqf + + Copyright 2016 Jan Babor + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +*/ + +execVM "ExAdClient\HaloParachute\customize.sqf"; + +[] spawn { + while {true} do { + waitUntil{!isNil "ExileClientLoadedIn"}; + UISleep 0.1; + waitUntil{ExileClientLoadedIn}; + UISleep 0.1; + waitUntil{alive player}; + + ExAd_ACTION_PARACHUTE = player addaction [" Open Parachute!", "call ExAd_fnc_pullParachute", [], 6, true, true, "", "call ExAd_fnc_showParachute"]; + ExAd_ACTION_EJECT = player addaction [" Halo Jump", "call ExAd_fnc_ejectPlayer", [], 6, false, true, "", "call ExAd_fnc_showEject;"]; + + waitUntil{!alive player}; + player removeAction ExAd_ACTION_PARACHUTE; + player removeAction ExAd_ACTION_EJECT; + } +}; \ No newline at end of file