Advertisement
Guest User

Untitled

a guest
May 13th, 2013
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.70 KB | None | 0 0
  1. private["_obj","_type","_config","_positions","_iPos","_nearBy","_itemType","_itemTypes","_itemChances","_lootChance","_weights","_cntWeights","_index","_LootClass"];
  2.  
  3. _obj = _this select 0;
  4. _type = typeOf _obj;
  5. _config = configFile >> "CfgBuildingLoot" >> _type;
  6. _positions = [] + getArray (_config >> "lootPos");
  7. //_itemTypes = [] + getArray (_config >> "itemType"); // Default System
  8. _lootChance = getNumber (_config >> "lootChance");
  9.  
  10. //------------------//
  11. //CUSTOM LOOT SPAWNS//
  12. //------------------//
  13. _itemTypes = []; //Initialise array
  14. _itemChance = []; //Initialise array
  15.  
  16. diag_log "SPAWNING WITH CUSTOM LOOT";//Remove This line after testing
  17.  
  18. switch (_type) do { //Assign building classes
  19. case "Land_HouseV_1I4": { _LootClass = "Residential"; };
  20. case "Land_kulna": { _LootClass = "Residential"; };
  21. case "Land_Ind_Workshop01_04": { _LootClass = "Industrial"; };
  22. case "Land_hut06": { _LootClass = "Residential"; };
  23. case "Land_Hlidac_budka": { _LootClass = "Residential"; };
  24. case "Land_HouseV2_02_Interier": { _LootClass = "Residential"; };
  25. case "Land_A_Pub_01": { _LootClass = "Residential"; };
  26. case "Land_Shed_wooden": { _LootClass = "Residential"; };
  27. case "Land_HouseBlock_A1_1": { _LootClass = "Residential"; };
  28. case "Land_A_MunicipalOffice": { _LootClass = "Residential"; };
  29. case "Land_ruin_01": { _LootClass = "Residential"; };
  30. case "Land_HouseV2_04_interier": { _LootClass = "Residential"; };
  31. case "Land_HouseV2_01A": { _LootClass = "Residential"; };
  32. case "Land_psi_bouda": { _LootClass = "Residential"; };
  33. case "Land_KBud": { _LootClass = "Residential"; };
  34. case "Land_A_Castle_Bergfrit": { _LootClass = "Residential"; };
  35. case "Land_A_Castle_Stairs_A": { _LootClass = "Residential"; };
  36. case "Land_A_Castle_Gate": { _LootClass = "Residential"; };
  37. case "Land_sara_domek_zluty": { _LootClass = "Residential"; };
  38. case "Land_Church_01": { _LootClass = "Residential"; };
  39. case "Land_Church_03": { _LootClass = "Residential"; };
  40. case "Land_HouseB_Tenement": { _LootClass = "Residential"; };
  41. case "Land_Panelak": { _LootClass = "Residential"; };
  42. case "Land_Panelak2": { _LootClass = "Residential"; };
  43. case "Land_rail_station_big": { _LootClass = "Residential"; };
  44. case "Land_A_Office01": { _LootClass = "Residential"; };
  45. case "Land_A_Office02": { _LootClass = "Residential"; };
  46. case "Land_Ind_Workshop01_01": { _LootClass = "Industrial"; };
  47. case "Land_Ind_Garage01": { _LootClass = "Industrial"; };
  48. case "Land_Ind_Workshop01_02": { _LootClass = "Industrial"; };
  49. case "Land_Ind_Workshop01_L": { _LootClass = "Industrial"; };
  50. case "Land_Hangar_2": { _LootClass = "Industrial"; };
  51. case "Land_A_FuelStation_Build": { _LootClass = "Industrial"; };
  52. case "Land_Shed_Ind02": { _LootClass = "Industrial"; };
  53. case "Land_Misc_PowerStation": { _LootClass = "Industrial"; };
  54. case "Land_Shed_W01": { _LootClass = "Industrial"; };
  55. case "Land_Tovarna2": { _LootClass = "Industrial"; };
  56. case "Land_Ind_Vysypka": { _LootClass = "Industrial"; };
  57. case "Land_A_BuildingWIP": { _LootClass = "Industrial"; };
  58. case "Land_A_TVTower_Base": { _LootClass = "Industrial"; };
  59. case "Land_Misc_Cargo1Ao": { _LootClass = "Industrial"; };
  60. case "Land_Misc_Cargo1Bo": { _LootClass = "Industrial"; };
  61. case "Land_Nav_Boathouse": { _LootClass = "Industrial"; };
  62. case "Land_wagon_box": { _LootClass = "Industrial"; };
  63. case "Land_Rail_House_01": { _LootClass = "Industrial"; };
  64. case "Land_A_GeneralStore_01a": { _LootClass = "Supermarket"; };
  65. case "Land_A_GeneralStore_01": { _LootClass = "Supermarket"; };
  66. case "Land_A_Hospital": { _LootClass = "Hospital"; };
  67. case "MASH": { _LootClass = "Hospital"; };
  68. case "MASH_EP1": { _LootClass = "Hospital"; };
  69. case "USMC_WarfareBFieldhHospital": { _LootClass = "Hospital"; };
  70. case "Land_a_stationhouse": { _LootClass = "Military"; };
  71. case "Land_Mil_ControlTower": { _LootClass = "Military"; };
  72. case "Land_SS_hangar": { _LootClass = "Military"; };
  73. case "Land_Mil_House": { _LootClass = "Military"; };
  74. case "Camp": { _LootClass = "Military"; };
  75. case "CampEast": { _LootClass = "Military"; };
  76. case "CampEast_EP1": { _LootClass = "Military"; };
  77. case "Land_Mil_Barracks_i": { _LootClass = "MilitarySpecial"; };
  78. case "Land_Misc_deerstand": { _LootClass = "Hunting"; };
  79. case "Land_stodola_old_open": { _LootClass = "Farm"; };
  80. case "Land_Farm_Cowshed_a": { _LootClass = "Farm"; };
  81. case "Land_stodola_open": { _LootClass = "Farm"; };
  82. case "Land_Barn_W_01": { _LootClass = "Farm"; };
  83. case "Land_Barn_W_02": { _LootClass = "Farm"; };
  84. default { _LootClass = "Residential"; };
  85. };
  86.  
  87. switch (_LootClass) do { //Find correct loot
  88. case "Residential": {
  89. _itemTypes = [
  90. ["ItemSodaMdew","magazine"],
  91. ["ItemWatch","generic"],
  92. ["ItemCompass","generic"],
  93. ["ItemMap","weapon"],
  94. ["Makarov","weapon"],
  95. ["Colt1911","weapon"],
  96. ["ItemFlashlight","generic"],
  97. ["ItemKnife","generic"],
  98. ["ItemMatchbox","generic"],
  99. ["","generic"],
  100. ["LeeEnfield","weapon"],
  101. ["revolver_EP1","weapon"],
  102.  
  103. ["DZ_Assault_Pack_EP1","object"], // 12
  104. ["DZ_Czech_Vest_Puch","object"], // 12-0
  105. ["DZ_ALICE_Pack_EP1","object"], // 16
  106. ["DZ_TK_Assault_Pack_EP1","object"], // 16
  107. ["DZ_British_ACU","object"], // 18
  108.  
  109. ["Winchester1866","weapon"],
  110. ["WeaponHolder_ItemTent","object"],
  111. ["","military"],
  112. ["","trash"],
  113. ["Crossbow_DZ","weapon"],
  114. ["Binocular","weapon"],
  115. ["PartWoodPile","magazine"],
  116. ["Skin_Camo1_DZ","magazine"],
  117. ["Skin_Sniper1_DZ","magazine"],
  118. ["WeaponHolder_ItemCrowbar","object"],
  119. ["MR43","weapon"],
  120. ["m8_base","weapon"],
  121. ["m8_carbineGL","weapon"],
  122. ["SCAR_L_STD_Mk4CQT","weapon"],
  123. ["SCAR_H_LNG_Sniper","weapon"],
  124. ["SCAR_H_LNG_Sniper_SD","weapon"],
  125. ["BAF_L86A2_ACOG","weapon"],
  126. ["SCAR_L_STD_Mk4CQT","weapon"],
  127. ["SCAR_L_STD_EGLM_RCO","weapon"],
  128. ["SCAR_L_CQC_EGLM_Holo","weapon"],
  129. ["SCAR_H_CQC_CCO","weapon"],
  130. ["SCAR_H_STD_EGLM_Spect","weapon"],
  131. ["GrenadeLauncher_EP1","weapon"],
  132. ["Mk13_EP1","weapon"],
  133. ["AKS_74_UN_kobra","weapon"],
  134. ["m8_sharpshooter","weapon"],
  135. ["m8_SAW","weapon"],
  136. ["RPK_74","weapon"],
  137. ["MG36_camo","weapon"],
  138. ["MG36","weapon"],
  139. ["M242","weapon"]
  140. ];
  141. _itemChance = [
  142. 0.01,
  143. 0.15,
  144. 0.05,
  145. 0.03,
  146. 0.13,
  147. 0.05,
  148. 0.03,
  149. 0.08,
  150. 0.06,
  151. 2,
  152. 0.06,
  153. 0.04,
  154. 0.05, //12
  155. 0.04, // 12-0
  156. 0.02, //16
  157. 0.02, //16
  158. 0.01, //18
  159. 0.01,
  160. 0.01,
  161. 0.03,
  162. 0.5,
  163. 0.01,
  164. 0.06,
  165. 0.06,
  166. 0.01,
  167. 0.01,
  168. 0.08,
  169. 0.03,
  170. 0.5,
  171. 0.01,
  172. 0.15,
  173. 0.05,
  174. 0.03,
  175. 0.13,
  176. 0.05,
  177. 0.03,
  178. 0.08,
  179. 0.06,
  180. 0.01,
  181. 0.15,
  182. 0.05,
  183. 0.03,
  184. 0.13,
  185. 0.05,
  186. 0.03,
  187. 0.08,
  188. 0.06,
  189. 0.03,
  190. 0.08,
  191. 0.06
  192. ];
  193. };
  194. case "Industrial": {
  195. _itemTypes = [
  196. ["","generic"],
  197. ["","trash"],
  198. ["","military"],
  199. ["WeaponHolder_PartGeneric","object"],
  200. ["WeaponHolder_PartWheel","object"],
  201. ["WeaponHolder_PartFueltank","object"],
  202. ["WeaponHolder_PartEngine","object"],
  203. ["WeaponHolder_PartGlass","object"],
  204. ["WeaponHolder_PartVRotor","object"],
  205. ["WeaponHolder_ItemJerrycan","object"],
  206. ["WeaponHolder_ItemHatchet","object"],
  207. ["ItemKnife","military"],
  208. ["ItemToolbox","weapon"],
  209. ["ItemWire","magazine"],
  210. ["ItemTankTrap","magazine"]
  211. ];
  212. _itemChance = [
  213. 0.18,
  214. 0.29,
  215. 0.04,
  216. 0.04,
  217. 0.05,
  218. 0.02,
  219. 0.02,
  220. 0.04,
  221. 0.01,
  222. 0.04,
  223. 0.11,
  224. 0.07,
  225. 0.06,
  226. 0.01,
  227. 0.04
  228. ];
  229. };
  230. case "Farm": {
  231. _itemTypes = [
  232. ["WeaponHolder_ItemJerrycan","object"],
  233. ["","generic"],
  234. ["huntingrifle","weapon"],
  235. ["LeeEnfield","weapon"],
  236. ["Winchester1866","weapon"],
  237. ["","trash"],
  238. ["Crossbow_DZ","weapon"],
  239. ["PartWoodPile","magazine"],
  240. ["WeaponHolder_ItemHatchet","object"],
  241. ["MR43","weapon"],
  242. ["WeaponHolder_ItemMachete","object"]
  243. ["MR43","weapon"]
  244. ["m8_base","weapon"],
  245. ["m8_carbineGL","weapon"],
  246. ["SCAR_L_STD_Mk4CQT","weapon"],
  247. ["SCAR_H_LNG_Sniper","weapon"],
  248. ["SCAR_H_LNG_Sniper_SD","weapon"],
  249. ["BAF_L86A2_ACOG","weapon"],
  250. ["SCAR_L_STD_Mk4CQT","weapon"],
  251. ["SCAR_L_STD_EGLM_RCO","weapon"],
  252. ["SCAR_L_CQC_EGLM_Holo","weapon"],
  253. ["SCAR_H_CQC_CCO","weapon"],
  254. ["SCAR_H_STD_EGLM_Spect","weapon"],
  255. ["GrenadeLauncher_EP1","weapon"],
  256. ["Mk13_EP1","weapon"],
  257. ["AKS_74_UN_kobra","weapon"],
  258. ["m8_sharpshooter","weapon"],
  259. ["m8_SAW","weapon"],
  260. ["RPK_74","weapon"],
  261. ["MG36_camo","weapon"],
  262. ["MG36","weapon"],
  263. ["M242","weapon"]
  264. ];
  265. _itemChance = [
  266. 0.06,
  267. 0.28,
  268. 0.01,
  269. 0.04,
  270. 0.03,
  271. 0.22,
  272. 0.03,
  273. 0.11,
  274. 0.17,
  275. 0.06,
  276. 0.03,
  277. 0.01,
  278. 0.15,
  279. 0.05,
  280. 0.03,
  281. 0.13,
  282. 0.05,
  283. 0.03,
  284. 0.08,
  285. 0.06,
  286. 0.01,
  287. 0.15,
  288. 0.05,
  289. 0.03,
  290. 0.13,
  291. 0.05,
  292. 0.03,
  293. 0.08,
  294. 0.06,
  295. 0.03,
  296. 0.08,
  297. 0.06
  298. ];
  299. };
  300. case "Supermarket": {
  301. _itemTypes = [
  302. ["ItemWatch","generic"],
  303. ["ItemCompass","generic"],
  304. ["ItemMap","weapon"],
  305. ["Makarov","weapon"],
  306. ["Colt1911","weapon"],
  307. ["ItemFlashlight","generic"],
  308. ["ItemKnife","generic"],
  309. ["ItemMatchbox","generic"],
  310. ["","generic"],
  311. ["LeeEnfield","weapon"],
  312. ["revolver_EP1","weapon"],
  313.  
  314. ["DZ_Assault_Pack_EP1","object"], // 12
  315. ["DZ_Czech_Vest_Puch","object"], // 12-0
  316. ["DZ_ALICE_Pack_EP1","object"], // 16
  317. ["DZ_TK_Assault_Pack_EP1","object"], // 16
  318. ["DZ_British_ACU","object"], // 18
  319.  
  320. ["Winchester1866","weapon"],
  321. ["WeaponHolder_ItemTent","object"],
  322. ["","food"],
  323. ["","trash"],
  324. ["Crossbow_DZ","weapon"],
  325. ["Binocular","weapon"],
  326. ["PartWoodPile","magazine"],
  327. ["MR43","weapon"],
  328. ["m8_base","weapon"],
  329. ["m8_carbineGL","weapon"],
  330. ["SCAR_L_STD_Mk4CQT","weapon"],
  331. ["SCAR_H_LNG_Sniper","weapon"],
  332. ["SCAR_H_LNG_Sniper_SD","weapon"],
  333. ["BAF_L86A2_ACOG","weapon"],
  334. ["SCAR_L_STD_Mk4CQT","weapon"],
  335. ["SCAR_L_STD_EGLM_RCO","weapon"],
  336. ["SCAR_L_CQC_EGLM_Holo","weapon"],
  337. ["SCAR_H_CQC_CCO","weapon"],
  338. ["SCAR_H_STD_EGLM_Spect","weapon"],
  339. ["GrenadeLauncher_EP1","weapon"],
  340. ["Mk13_EP1","weapon"],
  341. ["AKS_74_UN_kobra","weapon"],
  342. ["m8_sharpshooter","weapon"],
  343. ["m8_SAW","weapon"],
  344. ["RPK_74","weapon"],
  345. ["MG36_camo","weapon"],
  346. ["MG36","weapon"],
  347. ["M242","weapon"]
  348. ];
  349. _itemChance = [
  350. 0.15,
  351. 0.01,
  352. 0.05,
  353. 0.02,
  354. 0.02,
  355. 0.05,
  356. 0.02,
  357. 0.05,
  358. 0.05,
  359. 0.01,
  360. 0.01,
  361. 0.05, //12
  362. 0.04, // 12-0
  363. 0.02, //16
  364. 0.02, //16
  365. 0.01, //18
  366. 0.01,
  367. 0.01,
  368. 0.3,
  369. 0.15,
  370. 0.01,
  371. 0.05,
  372. 0.02,
  373. 0.01,
  374. 0.01,
  375. 0.15,
  376. 0.05,
  377. 0.03,
  378. 0.13,
  379. 0.05,
  380. 0.03,
  381. 0.08,
  382. 0.06,
  383. 0.01,
  384. 0.15,
  385. 0.05,
  386. 0.03,
  387. 0.13,
  388. 0.05,
  389. 0.03,
  390. 0.08,
  391. 0.06,
  392. 0.03,
  393. 0.08
  394. ];
  395. };
  396. case "Hospital": {
  397. _itemTypes = [
  398. ["","trash"],
  399. ["","hospital"],
  400. ["MedBox0","object"]
  401. ];
  402. _itemChance = [
  403. 0.2,
  404. 1,
  405. 0.2
  406. ];
  407. };
  408. case "Military": {
  409. _itemTypes = [
  410. ["M9","weapon"],
  411. ["M16A2","weapon"],
  412. ["M16A2GL","weapon"],
  413. ["M9SD","weapon"],
  414. ["AK_74","weapon"],
  415. ["M4A1_Aim","weapon"],
  416. ["AKS_74_kobra","weapon"],
  417. ["AKS_74_U","weapon"],
  418. ["AK_47_M","weapon"],
  419. ["M24","weapon"],
  420. ["M1014","weapon"],
  421. ["DMR","weapon"],
  422. ["M4A1","weapon"],
  423. ["M14_EP1","weapon"],
  424. ["UZI_EP1","weapon"],
  425. ["Remington870_lamp","weapon"],
  426. ["glock17_EP1","weapon"],
  427. ["MP5A5","weapon"],
  428. ["MP5SD","weapon"],
  429. ["M4A3_CCO_EP1","weapon"],
  430. ["Binocular","weapon"],
  431. ["ItemFlashlightRed","military"],
  432. ["ItemKnife","military"],
  433. ["ItemGPS","weapon"],
  434. ["ItemMap","military"],
  435. ["MR43","weapon"]
  436. ["m8_base","weapon"],
  437. ["m8_carbineGL","weapon"],
  438. ["SCAR_L_STD_Mk4CQT","weapon"],
  439. ["SCAR_H_LNG_Sniper","weapon"],
  440. ["SCAR_H_LNG_Sniper_SD","weapon"],
  441. ["BAF_L86A2_ACOG","weapon"],
  442. ["SCAR_L_STD_Mk4CQT","weapon"],
  443. ["SCAR_L_STD_EGLM_RCO","weapon"],
  444. ["SCAR_L_CQC_EGLM_Holo","weapon"],
  445. ["SCAR_H_CQC_CCO","weapon"],
  446. ["SCAR_H_STD_EGLM_Spect","weapon"],
  447. ["GrenadeLauncher_EP1","weapon"],
  448. ["Mk13_EP1","weapon"],
  449. ["AKS_74_UN_kobra","weapon"],
  450. ["m8_sharpshooter","weapon"],
  451. ["m8_SAW","weapon"],
  452. ["RPK_74","weapon"],
  453. ["MG36_camo","weapon"],
  454. ["MG36","weapon"],
  455. ["M242","weapon"],
  456.  
  457. ["DZ_ALICE_Pack_EP1","object"], // 16
  458. ["DZ_TK_Assault_Pack_EP1","object"], // 16
  459. ["DZ_British_ACU","object"], // 18
  460. ["DZ_CivilBackpack_EP1","object"], // 24
  461. ["DZ_Backpack_EP1","object"], // 24
  462.  
  463. //Normal
  464. ["","medical"],
  465. ["","generic"],
  466. ["","military"],
  467. //["Body","object"],
  468. ["ItemEtool","weapon"],
  469. ["ItemSandbag","magazine"],
  470. ["Sa58P_EP1","weapon"],
  471. ["Sa58V_EP1","weapon"],
  472. ["BAF_L85A2_RIS_Holo","weapon"]
  473. ];
  474. _itemChance = [
  475. 0.05,
  476. 0.05,
  477. 0.01,
  478. 0.02,
  479. 0.15,
  480. 0.01,
  481. 0.08,
  482. 0.05,
  483. 0.05,
  484. 0.01,
  485. 0.10,
  486. 0.01,
  487. 0.02,
  488. 0.01,
  489. 0.05,
  490. 0.08,
  491. 0.10,
  492. 0.04,
  493. 0.02,
  494. 0.01,
  495. 0.06,
  496. 0.10,
  497. 0.10,
  498. 0.01,
  499. 0.05,
  500. //Bags
  501. 0.08, //16
  502. 0.08, //16
  503. 0.06, //18
  504. 0.01, //24
  505. 0.01, //DZ_Backpack_EP1 24
  506. 0.10,
  507. 1.00,
  508. 2.50,
  509. //0.20,
  510. 0.05,
  511. 0.02,
  512. 0.03,
  513. 0.03,
  514. 0.01,
  515. 0.01,
  516. 0.15,
  517. 0.05,
  518. 0.03,
  519. 0.13,
  520. 0.05,
  521. 0.03,
  522. 0.08,
  523. 0.06,
  524. 0.01,
  525. 0.15,
  526. 0.05,
  527. 0.03,
  528. 0.13,
  529. 0.05,
  530. 0.03,
  531. 0.08,
  532. 0.06,
  533. 0.03,
  534. 0.08,
  535. 0.06
  536. ];
  537. };
  538. case "MilitarySpecial": {
  539. _itemTypes = [
  540. ["M16A2","weapon"],
  541. ["M16A2GL","weapon"],
  542. ["M249_DZ","weapon"],
  543. ["M9SD","weapon"],
  544. //["M136","weapon"],
  545. ["AK_74","weapon"],
  546. ["M4A1_Aim","weapon"],
  547. ["AKS_74_kobra","weapon"],
  548. ["AKS_74_U","weapon"],
  549. ["AK_47_M","weapon"],
  550. ["M24","weapon"],
  551. ["SVD_CAMO","weapon"],
  552. ["M1014","weapon"],
  553. ["M107_DZ","weapon"],
  554. ["DMR","weapon"],
  555. ["M4A1","weapon"],
  556. ["M14_EP1","weapon"],
  557. ["UZI_EP1","weapon"],
  558. ["Remington870_lamp","weapon"],
  559. ["glock17_EP1","weapon"],
  560. ["M240_DZ","weapon"],
  561. ["M4A1_AIM_SD_camo","weapon"],
  562. ["M16A4_ACG","weapon"],
  563. ["M4A1_HWS_GL_camo","weapon"],
  564. ["Mk_48_DZ","weapon"],
  565. ["M4A3_CCO_EP1","weapon"],
  566. //Ammo
  567. ["AmmoBoxSmall_556","object"],
  568. ["AmmoBoxSmall_762","object"],
  569.  
  570. //["NVGoggles","weapon"],
  571. ["Binocular","weapon"],
  572. ["ItemFlashlightRed","military"],
  573. ["ItemKnife","military"],
  574. ["ItemGPS","weapon"],
  575. ["ItemMap","military"],
  576. ["Binocular_Vector","military"],
  577.  
  578. ["DZ_ALICE_Pack_EP1","object"], // 16
  579. ["DZ_TK_Assault_Pack_EP1","object"], // 16
  580. ["DZ_British_ACU","object"], // 18
  581. ["DZ_CivilBackpack_EP1","object"], // 24
  582. ["DZ_Backpack_EP1","object"], // 24
  583.  
  584. ["","medical"],
  585. ["","generic"],
  586. ["","military"],
  587. //["Body","object"],
  588. ["PipeBomb","magazine"],
  589. ["Sa58V_RCO_EP1","weapon"],
  590. ["Sa58V_CCO_EP1","weapon"],
  591. //["G36_C_SD_camo","weapon"],
  592. ["M40A3","weapon"],
  593. ["100Rnd_762x54_PK","magazine"]
  594. ];
  595. _itemChance = [
  596. 0.10,
  597. 0.05,
  598. 0.01,
  599. 0.02,
  600. //0.01, //m136
  601. 0.10,
  602. 0.02,
  603. 0.10,
  604. 0.10,
  605. 0.10,
  606. 0.01,
  607. 0.01,
  608. 0.20,
  609. 0.01,
  610. 0.02,
  611. 0.10,
  612. 0.03,
  613. 0.20,
  614. 0.10,
  615. 0.20,
  616. 0.01,
  617. 0.04,
  618. 0.05,
  619. 0.02,
  620. 0.01,
  621. 0.08,
  622. 0.04,
  623. 0.02,
  624. //0.01, //NVGoggles
  625. 0.10,
  626. 0.05,
  627. 0.15,
  628. 0.01, //ItemGPS
  629. 0.03,
  630. 0.01,
  631. //Bags
  632. 0.08, //16
  633. 0.08, //16
  634. 0.06, //18
  635. 0.01, //24
  636. 0.01, //DZ_Backpack_EP1 24
  637. 0.30,
  638. 1.00,
  639. 5.00, //military
  640. //0.20,
  641. 0.01, //PipeBomb
  642. 0.01, //Sa58V_RCO_EP1
  643. 0.01, //Sa58V_CCO_EP1
  644. //0.01, //["G36_C_SD_camo","weapon"],
  645. 0.02, // M40A3
  646. 0.01 //["100Rnd_762x54_PK","magazine"]
  647. ];
  648. };
  649. case "Hunting": {
  650. _itemTypes = [
  651. ["ItemMap","weapon"],
  652. ["ItemFlashlight","generic"],
  653. ["ItemKnife","generic"],
  654. ["ItemMatchbox","generic"],
  655. ["Crossbow_DZ","weapon"],
  656. ["","military"],
  657. ["WeaponHolder_ItemMachete", "object"],
  658. ["huntingrifle","weapon"],
  659. ["","hunter"]
  660. ];
  661. _itemChance = [
  662. 0.08,
  663. 0.05,
  664. 0.04,
  665. 0.06,
  666. 0.03,
  667. 2.00,
  668. 0.03,
  669. 0.04,
  670. 3.00
  671. ];
  672. };
  673. };
  674. //------------------//
  675. //CUSTOM LOOT SPAWNS//
  676. //------------------//
  677. {
  678. if ((random 1) < _lootChance) then {
  679. _iPos = _obj modelToWorld _x;
  680. _nearBy = nearestObjects [_iPos, ["WeaponHolder","WeaponHolderBase"], 1];
  681. if (count _nearBy == 0) then {
  682. private["_index"];
  683. _weights = [_itemTypes,_itemChance] call fnc_buildWeightedArray;
  684. _index = _weights call BIS_fnc_selectRandom;
  685. _itemType = _itemTypes select _index;
  686. [_itemType select 0, _itemType select 1 , _iPos, 0.0] call spawn_loot;
  687. };
  688. };
  689. } forEach _positions;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement