mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Move dze_supplyCrate and vein wrecks to CfgLoot (#1863)
* Move dze_supplyCrate and vein wrecks to CfgLoot Moves both the supply crates and vein wrecks to the CfgLoot tables so admins can customize. Also modifies the main add item statement to allow support for weapons, magazines and backpack refunding/spawning instead of hard coded magazines. Should be backwards compatible with the old style (I did test). * Remove unused _activatingPlayer variable * Rework
This commit is contained in:
@@ -41,6 +41,7 @@ class CfgLoot
|
|||||||
#include "Groups\Weapons.hpp"
|
#include "Groups\Weapons.hpp"
|
||||||
#include "Groups\Clothes.hpp"
|
#include "Groups\Clothes.hpp"
|
||||||
#include "Groups\Backpacks.hpp"
|
#include "Groups\Backpacks.hpp"
|
||||||
|
#include "Groups\Wrecks.hpp"
|
||||||
|
|
||||||
// Points of interest
|
// Points of interest
|
||||||
#include "Groups\CrashSite.hpp"
|
#include "Groups\CrashSite.hpp"
|
||||||
|
|||||||
29
SQF/dayz_code/Configs/CfgLoot/Groups/Wrecks.hpp
Normal file
29
SQF/dayz_code/Configs/CfgLoot/Groups/Wrecks.hpp
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
Land_iron_vein_wreck[] =
|
||||||
|
{
|
||||||
|
{Loot_MAGAZINE,85,PartOre,10,10},
|
||||||
|
{Loot_MAGAZINE,10,PartOreSilver,0,10},
|
||||||
|
{Loot_MAGAZINE,5,PartOreGold,0,5}
|
||||||
|
};
|
||||||
|
|
||||||
|
Land_silver_vein_wreck[] =
|
||||||
|
{
|
||||||
|
{Loot_MAGAZINE,80,PartOreSilver,10,10},
|
||||||
|
{Loot_MAGAZINE,15,PartOreGold,2,6},
|
||||||
|
{Loot_MAGAZINE,5,PartOre,0,1}
|
||||||
|
};
|
||||||
|
|
||||||
|
Land_gold_vein_wreck[] =
|
||||||
|
{
|
||||||
|
{Loot_MAGAZINE,80,PartOreGold,10,10},
|
||||||
|
{Loot_MAGAZINE,15,PartOreSilver,2,6},
|
||||||
|
{Loot_MAGAZINE,5,PartOre,0,1}
|
||||||
|
};
|
||||||
|
|
||||||
|
Land_ammo_supply_wreck[] =
|
||||||
|
{
|
||||||
|
{Loot_MAGAZINE, 20, 2000Rnd_762x51_M134},
|
||||||
|
{Loot_MAGAZINE, 20, 29Rnd_30mm_AGS30},
|
||||||
|
{Loot_MAGAZINE, 20, 50Rnd_127x107_DSHKM},
|
||||||
|
{Loot_MAGAZINE, 20, 48Rnd_40mm_MK19},
|
||||||
|
{Loot_MAGAZINE, 20, 100Rnd_127x99_M2}
|
||||||
|
};
|
||||||
@@ -252,26 +252,26 @@ class Land_iron_vein_wreck: ruins {
|
|||||||
scope = protected;
|
scope = protected;
|
||||||
model = "\z\addons\dayz_epoch\models\iron_vein_wreck.p3d";
|
model = "\z\addons\dayz_epoch\models\iron_vein_wreck.p3d";
|
||||||
displayName = $STR_ORE_VEIN_WRECK_IRON;
|
displayName = $STR_ORE_VEIN_WRECK_IRON;
|
||||||
removeoutput[] = {{"PartOre",{10,10}},{"PartOreSilver",{0,10}},{"PartOreGold",{0,5}}};
|
//removeoutput[] = {{"PartOre",{10,10}},{"PartOreSilver",{0,10}},{"PartOreGold",{0,5}}}; // Moved to CfgLoot group
|
||||||
};
|
};
|
||||||
class Land_silver_vein_wreck: ruins {
|
class Land_silver_vein_wreck: ruins {
|
||||||
scope = protected;
|
scope = protected;
|
||||||
model = "\z\addons\dayz_epoch\models\silver_vein_wreck.p3d";
|
model = "\z\addons\dayz_epoch\models\silver_vein_wreck.p3d";
|
||||||
displayName = $STR_ORE_VEIN_WRECK_SILVER;
|
displayName = $STR_ORE_VEIN_WRECK_SILVER;
|
||||||
removeoutput[] = {{"PartOreSilver",{10,10}},{"PartOre",{0,1}},{"PartOreGold",{6,4}}};
|
//removeoutput[] = {{"PartOreSilver",{10,10}},{"PartOre",{0,1}},{"PartOreGold",{6,4}}}; // Moved to CfgLoot group
|
||||||
};
|
};
|
||||||
class Land_gold_vein_wreck: ruins {
|
class Land_gold_vein_wreck: ruins {
|
||||||
scope = protected;
|
scope = protected;
|
||||||
model = "\z\addons\dayz_epoch\models\gold_vein_wreck.p3d";
|
model = "\z\addons\dayz_epoch\models\gold_vein_wreck.p3d";
|
||||||
displayName = $STR_ORE_VEIN_WRECK_GOLD;
|
displayName = $STR_ORE_VEIN_WRECK_GOLD;
|
||||||
removeoutput[] = {{"PartOreGold",{10,10}},{"PartOre",{0,1}},{"PartOreSilver",{6,4}}};
|
//removeoutput[] = {{"PartOreGold",{10,10}},{"PartOre",{0,1}},{"PartOreSilver",{6,4}}}; // Moved to CfgLoot group
|
||||||
};
|
};
|
||||||
|
|
||||||
class Land_ammo_supply_wreck: ruins {
|
class Land_ammo_supply_wreck: ruins {
|
||||||
scope = protected;
|
scope = protected;
|
||||||
model = "\z\addons\dayz_epoch\models\ammo_supply_wreck.p3d";
|
model = "\z\addons\dayz_epoch\models\ammo_supply_wreck.p3d";
|
||||||
displayName = $STR_EPOCH_BULK_NAME;
|
displayName = $STR_EPOCH_BULK_NAME;
|
||||||
removeoutput[] = {{"100Rnd_762x54_PK",{0,1}},{"29Rnd_30mm_AGS30",{0,1}},{"50Rnd_127x107_DSHKM",{0,1}},{"100Rnd_127x99_M2",{0,1}},{"2000Rnd_762x51_M134",{0,1}},{"48Rnd_40mm_MK19",{0,1}},{"100Rnd_762x51_M240",{0,1}}};
|
//removeoutput[] = {{"100Rnd_762x54_PK",{0,1}},{"29Rnd_30mm_AGS30",{0,1}},{"50Rnd_127x107_DSHKM",{0,1}},{"100Rnd_127x99_M2",{0,1}},{"2000Rnd_762x51_M134",{0,1}},{"48Rnd_40mm_MK19",{0,1}},{"100Rnd_762x51_M240",{0,1}}}; // Moved to CfgLoot group
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,12 @@ dayz_actionInProgress = true;
|
|||||||
delete object from db with extra waiting by [VB]AWOL
|
delete object from db with extra waiting by [VB]AWOL
|
||||||
parameters: _obj
|
parameters: _obj
|
||||||
*/
|
*/
|
||||||
private ["_activatingPlayer","_obj","_objectID","_objectUID","_started","_finished","_animState","_isMedic","_isOk","_proceed","_counter","_limit","_objType","_sfx","_dis","_itemOut","_countOut","_selectedRemoveOutput","_nearestPole","_ownerID","_refundpart","_isWreck","_IsNearPlot","_brokenTool","_removeTool","_isDestructable","_isRemovable","_objOwnerID","_isOwnerOfObj","_preventRefund","_ipos","_item","_radius","_isWreckBuilding","_nameVehicle","_isModular","_success"];
|
private ["_obj","_objectID","_objectUID","_started","_finished","_animState","_isMedic","_isOk","_proceed","_counter","_limit","_objType","_sfx","_dis","_itemOut","_countOut","_selectedRemoveOutput","_nearestPole","_ownerID","_refundpart","_isWreck","_IsNearPlot","_brokenTool","_removeTool","_isDestructable","_isRemovable","_objOwnerID","_isOwnerOfObj","_preventRefund","_ipos","_item","_radius","_isWreckBuilding","_nameVehicle","_isModular","_success","_lootGroupIndex","_output"];
|
||||||
|
|
||||||
player removeAction s_player_deleteBuild;
|
player removeAction s_player_deleteBuild;
|
||||||
s_player_deleteBuild = 1;
|
s_player_deleteBuild = 1;
|
||||||
|
|
||||||
_obj = _this select 3;
|
_obj = _this select 3;
|
||||||
_activatingPlayer = player;
|
|
||||||
_objOwnerID = "0";
|
_objOwnerID = "0";
|
||||||
_isOwnerOfObj = false;
|
_isOwnerOfObj = false;
|
||||||
|
|
||||||
@@ -182,8 +181,7 @@ if (_proceed && _success) then {
|
|||||||
deleteVehicle _obj;
|
deleteVehicle _obj;
|
||||||
|
|
||||||
if(!_isWreck && !_isWreckBuilding) then {
|
if(!_isWreck && !_isWreckBuilding) then {
|
||||||
_activatingPlayer = player;
|
PVDZ_obj_Destroy = [_objectID,_objectUID,player];
|
||||||
PVDZ_obj_Destroy = [_objectID,_objectUID, _activatingPlayer];
|
|
||||||
publicVariableServer "PVDZ_obj_Destroy";
|
publicVariableServer "PVDZ_obj_Destroy";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -203,7 +201,21 @@ if (_proceed && _success) then {
|
|||||||
_selectedRemoveOutput set [count _selectedRemoveOutput,[_refundpart,1]];
|
_selectedRemoveOutput set [count _selectedRemoveOutput,[_refundpart,1]];
|
||||||
} else {
|
} else {
|
||||||
if(_isWreckBuilding) then {
|
if(_isWreckBuilding) then {
|
||||||
_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
|
switch true do {
|
||||||
|
case (_isMine): {
|
||||||
|
_lootGroupIndex = dz_loot_groups find _objType;
|
||||||
|
_output = [_lootGroupIndex,3] call dz_fn_loot_select;
|
||||||
|
|
||||||
|
{_selectedRemoveOutput set [count _selectedRemoveOutput, [_x select 1,[_x select 2,_x select 3]]]} forEach _output;
|
||||||
|
};
|
||||||
|
case (_objType == "Land_ammo_supply_wreck"): {
|
||||||
|
_lootGroupIndex = dz_loot_groups find _objType;
|
||||||
|
_output = [_lootGroupIndex,5] call dz_fn_loot_select;
|
||||||
|
|
||||||
|
{_selectedRemoveOutput set [count _selectedRemoveOutput, [_x select 1,1,_x select 0]]} forEach _output;
|
||||||
|
};
|
||||||
|
default {_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput")};
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
|
_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
|
||||||
_preventRefund = (_objectID == "0" && _objectUID == "0");
|
_preventRefund = (_objectID == "0" && _objectUID == "0");
|
||||||
@@ -245,7 +257,15 @@ if (_proceed && _success) then {
|
|||||||
if (typeName _countOut == "ARRAY") then {
|
if (typeName _countOut == "ARRAY") then {
|
||||||
_countOut = round((random (_countOut select 1)) + (_countOut select 0));
|
_countOut = round((random (_countOut select 1)) + (_countOut select 0));
|
||||||
};
|
};
|
||||||
|
if (count _x > 2) then {
|
||||||
|
switch (_x select 2) do {
|
||||||
|
case 2: {_item addWeaponCargoGlobal [_itemOut,_countOut]};
|
||||||
|
case 3: {_item addMagazineCargoGlobal [_itemOut,_countOut]};
|
||||||
|
case 5: {_item addBackpackCargoGlobal [_itemOut,_countOut]}; // Needs to make sure object can handle Backpacks or will dump on the ground.
|
||||||
|
};
|
||||||
|
} else {
|
||||||
_item addMagazineCargoGlobal [_itemOut,_countOut];
|
_item addMagazineCargoGlobal [_itemOut,_countOut];
|
||||||
|
};
|
||||||
} count _selectedRemoveOutput;
|
} count _selectedRemoveOutput;
|
||||||
|
|
||||||
_item setposATL _iPos;
|
_item setposATL _iPos;
|
||||||
|
|||||||
Reference in New Issue
Block a user