Heli-Crash custom loot 1.7.7 [needs work]

is it solves

  • yes

    Votes: 1 33.3%
  • no

    Votes: 2 66.7%

  • Total voters
    3
This is the new code for the crash site replace!

[Code decided to not work anymore idk why i can't figure it out the code is the same it just stopped spawning the choppers!]

Tutorial:

The new code consists of different loot tables: one being random and the other being focused, the loot table is still chosen after this portion of code so the only part really needed to edit is:

Find and add:
Code:
//or just helicrash loottable
    if (_crashModel == "Mi8Wreck_DZ") then {_lootTable = "MilitaryEAST";}
    else    {_lootTable = "MilitaryEAST";};
Find and Replace:
Code:
        _itemTypes =    [] + getArray (configFile >> "CfgBuildingLoot" >> _lootTable >> "lootType");
        _index = dayz_CBLBase  find _lootTable;
        _weights =        dayz_CBLChances select _index;
        _cntWeights = count _weights;
With:
Code:
//Custom loot table
//Mark out new and replace with old if not functioning
// 35 Items
// 35 Chances adding too 1.0 <<---- mast add to 1.0
        _config = configfile >> "CfgBuildingLoot" >> _lootTable;
        _itemTypes = [["", "food"], ["", "MilitaryEAST"], ["MedBox0", "object"], ["AmmoBoxSmall_556", "object"], ["AmmoBoxSmall_762", "object"], ["Skin_Camo1_DZ", "magazine"], ["Skin_Soldier1_DZ", "magazine"], ["Skin_Sniper1_DZ", "magazine"], ["FN_FAL","weapon"], ["FN_FAL_ANPVS4","weapon"], ["M14_EP1","weapon"], ["Mk_48_DZ","weapon"], ["M249_DZ","weapon"], ["M240_DZ","weapon"], ["DMR","weapon"], ["G36C","weapon"], ["G36K","weapon"], ["G36a","weapon"], ["G36C_camo","weapon"], ["G36A_camo","weapon"], ["G36K_camo","weapon"], ["SVD_CAMO","weapon"], ["M24","weapon"], ["M4A1_AIM_SD_camo","weapon"], ["Sa58V_CCO_EP1","weapon"], ["m107_DZ","weapon"], ["BAF_AS50_scoped","weapon"], ["MP5SD","weapon"], ["M40A3","weapon"], ["MP5A5","weapon"], ["M4A3_CCO_EP1","weapon"], ["M4A1_Aim","weapon"], ["m16a4_acg","weapon"], ["M16A2GL","weapon"], ["BAF_L85A2_RIS_Holo","weapon"]];
        _itemChance = [0.06, 0.02, 0.02, 0.01, 0.01, 0.02, 0.02, 0.01, 0.05, 0.01, 0.04, 0.01, 0.06, 0.01, 0.05, 0.06, 0.03, 0.04, 0.03, 0.03, 0.03, 0.04, 0.04, 0.01, 0.08, 0.01, 0.01, 0.03, 0.01, 0.03, 0.03, 0.02, 0.02, 0.04, 0.01,];
        _weights = [];
        _weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
        _cntWeights = count _weights;
        _index = _weights call BIS_fnc_selectRandom;
Also Replace:
Code:
for "_x" from 1 to (round(random _randomizedLoot) + _guaranteedLoot) do {

With:
Code:
for "_x" from 1 to (round(random 4) + 4) do {
 
edited the code with my updated functioning code for it Take a look!

also for those who do not know the spawn radius around the crash site is due too the new

Code:
            _position = [_position,(sizeOf _crashModel)/2,(sizeOf _crashModel),0,0,0,0] call BIS_fnc_findSafePos;
            _position = [_position select 0,_position select 1,0];
 
Back
Top