mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-08-12 18:43:18 +03:00
Organize files a bit and removed non source pbo's
This commit is contained in:
@@ -0,0 +1 @@
|
||||
z\addons\dayz_code
|
||||
@@ -0,0 +1,894 @@
|
||||
class CfgMagazines {
|
||||
class CA_Magazine; // External class reference
|
||||
|
||||
class ItemTent: CA_Magazine
|
||||
{
|
||||
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;
|
||||
class ItemActions
|
||||
{
|
||||
class Pitch
|
||||
{
|
||||
text = $STR_PITCH_TENT;
|
||||
script = "spawn player_tentPitch;";
|
||||
create = "TentStorage";
|
||||
};
|
||||
class Crafting
|
||||
{
|
||||
text = "Craft Desert Net";
|
||||
script = "spawn player_craftItem;";
|
||||
neednearby[] = {"workshop"};
|
||||
requiretools[] = {"ItemToolbox","ItemKnife"};
|
||||
output[] = {{"desert_net_kit",1}};
|
||||
input[] = {{"ItemTent",4},{"ItemPole",4}};
|
||||
};
|
||||
class Crafting1
|
||||
{
|
||||
text = "Craft Forest Net";
|
||||
script = "spawn player_craftItem1;";
|
||||
neednearby[] = {"workshop"};
|
||||
requiretools[] = {"ItemToolbox","ItemKnife"};
|
||||
output[] = {{"forest_net_kit",1}};
|
||||
input[] = {{"ItemTent",4},{"ItemPole",4}};
|
||||
};
|
||||
};
|
||||
};
|
||||
class ItemTentDomed : ItemTent {
|
||||
scope = public;
|
||||
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 Pitch {
|
||||
text = $STR_PITCH_TENT;
|
||||
script = "spawn player_tentPitch;";
|
||||
create = "TentStorageDomed";
|
||||
};
|
||||
class Crafting
|
||||
{
|
||||
text = "Craft Desert Net";
|
||||
script = "spawn player_craftItem;";
|
||||
neednearby[] = {"workshop"};
|
||||
requiretools[] = {"ItemToolbox","ItemKnife"};
|
||||
output[] = {{"desert_net_kit",1}};
|
||||
input[] = {{"ItemTent",4},{"ItemPole",4}};
|
||||
};
|
||||
class Crafting1
|
||||
{
|
||||
text = "Craft Forest Net";
|
||||
script = "spawn player_craftItem1;";
|
||||
neednearby[] = {"workshop"};
|
||||
requiretools[] = {"ItemToolbox","ItemKnife"};
|
||||
output[] = {{"forest_net_kit",1}};
|
||||
input[] = {{"ItemTent",4},{"ItemPole",4}};
|
||||
};
|
||||
};
|
||||
};
|
||||
class ItemTentDomed2 : ItemTent {
|
||||
scope = public;
|
||||
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 Pitch {
|
||||
text = $STR_PITCH_TENT;
|
||||
script = "spawn player_tentPitch;";
|
||||
create = "TentStorageDomed2";
|
||||
};
|
||||
class Crafting
|
||||
{
|
||||
text = "Craft Desert Net";
|
||||
script = "spawn player_craftItem;";
|
||||
neednearby[] = {"workshop"};
|
||||
requiretools[] = {"ItemToolbox","ItemKnife"};
|
||||
output[] = {{"desert_net_kit",1}};
|
||||
input[] = {{"ItemTent",4},{"ItemPole",4}};
|
||||
};
|
||||
class Crafting1
|
||||
{
|
||||
text = "Craft Desert Net";
|
||||
script = "spawn player_craftItem1;";
|
||||
neednearby[] = {"workshop"};
|
||||
requiretools[] = {"ItemToolbox","ItemKnife"};
|
||||
output[] = {{"forest_net_kit",1}};
|
||||
input[] = {{"ItemTent",4},{"ItemPole",4}};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class ItemSandbag : CA_Magazine {
|
||||
scope = public;
|
||||
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 = "Build Sandbag";
|
||||
script = "spawn player_build;";
|
||||
require[] = {"ItemEtool"};
|
||||
create = "Sandbag1_DZ";
|
||||
};
|
||||
class Crafting
|
||||
{
|
||||
text = "Craft Large Sandbag";
|
||||
script = "spawn player_craftItem;";
|
||||
neednearby[] = {};
|
||||
requiretools[] = {"ItemEtool","ItemToolbox"};
|
||||
output[] = {{"ItemSandbagLarge",1}};
|
||||
input[] = {{"ItemSandbag",3},{"ItemWire",1},{"ItemTankTrap",1}};
|
||||
};
|
||||
class Crafting1
|
||||
{
|
||||
text = "Craft Sandbag Nest";
|
||||
script = "spawn player_craftItem1;";
|
||||
neednearby[] = {};
|
||||
requiretools[] = {"ItemEtool","ItemToolbox"};
|
||||
output[] = {{"sandbag_nest_kit",1}};
|
||||
input[] = {{"ItemSandbag",4},{"PartWoodPlywood",2},{"PartWoodLumber",4}};
|
||||
};
|
||||
/*
|
||||
class Crafting2
|
||||
{
|
||||
text = "Craft M240 Nest";
|
||||
script = "spawn player_craftItem2;";
|
||||
neednearby[] = {"workshop"};
|
||||
requiretools[] = {"ItemEtool","ItemToolbox","M240_DZ"};
|
||||
output[] = {{"m240_nest_kit",1}};
|
||||
input[] = {{"ItemSandbag",4},{"ItemCanvas",1},{"PartWoodPlywood",4},{"PartWoodLumber",3}};
|
||||
consumeweapons[] = {"M240_DZ"};
|
||||
};
|
||||
*/
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
class ItemSandbagLarge : CA_Magazine {
|
||||
scope = public;
|
||||
count = 1;
|
||||
type = 256;
|
||||
displayName = "H-barrier cube";
|
||||
model = "\dayz_equip\models\sandbags.p3d";
|
||||
picture = "\dayz_equip\textures\equip_sandbag_ca.paa";
|
||||
descriptionShort = "Hesco berrier: A buildable object that is used for fortification purposes.";
|
||||
|
||||
class ItemActions {
|
||||
class Build {
|
||||
text = "Build H-barrier cube";
|
||||
script = "spawn player_build;";
|
||||
require[] = {"ItemEtool"};
|
||||
create = "Land_HBarrier1_DZ";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class ItemTankTrap : CA_Magazine {
|
||||
scope = public;
|
||||
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;
|
||||
script = "spawn player_build;";
|
||||
require[] = {"ItemToolbox"};
|
||||
create = "Hedgehog_DZ";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class TrapBear : CA_Magazine {
|
||||
scope = public;
|
||||
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 = public;
|
||||
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;
|
||||
script = "spawn player_build;";
|
||||
require[] = {"ItemToolbox"};
|
||||
create = "Fort_RazorWire";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class Quiver : CA_Magazine
|
||||
{
|
||||
scope = public;
|
||||
ammo = "WoodenArrow";
|
||||
count = 6;
|
||||
descriptionshort = "Small Quiver used with the Crossbow, Max arrows 6.";
|
||||
displayname = "Quiver";
|
||||
initSpeed = 150;
|
||||
model = "\z\addons\dayz_communityassets\models\quiver";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_quiver_ca.paa";
|
||||
};
|
||||
|
||||
class WoodenArrow : CA_Magazine {
|
||||
scope = public;
|
||||
displayName = "Arrow"; //$STR_MAG_NAME_3;
|
||||
model = "\dayz_weapons\models\bolt_gear";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_warrow_ca.paa";
|
||||
ammo = "WoodenArrow";
|
||||
count = 1;
|
||||
initSpeed = 150;
|
||||
descriptionShort = "Arrow made out of wood, used with the Crossbow."; //$STR_MAG_DESC_3;
|
||||
|
||||
class ItemActions {
|
||||
class ReloadMag {
|
||||
text = "Combine into Quiver";
|
||||
script = "spawn player_reloadMag;";
|
||||
use[] = {"WoodenArrow","WoodenArrow","WoodenArrow","WoodenArrow","WoodenArrow","WoodenArrow"};
|
||||
output[] = {"Quiver"};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
class ItemSodaEmpty;//External class reference
|
||||
class ItemSodaCoke; //External class reference
|
||||
|
||||
class ItemSodaCokeEmpty : ItemSodaEmpty{
|
||||
model = "\dayz_equip\models\soda_coke_e.p3d";
|
||||
picture = "\dayz_equip\textures\equip_soda_empty_ca.paa";
|
||||
};
|
||||
class ItemSodaPepsiEmpty : ItemSodaEmpty{
|
||||
model = "\dayz_equip\models\soda_pepsi_e.p3d";
|
||||
picture = "\dayz_equip\textures\equip_soda_empty_ca.paa";
|
||||
};
|
||||
class ItemSodaMdewEmpty : ItemSodaEmpty{
|
||||
model = "\dayz_equip\models\soda_mdew_e.p3d";
|
||||
picture = "\dayz_equip\textures\equip_soda_empty_ca.paa";
|
||||
};
|
||||
|
||||
class ItemSodaMtngreen : ItemSodaCoke {
|
||||
displayName = $STR_ITEMSODA_FULL_CLEAN_CODE_NAME_0;
|
||||
descriptionShort = $STR_ITEMSODA_FULL_CLEAN_CODE_DESC_0;
|
||||
model = "z\addons\dayz_communityassets\models\soda_mtngreen_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_mtngreen_clean_full_ca.paa";
|
||||
};
|
||||
class ItemSodaMtngreenEmpty : ItemSodaEmpty{
|
||||
model = "z\addons\dayz_communityassets\models\soda_mtngreen_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_mtngreen_clean_empty_ca.paa";
|
||||
//ammo = "SodaCanMtngreen";
|
||||
};
|
||||
|
||||
class ItemSodaR4z0r : ItemSodaCoke {
|
||||
displayName = $STR_ITEMSODA_FULL_CLEAN_CODE_NAME_1;
|
||||
descriptionShort = $STR_ITEMSODA_FULL_CLEAN_CODE_DESC_1;
|
||||
model = "z\addons\dayz_communityassets\models\soda_r4z0r_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_r4z0r_clean_full_ca.paa";
|
||||
};
|
||||
class ItemSodaR4z0rEmpty : ItemSodaEmpty{
|
||||
model = "z\addons\dayz_communityassets\models\soda_r4z0r_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_r4z0r_clean_empty_ca.paa";
|
||||
//ammo = "SodaCanMtngreen";
|
||||
};
|
||||
|
||||
class ItemSodaRbull : ItemSodaCoke {
|
||||
displayName = $STR_FOOD_NAME_RBULL;
|
||||
descriptionShort = $STR_FOOD_DESC_RBULL;
|
||||
model = "z\addons\dayz_epoch\models\soda_redbull.p3d";
|
||||
picture = "\z\addons\dayz_epoch\pictures\equip_soda_rbull_CA.paa";
|
||||
};
|
||||
class ItemSodaOrageSherbet : ItemSodaCoke {
|
||||
displayName = $STR_FOOD_NAME_OSHERBET;
|
||||
descriptionShort = $STR_FOOD_DESC_OSHERBET;
|
||||
model = "z\addons\dayz_epoch\models\soda_sherbet.p3d";
|
||||
picture = "\z\addons\dayz_epoch\pictures\soda_orangesherbet_ca.paa";
|
||||
};
|
||||
|
||||
class ItemSodaClays : ItemSodaCoke {
|
||||
displayName = $STR_ITEMSODA_FULL_CLEAN_CODE_NAME_2;
|
||||
descriptionShort = $STR_ITEMSODA_FULL_CLEAN_CODE_DESC_2;
|
||||
model = "z\addons\dayz_communityassets\models\soda_clays_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_clays_clean_full_ca.paa";
|
||||
};
|
||||
class ItemSodaClaysEmpty : ItemSodaEmpty{
|
||||
model = "z\addons\dayz_communityassets\models\soda_clays_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_clays_clean_empty_ca.paa";
|
||||
//ammo = "SodaCanMtngreen";
|
||||
};
|
||||
|
||||
class ItemSodaSmasht : ItemSodaCoke {
|
||||
displayName = $STR_ITEMSODA_FULL_CLEAN_CODE_NAME_3;
|
||||
descriptionShort = $STR_ITEMSODA_FULL_CLEAN_CODE_DESC_3;
|
||||
model = "z\addons\dayz_communityassets\models\soda_smasht_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_smasht_clean_full_ca.paa";
|
||||
};
|
||||
class ItemSodaSmashtEmpty : ItemSodaEmpty{
|
||||
model = "z\addons\dayz_communityassets\models\soda_smasht_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_smasht_clean_empty_ca.paa";
|
||||
//ammo = "SodaCanMtngreen";
|
||||
};
|
||||
|
||||
class ItemSodaDrwaste : ItemSodaCoke {
|
||||
displayName = $STR_ITEMSODA_FULL_CLEAN_CODE_NAME_4;
|
||||
descriptionShort = $STR_ITEMSODA_FULL_CLEAN_CODE_DESC_4;
|
||||
model = "z\addons\dayz_communityassets\models\soda_drwaste_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_drwaste_clean_full_ca.paa";
|
||||
};
|
||||
class ItemSodaDrwasteEmpty : ItemSodaEmpty{
|
||||
model = "z\addons\dayz_communityassets\models\soda_drwaste_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_drwaste_clean_empty_ca.paa";
|
||||
//ammo = "SodaCanMtngreen";
|
||||
};
|
||||
/*
|
||||
class ItemSodaFranka : ItemSodaCoke {
|
||||
displayName = $STR_ITEMSODA_FULL_CLEAN_CODE_NAME_5;
|
||||
descriptionShort = $STR_ITEMSODA_FULL_CLEAN_CODE_DESC_5;
|
||||
model = "z\addons\dayz_communityassets\models\soda_franka_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_franka_clean_full_ca.paa";
|
||||
};
|
||||
class ItemSodaFrankaEmpty : ItemSodaEmpty{
|
||||
model = "z\addons\dayz_communityassets\models\soda_franka_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_franka_clean_empty_ca";
|
||||
//ammo = "SodaCanMtngreen";
|
||||
};
|
||||
*/
|
||||
class ItemSodaLemonade : ItemSodaCoke {
|
||||
displayName = $STR_ITEMSODA_FULL_CLEAN_CODE_NAME_6;
|
||||
descriptionShort = $STR_ITEMSODA_FULL_CLEAN_CODE_DESC_6;
|
||||
model = "z\addons\dayz_communityassets\models\soda_lemonade_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_lemonade_clean_full_ca.paa";
|
||||
};
|
||||
class ItemSodaLemonadeEmpty : ItemSodaEmpty{
|
||||
model = "z\addons\dayz_communityassets\models\soda_lemonade_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_lemonade_clean_empty_ca.paa";
|
||||
//ammo = "SodaCanMtngreen";
|
||||
};
|
||||
/*
|
||||
class ItemSodaLirik : ItemSodaCoke {
|
||||
displayName = $STR_ITEMSODA_FULL_CLEAN_CODE_NAME_7;
|
||||
descriptionShort = $STR_ITEMSODA_FULL_CLEAN_CODE_DESC_7;
|
||||
model = "z\addons\dayz_communityassets\models\soda_lirik_clean_full.p3d";
|
||||
//picture = "\z\addons\dayz_communityassets\pictures\equip_soda_lirik_clean_full_ca.paa";
|
||||
};
|
||||
class ItemSodaLirikEmpty : ItemSodaEmpty{
|
||||
model = "z\addons\dayz_communityassets\models\soda_lirik_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_lirik_clean_empty_ca.paa";
|
||||
//ammo = "SodaCanMtngreen";
|
||||
};
|
||||
*/
|
||||
class ItemSodaLvg : ItemSodaCoke {
|
||||
displayName = $STR_ITEMSODA_FULL_CLEAN_CODE_NAME_8;
|
||||
descriptionShort = $STR_ITEMSODA_FULL_CLEAN_CODE_DESC_8;
|
||||
model = "z\addons\dayz_communityassets\models\soda_lvg_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_lvg_clean_full_ca.paa";
|
||||
};
|
||||
class ItemSodaLvgEmpty : ItemSodaEmpty{
|
||||
model = "z\addons\dayz_communityassets\models\soda_lvg_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_lvg_clean_empty_ca.paa";
|
||||
//ammo = "SodaCanMtngreen";
|
||||
};
|
||||
|
||||
class ItemSodaMzly : ItemSodaCoke {
|
||||
displayName = $STR_ITEMSODA_FULL_CLEAN_CODE_NAME_9;
|
||||
descriptionShort = $STR_ITEMSODA_FULL_CLEAN_CODE_DESC_9;
|
||||
model = "z\addons\dayz_communityassets\models\soda_mzly_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_mzly_clean_full_ca.paa";
|
||||
};
|
||||
class ItemSodaMzlyEmpty : ItemSodaEmpty{
|
||||
model = "z\addons\dayz_communityassets\models\soda_mzly_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_mzly_clean_empty_ca.paa";
|
||||
//ammo = "SodaCanMtngreen";
|
||||
};
|
||||
/*
|
||||
class ItemSodaPeppsy : ItemSodaCoke {
|
||||
displayName = $STR_ITEMSODA_FULL_CLEAN_CODE_NAME_10;
|
||||
descriptionShort = $STR_ITEMSODA_FULL_CLEAN_CODE_DESC_10;
|
||||
model = "z\addons\dayz_communityassets\models\soda_peppsy_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_peppsy_clean_full_ca.paa";
|
||||
};
|
||||
class ItemSodaPeppsyEmpty : ItemSodaEmpty{
|
||||
model = "z\addons\dayz_communityassets\models\soda_peppsy_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_peppsy_clean_empty_ca.paa";
|
||||
//ammo = "SodaCanMtngreen";
|
||||
};
|
||||
*/
|
||||
class ItemSodaRabbit : ItemSodaCoke {
|
||||
displayName = $STR_ITEMSODA_FULL_CLEAN_CODE_NAME_11;
|
||||
descriptionShort = $STR_ITEMSODA_FULL_CLEAN_CODE_DESC_11;
|
||||
model = "z\addons\dayz_communityassets\models\soda_rabbit_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_rabbit_clean_full_ca.paa";
|
||||
};
|
||||
class ItemSodaRabbitEmpty : ItemSodaEmpty{
|
||||
model = "z\addons\dayz_communityassets\models\soda_rabbit_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_rabbit_clean_empty_ca.paa";
|
||||
//ammo = "SodaCanMtngreen";
|
||||
|
||||
};
|
||||
/*
|
||||
class ItemSodaSacrite : ItemSodaCoke {
|
||||
displayName = $STR_ITEMSODA_FULL_CLEAN_CODE_NAME_12;
|
||||
descriptionShort = $STR_ITEMSODA_FULL_CLEAN_CODE_DESC_12;
|
||||
model = "z\addons\dayz_communityassets\models\soda_sacrite_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_sacrite_clean_full_ca.paa";
|
||||
};
|
||||
class ItemSodaSacriteEmpty : ItemSodaEmpty{
|
||||
model = "z\addons\dayz_communityassets\models\soda_sacrite_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_soda_sacrite_clean_empty_ca.paa";
|
||||
//ammo = "SodaCanMtngreen";
|
||||
};
|
||||
*/
|
||||
class FoodEdible;
|
||||
class FoodmeatRaw : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
type = 256;
|
||||
displayName = $STR_FOOD_EQIP_CODE_NAME_0;
|
||||
model = "\dayz_equip\models\food_steak_gear.p3d";
|
||||
picture = "\dayz_equip\textures\equip_steak_ca.paa";
|
||||
descriptionShort = $STR_FOOD_EQUIP_CODE_DESC_0;
|
||||
bloodRegen = 100;
|
||||
};
|
||||
class FoodmuttonRaw : FoodmeatRaw {
|
||||
displayName = $STR_FOOD_EQIP_CODE_NAME_1;
|
||||
descriptionShort = $STR_FOOD_EQUIP_CODE_DESC_1;
|
||||
bloodRegen = 100;
|
||||
};
|
||||
|
||||
class FoodchickenRaw : FoodmeatRaw {
|
||||
displayName = $STR_FOOD_EQIP_CODE_NAME_2;
|
||||
descriptionShort = $STR_FOOD_EQUIP_CODE_DESC_2;
|
||||
bloodRegen = 100;
|
||||
};
|
||||
|
||||
class FoodrabbitRaw : FoodmeatRaw {
|
||||
displayName = $STR_FOOD_EQIP_CODE_NAME_3;
|
||||
descriptionShort = $STR_FOOD_EQUIP_CODE_DESC_3;
|
||||
bloodRegen = 400;
|
||||
};
|
||||
|
||||
class FoodbaconRaw : FoodmeatRaw {
|
||||
displayName = $STR_FOOD_EQIP_CODE_NAME_4;
|
||||
model = "z\addons\dayz_communityassets\models\bacon_raw.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_bacon_raw_CA.paa";
|
||||
descriptionShort = $STR_FOOD_EQUIP_CODE_DESC_4;
|
||||
bloodRegen = 150;
|
||||
};
|
||||
class FoodbeefRaw : FoodmeatRaw {
|
||||
displayName = $STR_FOOD_EQIP_CODE_NAME_6;
|
||||
descriptionShort = $STR_FOOD_EQUIP_CODE_DESC_6;
|
||||
bloodRegen = 100;
|
||||
};
|
||||
|
||||
class FoodmeatCooked : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_0;
|
||||
model = "\dayz_equip\models\food_steak_cooked_gear.p3d";
|
||||
picture = "\dayz_equip\textures\equip_steak_cooked_ca.paa";
|
||||
descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_0;
|
||||
bloodRegen = 800;
|
||||
};
|
||||
class FoodmuttonCooked : FoodmeatCooked {
|
||||
displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_1;
|
||||
descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_1;
|
||||
bloodRegen = 400;
|
||||
};
|
||||
|
||||
class FoodchickenCooked : FoodmeatCooked {
|
||||
displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_2;
|
||||
descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_2;
|
||||
bloodRegen = 400;
|
||||
};
|
||||
|
||||
class FoodbaconCooked : FoodmeatCooked {
|
||||
displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_4;
|
||||
model = "z\addons\dayz_communityassets\models\bacon_fried.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_bacon_fried_CA.paa";
|
||||
descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_4;
|
||||
bloodRegen = 400;
|
||||
};
|
||||
class FoodrabbitCooked : FoodmeatCooked {
|
||||
displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_3;
|
||||
descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_3;
|
||||
bloodRegen = 1600;
|
||||
};
|
||||
class FoodbeefCooked : FoodmeatCooked {
|
||||
displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_6;
|
||||
descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_6;
|
||||
bloodRegen = 600;
|
||||
};
|
||||
|
||||
class AngelCookies : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
displayName = $STR_FOODCOOKED_EQIP_CODE_NAME_5;
|
||||
model = "z\addons\dayz_communityassets\models\buiscits_box.p3d";
|
||||
picture = "z\addons\dayz_communityassets\pictures\i_buiscit_ca.paa";
|
||||
descriptionShort = $STR_FOODCOOKED_EQUIP_CODE_DESC_5;
|
||||
bloodRegen = 100;
|
||||
};
|
||||
class FoodMRE : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 800;
|
||||
displayName = $STR_FOOD_NAME_MRE;
|
||||
descriptionShort = $STR_FOOD_DESC_MRE;
|
||||
model = "z\addons\dayz_communityassets\models\mre.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_mre_CA.paa";
|
||||
};
|
||||
|
||||
class FoodPistachio : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 100;
|
||||
displayName = $STR_FOOD_NAME_PISTACHIO;
|
||||
descriptionShort = $STR_FOOD_DESC_PISTACHIO;
|
||||
model = "z\addons\dayz_communityassets\models\pistachio.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_pistachios_CA.paa";
|
||||
};
|
||||
class FoodNutmix : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 100;
|
||||
displayName = $STR_FOOD_NAME_NUTMIX;
|
||||
descriptionShort = $STR_FOOD_DESC_NUTMIX;
|
||||
model = "z\addons\dayz_communityassets\models\nutmix.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_nutmix_CA.paa";
|
||||
};
|
||||
|
||||
class FoodCanGriff : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 200;
|
||||
displayName = $STR_FOOD_NAME_CAN_GRIFF;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_GRIFF;
|
||||
model = "z\addons\dayz_communityassets\models\can_griff_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_griff_clean_full_ca.paa";
|
||||
};
|
||||
class FoodCanBadguy : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 200;
|
||||
displayName = $STR_FOOD_NAME_CAN_BADGUY;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_BADGUY;
|
||||
model = "z\addons\dayz_communityassets\models\can_badguy_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_badguy_clean_full_ca.paa";
|
||||
};
|
||||
class FoodCanBoneboy : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 200;
|
||||
displayName = $STR_FOOD_NAME_CAN_BONEBOY;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_BONEBOY;
|
||||
model = "z\addons\dayz_communityassets\models\can_boneboy_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_boneboy_clean_full_ca.paa";
|
||||
};
|
||||
class FoodCanCorn : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 200;
|
||||
displayName = $STR_FOOD_NAME_CAN_CORN;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_CORN;
|
||||
model = "z\addons\dayz_communityassets\models\can_corn_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_corn_clean_full_ca.paa";
|
||||
};
|
||||
class FoodCanCurgon : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 200;
|
||||
displayName = $STR_FOOD_NAME_CAN_CURGON;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_CURGON;
|
||||
model = "z\addons\dayz_communityassets\models\can_curgon_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_curgon_clean_full_ca.paa";
|
||||
};
|
||||
class FoodCanDemon : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 200;
|
||||
displayName = $STR_FOOD_NAME_CAN_DEMON;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_DEMON;
|
||||
model = "z\addons\dayz_communityassets\models\can_demon_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_demon_clean_full_ca.paa";
|
||||
};
|
||||
class FoodCanFraggleos : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 200;
|
||||
displayName = $STR_FOOD_NAME_CAN_FRAGGLEOS;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_FRAGGLEOS;
|
||||
model = "z\addons\dayz_communityassets\models\can_fraggleos_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_fraggleos_clean_full_ca.paa";
|
||||
};
|
||||
class FoodCanHerpy : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 200;
|
||||
displayName = $STR_FOOD_NAME_CAN_HERPY;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_HERPY;
|
||||
model = "z\addons\dayz_communityassets\models\can_herpy_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_herpy_clean_full_ca.paa";
|
||||
};
|
||||
class FoodCanOrlok : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 200;
|
||||
displayName = $STR_FOOD_NAME_CAN_ORLOK;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_ORLOK;
|
||||
model = "z\addons\dayz_communityassets\models\can_orlok_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_orlok_clean_full_ca.paa";
|
||||
};
|
||||
class FoodCanPowell : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 200;
|
||||
displayName = $STR_FOOD_NAME_CAN_POWELL;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_POWELL;
|
||||
model = "z\addons\dayz_communityassets\models\can_powell_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_powell_clean_full_ca.paa";
|
||||
};
|
||||
class FoodCanTylers : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 200;
|
||||
displayName = $STR_FOOD_NAME_CAN_TYLERS;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_TYLERS;
|
||||
model = "z\addons\dayz_communityassets\models\can_tylers_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_tylers_clean_full_ca.paa";
|
||||
};
|
||||
class FoodCanUnlabeled : FoodEdible {
|
||||
scope = public;
|
||||
count = 1;
|
||||
bloodRegen = 200;
|
||||
displayName = $STR_FOOD_NAME_CAN_UNLABELED;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_UNLABELED;
|
||||
model = "z\addons\dayz_communityassets\models\can_unlabeled_clean_full.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_unlabeled_clean_full_ca.paa";
|
||||
};
|
||||
|
||||
class TrashTinCan;
|
||||
class FoodCanGriffEmpty : TrashTinCan {
|
||||
scope = public;
|
||||
count = 1;
|
||||
model = "z\addons\dayz_communityassets\models\can_griff_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_griff_clean_empty_ca.paa";
|
||||
displayName = $STR_FOOD_NAME_CAN_GRIFF_EMPTY;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_GRIFF_EMPTY;
|
||||
ammo = "TinCan";
|
||||
};
|
||||
class FoodCanBadguyEmpty : TrashTinCan {
|
||||
scope = public;
|
||||
count = 1;
|
||||
displayName = $STR_FOOD_NAME_CAN_BADGUY_EMPTY;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_BADGUY_EMPTY;
|
||||
model = "z\addons\dayz_communityassets\models\can_badguy_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_badguy_clean_empty_ca.paa";
|
||||
ammo = "TinCan";
|
||||
};
|
||||
class FoodCanBoneboyEmpty : TrashTinCan {
|
||||
scope = public;
|
||||
count = 1;
|
||||
displayName = $STR_FOOD_NAME_CAN_BONEBOY_EMPTY;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_BONEBOY_EMPTY;
|
||||
model = "z\addons\dayz_communityassets\models\can_boneboy_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_boneboy_clean_empty_ca.paa";
|
||||
ammo = "TinCan";
|
||||
};
|
||||
class FoodCanCornEmpty : TrashTinCan {
|
||||
scope = public;
|
||||
count = 1;
|
||||
displayName = $STR_FOOD_NAME_CAN_CORN_EMPTY;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_CORN_EMPTY;
|
||||
model = "z\addons\dayz_communityassets\models\can_corn_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_corn_clean_empty_ca.paa";
|
||||
ammo = "TinCan";
|
||||
};
|
||||
class FoodCanCurgonEmpty : TrashTinCan {
|
||||
scope = public;
|
||||
count = 1;
|
||||
displayName = $STR_FOOD_NAME_CAN_CURGON_EMPTY;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_CURGON_EMPTY;
|
||||
model = "z\addons\dayz_communityassets\models\can_curgon_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_curgon_clean_empty_ca.paa";
|
||||
ammo = "TinCan";
|
||||
};
|
||||
class FoodCanDemonEmpty : TrashTinCan {
|
||||
scope = public;
|
||||
count = 1;
|
||||
displayName = $STR_FOOD_NAME_CAN_DEMON_EMPTY;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_DEMON_EMPTY;
|
||||
model = "z\addons\dayz_communityassets\models\can_demon_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_demon_clean_empty_ca.paa";
|
||||
ammo = "TinCan";
|
||||
};
|
||||
class FoodCanFraggleosEmpty : TrashTinCan {
|
||||
scope = public;
|
||||
count = 1;
|
||||
displayName = $STR_FOOD_NAME_CAN_FRAGGLEOS_EMPTY;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_FRAGGLEOS_EMPTY;
|
||||
model = "z\addons\dayz_communityassets\models\can_fraggleos_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_fraggleos_clean_empty_ca.paa";
|
||||
ammo = "TinCan";
|
||||
};
|
||||
class FoodCanHerpyEmpty : TrashTinCan {
|
||||
scope = public;
|
||||
count = 1;
|
||||
displayName = $STR_FOOD_NAME_CAN_HERPY_EMPTY;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_HERPY_EMPTY;
|
||||
model = "z\addons\dayz_communityassets\models\can_herpy_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_herpy_clean_empty_ca.paa";
|
||||
ammo = "TinCan";
|
||||
};
|
||||
class FoodCanOrlokEmpty : TrashTinCan {
|
||||
scope = public;
|
||||
count = 1;
|
||||
displayName = $STR_FOOD_NAME_CAN_ORLOK_EMPTY;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_ORLOK_EMPTY;
|
||||
model = "z\addons\dayz_communityassets\models\can_orlok_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_orlok_clean_empty_ca.paa";
|
||||
ammo = "TinCan";
|
||||
};
|
||||
class FoodCanPowellEmpty : TrashTinCan {
|
||||
scope = public;
|
||||
count = 1;
|
||||
displayName = $STR_FOOD_NAME_CAN_POWELL_EMPTY;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_POWELL_EMPTY;
|
||||
model = "z\addons\dayz_communityassets\models\can_powell_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_powell_clean_empty_ca.paa";
|
||||
ammo = "TinCan";
|
||||
};
|
||||
class FoodCanTylersEmpty : TrashTinCan {
|
||||
scope = public;
|
||||
count = 1;
|
||||
displayName = $STR_FOOD_NAME_CAN_TYLERS_EMPTY;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_TYLERS_EMPTY;
|
||||
model = "z\addons\dayz_communityassets\models\can_tylers_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_tylers_clean_empty_ca.paa";
|
||||
ammo = "TinCan";
|
||||
};
|
||||
class FoodCanUnlabeledEmpty : TrashTinCan {
|
||||
scope = public;
|
||||
count = 1;
|
||||
displayName = $STR_FOOD_NAME_CAN_UNLABELED_EMPTY;
|
||||
descriptionShort = $STR_FOOD_DESC_CAN_UNLABELED_EMPTY;
|
||||
model = "z\addons\dayz_communityassets\models\can_unlabeled_clean_empty.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_can_unlabeled_clean_empty_ca.paa";
|
||||
ammo = "TinCan";
|
||||
};
|
||||
|
||||
class ItemWaterbottle;
|
||||
class ItemWaterbottleBoiled : ItemWaterbottle {
|
||||
displayName = $STR_ITEMWATERBOTTLEBOILED_CODE_NAME;
|
||||
descriptionShort = $STR_ITEMWATERBOTTLEBOILED_CODE_DESC;
|
||||
};
|
||||
class Hatchet_Swing;
|
||||
class Machete_Swing : Hatchet_Swing {
|
||||
displayName = "Machete";
|
||||
displayNameMagazine = "Machete";
|
||||
shortNameMagazine = "Machete";
|
||||
ammo = "Machete_Swing_Ammo";
|
||||
};
|
||||
class Fishing_Swing : Hatchet_Swing {
|
||||
displayName = "Fishing";
|
||||
displayNameMagazine = "Fishing";
|
||||
shortNameMagazine = "Fishing";
|
||||
ammo = "Fishing_Swing_Ammo";
|
||||
};
|
||||
// Inventory Placeholder
|
||||
class DummyItem : Hatchet_Swing {
|
||||
displayName = "Dummy";
|
||||
displayNameMagazine = "Dummy";
|
||||
shortNameMagazine = "Dummy";
|
||||
ammo = "Dummy_Swing_Ammo";
|
||||
};
|
||||
class ItemTrashToiletpaper : CA_Magazine {
|
||||
scope = public;
|
||||
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;
|
||||
};
|
||||
class ItemTrashRazor : CA_Magazine {
|
||||
scope = public;
|
||||
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 8Rnd_B_Beneli_74Slug;
|
||||
class 8Rnd_B_Beneli_Pellets;
|
||||
|
||||
class 2Rnd_shotgun_74Slug: 8Rnd_B_Beneli_74Slug
|
||||
{
|
||||
displayName="2Rnd. Slug";
|
||||
count=2;
|
||||
descriptionShort="Caliber: 12 gauge <br/>Rounds: 2 <br/>Used in: M1014";
|
||||
model = "\z\addons\dayz_communityassets\models\2shells_slugshot.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_2shells_slugshot_CA.paa";
|
||||
class ItemActions
|
||||
{
|
||||
class ReloadMag
|
||||
{
|
||||
text="Combine to 8 rounds";
|
||||
script="spawn player_reloadMag;";
|
||||
use[]=
|
||||
{
|
||||
"2Rnd_shotgun_74Slug",
|
||||
"2Rnd_shotgun_74Slug",
|
||||
"2Rnd_shotgun_74Slug",
|
||||
"2Rnd_shotgun_74Slug"
|
||||
};
|
||||
output[]=
|
||||
{
|
||||
"8Rnd_B_Beneli_74Slug"
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
class 2Rnd_shotgun_74Pellets: 8Rnd_B_Beneli_Pellets
|
||||
{
|
||||
displayName="2Rnd. Pellets";
|
||||
count=2;
|
||||
descriptionShort="Caliber: 12 gauge <br/>Rounds: 2 Pellets<br/>Used in: M1014";
|
||||
model = "\z\addons\dayz_communityassets\models\2shells_pellet.p3d";
|
||||
picture = "\z\addons\dayz_communityassets\pictures\equip_2shells_pellet_CA.paa";
|
||||
class ItemActions
|
||||
{
|
||||
class ReloadMag
|
||||
{
|
||||
text="Combine to 8 rounds";
|
||||
script="spawn player_reloadMag;";
|
||||
use[]=
|
||||
{
|
||||
"2Rnd_shotgun_74Pellets",
|
||||
"2Rnd_shotgun_74Pellets",
|
||||
"2Rnd_shotgun_74Pellets",
|
||||
"2Rnd_shotgun_74Pellets"
|
||||
};
|
||||
output[]=
|
||||
{
|
||||
"8Rnd_B_Beneli_Pellets"
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
class CfgMarkers
|
||||
{
|
||||
class Cricle01 {
|
||||
name = "Marker description";
|
||||
icon = "\z\addons\dayz_communityassets\cricle_01_raw.paa";
|
||||
color[] = {1, 0, 0, 1};
|
||||
size = 32;
|
||||
shadow = true;
|
||||
scope = private;
|
||||
};
|
||||
class Cricle02 {
|
||||
name = "Marker description";
|
||||
icon = "\z\addons\dayz_communityassets\cricle_02_raw.paa";
|
||||
color[] = {1, 0, 0, 1};
|
||||
size = 32;
|
||||
shadow = true;
|
||||
scope = private;
|
||||
};
|
||||
class Cross01 {
|
||||
name = "Marker description";
|
||||
icon = "\z\addons\dayz_communityassets\cross_01_raw.paa";
|
||||
color[] = {1, 0, 0, 1};
|
||||
size = 32;
|
||||
shadow = true;
|
||||
scope = private;
|
||||
};
|
||||
class Cross02 {
|
||||
name = "Marker description";
|
||||
icon = "\z\addons\dayz_communityassets\cross_02_raw.paa";
|
||||
color[] = {1, 0, 0, 1};
|
||||
size = 32;
|
||||
shadow = true;
|
||||
scope = private;
|
||||
};
|
||||
class Questionmark {
|
||||
name = "Marker description";
|
||||
icon = "\z\addons\dayz_communityassets\questionmark_raw.paa";
|
||||
color[] = {1, 0, 0, 1};
|
||||
size = 32;
|
||||
shadow = true;
|
||||
scope = private;
|
||||
};
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,25 @@
|
||||
private ["_ammoType","_vehicle","_ammo","_weapon","_turret","_text","_array","_magazines"];
|
||||
_array = _this select 3;
|
||||
_vehicle = _array select 0;
|
||||
_weapon = _array select 1;
|
||||
_turret = _array select 2;
|
||||
_ammo = "";
|
||||
_text = [];
|
||||
|
||||
call r_player_removeActions2;
|
||||
_magazines = getArray (configFile >> "cfgWeapons" >> _weapon >> "magazines");
|
||||
{
|
||||
_ammoType = getText (configFile >> "cfgMagazines" >> _x >> "displayName");
|
||||
if (_ammoType == "") then {_ammoType = _x;};
|
||||
if (!(_ammoType in _text)) then {_text set [count _text,_ammoType];};
|
||||
if (_x in magazines player) exitWith {_ammo = _x;};
|
||||
} forEach _magazines;
|
||||
if (_ammo != "") then {
|
||||
_vehicle removeMagazineTurret [_ammo,_turret];
|
||||
_vehicle addMagazineTurret [_ammo,_turret];
|
||||
player removeMagazine _ammo;
|
||||
|
||||
cutText [format["You have successfully loaded %1 ammunition.",_ammoType], "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [format["You need %1 type of ammo to do this.",_text], "PLAIN DOWN"];
|
||||
};
|
||||
@@ -0,0 +1,56 @@
|
||||
private ["_hasbottleitem","_hastinitem","_bottletext","_tin1text","_tin2text","_tintext","_qty","_dis","_sfx","_removed"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Boil already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
player removeAction s_player_boil;
|
||||
s_player_boil = 1;
|
||||
|
||||
_hasbottleitem = "ItemWaterbottle" in magazines player;
|
||||
_hastinitem = false;
|
||||
{
|
||||
if (_x in magazines player) then {
|
||||
_hastinitem = true;
|
||||
};
|
||||
|
||||
} forEach boil_tin_cans;
|
||||
|
||||
_bottletext = getText (configFile >> "CfgMagazines" >> "ItemWaterbottle" >> "displayName");
|
||||
_tin1text = getText (configFile >> "CfgMagazines" >> "TrashTinCan" >> "displayName");
|
||||
_tin2text = getText (configFile >> "CfgMagazines" >> "ItemSodaEmpty" >> "displayName");
|
||||
_tintext = format["%1 / %2",_tin1text,_tin2text];
|
||||
if (!_hasbottleitem) exitWith {TradeInprogress = false; cutText [format[(localize "str_player_31"),_bottletext,"fill"] , "PLAIN DOWN"]};
|
||||
if (!_hastinitem) exitWith {TradeInprogress = false; cutText [format[(localize "str_player_31"),_tintext,"fill"] , "PLAIN DOWN"]};
|
||||
|
||||
_removed = 0;
|
||||
|
||||
if (_hasbottleitem and _hastinitem) then {
|
||||
_qty = {_x == "ItemWaterbottle"} count magazines player;
|
||||
if ("ItemWaterbottle" in magazines player) then {
|
||||
|
||||
_removed = _removed + ([player,"ItemWaterbottle",_qty] call BIS_fnc_invRemove);
|
||||
|
||||
player playActionNow "Medic";
|
||||
sleep 1;
|
||||
|
||||
_dis=10;
|
||||
_sfx = "cook";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
sleep 5;
|
||||
|
||||
// Add back only number of removed
|
||||
for "_x" from 1 to _removed do {
|
||||
player addMagazine "ItemWaterbottleBoiled";
|
||||
};
|
||||
|
||||
cutText [format[(localize "str_player_01"),_qty], "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [(localize "str_player_02") , "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
|
||||
s_player_boil = -1;
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,119 @@
|
||||
private ["_location","_isOk","_dir","_classname","_item","_cancel","_location3","_location4","_location1","_location2","_counter","_hasbuilditem","_dis","_sfx","_object","_onLadder","_isWater","_text","_offset_x","_offset_y","_offset_z","_offset_z_attach","_tmpbuilt","_built_location"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Building already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
_location = player modeltoworld [0,1,0];
|
||||
_location set [2,0];
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
_isWater = (surfaceIsWater _location) or dayz_isSwimming;
|
||||
|
||||
if(_isWater) exitWith {cutText [localize "str_player_26", "PLAIN DOWN"];};
|
||||
if(_onLadder) exitWith {cutText [localize "str_player_21", "PLAIN DOWN"];};
|
||||
|
||||
if (vehicle player != player) exitWith {cutText ["You may not build while in a vehicle", "PLAIN DOWN"]};
|
||||
|
||||
_item = _this;
|
||||
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
|
||||
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
|
||||
|
||||
_hasbuilditem = _this in magazines player;
|
||||
|
||||
if (!_hasbuilditem) exitWith {cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]};
|
||||
|
||||
_dir = getDir player;
|
||||
|
||||
_offset_x = 0;
|
||||
_offset_y = 1.5;
|
||||
_offset_z = 0;
|
||||
_offset_z_attach = 0.5;
|
||||
|
||||
// Start Preview loop
|
||||
_tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
_tmpbuilt setdir _dir;
|
||||
_tmpbuilt attachTo [player,[_offset_x,_offset_y,_offset_z_attach]];
|
||||
|
||||
_cancel = false;
|
||||
_counter = 0;
|
||||
_isOk = true;
|
||||
|
||||
while {_isOk} do {
|
||||
|
||||
if(_counter == 0) then {
|
||||
cutText ["Planning construction stand still 5 seconds to build.", "PLAIN DOWN"];
|
||||
sleep 5;
|
||||
_location1 = getPosATL player;
|
||||
sleep 5;
|
||||
_location2 = getPosATL player;
|
||||
|
||||
if(_location1 distance _location2 < 0.1) exitWith {
|
||||
|
||||
cutText ["Started construction move within 5 seconds to cancel.", "PLAIN DOWN"];
|
||||
_location3 = getPosATL player;
|
||||
sleep 5;
|
||||
_location4 = getPosATL player;
|
||||
|
||||
if(_location3 distance _location4 > 0.1) exitWith {
|
||||
_isOk = false;
|
||||
_cancel = true;
|
||||
};
|
||||
|
||||
_isOk = false;
|
||||
};
|
||||
};
|
||||
if(_counter >= 1) exitWith {
|
||||
_isOk = false;
|
||||
_cancel = true;
|
||||
};
|
||||
_counter = _counter + 1;
|
||||
};
|
||||
|
||||
detach _tmpbuilt;
|
||||
|
||||
// Get location of detached tmp built
|
||||
_built_location = (getPosATL _tmpbuilt);
|
||||
|
||||
// force to ground
|
||||
_built_location set [2,0];
|
||||
|
||||
if(!_cancel) then {
|
||||
|
||||
_hasbuilditem = _this in magazines player;
|
||||
if (!_hasbuilditem) exitWith {cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]};
|
||||
|
||||
_dir = getDir player;
|
||||
|
||||
player removeMagazine _item;
|
||||
|
||||
//disableSerialization;
|
||||
//call dayz_forceSave;
|
||||
|
||||
|
||||
player playActionNow "Medic";
|
||||
sleep 1;
|
||||
|
||||
_dis=20;
|
||||
_sfx = "repair";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
sleep 5;
|
||||
|
||||
player allowDamage false;
|
||||
_object = createVehicle [_classname, _built_location, [], 0, "CAN_COLLIDE"];
|
||||
_object setDir _dir;
|
||||
player reveal _object;
|
||||
|
||||
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
|
||||
|
||||
//["dayzPublishObj",[dayz_characterID,_object,[_dir,_location],_classname]] call callRpcProcedure;
|
||||
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
|
||||
publicVariableServer "dayzPublishObj";
|
||||
|
||||
sleep 2;
|
||||
player allowDamage true;
|
||||
|
||||
} else {
|
||||
cutText [format["Canceled construction of %1.",_text], "PLAIN DOWN"];
|
||||
};
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,122 @@
|
||||
private ["_activatingPlayer","_trader_id","_type","_name","_qty","_sell","_order","_tid","_out","_part","_cancel","_Display","_File","_textCurrency","_textPart","_btype","_stype","_header","_item","_buy","_bqty","_bname","_afile"];
|
||||
|
||||
if (TradeInprogress) exitWith {}; // Do not allow if any script is running.
|
||||
|
||||
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
||||
|
||||
// [ _trader_id, _category, _action ];
|
||||
_activatingPlayer = _this select 1;
|
||||
|
||||
_trader_id = (_this select 3) select 0;
|
||||
// _category = (_this select 3) select 1;
|
||||
|
||||
dayzTraderMenuResult = call compile format["tcacheBuy_%1;",_trader_id];
|
||||
|
||||
if(isNil "dayzTraderMenuResult") then {
|
||||
diag_log format["DEBUG TRADER OBJ: %1", _trader_id];
|
||||
//["dayzTraderMenu",[_activatingPlayer,_trader_id,_category,_action]] call callRpcProcedure;
|
||||
dayzTraderMenu = [_activatingPlayer,_trader_id];
|
||||
publicVariableServer "dayzTraderMenu";
|
||||
waitUntil {!isNil "dayzTraderMenuResult"};
|
||||
};
|
||||
|
||||
diag_log format["DEBUG Buy: %1", dayzTraderMenuResult];
|
||||
{
|
||||
_header = _x select 0; // "TRD"
|
||||
|
||||
// Trader Item name|type
|
||||
_item = _x select 1;
|
||||
_name = _item select 0;
|
||||
_type = _item select 1;
|
||||
switch(true)do{
|
||||
case (_type == 1): {
|
||||
_type = "CfgMagazines";
|
||||
};
|
||||
case (_type == 2): {
|
||||
_type = "CfgVehicles";
|
||||
};
|
||||
case (_type == 3): {
|
||||
_type = "CfgWeapons";
|
||||
};
|
||||
};
|
||||
// Display Name of item
|
||||
_textPart = getText(configFile >> _type >> _name >> "displayName");
|
||||
|
||||
// Total in stock
|
||||
_qty = _x select 2;
|
||||
|
||||
// Buy Data from array
|
||||
_buy = _x select 3;
|
||||
_bqty = _buy select 0;
|
||||
_bname = _buy select 1;
|
||||
_btype = _buy select 2;
|
||||
switch(true)do{
|
||||
case (_btype == 1): {
|
||||
_btype = "CfgMagazines";
|
||||
};
|
||||
case (_btype == 2): {
|
||||
_btype = "CfgVehicles";
|
||||
};
|
||||
case (_btype == 3): {
|
||||
_btype = "CfgWeapons";
|
||||
};
|
||||
};
|
||||
// Display Name of buy item
|
||||
_textCurrency = getText(configFile >> _btype >> _bname >> "displayName");
|
||||
|
||||
// Sell data from array
|
||||
_sell = _x select 4;
|
||||
//_sqty = _sell select 0;
|
||||
//_sname = _sell select 1;
|
||||
_stype = _sell select 2;
|
||||
switch(true)do{
|
||||
case (_stype == 1): {
|
||||
_stype = "CfgMagazines";
|
||||
};
|
||||
case (_stype == 2): {
|
||||
_stype = "CfgVehicles";
|
||||
};
|
||||
case (_stype == 3): {
|
||||
_stype = "CfgWeapons";
|
||||
};
|
||||
};
|
||||
// Display Name of sell item
|
||||
//_textCurrencySell = getText(configFile >> _stype >> _sname >> "displayName");
|
||||
|
||||
// Menu sort order
|
||||
_order = _x select 5;
|
||||
|
||||
// Trader Menu ID
|
||||
_tid = _x select 6;
|
||||
|
||||
// Action file to use for trade
|
||||
_afile = _x select 7;
|
||||
_File = "\z\addons\dayz_code\actions\" + _afile + ".sqf";
|
||||
|
||||
// Allways 1 for now
|
||||
_out = 1;
|
||||
|
||||
// trade_items.sqf | [part_out, part_in, qty_out, qty_in,_textPart,_textCurrency];
|
||||
|
||||
if (_qty > 0) then {
|
||||
_Display = format["Buy %1 (%2) for %3 %4", _textPart, _name, _bqty, _textCurrency];
|
||||
} else {
|
||||
_Display = format["<t color='#ffff00'>Buy %1 (%2) for %3 %4</t>", _textPart, _name, _bqty, _textCurrency];
|
||||
};
|
||||
|
||||
_part = player addAction [_Display, _File,[_name,_bname,_out,_bqty,"buy",_textCurrency,_textPart,_header], _order, true, true, "",""];
|
||||
|
||||
diag_log format["DEBUG TRADER: %1", _part];
|
||||
s_player_parts set [count s_player_parts,_part];
|
||||
|
||||
} forEach dayzTraderMenuResult;
|
||||
|
||||
_cancel = player addAction ["Cancel", "\z\addons\dayz_code\actions\trade_cancel.sqf",["medical"], 0, true, false, "",""];
|
||||
s_player_parts set [count s_player_parts,_cancel];
|
||||
|
||||
// Cache data in client side global variable
|
||||
call compile format["tcacheBuy_%1 = %2;",_tid,dayzTraderMenuResult];
|
||||
|
||||
// Clear Data
|
||||
dayzTraderMenuResult = nil;
|
||||
s_player_parts_crtl = 1;
|
||||
@@ -0,0 +1,19 @@
|
||||
private["_trader_id","_category","_buy","_sell","_cancel"];
|
||||
|
||||
if (TradeInprogress) exitWith {}; // Do not allow if any script is running.
|
||||
|
||||
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
||||
|
||||
_trader_id = (_this select 3) select 0;
|
||||
_category = (_this select 3) select 1;
|
||||
|
||||
_buy = player addAction ["Buy "+_category, "\z\addons\dayz_code\actions\buy_db.sqf",[_trader_id], 99, true, false, "",""];
|
||||
s_player_parts set [count s_player_parts,_buy];
|
||||
|
||||
_sell = player addAction ["Sell "+_category, "\z\addons\dayz_code\actions\sell_db.sqf",[_trader_id], 98, true, false, "",""];
|
||||
s_player_parts set [count s_player_parts,_sell];
|
||||
|
||||
_cancel = player addAction ["Cancel", "\z\addons\dayz_code\actions\trade_cancel.sqf",["medical"], 0, true, false, "",""];
|
||||
s_player_parts set [count s_player_parts,_cancel];
|
||||
|
||||
s_player_parts_crtl = 1;
|
||||
@@ -0,0 +1,23 @@
|
||||
private [];
|
||||
//_item = _this select 3;
|
||||
|
||||
// remove menu
|
||||
player removeAction s_player_callzombies;
|
||||
s_player_callzombies = 1;
|
||||
|
||||
// player playActionNow "Surrender";
|
||||
|
||||
// for now try reseting animation when this is called to test preventing animation lockups
|
||||
// player switchMove "";
|
||||
|
||||
[player,"spotted",0,false] call dayz_zombieSpeak;
|
||||
|
||||
[player,100,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
// wait a bit
|
||||
sleep 3;
|
||||
|
||||
// allow menu again
|
||||
s_player_callzombies = -1;
|
||||
|
||||
// cutText ["Calling Zombies...", "PLAIN DOWN"];
|
||||
@@ -0,0 +1,33 @@
|
||||
private ["_vehicle","_class","_maxMagazines","_maxWeapons","_maxBackpacks","_magazineCount","_weaponsCount","_backpackCount","_magazineCount_raw","_weaponsCount_raw","_backpackCount_raw"];
|
||||
_vehicle = _this select 3;
|
||||
|
||||
_class = typeOf _vehicle;
|
||||
|
||||
// Get max magazines count
|
||||
_maxMagazines = getNumber (configFile >> "CfgVehicles" >> _class >> "transportMaxMagazines");
|
||||
|
||||
// Get max weapon count
|
||||
_maxWeapons = getNumber (configFile >> "CfgVehicles" >> _class >> "transportMaxWeapons");
|
||||
|
||||
// Get max backpack count
|
||||
_maxBackpacks = getNumber (configFile >> "CfgVehicles" >> _class >> "transportmaxbackpacks");
|
||||
|
||||
// Count and show magazines available space
|
||||
_magazineCount_raw = getMagazineCargo _vehicle;
|
||||
|
||||
// Count and show weapons available space
|
||||
_weaponsCount_raw = getWeaponCargo _vehicle;
|
||||
|
||||
// Count and show backpacks available space
|
||||
_backpackCount_raw = getBackpackCargo _vehicle;
|
||||
|
||||
// Count and show magazines available space
|
||||
_magazineCount = (_magazineCount_raw select 1) call vehicle_gear_count;
|
||||
|
||||
// Count and show weapons available space
|
||||
_weaponsCount = (_weaponsCount_raw select 1) call vehicle_gear_count;
|
||||
|
||||
// Count and show weapons available space
|
||||
_backpackCount = (_backpackCount_raw select 1) call vehicle_gear_count;
|
||||
|
||||
TitleText [format[("Magazine %1 / %2 - Weapons %3 / %4 - Backpacks %5 / %6"),_magazineCount,_maxMagazines,_weaponsCount,_maxWeapons,_backpackCount,_maxBackpacks], "PLAIN DOWN"];
|
||||
@@ -0,0 +1,82 @@
|
||||
private ["_text","_rawmeat","_cookedmeat","_meat","_meatcooked","_qty","_started","_finished","_animState","_isMedic","_removed","_dis","_sfx"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Cooking already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
// diag_log ("Cook Enabled");
|
||||
player removeAction s_player_cook;
|
||||
s_player_cook = 1;
|
||||
|
||||
_rawmeat = meatraw;
|
||||
_cookedmeat = meatcooked;
|
||||
|
||||
|
||||
|
||||
{
|
||||
_meat = _x;
|
||||
_meatcooked = _cookedmeat select (_rawmeat find _meat);
|
||||
_removed = 0;
|
||||
if (_meat in magazines player) then {
|
||||
_textraw = getText (configFile >> "CfgMagazines" >> _meat >> "displayName");
|
||||
_text = getText (configFile >> "CfgMagazines" >> _meatcooked >> "displayName");
|
||||
|
||||
_qty = {_x == _meat} count magazines player;
|
||||
|
||||
cutText [format["Started cooking %1",_textraw], "PLAIN DOWN"];
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
_dis=6;
|
||||
_sfx = "cook";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
_removed = _removed + ([player,_meat,_qty] call BIS_fnc_invRemove);
|
||||
|
||||
// Add only number of items removed
|
||||
for "_x" from 1 to _removed do {
|
||||
player addMagazine _meatcooked;
|
||||
};
|
||||
|
||||
cutText [format[(localize "str_success_cooked"),_qty,_text], "PLAIN DOWN"];
|
||||
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
|
||||
cutText [format["Canceled cooking %1",_textraw], "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
} forEach _rawmeat;
|
||||
|
||||
s_player_cook = -1;
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,10 @@
|
||||
private ["_array","_object","_inventory"];
|
||||
_array = _this select 3;
|
||||
_object = _array select 0;
|
||||
_inventory = _array select 1;
|
||||
player playActionNow "Medic";
|
||||
sleep 8;
|
||||
{player addMagazine _x} forEach _inventory;
|
||||
deleteVehicle _object;
|
||||
r_action = false;
|
||||
call fnc_usec_medic_removeActions;
|
||||
@@ -0,0 +1,36 @@
|
||||
private ["_array","_handle","_type","_onLadder","_removed","_itemIn","_countIn"];
|
||||
_array = _this select 3;
|
||||
_handle = _array select 0;
|
||||
_type = _array select 1;
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
player playActionNow "PutDown";
|
||||
|
||||
switch (_type) do {
|
||||
case 0: {
|
||||
// expanded to allow all meats as input
|
||||
_removed = 0;
|
||||
_itemIn = "FoodmeatRaw";
|
||||
_countIn = 1;
|
||||
{
|
||||
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
|
||||
_removed = _removed + ([player,_x] call BIS_fnc_invRemove);
|
||||
};
|
||||
} forEach magazines player;
|
||||
if(_removed == _countIn) then {
|
||||
_handle setFSMVariable ["_hunger",0];
|
||||
player removeAction s_player_feeddog;
|
||||
s_player_feeddog = -1;
|
||||
};
|
||||
|
||||
};
|
||||
case 1: {
|
||||
player removeMagazine "ItemWaterbottle";
|
||||
player addMagazine "ItemWaterbottleUnfilled";
|
||||
_handle setFSMVariable ["_thirst",0];
|
||||
player removeAction s_player_waterdog;
|
||||
s_player_waterdog = -1;
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
private["_array","_handle","_whistle","_dog"];
|
||||
_array = _this select 3;
|
||||
_handle = _array select 0;
|
||||
_whistle = _array select 1;
|
||||
_dog = _handle getFSMVariable "_dog";
|
||||
|
||||
if(_whistle) then {
|
||||
[nil,player,rSAY,["dog_callBack", 120]] call RE;
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
|
||||
if (_dog distance player <= 900) then {
|
||||
_handle setFSMVariable ["_command","return"];
|
||||
};
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
private ["_handle"];
|
||||
_handle = _this select 3;
|
||||
|
||||
_handle setFSMVariable ["_command","move"];
|
||||
@@ -0,0 +1,5 @@
|
||||
private ["_dog"];
|
||||
_dog = _this select 3;
|
||||
|
||||
_dog playActionNow "GestureBark";
|
||||
[_dog,"dog_bark",0,false] call dayz_zombieSpeak;
|
||||
@@ -0,0 +1,16 @@
|
||||
private ["_array", "_handle", "_speed", "_dog"];
|
||||
_array = _this select 3;
|
||||
_handle = _array select 0;
|
||||
_speed = _array select 1;
|
||||
|
||||
player removeAction s_player_speeddog;
|
||||
s_player_speeddog = -1;
|
||||
|
||||
_dog = _handle getFSMVariable "_dog";
|
||||
|
||||
if(player distance _dog > 5) then {
|
||||
[nil,player,rSAY,["dog_slowDown", 120]] call RE;
|
||||
};
|
||||
|
||||
_handle setFSMVariable ["_maxSpeed", _speed];
|
||||
_dog setVariable ["currentSpeed", _speed];
|
||||
@@ -0,0 +1,13 @@
|
||||
private ["_handle", "_dog", "_standing", "_watchDog", "_anim"];
|
||||
_handle = _this select 3;
|
||||
_dog = _handle getFSMVariable "_dog";
|
||||
_standing = _handle getFSMVariable "_standing";
|
||||
_handle setFSMVariable ["_command","stay"];
|
||||
_watchDog = _handle getFSMVariable "_watchDog";
|
||||
|
||||
_anim = animationState _dog;
|
||||
if (_anim == "Dog_SitDown" and _watchDog) then {
|
||||
//[objNull, _dog, rSwitchMove,"Dog_SitUp"] call RE;
|
||||
//sleep 0.5;
|
||||
[objNull, _dog, rSwitchMove,"Dog_LieDown"] call RE;
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
private ["_handle"];
|
||||
_handle = _this select 3;
|
||||
|
||||
_handle setFSMVariable ["_command","track"];
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
private ["_array", "_handle", "_watchDog", "_dog", "_warn"];
|
||||
_array = _this select 3;
|
||||
_handle = _array select 0;
|
||||
_watchDog = _array select 1;
|
||||
_dog = _handle getFSMVariable "_dog";
|
||||
|
||||
player removeAction s_player_warndog;
|
||||
s_player_warndog = -1;
|
||||
|
||||
_handle setFSMVariable ["_watchDog",_watchDog];
|
||||
|
||||
_warn = {
|
||||
_handle = _this select 0;
|
||||
while {_watchDog and alive _dog} do {
|
||||
_watchDog = _handle getFSMVariable "_watchDog";
|
||||
_senseSkill = _handle getFSMVariable "_senseSkill";
|
||||
if (_watchDog) then {
|
||||
_nearby = (getPosATL _dog) nearEntities ["CAManBase",_senseSkill];
|
||||
_nearby = _nearby - [player];
|
||||
if (count _nearby > 0) then {
|
||||
[_dog,"dog_growl",2,false] call dayz_zombieSpeak;
|
||||
};
|
||||
};
|
||||
sleep 2;
|
||||
};
|
||||
};
|
||||
|
||||
if (_watchDog) then {
|
||||
_handle setFSMVariable ["_idleTime",5];
|
||||
[_handle] spawn _warn;
|
||||
} else {
|
||||
_handle setFSMVariable ["_idleTime",1];
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
private ["_array","_location","_dir","_classname","_magazine","_weapon"];
|
||||
_array = _this select 3;
|
||||
_location = player modeltoworld [0,0.5,0];
|
||||
_dir = (getDir player) + 180;
|
||||
_classname = _array select 0;
|
||||
_magazine = _array select 1;
|
||||
player removeMagazine _magazine;
|
||||
player playActionNow "Medic";
|
||||
call fnc_usec_engineer_removeActions;
|
||||
r_action_engineer = false;
|
||||
sleep 8;
|
||||
_weapon = _classname createVehicle _location;
|
||||
_weapon setDir _dir;
|
||||
_weapon setpos _location;
|
||||
player reveal _weapon;
|
||||
@@ -0,0 +1,24 @@
|
||||
private ["_array","_object","_magazine","_classname","_dir","_location","_weapon"];
|
||||
_array = _this select 3;
|
||||
_object = _array select 0;
|
||||
_magazine = _array select 1;
|
||||
_classname = _array select 2;
|
||||
|
||||
_dir = direction _object;
|
||||
_location = getPosATL _object;
|
||||
|
||||
player removeMagazine _magazine;
|
||||
player playActionNow "Medic";
|
||||
|
||||
r_action = false;
|
||||
call fnc_usec_medic_removeActions;
|
||||
|
||||
sleep 8;
|
||||
//Delete old Object
|
||||
deleteVehicle _object;
|
||||
|
||||
//New Object
|
||||
_weapon = _classname createVehicle _location;
|
||||
_weapon setDir _dir;
|
||||
_weapon setpos _location;
|
||||
player reveal _weapon;
|
||||
@@ -0,0 +1,107 @@
|
||||
private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_isMedic","_abort","_canSize","_configVeh","_capacity","_nameText","_isOk","_findNearestVehicles","_findNearestVehicle","_IsNearVehicle"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Refuel already in progress." , "PLAIN DOWN"] };
|
||||
TradeInprogress = true;
|
||||
|
||||
// Get all nearby vehicles within 10m
|
||||
_findNearestVehicles = nearestObjects [player, ["AllVehicles"], 10];
|
||||
_findNearestVehicle = [];
|
||||
{
|
||||
if (alive _x and !(_x isKindOf "Man")) then {
|
||||
_findNearestVehicle set [(count _findNearestVehicle),_x];
|
||||
};
|
||||
} foreach _findNearestVehicles;
|
||||
|
||||
_IsNearVehicle = count (_findNearestVehicle);
|
||||
|
||||
if(_IsNearVehicle >= 1) then {
|
||||
|
||||
// select the nearest one
|
||||
_vehicle = _findNearestVehicle select 0;
|
||||
|
||||
// Static vehicle fuel information
|
||||
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
|
||||
_capacity = getNumber(_configVeh >> "fuelCapacity");
|
||||
_nameText = getText(_configVeh >> "displayName");
|
||||
|
||||
|
||||
_isOk = true;
|
||||
// perform fuel up
|
||||
while {_isOk} do {
|
||||
|
||||
// qty to add per loop
|
||||
_canSize = 20;
|
||||
|
||||
cutText [format["Filling up %1, move to cancel.",_nameText], "PLAIN DOWN"];
|
||||
|
||||
// alert zombies
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
_finished = false;
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if(!_finished) then {
|
||||
r_interrupt = false;
|
||||
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
// Get vehicle fuel levels again
|
||||
_curFuel = ((fuel _vehicle) * _capacity);
|
||||
_newFuel = (_curFuel + _canSize);
|
||||
|
||||
if (_newFuel > _capacity) then {_newFuel = _capacity; _abort = true; };
|
||||
|
||||
// calculate minimum needed fuel
|
||||
_newFuel = (_newFuel / _capacity);
|
||||
|
||||
dayzSetFuel = [_vehicle,_newFuel];
|
||||
if (local _vehicle) then {
|
||||
dayzSetFuel spawn local_setFuel;
|
||||
};
|
||||
publicVariable "dayzSetFuel";
|
||||
|
||||
// Play sound
|
||||
[player,"refuel",0,false] call dayz_zombieSpeak;
|
||||
|
||||
cutText [format["%1 filled to %2 percent capacity.",_nameText,round(_newFuel*100)], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
if(_abort) exitWith {};
|
||||
sleep 1;
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText ["No Vehicles Nearby.", "PLAIN DOWN"];
|
||||
};
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,92 @@
|
||||
private ["_vehicle","_started","_finished","_animState","_isMedic","_soundSource"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Refuel already in progress." , "PLAIN DOWN"] };
|
||||
TradeInprogress = true;
|
||||
|
||||
player removeAction s_player_fillgen;
|
||||
s_player_fillgen = 1;
|
||||
|
||||
// Use target from addaction
|
||||
_vehicle = _this select 3;
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
|
||||
cutText ["Preparing to fuel and start generator, move to cancel.", "PLAIN DOWN"];
|
||||
|
||||
[player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if(!_finished) then {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled." , "PLAIN DOWN"]
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
// take jerry can and replace with empty
|
||||
|
||||
if(!(_vehicle getVariable ["GeneratorFilled", false]) and ("ItemJerrycan" in magazines player)) then {
|
||||
|
||||
if(([player,"ItemJerrycan"] call BIS_fnc_invRemove) == 1) then {
|
||||
|
||||
player addMagazine "ItemJerrycanEmpty";
|
||||
|
||||
// mark as once filled
|
||||
_vehicle setVariable ["GeneratorFilled", true,true];
|
||||
|
||||
// Start generator
|
||||
_vehicle setVariable ["GeneratorRunning", true,true];
|
||||
|
||||
// Sound_Generator1
|
||||
// Looks like this was the entended way of making the sound, lets test
|
||||
_soundSource = createSoundSource ["Sound_Generator1", position player, [], 0];
|
||||
|
||||
_vehicle setVariable ["GeneratorSound", _soundSource,true];
|
||||
|
||||
cutText ["Generator has been started.", "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
|
||||
// Start generator
|
||||
_vehicle setVariable ["GeneratorRunning", true,true];
|
||||
|
||||
// Sound_Generator1
|
||||
// Looks like this was the entended way of making the sound, lets test
|
||||
_soundSource = createSoundSource ["Sound_Generator1", position player, [], 0];
|
||||
|
||||
_vehicle setVariable ["GeneratorSound", _soundSource,true];
|
||||
|
||||
// TODO: Add running sounds to generator
|
||||
cutText ["Generator has been started.", "PLAIN DOWN"];
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
s_player_fillgen = -1;
|
||||
@@ -0,0 +1,17 @@
|
||||
private["_location","_isOk","_dir","_classname"];
|
||||
_location = player modeltoworld [0,1,0];
|
||||
_location set [2,0];
|
||||
_isOk = count (_location isFlatEmpty [0.5,0,0,4,0,false,player]) > 0;
|
||||
|
||||
if (_isOk) then {
|
||||
_dir = getDir player;
|
||||
_classname = "Land_Fire";
|
||||
player playActionNow "Medic";
|
||||
sleep 6;
|
||||
dayz_hasFire = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
dayz_hasFire setDir _dir;
|
||||
player reveal dayz_hasFire;
|
||||
cutText [localize "str_fireplace_01", "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [localize "str_fireplace_02", "PLAIN DOWN"];
|
||||
};
|
||||
@@ -0,0 +1,14 @@
|
||||
private["_obj"];
|
||||
_obj = _this select 3;
|
||||
|
||||
player removeAction s_player_fireout;
|
||||
s_player_fireout = 1;
|
||||
|
||||
player playActionNow "Medic";
|
||||
sleep 6;
|
||||
if(_obj isKindOf "Land_fire") then {
|
||||
dayz_hasFire = objNull;
|
||||
deleteVehicle _obj;
|
||||
};
|
||||
cutText [localize "str_fireplace_removed", "PLAIN DOWN"];
|
||||
s_player_fireout = -1;
|
||||
@@ -0,0 +1,8 @@
|
||||
private["_flare"];
|
||||
_flare = _this select 3;
|
||||
player removeAction s_player_dropflare;
|
||||
detach _flare;
|
||||
s_player_grabflare = -1;
|
||||
s_player_removeflare = -1;
|
||||
_flare setVariable ["owner",objNull,true];
|
||||
dayz_hasLight = false;
|
||||
@@ -0,0 +1,25 @@
|
||||
private ["_flare","_text"];
|
||||
_flare = _this select 3;
|
||||
player playActionNow "PutDown";
|
||||
sleep 2;
|
||||
_flare attachTo [player,[0,0,0],"granat2"];
|
||||
[_flare, -90, -10] call object_setpitchbank;
|
||||
_flare setPos (getPos _flare);
|
||||
_flare setVariable ["owner",player,true];
|
||||
player removeAction s_player_grabflare;
|
||||
player removeAction s_player_removeflare;
|
||||
dayz_hasLight = true;
|
||||
|
||||
//Add Drop Action
|
||||
_text = getText (configFile >> "CfgAmmo" >> (typeOf _flare) >> "displayName");
|
||||
s_player_dropflare = player addAction [format[localize "str_actions_medical_16",_text], "\z\addons\dayz_code\actions\flare_drop.sqf",_flare, 1, false, true, "", ""];
|
||||
|
||||
while {(alive _flare) and dayz_hasLight} do {
|
||||
sleep 0.1;
|
||||
};
|
||||
if (dayz_hasLight) then {
|
||||
dayz_hasLight = false;
|
||||
player removeAction s_player_dropflare;
|
||||
s_player_grabflare = -1;
|
||||
s_player_removeflare = -1;
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
private["_flare"];
|
||||
_flare = _this select 3;
|
||||
deleteVehicle _flare;
|
||||
player removeAction s_player_grabflare;
|
||||
player removeAction s_player_removeflare;
|
||||
s_player_grabflare = -1;
|
||||
s_player_removeflare = -1;
|
||||
@@ -0,0 +1,4 @@
|
||||
private [];
|
||||
//["dayzUpdateVehicle",[_this select 3,"all"]] call callRpcProcedure;
|
||||
dayzUpdateVehicle = [_this select 3,"all"];
|
||||
publicVariableServer "dayzUpdateVehicle";
|
||||
@@ -0,0 +1,90 @@
|
||||
private ["_item","_hasKnife","_hasKnifeBlunt","_hasHarvested","_qty","_text","_string","_type","_started","_finished","_animState","_isMedic","_array","_isListed","_config"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Gutting animal already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
_item = _this select 3;
|
||||
_hasKnife = "ItemKnife" in items player;
|
||||
_hasKnifeBlunt = "ItemKnifeBlunt" in items player;
|
||||
_type = typeOf _item;
|
||||
_hasHarvested = _item getVariable["meatHarvested",false];
|
||||
_config = configFile >> "CfgSurvival" >> "Meat" >> _type;
|
||||
|
||||
player removeAction s_player_butcher;
|
||||
s_player_butcher = 1;
|
||||
|
||||
if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
|
||||
//Get Animal Type
|
||||
_isListed = isClass (_config);
|
||||
_text = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
// Alert zombies
|
||||
[player,10,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled gutting." , "PLAIN DOWN"];
|
||||
//_abort = true;
|
||||
};
|
||||
|
||||
_hasHarvested = _item getVariable["meatHarvested",false];
|
||||
|
||||
if(_finished and !_hasHarvested) then {
|
||||
|
||||
_item setVariable["meatHarvested",true,true];
|
||||
|
||||
// Play sound since we finished
|
||||
[player,"gut",0,false,10] call dayz_zombieSpeak;
|
||||
|
||||
_qty = 2;
|
||||
if (_isListed) then {
|
||||
_qty = getNumber (_config >> "yield");
|
||||
};
|
||||
|
||||
if (_hasKnifeBlunt) then { _qty = round(_qty / 2); };
|
||||
|
||||
_array = [_item,_qty];
|
||||
|
||||
if (local _item) then {
|
||||
_array spawn local_gutObject;
|
||||
} else {
|
||||
dayzGutBody = _array;
|
||||
publicVariable "dayzGutBody";
|
||||
};
|
||||
|
||||
_string = format[localize "str_success_gutted_animal",_text,_qty];
|
||||
cutText [_string, "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
s_player_butcher = -1;
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,86 @@
|
||||
private ["_hasKnife","_qty","_item","_text","_string","_type","_started","_finished","_animState","_isMedic","_array","_hasHarvested","_hasKnifeBlunt"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Gutting zombie already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
_item = _this select 3;
|
||||
_hasKnife = "ItemKnife" in items player;
|
||||
_hasKnifeBlunt = "ItemKnifeBlunt" in items player;
|
||||
_type = typeOf _item;
|
||||
_hasHarvested = _item getVariable["meatHarvested",false];
|
||||
//_config = configFile >> "CfgSurvival" >> "Meat" >> _type;
|
||||
|
||||
player removeAction s_player_butcher;
|
||||
s_player_butcher = 1;
|
||||
|
||||
if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
|
||||
//Get Animal Type
|
||||
//_loop = true;
|
||||
//_isListed = isClass (_config);
|
||||
_text = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
// Alert zombies
|
||||
[player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled gutting." , "PLAIN DOWN"];
|
||||
//_abort = true;
|
||||
};
|
||||
|
||||
_hasHarvested = _item getVariable["meatHarvested",false];
|
||||
|
||||
if(_finished and !_hasHarvested) then {
|
||||
|
||||
_item setVariable["meatHarvested",true,true];
|
||||
|
||||
// Play sound since we finished
|
||||
[player,"gut",0,false,10] call dayz_zombieSpeak;
|
||||
|
||||
_qty = 1;
|
||||
|
||||
_array = [_item,_qty];
|
||||
|
||||
if (local _item) then {
|
||||
_array spawn local_gutObjectZ;
|
||||
} else {
|
||||
dayzGutBody = _array;
|
||||
publicVariable "dayzGutBodyZ";
|
||||
};
|
||||
|
||||
_string = format["Successfully Gutted Zombie",_text,_qty];
|
||||
cutText [_string, "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
s_player_butcher = -1;
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,85 @@
|
||||
private ["_qty","_started","_finished","_animState","_isMedic","_abort","_fillCounter","_dis","_sfx"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Fill Jerry already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
player removeAction s_player_fillfuel;
|
||||
s_player_fillfuel = 1;
|
||||
|
||||
_fillCounter = 0;
|
||||
_abort = false;
|
||||
|
||||
_qty = {_x == "ItemJerrycanEmpty"} count magazines player;
|
||||
|
||||
for "_x" from 1 to _qty do {
|
||||
|
||||
_fillCounter = _fillCounter + 1;
|
||||
|
||||
if(_qty == 1) then {
|
||||
cutText ["Preparing to siphon, stand still to fill empty jerry can.", "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [format[("Preparing to siphon, stand still to fill empty jerry can %1 of %2."),_fillCounter,_qty] , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
// Play sound and alert zombies
|
||||
|
||||
_dis=10;
|
||||
_sfx = "refuel";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled siphon." , "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
if ("ItemJerrycanEmpty" in magazines player) then {
|
||||
|
||||
player removeMagazine "ItemJerrycanEmpty";
|
||||
player addMagazine "ItemJerrycan";
|
||||
|
||||
cutText [format[(localize "str_player_09"),1], "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [(localize "str_player_10") , "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
if(_abort) exitWith {};
|
||||
};
|
||||
|
||||
s_player_fillfuel = -1;
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,25 @@
|
||||
private ["_activatingPlayer"];
|
||||
|
||||
// [ _trader_id, _category, _action ];
|
||||
_activatingPlayer = _this select 1;
|
||||
|
||||
diag_log format["DEBUG DEATH OBJ: %1", _this select 0];
|
||||
|
||||
//["dayzPlayerDeaths",[_activatingPlayer]] call callRpcProcedure;
|
||||
dayzPlayerDeaths = [_activatingPlayer];
|
||||
publicVariableServer "dayzPlayerDeaths";
|
||||
|
||||
waitUntil {!isNil "dayzPlayerDeathsResult"};
|
||||
|
||||
diag_log format["DEBUG Death: %1", dayzPlayerDeathsResult];
|
||||
|
||||
if((count dayzPlayerDeathsResult) > 0) then {
|
||||
"Recent Player Deaths:" hintC dayzPlayerDeathsResult;
|
||||
} else {
|
||||
"Recent Player Deaths:" hintC "No recent Deaths.";
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Clear Data maybe consider cacheing results
|
||||
dayzPlayerDeathsResult = nil;
|
||||
@@ -0,0 +1,20 @@
|
||||
private["_vehicle"];
|
||||
_vehicle = _this select 3;
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Lock vehicle already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
|
||||
s_player_lockUnlock_crtl = 1;
|
||||
|
||||
dayzLockVehicle = [_vehicle,true];
|
||||
if(player distance _vehicle < 10) then {
|
||||
if (local _vehicle) then {
|
||||
dayzLockVehicle spawn local_lockUnlock
|
||||
} else {
|
||||
publicVariable "dayzLockVehicle";
|
||||
};
|
||||
};
|
||||
|
||||
s_player_lockUnlock_crtl = -1;
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,108 @@
|
||||
private ["_array","_type","_classname","_holder","_config","_isOk","_muzzles","_playerID","_claimedBy","_text","_broken","_playerNear","_obj","_qty"];
|
||||
|
||||
// Exit if player zombie
|
||||
if(player isKindOf "PZombie_VB") exitWith {};
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Take item already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
// Test cannot lock while another player is nearby
|
||||
_playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]) > 1;
|
||||
if(_playerNear) exitWith { TradeInprogress = false; cutText ["Cannot take item while another player is nearby." , "PLAIN DOWN"]; };
|
||||
|
||||
_array = _this select 3;
|
||||
_type = _array select 0;
|
||||
_classname = _array select 1;
|
||||
_holder = _array select 2;
|
||||
|
||||
_playerID = getPlayerUID player;
|
||||
_text = getText (configFile >> _type >> _classname >> "displayName");
|
||||
|
||||
_claimedBy = _holder getVariable["claimed","0"];
|
||||
|
||||
// Check if any players are nearby if not allow player to claim item.
|
||||
_playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 6]) > 1;
|
||||
|
||||
// Only allow if not already claimed.
|
||||
if (_claimedBy == "0" or !_playerNear) then {
|
||||
// Since item was not claimed proceed with claiming it.
|
||||
_holder setVariable["claimed",_playerID,true];
|
||||
};
|
||||
|
||||
if(_classname isKindOf "TrapBear") exitwith {TradeInprogress = false; deleteVehicle _holder;};
|
||||
|
||||
player playActionNow "PutDown";
|
||||
if (_classname == "MeleeCrowbar") then {
|
||||
player addMagazine 'crowbar_swing';
|
||||
};
|
||||
if (_classname == "MeleeHatchet") then {
|
||||
player addMagazine 'hatchet_swing';
|
||||
};
|
||||
if (_classname == "MeleeMachete") then {
|
||||
player addMagazine 'Machete_swing';
|
||||
};
|
||||
if (_classname == "MeleeFishingPole") then {
|
||||
player addMagazine 'Fishing_Swing';
|
||||
};
|
||||
|
||||
_broken = false;
|
||||
if(_classname == "WoodenArrow") then {
|
||||
if (20 > random 100) then {
|
||||
_broken = true;
|
||||
};
|
||||
};
|
||||
if (_broken) exitWith { deleteVehicle _holder; TradeInprogress = false; cutText [localize "str_broken_arrow", "PLAIN DOWN"] };
|
||||
|
||||
sleep 1;
|
||||
|
||||
_claimedBy = _holder getVariable["claimed","0"];
|
||||
|
||||
if (_claimedBy != _playerID) exitWith {TradeInprogress = false; cutText [format[(localize "str_player_beinglooted"),_text] , "PLAIN DOWN"]};
|
||||
|
||||
if(_classname isKindOf "Bag_Base_EP1") then {
|
||||
diag_log("Picked up a bag: " + _classname);
|
||||
};
|
||||
|
||||
// test to see if item still exists just before adding and removing
|
||||
if(isNull _holder) exitWith { TradeInprogress = false; };
|
||||
|
||||
_obj = nearestObjects [(getPosATL player), [(typeOf _holder)], 5];
|
||||
_qty = count _obj;
|
||||
|
||||
if(_qty >= 1) then {
|
||||
|
||||
_config = (configFile >> _type >> _classname);
|
||||
_isOk = [player,_config] call BIS_fnc_invAdd;
|
||||
if (_isOk) then {
|
||||
|
||||
deleteVehicle _holder;
|
||||
if (_classname in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole"]) then {
|
||||
|
||||
if (_type == "cfgWeapons") then {
|
||||
_muzzles = getArray(configFile >> "cfgWeapons" >> _classname >> "muzzles");
|
||||
//_wtype = ((weapons player) select 0);
|
||||
if (count _muzzles > 1) then {
|
||||
player selectWeapon (_muzzles select 0);
|
||||
} else {
|
||||
player selectWeapon _classname;
|
||||
};
|
||||
};
|
||||
};
|
||||
} else {
|
||||
_holder setVariable["claimed","0",true];
|
||||
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
|
||||
if (_classname == "MeleeCrowbar") then {
|
||||
player removeMagazine 'crowbar_swing';
|
||||
};
|
||||
if (_classname == "MeleeHatchet") then {
|
||||
player removeMagazine 'hatchet_swing';
|
||||
};
|
||||
if (_classname == "MeleeMachete") then {
|
||||
player removeMagazine 'Machete_swing';
|
||||
};
|
||||
if (_classname == "MeleeFishingPole") then {
|
||||
player removeMagazine 'Fishing_Swing';
|
||||
};
|
||||
};
|
||||
};
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,10 @@
|
||||
private ["_array","_object","_type"];
|
||||
_array = _this select 3;
|
||||
_object = _array select 0;
|
||||
_type = TypeOf(_object);
|
||||
player playActionNow "Medic";
|
||||
sleep 8;
|
||||
player addBackpack format["%1_US_Bag_EP1",_type];
|
||||
deleteVehicle _object;
|
||||
r_action = false;
|
||||
call fnc_usec_medic_removeActions;
|
||||
@@ -0,0 +1,89 @@
|
||||
private ["_item","_config","_onLadder","_create","_isOk","_config2","_magType","_meleeNum","_muzzles","_wtype","_type","_hastoolweapon","_text"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Add to toolbelt already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
_item = _this;
|
||||
_config = configFile >> "cfgWeapons" >> _item;
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
if (_onLadder) exitWith {TradeInprogress = false; cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
_hastoolweapon = _this in weapons player;
|
||||
_text = getText (_config >> "displayName");
|
||||
if (!_hastoolweapon) exitWith {TradeInprogress = false; cutText [format[(localize "str_player_30"),_text] , "PLAIN DOWN"]};
|
||||
|
||||
call gear_ui_init;
|
||||
|
||||
//Add new item
|
||||
_create = getArray (_config >> "ItemActions" >> "Toolbelt" >> "output") select 0;
|
||||
_config2 = configFile >> "cfgWeapons" >> _create;
|
||||
|
||||
//Remove magazines if needed
|
||||
if (_item in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole"]) then {
|
||||
_magType = ([] + getArray (configFile >> "cfgWeapons" >> _item >> "magazines")) select 0;
|
||||
_meleeNum = ({_x == _magType} count magazines player);
|
||||
for "_i" from 1 to _meleeNum do {
|
||||
player removeMagazine _magType;
|
||||
};
|
||||
};
|
||||
|
||||
if (_item in ["ItemHatchet","ItemCrowbar","ItemMachete"]) then {
|
||||
switch (primaryWeapon player) do
|
||||
{
|
||||
case "MeleeHatchet": { "MeleeHatchet" call player_addToolbelt };
|
||||
case "MeleeCrowbar": { "MeleeCrowbar" call player_addToolbelt };
|
||||
case "MeleeMachete": { "MeleeMachete" call player_addToolbelt };
|
||||
};
|
||||
};
|
||||
|
||||
_isOk = [player,_config2] call BIS_fnc_invAdd;
|
||||
|
||||
if (_isOk) then {
|
||||
//Remove item
|
||||
player removeWeapon _item;
|
||||
|
||||
//Add magazines if needed
|
||||
if (_create in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole"]) then {
|
||||
if (_create == "MeleeCrowbar") then {
|
||||
player addMagazine 'crowbar_swing';
|
||||
};
|
||||
if (_create == "MeleeHatchet") then {
|
||||
player addMagazine 'hatchet_swing';
|
||||
};
|
||||
if (_create == "MeleeMachete") then {
|
||||
player addMagazine 'Machete_swing';
|
||||
};
|
||||
if (_create == "MeleeFishingPole") then {
|
||||
player addMagazine 'Fishing_Swing';
|
||||
};
|
||||
if (_type == "cfgWeapons") then {
|
||||
_muzzles = getArray(configFile >> "cfgWeapons" >> _create >> "muzzles");
|
||||
_wtype = ((weapons player) select 0);
|
||||
if (count _muzzles > 1) then {
|
||||
player selectWeapon (_muzzles select 0);
|
||||
} else {
|
||||
player selectWeapon _wtype;
|
||||
};
|
||||
};
|
||||
};
|
||||
} else {
|
||||
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
|
||||
|
||||
//Add magazines back
|
||||
if (_item in ["MeleeHatchet","MeleeCrowbar","MeleeMachete","MeleeFishingPole"]) then {
|
||||
if (_item == "MeleeCrowbar") then {
|
||||
player addMagazine 'crowbar_swing';
|
||||
};
|
||||
if (_item == "MeleeHatchet") then {
|
||||
player addMagazine 'hatchet_swing';
|
||||
};
|
||||
if (_item == "MeleeMachete") then {
|
||||
player addMagazine 'Machete_swing';
|
||||
};
|
||||
if (_item == "MeleeFishingPole") then {
|
||||
player addMagazine 'Fishing_Swing';
|
||||
};
|
||||
};
|
||||
};
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,307 @@
|
||||
private ["_location","_dir","_classname","_item","_hasrequireditem","_missing","_hastoolweapon","_cancel","_reason","_isBuilding","_started","_finished","_animState","_isMedic","_dis","_sfx","_hasbuilditem","_tmpbuilt","_buildings","_onLadder","_isWater","_require","_text","_offset","_IsNearPlot","_isOk","_location1","_location2","_counter","_limit","_proceed","_num_removed","_position","_object","_canBuildOnPlot","_friendlies","_nearestPole","_ownerID","_findNearestPoles","_findNearestPole"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Building already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
_isWater = (surfaceIsWater (getPosATL player)) or dayz_isSwimming;
|
||||
_cancel = false;
|
||||
_reason = "";
|
||||
_canBuildOnPlot = false;
|
||||
|
||||
call gear_ui_init;
|
||||
|
||||
if(_isWater) exitWith {TradeInprogress = false; cutText [localize "str_player_26", "PLAIN DOWN"];};
|
||||
if(_onLadder) exitWith {TradeInprogress = false; cutText [localize "str_player_21", "PLAIN DOWN"];};
|
||||
if(player getVariable["combattimeout", 0] >= time) exitWith {TradeInprogress = false; cutText ["Cannot build while in combat.", "PLAIN DOWN"];};
|
||||
|
||||
_item = _this;
|
||||
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
|
||||
_require = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "require");
|
||||
|
||||
_needNearby = getArray (configFile >> "cfgMagazines" >> _this >> "ItemActions" >> "Build" >> "needNearby");
|
||||
|
||||
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
|
||||
_offset = getArray (configFile >> "CfgVehicles" >> _classname >> "offset");
|
||||
|
||||
_isPole = (_classname == "Plastic_Pole_EP1_DZ");
|
||||
|
||||
_distance = 30;
|
||||
_needText = "Plot Pole";
|
||||
|
||||
if(_isPole) then {
|
||||
_distance = 45;
|
||||
};
|
||||
|
||||
if((count _needNearby) == 0) then {
|
||||
_needNearby = ["Plastic_Pole_EP1_DZ"];
|
||||
} else {
|
||||
if("dayz_fuelpumparray" in _needNearby) then {
|
||||
_needNearby = dayz_fuelpumparray;
|
||||
_needText = "Fuel Pump";
|
||||
};
|
||||
if("dayz_fuelsources" in _needNearby) then {
|
||||
_needNearby = dayz_fuelsources;
|
||||
_needText = "Fuel Tanks";
|
||||
};
|
||||
};
|
||||
|
||||
// check for near plot
|
||||
_findNearestPoles = nearestObjects [(vehicle player), _needNearby, _distance];
|
||||
_findNearestPole = [];
|
||||
|
||||
{if (alive _x) then {_findNearestPole set [(count _findNearestPole),_x];};} foreach _findNearestPoles;
|
||||
_IsNearPlot = count (_findNearestPole);
|
||||
|
||||
// If item is plot pole and another one exists within 45m
|
||||
if(_isPole and _IsNearPlot > 0) exitWith { TradeInprogress = false; cutText ["Cannot build plot pole within 45m of an existing plot." , "PLAIN DOWN"]; };
|
||||
|
||||
if(_IsNearPlot == 0) then {
|
||||
|
||||
// Allow building of plot
|
||||
if(_isPole) then {
|
||||
_canBuildOnPlot = true;
|
||||
};
|
||||
|
||||
} else {
|
||||
// Since there are plots nearby we check for ownership and then for friend status
|
||||
|
||||
if("Plastic_Pole_EP1_DZ" in _needNearby) then {
|
||||
_nearestPole = _findNearestPole select 0;
|
||||
|
||||
// Find owner
|
||||
_ownerID = _nearestPole getVariable["CharacterID","0"];
|
||||
|
||||
// diag_log format["DEBUG BUILDING: %1 = %2", dayz_characterID, _ownerID];
|
||||
|
||||
// check if friendly to owner
|
||||
if(dayz_characterID == _ownerID) then {
|
||||
// owner can build anything within his plot except other plots
|
||||
if(!_isPole) then {
|
||||
_canBuildOnPlot = true;
|
||||
};
|
||||
|
||||
} else {
|
||||
// disallow building plot
|
||||
if(!_isPole) then {
|
||||
_friendlies = player getVariable ["friendlyTo",[]];
|
||||
// check if friendly to owner
|
||||
if(_ownerID in _friendlies) then {
|
||||
_canBuildOnPlot = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
} else {
|
||||
_canBuildOnPlot = true;
|
||||
};
|
||||
};
|
||||
|
||||
// _message
|
||||
if(!_canBuildOnPlot) exitWith { TradeInprogress = false; cutText [format["Building requires %1 within %2m.",_needText,_distance] , "PLAIN DOWN"]; };
|
||||
|
||||
_missing = "";
|
||||
_hasrequireditem = true;
|
||||
{
|
||||
_hastoolweapon = _x in weapons player;
|
||||
if(!_hastoolweapon) exitWith { _hasrequireditem = false; _missing = _x; }
|
||||
} forEach _require;
|
||||
|
||||
_hasbuilditem = _this in magazines player;
|
||||
if (!_hasbuilditem) exitWith {TradeInprogress = false; cutText [format[(localize "str_player_31"),_text,"build"] , "PLAIN DOWN"]; };
|
||||
|
||||
if (!_hasrequireditem) exitWith {TradeInprogress = false; cutText [format["Missing tool %1",_missing] , "PLAIN DOWN"]; };
|
||||
if (_hasrequireditem) then {
|
||||
|
||||
_location = [0,0,0];
|
||||
_dir = getDir player;
|
||||
|
||||
player allowDamage false;
|
||||
|
||||
_position = player modeltoworld _offset;
|
||||
_position = [(_position select 0),(_position select 1), 0];
|
||||
|
||||
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
|
||||
_object setDir _dir;
|
||||
|
||||
_object setPos _position;
|
||||
|
||||
_object allowDamage false;
|
||||
|
||||
_object attachTo [player];
|
||||
|
||||
_counter = 0;
|
||||
_isOk = true;
|
||||
|
||||
while {_isOk} do {
|
||||
|
||||
if (player getVariable["combattimeout", 0] >= time) exitWith {
|
||||
_isOk = false;
|
||||
_cancel = true;
|
||||
_reason = "Cannot build while in combat.";
|
||||
};
|
||||
|
||||
cutText ["Planning construction stand still 5 seconds to build.", "PLAIN DOWN"];
|
||||
|
||||
_location1 = getPosATL player;
|
||||
sleep 5;
|
||||
_location2 = getPosATL player;
|
||||
|
||||
if(_location1 distance _location2 < 0.1) exitWith {
|
||||
_isOk = false;
|
||||
};
|
||||
|
||||
if(_location1 distance _location2 > 5) exitWith {
|
||||
_isOk = false;
|
||||
_cancel = true;
|
||||
_reason = "Moving to fast.";
|
||||
};
|
||||
|
||||
if(_counter >= 3) exitWith {
|
||||
_isOk = false;
|
||||
_cancel = true;
|
||||
_reason = "Ran out of time to find position.";
|
||||
};
|
||||
_counter = _counter + 1;
|
||||
};
|
||||
|
||||
detach _object;
|
||||
deleteVehicle _object;
|
||||
|
||||
|
||||
// Start Build
|
||||
_tmpbuilt = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
|
||||
_dir = getDir player;
|
||||
_tmpbuilt setdir _dir;
|
||||
|
||||
// Get position based on player
|
||||
_location = player modeltoworld _offset;
|
||||
|
||||
// No building on roads
|
||||
if (isOnRoad _location) then { _cancel = true; _reason = "Cannot build on a road."; };
|
||||
|
||||
// set building with ground
|
||||
_location = [(_location select 0),(_location select 1), 0];
|
||||
_tmpbuilt setpos _location;
|
||||
|
||||
// set building with offset
|
||||
// _tmpbuilt setpos _location;
|
||||
|
||||
player allowDamage true;
|
||||
|
||||
// testing new way of finding building
|
||||
_buildings = nearestObjects [(vehicle player), ["Building"], 100];
|
||||
{
|
||||
_isBuilding = [(vehicle player),_x] call fnc_isInsideBuilding;
|
||||
if(_isBuilding) exitWith {
|
||||
_cancel = true;
|
||||
_reason = "Cannot build inside another building.";
|
||||
};
|
||||
} forEach _buildings;
|
||||
|
||||
// No building in trader zones
|
||||
if(!canbuild) then { _cancel = true; _reason = "Cannot build in a city."; };
|
||||
|
||||
if(!_cancel) then {
|
||||
|
||||
cutText [format["Placing %1, move to cancel.",_text], "PLAIN DOWN"];
|
||||
|
||||
_limit = 5;
|
||||
|
||||
if(isNumber (configFile >> "CfgVehicles" >> _classname >> "constructioncount")) then {
|
||||
_limit = getNumber(configFile >> "CfgVehicles" >> _classname >> "constructioncount");
|
||||
};
|
||||
|
||||
_isOk = true;
|
||||
_proceed = false;
|
||||
_counter = 0;
|
||||
|
||||
while {_isOk} do {
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
_dis=20;
|
||||
_sfx = "repair";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt or (player getVariable["combattimeout", 0] >= time)) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
|
||||
if(!_finished) exitWith {
|
||||
_isOk = false;
|
||||
_proceed = false;
|
||||
};
|
||||
|
||||
if(_finished) then {
|
||||
_counter = _counter + 1;
|
||||
};
|
||||
|
||||
cutText [format["Constructing %1 stage %2 of %3, move to cancel.",_text, _counter,_limit], "PLAIN DOWN"];
|
||||
|
||||
if(_counter == _limit) exitWith {
|
||||
_isOk = false;
|
||||
_proceed = true;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
if (_proceed) then {
|
||||
|
||||
_num_removed = ([player,_item] call BIS_fnc_invRemove);
|
||||
if(_num_removed == 1) then {
|
||||
|
||||
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
|
||||
|
||||
_tmpbuilt setVariable ["characterID",dayz_characterID,true];
|
||||
|
||||
//["dayzPublishObj",[dayz_characterID,_tmpbuilt,[_dir,_location],_classname]] call callRpcProcedure;
|
||||
dayzPublishObj = [dayz_characterID,_tmpbuilt,[_dir,_location],_classname];
|
||||
publicVariableServer "dayzPublishObj";
|
||||
|
||||
} else {
|
||||
deleteVehicle _tmpbuilt;
|
||||
cutText ["Canceled building." , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
|
||||
deleteVehicle _tmpbuilt;
|
||||
|
||||
cutText ["Canceled building." , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
deleteVehicle _tmpbuilt;
|
||||
cutText [format["Canceled construction of %1 %2.",_text,_reason], "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,146 @@
|
||||
/*
|
||||
DayZ Enhanced ChopWood
|
||||
Usage: spawn player_chopWood;
|
||||
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
|
||||
*/
|
||||
private ["_isOk","_i","_objName","_objInfo","_lenInfo","_started","_finished","_animState","_isMedic","_proceed","_counter","_itemOut","_countOut","_tree","_distance2d","_distance3d","_trees","_findNearestTree"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Harvest wood already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
// allowed trees list move this later
|
||||
_trees = ["t_pyrus2s.p3d","str_briza_kriva.p3d","dd_borovice.p3d","les_singlestrom_b.p3d","les_singlestrom.p3d","smrk_velky.p3d","smrk_siroky.p3d","smrk_maly.p3d","les_buk.p3d","str krovisko vysoke.p3d","str_fikovnik_ker.p3d","str_fikovnik.p3d","str vrba.p3d","hrusen2.p3d","str dub jiny.p3d","str lipa.p3d","str briza.p3d","p_akat02s.p3d","jablon.p3d","p_buk.p3d","str_topol.p3d","str_topol2.p3d","p_osika.p3d","t_picea3f.p3d","t_picea2s.p3d","t_picea1s.p3d","t_fagus2w.p3d","t_fagus2s.p3d","t_fagus2f.p3d","t_betula1f.p3d","t_betula2f.p3d","t_betula2s.p3d","t_betula2w.p3d","t_alnus2s.p3d","t_acer2s.p3d","t_populus3s.p3d","t_quercus2f.p3d","t_sorbus2s.p3d","t_malus1s.p3d","t_salix2s.p3d","t_picea1s_w.p3d","t_picea2s_w.p3d","t_ficusb2s_ep1.p3d","t_populusb2s_ep1.p3d","t_populusf2s_ep1.p3d","t_amygdalusc2s_ep1.p3d","t_ficusb2s_ep1.p3d","t_pistacial2s_ep1.p3d","t_pinuse2s_ep1.p3d","t_pinuss3s_ep1.p3d","t_prunuss2s_ep1.p3d","t_pinusn2s.p3d","t_pinusn1s.p3d","t_pinuss2f.p3d","t_poplar2f_dead_pmc.p3d","misc_torzotree_pmc.p3d","misc_burnspruce_pmc.p3d","brg_cocunutpalm8.p3d","brg_umbrella_acacia01b.p3d","brg_jungle_tree_canopy_1.p3d","brg_jungle_tree_canopy_2.p3d","brg_cocunutpalm4.p3d","brg_cocunutpalm3.p3d","palm_01.p3d","palm_02.p3d","palm_03.p3d","palm_04.p3d","palm_09.p3d","palm_10.p3d","brg_cocunutpalm2.p3d","brg_jungle_tree_antiaris.p3d","brg_cocunutpalm1.p3d"];
|
||||
|
||||
//_item = _this;
|
||||
call gear_ui_init;
|
||||
|
||||
_findNearestTree = [];
|
||||
{
|
||||
if("" == typeOf _x) then {
|
||||
|
||||
if (alive _x) then {
|
||||
|
||||
_objInfo = toArray(str(_x));
|
||||
_lenInfo = count _objInfo - 1;
|
||||
_objName = [];
|
||||
_i = 0;
|
||||
// determine where the object name starts
|
||||
{
|
||||
if (58 == _objInfo select _i) exitWith {};
|
||||
_i = _i + 1;
|
||||
} forEach _objInfo;
|
||||
_i = _i + 2; // skip the ": " part
|
||||
for "_k" from _i to _lenInfo do {
|
||||
_objName = _objName + [_objInfo select _k];
|
||||
};
|
||||
_objName = toLower(toString(_objName));
|
||||
|
||||
// Exit since we found a tree
|
||||
if (_objName in _trees) exitWith {
|
||||
_findNearestTree set [(count _findNearestTree),_x];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
} foreach nearestObjects [getPos player, [], 20];
|
||||
|
||||
diag_log format["DEBUG TREES: %1", _findNearestTree];
|
||||
|
||||
if (count(_findNearestTree) >= 1) then {
|
||||
|
||||
_tree = _findNearestTree select 0;
|
||||
|
||||
// get 2d distance
|
||||
_distance2d = [player, _tree] call BIS_fnc_distance2D;
|
||||
_distance3d = player distance _tree;
|
||||
|
||||
if(_distance2d <= 5) then {
|
||||
|
||||
_countOut = ceil(_distance3d-_distance2d);
|
||||
|
||||
diag_log format["DEBUG TREE DISTANCE: %1 - %2 = %3", _distance3d,_distance2d,(_distance3d-_distance2d)];
|
||||
|
||||
// Start chop tree loop
|
||||
_counter = 0;
|
||||
_isOk = true;
|
||||
_proceed = false;
|
||||
while {_isOk} do {
|
||||
|
||||
player playActionNow "Medic";
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
[player,"chopwood",0,false] call dayz_zombieSpeak;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
|
||||
sleep 0.1;
|
||||
|
||||
};
|
||||
|
||||
if(!_finished) exitWith {
|
||||
_isOk = false;
|
||||
_proceed = false;
|
||||
};
|
||||
|
||||
if(_finished) then {
|
||||
_counter = _counter + 1;
|
||||
};
|
||||
|
||||
cutText ["Chopping down tree, walk away at anytime to cancel.", "PLAIN DOWN"];
|
||||
|
||||
if(_counter == _countOut) exitWith {
|
||||
_isOk = false;
|
||||
_proceed = true;
|
||||
};
|
||||
};
|
||||
|
||||
if (_proceed) then {
|
||||
|
||||
_itemOut = "PartWoodPile";
|
||||
|
||||
for "_x" from 1 to _countOut do {
|
||||
player addMagazine _itemOut;
|
||||
};
|
||||
|
||||
// chop down tree
|
||||
if("" == typeOf _tree) then {
|
||||
_tree setDamage 1;
|
||||
};
|
||||
diag_log format["DEBUG TREE DAMAGE: %1", _tree];
|
||||
|
||||
cutText [format["%1 piles of wood has been successfully added to your inventory.", _countOut], "PLAIN DOWN"];
|
||||
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled Harvesting Wood.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText [localize "str_player_23", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText [localize "str_player_23", "PLAIN DOWN"];
|
||||
};
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,78 @@
|
||||
private ["_item","_config","_onLadder","_create","_started","_finished","_animState","_isMedic","_qty","_box","_num_removed","_text","_haskey","_hastoolweapon","_isNear","_hasTinBar"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Copy key already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
_item = _this;
|
||||
_config = configFile >> "cfgWeapons" >> _item;
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
if (_onLadder) exitWith {TradeInprogress = false; cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
_text = getText (_config >> "displayName");
|
||||
_haskey = _this in weapons player;
|
||||
if (!_haskey) exitWith {TradeInprogress = false; cutText [format[(localize "str_player_30"),_text] , "PLAIN DOWN"]};
|
||||
|
||||
_hastoolweapon = "ItemKeyKit" in weapons player;
|
||||
if (!_hastoolweapon) exitWith {TradeInprogress = false; cutText ["Need Keymakers kit to make a copy of a key." , "PLAIN DOWN"]};
|
||||
|
||||
_isNear = {inflamed _x} count (position player nearObjects 2);
|
||||
if(_isNear == 0) exitWith {TradeInprogress = false; cutText ["Key crafting needs a fire within 2 meters." , "PLAIN DOWN"]};
|
||||
|
||||
call gear_ui_init;
|
||||
|
||||
// require one tin bar per key
|
||||
_hasTinBar = "ItemTinBar" in magazines player;
|
||||
if(!_hasTinBar) exitWith {TradeInprogress = false; cutText ["Key crafting requires a 1oz Tin Bar." , "PLAIN DOWN"]};
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
[player,"repair",0,false] call dayz_zombieSpeak;
|
||||
[player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if(_finished) then {
|
||||
|
||||
_num_removed = ([player,"ItemTinBar"] call BIS_fnc_invRemove);
|
||||
|
||||
if(_num_removed == 1) then {
|
||||
// output key to backpack if space
|
||||
_create = _item;
|
||||
_qty = 1;
|
||||
_box = unitBackpack player;
|
||||
_box addWeaponCargoGlobal [_create,_qty];
|
||||
cutText ["Copied key has been added to your backpack." , "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText ["Canceled Key Crafting." , "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled Key Crafting." , "PLAIN DOWN"];
|
||||
};
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
count player magazines with ammo count
|
||||
value = call player_countmagazines;
|
||||
return all player magazines with ammo count
|
||||
*/
|
||||
private ["_dialog","_control","_magazineArray","_item","_val","_max","_created"];
|
||||
disableSerialization;
|
||||
disableUserInput true;
|
||||
_dialog = findDisplay 106;
|
||||
_created = false;
|
||||
if ( isNull _dialog ) then {
|
||||
//startLoadingScreen [""];
|
||||
createGearDialog [player, "RscDisplayGear"];
|
||||
_dialog = findDisplay 106;
|
||||
_created = true;
|
||||
};
|
||||
|
||||
_magazineArray = [];
|
||||
for "_i" from 109 to 120 do
|
||||
{
|
||||
_control = _dialog displayCtrl _i;
|
||||
_item = gearSlotData _control;
|
||||
_val = gearSlotAmmoCount _control;
|
||||
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
|
||||
if (_item != "") then {
|
||||
if (_val != _max) then {
|
||||
_magazineArray set [count _magazineArray,[_item,_val]];
|
||||
} else {
|
||||
_magazineArray set [count _magazineArray,_item];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
for "_i" from 122 to 129 do
|
||||
{
|
||||
_control = _dialog displayCtrl _i;
|
||||
_item = gearSlotData _control;
|
||||
_val = gearSlotAmmoCount _control;
|
||||
_max = getNumber (configFile >> "CfgMagazines" >> _item >> "count");
|
||||
if (_item != "") then {
|
||||
if (_val != _max) then {
|
||||
_magazineArray set [count _magazineArray,[_item,_val]];
|
||||
} else {
|
||||
_magazineArray set [count _magazineArray,_item];
|
||||
};
|
||||
};
|
||||
};
|
||||
if ( _created ) then {
|
||||
closeDialog 0;
|
||||
//endLoadingScreen;
|
||||
};
|
||||
disableUserInput false;
|
||||
dayz_Magazines=_magazineArray;
|
||||
_magazineArray
|
||||
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
DayZ Crafting
|
||||
Usage: spawn player_goFishing;
|
||||
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
|
||||
*/
|
||||
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_consumeweapons","_item"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Crafting already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
// temp array of removed parts
|
||||
_temp_removed_array = [];
|
||||
_abort = false;
|
||||
_distance = 2;
|
||||
_reason = "";
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
|
||||
|
||||
_item = _this;
|
||||
_crafting = "Crafting";
|
||||
|
||||
// check if fire is reqired
|
||||
_needNear = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "neednearby");
|
||||
|
||||
if("fire" in _needNear) then {
|
||||
_isNear = {inflamed _x} count (position player nearObjects _distance);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "fire";
|
||||
};
|
||||
};
|
||||
|
||||
if("workshop" in _needNear) then {
|
||||
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ"], 5]);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "workshop";
|
||||
};
|
||||
};
|
||||
|
||||
if(_abort) exitWith {
|
||||
cutText [format["Crafting needs a %1 within %2 meters",_reason,_distance], "PLAIN DOWN"];
|
||||
TradeInprogress = false;
|
||||
};
|
||||
|
||||
// diag_log format["Checking for fire: %1", _isFireNear];
|
||||
|
||||
if (_canDo) then {
|
||||
|
||||
// Moved all recipes input and outputs to configs
|
||||
|
||||
_selectedRecipeOutput = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "output");
|
||||
_selectedRecipeInput = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "input");
|
||||
_selectedRecipeTools = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "requiretools");
|
||||
_consumeweapons = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "consumeweapons");
|
||||
|
||||
_missing = "";
|
||||
_missingTools = false;
|
||||
{
|
||||
_hastoolweapon = _x in weapons player;
|
||||
if(!_hastoolweapon) exitWith { _missingTools = true; _missing = _x; };
|
||||
} forEach _selectedRecipeTools;
|
||||
|
||||
if(!_missingTools) then {
|
||||
|
||||
diag_log format["Selected Recipe Input: %1", _selectedRecipeInput];
|
||||
diag_log format["Selected Recipe Output: %1", _selectedRecipeOutput];
|
||||
|
||||
// Dry run to see if all parts are available.
|
||||
_proceed = true;
|
||||
{
|
||||
_itemIn = _x select 0;
|
||||
_countIn = _x select 1;
|
||||
|
||||
diag_log format["Recipe Check: %1 %2", _itemIn,_countIn];
|
||||
|
||||
// not neccessary
|
||||
//if (!(_itemIn in magazines player)) exitWith { _missing = _itemIn; _missingQty = _countIn; _proceed = false; };
|
||||
|
||||
// match against class and parentClass
|
||||
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
|
||||
|
||||
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
|
||||
|
||||
} forEach _selectedRecipeInput;
|
||||
|
||||
// If all parts proceed
|
||||
if (_proceed) then {
|
||||
|
||||
cutText ["Crafting started", "PLAIN DOWN"];
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
[player,"repair",0,false] call dayz_zombieSpeak;
|
||||
[player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
_removed_total = 0; // count total of removed items
|
||||
_tobe_removed_total = 0; // count total of all to be removed items
|
||||
// Take items
|
||||
{
|
||||
_removed = 0;
|
||||
_itemIn = _x select 0;
|
||||
_countIn = _x select 1;
|
||||
// diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn];
|
||||
_tobe_removed_total = _tobe_removed_total + _countIn;
|
||||
|
||||
{
|
||||
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
|
||||
_num_removed = ([player,_x] call BIS_fnc_invRemove);
|
||||
_removed = _removed + _num_removed;
|
||||
_removed_total = _removed_total + _num_removed;
|
||||
if(_num_removed >= 1) then {
|
||||
_temp_removed_array set [count _temp_removed_array,_x];
|
||||
};
|
||||
};
|
||||
|
||||
} forEach magazines player;
|
||||
|
||||
} forEach _selectedRecipeInput;
|
||||
|
||||
diag_log format["removed: %1 of: %2", _removed, _tobe_removed_total];
|
||||
|
||||
// Only proceed if all parts were removed successfully
|
||||
if(_removed_total == _tobe_removed_total) then {
|
||||
|
||||
// Put items
|
||||
{
|
||||
// consumeweapons
|
||||
{
|
||||
player removeWeapon _x;
|
||||
} forEach _consumeweapons;
|
||||
|
||||
_itemOut = _x select 0;
|
||||
_countOut = _x select 1;
|
||||
diag_log format["Recipe Output: %1 %2", _itemOut,_countOut];
|
||||
|
||||
for "_x" from 1 to _countOut do {
|
||||
player addMagazine _itemOut;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// get display name
|
||||
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName");
|
||||
|
||||
// Add crafted item
|
||||
cutText [format["Crafted Item: %1 x %2",_textCreate,_countOut], "PLAIN DOWN"];
|
||||
|
||||
} forEach _selectedRecipeOutput;
|
||||
|
||||
} else {
|
||||
// Refund parts since we failed
|
||||
{player addMagazine _x;} forEach _temp_removed_array;
|
||||
|
||||
cutText [format["Missing Parts after first check Item: %1 / %2",_removed_total,_tobe_removed_total], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled crafting.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
|
||||
cutText [format["Missing %1 more of %2",_missingQty, _textMissing], "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
_textMissing = getText(configFile >> "CfgWeapons" >> _missing >> "displayName");
|
||||
cutText [format["Missing Tool: %1",_textMissing], "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
cutText ["Crafting needs a fire within 2 meters.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
DayZ Crafting
|
||||
Usage: spawn player_goFishing;
|
||||
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
|
||||
*/
|
||||
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_consumeweapons","_item"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Crafting already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
// temp array of removed parts
|
||||
_temp_removed_array = [];
|
||||
_abort = false;
|
||||
_distance = 2;
|
||||
_reason = "";
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
|
||||
|
||||
_item = _this;
|
||||
_crafting = "Crafting1";
|
||||
|
||||
// check if fire is reqired
|
||||
_needNear = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "neednearby");
|
||||
|
||||
if("fire" in _needNear) then {
|
||||
_isNear = {inflamed _x} count (position player nearObjects _distance);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "fire";
|
||||
};
|
||||
};
|
||||
|
||||
if("workshop" in _needNear) then {
|
||||
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ"], 5]);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "workshop";
|
||||
};
|
||||
};
|
||||
|
||||
if(_abort) exitWith {
|
||||
cutText [format["Crafting needs a %1 within %2 meters",_reason,_distance], "PLAIN DOWN"];
|
||||
TradeInprogress = false;
|
||||
};
|
||||
|
||||
// diag_log format["Checking for fire: %1", _isFireNear];
|
||||
|
||||
if (_canDo) then {
|
||||
|
||||
// Moved all recipes input and outputs to configs
|
||||
|
||||
_selectedRecipeOutput = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "output");
|
||||
_selectedRecipeInput = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "input");
|
||||
_selectedRecipeTools = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "requiretools");
|
||||
_consumeweapons = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "consumeweapons");
|
||||
|
||||
_missing = "";
|
||||
_missingTools = false;
|
||||
{
|
||||
_hastoolweapon = _x in weapons player;
|
||||
if(!_hastoolweapon) exitWith { _missingTools = true; _missing = _x; };
|
||||
} forEach _selectedRecipeTools;
|
||||
|
||||
if(!_missingTools) then {
|
||||
|
||||
diag_log format["Selected Recipe Input: %1", _selectedRecipeInput];
|
||||
diag_log format["Selected Recipe Output: %1", _selectedRecipeOutput];
|
||||
|
||||
// Dry run to see if all parts are available.
|
||||
_proceed = true;
|
||||
{
|
||||
_itemIn = _x select 0;
|
||||
_countIn = _x select 1;
|
||||
|
||||
diag_log format["Recipe Check: %1 %2", _itemIn,_countIn];
|
||||
|
||||
// not neccessary
|
||||
//if (!(_itemIn in magazines player)) exitWith { _missing = _itemIn; _missingQty = _countIn; _proceed = false; };
|
||||
|
||||
// match against class and parentClass
|
||||
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
|
||||
|
||||
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
|
||||
|
||||
} forEach _selectedRecipeInput;
|
||||
|
||||
// If all parts proceed
|
||||
if (_proceed) then {
|
||||
|
||||
cutText ["Crafting started", "PLAIN DOWN"];
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
[player,"repair",0,false] call dayz_zombieSpeak;
|
||||
[player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
_removed_total = 0; // count total of removed items
|
||||
_tobe_removed_total = 0; // count total of all to be removed items
|
||||
// Take items
|
||||
{
|
||||
_removed = 0;
|
||||
_itemIn = _x select 0;
|
||||
_countIn = _x select 1;
|
||||
// diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn];
|
||||
_tobe_removed_total = _tobe_removed_total + _countIn;
|
||||
|
||||
{
|
||||
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
|
||||
_num_removed = ([player,_x] call BIS_fnc_invRemove);
|
||||
_removed = _removed + _num_removed;
|
||||
_removed_total = _removed_total + _num_removed;
|
||||
if(_num_removed >= 1) then {
|
||||
_temp_removed_array set [count _temp_removed_array,_x];
|
||||
};
|
||||
};
|
||||
|
||||
} forEach magazines player;
|
||||
|
||||
} forEach _selectedRecipeInput;
|
||||
|
||||
diag_log format["removed: %1 of: %2", _removed, _tobe_removed_total];
|
||||
|
||||
// Only proceed if all parts were removed successfully
|
||||
if(_removed_total == _tobe_removed_total) then {
|
||||
|
||||
// Put items
|
||||
{
|
||||
// consumeweapons
|
||||
{
|
||||
player removeWeapon _x;
|
||||
} forEach _consumeweapons;
|
||||
|
||||
_itemOut = _x select 0;
|
||||
_countOut = _x select 1;
|
||||
diag_log format["Recipe Output: %1 %2", _itemOut,_countOut];
|
||||
|
||||
for "_x" from 1 to _countOut do {
|
||||
player addMagazine _itemOut;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// get display name
|
||||
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName");
|
||||
|
||||
// Add crafted item
|
||||
cutText [format["Crafted Item: %1 x %2",_textCreate,_countOut], "PLAIN DOWN"];
|
||||
|
||||
} forEach _selectedRecipeOutput;
|
||||
|
||||
} else {
|
||||
// Refund parts since we failed
|
||||
{player addMagazine _x;} forEach _temp_removed_array;
|
||||
|
||||
cutText [format["Missing Parts after first check Item: %1 / %2",_removed_total,_tobe_removed_total], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled crafting.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
|
||||
cutText [format["Missing %1 more of %2",_missingQty, _textMissing], "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
_textMissing = getText(configFile >> "CfgWeapons" >> _missing >> "displayName");
|
||||
cutText [format["Missing Tool: %1",_textMissing], "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
cutText ["Crafting needs a fire within 2 meters.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
DayZ Crafting
|
||||
Usage: spawn player_goFishing;
|
||||
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
|
||||
*/
|
||||
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_consumeweapons","_item"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Crafting already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
// temp array of removed parts
|
||||
_temp_removed_array = [];
|
||||
_abort = false;
|
||||
_distance = 2;
|
||||
_reason = "";
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
|
||||
|
||||
_item = _this;
|
||||
_crafting = "Crafting2";
|
||||
|
||||
// check if fire is reqired
|
||||
_needNear = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "neednearby");
|
||||
|
||||
if("fire" in _needNear) then {
|
||||
_isNear = {inflamed _x} count (position player nearObjects _distance);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "fire";
|
||||
};
|
||||
};
|
||||
|
||||
if("workshop" in _needNear) then {
|
||||
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ"], 5]);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "workshop";
|
||||
};
|
||||
};
|
||||
|
||||
if(_abort) exitWith {
|
||||
cutText [format["Crafting needs a %1 within %2 meters",_reason,_distance], "PLAIN DOWN"];
|
||||
TradeInprogress = false;
|
||||
};
|
||||
|
||||
// diag_log format["Checking for fire: %1", _isFireNear];
|
||||
|
||||
if (_canDo) then {
|
||||
|
||||
// Moved all recipes input and outputs to configs
|
||||
|
||||
_selectedRecipeOutput = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "output");
|
||||
_selectedRecipeInput = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "input");
|
||||
_selectedRecipeTools = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "requiretools");
|
||||
_consumeweapons = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "consumeweapons");
|
||||
|
||||
_missing = "";
|
||||
_missingTools = false;
|
||||
{
|
||||
_hastoolweapon = _x in weapons player;
|
||||
if(!_hastoolweapon) exitWith { _missingTools = true; _missing = _x; };
|
||||
} forEach _selectedRecipeTools;
|
||||
|
||||
if(!_missingTools) then {
|
||||
|
||||
diag_log format["Selected Recipe Input: %1", _selectedRecipeInput];
|
||||
diag_log format["Selected Recipe Output: %1", _selectedRecipeOutput];
|
||||
|
||||
// Dry run to see if all parts are available.
|
||||
_proceed = true;
|
||||
{
|
||||
_itemIn = _x select 0;
|
||||
_countIn = _x select 1;
|
||||
|
||||
diag_log format["Recipe Check: %1 %2", _itemIn,_countIn];
|
||||
|
||||
// not neccessary
|
||||
//if (!(_itemIn in magazines player)) exitWith { _missing = _itemIn; _missingQty = _countIn; _proceed = false; };
|
||||
|
||||
// match against class and parentClass
|
||||
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
|
||||
|
||||
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
|
||||
|
||||
} forEach _selectedRecipeInput;
|
||||
|
||||
// If all parts proceed
|
||||
if (_proceed) then {
|
||||
|
||||
cutText ["Crafting started", "PLAIN DOWN"];
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
[player,"repair",0,false] call dayz_zombieSpeak;
|
||||
[player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
_removed_total = 0; // count total of removed items
|
||||
_tobe_removed_total = 0; // count total of all to be removed items
|
||||
// Take items
|
||||
{
|
||||
_removed = 0;
|
||||
_itemIn = _x select 0;
|
||||
_countIn = _x select 1;
|
||||
// diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn];
|
||||
_tobe_removed_total = _tobe_removed_total + _countIn;
|
||||
|
||||
{
|
||||
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
|
||||
_num_removed = ([player,_x] call BIS_fnc_invRemove);
|
||||
_removed = _removed + _num_removed;
|
||||
_removed_total = _removed_total + _num_removed;
|
||||
if(_num_removed >= 1) then {
|
||||
_temp_removed_array set [count _temp_removed_array,_x];
|
||||
};
|
||||
};
|
||||
|
||||
} forEach magazines player;
|
||||
|
||||
} forEach _selectedRecipeInput;
|
||||
|
||||
diag_log format["removed: %1 of: %2", _removed, _tobe_removed_total];
|
||||
|
||||
// Only proceed if all parts were removed successfully
|
||||
if(_removed_total == _tobe_removed_total) then {
|
||||
|
||||
// Put items
|
||||
{
|
||||
// consumeweapons
|
||||
{
|
||||
player removeWeapon _x;
|
||||
} forEach _consumeweapons;
|
||||
|
||||
_itemOut = _x select 0;
|
||||
_countOut = _x select 1;
|
||||
diag_log format["Recipe Output: %1 %2", _itemOut,_countOut];
|
||||
|
||||
for "_x" from 1 to _countOut do {
|
||||
player addMagazine _itemOut;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// get display name
|
||||
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName");
|
||||
|
||||
// Add crafted item
|
||||
cutText [format["Crafted Item: %1 x %2",_textCreate,_countOut], "PLAIN DOWN"];
|
||||
|
||||
} forEach _selectedRecipeOutput;
|
||||
|
||||
} else {
|
||||
// Refund parts since we failed
|
||||
{player addMagazine _x;} forEach _temp_removed_array;
|
||||
|
||||
cutText [format["Missing Parts after first check Item: %1 / %2",_removed_total,_tobe_removed_total], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled crafting.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
|
||||
cutText [format["Missing %1 more of %2",_missingQty, _textMissing], "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
_textMissing = getText(configFile >> "CfgWeapons" >> _missing >> "displayName");
|
||||
cutText [format["Missing Tool: %1",_textMissing], "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
cutText ["Crafting needs a fire within 2 meters.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
DayZ Crafting
|
||||
Usage: spawn player_goFishing;
|
||||
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
|
||||
*/
|
||||
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_consumeweapons","_item"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Crafting already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
// temp array of removed parts
|
||||
_temp_removed_array = [];
|
||||
_abort = false;
|
||||
_distance = 2;
|
||||
_reason = "";
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
|
||||
|
||||
_item = _this;
|
||||
_crafting = "Crafting3";
|
||||
|
||||
// check if fire is reqired
|
||||
_needNear = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "neednearby");
|
||||
|
||||
if("fire" in _needNear) then {
|
||||
_isNear = {inflamed _x} count (position player nearObjects _distance);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "fire";
|
||||
};
|
||||
};
|
||||
|
||||
if("workshop" in _needNear) then {
|
||||
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ"], 5]);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "workshop";
|
||||
};
|
||||
};
|
||||
|
||||
if(_abort) exitWith {
|
||||
cutText [format["Crafting needs a %1 within %2 meters",_reason,_distance], "PLAIN DOWN"];
|
||||
TradeInprogress = false;
|
||||
};
|
||||
|
||||
// diag_log format["Checking for fire: %1", _isFireNear];
|
||||
|
||||
if (_canDo) then {
|
||||
|
||||
// Moved all recipes input and outputs to configs
|
||||
|
||||
_selectedRecipeOutput = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "output");
|
||||
_selectedRecipeInput = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "input");
|
||||
_selectedRecipeTools = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "requiretools");
|
||||
_consumeweapons = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "consumeweapons");
|
||||
|
||||
_missing = "";
|
||||
_missingTools = false;
|
||||
{
|
||||
_hastoolweapon = _x in weapons player;
|
||||
if(!_hastoolweapon) exitWith { _missingTools = true; _missing = _x; };
|
||||
} forEach _selectedRecipeTools;
|
||||
|
||||
if(!_missingTools) then {
|
||||
|
||||
diag_log format["Selected Recipe Input: %1", _selectedRecipeInput];
|
||||
diag_log format["Selected Recipe Output: %1", _selectedRecipeOutput];
|
||||
|
||||
// Dry run to see if all parts are available.
|
||||
_proceed = true;
|
||||
{
|
||||
_itemIn = _x select 0;
|
||||
_countIn = _x select 1;
|
||||
|
||||
diag_log format["Recipe Check: %1 %2", _itemIn,_countIn];
|
||||
|
||||
// not neccessary
|
||||
//if (!(_itemIn in magazines player)) exitWith { _missing = _itemIn; _missingQty = _countIn; _proceed = false; };
|
||||
|
||||
// match against class and parentClass
|
||||
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
|
||||
|
||||
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
|
||||
|
||||
} forEach _selectedRecipeInput;
|
||||
|
||||
// If all parts proceed
|
||||
if (_proceed) then {
|
||||
|
||||
cutText ["Crafting started", "PLAIN DOWN"];
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
[player,"repair",0,false] call dayz_zombieSpeak;
|
||||
[player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
_removed_total = 0; // count total of removed items
|
||||
_tobe_removed_total = 0; // count total of all to be removed items
|
||||
// Take items
|
||||
{
|
||||
_removed = 0;
|
||||
_itemIn = _x select 0;
|
||||
_countIn = _x select 1;
|
||||
// diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn];
|
||||
_tobe_removed_total = _tobe_removed_total + _countIn;
|
||||
|
||||
{
|
||||
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
|
||||
_num_removed = ([player,_x] call BIS_fnc_invRemove);
|
||||
_removed = _removed + _num_removed;
|
||||
_removed_total = _removed_total + _num_removed;
|
||||
if(_num_removed >= 1) then {
|
||||
_temp_removed_array set [count _temp_removed_array,_x];
|
||||
};
|
||||
};
|
||||
|
||||
} forEach magazines player;
|
||||
|
||||
} forEach _selectedRecipeInput;
|
||||
|
||||
diag_log format["removed: %1 of: %2", _removed, _tobe_removed_total];
|
||||
|
||||
// Only proceed if all parts were removed successfully
|
||||
if(_removed_total == _tobe_removed_total) then {
|
||||
|
||||
// Put items
|
||||
{
|
||||
// consumeweapons
|
||||
{
|
||||
player removeWeapon _x;
|
||||
} forEach _consumeweapons;
|
||||
|
||||
_itemOut = _x select 0;
|
||||
_countOut = _x select 1;
|
||||
diag_log format["Recipe Output: %1 %2", _itemOut,_countOut];
|
||||
|
||||
for "_x" from 1 to _countOut do {
|
||||
player addMagazine _itemOut;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// get display name
|
||||
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName");
|
||||
|
||||
// Add crafted item
|
||||
cutText [format["Crafted Item: %1 x %2",_textCreate,_countOut], "PLAIN DOWN"];
|
||||
|
||||
} forEach _selectedRecipeOutput;
|
||||
|
||||
} else {
|
||||
// Refund parts since we failed
|
||||
{player addMagazine _x;} forEach _temp_removed_array;
|
||||
|
||||
cutText [format["Missing Parts after first check Item: %1 / %2",_removed_total,_tobe_removed_total], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled crafting.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
|
||||
cutText [format["Missing %1 more of %2",_missingQty, _textMissing], "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
_textMissing = getText(configFile >> "CfgWeapons" >> _missing >> "displayName");
|
||||
cutText [format["Missing Tool: %1",_textMissing], "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
cutText ["Crafting needs a fire within 2 meters.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
DayZ Crafting
|
||||
Usage: spawn player_goFishing;
|
||||
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
|
||||
*/
|
||||
private ["_onLadder","_canDo","_selectedRecipeOutput","_proceed","_itemIn","_countIn","_missing","_missingQty","_qty","_itemOut","_countOut","_started","_finished","_animState","_isMedic","_removed","_tobe_removed_total","_textCreate","_textMissing","_selectedRecipeInput","_num_removed","_removed_total","_temp_removed_array","_abort","_reason","_isNear","_missingTools","_hastoolweapon","_selectedRecipeTools","_distance","_crafting","_needNear","_consumeweapons","_item"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Crafting already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
// temp array of removed parts
|
||||
_temp_removed_array = [];
|
||||
_abort = false;
|
||||
_distance = 2;
|
||||
_reason = "";
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
_canDo = (!r_drag_sqf and !r_player_unconscious and !_onLadder);
|
||||
|
||||
_item = _this;
|
||||
_crafting = "Crafting4";
|
||||
|
||||
// check if fire is reqired
|
||||
_needNear = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "neednearby");
|
||||
|
||||
if("fire" in _needNear) then {
|
||||
_isNear = {inflamed _x} count (position player nearObjects _distance);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "fire";
|
||||
};
|
||||
};
|
||||
|
||||
if("workshop" in _needNear) then {
|
||||
_isNear = count (nearestObjects [player, ["Wooden_shed_DZ","WoodShack_DZ"], 5]);
|
||||
if(_isNear == 0) then {
|
||||
_abort = true;
|
||||
_reason = "workshop";
|
||||
};
|
||||
};
|
||||
|
||||
if(_abort) exitWith {
|
||||
cutText [format["Crafting needs a %1 within %2 meters",_reason,_distance], "PLAIN DOWN"];
|
||||
TradeInprogress = false;
|
||||
};
|
||||
|
||||
// diag_log format["Checking for fire: %1", _isFireNear];
|
||||
|
||||
if (_canDo) then {
|
||||
|
||||
// Moved all recipes input and outputs to configs
|
||||
|
||||
_selectedRecipeOutput = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "output");
|
||||
_selectedRecipeInput = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "input");
|
||||
_selectedRecipeTools = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "requiretools");
|
||||
_consumeweapons = getArray (configFile >> "cfgMagazines" >> _item >> "ItemActions" >> _crafting >> "consumeweapons");
|
||||
|
||||
_missing = "";
|
||||
_missingTools = false;
|
||||
{
|
||||
_hastoolweapon = _x in weapons player;
|
||||
if(!_hastoolweapon) exitWith { _missingTools = true; _missing = _x; };
|
||||
} forEach _selectedRecipeTools;
|
||||
|
||||
if(!_missingTools) then {
|
||||
|
||||
diag_log format["Selected Recipe Input: %1", _selectedRecipeInput];
|
||||
diag_log format["Selected Recipe Output: %1", _selectedRecipeOutput];
|
||||
|
||||
// Dry run to see if all parts are available.
|
||||
_proceed = true;
|
||||
{
|
||||
_itemIn = _x select 0;
|
||||
_countIn = _x select 1;
|
||||
|
||||
diag_log format["Recipe Check: %1 %2", _itemIn,_countIn];
|
||||
|
||||
// not neccessary
|
||||
//if (!(_itemIn in magazines player)) exitWith { _missing = _itemIn; _missingQty = _countIn; _proceed = false; };
|
||||
|
||||
// match against class and parentClass
|
||||
_qty = { (_x == _itemIn) || (configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn) } count magazines player;
|
||||
|
||||
if(_qty < _countIn) exitWith { _missing = _itemIn; _missingQty = (_countIn - _qty); _proceed = false; };
|
||||
|
||||
} forEach _selectedRecipeInput;
|
||||
|
||||
// If all parts proceed
|
||||
if (_proceed) then {
|
||||
|
||||
cutText ["Crafting started", "PLAIN DOWN"];
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
[player,"repair",0,false] call dayz_zombieSpeak;
|
||||
[player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
_removed_total = 0; // count total of removed items
|
||||
_tobe_removed_total = 0; // count total of all to be removed items
|
||||
// Take items
|
||||
{
|
||||
_removed = 0;
|
||||
_itemIn = _x select 0;
|
||||
_countIn = _x select 1;
|
||||
// diag_log format["Recipe Finish: %1 %2", _itemIn,_countIn];
|
||||
_tobe_removed_total = _tobe_removed_total + _countIn;
|
||||
|
||||
{
|
||||
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
|
||||
_num_removed = ([player,_x] call BIS_fnc_invRemove);
|
||||
_removed = _removed + _num_removed;
|
||||
_removed_total = _removed_total + _num_removed;
|
||||
if(_num_removed >= 1) then {
|
||||
_temp_removed_array set [count _temp_removed_array,_x];
|
||||
};
|
||||
};
|
||||
|
||||
} forEach magazines player;
|
||||
|
||||
} forEach _selectedRecipeInput;
|
||||
|
||||
diag_log format["removed: %1 of: %2", _removed, _tobe_removed_total];
|
||||
|
||||
// Only proceed if all parts were removed successfully
|
||||
if(_removed_total == _tobe_removed_total) then {
|
||||
|
||||
// Put items
|
||||
{
|
||||
// consumeweapons
|
||||
{
|
||||
player removeWeapon _x;
|
||||
} forEach _consumeweapons;
|
||||
|
||||
_itemOut = _x select 0;
|
||||
_countOut = _x select 1;
|
||||
diag_log format["Recipe Output: %1 %2", _itemOut,_countOut];
|
||||
|
||||
for "_x" from 1 to _countOut do {
|
||||
player addMagazine _itemOut;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// get display name
|
||||
_textCreate = getText(configFile >> "CfgMagazines" >> _itemOut >> "displayName");
|
||||
|
||||
// Add crafted item
|
||||
cutText [format["Crafted Item: %1 x %2",_textCreate,_countOut], "PLAIN DOWN"];
|
||||
|
||||
} forEach _selectedRecipeOutput;
|
||||
|
||||
} else {
|
||||
// Refund parts since we failed
|
||||
{player addMagazine _x;} forEach _temp_removed_array;
|
||||
|
||||
cutText [format["Missing Parts after first check Item: %1 / %2",_removed_total,_tobe_removed_total], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled crafting.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
_textMissing = getText(configFile >> "CfgMagazines" >> _missing >> "displayName");
|
||||
cutText [format["Missing %1 more of %2",_missingQty, _textMissing], "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
_textMissing = getText(configFile >> "CfgWeapons" >> _missing >> "displayName");
|
||||
cutText [format["Missing Tool: %1",_textMissing], "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
cutText ["Crafting needs a fire within 2 meters.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,77 @@
|
||||
private ["_onLadder","_itemorignal","_hasdrinkitem","_hasoutput","_config","_text","_sfx","_dis","_itemtodrop","_nearByPile","_item","_display"];
|
||||
|
||||
disableserialization;
|
||||
call gear_ui_init;
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
if (vehicle player != player) exitWith {cutText ["You may not drink while in a vehicle", "PLAIN DOWN"]};
|
||||
|
||||
//Force players to wait 3 mins to drink again
|
||||
//if (dayz_lastDrink < 180) exitWith {cutText ["You may not drink, your not thirsty", "PLAIN DOWN"]};
|
||||
|
||||
_itemorignal = _this;
|
||||
_hasdrinkitem = _itemorignal in magazines player;
|
||||
_hasoutput = _itemorignal in drink_with_output;
|
||||
|
||||
_config = configFile >> "CfgMagazines" >> _itemorignal;
|
||||
_text = getText (_config >> "displayName");
|
||||
|
||||
//getting type of sfx (now just drink od soda open and drink)
|
||||
_sfx = getText (_config >> "sfx");
|
||||
|
||||
if (!_hasdrinkitem) exitWith {cutText [format[(localize "str_player_31"),_text,"drink"] , "PLAIN DOWN"]};
|
||||
|
||||
player playActionNow "PutDown";
|
||||
player removeMagazine _itemorignal;
|
||||
sleep 1;
|
||||
|
||||
if (["ItemWaterbottle",_itemorignal] call fnc_inString) then {
|
||||
//low alert and sound radius
|
||||
_dis=5;
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
player addMagazine "ItemWaterbottleUnfilled";
|
||||
};
|
||||
if (["ItemSoda",_itemorignal] call fnc_inString) then {
|
||||
//higher alert and sound radius
|
||||
_dis=10;
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
};
|
||||
|
||||
if (_hasoutput) then{
|
||||
// Selecting output
|
||||
_itemtodrop = drink_output select (drink_with_output find _itemorignal);
|
||||
|
||||
sleep 3;
|
||||
_nearByPile= nearestObjects [(position player), ["WeaponHolder","WeaponHolderBase"],2];
|
||||
if (count _nearByPile ==0) then {
|
||||
_item = createVehicle ["WeaponHolder", position player, [], 0.0, "CAN_COLLIDE"];
|
||||
} else {
|
||||
_item = _nearByPile select 0;
|
||||
};
|
||||
_item addMagazineCargoGlobal [_itemtodrop,1];
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//add infection chance for "ItemWaterbottle",
|
||||
if ((random 15 < 1) and (_itemorignal == "ItemWaterbottle")) then {
|
||||
r_player_infected = true;
|
||||
player setVariable["USEC_infected",true,true];
|
||||
};
|
||||
|
||||
player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
|
||||
|
||||
dayz_lastDrink = time;
|
||||
dayz_thirst = 0;
|
||||
|
||||
//Ensure Control is visible
|
||||
_display = uiNamespace getVariable 'DAYZ_GUI_display';
|
||||
(_display displayCtrl 1302) ctrlShow true;
|
||||
|
||||
cutText [format[(localize "str_player_consumed"),_text], "PLAIN DOWN"];
|
||||
@@ -0,0 +1,25 @@
|
||||
private ["_item","_config","_onLadder","_consume","_meleeNum","_bag"];
|
||||
_item = _this;
|
||||
_config = configFile >> "CfgWeapons" >> _item;
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
call gear_ui_init;
|
||||
|
||||
_consume = ([] + getArray (_config >> "magazines")) select 0;
|
||||
|
||||
_meleeNum = ({_x == _consume} count magazines player);
|
||||
for "_i" from 1 to _meleeNum do {
|
||||
player removeMagazine _consume;
|
||||
};
|
||||
|
||||
player removeWeapon _item;
|
||||
if (_item == "MeleeHatchet") then {_item = "ItemHatchet";};
|
||||
if (_item == "MeleeCrowbar") then {_item = "MeleeCrowbar";};
|
||||
if (_item == "MeleeMachete") then {_item = "ItemMachete";};
|
||||
if (_item == "MeleeFishingPole") then {_item = "MeleeFishingPole";};
|
||||
|
||||
_bag = createVehicle [format["WeaponHolder_%1",_item],getPosATL player,[], 0, "CAN_COLLIDE"];
|
||||
_bag setdir (getDir player);
|
||||
player reveal _bag;
|
||||
@@ -0,0 +1,90 @@
|
||||
private ["_onLadder","_itemorignal","_hasfooditem","_rawfood","_hasoutput","_config","_text","_regen","_dis","_sfx","_itemtodrop","_nearByPile","_item","_display","_rawexceptions","_badfood"];
|
||||
disableserialization;
|
||||
call gear_ui_init;
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
if (vehicle player != player) exitWith {cutText ["You may not eat while in a vehicle", "PLAIN DOWN"]};
|
||||
|
||||
//Force players to wait 3 mins to eat again
|
||||
//if (dayz_lastMeal < 180) exitWith {cutText ["You may not eat, you're already full", "PLAIN DOWN"]};
|
||||
|
||||
_itemorignal = _this;
|
||||
_hasfooditem = _itemorignal in magazines player;
|
||||
|
||||
_rawfood = _itemorignal in meatraw;
|
||||
_rawexceptions = _itemorignal in exceptionsraw;
|
||||
//_cookedfood = _itemorignal in meatcooked;
|
||||
_hasoutput = _itemorignal in food_with_output;
|
||||
|
||||
_badfood = _itemorignal in badfood;
|
||||
|
||||
_config = configFile >> "CfgMagazines" >> _itemorignal;
|
||||
_text = getText (_config >> "displayName");
|
||||
_regen = getNumber (_config >> "bloodRegen");
|
||||
|
||||
if (!_hasfooditem) exitWith {cutText [format[(localize "str_player_31"),_text,"consume"] , "PLAIN DOWN"]};
|
||||
|
||||
player playActionNow "PutDown";
|
||||
player removeMagazine _itemorignal;
|
||||
sleep 1;
|
||||
|
||||
_dis=6;
|
||||
_sfx = "eat";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
if (dayz_lastMeal < 3600) then {
|
||||
if (_itemorignal == "FoodSteakCooked") then {
|
||||
//_regen = _regen * (10 - (10 max ((time - _Cookedtime) / 3600)));
|
||||
};
|
||||
};
|
||||
|
||||
if (_hasoutput) then{
|
||||
// Selecting output
|
||||
_itemtodrop = food_output select (food_with_output find _itemorignal);
|
||||
|
||||
sleep 3;
|
||||
_nearByPile= nearestObjects [(position player), ["WeaponHolder","WeaponHolderBase"],2];
|
||||
if (count _nearByPile ==0) then {
|
||||
_item = createVehicle ["WeaponHolder", position player, [], 0.0, "CAN_COLLIDE"];
|
||||
} else {
|
||||
_item = _nearByPile select 0;
|
||||
};
|
||||
_item addMagazineCargoGlobal [_itemtodrop,1];
|
||||
};
|
||||
|
||||
if (_rawfood and !_rawexceptions and (random 15 < 1)) then {
|
||||
r_player_infected = true;
|
||||
player setVariable["USEC_infected",true,true];
|
||||
};
|
||||
|
||||
if (_badfood and (random 2 < 1)) then {
|
||||
r_player_infected = true;
|
||||
player setVariable["USEC_infected",true,true];
|
||||
};
|
||||
|
||||
r_player_blood = r_player_blood + _regen;
|
||||
if (r_player_blood > r_player_bloodTotal) then {
|
||||
r_player_blood = r_player_bloodTotal;
|
||||
};
|
||||
|
||||
player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
|
||||
player setVariable["USEC_BloodQty",r_player_blood,true];
|
||||
player setVariable["medForceUpdate",true];
|
||||
|
||||
//["dayzPlayerSave",[player,[],true]] call callRpcProcedure;
|
||||
dayzPlayerSave = [player,[],true];
|
||||
publicVariableServer "dayzPlayerSave";
|
||||
|
||||
dayz_lastMeal = time;
|
||||
dayz_hunger = 0;
|
||||
|
||||
//Ensure Control is visible
|
||||
_display = uiNamespace getVariable 'DAYZ_GUI_display';
|
||||
(_display displayCtrl 1301) ctrlShow true;
|
||||
|
||||
if (r_player_blood / r_player_bloodTotal >= 0.2) then {
|
||||
(_display displayCtrl 1300) ctrlShow true;
|
||||
};
|
||||
cutText [format[(localize "str_player_consumed"),_text], "PLAIN DOWN"];
|
||||
@@ -0,0 +1,24 @@
|
||||
private ["_object"];
|
||||
_object = _this select 3;
|
||||
|
||||
// _position = [position _object,0,0,0,0,0,0,position player] call BIS_fnc_findSafePos;
|
||||
|
||||
//Standup
|
||||
//player playMove "amovpercmstpsraswrfldnon_amovpknlmstpslowwrfldnon";
|
||||
//sleep 1;
|
||||
//waitUntil { animationState player != "amovpercmstpsraswrfldnon_amovpknlmstpslowwrfldnon"};
|
||||
|
||||
//Kneel Down
|
||||
player playMove "amovpknlmstpslowwrfldnon_amovpercmstpsraswrfldnon";
|
||||
waitUntil { animationState player != "amovpknlmstpslowwrfldnon_amovpercmstpsraswrfldnon"};
|
||||
sleep 2;
|
||||
//_object setpos _position;
|
||||
_object setvectorup [0,0,1];
|
||||
[player,"scream",0,true] call dayz_zombieSpeak;
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
sleep 3;
|
||||
|
||||
|
||||
//Other possibilities
|
||||
//[_object,0, 0] call bis_fnc_setpitchbank;
|
||||
//_object setpos [getpos _object select 0, getpos _object select 1, 0];
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
DayZ Crafting
|
||||
Usage: spawn player_goFishing;
|
||||
Made for DayZ Epoch please ask permission to use/edit/distrubute email vbawol@veteranbastards.com.
|
||||
*/
|
||||
private ["_itemOut","_position","_isOk","_counter"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Fishing already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
call gear_ui_init;
|
||||
|
||||
// find position 5m in front of player
|
||||
_position = player modeltoworld [0,5,0];
|
||||
if(!(surfaceIsWater _position)) exitWith {TradeInprogress = false; cutText ["Must be near a shore or on a boat to fish." , "PLAIN DOWN"]; };
|
||||
|
||||
if(dayz_isSwimming) exitWith {TradeInprogress = false; cutText [localize "str_player_26", "PLAIN DOWN"]; };
|
||||
if(player getVariable["combattimeout", 0] >= time) exitWith {TradeInprogress = false; cutText ["Canceled Fishing.", "PLAIN DOWN"];};
|
||||
|
||||
_isOk = true;
|
||||
_counter = 0;
|
||||
|
||||
// swing fishingpole
|
||||
player playActionNow "GestureSwing";
|
||||
// Alert zeds
|
||||
[player,10,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
r_interrupt = false;
|
||||
|
||||
while {_isOk} do {
|
||||
|
||||
if (r_interrupt or (player getVariable["combattimeout", 0] >= time)) then {
|
||||
_isOk = false;
|
||||
cutText ["Canceled Fishing.", "PLAIN DOWN"];
|
||||
} else {
|
||||
|
||||
sleep 2;
|
||||
|
||||
_rnd = 100;
|
||||
|
||||
// check if player is in boat
|
||||
_vehicle = vehicle player;
|
||||
_inVehicle = (_vehicle != player);
|
||||
if(_inVehicle) then {
|
||||
if(_vehicle isKindOf "Ship") then {
|
||||
_rnd = 50;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// 1% chance to catch anything
|
||||
if((random _rnd) <= 1) then {
|
||||
// Just the one fish for now
|
||||
_itemOut = ["ItemTrout","ItemTrout","ItemTrout","ItemTrout","ItemTrout","ItemTrout","ItemTrout","ItemSeaBass","ItemSeaBass","ItemTuna"] call BIS_fnc_selectRandom;
|
||||
|
||||
if(_inVehicle) then {
|
||||
_item = _vehicle;
|
||||
_itemtodrop = _itemOut;
|
||||
_item addMagazineCargoGlobal [_itemtodrop,1];
|
||||
} else {
|
||||
player addMagazine _itemOut;
|
||||
};
|
||||
|
||||
|
||||
cutText ["You caught a fish.", "PLAIN DOWN"];
|
||||
_isOk = false;
|
||||
} else {
|
||||
cutText ["Nibble... Nibble...", "PLAIN DOWN"];
|
||||
_counter = _counter + 1;
|
||||
if(_counter == 5) then {
|
||||
_isOk = false;
|
||||
sleep 2;
|
||||
cutText ["You didn't catch anything.", "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,56 @@
|
||||
private ["_dir","_classname","_box","_location","_item","_config","_create_raw","_create","_qty","_type","_hasCrate","_hasTool"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Open Crate already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
_hasTool = "ItemCrowbar" in items player;
|
||||
if(!_hasTool) exitWith {
|
||||
cutText ["You need a crowbar to open this.", "PLAIN DOWN"];
|
||||
TradeInprogress = false;
|
||||
};
|
||||
|
||||
_item = _this;
|
||||
_hasCrate = _item in magazines player;
|
||||
if (!_hasCrate) then {
|
||||
cutText ["Missing supply crate.", "PLAIN DOWN"];
|
||||
TradeInprogress = false;
|
||||
};
|
||||
|
||||
_config = configFile >> "CfgMagazines" >> _item;
|
||||
_create_raw = getArray (_config >> "ItemActions" >> "CreateMags" >> "output");
|
||||
_create = _create_raw select 0;
|
||||
_qty = _create_raw select 1;
|
||||
_type = _create_raw select 2;
|
||||
|
||||
_location = player modeltoworld [0,0.3,0];
|
||||
if ((_location select 2) < 0) then {
|
||||
_location set [2,0];
|
||||
};
|
||||
|
||||
player removeMagazine _item;
|
||||
_dir = getDir player;
|
||||
_classname = "WeaponHolder";
|
||||
|
||||
// Change to optional wait to complete
|
||||
player playActionNow "Medic";
|
||||
sleep 6;
|
||||
|
||||
_box = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
_box setDir _dir;
|
||||
|
||||
// Fill box with Items from config.
|
||||
if(_type == "magazine") then {
|
||||
_box addMagazineCargoGlobal [_create,_qty];
|
||||
};
|
||||
if(_type == "weapon") then {
|
||||
_box addWeaponCargoGlobal [_create,_qty];
|
||||
};
|
||||
if(_type == "backpack") then {
|
||||
_box addBackpackCargoGlobal [_create,_qty];
|
||||
};
|
||||
|
||||
player reveal _box;
|
||||
|
||||
cutText ["Opened supply crate.", "PLAIN DOWN"];
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,29 @@
|
||||
private ["_location","_isOk","_dir","_classname","_fire","_hasWood"];
|
||||
_location = player modeltoworld [0,0.3,0];
|
||||
if ((_location select 2) < 0) then {
|
||||
_location set [2,0];
|
||||
};
|
||||
//_location set [2,0];
|
||||
_isOk = true; //count (_location isFlatEmpty [0.3,0,0,4,0,false,player]) > 0;
|
||||
_hasWood = "PartWoodPile" in magazines player;
|
||||
|
||||
if (_hasWood) then {
|
||||
if (_isOk) then {
|
||||
player removeMagazine "PartWoodPile";
|
||||
_dir = getDir player;
|
||||
_classname = "Land_Fire_DZ";
|
||||
player playActionNow "Medic";
|
||||
sleep 6;
|
||||
_fire = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
_fire setDir _dir;
|
||||
player reveal _fire;
|
||||
|
||||
_fire spawn player_fireMonitor;
|
||||
|
||||
cutText [localize "str_fireplace_01", "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [localize "str_fireplace_02", "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
cutText [localize "str_player_22", "PLAIN DOWN"];
|
||||
};
|
||||
@@ -0,0 +1,109 @@
|
||||
private ["_item","_config","_consume","_create","_item_ammo","_consume_magsize","_create_magsize","_consume_type","_slotstart","_slotend","_dialog","_qty_total_ammo","_qty_consume_ammo","_qty_create_ammo","_qty_consume_mags","_qty_create_mags","_qty_free_slots","_control","_mag","_qtynew_create_ammo","_qtynew_consume_ammo","_qtynew_create_mags","_qtynew_consume_mags","_qtynew_consume_mags_full","_qtynew_create_mags_full","_qtynew_consume_ammo_rest","_qtynew_create_ammo_rest","_avaliable_slots"];
|
||||
|
||||
disableSerialization;
|
||||
call gear_ui_init;
|
||||
|
||||
//note - one slot ammo can be used!
|
||||
|
||||
|
||||
_item = _this;
|
||||
|
||||
_config = configFile >> "CfgMagazines" >> _item;
|
||||
|
||||
_consume = getArray (_config >> "ItemActions" >> "ReloadMag" >> "use") select 0;
|
||||
_create = getArray (_config >> "ItemActions" >> "ReloadMag" >> "output") select 0;
|
||||
|
||||
_item_ammo = gearSlotAmmoCount (uiNamespace getVariable 'uiControl');
|
||||
|
||||
//add check if weapon can use create (if not - show message)
|
||||
|
||||
player playActionNow "PutDown";
|
||||
|
||||
_consume_magsize = getNumber(configFile >> "CfgMagazines" >> _consume >> "count");
|
||||
_create_magsize = getNumber(configFile >> "CfgMagazines" >> _create >> "count");
|
||||
|
||||
_consume_type = getNumber(configFile >> "CfgMagazines" >> _consume >> "type");
|
||||
|
||||
//primary/secondary mags?
|
||||
_slotstart = 0;
|
||||
_slotend = 0;
|
||||
if (_consume_type == 256) then {
|
||||
_slotstart = 109;
|
||||
_slotend = 120;
|
||||
};
|
||||
if ( _consume_type == 16) then {
|
||||
_slotstart = 122;
|
||||
_slotend = 129;
|
||||
};
|
||||
|
||||
_dialog = findDisplay 106;
|
||||
|
||||
_qty_total_ammo = 0;
|
||||
_qty_consume_ammo = 0;
|
||||
_qty_create_ammo = 0;
|
||||
_qty_consume_mags = 0;
|
||||
_qty_create_mags = 0;
|
||||
_qty_free_slots = 0;
|
||||
for "_i" from _slotstart to _slotend do {
|
||||
_control =_dialog displayCtrl _i;
|
||||
_mag = gearSlotData _control;
|
||||
if (_mag == _consume) then {
|
||||
_qty_total_ammo = _qty_total_ammo + gearSlotAmmoCount _control;
|
||||
_qty_consume_ammo = _qty_consume_ammo + gearSlotAmmoCount _control;
|
||||
_qty_consume_mags = _qty_consume_mags+1;
|
||||
};
|
||||
if (_mag == _create) then {
|
||||
_qty_total_ammo = _qty_total_ammo + gearSlotAmmoCount _control;
|
||||
_qty_create_ammo = _qty_create_ammo + gearSlotAmmoCount _control;
|
||||
_qty_create_mags = _qty_create_mags+1;
|
||||
};
|
||||
if (_mag == "") then {
|
||||
_qty_free_slots = _qty_free_slots + 1;
|
||||
};
|
||||
};
|
||||
|
||||
_qtynew_create_ammo = 0;
|
||||
_qtynew_consume_ammo = 0;
|
||||
_qtynew_create_mags = 0;
|
||||
_qtynew_consume_mags = 0;
|
||||
|
||||
_qtynew_consume_mags_full = 0;
|
||||
_qtynew_create_mags_full = 0;
|
||||
_qtynew_consume_ammo_rest = 0;
|
||||
_qtynew_create_ammo_rest = 0;
|
||||
|
||||
|
||||
if ( _consume_magsize > _create_magsize) then {
|
||||
_qtynew_create_ammo = _qty_create_ammo + _item_ammo;
|
||||
_qtynew_consume_ammo = _qty_consume_ammo - _item_ammo;
|
||||
_qtynew_create_mags = ceil(_qtynew_create_ammo/_create_magsize);
|
||||
_qtynew_consume_mags = ceil(_qtynew_consume_ammo/_consume_magsize);
|
||||
} else {
|
||||
_qtynew_create_ammo = _qty_total_ammo;
|
||||
_qtynew_consume_ammo = 0;
|
||||
};
|
||||
|
||||
if ((_qtynew_create_mags + _qtynew_consume_mags) > _avaliable_slots) exitWith {
|
||||
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
|
||||
};
|
||||
_qtynew_consume_mags_full = floor(_qtynew_consume_ammo/_consume_magsize);
|
||||
_qtynew_create_mags_full = floor(_qtynew_create_ammo/_create_magsize);
|
||||
_qtynew_consume_ammo_rest = _qtynew_consume_ammo - (_qtynew_consume_mags_full*_consume_magsize);
|
||||
_qtynew_create_ammo_rest = _qtynew_create_ammo - (_qtynew_create_mags_full*_create_magsize);
|
||||
|
||||
//remove all _consume and _create mags (we already have total ammo count)
|
||||
player removeMagazines _consume;
|
||||
player removeMagazines _create;
|
||||
|
||||
for "_i" from 1 to _qtynew_consume_mags_full do {
|
||||
player addMagazine _consume;
|
||||
};
|
||||
if (_qtynew_consume_ammo_rest != 0) then {
|
||||
player addMagazine [_consume,_qtynew_consume_ammo_rest];
|
||||
};
|
||||
for "_i" from 1 to _qtynew_create_mags_full do {
|
||||
player addMagazine _create;
|
||||
};
|
||||
if (_qtynew_create_ammo_rest != 0) then {
|
||||
player addMagazine [_create,_qtynew_create_ammo_rest];
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
private ["_item","_onLadder","_classname","_text","_hastrapitem","_location","_object","_dir"];
|
||||
_item = _this;
|
||||
// _config = configFile >> "CfgWeapons" >> _item;
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
call gear_ui_init;
|
||||
|
||||
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
|
||||
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
|
||||
//_consume = ([] + getArray (_config >> "magazines")) select 0;
|
||||
|
||||
_hastrapitem = _this in magazines player;
|
||||
|
||||
if (!_hastrapitem) exitWith {cutText [format[(localize "str_player_31"),_text,"place"] , "PLAIN DOWN"]};
|
||||
|
||||
player removeMagazine _item;
|
||||
_location = getPosATL player;
|
||||
|
||||
player playActionNow "PutDown";
|
||||
sleep 1;
|
||||
|
||||
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
_dir = getDir player;
|
||||
_object setDir _dir;
|
||||
player reveal _object;
|
||||
|
||||
cutText [format[localize "str_build_01",_text], "PLAIN DOWN"];
|
||||
@@ -0,0 +1,50 @@
|
||||
//http://community.bistudio.com/wiki/ArmA2:_Moves
|
||||
|
||||
player playMove "amovpsitmstpsraswrfldnon_smoking"; // - Sitting smoking
|
||||
|
||||
waitUntil { animationState player != "amovpsitmstpsraswrfldnon_smoking"};
|
||||
|
||||
sleep 5;
|
||||
|
||||
player playMove "amovpsitmstpsraswrfldnon_weaponcheck1"; // - Sitting checking weapon
|
||||
|
||||
waitUntil { animationState player != "amovpsitmstpsraswrfldnon_weaponcheck1"};
|
||||
|
||||
sleep 5;
|
||||
|
||||
player playMove "AidlPpneMstpSnonWnonDnon_SleepC_layDown";
|
||||
|
||||
waitUntil { animationState player != "AidlPpneMstpSnonWnonDnon_SleepC_layDown"};
|
||||
|
||||
sleep 5;
|
||||
|
||||
player playMove "AidlPpneMstpSnonWnonDnon_SleepC_lookAround";
|
||||
|
||||
waitUntil { animationState player != "AidlPpneMstpSnonWnonDnon_SleepC_lookAround"};
|
||||
|
||||
sleep 5;
|
||||
|
||||
player playMove "AidlPpneMstpSnonWnonDnon_SleepC_scratch";
|
||||
|
||||
waitUntil { animationState player != "AidlPpneMstpSnonWnonDnon_SleepC_scratch"};
|
||||
|
||||
sleep 5;
|
||||
|
||||
player playMove "AidlPpneMstpSnonWnonDnon_SleepC_sleep";
|
||||
|
||||
waitUntil { animationState player != "AidlPpneMstpSnonWnonDnon_SleepC_sleep"};
|
||||
|
||||
sleep 5;
|
||||
|
||||
player playMove "AidlPpneMstpSnonWnonDnon_SleepC_sleep0";
|
||||
|
||||
waitUntil { animationState player != "AidlPpneMstpSnonWnonDnon_SleepC_sleep0"};
|
||||
|
||||
sleep 5;
|
||||
|
||||
player playMove "AidlPpneMstpSnonWnonDnon_SleepC_standUp";
|
||||
|
||||
waitUntil { animationState player != "AidlPpneMstpSnonWnonDnon_SleepC_standUp"};
|
||||
|
||||
R3F_TIRED_Accumulator = 0;
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
private["_target", "_caller", "_action", "_callerID", "_targetID", "_friendlies", "_rfriendlies"];
|
||||
_target = _this select 0;
|
||||
_caller = _this select 1;
|
||||
_action = _this select 2;
|
||||
|
||||
_caller removeAction _action;
|
||||
|
||||
_callerID = _caller getVariable "characterID";
|
||||
_targetID = _target getVariable "characterID";
|
||||
|
||||
_friendlies = _caller getVariable ["friendlies", []];
|
||||
_friendlies set [count _friendlies, _targetID];
|
||||
_caller setVariable ["friendlies", _friendlies, true];
|
||||
|
||||
_rfriendlies = _target getVariable ["friendlies", []];
|
||||
|
||||
if (!(_callerID in _rfriendlies)) then {
|
||||
// caller
|
||||
titleText [format["You have tagged a player as friendly. Waiting for other player to accept.",(name _target)], "PLAIN DOWN"];
|
||||
// target
|
||||
[_caller,_target,"loc",rTITLETEXT,format["A player wants to tag you as friendly. To accept, tag player as friendly.", (name _caller)],"PLAIN DOWN"] call RE;
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
private ["_item","_id","_onLadder","_hasmeditem","_config","_text"];
|
||||
_item = _this;
|
||||
call gear_ui_init;
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
if (_onLadder) exitWith {cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
_hasmeditem = _this in magazines player;
|
||||
|
||||
_config = configFile >> "CfgMagazines" >> _item;
|
||||
_text = getText (_config >> "displayName");
|
||||
|
||||
if (!_hasmeditem) exitWith {cutText [format[(localize "str_player_31"),_text,"use"] , "PLAIN DOWN"]};
|
||||
|
||||
switch (_item) do {
|
||||
case "ItemBandage": {
|
||||
_id = [0,0,0,[player]] execVM "\z\addons\dayz_code\medical\bandage.sqf";
|
||||
};
|
||||
case "ItemMorphine": {
|
||||
_id = [0,0,0,[player]] execVM "\z\addons\dayz_code\medical\morphine.sqf";
|
||||
};
|
||||
case "ItemPainkiller": {
|
||||
_id = [0,0,0,[player]] execVM "\z\addons\dayz_code\medical\painkiller.sqf";
|
||||
};
|
||||
case "ItemAntibiotic": {
|
||||
_id = [0,0,0,[player]] execVM "\z\addons\dayz_code\medical\antibiotics.sqf";
|
||||
};
|
||||
case "ItemHeatPack": {
|
||||
player removeMagazine "ItemHeatPack";
|
||||
dayz_temperatur = (dayz_temperatur + 5) min dayz_temperaturmax;
|
||||
cutText [localize "str_player_27", "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
_item spawn player_wearClothes;
|
||||
Added Female skin changes - DayZ Epoch - vbawol
|
||||
*/
|
||||
private ["_item","_onLadder","_hasclothesitem","_config","_text","_myModel","_itemNew","_currentSex","_newSex","_model"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Changing clothes already in progress." , "PLAIN DOWN"] };
|
||||
TradeInprogress = true;
|
||||
|
||||
_item = _this;
|
||||
call gear_ui_init;
|
||||
|
||||
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
|
||||
if (_onLadder) exitWith {TradeInprogress = false; cutText [(localize "str_player_21") , "PLAIN DOWN"]};
|
||||
|
||||
_hasclothesitem = _this in magazines player;
|
||||
_config = configFile >> "CfgMagazines";
|
||||
_text = getText (_config >> _item >> "displayName");
|
||||
|
||||
if (!_hasclothesitem) exitWith {TradeInprogress = false; cutText [format[(localize "str_player_31"),_text,"wear"] , "PLAIN DOWN"]};
|
||||
|
||||
if (vehicle player != player) exitWith {TradeInprogress = false; cutText ["You may not change clothes while in a vehicle", "PLAIN DOWN"]};
|
||||
|
||||
_myModel = (typeOf player);
|
||||
_itemNew = "Skin_" + _myModel;
|
||||
|
||||
diag_log ("Debug Clothes: model In: " + str(_itemNew) + " Out: " + str(_item));
|
||||
|
||||
if ( (isClass(_config >> _itemNew)) ) then {
|
||||
if ( (isClass(_config >> _item)) ) then {
|
||||
// Current sex of player skin
|
||||
|
||||
_currentSex = getText (configFile >> "CfgSurvival" >> "Skins" >> _itemNew >> "sex");
|
||||
// Sex of new skin
|
||||
_newSex = getText (configFile >> "CfgSurvival" >> "Skins" >> _item >> "sex");
|
||||
diag_log ("Debug Clothes: sex In: " + str(_currentSex) + " Out: " + str(_newSex));
|
||||
|
||||
if(_currentSex == _newSex) then {
|
||||
// Get model name from config
|
||||
_model = getText (configFile >> "CfgSurvival" >> "Skins" >> _item >> "playerModel");
|
||||
if (_model != _myModel) then {
|
||||
player removeMagazine _item;
|
||||
player addMagazine _itemNew;
|
||||
[dayz_playerUID,dayz_characterID,_model] spawn player_humanityMorph;
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText ["You cannot wear a skin of the opposite sex.", "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
};
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,30 @@
|
||||
//Let Zeds know
|
||||
[player,4,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
//display gui (temp hint)
|
||||
|
||||
hintSilent parseText format ["
|
||||
<t size='1.20' font='Bitstream' color='#5882FA'>%1</t><br/><br/>
|
||||
<t size='1.20' font='Bitstream' color='#5882FA'>Survived %7 Days</t><br/><br/>
|
||||
<t size='1.15' font='Bitstream' align='left'>Zombies Killed: </t><t size='1.15' font='Bitstream' align='right'>%2</t><br/>
|
||||
<t size='1.15' font='Bitstream' align='left'>Headshots: </t><t size='1.15' font='Bitstream' align='right'>%3</t><br/>
|
||||
<t size='1.15' font='Bitstream' align='left'>Murders: </t><t size='1.15' font='Bitstream' align='right'>%4</t><br/>
|
||||
<t size='1.15' font='Bitstream' align='left'>Bandits Killed: </t><t size='1.15' font='Bitstream' align='right'>%5</t><br/><br/>
|
||||
<t size='1.15' font='Bitstream' align='left'>Humanity: </t><t size='1.15' font='Bitstream' align='right'>%6</t><br/><br/>",
|
||||
(name player),
|
||||
(player getVariable['zombieKills', 0]),
|
||||
(player getVariable['headShots', 0]),
|
||||
(player getVariable['humanKills', 0]),
|
||||
(player getVariable['banditKills', 0]),
|
||||
(player getVariable['humanity', 0]),
|
||||
(dayz_skilllevel)
|
||||
];
|
||||
|
||||
/*
|
||||
player createDiarySubject ["MyDiary","My Diary"];
|
||||
player createDiaryRecord ["MyDiary",["Stats", "Zombies Killed: <execute expression='player getVariable['zombieKills', 0]'</execute>"]];
|
||||
player createDiaryRecord ["MyDiary",["Stats", "Headshots: <execute expression='player getVariable['headShots', 0]'</execute>"]];
|
||||
player createDiaryRecord ["MyDiary",["Stats", "Murders: <execute expression='player getVariable['humanKills', 0]'</execute>"]];
|
||||
player createDiaryRecord ["MyDiary",["Stats", "Bandits Killed: <execute expression='player getVariable['banditKills', 0]'</execute>"]];
|
||||
player createDiaryRecord ["MyDiary",["Stats", "Humanity: <execute expression='player getVariable['humanity', 0]'</execute>"]];
|
||||
*/
|
||||
@@ -0,0 +1,33 @@
|
||||
private ["_target","_ent","_rnd","_move","_isZombie"];
|
||||
_target = _this select 3;
|
||||
_ent = _target;
|
||||
|
||||
// remove menu
|
||||
player removeAction s_player_pzombiesattack;
|
||||
s_player_pzombiesattack = 1;
|
||||
|
||||
_rnd = (round(random 9)) + 1;
|
||||
_move = "ZombieStandingAttack" + str(_rnd);
|
||||
player playMoveNow _move;
|
||||
|
||||
_isZombie = _ent isKindOf "zZombie_base";
|
||||
|
||||
if(player distance _target < 5) then {
|
||||
|
||||
if (_ent isKindOf "Animal" or _isZombie) then {
|
||||
_ent setDamage 1;
|
||||
} else {
|
||||
//["usecBreakLegs",[_target,player]] call broadcastRpcCallAll;
|
||||
usecBreakLegs = [_target,player];
|
||||
publicVariable "usecBreakLegs";
|
||||
};
|
||||
|
||||
[player,"hit",0,false] call dayz_zombieSpeak;
|
||||
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
|
||||
player switchmove "";
|
||||
|
||||
s_player_pzombiesattack = -1;
|
||||
@@ -0,0 +1,95 @@
|
||||
private ["_item","_regen","_isAnimal","_animalType","_isMan","_config","_isListed","_qty","_ctrlBlood","_rnd","_move","_display","_control","_bloodVal"];
|
||||
_item = _this select 3;
|
||||
// _ent = _item;
|
||||
|
||||
disableSerialization;
|
||||
|
||||
player removeAction s_player_butcher;
|
||||
s_player_butcher = 1;
|
||||
|
||||
if(!(alive _item)) then {
|
||||
|
||||
_rnd = (round(random 4)) + 1;
|
||||
_move = "ZombieFeed" + str(_rnd);
|
||||
player playMoveNow _move;
|
||||
|
||||
sleep 1;
|
||||
|
||||
// player playActionNow "PutDown";
|
||||
[player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
[player,"gut",0,false] call dayz_zombieSpeak;
|
||||
|
||||
_item setVariable["meatHarvested",true,true];
|
||||
|
||||
sleep 1;
|
||||
|
||||
_regen = 200;
|
||||
|
||||
_isAnimal = _item isKindOf "Animal";
|
||||
_animalType = typeOf _item;
|
||||
_isMan = _item isKindOf "Man";
|
||||
|
||||
if(_isAnimal) then {
|
||||
_config = configFile >> "CfgSurvival" >> "Meat" >> _animalType;
|
||||
_isListed = isClass (_config);
|
||||
|
||||
_qty = 1;
|
||||
if (_isListed) then {
|
||||
_qty = getNumber (_config >> "yield");
|
||||
_regen = _qty * 200;
|
||||
};
|
||||
|
||||
} else {
|
||||
|
||||
if(_isMan) then {
|
||||
_regen == 12000;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
r_player_blood = r_player_blood + _regen;
|
||||
if (r_player_blood > r_player_bloodTotal) then {
|
||||
r_player_blood = r_player_bloodTotal;
|
||||
};
|
||||
|
||||
player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
|
||||
player setVariable["USEC_BloodQty",r_player_blood,true];
|
||||
player setVariable["medForceUpdate",true];
|
||||
|
||||
dayz_lastDrink = time;
|
||||
dayz_thirst = 0;
|
||||
|
||||
dayz_lastMeal = time;
|
||||
dayz_hunger = 0;
|
||||
|
||||
//["dayzPlayerSave",[player,[],true]] call callRpcProcedure;
|
||||
dayzPlayerSave = [player,[],true];
|
||||
publicVariableServer "dayzPlayerSave";
|
||||
|
||||
[player,"eat",0,false] call dayz_zombieSpeak;
|
||||
|
||||
// todo: dump loot on ground and then remove
|
||||
|
||||
//Ensure Control is visible
|
||||
_display = uiNamespace getVariable 'DAYZ_GUI_display';
|
||||
_control = _display displayCtrl 1301;
|
||||
_control ctrlShow true;
|
||||
|
||||
_ctrlBlood = _display displayCtrl 1300;
|
||||
_bloodVal = r_player_blood / r_player_bloodTotal;
|
||||
if (_bloodVal >= 0.2) then {
|
||||
_ctrlBlood ctrlShow true;
|
||||
};
|
||||
|
||||
//Ensure Control is visible
|
||||
_display = uiNamespace getVariable 'DAYZ_GUI_display';
|
||||
_control = _display displayCtrl 1302;
|
||||
_control ctrlShow true;
|
||||
|
||||
|
||||
cutText [format[(localize "str_player_consumed"),_animalType], "PLAIN DOWN"];
|
||||
player switchmove "";
|
||||
};
|
||||
|
||||
s_player_butcher = -1;
|
||||
@@ -0,0 +1,70 @@
|
||||
|
||||
private ["_gen","_caller","_id","_NV","_NVOn","_OldAperture","_NV1","_NV2","_NV3"];
|
||||
_gen = _this select 0;
|
||||
_caller = _this select 1;
|
||||
_id = _this select 2;
|
||||
|
||||
_gen removeAction _id;
|
||||
|
||||
// get first rbg + m
|
||||
_NV1 = player getvariable ["NV1",[1.8,-1.5,-0.5,0]];
|
||||
_NV2 = player getvariable ["NV2",[2.4,0.6,0.3,-0.3]];
|
||||
_NV3 = player getvariable ["NV3",[-0.6,0.8,0.3,0.6]];
|
||||
|
||||
_NV = player getvariable ["NV", ["OFF", 0.1]];
|
||||
_NVOn = (_NV select 0);
|
||||
_OldAperture = (_NV select 1);
|
||||
|
||||
if(_NVOn == "ON")
|
||||
exitwith
|
||||
{
|
||||
setaperture -1;
|
||||
ppEffectDestroy ppColor;
|
||||
ppEffectDestroy ppBlur;
|
||||
player setvariable ["NV",["OFF",_oldAperture]];
|
||||
player addAction ["Vision", "\z\addons\dayz_code\actions\pzombie\pz_vision.sqf", [], 0, false, true, "nightVision", "_this == _target"];
|
||||
};
|
||||
|
||||
ppEffectDestroy ppColor;
|
||||
ppEffectDestroy ppBlur;
|
||||
|
||||
|
||||
ppColor = ppEffectCreate ["ColorCorrections", 1999];
|
||||
ppColor ppEffectEnable true;
|
||||
ppColor ppEffectAdjust [1, 1, 0, _NV1, _NV2, _NV3];
|
||||
ppColor ppEffectCommit 0;
|
||||
|
||||
/*
|
||||
ppInversion = ppEffectCreate ['colorInversion', 2555];
|
||||
ppInversion ppEffectEnable false;
|
||||
ppInversion ppEffectAdjust [1,1,1];
|
||||
ppInversion ppEffectCommit 0;
|
||||
*/
|
||||
|
||||
diag_log format ["DEBUG: Aperture : %1 First %2 Second %3 Third %4", _OldAperture, _NV1,_NV2,_NV3];
|
||||
|
||||
|
||||
ppBlur = ppEffectCreate ["dynamicBlur", 505];
|
||||
ppBlur ppEffectEnable true;
|
||||
ppBlur ppEffectAdjust [.2];
|
||||
ppBlur ppEffectCommit 0;
|
||||
|
||||
|
||||
aperture = 0.0001;
|
||||
while { aperture < _oldAperture } do
|
||||
{
|
||||
aperture = aperture + 0.0005;
|
||||
setAperture aperture;
|
||||
sleep 0.001;
|
||||
};
|
||||
|
||||
|
||||
|
||||
player setVariable ["NV", ["ON", _oldAperture]];
|
||||
player setVariable ["NV1",_NV1];
|
||||
player setVariable ["NV2",_NV2];
|
||||
player setVariable ["NV3",_NV3];
|
||||
|
||||
|
||||
player addAction ["Vision", "\z\addons\dayz_code\actions\pzombie\pz_vision.sqf", [], 0, false, true, "nightVision", "_this == _target"];
|
||||
exit;
|
||||
@@ -0,0 +1,28 @@
|
||||
private ["_gen","_caller","_id","_NV","_NVOn","_new","_inc","_newap"];
|
||||
|
||||
_gen = _this select 0;
|
||||
_caller = _this select 1;
|
||||
_id = _this select 2;
|
||||
|
||||
// _gen removeAction _id;
|
||||
|
||||
// array from tweaking settings
|
||||
_new = _this select 3;
|
||||
_inc = _new select 0;
|
||||
|
||||
// get Aperture
|
||||
_NV = player getvariable ["NV",["OFF", 0.1]];
|
||||
|
||||
_newap = (_NV select 1)+_inc;
|
||||
|
||||
_NVOn = (_NV select 0);
|
||||
|
||||
if(_NVOn == "ON") then {
|
||||
|
||||
setAperture _newap;
|
||||
|
||||
player setVariable ["NV", ["OFF", _newap]];
|
||||
} else {
|
||||
player setVariable ["NV", ["ON", _newap]];
|
||||
};
|
||||
cutText [format["%1 %2","NV",_newap], "PLAIN DOWN"];
|
||||
@@ -0,0 +1,55 @@
|
||||
private ["_gen","_caller","_id","_NV","_NVOn","_index","_NV1","_NV2","_NV3","_new","_NVx","_increase","_newap"];
|
||||
|
||||
_gen = _this select 0;
|
||||
_caller = _this select 1;
|
||||
_id = _this select 2;
|
||||
|
||||
// _gen removeAction _id;
|
||||
|
||||
// array from tweaking settings
|
||||
_new = _this select 3;
|
||||
|
||||
_NVx = _new select 0;
|
||||
|
||||
// get first rbg + m
|
||||
_NV = player getvariable [_NVx,[0.0, 0.0, 0.0, 0.0]];
|
||||
|
||||
_increase = (_new select 1);
|
||||
|
||||
_index = 0;
|
||||
{
|
||||
_NV set [_index,(_NV select _index) + _x];
|
||||
|
||||
_index =_index + 1;
|
||||
} forEach _increase;
|
||||
|
||||
// set rgb + m
|
||||
player setVariable [_NVx, _NV];
|
||||
cutText [format["%1 %2",_NVx,_NV], "PLAIN DOWN"];
|
||||
|
||||
_NV = player getvariable ["NV",["OFF", 0.1]];
|
||||
_NVOn = (_NV select 0);
|
||||
_newap = (_NV select 1);
|
||||
|
||||
if(_NVOn == "ON") then {
|
||||
|
||||
_NV1 = player getvariable ["NV1",[0,0,0,0]];
|
||||
_NV2 = player getvariable ["NV2",[0,0,0,0]];
|
||||
_NV3 = player getvariable ["NV3",[0,0,0,0]];
|
||||
|
||||
ppEffectDestroy ppColor;
|
||||
ppEffectDestroy ppBlur;
|
||||
|
||||
ppColor = ppEffectCreate ["ColorCorrections", 1999];
|
||||
ppColor ppEffectEnable true;
|
||||
ppColor ppEffectAdjust [1, 1, 0, _NV1, _NV2, _NV3];
|
||||
ppColor ppEffectCommit 0;
|
||||
|
||||
diag_log format ["DEBUG: Aperture : %1 First %2 Second %3 Third %4", _newap, _NV1,_NV2,_NV3];
|
||||
|
||||
player setVariable ["NV", ["OFF", _newap]];
|
||||
} else {
|
||||
player setVariable ["NV", ["ON", _newap]];
|
||||
};
|
||||
|
||||
exit;
|
||||
@@ -0,0 +1,151 @@
|
||||
private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_isMedic","_location1","_location2","_abort","_canName","_canSize","_configCan","_configVeh","_capacity","_nameText","_availableCans","_canText"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Refuel already in progress." , "PLAIN DOWN"] };
|
||||
TradeInprogress = true;
|
||||
|
||||
// Use target from addaction
|
||||
_vehicle = _this select 0;
|
||||
|
||||
_abort = false;
|
||||
|
||||
// Static vehicle fuel information
|
||||
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
|
||||
_capacity = getNumber(_configVeh >> "fuelCapacity");
|
||||
_nameText = getText(_configVeh >> "displayName");
|
||||
|
||||
// _availableCansEmpty = ["ItemJerrycanEmpty","ItemFuelBarrelEmpty"];
|
||||
_availableCans = ["ItemJerrycan","ItemFuelBarrel"];
|
||||
|
||||
// Loop to find containers that can could hold fuel and fill them
|
||||
{
|
||||
_configCan = configFile >> "CfgMagazines" >> _x;
|
||||
|
||||
if(_x in _availableCans) then {
|
||||
|
||||
// Get full can size
|
||||
_canName = _x;
|
||||
_canSize = getNumber(_configCan >> "fuelQuantity");
|
||||
_canText = getText(_configCan >> "displayName");
|
||||
|
||||
_curFuel = ((fuel _vehicle) * _capacity);
|
||||
_newFuel = (_curFuel + _canSize);
|
||||
|
||||
if (_newFuel <= _capacity) then {
|
||||
|
||||
// calculate new fuel
|
||||
_newFuel = (_newFuel / _capacity);
|
||||
|
||||
diag_log ("refuel check: " + str(_newFuel) + " / " + str(_capacity));
|
||||
|
||||
cutText [format["Preparing to refuel, stand still to drain %1.",_canText], "PLAIN DOWN"];
|
||||
|
||||
// alert zombies
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
_finished = false;
|
||||
|
||||
if(!dayz_isSwimming) then {
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
if (vehicle player != player) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if(!_finished) then {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
};
|
||||
|
||||
} else {
|
||||
// Alternate method in water make sure player stays in one spot for 6 seconds
|
||||
_location1 = getPosATL player;
|
||||
sleep 6;
|
||||
_location2 = getPosATL player;
|
||||
if(_location1 distance _location2 < 3) then {
|
||||
_finished = true;
|
||||
};
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
// Get vehicle fuel levels again
|
||||
_curFuel = ((fuel _vehicle) * _capacity);
|
||||
_newFuel = (_curFuel + _canSize);
|
||||
|
||||
if (_newFuel <= _capacity) then {
|
||||
|
||||
// calculate minimum needed fuel
|
||||
_newFuel = (_newFuel / _capacity);
|
||||
|
||||
if(([player,_canName] call BIS_fnc_invRemove) == 1) then {
|
||||
|
||||
dayzSetFuel = [_vehicle,_newFuel];
|
||||
if (local _vehicle) then {
|
||||
dayzSetFuel spawn local_setFuel;
|
||||
};
|
||||
publicVariable "dayzSetFuel";
|
||||
|
||||
// Play sound
|
||||
[player,"refuel",0,false] call dayz_zombieSpeak;
|
||||
|
||||
// Add filled can
|
||||
player addMagazine _canName+"Empty";
|
||||
|
||||
cutText [format[localize "str_player_05",_nameText,_canSize], "PLAIN DOWN"];
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
r_action = false;
|
||||
|
||||
sleep 1;
|
||||
} else {
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText [format["%1 cannot hold that much fuel.",_nameText], "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText ["Canceled refuel." , "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText [format["%1 cannot hold that much fuel.",_nameText], "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
};
|
||||
|
||||
// exit if abort flag was set
|
||||
if(_abort) exitWith {};
|
||||
|
||||
} forEach magazines player;
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,168 @@
|
||||
/*
|
||||
delete object from db with extra waiting by [VB]AWOL
|
||||
parameters: _obj
|
||||
*/
|
||||
private ["_obj","_objectID","_objectUID","_started","_finished","_animState","_isMedic","_isOk","_proceed","_counter","_limit","_objType","_sfx","_dis","_itemOut","_countOut","_selectedRemoveOutput","_friendlies","_nearestPole","_ownerID","_refundpart","_isWreck","_findNearestPoles","_findNearestPole","_IsNearPlot"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Remove already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
_obj = _this select 3;
|
||||
|
||||
if(_obj getVariable ["GeneratorRunning", false]) exitWith {TradeInprogress = false; cutText ["Cannot remove running generator.", "PLAIN DOWN"];};
|
||||
|
||||
_objectID = _obj getVariable ["ObjectID","0"];
|
||||
_objectUID = _obj getVariable ["ObjectUID","0"];
|
||||
|
||||
_isOk = true;
|
||||
_proceed = false;
|
||||
_objType = typeOf _obj;
|
||||
|
||||
_limit = 5;
|
||||
if(isNumber (configFile >> "CfgVehicles" >> _objType >> "constructioncount")) then {
|
||||
_limit = getNumber(configFile >> "CfgVehicles" >> _objType >> "constructioncount");
|
||||
};
|
||||
|
||||
_findNearestPoles = nearestObjects[player, ["Plastic_Pole_EP1_DZ"], 30];
|
||||
_findNearestPole = [];
|
||||
{if (alive _x) then {_findNearestPole set [(count _findNearestPole),_x];};} foreach _findNearestPoles;
|
||||
|
||||
_IsNearPlot = count (_findNearestPole);
|
||||
|
||||
if(_IsNearPlot >= 1) then {
|
||||
|
||||
_nearestPole = _findNearestPole select 0;
|
||||
|
||||
// Find owner
|
||||
_ownerID = _nearestPole getVariable["CharacterID","0"];
|
||||
|
||||
// check if friendly to owner
|
||||
if(dayz_characterID != _ownerID) then {
|
||||
|
||||
_friendlies = player getVariable ["friendlyTo",[]];
|
||||
// check if friendly to owner
|
||||
if(!(_ownerID in _friendlies)) then {
|
||||
_limit = round(_limit*2);
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
cutText [format["Starting de-construction of %1.",_objType], "PLAIN DOWN"];
|
||||
|
||||
// Alert zombies once.
|
||||
[player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
// Start de-construction loop
|
||||
_counter = 0;
|
||||
while {_isOk} do {
|
||||
|
||||
// if object no longer exits this should return true.
|
||||
if(isNull(_obj)) exitWith {
|
||||
_isOk = false;
|
||||
_proceed = false;
|
||||
};
|
||||
|
||||
player playActionNow "Medic";
|
||||
_dis=20;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
_sfx = "repair";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
|
||||
sleep 0.1;
|
||||
|
||||
};
|
||||
|
||||
if(!_finished) exitWith {
|
||||
_isOk = false;
|
||||
_proceed = false;
|
||||
};
|
||||
|
||||
if(_finished) then {
|
||||
_counter = _counter + 1;
|
||||
};
|
||||
|
||||
cutText [format["De-constructing %1 stage %2 of %3 walk away at anytime to cancel.",_objType, _counter,_limit], "PLAIN DOWN"];
|
||||
|
||||
if(_counter == _limit) exitWith {
|
||||
_isOk = false;
|
||||
_proceed = true;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
// Remove only if player waited
|
||||
if (_proceed) then {
|
||||
|
||||
// Double check that object is not null
|
||||
if(!isNull(_obj)) then {
|
||||
cutText [format["De-constructing %1.",_objType], "PLAIN DOWN"];
|
||||
|
||||
// TODO add hideobject to have it sink into ground then delete
|
||||
dayzHideObject = _obj;
|
||||
hideObject _obj; // local player
|
||||
publicVariable "dayzHideObject"; // remote player
|
||||
sleep 5;
|
||||
|
||||
|
||||
//["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
|
||||
dayzDeleteObj = [_objectID,_objectUID];
|
||||
publicVariableServer "dayzDeleteObj";
|
||||
|
||||
_isWreck = (typeOf _obj) in ["SKODAWreck","HMMWVWreck","UralWreck","datsun01Wreck","hiluxWreck","datsun02Wreck","UAZWreck","Land_Misc_Garb_Heap_EP1","Fort_Barricade_EP1","Rubbish2"];
|
||||
|
||||
deleteVehicle _obj;
|
||||
|
||||
_selectedRemoveOutput = [];
|
||||
if(_isWreck) then {
|
||||
// Find one random part to give back
|
||||
_refundpart = ["PartEngine","PartGeneric","PartFueltank","PartWheel","PartGlass","ItemJerrycan"] call BIS_fnc_selectRandom;
|
||||
_selectedRemoveOutput set [count _selectedRemoveOutput,[_refundpart,1]];
|
||||
} else {
|
||||
_selectedRemoveOutput = getArray (configFile >> "CfgVehicles" >> _objType >> "removeoutput");
|
||||
};
|
||||
|
||||
// give refund items
|
||||
if((count _selectedRemoveOutput) > 0) then {
|
||||
// Put itemsg
|
||||
{
|
||||
_itemOut = _x select 0;
|
||||
_countOut = _x select 1;
|
||||
for "_x" from 1 to _countOut do {
|
||||
player addMagazine _itemOut;
|
||||
};
|
||||
|
||||
} forEach _selectedRemoveOutput;
|
||||
cutText ["De-constructed parts are now in your inventory.", "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
cutText ["Failed object not longer exists.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
};
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,127 @@
|
||||
private ["_vehicle","_part","_hitpoint","_type","_selection","_array","_started","_finished","_animState","_isMedic","_num_removed","_damage","_dis","_sfx","_allFixed","_id","_hasToolbox","_section","_nameType","_namePart","_hitpoints"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Repair already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
_id = _this select 2;
|
||||
_array = _this select 3;
|
||||
_vehicle = _array select 0;
|
||||
_part = _array select 1;
|
||||
_hitpoint = _array select 2;
|
||||
_type = typeOf _vehicle;
|
||||
|
||||
//
|
||||
_hasToolbox = "ItemToolbox" in items player;
|
||||
_section = _part in magazines player;
|
||||
|
||||
// moving this here because we need to know which part needed if we don't have it
|
||||
_nameType = getText(configFile >> "cfgVehicles" >> _type >> "displayName");
|
||||
_namePart = getText(configFile >> "cfgMagazines" >> _part >> "displayName");
|
||||
|
||||
s_player_repair_crtl = 1;
|
||||
|
||||
if (_section and _hasToolbox) then {
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
_dis=20;
|
||||
_sfx = "repair";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
_damage = [_vehicle,_hitpoint] call object_getHit;
|
||||
_vehicle removeAction _id;
|
||||
|
||||
//dont waste loot on undamaged parts
|
||||
if (_damage > 0) then {
|
||||
|
||||
// ensure part was removed
|
||||
_num_removed = ([player,_part] call BIS_fnc_invRemove);
|
||||
|
||||
if(_num_removed == 1) then {
|
||||
|
||||
//Fix the part
|
||||
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
|
||||
|
||||
//vehicle is owned by whoever is in it, so we have to have each client try and fix it
|
||||
dayzSetFix = [_vehicle,_selection,0];
|
||||
publicVariable "dayzSetFix";
|
||||
if (local _vehicle) then {
|
||||
dayzSetFix call object_setFixServer;
|
||||
};
|
||||
|
||||
_vehicle setvelocity [0,0,1];
|
||||
|
||||
//Success!
|
||||
cutText [format["You have successfully attached %1 to the %2",_namePart,_nameType], "PLAIN DOWN"];
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled Repair.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText [format["You need %1 to repair this",_namePart], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
|
||||
dayz_myCursorTarget = objNull;
|
||||
|
||||
//check if repaired fully
|
||||
_hitpoints = _vehicle call vehicle_getHitpoints;
|
||||
_allFixed = true;
|
||||
{
|
||||
_damage = [_vehicle,_x] call object_getHit;
|
||||
if (_damage > 0) exitWith {
|
||||
_allFixed = false;
|
||||
};
|
||||
} forEach _hitpoints;
|
||||
|
||||
//update if repaired
|
||||
if (_allFixed) then {
|
||||
_vehicle setDamage 0;
|
||||
//["dayzUpdateVehicle",[_vehicle,"repair"]] call callRpcProcedure;
|
||||
dayzSetFix = [_vehicle,_selection,0];
|
||||
publicVariable "dayzSetFix";
|
||||
if (local _vehicle) then {
|
||||
dayzSetFix call object_setFixServer;
|
||||
};
|
||||
};
|
||||
|
||||
s_player_repair_crtl = -1;
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,4 @@
|
||||
private [];
|
||||
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
|
||||
s_player_repair_crtl = -1;
|
||||
dayz_myCursorTarget = objNull;
|
||||
@@ -0,0 +1,70 @@
|
||||
private ["_part","_cancel","_color","_allFixed","_percent","_string","_handle","_damage","_cmpt","_vehicle","_hitpoints"];
|
||||
|
||||
// [ _trader_id, _category, _action ];
|
||||
// _activatingPlayer = _this select 1;
|
||||
|
||||
_vehicle = _this select 3;
|
||||
|
||||
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
|
||||
// dayz_myCursorTarget = _vehicle;
|
||||
|
||||
_allFixed = true;
|
||||
_hitpoints = _vehicle call vehicle_getHitpoints;
|
||||
|
||||
{
|
||||
_damage = [_vehicle,_x] call object_getHit;
|
||||
_part = "PartGeneric";
|
||||
|
||||
//change "HitPart" to " - Part" rather than complicated string replace
|
||||
_cmpt = toArray (_x);
|
||||
_cmpt set [0,20];
|
||||
_cmpt set [1,toArray ("-") select 0];
|
||||
_cmpt set [2,20];
|
||||
_cmpt = toString _cmpt;
|
||||
|
||||
if(["Engine",_x,false] call fnc_inString) then {
|
||||
_part = "PartEngine";
|
||||
};
|
||||
|
||||
if(["HRotor",_x,false] call fnc_inString) then {
|
||||
_part = "PartVRotor"; //yes you need PartVRotor to fix HRotor LOL
|
||||
};
|
||||
|
||||
if(["Fuel",_x,false] call fnc_inString) then {
|
||||
_part = "PartFueltank";
|
||||
};
|
||||
|
||||
if(["Wheel",_x,false] call fnc_inString) then {
|
||||
_part = "PartWheel";
|
||||
};
|
||||
|
||||
if(["Glass",_x,false] call fnc_inString) then {
|
||||
_part = "PartGlass";
|
||||
};
|
||||
|
||||
// get every damaged part no matter how tiny damage is!
|
||||
if (_damage > 0) then {
|
||||
|
||||
_allFixed = false;
|
||||
_color = "color='#ffff00'"; //yellow
|
||||
if (_damage >= 0.5) then {_color = "color='#ff8800'";}; //orange
|
||||
if (_damage >= 0.9) then {_color = "color='#ff0000'";}; //red
|
||||
|
||||
_percent = round(_damage*100);
|
||||
_string = format["<t %2>Repair%1 (%3 %4)</t>",_cmpt,_color,_percent,"%"]; //Repair - Part
|
||||
_handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\repair.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
|
||||
s_player_repairActions set [count s_player_repairActions,_handle];
|
||||
};
|
||||
|
||||
} forEach _hitpoints;
|
||||
if (_allFixed) then {
|
||||
_vehicle setDamage 0;
|
||||
};
|
||||
|
||||
if(count _hitpoints > 0 ) then {
|
||||
|
||||
_cancel = dayz_myCursorTarget addAction ["Cancel", "\z\addons\dayz_code\actions\repair_cancel.sqf","repair", 0, true, false, "",""];
|
||||
s_player_repairActions set [count s_player_repairActions,_cancel];
|
||||
|
||||
s_player_repair_crtl = 1;
|
||||
};
|
||||
@@ -0,0 +1,120 @@
|
||||
private ["_vehicle","_part","_hitpoint","_type","_selection","_array","_started","_finished","_animState","_isMedic","_isOK","_brokenPart","_findPercent","_damage","_hasToolbox","_nameType","_namePart"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Salvage already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
//_id = _this select 2;
|
||||
_array = _this select 3;
|
||||
_vehicle = _array select 0;
|
||||
_part = _array select 1;
|
||||
_hitpoint = _array select 2;
|
||||
_type = typeOf _vehicle;
|
||||
|
||||
_isOK = false;
|
||||
_brokenPart = false;
|
||||
|
||||
//
|
||||
_hasToolbox = "ItemToolbox" in items player;
|
||||
|
||||
// moving this here because we need to know which part needed if we don't have it
|
||||
_nameType = getText(configFile >> "cfgVehicles" >> _type >> "displayName");
|
||||
_namePart = getText(configFile >> "cfgMagazines" >> _part >> "displayName");
|
||||
|
||||
{_vehicle removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
|
||||
s_player_repair_crtl = 1;
|
||||
|
||||
if (_hasToolbox) then {
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
[player,"repair",0,false] call dayz_zombieSpeak;
|
||||
[player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
_damage = [_vehicle,_hitpoint] call object_getHit;
|
||||
// _vehicle removeAction _id;
|
||||
|
||||
//dont allow removal of damaged parts
|
||||
if (_damage < 1) then {
|
||||
|
||||
_findPercent = (1 - _damage) * 10;
|
||||
if(ceil (random _findPercent) == 1) then {
|
||||
_isOK = true;
|
||||
_brokenPart = true;
|
||||
} else {
|
||||
_isOK = [player,_part] call BIS_fnc_invAdd;
|
||||
_brokenPart = false;
|
||||
};
|
||||
|
||||
if (_isOK) then {
|
||||
|
||||
//break the part
|
||||
_selection = getText(configFile >> "cfgVehicles" >> _type >> "HitPoints" >> _hitpoint >> "name");
|
||||
|
||||
//vehicle is owned by whoever is in it, so we have to have each client try and fix it
|
||||
//["dayzSetFix",[_vehicle,_selection,1],_vehicle] call broadcastRpcCallIfLocal;
|
||||
|
||||
dayzSetFix = [_vehicle,_selection,1];
|
||||
publicVariable "dayzSetFix";
|
||||
if (local _vehicle) then {
|
||||
dayzSetFix call object_setFixServer;
|
||||
};
|
||||
|
||||
_vehicle setvelocity [0,0,1];
|
||||
|
||||
if(_brokenPart) then {
|
||||
//Failed!
|
||||
cutText [format["You have destroyed %1 while attempting to remove from %2",_namePart,_nameType], "PLAIN DOWN"];
|
||||
} else {
|
||||
//Success!
|
||||
cutText [format["You have successfully removed %1 from the %2",_namePart,_nameType], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText [localize "STR_DAYZ_CODE_2", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled Salvage.", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText [format["You need %1 to remove this part.",_namePart], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
dayz_myCursorTarget = objNull;
|
||||
s_player_repair_crtl = -1;
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,70 @@
|
||||
private ["_part","_cancel","_color","_percent","_string","_handle","_damage","_cmpt","_vehicle","_hitpoints"];
|
||||
|
||||
// [ _trader_id, _category, _action ];
|
||||
// _activatingPlayer = _this select 1;
|
||||
|
||||
_vehicle = _this select 3;
|
||||
|
||||
{dayz_myCursorTarget removeAction _x} forEach s_player_repairActions;s_player_repairActions = [];
|
||||
// dayz_myCursorTarget = _vehicle;
|
||||
|
||||
// _allFixed = true;
|
||||
_hitpoints = _vehicle call vehicle_getHitpoints;
|
||||
// diag_log format["DEBUG SALVAGE: %1", _hitpoints];
|
||||
{
|
||||
_damage = [_vehicle,_x] call object_getHit;
|
||||
_part = "PartGeneric";
|
||||
|
||||
//change "HitPart" to " - Part" rather than complicated string replace
|
||||
_cmpt = toArray (_x);
|
||||
_cmpt set [0,20];
|
||||
_cmpt set [1,toArray ("-") select 0];
|
||||
_cmpt set [2,20];
|
||||
_cmpt = toString _cmpt;
|
||||
|
||||
if(["Engine",_x,false] call fnc_inString) then {
|
||||
_part = "PartEngine";
|
||||
};
|
||||
|
||||
if(["HRotor",_x,false] call fnc_inString) then {
|
||||
_part = "PartVRotor"; //yes you need PartVRotor to fix HRotor LOL
|
||||
};
|
||||
|
||||
if(["Fuel",_x,false] call fnc_inString) then {
|
||||
_part = "PartFueltank";
|
||||
};
|
||||
|
||||
if(["Wheel",_x,false] call fnc_inString) then {
|
||||
_part = "PartWheel";
|
||||
};
|
||||
|
||||
if(["Glass",_x,false] call fnc_inString) then {
|
||||
_part = "PartGlass";
|
||||
};
|
||||
|
||||
// allow removal of any lightly damaged parts
|
||||
if (_damage < 1 and _damage > 0) then {
|
||||
|
||||
// Do not allow removal of engine or fueltanks
|
||||
if( _part == "PartGlass" or _part == "PartWheel" ) then {
|
||||
|
||||
_color = "color='#ffff00'"; //yellow
|
||||
if (_damage >= 0.5) then {_color = "color='#ff8800'";}; //orange
|
||||
if (_damage >= 0.9) then {_color = "color='#ff0000'";}; //red
|
||||
|
||||
_percent = round(_damage*100);
|
||||
_string = format["<t %2>Remove%1 (%3 %4)</t>",_cmpt,_color,_percent,"%"]; //Remove - Part
|
||||
_handle = dayz_myCursorTarget addAction [_string, "\z\addons\dayz_code\actions\salvage.sqf",[_vehicle,_part,_x], 0, false, true, "",""];
|
||||
s_player_repairActions set [count s_player_repairActions,_handle];
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
} forEach _hitpoints;
|
||||
|
||||
if(count _hitpoints > 0 ) then {
|
||||
|
||||
_cancel = dayz_myCursorTarget addAction ["Cancel", "\z\addons\dayz_code\actions\repair_cancel.sqf","repair", 0, true, false, "",""];
|
||||
s_player_repairActions set [count s_player_repairActions,_cancel];
|
||||
s_player_repair_crtl = 1;
|
||||
};
|
||||
@@ -0,0 +1,149 @@
|
||||
private ["_activatingPlayer","_trader_id","_type","_name","_sell","_order","_tid","_in","_part","_cancel","_Display","_File","_textCurrency","_textPart","_count","_btype","_stype","_bag","_bagclass","_header","_item","_buy","_sqty","_sname","_afile"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
||||
|
||||
// [ _trader_id, _category, _action ];
|
||||
_activatingPlayer = _this select 1;
|
||||
|
||||
_trader_id = (_this select 3) select 0;
|
||||
//_category = (_this select 3) select 1;
|
||||
|
||||
dayzTraderMenuResult = call compile format["tcacheSell_%1;",_trader_id];
|
||||
|
||||
if(isNil "dayzTraderMenuResult") then {
|
||||
diag_log format["DEBUG TRADER OBJ: %1", _trader_id];
|
||||
//["dayzTraderMenu",[_activatingPlayer,_trader_id,_category,_action]] call callRpcProcedure;
|
||||
dayzTraderMenu = [_activatingPlayer,_trader_id];
|
||||
publicVariableServer "dayzTraderMenu";
|
||||
waitUntil {!isNil "dayzTraderMenuResult"};
|
||||
};
|
||||
|
||||
diag_log format["DEBUG Buy: %1", dayzTraderMenuResult];
|
||||
{
|
||||
_header = _x select 0; // "TRD"
|
||||
|
||||
// Trader Item name|type
|
||||
_item = _x select 1;
|
||||
_name = _item select 0;
|
||||
_type = _item select 1;
|
||||
switch(true)do{
|
||||
case (_type == 1): {
|
||||
_type = "CfgMagazines";
|
||||
};
|
||||
case (_type == 2): {
|
||||
_type = "CfgVehicles";
|
||||
};
|
||||
case (_type == 3): {
|
||||
_type = "CfgWeapons";
|
||||
};
|
||||
};
|
||||
// Display Name of item
|
||||
_textPart = getText(configFile >> _type >> _name >> "displayName");
|
||||
|
||||
// Total in stock
|
||||
//_qty = _x select 2;
|
||||
|
||||
// Buy Data from array
|
||||
_buy = _x select 3;
|
||||
//_bqty = _buy select 0;
|
||||
//_bname = _buy select 1;
|
||||
_btype = _buy select 2;
|
||||
switch(true)do{
|
||||
case (_btype == 1): {
|
||||
_btype = "CfgMagazines";
|
||||
};
|
||||
case (_btype == 2): {
|
||||
_btype = "CfgVehicles";
|
||||
};
|
||||
case (_btype == 3): {
|
||||
_btype = "CfgWeapons";
|
||||
};
|
||||
};
|
||||
// Display Name of buy item
|
||||
//_textCurrencyBuy = getText(configFile >> _btype >> _bname >> "displayName");
|
||||
|
||||
// Sell data from array
|
||||
_sell = _x select 4;
|
||||
_sqty = _sell select 0;
|
||||
_sname = _sell select 1;
|
||||
_stype = _sell select 2;
|
||||
switch(true)do{
|
||||
case (_stype == 1): {
|
||||
_stype = "CfgMagazines";
|
||||
};
|
||||
case (_stype == 2): {
|
||||
_stype = "CfgVehicles";
|
||||
};
|
||||
case (_stype == 3): {
|
||||
_stype = "CfgWeapons";
|
||||
};
|
||||
};
|
||||
// Display Name of sell item
|
||||
_textCurrency = getText(configFile >> _stype >> _sname >> "displayName");
|
||||
|
||||
// Menu sort order
|
||||
_order = _x select 5;
|
||||
|
||||
// Trader Menu ID
|
||||
_tid = _x select 6;
|
||||
|
||||
// Action file to use for trade
|
||||
_afile = _x select 7;
|
||||
_File = "\z\addons\dayz_code\actions\" + _afile + ".sqf";
|
||||
|
||||
// Allways 1 for now
|
||||
//_out = _sqty;
|
||||
// qty consumed of bname
|
||||
_in = 1;
|
||||
|
||||
_count = 0;
|
||||
if(_type == "CfgVehicles") then {
|
||||
if (_afile == "trade_backpacks") then {
|
||||
_bag = unitBackpack player;
|
||||
_bagclass = typeOf _bag;
|
||||
if(_name == _bagclass) then {
|
||||
_count = 1;
|
||||
};
|
||||
} else {
|
||||
_count = {(typeOf _x) == _name} count (nearestObjects [player, [_name], 20]);
|
||||
}
|
||||
};
|
||||
if(_type == "CfgMagazines") then {
|
||||
_count = {_x == _name} count magazines player;
|
||||
};
|
||||
if(_type == "CfgWeapons") then {
|
||||
_count = {_x == _name} count weapons player;
|
||||
};
|
||||
|
||||
|
||||
if (_count > 0) then {
|
||||
_Display = format["Sell %1 for %2 %3 each", _textPart, _sqty, _textCurrency];
|
||||
} else {
|
||||
_Display = format["<t color='#ffff00'>Sell %1 for %2 %3 each</t>", _textPart, _sqty, _textCurrency];
|
||||
};
|
||||
|
||||
// trade_items.sqf | [part_out, part_in, qty_out, qty_in,_textPart,_textCurrency];
|
||||
_part = player addAction [_Display, _File,[_sname,_name,_sqty,_in,"sell",_textPart,_textCurrency,_header], _order, true, true, "",""];
|
||||
|
||||
|
||||
// diag_log format["DEBUG TRADER: %1", _part];
|
||||
s_player_parts set [count s_player_parts,_part];
|
||||
|
||||
} forEach dayzTraderMenuResult;
|
||||
|
||||
_cancel = player addAction ["Cancel", "\z\addons\dayz_code\actions\trade_cancel.sqf",["medical"], 0, true, false, "",""];
|
||||
s_player_parts set [count s_player_parts,_cancel];
|
||||
|
||||
// Cache data in client side global variable
|
||||
call compile format["tcacheSell_%1 = %2;",_tid,dayzTraderMenuResult];
|
||||
|
||||
|
||||
// Clear Data
|
||||
dayzTraderMenuResult = nil;
|
||||
|
||||
|
||||
s_player_parts_crtl = 1;
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,158 @@
|
||||
private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_isMedic","_location1","_location2","_abort","_canNameEmpty","_canSizeEmpty","_canTypeEmpty","_canName","_canSize","_configCanEmpty","_configVeh","_capacity","_nameText","_availableCansEmpty"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Siphon already in progress." , "PLAIN DOWN"] };
|
||||
TradeInprogress = true;
|
||||
|
||||
// Use target from addaction
|
||||
_vehicle = _this select 0;
|
||||
|
||||
_abort = false;
|
||||
|
||||
// Static vehicle fuel information
|
||||
_configVeh = configFile >> "cfgVehicles" >> TypeOf(_vehicle);
|
||||
_capacity = getNumber(_configVeh >> "fuelCapacity");
|
||||
_nameText = getText(_configVeh >> "displayName");
|
||||
|
||||
_availableCansEmpty = ["ItemJerrycanEmpty","ItemFuelBarrelEmpty"];
|
||||
// _availableCans = ["ItemJerrycan","ItemFuelBarrel"];
|
||||
|
||||
// Loop to find containers that can could hold fuel and fill them
|
||||
{
|
||||
_configCanEmpty = configFile >> "CfgMagazines" >> _x;
|
||||
diag_log format["Looking for: %1", _x];
|
||||
if(_x in _availableCansEmpty) then {
|
||||
|
||||
diag_log format["gas fuelQuantity config : %1", _x];
|
||||
|
||||
// Get Empty can size
|
||||
_canNameEmpty = _x;
|
||||
_canSizeEmpty = getNumber(_configCanEmpty >> "fuelQuantity");
|
||||
_canTypeEmpty = getText(_configCanEmpty >> "displayName");
|
||||
|
||||
// Get Full can size
|
||||
_canName = configName(inheritsFrom(configFile >> "cfgMagazines" >> _canNameEmpty));
|
||||
_canSize = getNumber(configFile >> "cfgMagazines" >> _canName >> "fuelQuantity");
|
||||
|
||||
// is empty
|
||||
if(_canSizeEmpty == 0) then {
|
||||
|
||||
diag_log format["is empty fuelQuantity : %1", _x];
|
||||
|
||||
_curFuel = ((fuel _vehicle) * _capacity);
|
||||
_newFuel = (_curFuel - _canSize);
|
||||
|
||||
// calculate new fuel
|
||||
_newFuel = (_newFuel / _capacity);
|
||||
|
||||
if (_newFuel > 0) then {
|
||||
|
||||
cutText [format["Preparing to siphon, stand still to fill %1.",_canTypeEmpty], "PLAIN DOWN"];
|
||||
|
||||
// alert zombies
|
||||
[player,20,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
_finished = false;
|
||||
|
||||
if(!dayz_isSwimming) then {
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if(!_finished) then {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
};
|
||||
|
||||
} else {
|
||||
// Alternate method in water make sure player stays in one spot for 6 seconds
|
||||
_location1 = getPosATL player;
|
||||
sleep 6;
|
||||
_location2 = getPosATL player;
|
||||
if(_location1 distance _location2 < 3) then {
|
||||
_finished = true;
|
||||
};
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
// Get vehicle fuel levels again
|
||||
_curFuel = ((fuel _vehicle) * _capacity);
|
||||
_newFuel = (_curFuel - _canSize);
|
||||
|
||||
// calculate minimum needed fuel
|
||||
_newFuel = (_newFuel / _capacity);
|
||||
|
||||
if (_newFuel > 0) then {
|
||||
|
||||
if(([player,_canNameEmpty] call BIS_fnc_invRemove) == 1) then {
|
||||
|
||||
dayzSetFuel = [_vehicle,_newFuel];
|
||||
if (local _vehicle) then {
|
||||
dayzSetFuel spawn local_setFuel;
|
||||
};
|
||||
publicVariable "dayzSetFuel";
|
||||
|
||||
// Play sound
|
||||
[player,"refuel",0,false] call dayz_zombieSpeak;
|
||||
|
||||
// Add filled can
|
||||
player addMagazine _canName;
|
||||
|
||||
cutText [format["%1 has been drained for %2 litres of Fuel",_nameText,_canSize], "PLAIN DOWN"];
|
||||
|
||||
call fnc_usec_medic_removeActions;
|
||||
r_action = false;
|
||||
|
||||
sleep 1;
|
||||
} else {
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText [format["%1 does not have enough fuel to siphon.",_nameText], "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText ["Canceled siphon." , "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
} else {
|
||||
cutText [format["%1 does not have enough fuel to siphon.",_nameText], "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
// exit if abort flag was set
|
||||
if(_abort) exitWith {};
|
||||
|
||||
} forEach magazines player;
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,66 @@
|
||||
private ["_vehicle","_started","_finished","_animState","_isMedic","_soundObject"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Stop already in progress." , "PLAIN DOWN"] };
|
||||
TradeInprogress = true;
|
||||
|
||||
player removeAction s_player_fillgen;
|
||||
s_player_fillgen = 1;
|
||||
|
||||
// Use target from addaction
|
||||
_vehicle = _this select 3;
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
r_interrupt = false;
|
||||
_animState = animationState player;
|
||||
r_doLoop = true;
|
||||
_started = false;
|
||||
_finished = false;
|
||||
|
||||
cutText ["Preparing stop generator, move to cancel.", "PLAIN DOWN"];
|
||||
|
||||
[player,50,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
while {r_doLoop} do {
|
||||
_animState = animationState player;
|
||||
_isMedic = ["medic",_animState] call fnc_inString;
|
||||
if (_isMedic) then {
|
||||
_started = true;
|
||||
};
|
||||
if (_started and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if(!_finished) then {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled." , "PLAIN DOWN"]
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
// find sound and delete
|
||||
_soundObject = _vehicle getVariable "GeneratorSound";
|
||||
|
||||
deleteVehicle _soundObject;
|
||||
|
||||
// Stop generator
|
||||
_vehicle setVariable ["GeneratorRunning", false,true];
|
||||
|
||||
cutText ["Generator has been stopped.", "PLAIN DOWN"];
|
||||
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
s_player_fillgen = -1;
|
||||
@@ -0,0 +1,8 @@
|
||||
private["_body","_name","_method","_methodStr"];
|
||||
_body = _this select 3;
|
||||
_name = _body getVariable["bodyName","unknown"];
|
||||
_method = _body getVariable["deathType","unknown"];
|
||||
_methodStr = localize format ["str_death_%1",_method];
|
||||
|
||||
|
||||
cutText [format[(localize "str_player_studybody"),_name,_methodStr], "PLAIN DOWN"];
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
File: tame_dog.sqf 1.1
|
||||
Author: Kane "Alby" Stone
|
||||
Expanded to allow all meats as input by: [VB]AWOL - DayZ Epoch
|
||||
|
||||
Description:
|
||||
Allows a player to tame/domesticate a dog.
|
||||
Script is applied to object via addAction.
|
||||
|
||||
Variables:
|
||||
_target = Object that action is attached too.
|
||||
_caller = Object that activates the action.
|
||||
_id = ID of the action handler.
|
||||
_dog = Intended target of the script.
|
||||
*/
|
||||
|
||||
private ["_target","_caller","_id","_dog","_fsmid","_removed","_selected","_animalID","_textRemoved","_chanceToFail","_itemIn","_countIn"];
|
||||
_target = _this select 0;
|
||||
_caller = _this select 1;
|
||||
_id = _this select 2;
|
||||
_dog = _this select 3;
|
||||
|
||||
_removed = 0;
|
||||
_itemIn = "FoodmeatRaw";
|
||||
_countIn = 1;
|
||||
_selected = "";
|
||||
|
||||
{
|
||||
if( (_removed < _countIn) && ((_x == _itemIn) || configName(inheritsFrom(configFile >> "cfgMagazines" >> _x)) == _itemIn)) then {
|
||||
_removed = _removed + ([player,_x] call BIS_fnc_invRemove);
|
||||
};
|
||||
if(_removed == 1) exitWith { _selected = _x; };
|
||||
} forEach magazines player;
|
||||
|
||||
// Only proceed if removed count matches
|
||||
if(_removed == _countIn) then {
|
||||
|
||||
// get name of item removed
|
||||
_textRemoved = getText(configFile >> "CfgMagazines" >> _selected >> "displayName");
|
||||
|
||||
// add failure rate based on skill level variable (days alive)
|
||||
_chanceToFail = (((random 1) + (dayz_skilllevel/100)) > 0.5);
|
||||
|
||||
if(!_chanceToFail) then {
|
||||
|
||||
_animalID = _dog getVariable "fsm_handle";
|
||||
_animalID setFSMVariable ["_isTamed", true];
|
||||
sleep 1;
|
||||
diag_log format["DEBUG: %1, id: %2 [%3]",_dog,_animalID,completedFSM _animalID];
|
||||
if (!moveToCompleted _dog) then {
|
||||
_dog moveTo (position _dog);
|
||||
};
|
||||
_dog disableAI "FSM";
|
||||
(group _dog) setBehaviour "AWARE";
|
||||
_fsmid = [_dog, typeOf _dog] execFSM "\z\addons\dayz_code\system\dog_agent.fsm";
|
||||
_fsmid setFSMVariable ["_handle", _fsmid];
|
||||
player setVariable ["dogID", _fsmid];
|
||||
_dog setVariable ["fsm_handle", _fsmid];
|
||||
_dog setVariable ["characterID", dayz_characterID, true];
|
||||
|
||||
cutText [format["Dog consumed %1, and is now tamed.",_textRemoved], "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [format["Dog consumed %1, yet remains untamed.",_textRemoved], "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
private["_obj"];
|
||||
_obj = _this select 3;
|
||||
_obj spawn player_packTent;
|
||||
@@ -0,0 +1,70 @@
|
||||
private ["_location","_isOk","_pondPos","_isPond","_dir","_dis","_sfx","_classname","_object","_playerPos","_item","_hastentitem","_building","_config","_text","_objectsPond"];
|
||||
//check if can pitch here
|
||||
call gear_ui_init;
|
||||
_playerPos = getPosATL player;
|
||||
_item = _this;
|
||||
_hastentitem = _this in magazines player;
|
||||
_location = player modeltoworld [0,2.5,0];
|
||||
_location set [2,0];
|
||||
_building = nearestObject [(vehicle player), "HouseBase"];
|
||||
_isOk = [(vehicle player),_building] call fnc_isInsideBuilding;
|
||||
//_isOk = true;
|
||||
|
||||
//diag_log ("Pitch Tent: " + str(_isok) );
|
||||
|
||||
_config = configFile >> "CfgMagazines" >> _item;
|
||||
_text = getText (_config >> "displayName");
|
||||
|
||||
if (!_hastentitem) exitWith {cutText [format[(localize "str_player_31"),_text,"pitch"] , "PLAIN DOWN"]};
|
||||
|
||||
//blocked
|
||||
if (["concrete",dayz_surfaceType] call fnc_inString) then { _isOk = true; diag_log ("surface concrete"); };
|
||||
//Block Tents in pounds
|
||||
_objectsPond = nearestObjects [_playerPos, [], 10];
|
||||
{
|
||||
_isPond = ["pond",str(_x),false] call fnc_inString;
|
||||
if (_isPond) then {
|
||||
_pondPos = (_x worldToModel _playerPos) select 2;
|
||||
if (_pondPos < 0) then {
|
||||
_isOk = true;
|
||||
};
|
||||
};
|
||||
} forEach _objectsPond;
|
||||
|
||||
//diag_log ("Pitch Tent: " + str(_isok) );
|
||||
|
||||
if (!_isOk) then {
|
||||
//remove tentbag
|
||||
player removeMagazine _item;
|
||||
_dir = round(direction player);
|
||||
|
||||
//wait a bit
|
||||
player playActionNow "Medic";
|
||||
sleep 1;
|
||||
|
||||
_dis=20;
|
||||
_sfx = "tentunpack";
|
||||
[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Pitch" >> "create");
|
||||
|
||||
sleep 5;
|
||||
//place tent (local)
|
||||
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
_object setdir _dir;
|
||||
_object setpos _location;
|
||||
player reveal _object;
|
||||
_location = getPosATL _object;
|
||||
|
||||
_object setVariable ["characterID",dayz_characterID,true];
|
||||
|
||||
//["dayzPublishObj",[dayz_characterID,_tent,[_dir,_location],_classname]] call callRpcProcedure;
|
||||
dayzPublishObj = [dayz_characterID,_object,[_dir,_location],_classname];
|
||||
publicVariableServer "dayzPublishObj";
|
||||
|
||||
cutText [localize "str_success_tent_pitch", "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [localize "str_fail_tent_pitch", "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
private ["_veh","_location","_isOk","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_removed","_keyColor","_keyNumber","_keySelected","_isKeyOK","_config","_okToSell","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
// Test cannot lock while another player is nearby
|
||||
_playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 12]) > 1;
|
||||
if(_playerNear) exitWith { TradeInprogress = false; cutText ["Cannot trade while another player is nearby." , "PLAIN DOWN"]; };
|
||||
|
||||
// [part_out,part_in, qty_out, qty_in, loc];
|
||||
|
||||
_activatingPlayer = _this select 1;
|
||||
|
||||
_part_out = (_this select 3) select 0;
|
||||
_part_in = (_this select 3) select 1;
|
||||
_qty_out = (_this select 3) select 2;
|
||||
_qty_in = (_this select 3) select 3;
|
||||
_buy_o_sell = (_this select 3) select 4;
|
||||
_textPartIn = (_this select 3) select 5;
|
||||
_textPartOut = (_this select 3) select 6;
|
||||
_traderID = (_this select 3) select 7;
|
||||
_bos = 0;
|
||||
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance];
|
||||
_qty = count _obj;
|
||||
_bos = 1;
|
||||
};
|
||||
|
||||
|
||||
if (_qty >= _qty_in) then {
|
||||
|
||||
cutText ["Starting trade, stand still to complete trade.", "PLAIN DOWN"];
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled Trade." , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
// Double check for items
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance];
|
||||
_qty = count _obj;
|
||||
};
|
||||
|
||||
if (_qty >= _qty_in) then {
|
||||
|
||||
//["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
||||
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
|
||||
publicVariableServer "dayzTradeObject";
|
||||
|
||||
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
|
||||
|
||||
waitUntil {!isNil "dayzTradeResult"};
|
||||
|
||||
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
|
||||
|
||||
if(dayzTradeResult == "PASS") then {
|
||||
|
||||
if(_buy_o_sell == "buy") then {
|
||||
|
||||
// First select key color
|
||||
_keyColor = ["Green","Red","Blue","Yellow","Black"] call BIS_fnc_selectRandom;
|
||||
|
||||
// then select number from 1 - 2500
|
||||
_keyNumber = (floor(random 2500)) + 1;
|
||||
|
||||
// Combine to key (eg.ItemKeyYellow2494) classname
|
||||
_keySelected = format[("ItemKey%1%2"),_keyColor,_keyNumber];
|
||||
|
||||
_isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
|
||||
|
||||
_config = _keySelected;
|
||||
_isOk = [player,_config] call BIS_fnc_invAdd;
|
||||
waitUntil {!isNil "_isOk"};
|
||||
if (_isOk and _isKeyOK) then {
|
||||
|
||||
_removed = ([player,_part_in,_qty_in] call BIS_fnc_invRemove);
|
||||
if(_removed == _qty_in) then {
|
||||
_dir = round(random 360);
|
||||
|
||||
_helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100];
|
||||
if(count _helipad > 0) then {
|
||||
_location = (getPosATL (_helipad select 0));
|
||||
} else {
|
||||
_location = [(position player),0,20,1,2,2000,0] call BIS_fnc_findSafePos;
|
||||
};
|
||||
|
||||
//place vehicle spawn marker (local)
|
||||
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
|
||||
|
||||
_location = (getPosATL _veh);
|
||||
|
||||
//["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,_keySelected]] call callRpcProcedure;
|
||||
dayzPublishVeh2 = [_veh,[_dir,_location],_part_out,false,_keySelected];
|
||||
publicVariableServer "dayzPublishVeh2";
|
||||
|
||||
player reveal _veh;
|
||||
|
||||
cutText [format[("Bought %3 for %1 %2, key added to toolbelt."),_qty_in,_textPartIn,_textPartOut], "PLAIN DOWN"];
|
||||
} else {
|
||||
player removeMagazine _keySelected;
|
||||
};
|
||||
} else {
|
||||
cutText ["You do not have enough room on your toolbelt.", "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
|
||||
_obj = _obj select 0;
|
||||
|
||||
_okToSell = true;
|
||||
if(_okToSell and !isNull _obj and alive _obj) then {
|
||||
|
||||
// Sell Vehicle
|
||||
for "_x" from 1 to _qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
|
||||
_objectID = _obj getVariable ["ObjectID","0"];
|
||||
_objectUID = _obj getVariable ["ObjectUID","0"];
|
||||
|
||||
//["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
|
||||
dayzDeleteObj = [_objectID,_objectUID];
|
||||
publicVariableServer "dayzDeleteObj";
|
||||
|
||||
deleteVehicle _obj;
|
||||
|
||||
cutText [format[("Sold %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
|
||||
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
||||
s_player_parts_crtl = -1;
|
||||
|
||||
} else {
|
||||
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
|
||||
};
|
||||
dayzTradeResult = nil;
|
||||
};
|
||||
};
|
||||
|
||||
} else {
|
||||
_needed = _qty_in - _qty;
|
||||
if(_buy_o_sell == "buy") then {
|
||||
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [format[("No %1 found within 20 meters."),_textPartIn] , "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,215 @@
|
||||
private ["_veh","_location","_isOk","_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_obj","_objectID","_objectUID","_bos","_started","_finished","_animState","_isMedic","_dir","_helipad","_removed","_keyColor","_keyNumber","_keySelected","_isKeyOK","_config","_damage","_tireDmg","_tires","_okToSell","_hitpoints","_needed","_activatingPlayer","_textPartIn","_textPartOut","_traderID"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
// Test cannot lock while another player is nearby
|
||||
_playerNear = {isPlayer _x} count (player nearEntities ["CAManBase", 12]) > 1;
|
||||
if(_playerNear) exitWith { TradeInprogress = false; cutText ["Cannot trade while another player is nearby." , "PLAIN DOWN"]; };
|
||||
|
||||
// [part_out,part_in, qty_out, qty_in, loc];
|
||||
|
||||
_activatingPlayer = _this select 1;
|
||||
|
||||
_part_out = (_this select 3) select 0;
|
||||
_part_in = (_this select 3) select 1;
|
||||
_qty_out = (_this select 3) select 2;
|
||||
_qty_in = (_this select 3) select 3;
|
||||
_buy_o_sell = (_this select 3) select 4;
|
||||
_textPartIn = (_this select 3) select 5;
|
||||
_textPartOut = (_this select 3) select 6;
|
||||
_traderID = (_this select 3) select 7;
|
||||
_bos = 0;
|
||||
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance];
|
||||
_qty = count _obj;
|
||||
_bos = 1;
|
||||
};
|
||||
|
||||
if (_qty >= _qty_in) then {
|
||||
|
||||
cutText ["Starting trade, stand still to complete trade.", "PLAIN DOWN"];
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled Trade." , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
// Double check for items
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
_obj = nearestObjects [(getPosATL player), [_part_in], dayz_sellDistance];
|
||||
_qty = count _obj;
|
||||
};
|
||||
|
||||
if (_qty >= _qty_in) then {
|
||||
|
||||
//["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
||||
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
|
||||
publicVariableServer "dayzTradeObject";
|
||||
|
||||
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
|
||||
|
||||
waitUntil {!isNil "dayzTradeResult"};
|
||||
|
||||
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
|
||||
|
||||
if(dayzTradeResult == "PASS") then {
|
||||
|
||||
if(_buy_o_sell == "buy") then {
|
||||
|
||||
// First select key color
|
||||
_keyColor = ["Green","Red","Blue","Yellow","Black"] call BIS_fnc_selectRandom;
|
||||
|
||||
// then select number from 1 - 2500
|
||||
_keyNumber = (floor(random 2500)) + 1;
|
||||
|
||||
// Combine to key (eg.ItemKeyYellow2494) classname
|
||||
_keySelected = format[("ItemKey%1%2"),_keyColor,_keyNumber];
|
||||
|
||||
_isKeyOK = isClass(configFile >> "CfgWeapons" >> _keySelected);
|
||||
|
||||
_config = _keySelected;
|
||||
_isOk = [player,_config] call BIS_fnc_invAdd;
|
||||
waitUntil {!isNil "_isOk"};
|
||||
if (_isOk and _isKeyOK) then {
|
||||
|
||||
_removed = ([player,_part_in,_qty_in] call BIS_fnc_invRemove);
|
||||
if(_removed == _qty_in) then {
|
||||
_dir = round(random 360);
|
||||
|
||||
_helipad = nearestObjects [player, ["HeliHCivil","HeliHempty"], 100];
|
||||
if(count _helipad > 0) then {
|
||||
_location = (getPosATL (_helipad select 0));
|
||||
} else {
|
||||
_location = [(position player),0,20,1,0,2000,0] call BIS_fnc_findSafePos;
|
||||
};
|
||||
|
||||
//place vehicle spawn marker (local)
|
||||
_veh = createVehicle ["Sign_arrow_down_large_EP1", _location, [], 0, "CAN_COLLIDE"];
|
||||
|
||||
_location = (getPosATL _veh);
|
||||
|
||||
//["dayzPublishVeh",[_veh,[_dir,_location],_part_out,false,_keySelected]] call callRpcProcedure;
|
||||
dayzPublishVeh2 = [_veh,[_dir,_location],_part_out,false,_keySelected];
|
||||
publicVariableServer "dayzPublishVeh2";
|
||||
|
||||
player reveal _veh;
|
||||
|
||||
cutText [format[("Bought %3 for %1 %2, key added to toolbelt."),_qty_in,_textPartIn,_textPartOut], "PLAIN DOWN"];
|
||||
} else {
|
||||
player removeMagazine _keySelected;
|
||||
};
|
||||
} else {
|
||||
cutText ["You do not have enough room on your toolbelt.", "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
|
||||
_obj = _obj select 0;
|
||||
|
||||
//check to make sure vehicle has no more than 75% average tire damage
|
||||
_hitpoints = _obj call vehicle_getHitpoints;
|
||||
_okToSell = true;
|
||||
|
||||
// count parts
|
||||
_tires = 0;
|
||||
|
||||
// total damage
|
||||
_tireDmg = 0;
|
||||
|
||||
_damage = 0;
|
||||
{
|
||||
if(["Wheel",_x,false] call fnc_inString) then {
|
||||
_damage = [_obj,_x] call object_getHit;
|
||||
_tireDmg = _tireDmg + _damage;
|
||||
_tires = _tires + 1;
|
||||
};
|
||||
} forEach _hitpoints;
|
||||
|
||||
// find average tire damage
|
||||
if(_tireDmg > 0 and _tires > 0) then {
|
||||
if((_tireDmg / _tires) > 0.75) then {
|
||||
_okToSell = false;
|
||||
};
|
||||
};
|
||||
|
||||
if(_okToSell) then {
|
||||
|
||||
if(!isNull _obj and alive _obj) then {
|
||||
// Sell Vehicle
|
||||
for "_x" from 1 to _qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
|
||||
_objectID = _obj getVariable ["ObjectID","0"];
|
||||
_objectUID = _obj getVariable ["ObjectUID","0"];
|
||||
|
||||
//["dayzDeleteObj",[_objectID,_objectUID]] call callRpcProcedure;
|
||||
dayzDeleteObj = [_objectID,_objectUID];
|
||||
publicVariableServer "dayzDeleteObj";
|
||||
|
||||
deleteVehicle _obj;
|
||||
|
||||
cutText [format[("Sold %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
cutText [format[("Cannot sell %1, tires are too damaged."),_textPartIn] , "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
|
||||
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
||||
s_player_parts_crtl = -1;
|
||||
|
||||
} else {
|
||||
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
|
||||
};
|
||||
dayzTradeResult = nil;
|
||||
};
|
||||
};
|
||||
|
||||
} else {
|
||||
_needed = _qty_in - _qty;
|
||||
if(_buy_o_sell == "buy") then {
|
||||
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [format[("No %1 found within 20 meters."),_textPartIn] , "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,132 @@
|
||||
private ["_part_out","_part_in","_qty_out","_qty_in","_qty","_bos","_bag","_class","_started","_finished","_animState","_isMedic","_num_removed","_needed","_activatingPlayer","_buy_o_sell","_textPartIn","_textPartOut","_traderID"];
|
||||
// [part_out,part_in, qty_out, qty_in,];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
_activatingPlayer = _this select 1;
|
||||
|
||||
_part_out = (_this select 3) select 0;
|
||||
_part_in = (_this select 3) select 1;
|
||||
_qty_out = (_this select 3) select 2;
|
||||
_qty_in = (_this select 3) select 3;
|
||||
_buy_o_sell = (_this select 3) select 4;
|
||||
_textPartIn = (_this select 3) select 5;
|
||||
_textPartOut = (_this select 3) select 6;
|
||||
_traderID = (_this select 3) select 7;
|
||||
_bos = 0;
|
||||
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
_bos = 1;
|
||||
_qty = 0;
|
||||
_bag = unitBackpack player;
|
||||
_class = typeOf _bag;
|
||||
if(_class == _part_in) then {
|
||||
_qty = 1;
|
||||
};
|
||||
};
|
||||
|
||||
if (_qty >= _qty_in) then {
|
||||
|
||||
cutText ["Starting trade, stand still to complete trade.", "PLAIN DOWN"];
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled Trade." , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
// Double check we still have parts
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
_qty = 0;
|
||||
_bag = unitBackpack player;
|
||||
_class = typeOf _bag;
|
||||
if(_class == _part_in) then {
|
||||
_qty = 1;
|
||||
};
|
||||
};
|
||||
|
||||
if (_qty >= _qty_in) then {
|
||||
|
||||
//["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
||||
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
|
||||
publicVariableServer "dayzTradeObject";
|
||||
|
||||
diag_log format["DEBUG Starting to wait for answer: %1", dayzTradeObject];
|
||||
|
||||
waitUntil {!isNil "dayzTradeResult"};
|
||||
|
||||
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
|
||||
|
||||
if(dayzTradeResult == "PASS") then {
|
||||
|
||||
if(_buy_o_sell == "buy") then {
|
||||
|
||||
_num_removed = ([player,_part_in,_qty_in] call BIS_fnc_invRemove);
|
||||
if(_num_removed == _qty_in) then {
|
||||
removeBackpack player;
|
||||
player addBackpack _part_out;
|
||||
};
|
||||
} else {
|
||||
// Sell
|
||||
if((typeOf (unitBackpack player)) == _part_in) then {
|
||||
removeBackpack player;
|
||||
for "_x" from 1 to _qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
||||
|
||||
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
||||
s_player_parts_crtl = -1;
|
||||
|
||||
} else {
|
||||
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
|
||||
};
|
||||
dayzTradeResult = nil;
|
||||
};
|
||||
};
|
||||
|
||||
} else {
|
||||
_needed = _qty_in - _qty;
|
||||
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,3 @@
|
||||
private [];
|
||||
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
||||
s_player_parts_crtl = -1;
|
||||
@@ -0,0 +1,269 @@
|
||||
private ["_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_textPartIn","_textPartOut","_bos","_needed","_started","_finished","_animState","_isMedic","_total_parts_out","_abort","_removed","_tradeCounter","_next_highest_bar","_third_highest_bar","_next_highest_conv","_third_highest_conv","_third_parts_out_raw","_third_parts_out","_remainder","_next_parts_out_raw","_next_parts_out","_activatingPlayer","_traderID","_total_trades"];
|
||||
// [part_out,part_in, qty_out, qty_in,];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"] };
|
||||
TradeInprogress = true;
|
||||
|
||||
_total_parts_out = 0;
|
||||
|
||||
_activatingPlayer = _this select 1;
|
||||
|
||||
_part_out = (_this select 3) select 0;
|
||||
_part_in = (_this select 3) select 1;
|
||||
_qty_out = (_this select 3) select 2;
|
||||
_qty_in = (_this select 3) select 3;
|
||||
_buy_o_sell = (_this select 3) select 4;
|
||||
_textPartIn = (_this select 3) select 5;
|
||||
_textPartOut = (_this select 3) select 6;
|
||||
_traderID = (_this select 3) select 7;
|
||||
|
||||
_removed = 0;
|
||||
_tradeCounter = 0;
|
||||
|
||||
_bos = 0;
|
||||
if(_buy_o_sell == "sell") then {
|
||||
_bos = 1;
|
||||
};
|
||||
|
||||
// Get total parts in
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
|
||||
// Find number of possible trades
|
||||
_total_trades = floor(_qty / _qty_in);
|
||||
|
||||
_abort = false;
|
||||
|
||||
if(_total_trades < 1) exitWith {
|
||||
_needed = _qty_in - _qty;
|
||||
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
|
||||
TradeInprogress = false;
|
||||
};
|
||||
|
||||
// perform number of total trades
|
||||
for "_x" from 1 to _total_trades do {
|
||||
|
||||
_removed = 0;
|
||||
_tradeCounter = _tradeCounter + 1;
|
||||
|
||||
// cutText ["Starting trade, stand still to complete.", "PLAIN DOWN"];
|
||||
if(_total_trades == 1) then {
|
||||
cutText [format[("Starting trade, stand still to complete trade."),_tradeCounter,_total_trades] , "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [format[("Starting trade, stand still to complete trade %1 of %2."),_tradeCounter,_total_trades] , "PLAIN DOWN"];
|
||||
};
|
||||
player playActionNow "Medic";
|
||||
|
||||
//_dis=20;
|
||||
//_sfx = "repair";
|
||||
//[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
//[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled Trade." , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
if (_qty >= _qty_in) then {
|
||||
|
||||
_removed = _removed + ([player,_part_in,_qty_in] call BIS_fnc_invRemove);
|
||||
if (_removed == _qty_in) then {
|
||||
|
||||
// Continue with trade.
|
||||
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
|
||||
publicVariableServer "dayzTradeObject";
|
||||
|
||||
waitUntil {!isNil "dayzTradeResult"};
|
||||
|
||||
if(dayzTradeResult == "PASS") then {
|
||||
|
||||
// total of all parts
|
||||
_total_parts_out = _total_parts_out + _qty_out;
|
||||
|
||||
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
||||
|
||||
} else {
|
||||
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
|
||||
_abort = true;
|
||||
|
||||
// Return items taken
|
||||
for "_x" from 1 to _removed do {
|
||||
player addMagazine _part_in;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
dayzTradeResult = nil;
|
||||
|
||||
} else {
|
||||
|
||||
// Return items from botched trade.
|
||||
// TODO: this may never happen if so remove
|
||||
for "_x" from 1 to _removed do {
|
||||
player addMagazine _part_in;
|
||||
};
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
} else {
|
||||
_needed = _qty_in - _qty;
|
||||
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
|
||||
};
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
|
||||
if(_abort) exitWith {};
|
||||
};
|
||||
|
||||
// pay out
|
||||
if(_total_parts_out >= 1) then {
|
||||
|
||||
diag_log format["DEBUG TRADE #: %1", _total_parts_out];
|
||||
|
||||
if(_bos == 1) then {
|
||||
//convert currency trades into next bar
|
||||
// 10 ItemCopperBar > ItemCopperBar10oz
|
||||
// 3 ItemCopperBar10oz > ItemSilverBar
|
||||
// 10 ItemSilverBar > ItemSilverBar10oz
|
||||
// 3 ItemSilverBar10oz > ItemGoldBar
|
||||
// 10 ItemGoldBar > ItemGoldBar10oz
|
||||
|
||||
_next_highest_bar = "NA";
|
||||
_third_highest_bar = "NA";
|
||||
_next_highest_conv = 10000;
|
||||
_third_highest_conv = 10000;
|
||||
|
||||
switch(true)do{
|
||||
case (_part_out == "ItemCopperBar"): {
|
||||
_next_highest_bar = "ItemCopperBar10oz";
|
||||
_third_highest_bar = "ItemSilverBar";
|
||||
_next_highest_conv = 10;
|
||||
_third_highest_conv = 3;
|
||||
};
|
||||
case (_part_out == "ItemCopperBar10oz"): {
|
||||
_next_highest_bar = "ItemSilverBar";
|
||||
_third_highest_bar = "ItemSilverBar10oz";
|
||||
_next_highest_conv = 3;
|
||||
_third_highest_conv = 10;
|
||||
};
|
||||
case (_part_out == "ItemSilverBar"): {
|
||||
_next_highest_bar = "ItemSilverBar10oz";
|
||||
_third_highest_bar = "ItemGoldBar";
|
||||
_next_highest_conv = 10;
|
||||
_third_highest_conv = 3;
|
||||
};
|
||||
case (_part_out == "ItemSilverBar10oz"): {
|
||||
_next_highest_bar = "ItemGoldBar";
|
||||
_third_highest_bar = "ItemGoldBar10oz";
|
||||
_next_highest_conv = 3;
|
||||
_third_highest_conv = 10;
|
||||
};
|
||||
case (_part_out == "ItemGoldBar"): {
|
||||
_next_highest_bar = "ItemGoldBar10oz";
|
||||
_third_highest_bar = "NA";
|
||||
_next_highest_conv = 10;
|
||||
_third_highest_conv = 10000;
|
||||
};
|
||||
};
|
||||
|
||||
diag_log format["DEBUG TRADE part: %1 next: %2", _part_out,_next_highest_bar];
|
||||
|
||||
if(_total_parts_out >= _next_highest_conv) then {
|
||||
_next_parts_out_raw = _total_parts_out / _next_highest_conv;
|
||||
|
||||
// whole parts
|
||||
_next_parts_out = floor(_next_parts_out_raw);
|
||||
|
||||
diag_log format["DEBUG TRADE next whole parts: %1 part: %2", _next_parts_out,_next_highest_bar];
|
||||
|
||||
// find any whole remains
|
||||
_remainder = floor((_next_parts_out_raw - _next_parts_out) * _next_highest_conv);
|
||||
|
||||
diag_log format["DEBUG TRADE remainder parts: %1 part: %2", _remainder,_part_out];
|
||||
|
||||
for "_x" from 1 to _remainder do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
|
||||
// Find if needs further conversion
|
||||
if (_next_parts_out >= _third_highest_conv) then {
|
||||
|
||||
_third_parts_out_raw = _next_parts_out / _third_highest_conv;
|
||||
|
||||
// whole parts
|
||||
_third_parts_out = floor(_third_parts_out_raw);
|
||||
|
||||
diag_log format["DEBUG TRADE third whole parts: %1 part: %2", _third_parts_out,_third_highest_bar];
|
||||
|
||||
for "_x" from 1 to _third_parts_out do {
|
||||
player addMagazine _third_highest_bar;
|
||||
};
|
||||
|
||||
// find any whole remains
|
||||
_remainder = floor((_third_parts_out_raw - _third_parts_out) * _third_highest_conv);
|
||||
|
||||
diag_log format["DEBUG TRADE remainder parts: %1 part: %2", _remainder,_next_highest_bar];
|
||||
|
||||
for "_x" from 1 to _remainder do {
|
||||
player addMagazine _next_highest_bar;
|
||||
};
|
||||
|
||||
} else {
|
||||
|
||||
diag_log format["DEBUG TRADE next parts: %1 part: %2", _next_parts_out,_next_highest_bar];
|
||||
|
||||
for "_x" from 1 to _next_parts_out do {
|
||||
player addMagazine _next_highest_bar;
|
||||
};
|
||||
};
|
||||
|
||||
} else {
|
||||
|
||||
diag_log "DEBUG TRADE SELLING NORMALLY";
|
||||
|
||||
for "_x" from 1 to _total_parts_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
};
|
||||
|
||||
} else {
|
||||
|
||||
diag_log "DEBUG TRADE BUYING";
|
||||
|
||||
for "_x" from 1 to _total_parts_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,110 @@
|
||||
private ["_part_out","_part_in","_qty_out","_qty_in","_textPartIn","_textPartOut","_qty","_needed","_started","_finished","_animState","_isMedic","_abort","_removed","_tradeCounter","_total_trades"];
|
||||
// [part_out,part_in, qty_out, qty_in,];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
//_activatingPlayer = _this select 1;
|
||||
|
||||
_part_out = (_this select 3) select 0;
|
||||
_part_in = (_this select 3) select 1;
|
||||
_qty_out = (_this select 3) select 2;
|
||||
_qty_in = (_this select 3) select 3;
|
||||
// _buy_o_sell = (_this select 3) select 4;
|
||||
_textPartIn = (_this select 3) select 5;
|
||||
_textPartOut = (_this select 3) select 6;
|
||||
//_traderID = (_this select 3) select 7;
|
||||
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
|
||||
// find total number of possible trades
|
||||
_total_trades = floor (_qty / _qty_in);
|
||||
|
||||
if(_total_trades < 1) exitWith {
|
||||
_needed = _qty_in - _qty;
|
||||
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
|
||||
TradeInprogress = false;
|
||||
};
|
||||
|
||||
_abort = false;
|
||||
_tradeCounter = 0;
|
||||
|
||||
// trade all items
|
||||
for "_x" from 1 to _total_trades do {
|
||||
|
||||
_removed = 0;
|
||||
|
||||
_tradeCounter = _tradeCounter + 1;
|
||||
|
||||
if(_total_trades == 1) then {
|
||||
cutText [format[("Starting trade, stand still to complete trade."),_tradeCounter,_total_trades] , "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [format[("Starting trade, stand still to complete trade %1 of %2."),_tradeCounter,_total_trades] , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
player playActionNow "Medic";
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled Trade." , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
if (_qty >= _qty_in) then {
|
||||
|
||||
_removed = _removed + ([player,_part_in,_qty_in] call BIS_fnc_invRemove);
|
||||
if (_removed == _qty_in) then {
|
||||
|
||||
for "_x" from 1 to _qty_out do {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
||||
|
||||
} else {
|
||||
|
||||
// Return items from botched trade.
|
||||
for "_x" from 1 to _removed do {
|
||||
player addMagazine _part_in;
|
||||
};
|
||||
_abort = true;
|
||||
};
|
||||
|
||||
} else {
|
||||
_needed = _qty_in - _qty;
|
||||
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
sleep 1;
|
||||
|
||||
if(_abort) exitWith {};
|
||||
};
|
||||
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,36 @@
|
||||
private ["_buy","_metals_conversion","_cancel"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
||||
s_player_parts_crtl = 1;
|
||||
|
||||
_metals_conversion = [
|
||||
|
||||
["ItemTinBar","ItemAluminumBar",1,2,"buy","Aluminum","Tin",108],
|
||||
["ItemAluminumBar","ItemTinBar",2,1,"buy","Tin","Aluminum",107],
|
||||
|
||||
["ItemCopperBar","ItemTinBar",1,2,"buy","Tin","Copper",106],
|
||||
["ItemTinBar","ItemCopperBar",2,1,"buy","Copper","Tin",105],
|
||||
|
||||
["ItemSilverBar","ItemCopperBar10oz",1,3,"buy","10oz Copper","Silver",104],
|
||||
["ItemCopperBar10oz","ItemSilverBar",3,1,"buy","Silver","10oz Copper",103],
|
||||
|
||||
["ItemGoldBar","ItemSilverBar10oz",1,3,"buy","10oz Silver","Gold",102],
|
||||
["ItemSilverBar10oz","ItemGoldBar",3,1,"buy","Gold","10oz Silver",101]
|
||||
|
||||
];
|
||||
|
||||
// Static Menu
|
||||
{
|
||||
diag_log format["DEBUG TRADER: %1", _x];
|
||||
_buy = player addAction [format["Trade %1 %2 for %3 %4",(_x select 3),(_x select 5),(_x select 2),(_x select 6)], "\z\addons\dayz_code\actions\trade_items_wo_db.sqf",[(_x select 0),(_x select 1),(_x select 2),(_x select 3),(_x select 4),(_x select 5),(_x select 6)], (_x select 7), true, true, "",""];
|
||||
s_player_parts set [count s_player_parts,_buy];
|
||||
|
||||
} forEach _metals_conversion;
|
||||
|
||||
_cancel = player addAction ["Cancel", "\z\addons\dayz_code\actions\trade_cancel.sqf",["na"], 0, true, false, "",""];
|
||||
s_player_parts set [count s_player_parts,_cancel];
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,122 @@
|
||||
private ["_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_traderID","_bos","_needed","_activatingPlayer","_textPartIn","_textPartOut","_started","_finished","_animState","_isMedic"];
|
||||
// [part_out,part_in, qty_out, qty_in,"buy"];
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
_activatingPlayer = _this select 1;
|
||||
|
||||
_part_out = (_this select 3) select 0;
|
||||
_part_in = (_this select 3) select 1;
|
||||
_qty_out = (_this select 3) select 2;
|
||||
_qty_in = (_this select 3) select 3;
|
||||
_buy_o_sell = (_this select 3) select 4;
|
||||
_textPartIn = (_this select 3) select 5;
|
||||
_textPartOut = (_this select 3) select 6;
|
||||
_traderID = (_this select 3) select 7;
|
||||
_bos = 0;
|
||||
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
|
||||
} else {
|
||||
_qty = {_x == _part_in} count weapons player;
|
||||
_bos = 1;
|
||||
};
|
||||
|
||||
if (_qty >= _qty_in) then {
|
||||
|
||||
cutText ["Starting trade, stand still to complete trade.", "PLAIN DOWN"];
|
||||
|
||||
// force animation
|
||||
player playActionNow "Medic";
|
||||
|
||||
//_dis=20;
|
||||
//_sfx = "repair";
|
||||
//[player,_sfx,0,false,_dis] call dayz_zombieSpeak;
|
||||
//[player,_dis,true,(getPosATL player)] spawn player_alertZombies;
|
||||
|
||||
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 and !_isMedic) then {
|
||||
r_doLoop = false;
|
||||
_finished = true;
|
||||
};
|
||||
if (r_interrupt) then {
|
||||
r_doLoop = false;
|
||||
};
|
||||
sleep 0.1;
|
||||
};
|
||||
r_doLoop = false;
|
||||
|
||||
if (!_finished) exitWith {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
[objNull, player, rSwitchMove,""] call RE;
|
||||
player playActionNow "stop";
|
||||
};
|
||||
cutText ["Canceled Trade." , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
if (_finished) then {
|
||||
|
||||
// double check for all parts
|
||||
if(_buy_o_sell == "buy") then {
|
||||
_qty = {_x == _part_in} count magazines player;
|
||||
} else {
|
||||
_qty = {_x == _part_in} count weapons player;
|
||||
};
|
||||
|
||||
if (_qty >= _qty_in) then {
|
||||
|
||||
//["dayzTradeObject",[_activatingPlayer,_traderID,_bos]] call callRpcProcedure;
|
||||
dayzTradeObject = [_activatingPlayer,_traderID,_bos];
|
||||
publicVariableServer "dayzTradeObject";
|
||||
|
||||
waitUntil {!isNil "dayzTradeResult"};
|
||||
|
||||
diag_log format["DEBUG Complete Trade: %1", dayzTradeResult];
|
||||
|
||||
if(dayzTradeResult == "PASS") then {
|
||||
|
||||
_removed = ([player,_part_in,_qty_in] call BIS_fnc_invRemove);
|
||||
|
||||
if(_removed == _qty_in) then {
|
||||
for "_x" from 1 to _qty_out do {
|
||||
if(_buy_o_sell == "buy") then {
|
||||
player addWeapon _part_out;
|
||||
} else {
|
||||
player addMagazine _part_out;
|
||||
};
|
||||
};
|
||||
cutText [format[("Traded %1 %2 for %3 %4"),_qty_in,_textPartIn,_qty_out,_textPartOut], "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
|
||||
|
||||
{player removeAction _x} forEach s_player_parts;s_player_parts = [];
|
||||
s_player_parts_crtl = -1;
|
||||
|
||||
} else {
|
||||
cutText [format[("Insufficient Stock %1"),_textPartOut] , "PLAIN DOWN"];
|
||||
};
|
||||
dayzTradeResult = nil;
|
||||
};
|
||||
};
|
||||
|
||||
} else {
|
||||
_needed = _qty_in - _qty;
|
||||
cutText [format[("Need %1 More %2"),_needed,_textPartIn] , "PLAIN DOWN"];
|
||||
};
|
||||
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,20 @@
|
||||
private["_vehicle"];
|
||||
_vehicle = _this select 3;
|
||||
|
||||
if(TradeInprogress) exitWith { cutText ["Lock vehicle already in progress." , "PLAIN DOWN"]; };
|
||||
TradeInprogress = true;
|
||||
|
||||
{player removeAction _x} forEach s_player_lockunlock;s_player_lockunlock = [];
|
||||
s_player_lockUnlock_crtl = 1;
|
||||
|
||||
dayzLockVehicle = [_vehicle,false];
|
||||
if(player distance _vehicle < 10) then {
|
||||
if (local _vehicle) then {
|
||||
dayzLockVehicle spawn local_lockUnlock
|
||||
} else {
|
||||
publicVariable "dayzLockVehicle";
|
||||
};
|
||||
};
|
||||
|
||||
s_player_lockUnlock_crtl = -1;
|
||||
TradeInprogress = false;
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
private ["_array","_location","_dir","_classname","_weapon"];
|
||||
_array = _this select 3;
|
||||
_location = player modeltoworld [0,1,0];
|
||||
_dir = getDir player;
|
||||
_classname = _array select 0;
|
||||
removeBackpack player;
|
||||
player playActionNow "Medic";
|
||||
sleep 8;
|
||||
player removeAction r_player_action_bag;
|
||||
r_action_bag = false;
|
||||
_weapon = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
|
||||
_weapon setDir _dir;
|
||||
//_weapon setpos _location;
|
||||
player reveal _weapon;
|
||||
@@ -0,0 +1,11 @@
|
||||
private ["_buy","_number"];
|
||||
dayz_selectedVault = _this select 3;
|
||||
dayz_combination = "";
|
||||
|
||||
{player removeAction _x} forEach s_player_combi;s_player_combi = [];
|
||||
|
||||
if(!isNull dayz_selectedVault) then {
|
||||
_ok = createdialog "SafeKeyPad";
|
||||
};
|
||||
|
||||
s_player_unlockvault = -1;
|
||||
@@ -0,0 +1,15 @@
|
||||
private ["_buy","_number"];
|
||||
|
||||
// start combination string build
|
||||
dayz_combination = _this select 3;
|
||||
_number = 0;
|
||||
|
||||
{player removeAction _x} forEach s_player_combi;s_player_combi = [];
|
||||
|
||||
for "_x" from 1 to 10 do {
|
||||
_buy = player addAction [str(_number), "\z\addons\dayz_code\actions\vault_combination_3.sqf",str(_number), 99, true, false, "",""];
|
||||
s_player_combi set [count s_player_combi,_buy];
|
||||
_number = _number + 1;
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
private ["_buy","_number"];
|
||||
|
||||
// combine previous selections with next
|
||||
dayz_combination = format["%1%2",dayz_combination,(_this select 3)];
|
||||
_number = 0;
|
||||
|
||||
{player removeAction _x} forEach s_player_combi;s_player_combi = [];
|
||||
|
||||
for "_x" from 1 to 10 do {
|
||||
_buy = player addAction [str(_number), "\z\addons\dayz_code\actions\vault_combination_4.sqf",str(_number), 99, true, false, "",""];
|
||||
s_player_combi set [count s_player_combi,_buy];
|
||||
_number = _number + 1;
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
private ["_buy","_number"];
|
||||
|
||||
// combine previous selections with next
|
||||
dayz_combination = format["%1%2",dayz_combination,(_this select 3)];
|
||||
_number = 0;
|
||||
|
||||
{player removeAction _x} forEach s_player_combi;s_player_combi = [];
|
||||
|
||||
for "_x" from 1 to 10 do {
|
||||
_buy = player addAction [str(_number), "\z\addons\dayz_code\actions\vault_combination_final.sqf",str(_number), 99, true, false, "",""];
|
||||
s_player_combi set [count s_player_combi,_buy];
|
||||
_number = _number + 1;
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
private [];
|
||||
// set final combination to player
|
||||
dayz_combination = format["%1%2",dayz_combination,(_this select 3)];
|
||||
{player removeAction _x} forEach s_player_combi;s_player_combi = [];
|
||||
s_player_unlockvault = -1;
|
||||
// Run unlock on vault
|
||||
if(!isNull dayz_selectedVault and (typeOf dayz_selectedVault) == "VaultStorageLocked") then {
|
||||
dayz_selectedVault spawn player_unlockVault;
|
||||
dayz_selectedVault = objNull;
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
private ["_obj"];
|
||||
_obj = _this select 3;
|
||||
_obj spawn player_unlockVault;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user