diff --git a/SQF/dayz_code/Configs/CfgArma.hpp b/SQF/dayz_code/Configs/CfgArma.hpp index 622516e4d..8d61c2afc 100644 --- a/SQF/dayz_code/Configs/CfgArma.hpp +++ b/SQF/dayz_code/Configs/CfgArma.hpp @@ -235,7 +235,7 @@ class CfgSurvival { class Cow01_EP1: Cow{}; class Goat: Default { yield = 4; - rawfoodtype = "FoodmuttonRaw"; + rawfoodtype = "FoodgoatRaw"; }; class Goat01_EP1: Goat{}; class Goat02_EP1: Goat{}; diff --git a/SQF/dayz_code/Configs/CfgMagazines.hpp b/SQF/dayz_code/Configs/CfgMagazines.hpp deleted file mode 100644 index a4f5d5289..000000000 --- a/SQF/dayz_code/Configs/CfgMagazines.hpp +++ /dev/null @@ -1,1723 +0,0 @@ -class CfgMagazines { - class CA_Magazine; // External class reference - - // Ammmo - #include "CfgMagazines\Ammo.hpp" - #include "CfgMagazines\VehicleAmmo.hpp" - - // Gems - #include "CfgMagazines\DZE\Gems.hpp" - #include "CfgMagazines\DZE\Ores.hpp" - // Items - #include "CfgMagazines\DZE\Items.hpp" - #include "CfgMagazines\DZE\Bulk.hpp" - // Currency - #include "CfgMagazines\DZE\Currency\Briefcase.hpp" - #include "CfgMagazines\DZE\Currency\GoldBar.hpp" - #include "CfgMagazines\DZE\Currency\SilverBar.hpp" - #include "CfgMagazines\DZE\Currency\CopperBar.hpp" - #include "CfgMagazines\DZE\Currency\BronzeBar.hpp" - #include "CfgMagazines\DZE\Currency\AluminumBar.hpp" - #include "CfgMagazines\DZE\Currency\TinBar.hpp" - // Building Stuff - #include "CfgMagazines\DZE\ModularBuilding.hpp" - - #include "CfgMagazines\Parts.hpp" - #include "CfgMagazines\Skins.hpp" - - // ItemSoda - #include "CfgMagazines\ItemSoda.hpp" - #include "CfgMagazines\DZE\ItemSoda.hpp" - - class ItemCanvas: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Canvas"; - model = "\z\addons\dayz_epoch\models\canvas.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_canvas_ca.paa"; - descriptionShort = "Canvas Parcel"; - class ItemActions - { - class Crafting - { - text = $STR_EPOCH_PLAYER_190; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"ItemTentOld",1}}; - input[] = {{"ItemCanvas",2},{"ItemPole",2}}; - }; - class Crafting1 - { - text = $STR_EPOCH_PLAYER_191; - script = ";['Crafting1','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"ItemTentDomed",1}}; - input[] = {{"ItemCanvas",3},{"ItemPole",3}}; - }; - class Crafting2 - { - text = $STR_EPOCH_PLAYER_192; - script = ";['Crafting2','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"ItemTentDomed2",1}}; - input[] = {{"ItemCanvas",3},{"ItemPole",3}}; - }; - class Crafting3 - { - text = $STR_EPOCH_PLAYER_193; - script = ";['Crafting3','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"sun_shade_kit",1}}; - input[] = {{"ItemCanvas",1},{"PartWoodLumber",4}}; - }; - class Crafting4 - { - text = $STR_EPOCH_PLAYER_194; - script = ";['Crafting4','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"ItemBurlap",1}}; - input[] = {{"ItemCanvas",2}}; - }; - }; - }; - class ItemBurlap: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Burlap"; - model = "\z\addons\dayz_epoch\models\burlap.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_burlap_ca.paa"; - descriptionShort = "Burlap: A strong cloth like material used for building sandbags"; - class ItemActions - { - class Crafting - { - text = $STR_EPOCH_PLAYER_195; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"sand"}; // todo add sand requirement - requiretools[] = {"ItemEtool","ItemToolbox"}; - output[] = {{"ItemSandbag",1}}; - input[] = {{"ItemBurlap",3}}; - }; - }; - }; - class ItemLightBulb: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Light Bulb"; - model = "\z\addons\dayz_epoch\models\bulb.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_bulb_CA.paa"; - descriptionShort = "Lightbulb: Used in part to create a buildable lamp post. Don't tell me you didn't find this in a barn."; - class ItemActions { - class Crafting - { - text = $STR_EPOCH_PLAYER_196; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemEtool","ItemToolbox"}; - output[] = {{"light_pole_kit",1}}; - input[] = {{"ItemLightBulb",1},{"PartGeneric",1},{"PartWoodLumber",6}}; - }; - }; - }; - - - - class ItemZombieParts: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Zombie Parts"; - model = "\z\addons\dayz_epoch\models\zombie_parts_bag_v2.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_zparts_CA.paa"; - descriptionShort = "Zombie Parts in a Bag: Trade these for Bio Meat at medic traders."; - }; - - class ItemComboLock: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Combination Lock"; - weight = 0.5; - model = "\z\addons\dayz_epoch\models\combo_lock_mag.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_combolock_ca.paa"; - descriptionShort = "Used to secure structures from unauthorized entry."; - - }; - - class ItemCorrugated : CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Corrugated Fence"; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - descriptionShort = "Corrugated Fence: A buildable object used for fortification purposes."; - class ItemActions { - class Build { - text = $STR_EPOCH_PLAYER_214; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "Fence_corrugated_DZ"; - }; - class Crafting - { - text = $STR_EPOCH_PLAYER_215; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemCrowbar"}; - output[] = {{"wooden_shed_kit",1}}; - input[] = {{"ItemCorrugated",2},{"PartWoodPlywood",4},{"PartWoodLumber",4}}; - }; - class Crafting1 - { - text = $STR_EPOCH_PLAYER_217; - script = ";['Crafting1','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemCrowbar"}; - output[] = {{"outhouse_kit",1}}; - input[] = {{"ItemCorrugated",1},{"PartWoodPlywood",3},{"PartWoodLumber",3},{"ItemTrashToiletpaper",1}}; - }; - class Crafting2 - { - text = $STR_EPOCH_PLAYER_216; - script = ";['Crafting2','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemCrowbar"}; - output[] = {{"storage_shed_kit",1}}; - input[] = {{"ItemCorrugated",4},{"PartWoodPlywood",2},{"PartWoodLumber",2}}; - }; - }; - }; - class ItemPole: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Metal Pole"; - model = "\z\addons\dayz_epoch\models\pipe.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_pipe_CA.paa"; - descriptionShort = "Pole: A few sturdy metal poles used to craft tents and other buildables"; - class ItemActions { - class Crafting - { - text = $STR_EPOCH_PLAYER_218; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"fire"}; - requiretools[] = {"ItemToolbox","ItemCrowbar"}; - output[] = {{"ItemCorrugated",1}}; - input[] = {{"ItemPole",2},{"ItemTankTrap",2},{"PartWoodLumber",2}}; - }; - class Crafting1 - { - text = $STR_EPOCH_PLAYER_219; - script = ";['Crafting1','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemCrowbar"}; - output[] = {{"rusty_gate_kit",1}}; - input[] = {{"ItemPole",3},{"ItemTankTrap",1}}; - }; - class Crafting2 - { - text = $STR_EPOCH_PLAYER_220; - script = ";['Crafting2','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemCrowbar"}; - output[] = {{"metal_panel_kit",1}}; - input[] = {{"ItemPole",4},{"ItemTankTrap",4}}; - }; - class Crafting3 - { - text = $STR_EPOCH_PLAYER_305; - script = ";['Crafting3','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemCrowbar"}; - output[] = {{"ItemScaffoldingKit",1}}; - input[] = {{"ItemPole",4},{"ItemTankTrap",2},{"PartWoodLumber",4}}; - }; - }; - }; - class ItemGunRackKit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Gun Rack Kit"; - descriptionShort = "A Gun Rack for 20 weapons"; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 20; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemToolbox"}; - create = "GunRack_DZ"; - }; - }; - }; - class ItemWoodCrateKit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Wood Crate"; - descriptionShort = "A wood crate that holds a lot of items."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 20; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemToolbox"}; - create = "WoodCrate_DZ"; - }; - }; - }; - class ItemOilBarrel: CA_Magazine - { - scope = 2; - count = 1; - // fuelQuantity = 210; - type = 256; - displayName = "Oil Barrel"; - model = "\z\addons\dayz_epoch\models\oil_drum_model.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_oil_drum_model_ca.paa"; - descriptionShort = "210 litres of Oil in a Barrel"; - }; - class ItemFuelBarrel: CA_Magazine - { - scope = 2; - count = 1; - fuelQuantity = 210; - type = 256; - displayName = "Fuel Barrel"; - model = "\z\addons\dayz_epoch\models\oil_drum_model.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_oil_drum_model_ca.paa"; - descriptionShort = "210 litres of fuel per barrel"; - }; - class ItemFuelBarrelEmpty: ItemFuelBarrel - { - scope = 2; - count = 1; - fuelQuantity = 0; - type = 256; - displayName = "Fuel Barrel (Empty)"; - picture = "\z\addons\dayz_epoch\pictures\equip_oildrum_e_CA.paa"; - descriptionShort = "210 litres of fuel per barrel (Empty)"; - class ItemActions { - class Crafting - { - text = $STR_EPOCH_PLAYER_276; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {}; - requiretools[] = {"ItemToolbox","ItemMatchbox_DZE"}; - output[] = {{"ItemFireBarrel_kit",1}}; - input[] = {{"ItemFuelBarrelEmpty",1},{"ItemJerryCan",1},{"PartWoodPile",4}}; - }; - }; - }; - class ItemFireBarrel_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Fire Barrel Kit"; - descriptionShort = "Fire Barrel"; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 45; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemToolbox"}; - create = "FireBarrel_DZ"; - }; - }; - }; - class ItemJerrycan: CA_Magazine - { - scope = 2; - count = 1; - fuelQuantity = 20; - type = 256; - displayName = $STR_EQUIP_NAME_19; - model = "\dayz_equip\models\jerrycan.p3d"; - picture = "\dayz_equip\textures\equip_jerrycan_ca.paa"; - descriptionShort = $STR_EQUIP_DESC_19; - }; - class ItemJerrycanEmpty: ItemJerrycan - { - fuelQuantity = 0; - type = 256; - displayName = $STR_EQUIP_NAME_39; - picture = "\dayz_equip\textures\equip_jerrycan_e_ca.paa"; - descriptionShort = $STR_EQUIP_DESC_39; - }; - - class workbench_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Workbench"; - descriptionShort = "Workbench: Used to craft."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 10; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemToolbox"}; - create = "WorkBench_DZ"; - }; - }; - }; - - // BUILDING KITS - class wood_ramp_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Wood Ramp"; - descriptionShort = "Wood ramp can be used to get air."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "WoodRamp_DZ"; - }; - }; - }; - class 30m_plot_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "30 Meter Plot"; - descriptionShort = "Plot Pole: A placeable pole that will allow you and your friends to build within a 30m radius. Ownership of plot pole is lost after owners death."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "Plastic_Pole_EP1_DZ"; - }; - }; - }; - - class metal_panel_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Metal Panel"; - descriptionShort = "Metal Panel: Strong metal wall used for base defence."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 50; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "MetalPanel_DZ"; - }; - class Crafting - { - text = $STR_EPOCH_PLAYER_228; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop","fire"}; - requiretools[] = {"ItemToolbox","ItemCrowbar","ItemSledge"}; - output[] = {{"metal_floor_kit",1}}; - input[] = {{"metal_panel_kit",4}}; - }; - }; - }; - class deer_stand_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Deer Stand"; - descriptionShort = "Deer Stand: can be used as a lookout."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 25; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "DeerStand_DZ"; - }; - }; - }; - class desert_large_net_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Large Desert Camo Net"; - descriptionShort = "Large Camo Netting: A very large buildable object that can be used to cover objects."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 25; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "DesertLargeCamoNet_DZ"; - }; - }; - }; - class forest_large_net_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Large Forest Camo Net"; - descriptionShort = "Large Camo Netting: A very large buildable object that can be used to cover objects."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 25; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "ForestLargeCamoNet_DZ"; - }; - }; - }; - class desert_net_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Desert Camo Net"; - descriptionShort = "Camo Netting: A buildable object that can be used to cover objects."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 25; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "DesertCamoNet_DZ"; - }; - class Crafting - { - text = $STR_EPOCH_PLAYER_229; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"desert_large_net_kit",1}}; - input[] = {{"desert_net_kit",3}}; - }; - }; - }; - class forest_net_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Forest Camo Net"; - descriptionShort = "Camo Netting: A buildable object that can be used to cover objects."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 25; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "ForestCamoNet_DZ"; - }; - class Crafting - { - text = $STR_EPOCH_PLAYER_229; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"forest_large_net_kit",1}}; - input[] = {{"forest_net_kit",3}}; - }; - }; - }; - class fuel_pump_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Fuel Pump"; - descriptionShort = "Fuel Pump"; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 50; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "FuelPump_DZ"; - }; - }; - }; - class light_pole_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Light Pole"; - descriptionShort = "Light Pole: A buildable object that can be used with a Generator to provide light in times of darkness."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 25; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "LightPole_DZ"; - }; - }; - }; - class stick_fence_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Stick Fence"; - descriptionShort = "Stick Fence: A buildable barrier that can be used to keep zombies out of your camp. They are fairly weak and can be ran over easier."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 15; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "StickFence_DZ"; - }; - }; - }; - class wooden_shed_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Nice Wooden Shed"; - descriptionShort = "Nice Wooden Shed: A crafted object that holds a lot of items/weapons/backpacks and has a door that opens and closes."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 25; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "Wooden_shed_DZ"; - }; - }; - }; - class wood_shack_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Wood Shack"; - descriptionShort = "Wood Shack"; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 25; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "WoodShack_DZ"; - }; - }; - }; - class m240_nest_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "M240 Nest"; - descriptionShort = "M240 Nest"; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 125; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "M240Nest_DZ"; - }; - }; - }; - class sun_shade_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Canvas Sun Shade"; - descriptionShort = "Sun Shade: A buildable object used to keep the sun off your back."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 25; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "CanvasHut_DZ"; - }; - }; - }; - class park_bench_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Wood Bench"; - descriptionShort = "Wood Bench"; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 25; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "ParkBench_DZ"; - }; - }; - }; - class rusty_gate_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Rusty Gate"; - descriptionShort = "Rusty Gate: A buildable object that can be opened and closed."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 25; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "MetalGate_DZ"; - }; - }; - }; - class sandbag_nest_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Sandbag Nest"; - descriptionShort = "Sandbag Nest: A buildable fortification object, can be removed."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 50; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "SandNest_DZ"; - }; - }; - }; - class outhouse_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Outhouse"; - descriptionShort = "Outhouse: A buildable object that you can poop in. Comes pre-stocked with one roll of Toilet Paper."; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 25; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "OutHouse_DZ"; - }; - }; - }; - class storage_shed_kit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Storage Shed"; - descriptionShort = "Storage Shed: A large buildable object that is non enterable and holds a lot of items/weapons/backpacks"; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 75; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "StorageShed_DZ"; - }; - }; - }; - - class ItemGenerator: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = $STR_EQUIP_NAME_31; - model = "\dayz_equip\models\generator_gear.p3d"; - picture = "\dayz_equip\textures\equip_generator_ca.paa"; - descriptionShort = $STR_EQUIP_DESC_31; - weight = 30; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemToolbox"}; - create = "Generator_DZ"; - }; - }; - }; - - class ItemScaffoldingKit: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Scaffolding"; - descriptionShort = ""; - model = "\z\addons\dayz_epoch\models\supply_crate.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_wooden_crate_ca.paa"; - weight = 80; - class ItemActions - { - class Build - { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemEtool","ItemToolbox"}; - create = "Scaffolding_DZ"; - }; - }; - }; - // Custom player vault - class ItemVault: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = $STR_EPOCH_SAFE; - model = "\z\addons\dayz_epoch\models\safe_onside.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_safe_ca.paa"; - descriptionShort = $STR_EPOCH_SAFE_DESC; - class ItemActions - { - class Build { - text = $STR_EPOCH_PLAYER_230; - script = "spawn player_build;"; - require[] = {"ItemToolbox"}; - create = "VaultStorageLocked"; - }; - }; - }; - class ItemLockbox: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Lockbox"; - model = "\z\addons\dayz_epoch\models\lockbox_mag.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_lockbox_CA.paa"; - descriptionShort = "Semi secure lockbox"; - weight = 15; - class ItemActions - { - class Build { - text = $STR_EPOCH_PLAYER_231; - script = "spawn player_build;"; - require[] = {"ItemToolbox"}; - create = "LockboxStorageLocked"; - }; - }; - }; - - - - class PartEngine: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = $STR_EQUIP_NAME_11; - model = "\dayz_equip\models\engine.p3d"; - picture = "\dayz_equip\textures\equip_engine_ca.paa"; - descriptionShort = $STR_EQUIP_DESC_11; - class ItemActions { - class Crafting - { - text = $STR_EPOCH_PLAYER_212; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemCrowbar"}; - output[] = {{"PartGeneric",2}}; - input[] = {{"PartEngine",1}}; - }; - }; - }; - class PartWoodPile: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = $STR_EQUIP_NAME_40; - model = "\dayz_equip\models\woodPile.p3d"; - picture = "\dayz_equip\textures\equip_woodPile_ca.paa"; - descriptionShort = $STR_EQUIP_DESC_40; - class ItemActions { - class Build { - text = $STR_EPOCH_PLAYER_241; - script = "spawn player_build;"; - require[] = {"ItemMatchbox_DZE"}; - create = "Land_Fire_DZ"; - }; - class Crafting - { - text = $STR_EPOCH_PLAYER_242; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"sawmill"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"PartWoodLumber",1}}; - input[] = {{"PartWoodPile",2}}; - }; - class Crafting1 - { - text = $STR_EPOCH_PLAYER_243; - script = ";['Crafting1','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {}; - requiretools[] = {"ItemKnife"}; - output[] = {{"WoodenArrow",3}}; - input[] = {{"PartWoodPile",1},{"ItemTrashRazor",1}}; - - }; - class Crafting2 - { - text = $STR_EPOCH_PLAYER_244; - script = ";['Crafting2','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"stick_fence_kit",1}}; - input[] = {{"PartWoodPile",6}}; - - }; - - }; - }; - class PartPlankPack: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Lumber Pack"; - model = "\z\addons\dayz_epoch\models\plank_pack.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_lumber_pack_CA.paa"; - descriptionShort = "Lumber in a stack"; - weight = 6; - class ItemActions { - class Crafting - { - text = $STR_EPOCH_PLAYER_251; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"sawmill"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"PartWoodLumber",3}}; - input[] = {{"PartPlankPack",1}}; - }; - }; - }; - class CinderBlocks: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Cinder Blocks"; - model = "\z\addons\dayz_epoch\models\cinder_stack.p3d"; - picture = "\z\addons\dayz_epoch\pictures\epuip_cinder_blocks_CA.paa"; - descriptionShort = "Stack of nine cinder blocks"; - weight = 100; - class ItemActions { - class Crafting - { - text = $STR_EPOCH_PLAYER_252; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox"}; - output[] = {{"cinder_wall_kit",1}}; - input[] = {{"CinderBlocks",3},{"MortarBucket",1}}; - }; - class Crafting1 - { - text = $STR_EPOCH_PLAYER_253; - script = ";['Crafting1','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox"}; - output[] = {{"cinder_garage_kit",1}}; - input[] = {{"CinderBlocks",3},{"MortarBucket",1},{"ItemTankTrap",1}}; - }; - class Crafting2 - { - text = $STR_EPOCH_PLAYER_234; - script = ";['Crafting2','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox"}; - output[] = {{"cinder_door_kit",1}}; - input[] = {{"CinderBlocks",4},{"MortarBucket",1},{"ItemTankTrap",1}}; - }; - - - }; - }; - class MortarBucket: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Bucket of Mortar"; - model = "\z\addons\dayz_epoch\models\mortar.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_mortar_CA.paa"; - descriptionShort = "Premixed mastic adhesive that will bond to concrete block."; - weight = 21; - }; - class PartPlywoodPack: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Plywood Pack"; - model = "\z\addons\dayz_epoch\models\plywood_pack.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_plywood_pack_CA.paa"; - descriptionShort = "Plywood in a stack"; - weight = 12; - class ItemActions { - class Crafting - { - text = $STR_EPOCH_PLAYER_251; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"sawmill"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"PartWoodPlywood",3}}; - input[] = {{"PartPlywoodPack",1}}; - }; - - }; - }; - class PartWoodLumber: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Lumber"; - model = "\z\addons\dayz_epoch\models\planks.p3d"; - picture="\z\addons\dayz_epoch\pictures\equip_wood_planks_CA.paa"; - descriptionShort = "Lumber: Used for building many structures and can also be used to make plywood."; - class ItemActions { - class Crafting - { - text = $STR_EPOCH_PLAYER_254; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"sawmill"}; - requiretools[] = {"ItemToolbox"}; - output[] = {{"PartWoodPlywood",1}}; - input[] = {{"PartWoodLumber",2}}; - - }; - class Crafting1 - { - text = $STR_EPOCH_PLAYER_255; - script = ";['Crafting1','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox"}; - output[] = {{"bulk_empty",1}}; - input[] = {{"PartWoodLumber",2},{"PartGeneric",1}}; - - }; - class Crafting2 - { - text = $STR_EPOCH_PLAYER_256; - script = ";['Crafting2','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemCrowbar"}; - output[] = {{"deer_stand_kit",1}}; - input[] = {{"PartWoodLumber",8},{"PartWoodPile",2}}; - - }; - - class Crafting3 - { - text = $STR_EPOCH_PLAYER_257; - script = ";['Crafting3','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox"}; - output[] = {{"ItemWoodStairs",1}}; - input[] = {{"PartWoodLumber",8}}; - - }; - class Crafting4 - { - text = $STR_EPOCH_PLAYER_258; - script = ";['Crafting4','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox"}; - output[] = {{"ItemWoodLadder",1}}; - input[] = {{"PartWoodLumber",8}}; - - }; - class Crafting5 - { - text = $STR_EPOCH_PLAYER_259; - Script = ";['Crafting5','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"sawmill"}; - requiretools[] = {"ItemToolbox"}; - output[] = {{"PartPlankPack",1}}; - input[] = {{"PartWoodLumber",3}}; - }; - class Crafting6 - { - text = $STR_EPOCH_PLAYER_277; - Script = ";['Crafting6','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox"}; - output[] = {{"ItemGunRackKit",1}}; - input[] = {{"PartWoodLumber",6}}; - }; - class Crafting7 - { - text = $STR_EPOCH_PLAYER_304; - Script = ";['Crafting7','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {}; - requiretools[] = {"ItemToolbox"}; - output[] = {{"ItemWoodCrateKit",1}}; - input[] = {{"PartWoodLumber",6}}; - }; - }; - }; - class PartWoodPlywood: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = "Plywood"; - model = "\z\addons\dayz_epoch\models\plywood.p3d"; - picture="\z\addons\dayz_epoch\pictures\equip_plywood_CA.paa"; - descriptionShort = "Plywood: Used for building many structures."; - class ItemActions { - class Crafting - { - text = $STR_EPOCH_PLAYER_260; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {}; - requiretools[] = {"ItemToolbox"}; - output[] = {{"workbench_kit",1}}; - input[] = {{"PartWoodPlywood",1},{"PartWoodLumber",2}}; - - }; - class Crafting1 - { - text = $STR_EPOCH_PLAYER_261; - script = ";['Crafting1','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {}; - requiretools[] = {"ItemToolbox"}; - output[] = {{"wood_shack_kit",1}}; - input[] = {{"PartWoodPlywood",4},{"PartWoodLumber",4}}; - }; - class Crafting2 - { - text = $STR_EPOCH_PLAYER_262; - script = ";['Crafting2','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemCrowbar"}; - output[] = {{"ItemWoodFloorQuarter",1}}; - input[] = {{"PartWoodPlywood",3},{"PartWoodLumber",3}}; - }; - class Crafting3 - { - text = $STR_EPOCH_PLAYER_263; - script = ";['Crafting3','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemCrowbar"}; - output[] = {{"ItemWoodWallThird",1}}; - input[] = {{"PartWoodPlywood",3},{"PartWoodLumber",3}}; - }; - class Crafting4 - { - text = $STR_EPOCH_PLAYER_264; - Script = ";['Crafting4','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"sawmill"}; - requiretools[] = {"ItemToolbox"}; - output[] = {{"PartPlywoodPack",1}}; - input[] = {{"PartWoodPlywood",3}}; - }; - - }; - }; - class PartVRotor: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = $STR_EQUIP_NAME_32; - model = "\dayz_equip\models\vrotor.p3d"; - picture = "\dayz_equip\textures\equip_vrotor_ca.paa"; - descriptionShort = $STR_EQUIP_DESC_32; - class ItemActions { - class Crafting - { - text = $STR_EPOCH_PLAYER_212; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemCrowbar"}; - output[] = {{"PartGeneric",3}}; - input[] = {{"PartVRotor",1}}; - }; - }; - }; - class PartGlass: CA_Magazine - { - scope = 2; - count = 1; - type = 256; - displayName = $STR_EQUIP_NAME_30; - model = "\dayz_equip\models\carglass.p3d"; - picture = "\dayz_equip\textures\equip_carglass_ca.paa"; - descriptionShort = $STR_EQUIP_DESC_30; - }; - - class ItemTent; - class ItemTentOld: ItemTent - { - scope = 2; - count = 1; - type = 256; - displayName = $STR_EQUIP_NAME_20; - model = "\dayz_equip\models\tentbag_gear.p3d"; - picture = "\dayz_equip\textures\equip_tentbag_ca.paa"; - descriptionShort = $STR_EQUIP_DESC_20; - weight = 5; - class ItemActions - { - class Build { - text = $STR_PITCH_TENT; - script = "spawn player_build;"; - require[] = {}; - create = "TentStorage"; - }; - class Crafting - { - text = $STR_EPOCH_PLAYER_270; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"desert_net_kit",1}}; - input[] = {{"ItemTent",2},{"ItemPole",2}}; - }; - class Crafting1 - { - text = $STR_EPOCH_PLAYER_271; - script = ";['Crafting1','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"forest_net_kit",1}}; - input[] = {{"ItemTent",2},{"ItemPole",2}}; - }; - }; - }; - class ItemTentDomed : ItemTent { - scope = 2; - count = 1; - type = 256; - displayName = "Camping Tent Desert"; - model = "\dayz_equip\models\tentbag_gear.p3d"; - picture = "\dayz_equip\textures\equip_tentbag_ca.paa"; - descriptionShort = "A domed camping tent desert that can be pitched, allowing you extended storage."; - - class ItemActions { - class Build { - text = $STR_PITCH_TENT; - script = "spawn player_build;"; - require[] = {}; - create = "TentStorageDomed"; - }; - class Crafting - { - text = $STR_EPOCH_PLAYER_270; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"desert_net_kit",1}}; - input[] = {{"ItemTent",2},{"ItemPole",2}}; - }; - class Crafting1 - { - text = $STR_EPOCH_PLAYER_271; - script = ";['Crafting1','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"forest_net_kit",1}}; - input[] = {{"ItemTent",2},{"ItemPole",2}}; - }; - }; - }; - class ItemTentDomed2 : ItemTent { - scope = 2; - count = 1; - type = 256; - displayName = "Camping Tent Green"; - model = "\dayz_equip\models\tentbag_gear.p3d"; - picture = "\dayz_equip\textures\equip_tentbag_ca.paa"; - descriptionShort = "A domed camping tent desert that can be pitched, allowing you extended storage."; - class ItemActions { - class Build { - text = $STR_PITCH_TENT; - script = "spawn player_build;"; - require[] = {}; - create = "TentStorageDomed2"; - }; - class Crafting - { - text = $STR_EPOCH_PLAYER_270; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"desert_net_kit",1}}; - input[] = {{"ItemTent",2},{"ItemPole",2}}; - }; - class Crafting1 - { - text = $STR_EPOCH_PLAYER_271; - script = ";['Crafting1','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"forest_net_kit",1}}; - input[] = {{"ItemTent",2},{"ItemPole",2}}; - }; - }; - }; - - class ItemSandbag : CA_Magazine { - scope = 2; - count = 1; - type = 256; - displayName = $STR_EQUIP_NAME_21; - model = "\dayz_equip\models\sandbags.p3d"; - picture = "\dayz_equip\textures\equip_sandbag_ca.paa"; - descriptionShort = $STR_EQUIP_DESC_21; - - class ItemActions { - class Build { - text = $STR_EPOCH_PLAYER_272; - script = "spawn player_build;"; - require[] = {"ItemEtool"}; - create = "Sandbag1_DZ"; - }; - class Crafting - { - text = $STR_EPOCH_PLAYER_273; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {}; - requiretools[] = {"ItemEtool","ItemToolbox"}; - output[] = {{"ItemSandbagLarge",1}}; - input[] = {{"ItemSandbag",3},{"ItemWire",1},{"ItemTankTrap",1}}; - }; - class Crafting1 - { - text = $STR_EPOCH_PLAYER_274; - script = ";['Crafting1','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemEtool","ItemToolbox"}; - output[] = {{"sandbag_nest_kit",1}}; - input[] = {{"ItemSandbag",4},{"PartWoodPlywood",2},{"PartWoodLumber",4}}; - }; - class Crafting2 - { - text = $STR_EPOCH_PLAYER_298; - script = ";['Crafting2','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemEtool","ItemToolbox"}; - output[] = {{"BagFenceRound_DZ_kit",1}}; - input[] = {{"ItemSandbag",1}}; - }; - /* - class Crafting3 - { - text = "Craft M240 Nest"; - script = ";['Crafting3','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemEtool","ItemToolbox","M240_DZ"}; - output[] = {{"m240_nest_kit",1}}; - input[] = {{"ItemSandbag",4},{"ItemCanvas",1},{"PartWoodPlywood",4},{"PartWoodLumber",3}}; - inputweapons[] = {"M240_DZ"}; - }; - */ - - }; - }; - - class BagFenceRound_DZ_kit : CA_Magazine { - scope = 2; - count = 1; - type = 256; - displayName = "Round Sandbag Fence"; - model = "\dayz_equip\models\sandbags.p3d"; - picture = "\dayz_equip\textures\equip_sandbag_ca.paa"; - descriptionShort = $STR_EQUIP_DESC_21; - - class ItemActions { - class Build { - text = $STR_EPOCH_PLAYER_299; - script = "spawn player_build;"; - require[] = {"ItemEtool"}; - create = "BagFenceRound_DZ"; - }; - class Crafting - { - text = $STR_EPOCH_PLAYER_300; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {}; - requiretools[] = {"ItemEtool","ItemToolbox"}; - output[] = {{"ItemSandbag",1}}; - input[] = {{"BagFenceRound_DZ_kit",1}}; - }; - }; - }; - - class ItemSledgeHead : CA_Magazine { - scope = 2; - count = 1; - type = 256; - displayName = "Sledgehammer Head"; - model = "\z\addons\dayz_epoch\models\sledge_head.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_sledge_head_ca.paa"; - descriptionShort = "Combine with a handle to make a Sledgehammer"; - weight = 9; - class ItemActions { - class Crafting - { - text = $STR_EPOCH_PLAYER_275; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox"}; - output[] = {}; - outputweapons[] = {"ItemSledge"}; - input[] = {{"ItemSledgeHead",1},{"ItemSledgeHandle",1}}; - }; - }; - }; - class ItemSledgeHandle : CA_Magazine { - scope = 2; - count = 1; - type = 256; - displayName = "Sledgehammer Handle"; - model = "\z\addons\dayz_epoch\models\sledge_handle.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_sledge_handle_ca.paa"; - descriptionShort = "Combine with a head to make a Sledgehammer"; - weight = 1; - class ItemActions { - class Crafting - { - text = $STR_EPOCH_PLAYER_275; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox"}; - output[] = {}; - outputweapons[] = {"ItemSledge"}; - input[] = {{"ItemSledgeHead",1},{"ItemSledgeHandle",1}}; - }; - }; - }; - - class ItemSandbagLarge : CA_Magazine { - scope = 2; - count = 1; - type = 256; - displayName = "H-barrier cube"; - model = "\dayz_equip\models\sandbags.p3d"; // TODO model - picture = "\dayz_equip\textures\equip_sandbag_ca.paa"; - descriptionShort = "Hesco berrier: A buildable object that is used for fortification purposes."; - weight = 50; - class ItemActions { - class Build { - text = "Build H-barrier cube"; - script = "spawn player_build;"; - require[] = {"ItemEtool"}; - create = "Land_HBarrier1_DZ"; - }; - class Crafting - { - text = "Craft Triple H-barrier"; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {}; - requiretools[] = {"ItemEtool","ItemToolbox"}; - output[] = {{"ItemSandbagExLarge",1}}; - input[] = {{"ItemSandbagLarge",3}}; - }; - }; - }; - - - class ItemSandbagExLarge : CA_Magazine { - scope = 2; - count = 1; - type = 256; - displayName = "3 x H-barrier cube"; - model = "\dayz_equip\models\sandbags.p3d"; // TODO model - picture = "\dayz_equip\textures\equip_sandbag_ca.paa"; - descriptionShort = "Hesco berrier: A buildable object that is used for fortification purposes."; - weight = 150; - class ItemActions { - class Build { - text = "Build Triple H-barrier"; - script = "spawn player_build;"; - require[] = {"ItemEtool"}; - create = "Land_HBarrier3_DZ"; - }; - class Crafting - { - text = "Craft 5x H-barrier"; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {}; - requiretools[] = {"ItemEtool","ItemToolbox"}; - output[] = {{"ItemSandbagExLarge5x",1}}; - input[] = {{"ItemSandbagExLarge",1},{"ItemSandbagLarge",2}}; - }; - }; - }; - - class ItemSandbagExLarge5x : CA_Magazine { - scope = 2; - count = 1; - type = 256; - displayName = "5 x H-barrier cube"; - model = "\dayz_equip\models\sandbags.p3d"; // TODO model - picture = "\dayz_equip\textures\equip_sandbag_ca.paa"; - descriptionShort = "Hesco berrier: A buildable object that is used for fortification purposes."; - weight = 200; - class ItemActions { - class Build { - text = "Build 5x H-barrier"; - script = "spawn player_build;"; - require[] = {"ItemEtool"}; - create = "Land_HBarrier5_DZ"; - }; - }; - }; - - class ItemTankTrap : CA_Magazine { - scope = 2; - count = 1; - type = 256; - displayName = $STR_EQUIP_NAME_22; - model = "\dayz_equip\models\tank_trap_kit.p3d"; - picture = "\dayz_equip\textures\equip_tanktrap_kit_CA.paa"; - descriptionShort = $STR_EQUIP_DESC_22; - - class ItemActions { - class Build { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemToolbox"}; - create = "Hedgehog_DZ"; - }; - }; - }; - - class TrapBear : CA_Magazine { - scope = 2; - count = 1; - type = 256; - displayName = "Bear Trap"; - model = "\dayz_equip\models\bear_trap_gear.p3d"; - picture = "\dayz_equip\textures\equip_bear_trap_ca.paa"; - descriptionShort = "Place to add a bear trap"; - - class ItemActions { - class Build { - text = "Place Trap"; - script = "spawn player_setTrap;"; - require[] = {"ItemToolbox"}; - create = "BearTrap_DZ"; - }; - }; - }; - - class ItemWire : CA_Magazine { - scope = 2; - count = 1; - type = 256; - displayName = $STR_EQUIP_NAME_23; - model = "\dayz_equip\models\Fence_wire_kit.p3d"; - picture = "\dayz_equip\textures\equip_fencewire_kit_CA.paa"; - descriptionShort = $STR_EQUIP_DESC_23; - - class ItemActions { - class Build { - text = $STR_ACTIONS_BUILD_EPOCH; - script = "spawn player_build;"; - require[] = {"ItemToolbox"}; - create = "Fort_RazorWire"; - }; - }; - }; - - // Food - #include "CfgMagazines\Food.hpp" - #include "CfgMagazines\DZE\Food.hpp" - - // Waterbottle - #include "CfgMagazines\ItemWaterbottle.hpp" - #include "CfgMagazines\DZE\ItemWaterbottle.hpp" - - #include "CfgMagazines\MeleeSwing.hpp" - - #include "CfgMagazines\Planting.hpp" - - class HandGrenade_Stone; - class ItemTrashToiletpaper : HandGrenade_Stone { - scope = 2; - count = 1; - displayName = $STR_JUNK_NAME_TOILETPAPER; - descriptionShort = $STR_JUNK_DESC_TOILETPAPER; - model = "z\addons\dayz_communityassets\models\toiletpaper.p3d"; - picture = "\z\addons\dayz_communityassets\pictures\equip_toiletpaper_CA.paa"; - type = 256; - ammo = "GrenadeHand_Stone"; - }; - class ItemTrashRazor : CA_Magazine { - scope = 2; - count = 1; - displayName = $STR_JUNK_NAME_RAZOR; - descriptionShort = $STR_JUNK_DESC_RAZOR; - model = "\z\addons\dayz_communityassets\models\razor.p3d"; - picture = "\z\addons\dayz_communityassets\pictures\equip_razor_CA.paa"; - type = 256; - }; - - class ItemKiloHemp : CA_Magazine { - scope = 2; - count = 1; - displayName = "Kilo of Hemp"; - descriptionShort = "Kilo of Hemp"; - weight = 1; - model = "z\addons\dayz_epoch\models\kilohemp.p3d"; - picture = "\z\addons\dayz_epoch\pictures\equip_kilohemp_CA.paa"; - type = 256; - class ItemActions - { - class Crafting - { - text = $STR_EPOCH_PLAYER_269b; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {"workshop"}; - requiretools[] = {"ItemToolbox","ItemKnife"}; - output[] = {{"ItemCanvas",1}}; - input[] = {{"ItemKiloHemp",1}}; - }; - class Crafting1 - { - text = "Craft Hemp Seeds"; - script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;"; - neednearby[] = {""}; - requiretools[] = {"ItemKnife"}; - output[] = {{"ItemHempSeed",5}}; - input[] = {{"ItemKiloHemp",1}}; - }; - }; - }; -}; diff --git a/SQF/dayz_code/NOTE.txt b/SQF/dayz_code/NOTE.txt index 5b687c7cd..0f7497a35 100644 --- a/SQF/dayz_code/NOTE.txt +++ b/SQF/dayz_code/NOTE.txt @@ -18,7 +18,7 @@ CHANGED WEAPON CLASSES Create switchable blood system with variable. Convert (if old system) to ItemBloodbag - +DZE_UseBloodTypes bloodBagANEG bloodBagAPOS bloodBagBNEG bloodBagBPOS bloodBagONEG bloodBagOPOS wholeBloodBagANEG wholeBloodBagAPOS wholeBloodBagBNEG wholeBloodBagBPOS wholeBloodBagONEG wholeBloodBagOPOS @@ -28,4 +28,7 @@ I.E. ItemCrowbar replaces WeaponHolder_MeleeCrowbar WeaponHolder_ItemHatchet_DZE WeaponHolder_MeleeCrowbar -REMOVE TOOL BREAKING, IT'S STUPID \ No newline at end of file +REMOVE TOOL BREAKING, IT'S STUPID + +building_spawnLoot_Legacy +building_spawnZombies_Legacy \ No newline at end of file diff --git a/SQF/dayz_code/compile/building_spawnLoot.sqf b/SQF/dayz_code/compile/building_spawnLoot.sqf index ce6a1020a..776b72aaa 100644 --- a/SQF/dayz_code/compile/building_spawnLoot.sqf +++ b/SQF/dayz_code/compile/building_spawnLoot.sqf @@ -1,117 +1,59 @@ /* - Created exclusively for ArmA2:OA - DayZMod - Please request permission to use/alter/distribute from project leader (R4Z0R49) - Modified for DayZ Epoch by [VB]AWOL vbawol@veteranbastards.com. +Spawns loot at the given building. + +Single parameter: + object building to spawn loot at + +Author: + Foxy */ -private ["_lootChance"]; -_obj = _this; -// lower case to prevent issues with differing case for buildings from map to map. -_type = toLower(typeOf _obj); +#include "\z\addons\dayz_code\util\Vector.hpp" +#include "\z\addons\dayz_code\loot\Loot.hpp" -_config = configFile >> "CfgBuildingLoot" >> _type; -if (DZE_MissionLootTable) then { - _config = missionConfigFile >> "CfgBuildingLoot" >> _type; -}; +private +[ + "_vectorUp", + "_type", + "_config", + "_lootChance", + "_lootPos", + "_lootGroup", + "_worldPos", + "_existingPile", + "_loot" +]; + +_vectorUp = vectorUp _this; +if (Vector_Angle(Vector_UP,_vectorUp) > 20) exitWith { 0 }; + +_type = typeOf _this; +_config = (configFile >> "CfgLoot" >> "Buildings" >> _type); + +if (!isClass _config) exitWith {}; -_pos = [] + getArray (_config >> "lootPos"); -_itemTypes = [] + getArray (_config >> "lootType"); _lootChance = getNumber (_config >> "lootChance"); -//_countPositions = count _pos; -_qty = 0; // effective quantity of spawned weaponholder -_lootSpawnBias = 67; //67 between 50 && 100. The lower it is, the lower chance some of the lootpiles will spawn +if (_lootChance <= 0) exitWith {}; - -// shuffles an array -// parameters: array -// example: _myrandomarray = _myNormalArray call _ShuffleArray; -_ShuffleArray = { - private ["_ar","_rand_array","_rand"]; - _ar = _this; - _rand_array = []; - while {count _ar > 0} do { - _rand = (count _ar); - _rand = floor (random _rand); - _rand_array set [count _rand_array, _ar select _rand]; - _ar set [_rand, "randarray_del"]; - _ar = _ar - ["randarray_del"]; - }; - _rand_array; -}; -_positions = _pos call _ShuffleArray; - -// bias for this building. The lower it is, the lower chance some of the lootpiles will spawn -_bias = 50 max _lootSpawnBias; -_bias = 100 min _bias; -_bias = (_bias + random(100 - _bias)) / 100; -//diag_log(format["BIAS:%1 LOOTCHANCE:%2", _bias, _lootChance]); +_lootPos = getArray (_config >> "lootPos"); +_lootGroup = Loot_GetGroup(getText(_config >> "lootGroup")); { - if (count _x == 3) then { - _rnd = (random 1) / _bias; - _iPos = _obj modelToWorld _x; - _nearBy = nearestObjects [_iPos, ["ReammoBox"], 2]; + //Get the world position of the spawn position + _worldPos = _this modelToWorld _x; + _worldPos set [2, 0 max (_worldPos select 2)]; + + //Delete existing lootpiles within 1m of spawn location + { + deleteVehicle _x; + dayz_currentWeaponHolders = dayz_currentWeaponHolders - 1; + } + foreach (_worldPos nearObjects ["ReammoBox", 1]); - if (count _nearBy > 0) then { - _lootChance = _lootChance + 0.05; - }; - - if (dayz_currentWeaponHolders < dayz_maxMaxWeaponHolders) then { - if (_rnd <= _lootChance) then { - if (count _nearBy == 0) then { - _index = dayz_CBLBase find _type; - _weights = dayz_CBLChances select _index; - _cntWeights = count _weights; - _index = floor(random _cntWeights); - _index = _weights select _index; - _itemType = _itemTypes select _index; - [_itemType select 0, _itemType select 1 , _iPos, 0.0] call spawn_loot; - // diag_log (format["SpawnLoot: Pos: %1, LootType: %2/%3,",_iPos,_itemType select 0,_itemType select 1]); - dayz_currentWeaponHolders = dayz_currentWeaponHolders +1; - //loclout system - _obj setVariable ["looted",diag_tickTime + dayz_tickTimeOffset]; - }; - }; - }; + if (_lootChance > random 1 && {dayz_currentWeaponHolders < dayz_maxMaxWeaponHolders}) then + { + Loot_SpawnGroup(_lootGroup, _worldPos); }; -} count _positions; - -// small loot -_posSmall = [] + getArray (_config >> "lootPosSmall"); -_itemTypesSmall = [] + getArray (_config >> "lootTypeSmall"); - -_positionsSmall = _posSmall call _ShuffleArray; - -{ - if (count _x == 3) then { - _rnd = (random 1) / _bias; - _iPos = _obj modelToWorld _x; - _nearBy = nearestObjects [_iPos, ["ReammoBox"], 2]; - - if (count _nearBy > 0) then { - _lootChance = _lootChance + 0.05; - }; - - if (dayz_currentWeaponHolders < dayz_maxMaxWeaponHolders) then { - if (_rnd <= _lootChance) then { - if (count _nearBy == 0) then { - _index = dayzE_CBLSBase find _type; - _weights = dayzE_CBLSChances select _index; - _cntWeights = count _weights; - _index = floor(random _cntWeights); - _index = _weights select _index; - - //diag_log format["building_spawnLoot.sqf: %1", _itemTypesSmall]; - - _itemType = _itemTypesSmall select _index; - [_itemType select 0, _itemType select 1, _iPos, 0.0] call spawn_loot_small; - // diag_log (format["SpawnLoot: Pos: %1, LootType: %2/%3,",_iPos,_itemType select 0,_itemType select 1]); - dayz_currentWeaponHolders = dayz_currentWeaponHolders +1; - //loclout system - _obj setVariable ["looted",diag_tickTime + dayz_tickTimeOffset]; - }; - }; - }; - }; -} count _positionsSmall; \ No newline at end of file +} +foreach _lootPos; \ No newline at end of file diff --git a/SQF/dayz_code/compile/building_spawnLoot_Legacy.sqf b/SQF/dayz_code/compile/building_spawnLoot_Legacy.sqf new file mode 100644 index 000000000..ce6a1020a --- /dev/null +++ b/SQF/dayz_code/compile/building_spawnLoot_Legacy.sqf @@ -0,0 +1,117 @@ +/* + Created exclusively for ArmA2:OA - DayZMod + Please request permission to use/alter/distribute from project leader (R4Z0R49) + Modified for DayZ Epoch by [VB]AWOL vbawol@veteranbastards.com. +*/ +private ["_lootChance"]; +_obj = _this; + +// lower case to prevent issues with differing case for buildings from map to map. +_type = toLower(typeOf _obj); + +_config = configFile >> "CfgBuildingLoot" >> _type; +if (DZE_MissionLootTable) then { + _config = missionConfigFile >> "CfgBuildingLoot" >> _type; +}; + +_pos = [] + getArray (_config >> "lootPos"); +_itemTypes = [] + getArray (_config >> "lootType"); +_lootChance = getNumber (_config >> "lootChance"); + +//_countPositions = count _pos; +_qty = 0; // effective quantity of spawned weaponholder +_lootSpawnBias = 67; //67 between 50 && 100. The lower it is, the lower chance some of the lootpiles will spawn + + +// shuffles an array +// parameters: array +// example: _myrandomarray = _myNormalArray call _ShuffleArray; +_ShuffleArray = { + private ["_ar","_rand_array","_rand"]; + _ar = _this; + _rand_array = []; + while {count _ar > 0} do { + _rand = (count _ar); + _rand = floor (random _rand); + _rand_array set [count _rand_array, _ar select _rand]; + _ar set [_rand, "randarray_del"]; + _ar = _ar - ["randarray_del"]; + }; + _rand_array; +}; +_positions = _pos call _ShuffleArray; + +// bias for this building. The lower it is, the lower chance some of the lootpiles will spawn +_bias = 50 max _lootSpawnBias; +_bias = 100 min _bias; +_bias = (_bias + random(100 - _bias)) / 100; +//diag_log(format["BIAS:%1 LOOTCHANCE:%2", _bias, _lootChance]); + +{ + if (count _x == 3) then { + _rnd = (random 1) / _bias; + _iPos = _obj modelToWorld _x; + _nearBy = nearestObjects [_iPos, ["ReammoBox"], 2]; + + if (count _nearBy > 0) then { + _lootChance = _lootChance + 0.05; + }; + + if (dayz_currentWeaponHolders < dayz_maxMaxWeaponHolders) then { + if (_rnd <= _lootChance) then { + if (count _nearBy == 0) then { + _index = dayz_CBLBase find _type; + _weights = dayz_CBLChances select _index; + _cntWeights = count _weights; + _index = floor(random _cntWeights); + _index = _weights select _index; + _itemType = _itemTypes select _index; + [_itemType select 0, _itemType select 1 , _iPos, 0.0] call spawn_loot; + // diag_log (format["SpawnLoot: Pos: %1, LootType: %2/%3,",_iPos,_itemType select 0,_itemType select 1]); + dayz_currentWeaponHolders = dayz_currentWeaponHolders +1; + //loclout system + _obj setVariable ["looted",diag_tickTime + dayz_tickTimeOffset]; + }; + }; + }; + }; +} count _positions; + +// small loot +_posSmall = [] + getArray (_config >> "lootPosSmall"); +_itemTypesSmall = [] + getArray (_config >> "lootTypeSmall"); + +_positionsSmall = _posSmall call _ShuffleArray; + +{ + if (count _x == 3) then { + _rnd = (random 1) / _bias; + _iPos = _obj modelToWorld _x; + _nearBy = nearestObjects [_iPos, ["ReammoBox"], 2]; + + if (count _nearBy > 0) then { + _lootChance = _lootChance + 0.05; + }; + + if (dayz_currentWeaponHolders < dayz_maxMaxWeaponHolders) then { + if (_rnd <= _lootChance) then { + if (count _nearBy == 0) then { + _index = dayzE_CBLSBase find _type; + _weights = dayzE_CBLSChances select _index; + _cntWeights = count _weights; + _index = floor(random _cntWeights); + _index = _weights select _index; + + //diag_log format["building_spawnLoot.sqf: %1", _itemTypesSmall]; + + _itemType = _itemTypesSmall select _index; + [_itemType select 0, _itemType select 1, _iPos, 0.0] call spawn_loot_small; + // diag_log (format["SpawnLoot: Pos: %1, LootType: %2/%3,",_iPos,_itemType select 0,_itemType select 1]); + dayz_currentWeaponHolders = dayz_currentWeaponHolders +1; + //loclout system + _obj setVariable ["looted",diag_tickTime + dayz_tickTimeOffset]; + }; + }; + }; + }; +} count _positionsSmall; \ No newline at end of file diff --git a/SQF/dayz_code/compile/building_spawnZombies.sqf b/SQF/dayz_code/compile/building_spawnZombies.sqf index 62a8dded2..6156132db 100644 --- a/SQF/dayz_code/compile/building_spawnZombies.sqf +++ b/SQF/dayz_code/compile/building_spawnZombies.sqf @@ -1,62 +1,71 @@ -private ["_obj","_type","_config","_canLoot","_unitTypes","_min","_max","_num","_zombieChance","_rnd","_position","_positions","_iPos","_nearBy","_noOneNear"]; -//_t1 = diag_tickTime; - -if (dayz_maxCurrentZeds > dayz_maxZeds) exitwith {}; -if (dayz_CurrentZombies > dayz_maxGlobalZombies) exitwith {}; -if (dayz_spawnZombies > dayz_maxLocalZombies) exitwith {}; - -_obj = _this select 0; -_type = typeOf _obj; -_config = configFile >> "CfgBuildingLoot" >> _type; -if (DZE_MissionLootTable) then { - _config = missionConfigFile >> "CfgBuildingLoot" >> _type; +/* + Created exclusively for ArmA2:OA - DayZMod. + Please request permission to use/alter/distribute from project leader (R4Z0R49) +*/ +private ["_wreck","_maxlocalspawned","_maxControlledZombies","_iPos","_nearByZed","_nearByPlayer","_rnd","_positions","_zombieChance","_unitTypes","_min","_max","_num","_clean","_obj","_type","_config","_canLoot","_originalPos","_fastRun","_enabled","_i","_Pos"]; +_obj = _this select 0; +_wreck = false; +if (count _this > 1) then { + _wreck = _this select 1; }; + +_type = typeOf _obj; +_config = configFile >> "CfgLoot" >> "Buildings" >> _type; _canLoot = isClass (_config); +_originalPos = getPosATL _obj; -if (_canLoot) then { - - //Get zombie class - _zombieChance = getNumber (_config >> "zombieChance"); - _rnd = random 1; +_maxlocalspawned = round(dayz_spawnZombies); +//Lets check if we need to divide the amount of zeds +if (r_player_divideinvehicle > 0) then { + _maxlocalspawned = round(dayz_spawnZombies / r_player_divideinvehicle); +}; +_maxControlledZombies = round(dayz_maxLocalZombies); +_enabled = false; + +if (_canLoot ) then { //Get zombie class _unitTypes = getArray (_config >> "zombieClass"); - _min = getNumber (_config >> "minRoaming"); - _max = getNumber (_config >> "maxRoaming"); - - //Walking Zombies - _num = (round(random _max)) max _min; - - _position = getPosATL _obj; - - _noOneNear = (count (_position nearEntities ["CAManBase",30])) == 0; - - if (_noOneNear) then { - - _positions = getArray (_config >> "lootPosZombie"); - - if (count _positions > 0) then { - - { - if (random 1 < _zombieChance) then { - _iPos = _obj modelToWorld _x; - _nearBy = count (_iPos nearEntities ["zZombie_Base",1]) > 0; - if (!_nearBy) then { - [_iPos,true,_unitTypes] call zombie_generate; - }; - }; - } count _positions; - - } else { + _min = getNumber (_config >> "maxRoaming"); + _max = getNumber (_config >> "minRoaming"); + _zombieChance = getNumber (_config >> "zombieChance"); - for "_i" from 1 to _num do - { - if (random 1 < _zombieChance) then { - [_position,true,_unitTypes] call zombie_generate; - }; - }; + //Walking Zombies + _num = (round(random _max)) max _min; // + round(_max / 3); + //diag_log ("Class: " + _type + " / Zombies: " + str(_unitTypes) + " / Walking: " + str(_num)); + + for "_i" from 0 to _num do + { + //_iPos = _obj modelToWorld _originalPos; + if ((_maxlocalspawned < _maxControlledZombies) and (dayz_CurrentNearByZombies < dayz_maxNearByZombies) and (dayz_currentGlobalZombies < dayz_maxGlobalZeds)) then { + [_originalPos,true,_unitTypes,_wreck] call zombie_generate; }; }; - dayz_buildingMonitor set [count dayz_buildingMonitor,_obj]; -}; \ No newline at end of file + //Add Internal Zombies + if ((random 1) < _zombieChance) then { + _clean = {alive _x} count ((getPosATL _obj) nearEntities ["zZombie_Base",(sizeOf _type)]) == 0; + if (_clean) then { + _positions = getArray (_config >> "zedPos"); + //diag_log format["Building: %1 / Positions: %2 / Chance: %3",_type,_positions,_zombieChance]; + { + _Pos = [_x select 0, _x select 1, 0]; + _rnd = random 1; + if (_rnd < _zombieChance) then { + _iPos = _obj modelToWorld _Pos; + _nearByZed = {alive _x} count (_iPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 10)]) > 0; + _nearByPlayer = ({isPlayer _x} count (_iPos nearEntities ["CAManBase",30])) > 0; + //diag_log ("BUILDING: " + _type + " / " + str(_nearByZed) + " / " + str(_nearByPlayer)); + if ((_maxlocalspawned < _maxControlledZombies) and (dayz_CurrentNearByZombies < dayz_maxNearByZombies) and (dayz_currentGlobalZombies < dayz_maxGlobalZeds)) then { + if (!_nearByPlayer and !_nearByZed) then { + [_iPos,false,_unitTypes,false] call zombie_generate; + }; + }; + }; + } forEach _positions; + }; + //dayz_buildingMonitor set [count dayz_buildingMonitor,_obj]; + }; +}; + +//diag_log ("2 end"); \ No newline at end of file diff --git a/SQF/dayz_code/compile/building_spawnZombies_Legacy.sqf b/SQF/dayz_code/compile/building_spawnZombies_Legacy.sqf new file mode 100644 index 000000000..62a8dded2 --- /dev/null +++ b/SQF/dayz_code/compile/building_spawnZombies_Legacy.sqf @@ -0,0 +1,62 @@ +private ["_obj","_type","_config","_canLoot","_unitTypes","_min","_max","_num","_zombieChance","_rnd","_position","_positions","_iPos","_nearBy","_noOneNear"]; +//_t1 = diag_tickTime; + +if (dayz_maxCurrentZeds > dayz_maxZeds) exitwith {}; +if (dayz_CurrentZombies > dayz_maxGlobalZombies) exitwith {}; +if (dayz_spawnZombies > dayz_maxLocalZombies) exitwith {}; + +_obj = _this select 0; +_type = typeOf _obj; +_config = configFile >> "CfgBuildingLoot" >> _type; +if (DZE_MissionLootTable) then { + _config = missionConfigFile >> "CfgBuildingLoot" >> _type; +}; +_canLoot = isClass (_config); + +if (_canLoot) then { + + //Get zombie class + _zombieChance = getNumber (_config >> "zombieChance"); + _rnd = random 1; + + //Get zombie class + _unitTypes = getArray (_config >> "zombieClass"); + _min = getNumber (_config >> "minRoaming"); + _max = getNumber (_config >> "maxRoaming"); + + //Walking Zombies + _num = (round(random _max)) max _min; + + _position = getPosATL _obj; + + _noOneNear = (count (_position nearEntities ["CAManBase",30])) == 0; + + if (_noOneNear) then { + + _positions = getArray (_config >> "lootPosZombie"); + + if (count _positions > 0) then { + + { + if (random 1 < _zombieChance) then { + _iPos = _obj modelToWorld _x; + _nearBy = count (_iPos nearEntities ["zZombie_Base",1]) > 0; + if (!_nearBy) then { + [_iPos,true,_unitTypes] call zombie_generate; + }; + }; + } count _positions; + + } else { + + for "_i" from 1 to _num do + { + if (random 1 < _zombieChance) then { + [_position,true,_unitTypes] call zombie_generate; + }; + }; + }; + }; + + dayz_buildingMonitor set [count dayz_buildingMonitor,_obj]; +}; \ No newline at end of file diff --git a/SQF/dayz_code/compile/client_flies.sqf b/SQF/dayz_code/compile/client_flies.sqf new file mode 100644 index 000000000..544163885 --- /dev/null +++ b/SQF/dayz_code/compile/client_flies.sqf @@ -0,0 +1,61 @@ +// (c) facoptere@gmail.com, licensed to DayZMod for the community + +"PVCDZ_flies" addPublicVariableEventHandler { + //diag_log format [ "%1 -------------------------------- %2", __FILE__, _this ]; + _that = (_this select 1); + _onoff = _that select 0; + _body = _that select 1; + switch _onoff do { + case 0: { + _flies = _body getVariable [ "flies_particle", objNull ]; + if (!isNull _flies) then { + deleteVehicle _flies; + _body setVariable [ "flies_particle", nil ]; + }; + }; + default { + if ((isNull (_body getVariable [ "flies_particle", objNull ])) AND {(rain < 0.25)}) then { + _pos = ASLtoATL eyePos _body; + _pos set [2, 0.5 + (_pos select 2)]; + _interval = 0.1; + _size = 1.5; + //diag_log format [ "%1 adding flies to %2, at %3", __FILE__, _body, _pos ]; + + _flies = "#particlesource" createVehicleLocal _pos; + _body setVariable [ "flies_particle", _flies ]; + _flies setParticleParams + /*Sprite*/ [["\ca\characters2\OTHER\FLY.p3d", 1, 0, 1, 0], "", // File, Ntieth, Index, Count, Loop(Bool) + /*Type*/ "spaceObject", + /*TimmerPer*/ 1, + /*Lifetime*/ 4, + /*Position*/ [0, 0, 0], + /*MoveVelocity*/ [0, 0, 0.5], + /*Simulation*/ 1, 1.30, 1, 0, //rotationVel, weight, volume, rubbing + /*Scale*/ [0.03, 0.03, 0.03, 0], + /*Color*/ [[1, 1, 1, 1],[1, 1, 1, 1]], + /*AnimSpeed*/ [1.5,0.5], + /*randDirPeriod*/ 0.01, + /*randDirIntesity*/ 0.08, + /*onTimerScript*/ "", + /*DestroyScript*/ "", + /*Follow*/ _body]; + + // RANDOM / TOLERANCE PARAMS + _flies setParticleRandom + /*LifeTime*/ [2, + /*Position*/ [_size, _size, 0.25], + /*MoveVelocity*/ [0, 0, 0], + /*rotationVel*/ 1, + /*Scale*/ 0.02, + /*Color*/ [0, 0, 0, 0.1], + /*randDirPeriod*/ 0.01, + /*randDirIntesity*/ 0.03, + /*Angle*/ 10]; + + _flies setDropInterval _interval; + _pos set [2, -0.2 + (_pos select 2)]; + }; + }; + }; +}; + diff --git a/SQF/dayz_code/compile/crashsite_fire.sqf b/SQF/dayz_code/compile/crashsite_fire.sqf new file mode 100644 index 000000000..f6fc56ebb --- /dev/null +++ b/SQF/dayz_code/compile/crashsite_fire.sqf @@ -0,0 +1,74 @@ +/* +Spawns the fire and smoke effect at a crash site. +Based heavily on "\ca\data\particleeffects\scripts\destruction\burn.sqf" + +Single parameter: + object crashsite + +Author: + Foxy +*/ + +#define INTENSITY 2 + +//Local space position of the effects +//Get coordinates from config, if not found use the memory point "smoke" +_position = getArray (configFile >> "CfgVehicles" >> typeOf _this >> "smoke"); +if ((count _position) == 0) then { _position = "smoke" }; + + + +/**** SMOKE ****/ + +_color = 0.8 / INTENSITY; + +_smoke = "#particlesource" createVehicleLocal getpos _this; +_smoke setDropInterval (0.02 * INTENSITY); + +_smoke setParticleParams [ +/*Sprite*/ ["\Ca\Data\ParticleEffects\Universal\Universal", 16, 7, 48], +/*????*/ "", +/*Type*/ "Billboard", +/*Frequency*/ 1, +/*Lifetime*/ 3 * INTENSITY, +/*Position*/ _position, +/*MoveVelocity*/ [0, 0, 0.5 * INTENSITY], +/*Simulation*/ 0, 0.05, 0.04, 0.05, +/*Scale*/ [0.5 + 0.5 * INTENSITY, 3 + 3 * INTENSITY], +/*Color*/ [ +/**/ [_color, _color, _color, 0.2], +/**/ [_color, _color, _color, 1], +/**/ [_color, _color, _color, 1], +/**/ [0.05 + _color, 0.05 + _color, 0.05 + _color, 0.9], +/**/ [0.1 + _color, 0.1 + _color, 0.1 + _color, 0.6], +/**/ [0.2 + _color, 0.2 + _color, 0.2 + _color, 0.3], +/**/ [1, 1, 1, 0] +/**/ ], +/*Animspeed*/ [0.8, 0.3, 0.25], +/*RandDirPeriod*/ 1, +/*RandDirIntensity*/ 0, +/*OnTimerScript*/ "", +/*DestroyScript*/ "", +/*Follow*/ _this]; + +_smoke setParticleRandom [ +/*LifeTime*/ 0.7 * INTENSITY, +/*Position*/ [1 - INTENSITY / 10, 1 - INTENSITY / 10, 1 - INTENSITY / 10], +/*MoveVelocity*/ [0.2 * INTENSITY, 0.2 * INTENSITY, 0.05 * INTENSITY], +/*RotVelocity*/ 0, +/*Scale*/ 0.3, +/*Color*/ [0.05, 0.05, 0.05, 0], +/*RandDirPeriod*/ 0, +/*RandDirIntensity*/ 0]; + + + +/**** LIGHT ****/ + +_light = "#lightpoint" createVehicleLocal getpos _this; +_light setLightBrightness (INTENSITY / 30); +_light setLightAmbient[0.8, 0.6, 0.2]; +_light setLightColor[1, 0.5, 0.4]; +if ((typeName _position) == (typeName [])) + then { _light lightAttachObject [_this, _position]; } + else { _light lightAttachObject [_this, _this selectionPosition _position]; }; \ No newline at end of file diff --git a/SQF/dayz_code/compile/fn_buildWeightedArray.sqf b/SQF/dayz_code/compile/fn_buildWeightedArray.sqf index 5d8425f4e..d9e9d8d7c 100644 --- a/SQF/dayz_code/compile/fn_buildWeightedArray.sqf +++ b/SQF/dayz_code/compile/fn_buildWeightedArray.sqf @@ -5,21 +5,22 @@ scriptName "Functions\arrays\fn_selectRandomWeighted.sqf"; Description: Function to select a random item from an array, taking into account item weights. - The weights should be Numbers between 0 && 1, with a maximum precision of hundreds. - + The weights should be Numbers between 0 and 1, with a maximum precision of hundreds. + Parameter(s): _this select 0: source Array (Array of Any Value) _this select 1: weights (Array of Number) - + Returns: Any Value selected item - + TODO: [*] Algorithm is inefficient? */ -private ["_weights","_weighted"]; -//_array = _this select 0; +private["_weighted"]; + +_array = _this select 0; _weights = _this select 1; /* @@ -31,7 +32,7 @@ if ((count _array) > (count _weights)) exitWith {debugLog "Log: [selectRandomWei //Created weighted array of indices. _weighted = []; -for "_i" from 0 to ((count _weights) - 1) do +for "_i" from 0 to ((count _weights) - 1) do { private ["_weight"]; _weight = _weights select _i; @@ -39,17 +40,17 @@ for "_i" from 0 to ((count _weights) - 1) do //Ensure the weight is a Number. //If it's not, set weight to 0 to exclude it. if ((typeName _weight) != (typeName 0)) then {diag_log "Log: [selectRandomWeighted] Weights should be Numbers; weight set to 0!"; _weight = 0}; - - //The weight should be a Number between 0 && 1. - if (_weight < 0) then {diag_log "Log: [selectRandomWeighted] Weights should be more than || equal to 0; weight set to 0!"; _weight = 0}; - //if (_weight > 1) then {debugLog "Log: [selectRandomWeighted] Weights should be less than || equal to 1; weight set to 1!"; _weight = 1}; - + + //The weight should be a Number between 0 and 1. + if (_weight < 0) then {diag_log "Log: [selectRandomWeighted] Weights should be more than or equal to 0; weight set to 0!"; _weight = 0}; + //if (_weight > 1) then {debugLog "Log: [selectRandomWeighted] Weights should be less than or equal to 1; weight set to 1!"; _weight = 1}; + //Normalize the weight for a precision of hundreds. _weight = round(_weight * 100); - - for "_k" from 0 to (_weight - 1) do + + for "_k" from 0 to (_weight - 1) do { - _weighted = _weighted + [_i]; + _weighted set [(count _weighted), _i]; }; }; _weighted \ No newline at end of file diff --git a/SQF/dayz_code/compile/fn_curTimeStr.sqf b/SQF/dayz_code/compile/fn_curTimeStr.sqf index f3995d03d..426a4df58 100644 --- a/SQF/dayz_code/compile/fn_curTimeStr.sqf +++ b/SQF/dayz_code/compile/fn_curTimeStr.sqf @@ -1,4 +1,5 @@ -private ["_hrStr","_minStr","_curDate","_hr","_min","_strTime"]; +private["_hrStr","_minStr","_strTime"]; + _curDate = date; _hr = _curDate select 3; _min = _curDate select 4; @@ -10,4 +11,4 @@ if (_hr == 0) then {_hrStr = "00"}; if (_min < 10) then {_minStr = format["0%1",_min]} else {_minStr = format["%1",_min]}; if (_min == 0) then {_minStr = "00"}; _strTime = format["%1%2 hrs",_hrStr,_minStr]; -_strTime; \ No newline at end of file +_strTime \ No newline at end of file diff --git a/SQF/dayz_code/compile/fn_damageActions.sqf b/SQF/dayz_code/compile/fn_damageActions.sqf index cdfd897f7..2cde87c1c 100644 --- a/SQF/dayz_code/compile/fn_damageActions.sqf +++ b/SQF/dayz_code/compile/fn_damageActions.sqf @@ -1,4 +1,6 @@ scriptName "Functions\misc\fn_damageActions.sqf"; + +#include "\z\addons\dayz_code\util\array.hpp"; /*********************************************************** ADD ACTIONS FOR A CASUALTY - Function @@ -68,122 +70,190 @@ if (_inVehicle) then { } count _weapons; }; }; + //Check if patients + _crew = crew _vehicle; + if (count _crew > 0) then { + _unconscious_crew = []; + { + if (_x getVariable "NORRN_unconscious") then { + _unconscious_crew set [(count _unconscious_crew), _x] + }; + } forEach _crew; + _patients = (count _unconscious_crew); + if (_patients > 0) then { + if (!r_action_unload) then { + r_action_unload = true; + _vehType = typeOf _vehicle; + _action = _vehicle addAction [format[localize "str_actions_medical_14",_vehType], "\z\addons\dayz_code\medical\load\unLoad_act.sqf",[player,_vehicle], 0, false, true]; + r_player_actions set [count r_player_actions,_action]; + }; + } else { + if (r_action_unload) then { + call fnc_usec_medic_removeActions; + r_action_unload = false; + }; + }; + }; } else { call r_player_removeActions2; r_player_lastVehicle = objNull; r_player_lastSeat = []; }; -if (!isNull _menClose && _hasPatient && !r_drag_sqf && !r_action && !_inVehicle && !r_player_unconscious && _isClose) then { - _unit = cursorTarget; - _isDisallowRefuel = typeOf _unit in ["M240Nest_DZ","MMT_Civ","MMT_USMC","Old_bike_TK_CIV_EP1","Old_bike_TK_INS_EP1"]; - // player reveal _unit; - _vehClose = (getPosATL player) nearEntities [["Car","Tank","Helicopter","Plane","StaticWeapon","Ship"],5]; //nearestObjects [player, ["Car","Tank","Helicopter","Plane","StaticWeapon","Ship"], 5]; - _hasVehicle = ({alive _x} count _vehClose > 0); - _unconscious = _unit getVariable ["NORRN_unconscious", false]; - _lowBlood = _unit getVariable ["USEC_lowBlood", false]; - _injured = _unit getVariable ["USEC_injured", false]; - _inPain = _unit getVariable ["USEC_inPain", false]; - _legsBroke = _unit getVariable ["hit_legs", 0] >= 1; - _armsBroke = _unit getVariable ["hit_hands", 0] >= 1; - _charID = _unit getVariable ["CharacterID", 0]; - _friendlies = player getVariable ["friendlies", []]; - _playerMagazines = magazines player; - _hasBandage = "ItemBandage" in _playerMagazines; - _hasEpi = "ItemEpinephrine" in _playerMagazines; - _hasMorphine = "ItemMorphine" in _playerMagazines; - _hasBlood = "ItemBloodbag" in _playerMagazines; - //_hasToolbox = "ItemToolbox" in items player; - _hasJerry = "ItemJerrycan" in _playerMagazines; - _hasBarrel = "ItemFuelBarrel" in _playerMagazines; - _hasJerryE = "ItemJerrycanEmpty" in _playerMagazines; - _hasBarrelE = "ItemFuelBarrelEmpty" in _playerMagazines; - //_hasEtool = "ItemEtool" in weapons player; - //_hasWire = "ItemWire" in _playerMagazines; - _hasPainkillers = "ItemPainkiller" in _playerMagazines; +if (isPlayer cursorTarget) then { + if (!r_drag_sqf and !r_action and !_inVehicle and !r_player_unconscious and (player distance _menClose < 3)) then { + _unit = cursorTarget; + player reveal _unit; + _isDisallowRefuel = typeOf _unit in ["M240Nest_DZ","MMT_Civ","MMT_USMC","Old_bike_TK_CIV_EP1","Old_bike_TK_INS_EP1"]; + _antibiotics =["ItemAntibiotic","ItemAntibiotic1","ItemAntibiotic2","ItemAntibiotic3","ItemAntibiotic4","ItemAntibiotic5","ItemAntibiotic6"]; + _bloodBags = ["ItemBloodbag","bloodBagANEG","bloodBagAPOS","bloodBagBNEG","bloodBagBPOS","bloodBagABNEG","bloodBagABPOS","bloodBagONEG","bloodBagOPOS"]; - //Allow player to drag - if(_unconscious) then { - r_action = true; - _action1 = _unit addAction [localize "str_actions_medical_01", "\z\addons\dayz_code\medical\drag.sqf",_unit, 0, true, true]; - _action2 = _unit addAction [localize "str_actions_medical_02", "\z\addons\dayz_code\medical\pulse.sqf",_unit, 0, true, true]; - r_player_actions = r_player_actions + [_action1,_action2]; - }; - //Load Vehicle - if (_hasVehicle && _unconscious) then { - _x = 0; - r_action = true; - _unit = _unit; - _vehicle = (_vehClose select _x); - while{((!alive _vehicle) && (_x < (count _vehClose)))} do { - _x = _x + 1; - _vehicle = (_vehClose select _x); - }; - _vehType = typeOf _vehicle; - _action = _unit addAction [format[localize "str_actions_medical_03",_vehType], "\z\addons\dayz_code\medical\load\load_act.sqf",[player,_vehicle,_unit], 0, true, true]; - r_player_actions set [count r_player_actions,_action]; - }; - //Allow player to bandage - if(_injured && _hasBandage) then { - r_action = true; - _action = _unit addAction [localize "str_actions_medical_04", "\z\addons\dayz_code\medical\bandage.sqf",[_unit], 0, true, true, "", ""]; - r_player_actions set [count r_player_actions,_action]; - }; - //Allow player to give Epinephrine - if(_unconscious && _hasEpi) then { - r_action = true; - _action = _unit addAction [localize "str_actions_medical_05", "\z\addons\dayz_code\medical\epinephrine.sqf",[_unit], 0, true, true]; - r_player_actions set [count r_player_actions,_action]; - }; - //Allow player to give Morphine - if((_legsBroke || _armsBroke) && _hasMorphine) then { - r_action = true; - _action = _unit addAction [localize "str_actions_medical_06", "\z\addons\dayz_code\medical\morphine.sqf",[_unit], 0, true, true, "", ""]; - r_player_actions set [count r_player_actions,_action]; - }; - //Allow player to give Painkillers - if(_inPain && _hasPainkillers) then { - r_action = true; - _action = _unit addAction [localize "str_actions_medical_07", "\z\addons\dayz_code\medical\painkiller.sqf",[_unit], 0, true, true, "", ""]; - r_player_actions set [count r_player_actions,_action]; - }; - //Allow player to transfuse blood - if(_lowBlood && _hasBlood) then { - r_action = true; - _action = _unit addAction [localize "str_actions_medical_08", "\z\addons\dayz_code\medical\transfusion.sqf",[_unit], 0, true, true, "", ""]; - r_player_actions set [count r_player_actions,_action]; - }; - - //Repairs - if ((_unit isKindOf "AllVehicles") && !(_unit isKindOf "Man") && !_isDisallowRefuel) then { - _type = TypeOf(_unit); - _typeVeh = getText(configFile >> "cfgVehicles" >> _type >> "displayName"); + _vehClose = (getPosATL player) nearEntities [["Car","Tank","Helicopter","Plane","StaticWeapon","Ship"],5]; //nearestObjects [player, ["Car","Tank","Helicopter","Plane","StaticWeapon","Ship"], 5]; + _hasVehicle = ({alive _x} count _vehClose > 0); + _unconscious = _unit getVariable ["NORRN_unconscious", false]; + _lowBlood = _unit getVariable ["USEC_lowBlood", false]; + _injured = _unit getVariable ["USEC_injured", false]; + _hasSepsis = _unit getVariable ["USEC_Sepsis", false]; + _inPain = _unit getVariable ["USEC_inPain", false]; + _legsBroke = _unit getVariable ["hit_legs", 0] >= 1; + _armsBroke = _unit getVariable ["hit_hands", 0] >= 1; + _infected = _unit getVariable ["USEC_infected", false]; + _charID = _unit getVariable ["CharacterID", 0]; + _friendlies = player getVariable ["friendlies", []]; + _playerMagazines = magazines player; + _hasBandage = "ItemBandage" in magazines player; + _hasSepsisBandage = "ItemSepsisBandage" in magazines player; + _hasEpi = "ItemEpinephrine" in magazines player; + _hasMorphine = "ItemMorphine" in magazines player; + _hasSplint = "equip_woodensplint" in magazines player; + _hasPainkillers = "ItemPainkiller" in magazines player; + _hasAntibiotics = Array_Any(magazines player, {_this in _antibiotics}); + _hasBloodBag = Array_Any(magazines player, {_this in _bloodBags}); + //_hasToolbox = "ItemToolbox" in items player; + _hasJerry = "ItemJerrycan" in _playerMagazines; + _hasBarrel = "ItemFuelBarrel" in _playerMagazines; + _hasJerryE = "ItemJerrycanEmpty" in _playerMagazines; + _hasBarrelE = "ItemFuelBarrelEmpty" in _playerMagazines; + //_hasEtool = "ItemEtool" in weapons player; + //_hasWire = "ItemWire" in _playerMagazines; + _hasPainkillers = "ItemPainkiller" in _playerMagazines; - //CAN WE REFUEL THE OBJECT? - if ((fuel _unit < 1) && (_hasJerry || _hasBarrel)) then { - r_action = true; - _action = _unit addAction [format[localize "str_actions_medical_10",_typeVeh], "\z\addons\dayz_code\actions\refuel.sqf",[], 0, true, true, "", ""]; - r_player_actions set [count r_player_actions,_action]; - }; - //CAN WE siphon fuel from THE OBJECT? - if ((fuel _unit > 0) && (_hasJerryE || _hasBarrelE)) then { - r_action = true; - _action = _unit addAction [format["Siphon fuel from %1",_typeVeh], "\z\addons\dayz_code\actions\siphonFuel.sqf",[], 0, true, true, "", ""]; - r_player_actions set [count r_player_actions,_action]; - }; + //Allow player to drag + if (_hasPatient) then { + if(_unconscious) then { + r_action = true; + _action1 = _unit addAction [localize "STR_UI_GEAR", "\z\addons\dayz_code\actions\openGear.sqf",_unit, 0, true, true]; + _action2 = _unit addAction [localize "str_actions_medical_01", "\z\addons\dayz_code\medical\drag.sqf",_unit, 0, true, true]; + _action3 = _unit addAction [localize "str_actions_medical_02", "\z\addons\dayz_code\medical\pulse.sqf",_unit, 0, true, true]; - } else { - - // should only fire if cursor target is man && not vehicle - if ((isPlayer _unit) && !(_charID in _friendlies)) then { - r_action = true; - _action = _unit addAction ["Tag as friendly", "\z\addons\dayz_code\actions\player_tagFriendly.sqf", [], 0, false, true, "", ""]; - r_player_actions set [count r_player_actions,_action]; + r_player_actions set [count r_player_actions, _action1]; + r_player_actions set [count r_player_actions, _action2]; + r_player_actions set [count r_player_actions, _action3]; + }; + //Load Vehicle + if (_hasVehicle and _unconscious) then { + _y = 0; + r_action = true; + _unit = _unit; + _vehicle = (_vehClose select _y); + while{((!alive _vehicle) and (_y < (count _vehClose)))} do { + _y = _y + 1; + _vehicle = (_vehClose select _y); + _vehType = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName"); + sleep 0.001; + }; + _action = _unit addAction [format[localize "str_actions_medical_03",_vehType], "\z\addons\dayz_code\medical\load\load_act.sqf",[player,_vehicle,_unit], 0, true, true]; + r_player_actions set [count r_player_actions,_action]; + }; + //Allow player to bandage + if(_injured && _hasBandage) then { + r_action = true; + _action = _unit addAction [localize "str_actions_medical_04", "\z\addons\dayz_code\medical\bandage.sqf",[_unit,"ItemBandage"], 0, true, true, "", "'ItemBandage' in magazines player"]; + r_player_actions set [count r_player_actions,_action]; + }; + //Sepsis + if(_hasSepsis and _hasSepsisBandage) then { + r_action = true; + _action = _unit addAction [localize "str_actions_medical_04", "\z\addons\dayz_code\medical\bandage.sqf",[_unit,"ItemSepsisBandage"], 0, true, true, "", "'ItemBandage' in magazines player"]; + r_player_actions set [count r_player_actions,_action]; + }; + //Allow player to give Epinephrine + if(_unconscious && _hasEpi) then { + r_action = true; + _action = _unit addAction [localize "str_actions_medical_05", "\z\addons\dayz_code\medical\epinephrine.sqf",[_unit], 0, true, true]; + r_player_actions set [count r_player_actions,_action]; + }; + //Allow player to give Morphine + if((_legsBroke || _armsBroke) && _hasMorphine) then { + r_action = true; + //_action = _unit addAction [localize "str_actions_medical_06", "\z\addons\dayz_code\medical\morphine.sqf",[_unit], 0, true, true, "", ""]; + _action = _unit addAction [localize "str_actions_medical_06", "\z\addons\dayz_code\medical\brokeBones.sqf",[_unit,"ItemMorphine"], 0, true, true, "", "'ItemMorphine' in magazines player"]; + r_player_actions set [count r_player_actions,_action]; + }; + //Allow player to give equip_woodensplint + if((_legsBroke or _armsBroke) and _hasSplint) then { + r_action = true; + _action = _unit addAction [localize "str_actions_medical_06_splint", "\z\addons\dayz_code\medical\brokeBones.sqf",[_unit,"equip_woodensplint"], 0, true, true, "", "'equip_woodensplint' in magazines player"]; + r_player_actions set [count r_player_actions,_action]; + }; + //Allow player to give Painkillers + if(_inPain && _hasPainkillers) then { + r_action = true; + _action = _unit addAction [localize "str_actions_medical_07", "\z\addons\dayz_code\medical\painkiller.sqf",[_unit], 0, true, true, "", "'ItemPainkiller' in magazines player"]; + r_player_actions set [count r_player_actions,_action]; + }; + //Allow player to transfuse blood + if(_lowBlood && _hasBlood) then { + if (DZE_UseBloodTypes) then { + r_action = true; + _action = _unit addAction [localize "str_actions_medical_08", "\z\addons\dayz_code\medical\transfusion.sqf",[_unit], 0, true, true]; + r_player_actions set [count r_player_actions,_action]; + } else { + r_action = true; + _action = _unit addAction [localize "str_actions_medical_08", "\z\addons\dayz_code\medical\transfusion_NoBloodTypes.sqf",[_unit], 0, true, true, "", ""]; + r_player_actions set [count r_player_actions,_action]; + }; + }; + //Allow player to give antibiotics + if (_infected and _hasAntibiotics) then { + r_action = true; + _action = _unit addAction [localize "str_actions_medical_give_antibiotics", "\z\addons\dayz_code\medical\antibiotics.sqf",[_unit], 0, true, true]; + r_player_actions set [count r_player_actions, _action]; + }; + //Repairs + if ((_unit isKindOf "AllVehicles") && !(_unit isKindOf "Man") && !_isDisallowRefuel) then { + _type = TypeOf(_unit); + _typeVeh = getText(configFile >> "cfgVehicles" >> _type >> "displayName"); + + //CAN WE REFUEL THE OBJECT? + if ((fuel _unit < 1) && (_hasJerry || _hasBarrel)) then { + r_action = true; + _action = _unit addAction [format[localize "str_actions_medical_10",_typeVeh], "\z\addons\dayz_code\actions\refuel.sqf",[], 0, true, true, "", ""]; + r_player_actions set [count r_player_actions,_action]; + }; + //CAN WE siphon fuel from THE OBJECT? + if ((fuel _unit > 0) && (_hasJerryE || _hasBarrelE)) then { + r_action = true; + _action = _unit addAction [format["Siphon fuel from %1",_typeVeh], "\z\addons\dayz_code\actions\siphonFuel.sqf",[], 0, true, true, "", ""]; + r_player_actions set [count r_player_actions,_action]; + }; + } else { + // should only fire if cursor target is man && not vehicle + if ((isPlayer _unit) && !(_charID in _friendlies)) then { + r_action = true; + _action = _unit addAction ["Tag as friendly", "\z\addons\dayz_code\actions\player_tagFriendly.sqf", [], 0, false, true, "", ""]; + r_player_actions set [count r_player_actions,_action]; + }; + + }; + if (r_action) then { + r_action_targets set [(count r_action_targets), _unit]; + }; + if (r_action_unload) then { + r_action_unload = false; + call fnc_usec_medic_removeActions; + }; }; - - }; - if (r_action) then { - r_action_targets = r_action_targets + [_unit]; }; }; @@ -234,6 +304,8 @@ if ((!_isClose || !_hasPatient) && r_action) then { r_action = false; }; +//Monitor +player setVariable ["damageActions", diag_ticktime, false]; //Pain Effects //if (r_player_inpain && !r_player_unconscious) then { // playSound "breath_1"; diff --git a/SQF/dayz_code/medical/transfusion_NoBloodTypes.sqf b/SQF/dayz_code/medical/transfusion_NoBloodTypes.sqf new file mode 100644 index 000000000..0f863471d --- /dev/null +++ b/SQF/dayz_code/medical/transfusion_NoBloodTypes.sqf @@ -0,0 +1,59 @@ +private ["_started","_finished","_animState","_isMedic","_num_removed","_unit","_lastused"]; +// bleed.sqf +_unit = (_this select 3) select 0; +//_lowBlood = _unit getVariable ["USEC_lowBlood", false]; +//_injured = _unit getVariable ["USEC_injured", false]; +//_inPain = _unit getVariable ["USEC_inPain", false]; +//_lastused = _unit getVariable ["LastTransfusion", time]; + +// if (_lastused - time < 60) exitwith {cutText [format[(localize "str_actions_medical_18"),_text] , "PLAIN DOWN"]}; + +call fnc_usec_medic_removeActions; +r_action = false; + +// not possible to transfuse while in a vehicle +if (vehicle player != player) exitWith { }; + +player playActionNow "Medic"; + +[1,1] call dayz_HungerThirst; + +r_interrupt = false; +_animState = animationState player; +r_doLoop = true; +_started = false; +_finished = false; +while {r_doLoop} do { + _animState = animationState player; + _isMedic = ["medic",_animState] call fnc_inString; + if (_isMedic) then { + _started = true; + }; + if (_started && !_isMedic) then { + r_doLoop = false; + _finished = true; + }; + if (r_interrupt) then { + r_doLoop = false; + }; + uiSleep 0.1; +}; +r_doLoop = false; + +if (_finished) then { + //_unit setVariable["LastTransfusion",time,true]; //reserve for self transfusion + _unit setVariable["USEC_lowBlood",false,true]; + _num_removed = ([player,"ItemBloodbag"] call BIS_fnc_invRemove); + if(_num_removed == 1) then { + + /* PVS/PVC - Skaronator */ + PVDZE_send = [_unit,"Transfuse",[_unit,player]]; + publicVariableServer "PVDZE_send"; + + [player,100] call player_humanityChange; + }; +} else { + r_interrupt = false; + player switchMove ""; + player playActionNow "stop"; +}; \ No newline at end of file