Advertisement
Guest User

Untitled

a guest
Dec 9th, 2013
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.97 KB | None | 0 0
  1. private ["_spawnChance", "_spawnMarker", "_spawnRadius", "_markerRadius", "_item", "_debug", "_start_time", "_loot", "_loot_amount", "_loot_box", "_wait_time", "_spawnRoll", "_position", "_event_marker", "_loot_pos", "_debug_marker","_loot_box", "_hint"];
  2.  
  3. _spawnChance = 0.75; // Percentage chance of event happening
  4. _markerRadius = 350; // Radius the loot can spawn and used for the marker
  5. _debug = false; // Puts a marker exactly were the loot spawns
  6.  
  7. _loot_box = "SpecialWeaponsBox";
  8. _loot_lists = [
  9. [
  10. ["M9SD"],
  11. ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemSodaCoke","ItemSodaCoke","ItemSodaCoke","ItemSodaCoke","ItemSodaPepsi","ItemSodaPepsi","ItemSodaPepsi","ItemSodaPepsi","FoodCanBakedBeans","FoodCanBakedBeans","FoodCanBakedBeans","FoodCanBakedBeans","FoodCanPasta","FoodCanPasta","FoodCanPasta","FoodCanPasta","FoodCanSardines","FoodCanSardines","FoodCanSardines","FoodCanSardines","FoodMRE","FoodMRE","FoodMRE","FoodMRE","FoodMRE"]
  12. ],
  13. [
  14. ["M9SD"],
  15. ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemSodaRbull","ItemSodaR4z0r","ItemSodaRbull","ItemSodaR4z0r","ItemSodaRbull","ItemSodaR4z0r","ItemSodaRbull","ItemSodaR4z0r","FoodbaconCooked","FoodchickenCooked","FoodbaconCooked","FoodchickenCooked","FoodbaconCooked","FoodchickenCooked","FoodbaconCooked","FoodchickenCooked","FoodbaconCooked","FoodchickenCooked","FoodbaconCooked","FoodchickenCooked","FoodbaconCooked","FoodchickenCooked"]
  16. ],
  17. [
  18. ["M9SD"],
  19. ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemSodaRbull"]
  20. ],
  21. [
  22. ["M9SD"],
  23. ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemSodaRbull"]
  24. ],
  25. [
  26. ["M9SD"],
  27. ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemSodaRbull"]
  28. ],
  29. [
  30. ["M9SD"],
  31. ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemSodaRbull"]
  32. ],
  33. [
  34. ["M9SD"],
  35. ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemSodaRbull"]
  36. ],
  37. [
  38. ["M9SD"],
  39. ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemSodaRbull"]
  40. ],
  41. [
  42. ["M9SD"],
  43. ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","Skin_Camo1_DZ","Skin_CZ_Soldier_Sniper_EP1_DZ","Skin_CZ_Special_Forces_GL_DES_EP1_DZ","Skin_Drake_Light_DZ","Skin_FR_OHara_DZ","Skin_FR_Rodriguez_DZ","Skin_Graves_Light_DZ","Skin_Sniper1_DZ","Skin_Soldier1_DZ","Skin_Soldier_Bodyguard_AA12_PMC_DZ"]
  44. ],
  45. [
  46. ["M9SD"],
  47. ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","Skin_Functionary1_EP1_DZ","Skin_Pilot_EP1_DZ","Skin_Priest_DZ","Skin_Rocker1_DZ","Skin_Rocker2_DZ","Skin_RU_Policeman_DZ","Skin_RU_Policeman_DZ","Skin_Pilot_EP1_DZ","Skin_Functionary1_EP1_DZ","Skin_Priest_DZ"]
  48. ],
  49. [
  50. ["M9SD"],
  51. ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","Skin_Bandit1_DZ","Skin_Bandit2_DZ","Skin_BanditW1_DZ","Skin_GUE_Commander_DZ","kin_GUE_Soldier_2_DZ","Skin_GUE_Soldier_Crew_DZ","Skin_GUE_Soldier_Sniper_DZ","Skin_Ins_Soldier_GL_DZ","Skin_TK_INS_Soldier_EP1_DZ","Skin_TK_INS_Warlord_EP1_DZ","Skin_GUE_Commander_DZ"]
  52. ],
  53. [
  54. ["M9SD"],
  55. ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemAntibiotic","ItemBandage","ItemBloodbag","ItemEpinephrine","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemBandage","ItemBandage","ItemMorphine","ItemAntibiotic","ItemBandage","ItemBloodbag","ItemEpinephrine","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemSodaCoke","ItemSodaCoke","ItemSodaCoke","ItemSodaPepsi","ItemSodaPepsi","ItemSodaPepsi","ItemSodaPepsi","FoodCanBakedBeans","FoodCanBakedBeans","FoodCanBakedBeans","FoodCanBakedBeans","FoodCanPasta","FoodCanPasta","FoodCanPasta","FoodCanPasta","FoodCanSardines","FoodCanSardines","FoodCanSardines","FoodCanSardines","FoodMRE","FoodMRE","FoodMRE","FoodMRE","FoodMRE","ItemBandage","ItemBandage","ItemMorphine","ItemAntibiotic","ItemBandage","ItemBloodbag","ItemEpinephrine","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemBandage","ItemBandage","ItemMorphine","ItemTent","ItemJerrycan","ItemTent","ItemJerrycan","ItemTent","ItemJerrycan"]
  56. ],
  57. [
  58. ["M9SD"],
  59. ["15Rnd_9x19_M9SD","15Rnd_9x19_M9SD","ItemAntibiotic","ItemBandage","ItemBloodbag","ItemEpinephrine","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemBandage","ItemBandage","ItemMorphine","ItemAntibiotic","ItemBandage","ItemBloodbag","ItemEpinephrine","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemBandage","ItemBandage","ItemMorphine","ItemAntibiotic","ItemBandage","ItemBloodbag","ItemEpinephrine","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemBandage","ItemBandage","ItemMorphine","ItemAntibiotic","ItemBandage","ItemBloodbag","ItemEpinephrine","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemBandage","ItemBandage","ItemMorphine","ItemAntibiotic","ItemBandage","ItemBloodbag","ItemEpinephrine","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemBandage","ItemBandage","ItemMorphine","ItemAntibiotic","ItemBandage","ItemBloodbag","ItemEpinephrine","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemBandage","ItemBandage","ItemMorphine","ItemAntibiotic","ItemBandage","ItemBloodbag","ItemEpinephrine","ItemMorphine","ItemPainkiller","ItemBloodbag","ItemBandage","ItemBandage","ItemMorphine"]
  60. ]
  61. ];
  62. _loot = _loot_lists call BIS_fnc_selectRandom;
  63.  
  64. _loot_amount = 75;
  65. _wait_time = 900;
  66.  
  67. // Dont mess with theses unless u know what yours doing
  68. _start_time = time;
  69. _spawnRadius = 5000;
  70. _spawnMarker = 'center';
  71.  
  72. if (isNil "EPOCH_EVENT_RUNNING_S") then {
  73. EPOCH_EVENT_RUNNING_S = false;
  74. };
  75.  
  76. // Check for another event running
  77. if (EPOCH_EVENT_RUNNING_S) exitWith {
  78. diag_log("Event already running");
  79. };
  80.  
  81. // Random chance of event happening
  82. _spawnRoll = random 1;
  83. if (_spawnRoll > _spawnChance and !_debug) exitWith {};
  84.  
  85. EPOCH_EVENT_RUNNING_S = true;
  86.  
  87. // Random location
  88. _position = [getMarkerPos _spawnMarker,0,_spawnRadius,10,0,2000,0] call BIS_fnc_findSafePos;
  89.  
  90. diag_log(format["Spawning loot event at %1", _position]);
  91.  
  92. _event_marker = createMarker [ format ["loot_event_marker_%1", _start_time], _position];
  93. _event_marker setMarkerShape "ELLIPSE";
  94. _event_marker setMarkerColor "ColorBlue";
  95. _event_marker setMarkerAlpha 0.5;
  96. _event_marker setMarkerSize [(_markerRadius + 50), (_markerRadius + 50)];
  97.  
  98. // Configurate Marker - Refresh Marker Script by *hs-s.com | waTTe - www.banditparty.de
  99. // _markerRadius = 100;
  100. // _markershape = "ELLIPSE";
  101. // _markercolor = "ColorBlue";
  102. // _missiontype = 3; //0=EPOCH_EVENT_RUNNING_S
  103. // _refreshmarker = [_location,_markerRadius,_markershape,_markercolor,_missiontype] execVM "\z\addons\dayz_server\modules\refreshmarker.sqf";
  104.  
  105. _loot_pos = [_position,0,(_markerRadius - 100),10,0,2000,0] call BIS_fnc_findSafePos;
  106.  
  107. if (_debug) then {
  108. _debug_marker = createMarker [ format ["loot_event_debug_marker_%1", _start_time], _loot_pos];
  109. _debug_marker setMarkerShape "ICON";
  110. _debug_marker setMarkerType "mil_dot";
  111. _debug_marker setMarkerColor "ColorBlue";
  112. _debug_marker setMarkerAlpha 1;
  113. };
  114.  
  115. diag_log(format["Creating ammo box at %1", _loot_pos]);
  116.  
  117. // Create ammo box
  118. _loot_box = createVehicle [_loot_box,_loot_pos,[], 0, "NONE"];
  119. clearMagazineCargoGlobal _loot_box;
  120. clearWeaponCargoGlobal _loot_box;
  121.  
  122. // Cut the grass around the loot position
  123. _clutter = createVehicle ["ClutterCutter_small_2_EP1", _loot_pos, [], 0, "CAN_COLLIDE"];
  124. _clutter setPos _loot_pos;
  125. // cut the grass end
  126.  
  127. // Add loot
  128. {
  129. _loot_box addWeaponCargoGlobal [_x,1];
  130. } forEach (_loot select 0);
  131. {
  132. _loot_box addMagazineCargoGlobal [_x,1];
  133. } forEach (_loot select 1);
  134.  
  135. // Send Top Right message to users , requires Remote message script
  136. //_hint = parseText format["<t align='center' color='#0D00FF' shadow='2' size='1.75'>Supply Crate</t><br/><t align='center' color='#ffffff'>UN Agency drops life-saving supplies for Survivors, Check your Map for the Location!</t>"];
  137. //customRemoteMessage = ['hint', _hint];
  138. //publicVariable "customRemoteMessage";
  139.  
  140. // Send center message to users
  141. [nil,nil,rTitleText,"LZ-HQ Agency drops life-saving supplies! Check your Map for the Location!", "PLAIN",10] call RE;
  142.  
  143. diag_log(format["Loot event setup, waiting for %1 seconds", _wait_time]);
  144.  
  145. // Wait
  146. sleep _wait_time;
  147.  
  148. // Clean up
  149. EPOCH_EVENT_RUNNING_S = false;
  150.  
  151. // End RefreshMarker Script by *hs-s.com | waTTe - www.banditparty.de
  152. //sleep 30; //Wait to let the RefreshMarkerScript finish its loop
  153.  
  154. deleteVehicle _loot_box;
  155. deleteMarker _event_marker;
  156. if (_debug) then {
  157. deleteMarker _debug_marker;
  158. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement