Update spawn.sqf

Remove check for equip_lever and equip_brick. players can just remove it from the loot config.
This commit is contained in:
A Man
2020-04-02 18:10:34 +02:00
parent 51addea1dc
commit b94d107a49

View File

@@ -35,45 +35,21 @@ _vehicle = objNull;
call { call {
//Spawn a single magazine //Spawn a single magazine
if (_type == Loot_MAGAZINE) exitWith { if (_type == Loot_MAGAZINE) exitWith {
if (dayz_classicBloodBagSystem && _item in dayz_typedBags) then { 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 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; _item = ["ItemBandage","ItemPainkiller","ItemMorphine","ItemHeatPack","ItemAntibacterialWipe"] call BIS_fnc_selectRandom;
} else { } else {
_item = "ItemBloodbag"; _item = "ItemBloodbag";
}; };
}; };
if (!dayz_toolBreaking) then {
if (_item == "equip_lever") then { // The levers are only used if tool breaking is turned on.
_item = ["equip_hose","ItemPlank","equip_nails","ItemLog","equip_brick"] call BIS_fnc_selectRandom;
};
};
if (!dayz_knifeDulling) then {
if (_item == "equip_brick") then { // Bricks are only used to sharpen tools
_item = ["equip_hose","ItemPlank","equip_nails","ItemLog"] call BIS_fnc_selectRandom;
};
};
_vehicle = "WeaponHolder" createVehicle [0,0,0]; _vehicle = "WeaponHolder" createVehicle [0,0,0];
_vehicle addMagazineCargoGlobal [_item, 1]; _vehicle addMagazineCargoGlobal [_item, 1];
// Fix generator spawning half way in the floor by raising z coordinate by .3 meters. // Fix generator spawning half way in the floor by raising z coordinate by .3 meters.
if (_item == "ItemGenerator") then { if (_item == "ItemGenerator") then {
_pos set [2, ((_pos select 2) + .3)]; _pos set [2, ((_pos select 2) + .3)];
}; };
if (_isWater) then {
_vehicle setPos (_pos);
} else {
_vehicle setPosATL (_pos);
};
INCREMENT_WEAPON_HOLDERS
};
//Spawn a single weapon with [0,MAX_WEAPON_MAGAZINES] magazines.
if (_type == Loot_WEAPON) exitWith {
_vehicle = "WeaponHolder" createVehicle [0,0,0];
_vehicle addWeaponCargoGlobal [_item, 1];
if (_isWater) then { if (_isWater) then {
_vehicle setPos (_pos); _vehicle setPos (_pos);
} else { } else {
@@ -81,35 +57,49 @@ call {
}; };
INCREMENT_WEAPON_HOLDERS INCREMENT_WEAPON_HOLDERS
};
//Spawn a single weapon with [0,MAX_WEAPON_MAGAZINES] magazines.
if (_type == Loot_WEAPON) exitWith {
_vehicle = "WeaponHolder" createVehicle [0,0,0];
_vehicle addWeaponCargoGlobal [_item, 1];
if (_isWater) then {
_vehicle setPos (_pos);
} else {
_vehicle setPosATL (_pos);
};
INCREMENT_WEAPON_HOLDERS
_magazines = getArray (configFile >> "CfgWeapons" >> _item >> "magazines"); _magazines = getArray (configFile >> "CfgWeapons" >> _item >> "magazines");
if (count _magazines > 0 && {getNumber (configFile >> "CfgWeapons" >> _item >> "melee") != 1}) then if (count _magazines > 0 && {getNumber (configFile >> "CfgWeapons" >> _item >> "melee") != 1}) then
{ {
_vehicle addMagazineCargoGlobal [_magazines select 0, floor random (MAX_WEAPON_MAGAZINES + 1)]; _vehicle addMagazineCargoGlobal [_magazines select 0, floor random (MAX_WEAPON_MAGAZINES + 1)];
}; };
}; };
//Spawn backpack //Spawn backpack
if (_type == Loot_BACKPACK) exitWith { if (_type == Loot_BACKPACK) exitWith {
_vehicle = _item createVehicle [0,0,0]; _vehicle = _item createVehicle [0,0,0];
// Fix floating backpacks by lowering z coordinate by .15 meters. // Fix floating backpacks by lowering z coordinate by .15 meters.
_pos set [2, ((_pos select 2) - .15)]; _pos set [2, ((_pos select 2) - .15)];
if (_isWater) then { if (_isWater) then {
_vehicle setPos (_pos); _vehicle setPos (_pos);
} else { } else {
_vehicle setPosATL (_pos); _vehicle setPosATL (_pos);
}; };
}; };
//Spawn multiple items from a given group. All but weapons and magazines are ignored. //Spawn multiple items from a given group. All but weapons and magazines are ignored.
if (_type == Loot_PILE) exitWith { if (_type == Loot_PILE) exitWith {
_spawnCount = (_lootInfo select 2) + floor random ((_lootInfo select 3) - (_lootInfo select 2) + 1); _spawnCount = (_lootInfo select 2) + floor random ((_lootInfo select 3) - (_lootInfo select 2) + 1);
_vehicle = "WeaponHolder" createVehicle [0,0,0]; _vehicle = "WeaponHolder" createVehicle [0,0,0];
Loot_InsertCargo(_vehicle, _item, _spawnCount); Loot_InsertCargo(_vehicle, _item, _spawnCount);
if (_isWater) then { if (_isWater) then {
_vehicle setPos (_pos); _vehicle setPos (_pos);
} else { } else {
@@ -117,28 +107,28 @@ call {
}; };
INCREMENT_WEAPON_HOLDERS INCREMENT_WEAPON_HOLDERS
}; };
//Spawn a vehicle //Spawn a vehicle
if (_type == Loot_VEHICLE) exitWith { if (_type == Loot_VEHICLE) exitWith {
_vehicle = _item createVehicle [0,0,0]; _vehicle = _item createVehicle [0,0,0];
_vehicle setDir random 360; _vehicle setDir random 360;
if (_isWater) then { if (_isWater) then {
_vehicle setPos (_pos); _vehicle setPos (_pos);
} else { } else {
_vehicle setPosATL (_pos); _vehicle setPosATL (_pos);
}; };
}; };
//Spawn a container and populate it with loot from a given group //Spawn a container and populate it with loot from a given group
if (_type == Loot_CONTAINER) exitWith { if (_type == Loot_CONTAINER) exitWith {
_vehicle = _item createVehicle [0,0,0]; _vehicle = _item createVehicle [0,0,0];
//Number of items to spawn //Number of items to spawn
_spawnCount = (_lootInfo select 3) + floor random ((_lootInfo select 4) - (_lootInfo select 3) + 1); _spawnCount = (_lootInfo select 3) + floor random ((_lootInfo select 4) - (_lootInfo select 3) + 1);
Loot_InsertCargo(_vehicle, _lootInfo select 2, _spawnCount); Loot_InsertCargo(_vehicle, _lootInfo select 2, _spawnCount);
_vehicle setDir random 360; _vehicle setDir random 360;
if (_isWater) then { if (_isWater) then {
_vehicle setPos (_pos); _vehicle setPos (_pos);
} else { } else {
@@ -146,12 +136,12 @@ call {
}; };
INCREMENT_WEAPON_HOLDERS INCREMENT_WEAPON_HOLDERS
}; };
//Call a function which is assumed to return an object reference. //Call a function which is assumed to return an object reference.
if (_type == Loot_CUSTOM) exitWith { if (_type == Loot_CUSTOM) exitWith {
_vehicle = call (_item); _vehicle = call (_item);
if ((typeName _vehicle) != "OBJECT") exitWith {}; if ((typeName _vehicle) != "OBJECT") exitWith {};
if (!isNull _vehicle) then { if (!isNull _vehicle) then {
if (_isWater) then { if (_isWater) then {
_vehicle setPos (_pos); _vehicle setPos (_pos);