Editing Heli-Crash Loot - 1.7.6.1
By: Unkinhead
Credits: Inkko
Unpack your server.pbo with PBOview (or another PBO unpacker)
Open server_spawnCrashSite.sqf and look for this chunk of code.
Code:
_num = round(random _randomizedLoot) + _guaranteedLoot;
_config = configFile >> "CfgBuildingLoot" >> _lootTable;
_itemTypes = [] + getArray (_config >> "itemType");
_index = dayz_CBLBase find "HeliCrash";
_weights = dayz_CBLChances select _index;
_cntWeights = count _weights;
Replace it with:
Code:
_num = round(random 4) + 4;
_config = configFile >> "CfgBuildingLoot" >> _lootTable;
_itemTypes = [["SCAR_H_LNG_Sniper", "weapon"], ["FN_FAL","weapon"], ["M14_EP1","weapon"], ["FN_FAL_ANPVS4","weapon"], ["Mk_48_DZ","weapon"], ["M249_DZ","weapon"], ["BAF_L85A2_RIS_SUSAT","weapon"], ["DMR","weapon"], ["G36C","weapon"], ["G36C_camo","weapon"], ["SCAR_H_CQC_CCO", "weapon"], ["G36_C_SD_camo","weapon"], ["G36A_camo","weapon"], ["G36K_camo","weapon"], ["", "military"], ["MedBox0", "object"], ["NVGoggles", "weapon"], ["AmmoBoxSmall_556", "object"], ["AmmoBoxSmall_762", "object"], ["Skin_Camo1_DZ", "magazine"], ["Skin_Soldier1_DZ", "magazine"], ["Skin_Sniper1_DZ", "magazine"], ["SVD_CAMO","weapon"], ["M24","weapon"], ["M4A1_AIM_SD_camo","weapon"], ["Sa58P_EP1","weapon"], ["Sa58V_CCO_EP1","weapon"], ["Sa58V_EP1","weapon"], ["Sa58V_RCO_EP1","weapon"], ["M4SPR","weapon"]];
_itemChance = [0.01, 0.02, 0.05, 0.01, 0.03, 0.05, 0.01, 0.06, 0.03, 0.02, 0.01, 0.01, 0.02, 0.02, 0.9, 0.09, 0.01, 0.5, 0.05, 0.05, 0.01, 0.05, 0.05, 0.04, 0.03, 0.05, 0.05, 0.05, 0.04, 0.05];
_weights = [];
_weights = [_itemType,_itemChance] call fnc_buildWeightedArray;
_cntWeights = count _weights;
_index = _weights call BIS_fnc_selectRandom;
Then, find this portion:
Code:
//Crash loot - just uncomment the one you wish to use by default with 50cals is enabled.
//Table including 50 cals
_lootTable = ["Military","HeliCrash","MilitarySpecial"] call BIS_fnc_selectRandom;
//Table without 50 cals
//_lootTable = ["Military","HeliCrash_No50s","MilitarySpecial"] call BIS_fnc_selectRandom;
And replace it with:
Code:
//Crash loot - just uncomment the one you wish to use by default with 50cals is enabled.
//Table including 50 cals
_lootTable = ["Military"] call BIS_fnc_selectRandom;
//Table without 50 cals
//_lootTable = ["Military","HeliCrash_No50s","MilitarySpecial"] call BIS_fnc_selectRandom;
EDITING:
Change this line accordingly to your liking:
Code:
_num = round(random 4) + 4;
This means that a random number up to 4, + 4 will be the amount of loot that drops.
You can change either number to your liking. (EX: _num = round(random 2) + 3; means that a heli crash will have up to 2 random loot drops, and 3 indefinitely.
And the real editing with loot customization:
Code:
_itemTypes = []
and
Code:
_itemChance = []
I have already filled them in to give you an idea of how it is inserted, but essentially, for itemTypes =, you just need to insert the class name that you want to spawn, and then correspond that with the itemChance = (decimal value). MAKE SURE, that you have itemTypes and itemChance match in regarding to order, EX:
_itemTypes = [["SCAR_H_LNG_Sniper", "weapon"]];
_itemChance = [0.01];
The above will then connect to eachother because they are aligned correctly...To put it simply: First item in itemTypes uses the first item in itemChance.
ALSO, make sure that when adding a itemtype + itemchance you DON'T put a comma on the last item in the each list (itemTypes + itemChance) --- This also means adding a comma to the second last thing on the list when adding a new one.
When your done customizing repack with pboview and upload! you're done!
Also, this should help for getting class names
--- http://dayzsuperhive.co.uk/object-library.html