Remove DayZ Mod crafting and replace it with epoch crafting

- All dayz mod recipe were moved to epoch crafting.
- This disables the craft dialog in the diary too.
- The player_craftitem got updated and can handle all dayz mod recipes now.
- A few wooden recipes got updated with an need nails now.
- player_craftitem shows all items that are needed for crafting now, no longer only one missing part.
- Add a systemchat text for missing tools, so it can be checked later in the chat.
This commit is contained in:
A Man
2020-05-11 19:55:28 +02:00
parent 9c19e13418
commit 8315d8999b
19 changed files with 419 additions and 183 deletions

View File

@@ -1,34 +1,3 @@
class CfgCrafting {
class Recipe {
displayName = "Generic Recipe";
input[] = {}; //Items consumed during crafting
output[] = {}; //Items created from crafting
required[] = {}; //Items needed for but not consumed during crafting
failChance = 0;
};
//Completed
//Weapons
#include "Recipes\Weapons\NailedBaseballBat.hpp"
#include "Recipes\Weapons\BaseBallBatBarbed.hpp"
#include "Recipes\Weapons\Crossbow.hpp"
//Medical
#include "Recipes\Medical\Bandage.hpp"
#include "Recipes\Medical\sepsisBandage.hpp"
#include "Recipes\Medical\woodensplint.hpp"
#include "Recipes\Medical\HerbalDrink.hpp"
//ammo
//#include "Recipes\Ammo\WoodenArrow.hpp"
//other
#include "Recipes\Other\woodencrate.hpp"
#include "Recipes\Other\nails.hpp"
#include "Recipes\Other\BackPack.hpp"
//#include "Recipes\Other\woodenCraftTable.hpp"
//Traps
#include "Recipes\Traps\TrapBearTrapFlare.hpp"
#include "Recipes\Traps\TrapBearTrapSmoke.hpp"
#include "Recipes\Traps\TrapTripwireCans.hpp"
#include "Recipes\Traps\TrapTripwireFlare.hpp"
#include "Recipes\Traps\TrapTripwireGrenade.hpp"
#include "Recipes\Traps\TrapTripwireSmoke.hpp"
};

View File

@@ -19,6 +19,24 @@ class TrapBear : CA_Magazine
consume[] = {"TrapBear"};
create = "BearTrap_DZ";
};
class Crafting
{
text = $STR_ITEM_NAME_BEAR_TRAP_FLARE;
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {"ItemToolbox"};
output[] = {{"ItemTrapBearTrapFlare",1}};
input[] = {{"equip_string",1},{"TrapBear",1},{"PartWoodPile",1},{"equip_duct_tape",1},{"HandRoadFlare",1}};
};
class Crafting1
{
text = $STR_ITEM_NAME_BEAR_TRAP_SMOKE;
script = ";['Crafting1','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {"ItemToolbox"};
output[] = {{"ItemTrapBearTrapSmoke",1}};
input[] = {{"equip_string",1},{"TrapBear",1},{"PartWoodPile",1},{"equip_duct_tape",1},{"SmokeShell",1}};
};
};
};

View File

@@ -93,7 +93,25 @@ class ItemPlasticWaterBottleBoiled : ItemWaterBottle
infectionChance = 0;
consumeOutput = "ItemPlasticWaterbottleUnfilled";
containerEmpty = "ItemPlasticWaterbottleUnfilled";
};
class ItemActions
{
class Crafting
{
text = $STR_CRAFTING_HERBALDRINK;
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {};
output[] = {{"ItemPlasticWaterBottleHerbal",1}};
input[] = {{"equip_herb_box",1},{"ItemPlasticWaterBottleBoiled",1}};
};
class Empty
{
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
};
};
class ItemPlasticWaterBottleHerbal : ItemWaterBottle
{

View File

@@ -46,6 +46,24 @@ class ItemWaterBottleBoiled : ItemWaterBottle
descriptionShort = $STR_ITEMWATERBOTTLEBOILED_CODE_DESC;
infectionChance = 0;
class ItemActions
{
class Crafting
{
text = $STR_CRAFTING_HERBALDRINK;
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {};
output[] = {{"ItemWaterBottleHerbal",1}};
input[] = {{"equip_herb_box",1},{"ItemWaterBottleBoiled",1}};
};
class Empty
{
text = $STR_EQUIP_NAME_13_EMPTY;
script = "spawn player_emptyContainer";
};
};
};
class ItemWaterBottleHerbal : ItemWaterBottle

View File

@@ -17,6 +17,14 @@ class PartGeneric : CA_Magazine
output[] = {{"ItemPole",1}};
input[] = {{"PartGeneric",2}};
};
class Crafting1 {
text = $STR_CRAFTING_NAILS;
script = ";['Crafting1','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {"fire"};
requiretools[] = {"ItemToolbox"};
output[] = {{"equip_nails",4}};
input[] = {{"PartGeneric",2}};
};
};
};

View File

@@ -102,8 +102,8 @@ class equip_pvc_box : CA_Magazine {
count = 1;
displayName = $STR_ITEM_NAME_equip_pvc_box;
descriptionShort = $STR_ITEM_DESC_equip_pvc_box;
model = "\z\addons\dayz_communityassets\models\plastic_box.p3d";
picture = "\z\addons\dayz_communityassets\pictures\equip_plastic_box_ca.paa";
model = "\z\addons\dayz_communityassets\models\plastic_box.p3d";
picture = "\z\addons\dayz_communityassets\pictures\equip_plastic_box_ca.paa";
type = 256;
};

View File

@@ -3,7 +3,6 @@ class ItemFertilizer: CA_Magazine {
count = 1;
displayName = $STR_CRAFT_NAME_FERTILIZER;
descriptionShort = $STR_CRAFT_DESC_FERTILIZER;
weight = 0.1;
picture = "\z\addons\dayz_epoch_w\magazine\ui\m_fertilizer_ca.paa";
model = "\z\addons\dayz_epoch_w\magazine\dze_fertilizer.p3d";
type = 256;
@@ -14,7 +13,6 @@ class ItemPumpkinSeed: CA_Magazine {
count = 1;
displayName = $STR_CRAFT_NAME_PUMPKIN_SEED;
descriptionShort = $STR_CRAFT_DESC_PUMPKIN_SEED;
weight = 0.1;
model = "\z\addons\dayz_epoch\models\doc_child1.p3d"; // TODO: model + icon
picture = "\z\addons\dayz_epoch\pictures\equip_child1_ca.paa";
type = 256;
@@ -36,7 +34,6 @@ class ItemPumpkinPlant: CA_Magazine {
count = 1;
displayName = $STR_CRAFT_NAME_PUMPKIN_PLANT;
descriptionShort = $STR_CRAFT_DESC_PUMPKIN_PLANT;
weight = 0.1;
model = "\z\addons\dayz_epoch\models\doc_child1.p3d"; // TODO: model + icon
picture = "\z\addons\dayz_epoch\pictures\equip_child1_ca.paa";
type = 256;
@@ -56,7 +53,6 @@ class ItemHempSeed: CA_Magazine {
count = 1;
displayName = $STR_CRAFT_NAME_HEMP_SEED;
descriptionShort = $STR_CRAFT_DESC_HEMP_SEED;
weight = 0.1;
model = "\z\addons\dayz_epoch\models\doc_child2.p3d"; // TODO: model + icon
picture = "\z\addons\dayz_epoch\pictures\equip_child2_ca.paa";
type = 256;
@@ -78,7 +74,6 @@ class ItemHempPlant: CA_Magazine {
count = 1;
displayName = $STR_CRAFT_NAME_HEMP_PLANT;
descriptionShort = $STR_CRAFT_DESC_HEMP_PLANT;
weight = 0.1;
model = "\z\addons\dayz_epoch\models\doc_child2.p3d"; // TODO: model + icon
picture = "\z\addons\dayz_epoch\pictures\equip_child2_ca.paa";
type = 256;
@@ -99,7 +94,6 @@ class ItemKiloHemp : CA_Magazine
count = 1;
displayName = $STR_EPOCH_KILOOFHEMP;
descriptionShort = $STR_EPOCH_KILOOFHEMP_DESC;
weight = 1;
model = "z\addons\dayz_epoch\models\kilohemp.p3d";
picture = "\z\addons\dayz_epoch\pictures\equip_kilohemp_CA.paa";
type = 256;
@@ -132,7 +126,6 @@ class ItemKiloTobacco : CA_Magazine
count = 1;
displayName = $STR_EPOCH_KILOTOBACCO;
descriptionShort = $STR_EPOCH_KILOTOBACCO_DESC;
weight = 1;
model = "z\addons\dayz_epoch\models\kilohemp.p3d";
picture = "\z\addons\dayz_epoch\pictures\equip_kilohemp_CA.paa";
type = 256;

View File

@@ -7,6 +7,7 @@ class ItemCanvas: CA_Magazine
model = "\z\addons\dayz_epoch\models\canvas.p3d";
picture = "\z\addons\dayz_epoch\pictures\equip_canvas_ca.paa";
descriptionShort = $STR_EPOCH_CANVAS_DESC;
class ItemActions
{
class Crafting
@@ -56,6 +57,7 @@ class ItemCanvas: CA_Magazine
};
};
};
class ItemBurlap: CA_Magazine
{
scope = public;
@@ -65,13 +67,14 @@ class ItemBurlap: CA_Magazine
model = "\z\addons\dayz_epoch\models\burlap.p3d";
picture = "\z\addons\dayz_epoch\pictures\equip_burlap_ca.paa";
descriptionShort = $STR_EPOCH_BURLAP_DESC;
class ItemActions
{
class Crafting
{
text = $STR_EPOCH_PLAYER_195;
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {"sand"}; // todo add sand requirement
neednearby[] = {};
requiretools[] = {"ItemEtool","ItemToolbox"};
output[] = {{"ItemSandbag",1}};
input[] = {{"ItemBurlap",3}};
@@ -87,6 +90,20 @@ class equip_rag : CA_Magazine {
model = "\z\addons\dayz_communityassets\models\rag_clean.p3d";
picture = "\z\addons\dayz_communityassets\pictures\equip_rag_clean_ca.paa";
type = 256;
class ItemActions
{
class Crafting
{
text = $STR_EPOCH_PLAYER_269;
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {"ItemKnife"};
output[] = {{"ItemBandage",2}};
outputweapons[] = {};
input[] = {{"equip_gauze",2},{"equip_rag",1},{"equip_string",1}};
};
};
};
class equip_string : CA_Magazine {
@@ -94,9 +111,59 @@ class equip_string : CA_Magazine {
count = 1;
displayName = $STR_ITEM_NAME_equip_string;
descriptionShort = $STR_ITEM_DESC_equip_string;
model = "\z\addons\dayz_communityassets\models\string.p3d";
model = "\z\addons\dayz_communityassets\models\string.p3d";
picture = "\z\addons\dayz_communityassets\pictures\equip_string_ca.paa";
type = 256;
class ItemActions
{
class Crafting
{
text = $STR_EPOCH_PLAYER_269;
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {"ItemKnife"};
output[] = {{"ItemBandage",2}};
outputweapons[] = {};
input[] = {{"equip_gauze",2},{"equip_rag",1},{"equip_string",1}};
};
class Crafting1
{
text = $STR_ITEM_NAME_TRIPWIRE_CANS;
script = ";['Crafting1','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {"ItemToolbox"};
output[] = {{"ItemTrapTripwireCans",1}};
input[] = {{"equip_string",1},{"TrashTinCan",1},{"PartWoodPile",1},{"equip_duct_tape",1}};
};
class Crafting2
{
text = $STR_ITEM_NAME_TRIPWIRE_FLARE;
script = ";['Crafting2','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {"ItemToolbox"};
output[] = {{"ItemTrapTripwireFlare",1}};
input[] = {{"equip_string",1},{"HandRoadFlare",1},{"PartWoodPile",1},{"equip_duct_tape",1}};
};
class Crafting3
{
text = $STR_ITEM_NAME_TRIPWIRE_GRENADE;
script = ";['Crafting3','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {"ItemToolbox"};
output[] = {{"ItemTrapTripwireGrenade",1}};
input[] = {{"equip_string",1},{"HandGrenade_West",1},{"PartWoodPile",1},{"equip_duct_tape",1}};
};
class Crafting4
{
text = $STR_ITEM_NAME_TRIPWIRE_SMOKE;
script = ";['Crafting4','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {"ItemToolbox"};
output[] = {{"ItemTrapTripwireSmoke",1}};
input[] = {{"equip_string",1},{"SmokeShell",1},{"PartWoodPile",1},{"equip_duct_tape",1}};
};
};
};
class equip_rope : CA_Magazine {
@@ -107,6 +174,7 @@ class equip_rope : CA_Magazine {
model = "\z\addons\dayz_communityassets\models\rope.p3d";
picture = "\z\addons\dayz_communityassets\pictures\equip_rope_ca.paa";
type = 256;
class ItemActions
{
class Crafting

View File

@@ -18,7 +18,7 @@ class ItemSledgeHead : CA_Magazine
model = "\z\addons\dayz_epoch\models\sledge_head.p3d";
picture = "\z\addons\dayz_epoch\pictures\equip_sledge_head_ca.paa";
descriptionShort = $STR_EPOCH_SLEDGEHAMMERHEAD_DESC;
weight = 9;
class ItemActions
{
class Crafting
@@ -43,7 +43,7 @@ class ItemSledgeHandle : CA_Magazine
model = "\z\addons\dayz_epoch\models\sledge_handle.p3d";
picture = "\z\addons\dayz_epoch\pictures\equip_sledge_handle_ca.paa";
descriptionShort = $STR_EPOCH_SLEDGEHAMMERHANDLE_DESC;
weight = 1;
class ItemActions
{
class Crafting
@@ -59,7 +59,8 @@ class ItemSledgeHandle : CA_Magazine
};
};
class equip_Crossbow_Kit : CA_Magazine {
class equip_Crossbow_Kit : CA_Magazine
{
scope = public;
count = 1;
displayName = $STR_ITEM_NAME_CROSSBOW_KIT;
@@ -67,14 +68,43 @@ class equip_Crossbow_Kit : CA_Magazine {
model = "\z\addons\community_crossbow\models\Crossbow_kit.p3d";
picture = "\z\addons\community_crossbow\textures\Crossbow_kit.paa";
type = 256;
class ItemActions
{
class Crafting
{
text = $STR_CRAFTING_CROSSBOW;
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {"workshop"};
requiretools[] = {"ItemToolbox","ItemKnife"};
output[] = {};
outputweapons[] = {"Crossbow_DZ"};
input[] = {{"equip_Crossbow_Kit",1},{"equip_crossbow_stock",1}};
};
};
};
class equip_crossbow_stock : CA_Magazine {
class equip_crossbow_stock : CA_Magazine
{
scope = public;
count = 1;
displayName = "Crossbow (Stock)";
descriptionShort="You require a Crossbow String kit to craft this weapon";
displayName = $STR_ITEM_NAME_CROSSBOW_STOCK;
descriptionShort = $STR_ITEM_DESC_CROSSBOW_STOCK;
model = "z\addons\community_crossbow\models\crossbow_stock.p3d";
picture = "\z\addons\community_crossbow\icons\crossbow_stock.paa";
type = 256;
class ItemActions
{
class Crafting
{
text = $STR_CRAFTING_CROSSBOW;
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {"workshop"};
requiretools[] = {"ItemToolbox","ItemKnife"};
output[] = {};
outputweapons[] = {"Crossbow_DZ"};
input[] = {{"equip_Crossbow_Kit",1},{"equip_crossbow_stock",1}};
};
};
};

View File

@@ -58,6 +58,15 @@ class ItemPlank : CA_Magazine
output[] = {{"PartWoodPile",2}};
input[] = {{"ItemPlank",1}};
};
class Crafting1
{
text = $STR_CRAFTING_SPLINT;
Script = ";['Crafting1','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {"ItemKnife"};
output[] = {{"equip_woodensplint",1}};
input[] = {{"ItemPlank",1},{"equip_duct_tape",1},{"equip_string",1}};
};
};
};
@@ -82,7 +91,7 @@ class PartWoodPile : CA_Magazine
{
text = $STR_EPOCH_PLAYER_242;
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {"sawmill"};
neednearby[] = {};
requiretools[] = {"ItemToolbox","ItemKnife"};
output[] = {{"PartWoodLumber",1}};
input[] = {{"PartWoodPile",2}};
@@ -107,6 +116,15 @@ class PartWoodPile : CA_Magazine
input[] = {{"PartWoodPile",6}};
};
class Crafting3
{
text = $STR_CRAFTING_SPLINT;
Script = ";['Crafting3','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {"ItemKnife"};
output[] = {{"equip_woodensplint",1}};
input[] = {{"PartWoodPile",1},{"equip_duct_tape",1},{"equip_string",1}};
};
};
};
@@ -126,7 +144,7 @@ class PartPlankPack: CA_Magazine
{
text = $STR_EPOCH_PLAYER_251;
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {"sawmill"};
neednearby[] = {};
requiretools[] = {"ItemToolbox","ItemKnife"};
output[] = {{"PartWoodLumber",3}};
input[] = {{"PartPlankPack",1}};
@@ -150,7 +168,7 @@ class PartPlywoodPack: CA_Magazine
{
text = $STR_EPOCH_PLAYER_251;
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {"sawmill"};
neednearby[] = {};
requiretools[] = {"ItemToolbox","ItemKnife"};
output[] = {{"PartWoodPlywood",3}};
input[] = {{"PartPlywoodPack",1}};
@@ -173,7 +191,7 @@ class PartWoodLumber: CA_Magazine
{
text = $STR_EPOCH_PLAYER_254;
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {"sawmill"};
neednearby[] = {};
requiretools[] = {"ItemToolbox"};
output[] = {{"PartWoodPlywood",1}};
input[] = {{"PartWoodLumber",2}};
@@ -196,7 +214,7 @@ class PartWoodLumber: CA_Magazine
neednearby[] = {"workshop"};
requiretools[] = {"ItemToolbox","ItemCrowbar"};
output[] = {{"deer_stand_kit",1}};
input[] = {{"PartWoodLumber",8},{"PartWoodPile",2}};
input[] = {{"PartWoodLumber",8},{"PartWoodPile",2},{"equip_nails",2}};
};
class Crafting3
@@ -206,7 +224,7 @@ class PartWoodLumber: CA_Magazine
neednearby[] = {"workshop"};
requiretools[] = {"ItemToolbox"};
output[] = {{"ItemWoodStairs",1}};
input[] = {{"PartWoodLumber",8}};
input[] = {{"PartWoodLumber",8},{"equip_nails",2}};
};
class Crafting4
@@ -216,14 +234,14 @@ class PartWoodLumber: CA_Magazine
neednearby[] = {"workshop"};
requiretools[] = {"ItemToolbox"};
output[] = {{"ItemWoodLadder",1}};
input[] = {{"PartWoodLumber",8}};
input[] = {{"PartWoodLumber",8},{"equip_nails",2}};
};
class Crafting5
{
text = $STR_EPOCH_PLAYER_259;
Script = ";['Crafting5','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {"sawmill"};
neednearby[] = {};
requiretools[] = {"ItemToolbox"};
output[] = {{"PartPlankPack",1}};
input[] = {{"PartWoodLumber",3}};
@@ -235,16 +253,16 @@ class PartWoodLumber: CA_Magazine
neednearby[] = {"workshop"};
requiretools[] = {"ItemToolbox"};
output[] = {{"ItemGunRackKit",1}};
input[] = {{"PartWoodLumber",6}};
input[] = {{"PartWoodPlywood",1},{"PartWoodLumber",4},{"equip_nails",1}};
};
class Crafting7
{
text = $STR_EPOCH_PLAYER_304;
text = $STR_CRAFTING_SPLINT;
Script = ";['Crafting7','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {"ItemToolbox"};
output[] = {{"ItemWoodCrateKit",1}};
input[] = {{"PartWoodLumber",6}};
requiretools[] = {"ItemKnife"};
output[] = {{"equip_woodensplint",1}};
input[] = {{"PartWoodLumber",1},{"equip_duct_tape",1},{"equip_string",1}};
};
};
};
@@ -276,7 +294,7 @@ class PartWoodPlywood: CA_Magazine
neednearby[] = {};
requiretools[] = {"ItemToolbox"};
output[] = {{"wood_shack_kit",1}};
input[] = {{"PartWoodPlywood",4},{"PartWoodLumber",4}};
input[] = {{"PartWoodPlywood",4},{"PartWoodLumber",4},{"equip_nails",2}};
};
class Crafting2
{
@@ -300,11 +318,20 @@ class PartWoodPlywood: CA_Magazine
{
text = $STR_EPOCH_PLAYER_264;
Script = ";['Crafting4','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {"sawmill"};
neednearby[] = {};
requiretools[] = {"ItemToolbox"};
output[] = {{"PartPlywoodPack",1}};
input[] = {{"PartWoodPlywood",3}};
};
class Crafting5
{
text = $STR_EPOCH_PLAYER_304;
Script = ";['Crafting5','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {"ItemToolbox"};
output[] = {{"ItemWoodCrateKit",1}};
input[] = {{"PartWoodPlywood",4},{"PartWoodLumber",2},{"equip_nails",1}};
};
};
};

View File

@@ -41,6 +41,16 @@ class ItemBandage : CA_Magazine
text = $STR_BANDAGE_SELF;
script = "spawn player_useMeds;";
};
class Crafting
{
text = $STR_CRAFTING_SEPSISBANDAGE;
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {};
output[] = {{"ItemSepsisBandage",1}};
outputweapons[] = {};
input[] = {{"ItemBandage",1},{"equip_comfreyleafs",1}};
};
};
};
@@ -127,6 +137,7 @@ class equip_woodensplint : CA_Magazine {
model = "\z\addons\dayz_communityassets\models\woodensplint.p3d";
picture = "\z\addons\dayz_communityassets\pictures\equip_woodensplint_ca.paa";
type = 256;
class ItemActions {
class Use {
text = $STR_ACTIONS_BRACE_LEG;
@@ -143,6 +154,20 @@ class equip_gauze : CA_Magazine {
model = "\z\addons\dayz_communityassets\models\gauze.p3d";
picture = "\z\addons\dayz_communityassets\pictures\equip_gauze_ca.paa";
type = 256;
class ItemActions
{
class Crafting
{
text = $STR_EPOCH_PLAYER_269;
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {"ItemKnife"};
output[] = {{"ItemBandage",2}};
outputweapons[] = {};
input[] = {{"equip_gauze",2},{"equip_rag",1},{"equip_string",1}};
};
};
};
class equip_gauzepackaged : CA_Magazine {
@@ -153,6 +178,20 @@ class equip_gauzepackaged : CA_Magazine {
model = "\z\addons\dayz_communityassets\models\gauze_package.p3d";
picture = "\z\addons\dayz_communityassets\pictures\equip_gauze_package_ca.paa";
type = 256;
class ItemActions
{
class Crafting
{
text = $STR_CRAFTING_PACKAGEGAUZE;
script = ";['Crafting','CfgMagazines', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {};
output[] = {{"equip_gauze",3}};
outputweapons[] = {};
input[] = {{"equip_gauzepackaged",1}};
};
};
};
class equip_herb_box : CA_Magazine {

View File

@@ -18,7 +18,7 @@ class horde_journal_front_cover
controls[] =
{
"book_page_image",
"open_craft",
//"open_craft",
"open_book",
"click_here_to_close_book_1",
"click_here_to_close_book_2",
@@ -40,7 +40,7 @@ class horde_journal_front_cover
};
// buttons
/*
class open_craft: RscIGUIShortcutButton {
idc = -1;
x = 0.48 * safezoneW + safezoneX;
@@ -48,7 +48,7 @@ class horde_journal_front_cover
text = $STR_UI_CRAFT_OPEN;
action = "closeDialog 0; createDialog 'RscDisplayCraftingMenu';";
};
/*
class open_Construction: RscIGUIShortcutButton {
idc = -1;
x = 0.48 * safezoneW + safezoneX;

View File

@@ -299,10 +299,6 @@ class CfgWeapons
#include "Melee\FishingPole.hpp"
#include "Melee\MeleeSledgehammer.hpp"
/* TOOLS */
#include "Tools\Binocular.hpp"
@@ -340,54 +336,4 @@ class CfgWeapons
#include "Item\ItemKeys.hpp"
#include "Item\Documents.hpp"
/* OTHER */
/*class ItemFlashlightEmpty : ItemCore
{
scope = public;
displayName = $STR_EQUIP_NAME_5;
model = "\dayz_equip\models\flashlight.p3d";
picture = "\dayz_equip\textures\equip_flashlight_ca.paa";
descriptionShort = $STR_EQUIP_DESC_5;
};
class ItemSodaEmpty : HandGrenade
{
scope = public;
displayName = $STR_EQUIP_NAME_35;
model = "\dayz_equip\models\soda_coke_e.p3d";
picture = "\dayz_equip\textures\equip_soda_empty_ca.paa";
descriptionShort = $STR_EQUIP_DESC_35;
ammo = "SodaCan";
class ItemActions
{
class Drink
{
text = $STR_ACTIONS_DRINK2;
script = ";[_id] spawn player_fillWater;";
};
};
};
class TrashTinCan : HandGrenade
{
scope = public;
displayName = $STR_EQUIP_NAME_33;
model = "\dayz_equip\models\trash_tincan.p3d";
picture = "\dayz_equip\textures\equip_tincan_ca.paa";
descriptionShort = $STR_EQUIP_DESC_33;
ammo = "TinCan";
class ItemActions
{
class Drink
{
text = $STR_ACTIONS_DRINK2;
script = ";[_id] spawn player_fillWater;";
};
};
};*/
};

View File

@@ -15,6 +15,32 @@ class MeleeBaseBallBat : MeleeWeapon
{
libTextDesc = $STR_EQUIP_DESC_BASEBALLBAT;
};
class ItemActions
{
class Crafting
{
text = $STR_CRAFTING_NAILEDBASEBALLBAT;
script = ";['Crafting','CfgWeapons', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {"ItemToolbox"};
output[] = {};
outputweapons[] = {"MeleeBaseBallBatNails"};
input[] = {{"equip_nails",1}};
inputweapons[] = {"MeleeBaseBallBat"};
};
class Crafting1
{
text = $STR_CRAFTING_BASEBALLBATBARBED;
script = ";['Crafting1','CfgWeapons', _id] spawn player_craftItem;";
neednearby[] = {};
requiretools[] = {"ItemToolbox"};
output[] = {};
outputweapons[] = {"MeleeBaseBallBatBarbed"};
input[] = {{"equip_nails",1},{"ItemWire",1}};
inputweapons[] = {"MeleeBaseBallBat"};
};
};
};
class MeleeBaseBallBatBarbed : MeleeWeapon

View File

@@ -1,5 +1,5 @@
#include "RscGroups.hpp"
#include "RscDisplayCraftingMenu.hpp"
//#include "RscDisplayCraftingMenu.hpp"
#include "RscDisplayGear.hpp"
#include "RscDisplayGearMinimal.hpp"
#include "RscDisplayGenderSelect.hpp"

View File

@@ -1,6 +1,3 @@
// If a string was passed redirect to vanilla player_craftItem (Epoch items always pass an array)
if (typeName _this == "STRING") exitWith {_this spawn player_craftItemVanilla;};
/*
DayZ Epoch Crafting 0.3
Made for DayZ Epoch && Unleashed by [VB]AWOL please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
@@ -26,16 +23,13 @@ class ItemActions
if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
private ["_tradeComplete","_onLadder","_canDo","_selectedRecipeOutput","_boiled","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_finished","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_selectedRecipeInputStrict","_num_removed","_removed_total","_temp_removed_array","_abort","_waterLevel","_waterLevel_lowest","_reason","_isNear","_selectedRecipeTools","_distance","_crafting","_needNear","_item","_baseClass","_num_removed_weapons","_outputWeapons","_inputWeapons","_randomOutput","_craft_doLoop","_selectedWeapon","_selectedMag","_sfx","_configParent","_pPos"];
private ["_tradeComplete","_onLadder","_canDo","_selectedRecipeOutput","_boiled","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_finished","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_selectedRecipeInputStrict","_num_removed","_removed_total","_temp_removed_array","_abort","_waterLevel","_waterLevel_lowest","_reason","_isNear","_selectedRecipeTools","_distance","_crafting","_needNear","_item","_baseClass","_num_removed_weapons","_outputWeapons","_inputWeapons","_randomOutput","_craft_doLoop","_selectedWeapon","_selectedMag","_sfx","_configParent","_pPos","_text"];
// This is used to find correct recipe based what itemaction was click allows multiple recipes per item.
_crafting = _this select 0;
// This tells the script what type of item we are clicking on
_baseClass = _this select 1;
_item = _this select 2;
_abort = false;
_distance = 3;
_reason = "";
@@ -43,7 +37,7 @@ _waterLevel = 0;
_outputWeapons = [];
_selectedRecipeOutput = [];
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder);
_canDo = (!r_player_unconscious && {!r_drag_sqf} && {!_onLadder});
_boiled = false;
// Need Near Requirements
@@ -68,13 +62,11 @@ if (_abort) exitWith {
dayz_actionInProgress = false;
};
// diag_log format["Checking for fire: %1", _isFireNear];
if (_canDo) then {
_selectedRecipeTools = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "requiretools");
_selectedRecipeOutput = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "output");
_selectedRecipeInput = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "input");
_selectedRecipeInputStrict = ((isNumber (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputstrict")) && (getNumber (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputstrict") > 0));
_selectedRecipeInputStrict = ((isNumber (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputstrict")) && {getNumber (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputstrict") > 0});
_outputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "outputweapons");
_inputWeapons = getArray (configFile >> _baseClass >> _item >> "ItemActions" >> _crafting >> "inputweapons");
@@ -102,9 +94,27 @@ if (_canDo) then {
_itemIn = _x select 0;
_countIn = _x select 1;
_qty = { (_x == _itemIn) || (!_selectedRecipeInputStrict && configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)} count magazines player;
if (_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
} forEach _selectedRecipeInput;
_qty = { (_x == _itemIn) || (!_selectedRecipeInputStrict && {configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn})} count magazines player;
if (_qty < _countIn) exitWith {
_missing = _itemIn;
_missingQty = (_countIn - _qty);
_proceed = false;
};
} count _selectedRecipeInput;
};
if (count _inputWeapons > 0 && {_proceed}) then {
{
_itemIn = _x;
_countIn = 1;
_qty = { (_x == _itemIn) || (!_selectedRecipeInputStrict && {configName(inheritsFrom(configFile >> "cfgWeapons" >> _x)) == _itemIn})} count weapons player;
if (_qty < _countIn) exitWith {
_missing = _itemIn;
_missingQty = (_countIn - _qty);
_proceed = false;
};
} count _inputWeapons;
};
// If all parts proceed
@@ -131,7 +141,7 @@ if (_canDo) then {
// Preselect the item
{
_configParent = configName(inheritsFrom(configFile >> "cfgMagazines" >> _x));
if ((_x == _itemIn) || (!_selectedRecipeInputStrict && _configParent == _itemIn)) then {
if ((_x == _itemIn) || (!_selectedRecipeInputStrict && {_configParent == _itemIn})) then {
// Get lowest waterlevel
if ((_x == "ItemWaterbottle") || (_configParent == "ItemWaterbottle")) then {
_waterLevel = getNumber(configFile >> "CfgMagazines" >> _x >> "wateroz");
@@ -140,15 +150,14 @@ if (_canDo) then {
};
};
};
} forEach (magazines player);
} count (magazines player);
{
_configParent = configName(inheritsFrom(configFile >> "cfgMagazines" >> _x));
if ((_removed < _countIn) && ((_x == _itemIn) || (!_selectedRecipeInputStrict && _configParent == _itemIn))) then {
if ((_waterLevel_lowest == 0) || ((_waterLevel_lowest > 0) && (getNumber(configFile >> "CfgMagazines" >> _x >> "wateroz") == _waterLevel_lowest))) then {
if ((_removed < _countIn) && {(_x == _itemIn) || (!_selectedRecipeInputStrict && {_configParent == _itemIn})}) then {
if ((_waterLevel_lowest == 0) || ((_waterLevel_lowest > 0) && {getNumber(configFile >> "CfgMagazines" >> _x >> "wateroz") == _waterLevel_lowest})) then {
_num_removed = ([player,_x] call BIS_fnc_invRemove);
}
else {
} else {
_num_removed = 0;
};
_removed = _removed + _num_removed;
@@ -164,9 +173,8 @@ if (_canDo) then {
_temp_removed_array set [count _temp_removed_array,_x];
};
};
} forEach (magazines player);
} forEach _selectedRecipeInput;
} foreach (magazines player);
} count _selectedRecipeInput;
//diag_log format["removed: %1 of: %2", _removed, _tobe_removed_total];
@@ -175,27 +183,33 @@ if (_canDo) then {
_num_removed_weapons = 0;
{
_num_removed_weapons = _num_removed_weapons + ([player,_x] call BIS_fnc_invRemove);
} forEach _inputWeapons;
} count _inputWeapons;
if (_num_removed_weapons == (count _inputWeapons)) then {
if (_randomOutput == 1) then {
if (!isNil "_outputWeapons" && count _outputWeapons > 0) then {
if (!isNil "_outputWeapons" && {count _outputWeapons > 0}) then {
_selectedWeapon = _outputWeapons call BIS_fnc_selectRandom;
_outputWeapons = [_selectedWeapon];
};
if (!isNil "_selectedRecipeOutput" && count _selectedRecipeOutput > 0) then {
if (!isNil "_selectedRecipeOutput" && {count _selectedRecipeOutput > 0}) then {
_selectedMag = _selectedRecipeOutput call BIS_fnc_selectRandom;
_selectedRecipeOutput = [_selectedMag];
};
// exit loop
_craft_doLoop = false;
};
{
if (_x == "ItemSledge") then {
if (_x in weapons player) then {
_x call player_addDuplicateTool;
} else {
player addWeapon _x;
if (getNumber(configFile >> "CfgWeapons" >> _x >> "type") == 256) then {
player addWeapon _x;
} else {
_x call player_addDuplicateTool;
};
};
} forEach _outputWeapons;
} count _outputWeapons;
{
_itemOut = _x select 0;
_countOut = _x select 1;
@@ -219,7 +233,7 @@ if (_canDo) then {
};
};
};
} foreach _temp_removed_array;
} count _temp_removed_array;
};
// diag_log format["Checking for water level: %1", _waterLevel];
@@ -231,25 +245,45 @@ if (_canDo) then {
format[localize "str_epoch_player_150",_textCreate,_countOut] call dayz_rollingMessages;
// sleep here
uiSleep 1;
} forEach _selectedRecipeOutput;
} count _selectedRecipeOutput;
_tradeComplete = _tradeComplete+1;
_tradeComplete = _tradeComplete + 1;
};
} else {
// Refund parts since we failed
{player addMagazine _x; } forEach _temp_removed_array;
{player addMagazine _x; } count _temp_removed_array;
format[localize "STR_EPOCH_PLAYER_145",_removed_total,_tobe_removed_total] call dayz_rollingMessages;
};
} else {
localize "str_epoch_player_64" call dayz_rollingMessages;
_craft_doLoop = false;
};
} else {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
if (isClass (configFile >> "CfgMagazines" >> _missing)) then {
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
} else {
if (isClass (configFile >> "CfgWeapons" >> _missing)) then {
_textMissing = getText(configFile >> "CfgWeapons" >> _missing >> "displayName");
} else {
_textMissing = getText(configFile >> "CfgVehicles" >> _missing >> "displayName");
};
};
format[localize "str_epoch_player_152",_missingQty, _textMissing,_tradeComplete] call dayz_rollingMessages;
systemchat localize "STR_CRAFTING_NEEDED_ITEMS";
if (count _selectedRecipeInput > 0) then {
{
_text = getText(configFile >> "CfgMagazines" >> (_x select 0) >> "displayName");
systemchat format ["%2x %1",_text,(_x select 1)];
} count _selectedRecipeInput;
};
if (count _inputWeapons > 0) then {
{
_text = getText(configFile >> "CfgWeapons" >> _x >> "displayName");
systemchat format ["1x %1",_text];
} count _inputWeapons;
};
_craft_doLoop = false;
};
} else {

View File

@@ -44,7 +44,7 @@ _missingText = "";
_missingText = _x;
} else {
if (_forEachIndex == ((count _missing) - 1)) then {
_missingText = _missingText + " and " + _x;
_missingText = _missingText + ", " + _x;
} else {
_missingText = _missingText + ", " + _x;
};
@@ -53,7 +53,12 @@ _missingText = "";
_hasbuilditem = _item in magazines player;
if (!_hasbuilditem && {_text != ""}) exitWith {dayz_actionInProgress = false; format[localize "str_player_31",_text,"build"] call dayz_rollingMessages; false;};
if (!_hasrequireditem) exitWith {dayz_actionInProgress = false; format[localize "str_epoch_player_137",_missingText] call dayz_rollingMessages; false;};
if (!_hasrequireditem) exitWith {
dayz_actionInProgress = false;
systemChat format[localize "str_epoch_player_137",_missingText];
format[localize "str_epoch_player_137",_missingText] call dayz_rollingMessages;
false;
};
//When calling this function in another script use a silent exitWith, unless you have something special to say. i.e. if (!_hasrequireditem) exitWith{};
_hasrequireditem;

View File

@@ -157,11 +157,11 @@ if (!isDedicated) then {
player_spawn_2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\player_spawn_2.sqf";
//Crafting
fn_updateCraftUI = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_updateCraftUI.sqf";
player_craftItem = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem.sqf";
player_craftItemVanilla = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItemVanilla.sqf";
player_craftItemGUI = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItemGUI.sqf";
player_checkRecipe = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_checkRecipe.sqf";
//fn_updateCraftUI = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_updateCraftUI.sqf";
//player_craftItemVanilla = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItemVanilla.sqf";
//player_craftItemGUI = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItemGUI.sqf";
//player_checkRecipe = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_checkRecipe.sqf";
// EPOCH ADDITIONS
dayz_autoRunOff = {dayz_autoRun = false; terminate dayz_autoRunThread; if (speed player > 0) then {player playActionNow "Stop"};};
@@ -515,9 +515,9 @@ if (!isDedicated) then {
dz_fn_meleeMagazines = {
if (_this) then {
{ player addMagazine _x } count MeleeMagazines;
{ player addMagazine _x } foreach MeleeMagazines;
} else {
{ player removeMagazines _x } count MeleeMagazines;
{ player removeMagazines _x } foreach MeleeMagazines;
};
};

View File

@@ -4219,14 +4219,6 @@
<Russian>Картонная коробка</Russian>
<German>Kartonschachtel</German>
</Key>
<Key ID="STR_WPN_NAME_4">
<English>Compound Crossbow</English>
<German>Kompositarmbrust</German>
<Russian>Составной арбалет</Russian>
<Spanish>Ballesta Compuesta</Spanish>
<French>Arbalète composite</French>
<Czech>Kuše</Czech>
</Key>
<Key ID="STR_WPN_DESC_4">
<English>The compound crossbow is, once the aim is mastered, a powerful short-range single-shot weapon with a long reload time.</English>
<German>Die Kompositarmbrust ist, wenn man das Zielen beherrscht, eine starke und lautlose Waffe - allerdings mit kurzer Reichweite und langer Nachladezeit.</German>
@@ -25368,6 +25360,54 @@
<English>Green Borders</English>
<German>Grüne Umrandung</German>
</Key>
<Key ID="str_player_fail_wear4">
<English>You cannot change clothes when you are being targeted by NPCs!</English>
<German>Du kannst deine Kleidung nicht wechseln, wenn du dich in einem Gefecht mit NPCs befindest!</German>
</Key>
<Key ID="STR_ITEM_NAME_CROSSBOW_STOCK">
<English>Crossbow Stock</English>
<German>Armbrustschaft</German>
</Key>
<Key ID="STR_ITEM_DESC_CROSSBOW_STOCK">
<English>You require a Crossbow String kit to craft this weapon.</English>
<German>Zum Herstellen einer Armbrust wird ein Armbrust-Selbstbau-Kit benötigt.</German>
</Key>
<Key ID="STR_CRAFTING_CROSSBOW">
<English>Craft Crossbow</English>
<German>Armbrust herstellen</German>
</Key>
<Key ID="STR_CRAFTING_NAILEDBASEBALLBAT">
<English>Craft Nailed Baseball Bat</English>
<German>Nagelkeule herstellen</German>
</Key>
<Key ID="STR_CRAFTING_BASEBALLBATBARBED">
<English>Craft Baseball Bat Barbed</English>
<German>Stacheldrahtkeule herstellen</German>
</Key>
<Key ID="STR_CRAFTING_HERBALDRINK">
<English>Mix Herbal Drink</English>
<German>Kräutertrunk mixen</German>
</Key>
<Key ID="STR_CRAFTING_SEPSISBANDAGE">
<English>Craft Sepsis Bandage</English>
<German>Sepsisbandage herstellen</German>
</Key>
<Key ID="STR_CRAFTING_PACKAGEGAUZE">
<English>Unpack Gauze Packaged</English>
<German>Mullbindenpackung entpacken</German>
</Key>
<Key ID="STR_CRAFTING_SPLINT">
<English>Craft Wooden Splint</English>
<German>Holzschiene herstellen</German>
</Key>
<Key ID="STR_CRAFTING_NAILS">
<English>Craft Nails</English>
<German>Nägel herstellen</German>
</Key>
<Key ID="STR_CRAFTING_NEEDED_ITEMS">
<English>Needed items:</English>
<German>Benötigte Gegenstände:</German>
</Key>
<!--Fix for missing strings from the buildings3.pbo, this is just a placeholder-->
<Key ID="STR_FAL_Street_Sign">
@@ -25388,8 +25428,5 @@
<French>Une tenue de camouflage spécialement étudiée pour se fondre dans la végétation. Peut être porté.</French>
<German>Schwere Tarnkleidung, die dichtes Unterholz simuliert. Kann ausgepackt und getragen werden.</German>
</Key>
<Key ID="str_player_fail_wear4">
<English>You cannot change clothes when you are being targeted by NPCs</English>
</Key>
</Package>
</Project>