Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 KB | None | 0 0
  1. if(isServer) then {
  2.  
  3. private ["_room","_complete","_mayor_himself","_crate_type","_mission","_position","_crate","_baserunover","_mayor"];
  4.  
  5. _positionarray = [[856.919,9370.11,0.001],[3468.97,9430.79,0.001],[4721.69,1951.64,0.001],[8586.69,7174.76,0.001],[869.732,5158.03,0.001]];
  6. _position = _positionarray call BIS_fnc_selectRandom;
  7.  
  8. // Get mission number, important we do this early
  9. _mission = count wai_mission_data -1;
  10.  
  11. _position = [40] call find_position;
  12. [_mission,_position,"Hard","Mayors Mansion","MainHero",true] call mission_init;
  13.  
  14. diag_log format["WAI: [Mission:[Hero] Mayors Mansion]: Starting... %1",_position];
  15.  
  16. //Setup the crate
  17. _crate_type = crates_large call BIS_fnc_selectRandom;
  18. _crate = createVehicle ["BAF_VehicleBox",[(_position select 0),(_position select 1),0], [], 0, "CAN_COLLIDE"];
  19.  
  20. //Mayors Mansion
  21. _baserunover = createVehicle ["Land_A_Villa_EP1",[(_position select 0), (_position select 1),0],[], 0, "CAN_COLLIDE"];
  22. _baserunover setVectorUp surfaceNormal position _baserunover;
  23.  
  24. //Troops
  25. [[_position select 0,_position select 1,0],4,"Hard",["Random","AT"],4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;
  26. [[_position select 0,_position select 1,0],4,"Hard","Random",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;
  27. [[_position select 0,_position select 1,0],4,"Hard","Random",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;
  28. [[_position select 0,_position select 1,0],4,"Hard","Random",4,"Random","Bandit","Random","Bandit",_mission] call spawn_group;
  29.  
  30. //The Mayor Himself
  31. _mayor = [_position,1,"Hard","Random",4,"Random","Special","Random",["Bandit",500],_mission] call spawn_group;
  32. _mayor_himself = (units _mayor) select 0;
  33.  
  34. //Put the Mayor in his room
  35. _room = (6 + ceil(random(3)));
  36. _mayor_himself disableAI "MOVE";
  37. _mayor_himself setPos (_baserunover buildingPos _room);
  38.  
  39. //Let him move once player is near
  40. _mayor_himself spawn {
  41. private ["_mayor","_player_near"];
  42. _mayor = _this;
  43. _player_near = false;
  44. waitUntil {
  45. {
  46. if (isPlayer _x && (_x distance (position _mayor) < 20)) then { _player_near = true; };
  47. } count playableUnits;
  48. sleep .1;
  49. (_player_near)
  50. };
  51. _mayor enableAI "MOVE";
  52. };
  53.  
  54. //Static mounted guns
  55. [[
  56. [(_position select 0) - 15, (_position select 1) + 15, 8],
  57. [(_position select 0) + 15, (_position select 1) - 15, 8]
  58. ],"M2StaticMG","Easy","Bandit","Bandit",1,2,"Random","Random",_mission] call spawn_static;
  59.  
  60. _complete = [
  61. [_mission,_crate], // mission number and crate
  62. ["assassinate",_mayor], // ["crate"], or ["kill"], or ["assassinate", _unitGroup],
  63. [_baserunover], // cleanup objects
  64. "The Mayor has gone rogue, go take him and his task force out to claim the black market weapons!", // mission announcement
  65. "The rogue mayor has been taken out, who will be the next Mayor of Cherno?", // mission success
  66. "Survivors were unable to capture the mansion, time is up" // mission fail
  67. ] call mission_winorfail;
  68.  
  69. if(_complete) then {
  70. [_crate,16,4,0,4] call dynamic_crate;
  71. };
  72.  
  73. diag_log format["WAI: [Mission:[Hero] Mayors Mansion]: Ended at %1",_position];
  74.  
  75. h_missionsrunning = h_missionsrunning - 1;
  76. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement