Advertisement
DeTrix

Bank of Panthera

Apr 14th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.18 KB | None | 0 0
  1. /*
  2. File Name: FMission_M1_bank.sqf
  3. File Created: 3/28/2014
  4. File Version: 1.0
  5. File Author: Detour
  6. File Last Edit Date: 3/28/2014
  7. File Description: Panthera Bank (M1)
  8. Template by: Foamy
  9. */
  10.  
  11. // CHECK FOR ANOTHER MISSION 3 RUNNING START ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  12.  
  13. if (isNil "EPOCH_MISSION3_RUNNING") then
  14. {
  15. EPOCH_MISSION3_RUNNING = false;
  16. };
  17.  
  18. if (EPOCH_MISSION3_RUNNING) exitWith
  19. {
  20. diag_log("MISSION 3 already running");
  21. };
  22.  
  23. // CHECK FOR ANOTHER MISSION 3 RUNNING END ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  24.  
  25. // Don't forget to add all your "_names" to the private section
  26. private ["_missionSpawnChance","_spawnMarker","_spawnRadius","_markerRadius","_markerColor","_item","_loot","_loot_lists","_loot_box","_wait_time","_spawnRoll","_position","_loot_pos","_loot_box","_textMarker_IconType","_markerText","_markerBrush","_base","_aiunit_spawn_pos","_aivehicle_spawn_pos","_aiheli_spawn_pos","_aiunit1","_aiunit2","_aiunit3","_aiunit4","_aiunit5","_aiunit6","_aiunit7","_attackgroup","_attacker1","_attacker2","_targetunitsAlive","_timeout"];
  27.  
  28. diag_log("MISSION 3: Bank of panthera - Script Started");
  29.  
  30. _missionSpawnChance = .8; //Set Spawn Chance Here 1 = always
  31. _spawnRoll = random 1;
  32.  
  33. diag_log("MISSION 3: Bank of panthera - Checking MissionSpawnChance");
  34. if (_spawnRoll > _missionSpawnChance) exitWith
  35. {
  36. diag_log format ["MISSION 3: Bank of panthera - Failed with %1 it needed to be lower than %2",_spawnRoll,_missionSpawnChance];
  37. };
  38.  
  39. sleep .5;
  40. diag_log("MISSION 3: Bank of panthera - Mission SpawnChance Success");
  41.  
  42. sleep .5;
  43. diag_log("MISSION 3: Bank of panthera - Mission Script Started");
  44.  
  45. EPOCH_MISSION3_RUNNING = true;
  46.  
  47. /*
  48. // Edit Loot Box Contents Below
  49. // Format is:
  50. // 1st row = Weapons, Tools ( Compass, etc)
  51. // 2nd row = Ammo, Food items etc
  52. // 3rd row = Backpacks
  53.  
  54. The loot example in this template has 2 loadouts to choose from, you can add as many as you want. The more you add the more
  55. variety you will have.
  56. Each addition will use a block like this:
  57. [
  58. ["DMR","NVGoggles","Binocular_Vector"],
  59. ["20Rnd_762x51_DMR","20Rnd_762x51_DMR","20Rnd_762x51_DMR","ItemSodaMdew","ItemSodaR4z0r","ItemAntibiotic"],
  60. ["DZ_Backpack_EP1"]
  61. ], <---- The , is NOT needed on last loot block, see example below where the , is only used to separate the
  62. first block from the second block. There is no , at the end of the second block as it is the last block in
  63. the list.
  64. */
  65.  
  66. //---------------------------------------------------------------------------------
  67.  
  68. // Loot Box Setup
  69. _loot_box = "RUSpecialWeaponsBox";
  70. _loot_lists = [
  71.  
  72. [
  73. ["M4A1_AIM_SD_CAMO","ItemGPS","Binocular","glock17_EP1"],
  74. ["30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","30Rnd_556x45_StanagSD","17Rnd_9x19_glock17","17Rnd_9x19_glock17","ItemBriefcase100oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemGoldBar10oz","ItemMorphine"],
  75. ["DZ_British_ACU"]
  76. ]
  77. ];
  78.  
  79. //---------------------------------------------------------------------------------
  80.  
  81. _loot = _loot_lists call BIS_fnc_selectRandom;
  82.  
  83. // Mission Variables
  84. mission_despawn_timer = 1200; // This sets the Timeout if a timer is used.
  85. _wait_time = 900; // This is how long the loot box will stay once it spawns.
  86. _spawnRadius = 3000; // This is the distance from Center - Used to determine the radius in which missions will spawn
  87. _spawnMarker = 'center'; // DO NOT Change this, UNLESS you need a hard coded center loc for custom purposes
  88. _markerRadius = 350; // This sets marker radius and the area the loot can spawn in
  89. _markerColor = "ColorBlue"; // This sets the Marker Color
  90. _textMarker_IconType = "mil_objective"; // This sets the "Icon Type" (https://community.bi...wiki/cfgMarkers)
  91. _markerText = "Mission: Bank of panthera"; // Text to display at Marker (Leave "" blank if you dont want a message)
  92. _markerBrush = "SOLID"; // Marker Brush - How the marker is filled in
  93.  
  94.  
  95. // This sets the global position coords the mission needs to run, do not change.
  96. _position = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,20,0] call BIS_fnc_findSafePos;
  97. _loot_pos = [_position,0,(_markerRadius - 100),10,0,20,0] call BIS_fnc_findSafePos;
  98.  
  99. // Use these if using AI, Vehicles or Helis
  100. _aiunit_spawn_pos = [_loot_pos, 30, 50, 30, 0, 20, 0] call BIS_fnc_findSafePos;
  101. _aivehicle_spawn_pos = [_loot_pos, 30, 50, 30, 0, 20, 0] call BIS_fnc_findSafePos;
  102. _aiheli_spawn_pos = [_loot_pos, 30, 50, 30, 0, 20, 0] call BIS_fnc_findSafePos;
  103.  
  104. //---------------------------------------------------------------------------------
  105. // Mission Body STARTS Here
  106. // Read General Script Instructions for Variable Usage per script.
  107.  
  108. // Add a Marker? Make sure to use FMarker3.sqf for M3 Missions
  109. [_position,_loot_pos,_markerRadius,_markerColor,false,_textMarker_IconType,_markerText,_markerBrush] execVM "\z\addons\dayz_server\addons\FMission\FMarker\FMarker3.sqf";
  110.  
  111. // Add a base?
  112. _base = createVehicle ["USMC_WarfareBLightFactory",_loot_pos,[], 0, "CAN_COLLIDE"];
  113. _base setPos _loot_pos;
  114.  
  115. // Add some AI to patrol?
  116. sleep 1;
  117.  
  118. diag_log("MISSION 3: Bank of panthera - Loading -=FAI Units=- Started");
  119.  
  120. _aiunit1 = [_aiunit_spawn_pos,50,4,"Bandit",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";
  121.  
  122. _aiunit2 = [_aiunit_spawn_pos,50,4,"Bandit",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";
  123.  
  124. _aiunit3 = [_aiunit_spawn_pos,50,4,"Sniper",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";
  125.  
  126. _aiunit4 = [_aiunit_spawn_pos,50,4,"Medic",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";
  127.  
  128. _aiunit5 = [_aiunit_spawn_pos,50,4,"Sniper",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";
  129.  
  130. _aiunit6 = [_aiunit_spawn_pos,50,4,"Bandit",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";
  131.  
  132. _aiunit7 = [_aiunit_spawn_pos,50,4,"Bandit",_loot_pos,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Unit.sqf";
  133.  
  134. sleep 10;
  135. diag_log("MISSION 3: Bank of panthera - Loading -=FAI=- Completed");
  136.  
  137. sleep .5;
  138.  
  139. // Add a one off custom AI?
  140. _attackgroup = createGroup east;
  141.  
  142. _attacker1 = _attackgroup createUnit ["TK_INS_Soldier_3_EP1", _base, [], 0, "Form"];
  143. _attacker1 setUnitPos "AUTO";
  144. [_attacker1] execVM "\z\addons\dayz_server\addons\FMission\FLoot\FLoot_Bandit.sqf";
  145. _attacker1 setUnitPos "Middle";
  146.  
  147. _attacker2 = _attackgroup createUnit ["TK_Soldier_Medic_EP1", _base, [], 0, "Form"];
  148. _attacker2 setUnitPos "AUTO";
  149. _null = [_attacker2] execVM "\z\addons\dayz_server\addons\FMission\FLoot\FLoot_Medic.sqf";
  150. _attacker2 setUnitPos "Middle";
  151.  
  152. _attackgroup setCombatMode "RED";
  153. _attackgroup setBehaviour "STEALTH";
  154.  
  155.  
  156. // Add a Heli Patrol?
  157. _aiHeli = [_aiheli_spawn_pos,_loot_pos,250,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI_Create_Heli.sqf";
  158.  
  159. // Add a Vehicle patrols?
  160. _aiVehicle = [_aivehicle_spawn_pos,_loot_pos,100,"M1"] execVM "\z\addons\dayz_server\addons\FMission\FAI\FAI_Create_Vehicle.sqf";
  161.  
  162.  
  163. [nil,nil,rTitleText,"MISSION: Bank of Panthera - A local bank truck is getting service and bandits have over run it. Hurry there now to secure the location!", "PLAIN",10] call RE;
  164.  
  165. diag_log("MISSION 3: Bank of panthera - Waiting...");
  166. _timeout = time + mission_despawn_timer;
  167. waitUntil
  168. {
  169. _targetunitsAlive = {alive _x} count (units _attackgroup);
  170. ((time > _timeout) || (_targetunitsAlive < 1))
  171. };
  172.  
  173. _targetunitsAlive = {alive _x} count (units _attackgroup);
  174. if (_targetunitsAlive < 1) then
  175. {
  176. [nil,nil,rTitleText,"MISSION: Survivors have captured the Bank of panthera cargo and eliminated the Bandits, Good Job.", "PLAIN",10] call RE;
  177.  
  178.  
  179. // Create a loot box?
  180. // Create loot box
  181. diag_log("MISSION 3: Bank of panthera - Creating loot box");
  182. _loot_box = createVehicle [_loot_box,_loot_pos,[], 0, "NONE"];
  183. _loot_box setPos _loot_pos;
  184. clearMagazineCargoGlobal _loot_box;
  185. clearWeaponCargoGlobal _loot_box;
  186. clearBackpackCargoGlobal _loot_box;
  187.  
  188. // Add loot
  189. diag_log("MISSION 3: Bank of panthera - Loot box created, adding loot to loot box");
  190. {
  191. _loot_box addWeaponCargoGlobal [_x,1];
  192. } forEach (_loot select 0);
  193. {
  194. _loot_box addMagazineCargoGlobal [_x,1];
  195. } forEach (_loot select 1);
  196. {
  197. _loot_box addBackpackCargoGlobal [_x,1];
  198. } forEach (_loot select 2);
  199.  
  200. // Wait for awhile so loot can be collected?
  201. sleep _wait_time;
  202.  
  203.  
  204. // Mission Body ENDS here
  205. // ---------------------------------------------------------------------------------
  206.  
  207.  
  208. // Add additional deleteVehicle _xxx; for each item that needs to be deleted.
  209. // Add additional deleteVehicle _xxgroup; to delete the AI units
  210. // Clean up
  211. EPOCH_MISSION3_RUNNING = false;
  212.  
  213. deleteVehicle _base;
  214. deleteVehicle _loot_box;
  215. { deleteVehicle _x } forEach units _targetgroup;
  216. deleteGroup _targetgroup;
  217. { deleteVehicle _x } forEach units _attackgroup;
  218. deleteGroup _attackgroup;
  219.  
  220. diag_log("MISSION 3: Bank of panthera - Script Finished");
  221. }
  222. else
  223. {
  224. [nil,nil,rTitleText,"MISSION: Bank of Panthera Failed", "PLAIN",10] call RE;
  225.  
  226. // Clean up
  227. EPOCH_MISSION3_RUNNING = false;
  228.  
  229. deleteVehicle _base;
  230. { deleteVehicle _x } forEach units _attackgroup;
  231. deleteGroup _attackgroup;
  232.  
  233. diag_log("MISSION 3: Bank of panthera - Script Finished");
  234. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement