Randomized Custom Crash Site Loot

Discussion in 'Script/Addon releases' started by Inkko, Oct 16, 2013.

  1. Inkko

    Inkko Valued Member!

    Joined:
    Jan 12, 2013
    Messages:
    697
    Likes Received:
    83
    Randomized Custom Crash Site Loot
    v.1
    *This has been tested on 1.8 to 1.8.0.3 (I usually update it periodically when there is an update to DayZ)​
    What this does is change the server_spawnCrashSite.sqf to beable to make your own loot tables. I have edited it to use a switch case instead of the old way I was doing it so that people would have several loot tables that could be used to add more variety to crash sites. Through my way instead of crash sites using either MilitaryWEST, HeliCrashWEST you are able to make your own loot tables and have as many as you want. Or you could create one main loot table to be used.​
    Requires pbo unpacker, server pbo, and a text editor.​
    • Easy = Blue <10 (if you make your own loot tables it could take longer but I recommend doing so)
    Step 1: Download my server_spawnCrashSite.sqf from here (https://www.dropbox.com/s/znapfivaswjubgb/server_spawnCrashSite.sqf)

    Step 2: Unpack your server pbo and go into your compile folder. Copy my file into it and overwrite the original. (Always make backups just incase!)

    Step 3: Pack back up the pbo and you are done.

    I tried to comment all of my changes I made from the original and kept all the original code in.
    I believe I tried to label areas you can change or swap around for different outcomes.

    Here is an example of how to add more loot tables or remove loot tables, here is what mine looks like below (I shortened it to get my point accross).
    Code:
    _lootTable = ["Weapons1","Weapons2","Weapons3","Weapons4"] call BIS_fnc_selectRandom;
     
    switch (_lootTable) do {
    case "Weapons1": {
    _itemTypes = [["M9","weapon"], ["Huntingrifle","weapon"]];
    _itemChance = [.2, .3];
    };
    case "Weapons2": {
    _itemTypes = [["M9SD","weapon"], ["M4SPR","weapon"]];
    _itemChance = [.2, .5];
    };
    case "Weapons3": {
    _itemTypes = [["Skin_Sniper1_DZ","magazine"], ["Skin_Camo1_DZ","magazine"]];
    _itemChance = [.1, .4];
    };
    case "Weapons4": {
    _itemTypes = [["","military"], ["","generic"]];
    _itemChance = [.5, .1];
    };
    };
    You could create your own shortened loot table or increase it by doing something similar to this.
    Code:
    _lootTable = ["mycustom","mycustom2"] call BIS_fnc_selectRandom;
     
    switch (_lootTable) do {
    case "mycustom": {
    _itemTypes = ["","military"], ["","generic"],["Skin_Sniper1_DZ","magazine"], ["Skin_Camo1_DZ","magazine"]];
    _itemChance = [.2, .3, .5, .1];
    };
    case "mycustom2": {
    _itemTypes = [["M9SD","weapon"], ["M4SPR","weapon"], ["M40A3","weapon"]];
    _itemChance = [.5, .1, .1];
    };
    };
    Another thing you can change is which kind of wrecks have what loot. You could then make it so lets say Mi8 wrecks have only medical loot or whatever else you create in your loot tables.

    Code:
    // can be used to have certain switch cases for certain wrecks
    //selecting loottable
    if (_crashModel == "Mi8Wreck_DZ") then {
    _lootTable = ["Weapons1","Weapons2"] call BIS_fnc_selectRandom;
    } else {
    _lootTable = ["Weapons3","Weapons4"] call BIS_fnc_selectRandom;
    };
    // ^^^ Mi8 wrecks will have weapons1 and weapons2 switch case all others will have weapons3 and weapons4 switch case.
     
    _crashName = getText (configFile >> "CfgVehicles" >> _crashModel >> "displayName");
     
    // _lootTable setup for switch case (comment out if using certain switch cases for certain wrecks)
    //_lootTable = ["Weapons1","Weapons2","Weapons3","Weapons4"] call BIS_fnc_selectRandom;

    Discussion Thread:
    http://opendayz.net/threads/dayz-1-8-0-2-custom-crash-site-loot.14493/

    *Last updated 11/25/13 - Fixed banned weapon in list
    Download link for server_spawnCrashSite.sqf:
    https://www.dropbox.com/s/znapfivaswjubgb/server_spawnCrashSite.sqf
     
    SchwEde and muggerfugger like this.
  2. Inkko

    Inkko Valued Member!

    Joined:
    Jan 12, 2013
    Messages:
    697
    Likes Received:
    83
    SchwEde likes this.

Share This Page