Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // @file Version: 1.0
- // @file Name: mission_Outpost.sqf
- // @file Author: [404] Deadbeat, [404] Costlyy
- // @file Created: 08/12/2012 03:25
- // @file Args:
- #include "setup.sqf"
- #include "mainMissionDefines.sqf";
- if(!isServer) exitwith {};
- private ["_obj", "_rep1", "_rep2", "_rep3", "_rep4", "_result","_missionMarkerName","_missionType","_startTime","_returnData","_randomPos","_randomIndex","_badWeather", "_origFog", "_origRain", "_origOvercast", "_hint","_currTime","_playerPresent","_unitsAlive"];
- //Mission Initialization.
- _result = 0;
- _missionMarkerName = "MadScience_Marker";
- _missionType = "Defeat Mad Scientist";
- #ifdef __A2NET__
- _startTime = floor(netTime);
- #else
- _startTime = floor(time);
- #endif
- //Get Mission Location
- _returnData = call createMissionLocation;
- _randomPos = _returnData select 0;
- _randomIndex = _returnData select 1;
- diag_log format["WASTELAND SERVER - Main Mission Waiting to run: %1",_missionType];
- [mainMissionDelayTime] call createWaitCondition;
- diag_log format["WASTELAND SERVER - Main Mission Resumed: %1",_missionType];
- [_missionMarkerName,_randomPos,_missionType] call createClientMarker;
- _hint = parseText format ["<t align='center' color='%2' shadow='2' size='1.75'>Main Objective</t><br/><t align='center' color='%2'>------------------------------</t><br/><t align='center' color='%3' size='1.25'>%1</t><br/><t align='center' color='%3'>Recent weather trends may be artificially created! Investigate!</t>", _missionType, mainMissionColor, subTextColor];
- [nil,nil,rHINT,_hint] call RE;
- _origFog = fog;
- _origOvercast = overcast;
- _origRain = rain;
- _obj = createVehicle ["Satelit",_randomPos,[], 0,"None"];
- _obj setVariable ["faction", "WORLD", true];
- _rep1 = createVehicle ["Suitcase", [_randomPos select 0, (_randomPos select 1) + 5],[], 0,"None"];
- _rep1 setVariable ["faction", "WORLD", true];
- rep2 = createVehicle ["Suitcase", [(_randomPos select 0) +5, _randomPos select 1],[], 0,"None"];
- _rep2 setVariable ["faction", "WORLD", true];
- rep3 = createVehicle ["Suitcase", [(_randomPos select 0) -5, _randomPos select 1],[], 0,"None"];
- _rep3 setVariable ["faction", "WORLD", true];
- rep4 = createVehicle ["Suitcase", [_randomPos select 0, (_randomPos select 1) -5],[], 0,"None"];
- _rep4 setVariable ["faction", "WORLD", true];
- _obj setVehicleInit "0 setOverCast .95; 0 setFog .95; 0 setRain .95;";
- processInitCommands;
- CivGrpM = createGroup civilian;
- [CivGrpM,_randomPos] spawn createScienceGroup;
- diag_log format["WASTELAND SERVER - Main Mission Waiting to be Finished: %1",_missionType];
- #ifdef __A2NET__
- _startTime = floor(netTime);
- #else
- _startTime = floor(time);
- #endif
- waitUntil
- {
- sleep 1;
- _playerPresent = false;
- #ifdef __A2NET__
- _currTime = floor(netTime);
- #else
- _currTime = floor(time);
- #endif
- if(_currTime - _startTime >= mainMissionTimeout) then {_result = 1;};
- _unitsAlive = ({alive _x} count units CivGrpM);
- (_result == 1) OR (_unitsAlive < 1)
- };
- if(_result == 1) then
- {
- //Mission Failed.
- {deleteVehicle _x;}forEach units CivGrpM;
- deleteGroup CivGrpM;
- deleteVehicle _obj;
- _rep1 setVehicleInit "0 setOverCast .5; 0 setFog .15; 0 setRain 0;";
- processInitCommands;
- deleteVehicle _rep1;
- deleteVehicle _rep2;
- deleteVehicle _rep3;
- deleteVehicle _rep4;
- _hint = parseText format ["<t align='center' color='%3' shadow='2' size='1.75'>Objective Failed</t><br/><t align='center' color='%3'>------------------------------</t><br/><t align='center' color='%4' size='1.25'>%1</t><br/><t align='center' color='%4'>Objective failed, better luck next time</t>", _missionType, _vehicleName, failMissionColor, subTextColor];
- [nil,nil,rHINT,_hint] call RE;
- diag_log format["WASTELAND SERVER - Main Mission Failed: %1",_missionType];
- } else {
- //Mission Complete.
- deleteGroup CivGrpM;
- _rep1 setVehicleInit "0 setOverCast .15; 0 setFog .15; 0 setRain 0;";
- processInitCommands;
- _hint = parseText format ["<t align='center' color='%3' shadow='2' size='1.75'>Objective Complete</t><br/><t align='center' color='%3'>------------------------------</t><br/><t align='center' color='%4' size='1.25'>%1</t><br/><t align='center' color='%4'>The mad scientist has been stopped. Enjoy the weather!</t>", _missionType, _vehicleName, successMissionColor, subTextColor];
- [nil,nil,rHINT,_hint] call RE;
- diag_log format["WASTELAND SERVER - Main Mission Success: %1",_missionType];
- };
- //Reset Mission Spot.
- MissionSpawnMarkers select _randomIndex set[1, false];
- [_missionMarkerName] call deleteClientMarker;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement