Advertisement
Guest User

Untitled

a guest
Mar 17th, 2015
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. if(isServer) then {
  2.  
  3. private ["_complete","_crate","_mission","_static_gun","_crate_type","_rndnum","_playerPresent","_vehname","_vehicle","_position","_vehclass"];
  4.  
  5. // Get mission number, important we do this early
  6. _mission = count wai_mission_data -1;
  7.  
  8. //Armed Land Vehicle
  9. _vehclass = armed_vehicle call BIS_fnc_selectRandom;
  10. _vehname = getText (configFile >> "CfgVehicles" >> _vehclass >> "displayName");
  11.  
  12. _position = [30] call find_position;
  13. [_mission,_position,"Medium",format["Disabled %1",_vehname],"MainHero",true] call mission_init;
  14.  
  15. diag_log format["WAI: [Mission:[Hero] Armed Vehicle]: Starting... %1",_position];
  16.  
  17. //Setup the crate
  18. _crate_type = crates_small call BIS_fnc_selectRandom;
  19. _crate = createVehicle [_crate_type,[(_position select 0),(_position select 1) + 5,0], [], 0, "CAN_COLLIDE"];
  20.  
  21. //Troops
  22. _rndnum = (2 + round (random 4));
  23. [[_position select 0,_position select 1,0],_rndnum,"Medium",["Random","AT"],3,"Random","Bandit","Random","Bandit",_mission] call spawn_group;
  24. [[_position select 0,_position select 1,0],_rndnum,"Medium","Random",3,"Random","Bandit","Random","Bandit",_mission] call spawn_group;
  25. [[_position select 0,_position select 1,0],_rndnum,"Medium","Random",3,"Random","Bandit","Random","Bandit",_mission] call spawn_group;
  26.  
  27. //Static Guns
  28. _static_gun = ai_static_weapons call BIS_fnc_selectRandom;
  29. [[
  30. [(_position select 0),(_position select 1) + 10, 0]
  31. ],_static_gun,"Medium","Bandit","Bandit",0,2,"Random","Random",_mission] call spawn_static;
  32.  
  33. //Spawn Vehicle
  34. _vehicle = [_vehclass,_position,_mission] call custom_publish;
  35.  
  36. if(debug_mode) then {
  37. diag_log format["WAI: [Hero] armed_vehicle spawned a %1",_vehname];
  38. };
  39.  
  40. //Condition
  41. _complete = [
  42. [_mission,_crate], // mission number and crate
  43. ["crate"], // ["crate"], or ["kill"], or ["assassinate", _unitGroup],
  44. [_vehicle], // cleanup objects
  45. "Bandits have disabled an armed vehicle with lots of chain gun ammo in the gear! Check your map for the location!", // mission announcement
  46. "Survivors have secured the armed vehicle!", // mission success
  47. "Survivors did not secure the armed vehicle in time" // mission fail
  48. ] call mission_winorfail;
  49.  
  50. if(_complete) then {
  51. [_crate,0,0,[25,crate_items_chainbullets],2] call dynamic_crate;
  52. };
  53.  
  54. diag_log format["WAI: [Bandit] armed_vehicle ended at %1",_position];
  55.  
  56. h_missionsrunning = h_missionsrunning - 1;
  57. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement