mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 12:12:34 +03:00
Since typed bags spawn in bulk (usually 2x 4 different bag types) this reduces bloodbag output slightly when classic system is enabled. Medboxes were spawning with 3-8 blood bags, this reduces it to about 1-6 which should be similar to 1051 values IIRC. Feel free to adjust this up or down if needed.
48 lines
1.4 KiB
Plaintext
48 lines
1.4 KiB
Plaintext
/*
|
|
Selects random loot from specified group and inserts into a container.
|
|
Loot group should only contain Loot_WEAPON and Loot_MAGAZINE definitions. Others, if selected, will be ignored.
|
|
|
|
Parameters:
|
|
object Vehicle to insert into.
|
|
integer Loot group index in dayz_lootGroups
|
|
integer Number of items to insert.
|
|
|
|
Author:
|
|
Foxy
|
|
*/
|
|
|
|
#include "\z\addons\dayz_code\util\debug.hpp"
|
|
#include "Loot.hpp"
|
|
|
|
{
|
|
switch (_x select 0) do
|
|
{
|
|
case Loot_WEAPON:
|
|
{
|
|
(_this select 0) addWeaponCargoGlobal [_x select 1, 1];
|
|
|
|
Debug_Assert(typeName (_x select 1) == typeName "" && { (_x select 1) != "" });
|
|
//Debug_Log(String_Format2("DEBUG: Loot_Insert Weapon: %1 Vehicle: %2", _x select 1, _this select 0));
|
|
};
|
|
|
|
case Loot_MAGAZINE:
|
|
{
|
|
private "_item";
|
|
_item = _x select 1;
|
|
if (dayz_classicBloodBagSystem && _item in dayz_typedBags) then {
|
|
if (_item in ["bloodTester","bloodBagAPOS","bloodBagABPOS"]) then { // reduce ItemBloodBag output slightly since typed bags spawn in bulk
|
|
_item = ["ItemBandage","ItemPainkiller","ItemMorphine","ItemHeatPack","ItemAntibacterialWipe"] call BIS_fnc_selectRandom;
|
|
} else {
|
|
_item = "ItemBloodbag";
|
|
};
|
|
};
|
|
(_this select 0) addMagazineCargoGlobal [_item, 1];
|
|
};
|
|
|
|
case Loot_BACKPACK:
|
|
{
|
|
(_this select 0) addBackpackCargoGlobal [_x select 1, 1];
|
|
};
|
|
};
|
|
} count Loot_Select(_this select 1, _this select 2);
|
|
//foreach ([_this select 1, _this select 2] call loot_select); |