Advertisement
Guest User

Untitled

a guest
Feb 4th, 2016
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.33 KB | None | 0 0
  1.  
  2. private ["_humanity", "_foodList","_meatList","_drinkList","_backpackList","_pistolList","_riflelist","_meleeList","_extraMagsList","_extraWeaponsList", "_foodCount", "_meatCount",
  3. "_drinkCount", "_trashCount", "_msg", "_vehList", "_vehClass","_ammo","_rifle","_pistol","_vehicle","_objectID","_box", "_melee"];
  4.  
  5. _p = _this select 0; //player
  6. _w = _this select 1; // worldspace
  7.  
  8. _humanity = _p getVariable ["humanity",0];
  9.  
  10. diag_log(format ["DZLD: Player: %1, Humanity: %2, Worldspace: %3", name _p, _humanity,_w]);
  11.  
  12. //_isHero = (player getVariable ["humanity",0] > 5000);
  13. //_isBandit = (player getVariable ["humanity",0] < -2000);
  14. //if (_humanity > 5000) then {
  15. // _isHero=true;
  16. //};
  17. //_humanity = 152500;
  18.  
  19. _backpackList = [];
  20. _pistolList = [];
  21. _riflelist = [];
  22. _meleeList = [];
  23.  
  24. _extraMagsList = [];
  25. _extraWeaponsList = [];
  26.  
  27. _foodCount = 0;
  28. _meatCount = 0;
  29. _drinkCount = 0;
  30. _trashCount = 6;
  31.  
  32. // _msg = "";
  33. _vehList = [];
  34.  
  35. _foodList = ["FoodNutmix","FoodCanBakedBeans","FoodCanSardines","FoodCanFrankBeans","FoodCanPasta","FoodCanBadguy","FoodCanBoneboy","FoodCanCorn","FoodCanCurgon", "FoodCanDemon",
  36. "FoodCanFraggleos","FoodCanBeef","FoodCanHerpy","FoodCanDerpy","FoodCanOrlok","FoodCanPowell","FoodCanTylers","FoodCanUnlabeled","FoodPistachio", "FoodChipsSulahoops",
  37. "FoodChipsMysticales","FoodCandyAnders","FoodCandyLegacys","FoodCandyMintception","FoodCanRusStew","FoodCanRusPork","FoodCanRusPeas","FoodCanRusMilk", "FoodCanRusCorn",
  38. "FoodCakeCremeCakeClean"];
  39.  
  40. _meatList = ["FoodSteakCooked","FoodSteakRaw", "FoodmeatCooked", "FoodmeatRaw", "FoodbeefCooked", "FoodbeefRaw", "FoodmuttonCooked", "FoodmuttonRaw", "FoodchickenCooked", "FoodchickenRaw",
  41. "FoodrabbitCooked", "FoodrabbitRaw", "FoodbaconCooked", "FoodbaconRaw", "FoodgoatCooked", "FoodgoatRaw", "FishCookedTrout", "FishRawTrout", "FishCookedSeaBass", "FishRawSeaBass",
  42. "FishCookedTuna", "FishRawTuna"];
  43.  
  44. _drinkList = ["ItemWaterBottleBoiled","ItemWaterbottle","ItemSodaLirik","ItemSodaPeppsy","ItemSodaMtngreen","ItemSodaR4z0r","ItemSodaClays","ItemSodaSmasht","ItemSodaDrwaste","ItemSodaLemonade",
  45. "ItemSodaLvg","ItemSodaMzly","ItemSodaRabbit"];
  46.  
  47. _trashList = ["ItemSodaSmashtEmpty","ItemTrashToiletpaper","FoodCanBeefEmpty","TrashJackDaniels","FoodChipsChocolateEmpty","ItemKosmosSmokes","ItemSodaR4z0rEmpty","ItemTrashPaper",
  48. "FoodCanOrlokEmpty","ItemTrashPaperMusic", "ItemBookBible", "ItemWire","equip_scrapelectronics","FoodCanTylersEmpty","equip_2inch_metal_pipe", "equip_pvc_box"];
  49.  
  50. _vclassList = ["AH6X_DZ", "AN2_2_DZ", "AN2_DZ", "ATV_US_EP1", "BAF_Offroad_D", "BAF_Offroad_W", "car_hatchback", "car_sedan", "datsun1_civil_2_covered", "datsun1_civil_3_open", "Fishing_Boat",
  51. "hilux1_civil_1_open", "hilux1_civil_2_covered", "hilux1_civil_3_open", "HMMWV_DZ", "Ikarus", "Ikarus_TK_CIV_EP1", "ladalm", "LandRover_CZ_EP1", "LandRover_TK_CIV_EP1", "M1030", "MH6J_DZ", "Mi17_DZ",
  52. "Offroad_DSHKM_INS", "Old_bike_TK_CIV_EP1", "Old_moto_TK_Civ_EP1", "PBX", "Pickup_PK_INS", "S1203_TK_CIV_EP1", "Skoda", "SkodaBlue", "SkodaGreen", "Smallboat_1", "SUV_DZ", "Tractor", "TT650_Ins",
  53. "TT650_TK_CIV_EP1", "UAZ_RU", "UAZ_Unarmed_TK_CIV_EP1", "UAZ_Unarmed_TK_EP1", "UAZ_Unarmed_UN_EP1", "UH1H_2_DZ", "UH1H_DZ", "UralCivil", "UralCivil2", "UralOpen_INS", "Ural_CDF", "Ural_INS", "Ural_TK_CIV_EP1",
  54. "V3S_Civ", "VolhaLimo_TK_CIV_EP1", "Volha_1_TK_CIV_EP1", "Volha_2_TK_CIV_EP1"];
  55.  
  56.  
  57.  
  58. // BANDIT
  59. if (_humanity < -2000) then {
  60.  
  61. _backpackList = [];
  62. _pistolList = [];
  63. _riflelist = [];
  64. _meleeList = ["MeleeBaseBallBatNails", "MeleeBaseBallBatBarbed","MeleeBaseBallBat"];
  65. _extraMagsList = ["ItemPainkiller", "ItemTrashToiletpaper","TrashJackDaniels","ItemKosmosSmokes"];
  66. _extraWeaponsList = ["ItemCompass"];
  67. _foodCount = 0;
  68. _meatCount = 0;
  69. _drinkCount = 0;
  70. _msg = "You are an APPRENTICE BANDIT.";
  71.  
  72. if ( (_humanity < -25000) && (_humanity > -50000) ) then {
  73. _backpackList = ["DZ_Assault_Pack_EP1","DZ_ALICE_Pack_EP1"];
  74. _pistolList = ["PDW_DZ", "Makarov_DZ"];
  75. _riflelist = ["Bizon_DZ","MP5_SD_DZ"];
  76. _foodCount = 1;
  77. _drinkCount = 1;
  78. _msg = "You are a ENTHUSIASTIC BANDIT.";
  79. };
  80. if ( (_humanity < -49999) && (_humanity > -100000) ) then {
  81. _backpackList = ["DZ_Assault_Pack_EP1","DZ_ALICE_Pack_EP1"];
  82. _pistolList = ["PDW_DZ", "Makarov_DZ"];
  83. _riflelist = ["MP5_SD_DZ","AKM_DZ","Mosin_Nagant"];
  84. _vehList = ["Old_bike_TK_CIV_EP1","Old_moto_TK_Civ_EP1"];
  85. _foodCount = 1;
  86. _meatCount = 1;
  87. _drinkCount = 1;
  88. _msg = "You are a COMMITTED BANDIT.";
  89. };
  90.  
  91. if (_humanity < -99999) then {
  92. _backpackList = ["DZ_Assault_Pack_EP1","DZ_ALICE_Pack_EP1"];
  93. _pistolList = ["PDW_DZ", "Makarov_DZ"];
  94. _riflelist = ["AKS74U_Kobra_DZ","M16A4_DZ","AK74_Kobra_DZ","LeeEnfield_DZ"];
  95. _extraMagsList = ["ItemPainkiller", "ItemBandage", "ItemBandage","ItemBandage", "ItemBandage", "ItemMorphine", "ItemAntibiotic"];
  96. _vehList = ["SkodaBlue","Old_bike_TK_CIV_EP1","Skoda","Old_bike_TK_CIV_EP1","SkodaGreen"];
  97. _foodCount = 2;
  98. _meatCount = 2;
  99. _drinkCount = 2;
  100. _msg = "You are a DEVOTED BANDIT.";
  101. };
  102.  
  103. };
  104.  
  105.  
  106. if (_humanity > 5000) then { // HERO
  107.  
  108. _backpackList = ["DZ_Assault_Pack_EP1","DZ_ALICE_Pack_EP1","DZ_TK_Assault_Pack_EP1"];
  109. _pistolList = ["M1911_DZ","Revolver_DZ","G17_DZ","M9_DZ"];
  110. _riflelist = ["M4A1_DZ","M16A4_DZ","M16A2_DZ"];
  111. _meleeList = ["ItemHatchet", "ItemCrowbar"];
  112. _extraMagsList = ["ItemPainkiller", "ItemBandage", "ItemBandage","ItemBandage", "ItemBandage", "ItemMorphine", "ItemAntibiotic","equip_comfreyleafs","equip_comfreyleafs"];
  113. _extraWeaponsList = ["ItemFlashlight", "ItemMap", "ItemMatchbox", "Binocular", "ItemKnife"];
  114. _foodCount = 2;
  115. _drinkCount = 2;
  116. _msg = "You are a HERO!";
  117. _vehList = ["Old_bike_TK_CIV_EP1"];
  118.  
  119. if ( (_humanity > 9999) && (_humanity < 25000) ) then { // Awesome Hero
  120. _backpackList = ["DZ_Assault_Pack_EP1","DZ_ALICE_Pack_EP1","DZ_TK_Assault_Pack_EP1", "DZ_Czech_Vest_Puch","DZ_British_ACU"];
  121. _riflelist = ["L85_Holo_DZ","G36K_Camo_DZ"];
  122. _vehList = ["Old_bike_TK_CIV_EP1", "M1030", "TT650_Ins", "TT650_TK_CIV_EP1", "Old_moto_TK_Civ_EP1","ATV_US"];
  123. _foodCount = 3;
  124. _meatCount = 1;
  125. _drinkCount = 3;
  126. _msg = "You are an AWESOME HERO!";
  127. };
  128. if ( (_humanity > 24999) && (_humanity < 50000) ) then { // AmazingHero
  129. _backpackList = ["DZ_Assault_Pack_EP1","DZ_ALICE_Pack_EP1","DZ_TK_Assault_Pack_EP1", "DZ_CivilBackpack_EP1","DZ_Backpack_EP1"];
  130. _riflelist = ["SA58_ACOG_DZ","SVD_DZ","G36K_Camo_DZ"];
  131. _vehList = ["Old_bike_TK_CIV_EP1","hilux1_civil_1_open","hilux1_civil_2_covered", "hilux1_civil_3_open"];
  132. _foodCount = 4;
  133. _meatCount = 2;
  134. _drinkCount = 4;
  135. _msg = "You are an AMAZING HERO!";
  136. };
  137. if ( (_humanity > 49999) && (_humanity < 100000) ) then { // EpicHero
  138. _backpackList = ["DZ_Assault_Pack_EP1","DZ_ALICE_Pack_EP1","DZ_Backpack_EP1"];
  139. _riflelist = ["M14_DZ","SA58_ACOG_DZ","DMR_DZ","SVD_DZ"];
  140. _vehList = ["TT650_TK_CIV_EP1","UAZ_RU","UAZ_Unarmed_TK_CIV_EP1", "UAZ_Unarmed_TK_EP1", "UAZ_Unarmed_UN_EP1", "Old_moto_TK_Civ_EP1"];
  141. _extraWeaponsList = ["ItemFlashlight", "ItemMap", "ItemMatchbox", "Binocular", "ItemKnife", "ItemGPS"];
  142. _foodCount = 5;
  143. _meatCount = 3;
  144. _drinkCount = 5;
  145. _msg = "You are an EPIC HERO!";
  146. };
  147. if (_humanity > 99999) then { // UltimateHero
  148. _backpackList = ["DZ_TK_Assault_Pack_EP1", "DZ_CivilBackpack_EP1","DZ_Backpack_EP1"];
  149. _riflelist = ["M14_DZ","DMR_DZ","M240_DZ","M249_DZ"];
  150. _vehList = ["ATV_US","SUV_DZ","LandRover_CZ_EP1", "LandRover_TK_CIV_EP1", "M1030", "BAF_Offroad_D", "BAF_Offroad_W"];
  151. _extraWeaponsList = ["ItemFlashlight", "ItemMap", "ItemMatchbox", "Binocular", "ItemKnife","ItemGPS", "Binocular_Vector"];
  152. _foodCount = 6;
  153. _drinkCount = 6;
  154. _msg = "You are the ULTIMATE HERO!";
  155. };
  156.  
  157. } else { // SURVIVOR
  158.  
  159. _backpackList = ["DZ_Patrol_Pack_EP1", "DZ_Czech_Vest_Puch"];
  160. _pistolList = ["Revolver_DZ", "M1911_DZ"];
  161. _riflelist = ["CZ550_DZ","M1014_DZ","LeeEnfield_DZ","CZ550_DZ","M1014_DZ"];
  162. _meleeList = ["ItemMachete", "ItemCrowbar"];
  163.  
  164. _extraMagsList =["ItemPainkiller", "ItemBandage", "ItemBandage","equip_string", "PartWoodPile", "PartWoodPile"];
  165. _extraWeaponsList = ["ItemFlashlight", "ItemCompass"];
  166.  
  167. _foodCount = 1;
  168. _meatCount = 1;
  169. _drinkCount = 1;
  170.  
  171. _msg = "You are a SURVIVOR.";
  172. };
  173.  
  174. //systemChat (_msg);
  175. _p setVariable ["lMsg", _msg, true];
  176.  
  177. //_coords = position _p;
  178. _coords = _w;
  179.  
  180. diag_log(format ["DZLD: x: %1, y: %2, z: %3", (_coords select 0), (_coords select 1), (_coords select 2)]);
  181.  
  182. // Make sure there isn't already a vehicle there. Argh, need a meta list of all vehicles....
  183. // This could give a false positive, but so what
  184. _vehNear = nearestObjects [_coords, _vclassList, 25];
  185. // _vehCount = count _vehNear;
  186.  
  187. // if ( (!isNil "_vehClass") && (round(random 100)%5==0) ) then {
  188. if ( (count _vehList) > 0 && (count _vehNear) < 1 ) then {
  189.  
  190. _vehClass = _vehList call BIS_fnc_selectRandom;
  191. _vehicle = createVehicle [_vehClass,[(_coords select 0) - 4, (_coords select 1) + 4,0],[], 0, "CAN_COLLIDE"];
  192. _objectID = str(round(random 999999));
  193. _vehicle setVariable ["ObjectID", _objectID, true];
  194. _vehicle setVariable ["ObjectUID", _objectID, true];
  195.  
  196. diag_log(format ["DZLD1: Player: %1, Humanity: %2, VehicleClass: %3", name _p, _humanity, _vehClass]);
  197. // _vehicle setVariable ["Mission",1,true];
  198. dayz_serverObjectMonitor set [count dayz_serverObjectMonitor, _vehicle];
  199. waitUntil {(!isNull _vehicle)};
  200.  
  201. _ranFuel = random 1;
  202. if (_ranFuel < .25) then {_ranFuel = .25;};
  203. _vehicle setFuel _ranFuel;
  204. _vehicle setvelocity [0,0,1];
  205. _vehicle setDir (round(random 360));
  206. _vehicle setVehicleLock "UNLOCKED";
  207.  
  208. diag_log(format ["DZLD2: Player: %1, Humanity: %2, VehicleClass: %3", name _p, _humanity, _vehClass]);
  209.  
  210. clearMagazineCargo _vehicle;
  211. clearWeaponCargo _vehicle;
  212. //_vehicle addMagazineCargoGlobal ["ItemJerryCan"];
  213.  
  214. _vehicle addEventHandler ["GetIn",{
  215. _nil = [nil,(_this select 2),"loc",rTITLETEXT,"Warning: This vehicle will disappear on server restart!","PLAIN DOWN",5] call RE;
  216. }];
  217.  
  218. // _vehicle setVariable ["lName", _p name, true];
  219. // _vehicle addEventHandler ["GetIn",{
  220. // if ((_this select 0) getVariable ["lName",0] != (_this select 2) name ) then { (_this select 2) action ["eject", (_this select 0) (_this select 2)]; }
  221. // }];
  222.  
  223. //titleText ["Warning: This vehicle will disappear on server restart!", "PLAIN DOWN", 3];
  224. };
  225.  
  226. //AmmoBoxBig(works) ,Foodbox0 (disappears - like medbox0?), TentStorage (works)
  227.  
  228. // Make sure there isn't already a box there. You could go in/out of the lobby.
  229. // This could give a false positive, but so what
  230. _boxesNear = nearestObjects [_coords, ["AmmoBoxBig"], 10];
  231. _boxcount = count _boxesNear;
  232.  
  233. if ((_boxcount) < 1) then {
  234. _box = createVehicle ["AmmoBoxBig",[(_coords select 0) - 2, (_coords select 1) - 2,0],[], 0, "CAN_COLLIDE"];
  235. _box setVariable ["permaLoot",true];
  236. _box setVariable ["Mission",1,true];
  237.  
  238. clearWeaponCargoGlobal _box;
  239. clearMagazineCargoGlobal _box;
  240. clearBackPackCargoGlobal _box;
  241. //titleText ["Warning: Get your loadout now. The Supply Box will disappear when you walk away!", "PLAIN DOWN", 3];
  242.  
  243. if ((count _backpackList)>0) then {
  244. _box addBackpackCargoGlobal [_backpackList call BIS_fnc_selectRandom, 1];
  245. };
  246.  
  247. if ((count _pistolList)>0) then {
  248. _pistol = _pistolList call BIS_fnc_selectRandom;
  249. _box addWeaponCargoGlobal [_pistol, 1];
  250.  
  251. _ammo = [] + getArray (configFile >> "cfgWeapons" >> _pistol >> "magazines");
  252. if ((count _ammo) > 0) then {
  253. _box addMagazineCargoGlobal [(_ammo select 0),(round(random 2)+1)];
  254. };
  255. };
  256. if ((count _rifleList)>0) then {
  257. _rifle = _rifleList call BIS_fnc_selectRandom;
  258. _box addWeaponCargoGlobal [_rifle, 1];
  259.  
  260. _ammo = [] + getArray (configFile >> "cfgWeapons" >> _rifle >> "magazines");
  261. if ((count _ammo) > 0) then {
  262. _box addMagazineCargoGlobal [(_ammo select 0),(round(random 4)+1)];
  263. };
  264. };
  265. if ((count _meleeList)>0) then {
  266. _melee = _meleeList call BIS_fnc_selectRandom;
  267. _box addWeaponCargoGlobal [_melee, 1];
  268. };
  269. if ((count _extraMagsList)>0) then {
  270. {_box addMagazineCargoGlobal [_x, 1];} forEach _extraMagsList;
  271. };
  272. if ((count _extraWeaponsList)>0) then {
  273. {_box addWeaponCargoGlobal [_x, 1];} forEach _extraWeaponsList;
  274. };
  275.  
  276. for "_i" from 1 to _foodCount do { _box addMagazineCargoGlobal [_foodList call BIS_fnc_selectRandom, 1]; };
  277. for "_i" from 1 to _meatCount do { _box addMagazineCargoGlobal [_meatList call BIS_fnc_selectRandom, 1]; };
  278. for "_i" from 1 to _drinkCount do { _box addMagazineCargoGlobal [_drinkList call BIS_fnc_selectRandom, 1]; };
  279. for "_i" from 1 to _trashCount do { _box addMagazineCargoGlobal [_trashList call BIS_fnc_selectRandom, 1]; };
  280. // for "_i" from 1 to _medCount do { _box addMagazineCargoGlobal [_medList call BIS_fnc_selectRandom, 1]; };
  281.  
  282. //uisleep 5;
  283.  
  284. diag_log("DZLD: AmmoBoxBig Spawned");
  285. };
  286.  
  287. // Probably need to also delete on alive player. What about logout???
  288. // not alive player
  289. // OR !(alive player)
  290. // waitUntil {(_p distance _box) < 5};
  291. // waitUntil {(_p distance _box) > 5};
  292. // deleteVehicle _box;
  293. // diag_log("DZLD: AmmoBoxBig Removed");
  294. //} else {
  295. // titleText ["Hmmm, there seems to already be a supply box here.", "PLAIN DOWN", 3];
  296. //
  297. // _box = _boxesNear select 0;
  298. // waitUntil {(_p distance _box) > 5};
  299. // deleteVehicle _box;
  300. // {deleteVehicle _x;} forEach _boxesNear;
  301.  
  302. //};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement