Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ******************************************************************************************
- // * This project is licensed under the GNU Affero GPL v3. Copyright © 2014 A3Wasteland.com *
- // ******************************************************************************************
- // @file Name: mission_RussianRoulette.sqf
- // @file Author: JoSchaap, AgentRev, GriffinZS, RickB, soulkobk
- if (!isServer) exitwith {};
- #include "specialMissionDefines.sqf";
- private ["_positions", "_camonet", "_hostage", "_hostage", "_vehicleName", "_cashrandomizera", "_cashamountrandomizera", "_cashpilerandomizera", "_casha", "_cashamounta", "_cashpilea", "_cashrandomizerb", "_cashamountrandomizerb", "_cashpilerandomizerb", "_cashb", "_cashamountb", "_cashpileb", "_cash1", "_cash2", "_drop_item", "_drugpilerandomizer", "_drugpile"];
- _setupVars =
- {
- _missionType = "Russian Roulette";
- _locationsArray = MissionSpawnMarkers;
- };
- _setupObjects =
- {
- _missionPos = markerPos _missionLocation;
- //delete existing base parts and vehicles at location
- _baseToDelete = nearestObjects [_missionPos, ["All"], 25];
- { deleteVehicle _x } forEach _baseToDelete;
- _camonet = createVehicle ["Land_Shed_03_F", [_missionPos select 0, _missionPos select 1], [], 0, "CAN COLLIDE"];
- _camonet allowdamage false;
- _camonet setDir random 360;
- _camonet setVariable ["R3F_LOG_disabled", false];
- _missionPos = getPosATL _camonet;
- _hostage = createVehicle ["C_man_1_1_F", _missionPos, [], 0, "CAN COLLIDE"];
- removeAllWeapons _hostage;
- removeAllAssignedItems _hostage;
- removeBackpack _hostage;
- removeVest _hostage;
- removeUniform _hostage;
- _hostage addHeadgear "H_RacingHelmet_1_black_F";
- _hostage setPosATL [_missionPos select 0, _missionPos select 1, _missionPos select 2];
- waitUntil {alive _hostage};
- [_hostage, "UnaErcPoslechVelitele1"] call switchMoveGlobal;
- _hostage disableAI "autoTarget";
- _hostage disableAI "ANIM";
- _hostage setBehaviour "Careless";
- _hostage allowFleeing 0;
- _hostage disableAI "Move";
- _hostage2 = createVehicle ["C_man_1_1_F", _missionPos, [], 0, "CAN COLLIDE"];
- removeAllWeapons _hostage2;
- removeAllAssignedItems _hostage2;
- removeBackpack _hostage2;
- removeVest _hostage2;
- removeUniform _hostage2;
- _hostage2 addHeadgear "H_RacingHelmet_1_black_F";
- _hostage2 setPosATL [_missionPos select 0, _missionPos select 1, _missionPos select 2];
- waitUntil {not alive _hostage2 };
- [_hostage2, "UnaErcPoslechVelitele1"] call switchMoveGlobal;
- _hostage2 disableAI "autoTarget";
- _hostage2 disableAI "ANIM";
- _hostage2 setBehaviour "Careless";
- _hostage2 allowFleeing 0;
- _hostage2 disableAI "Move";
- _hostage2 addRating 1e11;
- _hostage2 addEventHandler ["Killed", server_playerDied];
- _aiGroup = createGroup CIVILIAN;
- [_aiGroup,_missionPos,2,5] spawn createcustomGroup;
- _aiGroup setCombatMode "RED";
- _aiGroup setBehaviour "COMBAT";
- _vehicleName = "Hostage";
- _missionHintText = format ["<br/>Ever wanted to play <t color='%2'>God</t>?<br/>Here is your opportunity. Kill the guards and then choose, which hostage you <t color='%2'>eliminate</t>.<br/>Choose wisely.", _vehicleName, specialMissionColor];
- };
- _waitUntilMarkerPos = nil;
- _waitUntilExec = nil;
- _waitUntilCondition = {!alive _hostage};
- _failedExec =
- {
- // Mission failed
- { deleteVehicle _x } forEach [_camonet, _hostage, _hostage2];
- };
- _successExec =
- {
- // Mission completed
- { deleteVehicle _x } forEach [_camonet, _hostage, _hostage2];
- //Random fake - real money
- _cashrandomizera = ["money","cmoney","money","cmoney"];
- _cashamountrandomizera = [200,300,400,500,600,700];
- _cashpilerandomizera = [3,5];
- _casha = _cashrandomizera call BIS_fnc_SelectRandom;
- _cashamounta = _cashamountrandomizera call BIS_fnc_SelectRandom;
- _cashpilea = _cashpilerandomizera call BIS_fnc_SelectRandom;
- for "_i" from 1 to _cashpilea do
- {
- _cash1 = createVehicle ["Land_Money_F",[(_lastPos select 0), (_lastPos select 1) - 5,0],[], 0, "NONE"];
- _cash1 setPos ([_lastPos, [[2 + random 3,0,0], random 360] call BIS_fnc_rotateVector2D] call BIS_fnc_vectorAdd);
- _cash1 setDir random 360;
- _cash1 setVariable [_casha, _cashamounta, true];
- _cash1 setVariable ["owner", "world", true];
- };
- _cashrandomizerb = ["money","cmoney","money","cmoney"];
- _cashamountrandomizerb = [200,300,400,500,600,700];
- _cashpilerandomizerb = [3,5];
- _cashb = _cashrandomizerb call BIS_fnc_SelectRandom;
- _cashamountb = _cashamountrandomizerb call BIS_fnc_SelectRandom;
- _cashpileb = _cashpilerandomizerb call BIS_fnc_SelectRandom;
- for "_i" from 1 to _cashpileb do
- {
- _cash2 = createVehicle ["Land_Money_F",[(_lastPos select 0), (_lastPos select 1) - 5,0],[], 0, "NONE"];
- _cash2 setPos ([_lastPos, [[2 + random 3,0,0], random 360] call BIS_fnc_rotateVector2D] call BIS_fnc_vectorAdd);
- _cash2 setDir random 360;
- _cash2 setVariable [_cashb, _cashamountb, true];
- _cash2 setVariable ["owner", "world", true];
- };
- _successHintMessage = format ["How does it feel? You eliminate the correct one .."];
- };
- _this call specialMissionProcessor;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement