diff --git a/SQF/dayz_code/Configs/CfgExtra/snappoints.hpp b/SQF/dayz_code/Configs/CfgExtra/snappoints.hpp index e6caffb4d..1d6eceaca 100644 --- a/SQF/dayz_code/Configs/CfgExtra/snappoints.hpp +++ b/SQF/dayz_code/Configs/CfgExtra/snappoints.hpp @@ -15,9 +15,11 @@ class SnapBuilding { "WoodFloorQuarter_DZ", "WoodFloorHalf_DZ", "WoodFloor_DZ", + "WoodTriangleFloor_DZ", "WoodFloorStairs_DZ", "WoodStairs_DZ", "WoodStairsSans_DZ", + "WoodStairsRails_DZ", "WoodSmallWallDoor_DZ", "WoodSmallWall_DZ", "WoodSmallWallWin_DZ", @@ -27,6 +29,7 @@ class SnapBuilding { "Land_DZE_LargeWoodDoor", "WoodLargeWallWin_DZ", "WoodLargeWallDoor_DZ", + "WoodTriangleWall_DZ", "Land_DZE_GarageWoodDoor", "Land_DZE_GarageWoodDoorLocked", "Land_DZE_LargeWoodDoorLocked", @@ -219,6 +222,20 @@ class SnapBuilding { radius = 10; }; class WoodFloor_DZ: WoodFloor_Preview_DZ {}; + + class WoodTriangleFloor_DZ: FloorsWallsStairs { + points[] = { + {0,0,0,$STR_EPOCH_ACTION_SNAP_PIVOT}, + {0,-1.3,0.130,$STR_EPOCH_ACTION_SNAP_BACK}, + {0,1.3,0.130,$STR_EPOCH_ACTION_SNAP_FRONT}, + {-1.3,0,0.130,$STR_EPOCH_ACTION_SNAP_LEFT}, + {1.3,0,0.130,$STR_EPOCH_ACTION_SNAP_RIGHT} + }; + radius = 10; + }; + + class WoodTriangleFloor_Preview_DZ: WoodTriangleFloor_DZ {}; + class WoodFloorStairs_DZ: FloorsWallsStairs { points[] = { {0,0,0,$STR_EPOCH_ACTION_SNAP_PIVOT}, @@ -228,21 +245,22 @@ class SnapBuilding { {2.48,0,3.14,$STR_EPOCH_ACTION_SNAP_RIGHT} }; }; - class Wood_Floor_Stairs_Preview_DZ: WoodFloorStairs_DZ {}; + class Wood_Floor_Stairs_Preview_DZ: WoodFloorStairs_DZ {}; class Stairs_DZE: FloorsWallsStairs { points[] = { - {0,0,0,$STR_EPOCH_ACTION_SNAP_PIVOT}, - {1.56055,-0.78,1.5,$STR_EPOCH_ACTION_SNAP_BACK}, - {1.56055,0.78,1.5,$STR_EPOCH_ACTION_SNAP_FRONT}, - {1.73926,0.05,2.9,$STR_EPOCH_ACTION_SNAP_TOP}, - {-1.73926,0.05,0,$STR_EPOCH_ACTION_SNAP_BOTTOM} + {0,0,0,$STR_EPOCH_ACTION_SNAP_BOTTOM}, + {0,3.65,3,$STR_EPOCH_ACTION_SNAP_FRONT}, + {0,1.8,0,$STR_EPOCH_ACTION_SNAP_BOTTOM}, + {-0.81,1.8,1.5,$STR_EPOCH_ACTION_SNAP_LEFT}, + {0.78,1.8,1.5,$STR_EPOCH_ACTION_SNAP_RIGHT} }; }; class WoodStairs_DZ: Stairs_DZE {}; class WoodStairs_Preview_DZ: Stairs_DZE {}; class WoodStairsSans_Preview_DZ: Stairs_DZE {}; class WoodStairsSans_DZ: Stairs_DZE {}; + class WoodStairsRails_DZ: Stairs_DZE {}; class WoodSmall_DZE: FloorsWallsStairs { // Small wood walls points[] = { @@ -286,6 +304,18 @@ class SnapBuilding { }; }; + class WoodTriangleWall_DZ: FloorsWallsStairs { + points[] = { + {0,0,0,$STR_EPOCH_ACTION_SNAP_PIVOT}, + {0,0,2.62,$STR_EPOCH_ACTION_SNAP_TOP}, + {-1.12,0,1.5,$STR_EPOCH_ACTION_SNAP_LEFT}, + {1.12,0,1.5,$STR_EPOCH_ACTION_SNAP_RIGHT} + }; + radius = 10; + }; + + class Wood_Triangle_Wall_Preview_DZ: WoodTriangleFloor_DZ {}; + class WoodSmallWallThird_DZ: WoodSmallWallThird_Preview_DZ{}; class WoodLargeWall_DZ: WoodLarge_DZE {}; class Land_DZE_LargeWoodDoor: WoodLarge_DZE {}; diff --git a/SQF/dayz_code/Configs/CfgLoot/CfgLoot.hpp b/SQF/dayz_code/Configs/CfgLoot/CfgLoot.hpp index ee39260c7..dd8e57c12 100644 --- a/SQF/dayz_code/Configs/CfgLoot/CfgLoot.hpp +++ b/SQF/dayz_code/Configs/CfgLoot/CfgLoot.hpp @@ -57,6 +57,8 @@ class CfgLoot #include "Groups\Zombies\Apo.hpp" //DZE #include "Groups\Zombies\DrugDealer.hpp" //DZE #include "Groups\Zombies\Prisoner.hpp" //DZE + #include "Groups\Zombies\Hero.hpp" //DZE + #include "Groups\Zombies\Bandit.hpp" //DZE }; class Buildings diff --git a/SQF/dayz_code/Configs/CfgLoot/Groups/Clothes.hpp b/SQF/dayz_code/Configs/CfgLoot/Groups/Clothes.hpp index 2711f8db0..6cc0db993 100644 --- a/SQF/dayz_code/Configs/CfgLoot/Groups/Clothes.hpp +++ b/SQF/dayz_code/Configs/CfgLoot/Groups/Clothes.hpp @@ -1,6 +1,9 @@ clothes[] = { {Loot_MAGAZINE, 1, Skin_Bandit1_DZ}, {Loot_MAGAZINE, 1, Skin_Bandit2_DZ}, + {Loot_MAGAZINE, 1, Skin_Bandit3_DZ}, + {Loot_MAGAZINE, 1, Skin_Bandit4_DZ}, + {Loot_MAGAZINE, 1, Skin_Bandit5_DZ}, {Loot_MAGAZINE, 1, Skin_BanditW1_DZ}, {Loot_MAGAZINE, 1, Skin_BanditW2_DZ}, {Loot_MAGAZINE, 1, Skin_SurvivorWcombat_DZ}, @@ -211,6 +214,8 @@ militaryclothes[] = { {Loot_MAGAZINE, 1, Skin_Ins_Soldier_GL_DZ}, {Loot_MAGAZINE, 1, Skin_GUE_Commander_DZ}, {Loot_MAGAZINE, 1, Skin_TK_INS_Soldier_EP1_DZ}, + {Loot_MAGAZINE, 1, Skin_TK_INS_Soldier_EP2_DZ}, + {Loot_MAGAZINE, 1, Skin_TK_INS_Soldier_EP3_DZ}, {Loot_MAGAZINE, 1, Skin_TK_INS_Warlord_EP1_DZ}, {Loot_MAGAZINE, 1, Skin_GUE_Soldier_MG_DZ}, {Loot_MAGAZINE, 1, Skin_GUE_Soldier_Crew_DZ}, diff --git a/SQF/dayz_code/Configs/CfgLoot/Groups/Zombies/Bandit.hpp b/SQF/dayz_code/Configs/CfgLoot/Groups/Zombies/Bandit.hpp new file mode 100644 index 000000000..59ffbf50e --- /dev/null +++ b/SQF/dayz_code/Configs/CfgLoot/Groups/Zombies/Bandit.hpp @@ -0,0 +1,14 @@ +ZombieBandit[] = +{ + {Loot_MAGAZINE, 5, FoodMRE}, + {Loot_MAGAZINE, 1, ItemHotwireKit}, + {Loot_GROUP, 3, MedicalLow}, + {Loot_GROUP, 10, AmmoMilitaryZed}, + {Loot_GROUP, 2, Consumable} +}; + +ZombieBanditViral[] = +{ + {Loot_GROUP, 10, ZombieMilitary}, + {Loot_MAGAZINE, 1, ItemAntibiotic1} +}; diff --git a/SQF/dayz_code/Configs/CfgLoot/Groups/Zombies/Hero.hpp b/SQF/dayz_code/Configs/CfgLoot/Groups/Zombies/Hero.hpp new file mode 100644 index 000000000..22bccb661 --- /dev/null +++ b/SQF/dayz_code/Configs/CfgLoot/Groups/Zombies/Hero.hpp @@ -0,0 +1,14 @@ +ZombieHero[] = +{ + {Loot_MAGAZINE, 5, FoodMRE}, + {Loot_MAGAZINE, 1, ItemHotwireKit}, + {Loot_GROUP, 3, MedicalLow}, + {Loot_GROUP, 10, AmmoMilitaryZed}, + {Loot_GROUP, 2, Consumable} +}; + +ZombieHeroViral[] = +{ + {Loot_GROUP, 10, ZombieMilitary}, + {Loot_MAGAZINE, 1, ItemAntibiotic1} +}; diff --git a/SQF/dayz_code/Configs/CfgMagazines/Clothing/EpochSkins.hpp b/SQF/dayz_code/Configs/CfgMagazines/Clothing/EpochSkins.hpp index b5f863779..730e88fa7 100644 --- a/SQF/dayz_code/Configs/CfgMagazines/Clothing/EpochSkins.hpp +++ b/SQF/dayz_code/Configs/CfgMagazines/Clothing/EpochSkins.hpp @@ -119,8 +119,8 @@ class Skin_Rocker4_DZ: SkinBase { }; class Skin_Bandit1_DZ: SkinBase { scope = 2; - displayName = $STR_EPOCH_SKINS_BANDITOUTFIT; - descriptionShort = $STR_EPOCH_SKINS_BANDITOUTFIT; + displayName = $STR_EPOCH_SKINS_BANDITOUTFIT1; + descriptionShort = $STR_EPOCH_SKINS_BANDITOUTFIT1; sex = "male"; playerModel = "Bandit1_DZ"; }; @@ -131,6 +131,27 @@ class Skin_Bandit2_DZ: SkinBase { sex = "male"; playerModel = "Bandit2_DZ"; }; +class Skin_Bandit3_DZ: SkinBase { + scope = 2; + displayName = $STR_EPOCH_SKINS_BANDITOUTFIT2; + descriptionShort = $STR_EPOCH_SKINS_BANDITOUTFIT2; + sex = "male"; + playerModel = "Bandit3_DZ"; +}; +class Skin_Bandit4_DZ: SkinBase { + scope = 2; + displayName = $STR_EPOCH_SKINS_BANDITOUTFIT3; + descriptionShort = $STR_EPOCH_SKINS_BANDITOUTFIT3; + sex = "male"; + playerModel = "Bandit4_DZ"; +}; +class Skin_Bandit5_DZ: SkinBase { + scope = 2; + displayName = $STR_EPOCH_SKINS_BANDITOUTFIT4; + descriptionShort = $STR_EPOCH_SKINS_BANDITOUTFIT4; + sex = "male"; + playerModel = "Bandit5_DZ"; +}; class Skin_GUE_Soldier_MG_DZ: SkinBase { scope = 2; displayName = $STR_EPOCH_SKINS_BANDITGUNNER; @@ -238,11 +259,25 @@ class Skin_TK_INS_Warlord_EP1_DZ: SkinBase { }; class Skin_TK_INS_Soldier_EP1_DZ: SkinBase { scope = 2; - displayName = $STR_EPOCH_SKINS_TAKISTANISOLDIER; - descriptionShort = $STR_EPOCH_SKINS_TAKISTANISOLDIER; + displayName = $STR_EPOCH_SKINS_TAKISTANISOLDIER1; + descriptionShort = $STR_EPOCH_SKINS_TAKISTANISOLDIER1; sex = "male"; playerModel = "TK_INS_Soldier_EP1_DZ"; }; +class Skin_TK_INS_Soldier_EP2_DZ: SkinBase { + scope = 2; + displayName = $STR_EPOCH_SKINS_TAKISTANISOLDIER2; + descriptionShort = $STR_EPOCH_SKINS_TAKISTANISOLDIER2; + sex = "male"; + playerModel = "TK_INS_Soldier_EP2_DZ"; +}; +class Skin_TK_INS_Soldier_EP3_DZ: SkinBase { + scope = 2; + displayName = $STR_EPOCH_SKINS_TAKISTANISOLDIER3; + descriptionShort = $STR_EPOCH_SKINS_TAKISTANISOLDIER3; + sex = "male"; + playerModel = "TK_INS_Soldier_EP3_DZ"; +}; class Skin_CZ_Special_Forces_GL_DES_EP1_DZ: SkinBase { scope = 2; displayName = $STR_EPOCH_SKINS_SPECIALFORCES; @@ -294,8 +329,8 @@ class Skin_Graves_Light_DZ: SkinBase { }; class Skin_Soldier_Sniper_PMC_DZ: SkinBase { scope = 2; - displayName = $STR_EPOCH_SKINS_MARKSMAN; - descriptionShort = $STR_EPOCH_SKINS_MARKSMAN; + displayName = $STR_EPOCH_SKINS_HERO; + descriptionShort = $STR_EPOCH_SKINS_HERO; sex = "male"; playerModel = "Soldier_Sniper_PMC_DZ"; }; diff --git a/SQF/dayz_code/Configs/CfgMagazines/Items/Misc.hpp b/SQF/dayz_code/Configs/CfgMagazines/Items/Misc.hpp index 8ee86ee6d..72caa637d 100644 --- a/SQF/dayz_code/Configs/CfgMagazines/Items/Misc.hpp +++ b/SQF/dayz_code/Configs/CfgMagazines/Items/Misc.hpp @@ -240,7 +240,7 @@ class ItemSuitcaseBomb : CA_Magazine type = 256; }; -class ItemPlasicParts : CA_Magazine +class ItemPlasticParts : CA_Magazine { scope = 2; count = 1; diff --git a/SQF/dayz_code/Configs/CfgServerTrader/Category/Bandit.hpp b/SQF/dayz_code/Configs/CfgServerTrader/Category/Bandit.hpp index 683d50370..0e891efd7 100644 --- a/SQF/dayz_code/Configs/CfgServerTrader/Category/Bandit.hpp +++ b/SQF/dayz_code/Configs/CfgServerTrader/Category/Bandit.hpp @@ -223,6 +223,9 @@ class Category_10 { class Skin_CamoWinter2W_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; class Skin_Bandit1_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; class Skin_Bandit2_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; + class Skin_Bandit3_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; + class Skin_Bandit4_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; + class Skin_Bandit5_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; class Skin_BanditW1_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; class Skin_BanditW2_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; class Skin_GUE_Commander_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; @@ -237,6 +240,8 @@ class Category_10 { class Skin_GUE_Soldier_Crew_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; class Skin_Ins_Soldier_GL_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; class Skin_TK_INS_Soldier_EP1_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; + class Skin_TK_INS_Soldier_EP2_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; + class Skin_TK_INS_Soldier_EP3_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; class Skin_TK_INS_Warlord_EP1_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; class Skin_RU_Soldier_Crew_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; class Skin_TK_INS_Soldier_AR_EP1_DZ {type = "trade_items";buy[] = {2,"ItemGoldBar"};sell[] = {1,"ItemGoldBar"};}; diff --git a/SQF/dayz_code/Configs/CfgServerTrader/Category/Hero.hpp b/SQF/dayz_code/Configs/CfgServerTrader/Category/Hero.hpp index a82836976..bf3e81c65 100644 --- a/SQF/dayz_code/Configs/CfgServerTrader/Category/Hero.hpp +++ b/SQF/dayz_code/Configs/CfgServerTrader/Category/Hero.hpp @@ -382,6 +382,9 @@ class Category_5 { //Bandit Skins sell only class Skin_Bandit1_DZ {type = "trade_items";buy[] = {-2,"ItemGoldBar"};sell[] = {7,"ItemSilverBar10oz"};}; class Skin_Bandit2_DZ {type = "trade_items";buy[] = {-2,"ItemGoldBar"};sell[] = {7,"ItemSilverBar10oz"};}; + class Skin_Bandit3_DZ {type = "trade_items";buy[] = {-2,"ItemGoldBar"};sell[] = {7,"ItemSilverBar10oz"};}; + class Skin_Bandit4_DZ {type = "trade_items";buy[] = {-2,"ItemGoldBar"};sell[] = {7,"ItemSilverBar10oz"};}; + class Skin_Bandit5_DZ {type = "trade_items";buy[] = {-2,"ItemGoldBar"};sell[] = {7,"ItemSilverBar10oz"};}; class Skin_BanditW1_DZ {type = "trade_items";buy[] = {-2,"ItemGoldBar"};sell[] = {7,"ItemSilverBar10oz"};}; class Skin_BanditW2_DZ {type = "trade_items";buy[] = {-2,"ItemGoldBar"};sell[] = {7,"ItemSilverBar10oz"};}; class Skin_GUE_Commander_DZ {type = "trade_items";buy[] = {-2,"ItemGoldBar"};sell[] = {7,"ItemSilverBar10oz"};}; @@ -392,6 +395,8 @@ class Category_5 { class Skin_SniperBanditW_DZ {type = "trade_items";buy[] = {-2,"ItemGoldBar"};sell[] = {7,"ItemSilverBar10oz"};}; class Skin_Ins_Soldier_GL_DZ {type = "trade_items";buy[] = {-2,"ItemGoldBar"};sell[] = {7,"ItemSilverBar10oz"};}; class Skin_TK_INS_Soldier_EP1_DZ {type = "trade_items";buy[] = {-2,"ItemGoldBar"};sell[] = {7,"ItemSilverBar10oz"};}; + class Skin_TK_INS_Soldier_EP2_DZ {type = "trade_items";buy[] = {-2,"ItemGoldBar"};sell[] = {7,"ItemSilverBar10oz"};}; + class Skin_TK_INS_Soldier_EP3_DZ {type = "trade_items";buy[] = {-2,"ItemGoldBar"};sell[] = {7,"ItemSilverBar10oz"};}; class Skin_TK_INS_Warlord_EP1_DZ {type = "trade_items";buy[] = {-2,"ItemGoldBar"};sell[] = {7,"ItemSilverBar10oz"};}; class Skin_RU_Soldier_Crew_DZ {type = "trade_items";buy[] = {-2,"ItemGoldBar"};sell[] = {7,"ItemSilverBar10oz"};}; class Skin_TK_INS_Soldier_AR_EP1_DZ {type = "trade_items";buy[] = {-2,"ItemGoldBar"};sell[] = {7,"ItemSilverBar10oz"};}; diff --git a/SQF/dayz_code/Configs/CfgServerTraderZSC/Category/Bandit.hpp b/SQF/dayz_code/Configs/CfgServerTraderZSC/Category/Bandit.hpp index ca7cf1ecf..2bfd47cd8 100644 --- a/SQF/dayz_code/Configs/CfgServerTraderZSC/Category/Bandit.hpp +++ b/SQF/dayz_code/Configs/CfgServerTraderZSC/Category/Bandit.hpp @@ -223,6 +223,9 @@ class Category_10 { class Skin_CamoWinter2W_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; class Skin_Bandit1_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; class Skin_Bandit2_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; + class Skin_Bandit3_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; + class Skin_Bandit4_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; + class Skin_Bandit5_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; class Skin_BanditW1_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; class Skin_BanditW2_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; class Skin_GUE_Commander_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; @@ -237,6 +240,8 @@ class Category_10 { class Skin_GUE_Soldier_Crew_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; class Skin_Ins_Soldier_GL_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; class Skin_TK_INS_Soldier_EP1_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; + class Skin_TK_INS_Soldier_EP2_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; + class Skin_TK_INS_Soldier_EP3_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; class Skin_TK_INS_Warlord_EP1_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; class Skin_RU_Soldier_Crew_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; class Skin_TK_INS_Soldier_AR_EP1_DZ {type = "trade_items";buy[] = {200,"worth"};sell[] = {100,"worth"};}; diff --git a/SQF/dayz_code/Configs/CfgServerTraderZSC/Category/Hero.hpp b/SQF/dayz_code/Configs/CfgServerTraderZSC/Category/Hero.hpp index ef0944398..90b9608c9 100644 --- a/SQF/dayz_code/Configs/CfgServerTraderZSC/Category/Hero.hpp +++ b/SQF/dayz_code/Configs/CfgServerTraderZSC/Category/Hero.hpp @@ -382,6 +382,9 @@ class Category_5 { //Bandit Skins sell only class Skin_Bandit1_DZ {type = "trade_items";buy[] = {-1,"worth"};sell[] = {70,"worth"};}; class Skin_Bandit2_DZ {type = "trade_items";buy[] = {-1,"worth"};sell[] = {70,"worth"};}; + class Skin_Bandit3_DZ {type = "trade_items";buy[] = {-1,"worth"};sell[] = {70,"worth"};}; + class Skin_Bandit4_DZ {type = "trade_items";buy[] = {-1,"worth"};sell[] = {70,"worth"};}; + class Skin_Bandit5_DZ {type = "trade_items";buy[] = {-1,"worth"};sell[] = {70,"worth"};}; class Skin_BanditW1_DZ {type = "trade_items";buy[] = {-1,"worth"};sell[] = {70,"worth"};}; class Skin_BanditW2_DZ {type = "trade_items";buy[] = {-1,"worth"};sell[] = {70,"worth"};}; class Skin_GUE_Commander_DZ {type = "trade_items";buy[] = {-1,"worth"};sell[] = {70,"worth"};}; @@ -392,6 +395,8 @@ class Category_5 { class Skin_SniperBanditW_DZ {type = "trade_items";buy[] = {-1,"worth"};sell[] = {70,"worth"};}; class Skin_Ins_Soldier_GL_DZ {type = "trade_items";buy[] = {-1,"worth"};sell[] = {70,"worth"};}; class Skin_TK_INS_Soldier_EP1_DZ {type = "trade_items";buy[] = {-1,"worth"};sell[] = {70,"worth"};}; + class Skin_TK_INS_Soldier_EP2_DZ {type = "trade_items";buy[] = {-1,"worth"};sell[] = {70,"worth"};}; + class Skin_TK_INS_Soldier_EP3_DZ {type = "trade_items";buy[] = {-1,"worth"};sell[] = {70,"worth"};}; class Skin_TK_INS_Warlord_EP1_DZ {type = "trade_items";buy[] = {-1,"worth"};sell[] = {70,"worth"};}; class Skin_RU_Soldier_Crew_DZ {type = "trade_items";buy[] = {-1,"worth"};sell[] = {70,"worth"};}; class Skin_TK_INS_Soldier_AR_EP1_DZ {type = "trade_items";buy[] = {-1,"worth"};sell[] = {70,"worth"};}; diff --git a/SQF/dayz_code/Configs/CfgVehicles/Buildables/Bridges.hpp b/SQF/dayz_code/Configs/CfgVehicles/Buildables/Bridges.hpp index 414f5b234..7b0394826 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Buildables/Bridges.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Buildables/Bridges.hpp @@ -36,6 +36,32 @@ class Metal_Drawbridge_DZ: CinderWallDoor_DZ_Base statement = "this animate [""Open_inner"", 0];this animate [""Open_outer"", 0];"; }; }; + class DestructionEffects { + class Sound { + simulation = "sound"; + type = "DestrHouse"; + position = "destructionEffect1"; + intensity = 1; + interval = 1; + lifeTime = 0.05; + }; + class DestroyPhase1 { + simulation = "destroy"; + type = "DelayedDestruction"; + lifeTime = 2.5; + position = ""; + intensity = 1; + interval = 1; + }; + class DamageAround1 { + simulation = "damageAround"; + type = "DamageAroundHouse"; + position = ""; + intensity = 0.1; + interval = 1; + lifeTime = 1; + }; + }; }; class Metal_DrawbridgeLocked_DZ: CinderWallDoorLocked_DZ_Base { @@ -102,4 +128,30 @@ class Metal_DrawbridgeLocked_DZ: CinderWallDoorLocked_DZ_Base statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; }; }; + class DestructionEffects { + class Sound { + simulation = "sound"; + type = "DestrHouse"; + position = "destructionEffect1"; + intensity = 1; + interval = 1; + lifeTime = 0.05; + }; + class DestroyPhase1 { + simulation = "destroy"; + type = "DelayedDestruction"; + lifeTime = 2.5; + position = ""; + intensity = 1; + interval = 1; + }; + class DamageAround1 { + simulation = "damageAround"; + type = "DamageAroundHouse"; + position = ""; + intensity = 0.1; + interval = 1; + lifeTime = 1; + }; + }; }; \ No newline at end of file diff --git a/SQF/dayz_code/Configs/CfgVehicles/Buildables/Doors.hpp b/SQF/dayz_code/Configs/CfgVehicles/Buildables/Doors.hpp index f1b36f2af..a78a18b76 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Buildables/Doors.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Buildables/Doors.hpp @@ -504,6 +504,16 @@ class Land_DZE_WoodGate: Land_DZE_WoodDoor_Base { statement = "this animate [""Open_door"", 0];this animate [""Open_doorR"", 0];"; }; }; + class DestructionEffects : DestructionEffects { + class Ruin1 { + simulation = "ruin"; + type = "\z\addons\dayz_epoch\models\wood_wreck_third.p3d"; + position = ""; + intensity = 1; + interval = 1; + lifeTime = 1; + }; + }; }; class Land_DZE_WoodGateLocked: Land_DZE_WoodDoorLocked_Base { @@ -570,6 +580,16 @@ class Land_DZE_WoodGateLocked: Land_DZE_WoodDoorLocked_Base { statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; }; }; + class DestructionEffects : DestructionEffects { + class Ruin1 { + simulation = "ruin"; + type = "\z\addons\dayz_epoch\models\wood_wreck_third.p3d"; + position = ""; + intensity = 1; + interval = 1; + lifeTime = 1; + }; + }; }; class Land_DZE_WoodOpenTopGarageDoor: Land_DZE_WoodDoor_Base { @@ -611,6 +631,16 @@ class Land_DZE_WoodOpenTopGarageDoor: Land_DZE_WoodDoor_Base { statement = "this animate [""doorl"", 0];this animate [""doorR"", 0];"; }; }; + class DestructionEffects : DestructionEffects { + class Ruin1 { + simulation = "ruin"; + type = "\z\addons\dayz_epoch\models\wood_wreck_third.p3d"; + position = ""; + intensity = 1; + interval = 1; + lifeTime = 1; + }; + }; }; class Land_DZE_WoodOpenTopGarageLocked: Land_DZE_WoodDoorLocked_Base { @@ -676,6 +706,16 @@ class Land_DZE_WoodOpenTopGarageLocked: Land_DZE_WoodDoorLocked_Base { statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; }; }; + class DestructionEffects : DestructionEffects { + class Ruin1 { + simulation = "ruin"; + type = "\z\addons\dayz_epoch\models\wood_wreck_third.p3d"; + position = ""; + intensity = 1; + interval = 1; + lifeTime = 1; + }; + }; }; class CinderWallDoorLocked_DZ: CinderWallDoorLocked_DZ_Base { @@ -1218,7 +1258,32 @@ class Door_DZ: CinderWallDoor_DZ_Base { statement = "this animate [""Open_door"", 0]"; }; }; - class DestructionEffects {}; + class DestructionEffects { + class Sound { + simulation = "sound"; + type = "DestrHouse"; + position = "destructionEffect1"; + intensity = 1; + interval = 1; + lifeTime = 0.05; + }; + class DestroyPhase1 { + simulation = "destroy"; + type = "DelayedDestruction"; + lifeTime = 2.5; + position = ""; + intensity = 1; + interval = 1; + }; + class DamageAround1 { + simulation = "damageAround"; + type = "DamageAroundHouse"; + position = ""; + intensity = 0.1; + interval = 1; + lifeTime = 1; + }; + }; }; class DoorLocked_DZ: CinderWallDoorLocked_DZ_Base { @@ -1278,7 +1343,32 @@ class DoorLocked_DZ: CinderWallDoorLocked_DZ_Base { statement = "dayz_selectedDoor = this;DZE_topCombo = 0;DZE_midCombo = 0;DZE_botCombo = 0;if(DZE_doorManagement) then {createdialog ""DoorAccess"";} else {createdialog ""ComboLockUI"";};"; }; }; - class DestructionEffects {}; + class DestructionEffects { + class Sound { + simulation = "sound"; + type = "DestrHouse"; + position = "destructionEffect1"; + intensity = 1; + interval = 1; + lifeTime = 0.05; + }; + class DestroyPhase1 { + simulation = "destroy"; + type = "DelayedDestruction"; + lifeTime = 2.5; + position = ""; + intensity = 1; + interval = 1; + }; + class DamageAround1 { + simulation = "damageAround"; + type = "DamageAroundHouse"; + position = ""; + intensity = 0.1; + interval = 1; + lifeTime = 1; + }; + }; }; /* diff --git a/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularBuild.hpp b/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularBuild.hpp index 8cb05634c..51ec95063 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularBuild.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularBuild.hpp @@ -34,6 +34,7 @@ class ModularItems: NonStrategic { }; }; +#include "ModularWrecks.hpp" #include "ModularBuildMetal.hpp" #include "ModularBuildCinder.hpp" #include "ModularBuildWood.hpp" diff --git a/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularBuildMetal.hpp b/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularBuildMetal.hpp index e27e90e90..e5f19ae32 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularBuildMetal.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularBuildMetal.hpp @@ -42,6 +42,16 @@ class MetalFloor4x_DZ: ModularItems { armor = 6000; displayName = $STR_EPOCH_METALFLOOR4x; GhostPreview = "MetalFloor4x_Preview_DZ"; + class DestructionEffects : DestructionEffects { + class Ruin1 { + simulation = "ruin"; + type = "\z\addons\dayz_epoch_v\base_building\floors\metal_floor_2x2_wreck.p3d"; + position = ""; + intensity = 1; + interval = 1; + lifeTime = 1; + }; + }; }; class DoorFrame_DZ: ModularItems { diff --git a/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularBuildWood.hpp b/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularBuildWood.hpp index a8e5524a3..6b30ef1d6 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularBuildWood.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularBuildWood.hpp @@ -26,6 +26,27 @@ class WoodFloor_DZ: ModularItems { }; }; }; + +class WoodFloorStairs_DZ: ModularItems { + scope = 2; + offset[] = {0,5,-2.5}; + model = "\z\addons\dayz_epoch_v\base_building\floors\wood_floor_stairs.p3d"; + armor = 1000; + displayName = $STR_EPOCH_WOODFLOORSTAIRS; + maintainBuilding[] = {{"PartWoodLumber",4}}; + GhostPreview = "Wood_Floor_Stairs_Preview_DZ"; + class DestructionEffects : DestructionEffects { + class Ruin1 { + simulation = "ruin"; + type = "\z\addons\dayz_epoch\models\wood_wreck_floor.p3d"; + position = ""; + intensity = 1; + interval = 1; + lifeTime = 1; + }; + }; +}; + class WoodFloorHalf_DZ: ModularItems { scope = 2; offset[] = {0,4,0}; @@ -46,6 +67,7 @@ class WoodFloorHalf_DZ: ModularItems { }; }; }; + class WoodFloorQuarter_DZ: ModularItems { scope = 2; offset[] = {0,4,0}; @@ -84,7 +106,7 @@ class WoodTriangleFloor_DZ: ModularItems { armor = 1000; displayName = $STR_EPOCH_FLOORCEILING4x; maintainBuilding[] = {{"PartWoodLumber",2}}; - GhostPreview = "WoodTriangleFloor_Preview_DZ"; + GhostPreview = "WoodTriangleFloor_Preview_DZ"; }; class WoodLargeWall_DZ: ModularItems { @@ -128,6 +150,7 @@ class WoodLargeWallDoor_DZ: ModularItems { }; }; }; + class WoodLargeWallWin_DZ: ModularItems { scope = 2; offset[] = {0,1.5,0}; @@ -168,6 +191,7 @@ class WoodSmallWall_DZ: ModularItems { }; }; }; + class WoodSmallWallThird_DZ: ModularItems { scope = 2; offset[] = {0,1.5,0}; @@ -188,6 +212,7 @@ class WoodSmallWallThird_DZ: ModularItems { }; }; }; + class WoodSmallWallWin_DZ: ModularItems { scope = 2; offset[] = {0,1.5,0}; @@ -207,6 +232,7 @@ class WoodSmallWallWin_DZ: ModularItems { }; }; }; + class WoodSmallWallDoor_DZ: ModularItems { scope = 2; offset[] = {0,1.5,0}; @@ -236,6 +262,37 @@ class WoodTriangleWall_DZ: ModularItems { displayName = $STR_EPOCH_TRIANGLE_WOODWALL; GhostPreview = "Wood_Triangle_Wall_Preview_DZ"; maintainBuilding[] = {{"PartWoodLumber",1}}; + class DestructionEffects : DestructionEffects { + class Ruin1 { + simulation = "ruin"; + type = "\z\addons\dayz_epoch\models\wood_wreck_third.p3d"; + position = ""; + intensity = 1; + interval = 1; + lifeTime = 1; + }; + }; +}; + +class WoodGateFrame_DZ: ModularItems { + scope = 2; + offset[] = {0,3,0}; + model = "\z\addons\dayz_epoch_v\base_building\wood\high_wood_garage\high_wood_garage_frame.p3d"; + armor = 2800; + displayName = $STR_EPOCH_WOODGATEFRAME; + maintainBuilding[] = {{"PartWoodLumber",4}}; + upgradeBuilding[] = {"Land_DZE_WoodGate",{"ItemToolbox","Handsaw_DZE","Hammer_DZE"},{{"PartWoodPlywood",8},{"PartWoodLumber",2},{"equip_nails",1}}}; + GhostPreview = "WoodGate_Preview_DZ"; + class DestructionEffects : DestructionEffects { + class Ruin1 { + simulation = "ruin"; + type = "\z\addons\dayz_epoch\models\wood_wreck_third.p3d"; + position = ""; + intensity = 1; + interval = 1; + lifeTime = 1; + }; + }; }; class WoodStairs_DZ: ModularItems { @@ -270,16 +327,6 @@ class WoodStairsSans_DZ: ModularItems { GhostPreview = "WoodStairsSans_Preview_DZ"; }; -class WoodFloorStairs_DZ: ModularItems { - scope = 2; - offset[] = {0,5,-2.5}; - model = "\z\addons\dayz_epoch_v\base_building\floors\wood_floor_stairs.p3d"; - armor = 1000; - displayName = $STR_EPOCH_WOODFLOORSTAIRS; - maintainBuilding[] = {{"PartWoodLumber",4}}; - GhostPreview = "Wood_Floor_Stairs_Preview_DZ"; -}; - class WoodLadder_DZ: ModularItems { scope = 2; offset[] = {0,1.5,0}; @@ -309,25 +356,4 @@ class WoodPillar_DZ: ModularItems { displayName = $STR_EPOCH_WOODPILLAR; maintainBuilding[] = {{"PartWoodLumber",1}}; GhostPreview = "Wood_Pillar_Preview_DZ"; -}; - -class WoodGateFrame_DZ: ModularItems { - scope = 2; - offset[] = {0,3,0}; - model = "\z\addons\dayz_epoch_v\base_building\wood\high_wood_garage\high_wood_garage_frame.p3d"; - armor = 2800; - displayName = $STR_EPOCH_WOODGATEFRAME; - maintainBuilding[] = {{"PartWoodLumber",4}}; - upgradeBuilding[] = {"Land_DZE_WoodGate",{"ItemToolbox","Handsaw_DZE","Hammer_DZE"},{{"PartWoodPlywood",8},{"PartWoodLumber",2},{"equip_nails",1}}}; - GhostPreview = "WoodGate_Preview_DZ"; - class DestructionEffects : DestructionEffects { - class Ruin1 { - simulation = "ruin"; - type = "\z\addons\dayz_epoch\models\wood_wreck_frame.p3d"; - position = ""; - intensity = 1; - interval = 1; - lifeTime = 1; - }; - }; }; \ No newline at end of file diff --git a/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularWrecks.hpp b/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularWrecks.hpp index 960970a64..b43542dd6 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularWrecks.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Buildables/ModularWrecks.hpp @@ -1,3 +1,6 @@ +// Note: If adding a custom wreck model make sure the p3d model name is used as the class name with the prefix Land_ +// E.g.: wood_wreck_frame.p3d = Land_ + wood_wreck_frame = Land_wood_wreck_frame + class Land_wood_wreck_frame : ruins { scope = 2; model = "\z\addons\dayz_epoch\models\wood_wreck_frame.p3d"; @@ -5,6 +8,7 @@ class Land_wood_wreck_frame : ruins { removeoutput[] = {{"PartWoodPlywood",{0,3}},{"PartWoodLumber",{0,3}}}; vehicleClass = "DayZ Epoch Buildables"; }; + class Land_wood_wreck_third : ruins { scope = 2; model = "\z\addons\dayz_epoch\models\wood_wreck_third.p3d"; @@ -44,10 +48,19 @@ class Land_wreck_cinder: ruins { removeoutput[] = {{"CinderBlocks",{0,1}}}; vehicleClass = "DayZ Epoch Buildables"; }; + class Land_wreck_metal_floor: ruins { scope = 2; model = "\z\addons\dayz_epoch\models\wreck_metal_floor.p3d"; displayName = $STR_METAL_FLOOR_WRECK; - removeoutput[] = {{"ItemPole",{0,2}},{"ItemTankTrap",{0,2}}}; + removeoutput[] = {{"ItemPole",{0,2}},{"equip_metal_sheet",{0,2}}}; + vehicleClass = "DayZ Epoch Buildables"; +}; + +class Land_metal_floor_2x2_wreck: ruins { + scope = 2; + model = "\z\addons\dayz_epoch_v\base_building\floors\metal_floor_2x2_wreck.p3d"; + displayName = $STR_METAL_FLOOR_WRECK; + removeoutput[] = {{"ItemPole",{0,4}},{"equip_metal_sheet",{0,4}}}; vehicleClass = "DayZ Epoch Buildables"; }; \ No newline at end of file diff --git a/SQF/dayz_code/Configs/CfgVehicles/CfgVehicles.hpp b/SQF/dayz_code/Configs/CfgVehicles/CfgVehicles.hpp index f9141b2b4..412b1a3d1 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/CfgVehicles.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/CfgVehicles.hpp @@ -491,8 +491,7 @@ class CfgVehicles #include "Buildables\Generator.hpp" #include "Buildables\Doors.hpp" #include "Buildables\Bridges.hpp" - #include "Buildables\ModularBuild.hpp" - #include "Buildables\ModularWrecks.hpp" + #include "Buildables\ModularBuild.hpp" #include "Buildables\FencesWood.hpp" #include "Buildables\FencesMetal.hpp" #include "Buildables\FencesGates.hpp" diff --git a/SQF/dayz_code/Configs/CfgVehicles/Skins/Male.hpp b/SQF/dayz_code/Configs/CfgVehicles/Skins/Male.hpp index e5dc2a7fa..a74ff95df 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Skins/Male.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Skins/Male.hpp @@ -134,12 +134,6 @@ class Survivor2_DZ : Survivor_DZ { model = "\dayz\characters\man_survivor"; }; -class Survivor3_DZ : Survivor2_DZ { - model = "\dayz\characters\man_hero"; - HiddenSelections[] = {"camo1", "camo2", "camo3"}; - HiddenSelectionsTextures[] = {"ca\characters_pmc\pmc_soldier\data\bauer_co.paa", "ca\characters_pmc\pmc_soldier\data\bauer_gear_co.paa", "ca\characters_pmc\pmc_soldier\data\headgear_co.paa"}; -}; - class Rocket_DZ: SoldierLight_Base_DZ { //BAF_Soldier_Officer_W scope = 2; displayName = "Rocket"; @@ -296,10 +290,7 @@ class Bandit1_DZ : SoldierLight_Base_DZ { //Normal black PMC vest bandit portrait = "\Ca\characters_E\data\portraits\ger_soldier_CA"; HiddenSelections[] = {"camo"}; HiddenSelectionsTextures[] = {"ca\characters_pmc\frost\data\frost_co.paa"}; - class EventHandlers: EventHandlers - { - init = "(_this select 0) setObjectTexture [0,[""\Ca\Characters_PMC\Frost\Data\Frost_1_co.paa"",""\Ca\Characters_PMC\Frost\Data\Frost_2_co.paa"",""\Ca\Characters_PMC\Frost\Data\Frost_3_co.paa""] select floor random 3];"; - }; + class Wounds { tex[] = {}; @@ -308,14 +299,20 @@ class Bandit1_DZ : SoldierLight_Base_DZ { //Normal black PMC vest bandit }; class Bandit2_DZ: Bandit1_DZ { //German bright color camo bandit - scope = 2; - displayName = $STR_CHAR_2; - weapons[] = {"Throw","Put"}; model = "\ca\characters_E\GER\GER_rifleman"; - portrait = "\Ca\characters_E\data\portraits\ger_soldier_CA"; - hiddenSelections[] = {"Camo"}; hiddenSelectionsTextures[] = {"\dayz\textures\clothes\bandit_tex1_co.paa"}; - class EventHandlers {}; +}; + +class Bandit3_DZ: Bandit1_DZ { + hiddenSelectionsTextures[] = {"\Ca\Characters_PMC\Frost\Data\Frost_1_co.paa"}; +}; + +class Bandit4_DZ: Bandit1_DZ { + hiddenSelectionsTextures[] = {"\Ca\Characters_PMC\Frost\Data\Frost_2_co.paa"}; +}; + +class Bandit5_DZ: Bandit1_DZ { + hiddenSelectionsTextures[] = {"\Ca\Characters_PMC\Frost\Data\Frost_3_co.paa"}; }; class GUE_Soldier_MG_DZ: SoldierLight_Base_DZ { @@ -456,10 +453,6 @@ class TK_INS_Warlord_EP1_DZ: Survivor_DZ { }; hiddenSelections[] = {"Camo"}; hiddenSelectionsTextures[] = {"\CA\characters_E\LOC\Data\LOC_opfor02_1_co.paa"}; - class EventHandlers: EventHandlers - { - init = "(_this select 0) setObjectTexture [0,[""\CA\characters_E\LOC\Data\LOC_opfor02_1_co.paa"",""\CA\characters_E\LOC\Data\LOC_opfor02_2_co.paa"",""\CA\characters_E\LOC\Data\LOC_opfor02_3_co.paa""] select floor random 3]"; - }; }; class TK_INS_Soldier_EP1_DZ: TK_INS_Warlord_EP1_DZ { @@ -471,10 +464,16 @@ class TK_INS_Soldier_EP1_DZ: TK_INS_Warlord_EP1_DZ { mat[] = {"CA\characters_E\LOC\Data\LOC_soldier01.rvmat","CA\characters_E\LOC\Data\W1_LOC_soldier01.rvmat","CA\characters_E\LOC\Data\W2_LOC_soldier01.rvmat"}; }; hiddenSelectionsTextures[] = {"\CA\characters_E\LOC\Data\LOC_opfor01_1_co.paa"}; - class EventHandlers: EventHandlers - { - init = "(_this select 0) setObjectTexture [0,[""\CA\characters_E\LOC\Data\LOC_opfor01_1_co.paa"",""\CA\characters_E\LOC\Data\LOC_opfor01_2_co.paa"",""\CA\characters_E\LOC\Data\LOC_opfor01_3_co.paa""] select floor random 3]"; - }; +}; + +class TK_INS_Soldier_EP2_DZ: TK_INS_Soldier_EP1_DZ { + displayName = $STR_EPOCH_SKINS_TAKISTANISOLDIER; + hiddenSelectionsTextures[] = {"\CA\characters_E\LOC\Data\LOC_opfor01_2_co.paa"}; +}; + +class TK_INS_Soldier_EP3_DZ: TK_INS_Soldier_EP1_DZ { + displayName = $STR_EPOCH_SKINS_TAKISTANISOLDIER; + hiddenSelectionsTextures[] = {"\CA\characters_E\LOC\Data\LOC_opfor01_3_co.paa"}; }; class CZ_Special_Forces_GL_DES_EP1_DZ: SoldierLight_Base_DZ { @@ -508,11 +507,7 @@ class Soldier_Bodyguard_AA12_PMC_DZ: SoldierLight_Base_DZ { model = "\Ca\Characters_PMC\Dixon\Dixon.p3d"; portrait = "\Ca\characters\data\portraits\comBarHead_civ_man_ca.paa"; HiddenSelections[] = {"camo1","camo2","camo3"}; - HiddenSelectionsTextures[] = {"ca\characters_E\Civil\Harris\Data\european-man_01_co.paa","ca\characters_pmc\dixon\data\dix_co.paa","ca\characters_E\Delta\Data\DO_Equip_CO.paa"}; - class EventHandlers: EventHandlers - { - init = "(_this select 0) setObjectTexture [0,[""ca\characters_pmc\dixon\data\european-man_02_co.paa"",""ca\characters_pmc\dixon\data\european-man_03_co.paa"",""ca\characters_pmc\dixon\data\european-man_04_co.paa"",""ca\characters_pmc\dixon\data\european-man_05_co.paa""] select floor random 4]; (_this select 0) setObjectTexture [1,[""Ca\Characters_PMC\Dixon\Data\Dix_1_CO.paa"",""Ca\Characters_PMC\Dixon\Data\Dix_2_CO.paa"",""Ca\Characters_PMC\Dixon\Data\Dix_3_CO.paa"",""Ca\Characters_PMC\Dixon\Data\Dix_4_CO.paa"",""Ca\Characters_PMC\Dixon\Data\Dix_4_CO.paa""] select floor random 5]"; - }; + HiddenSelectionsTextures[] = {"ca\characters_pmc\dixon\data\european-man_03_co.paa","ca\characters_pmc\dixon\data\dix_co.paa","ca\characters_E\Delta\Data\DO_Equip_CO.paa"}; class Wounds { tex[] = {}; @@ -521,13 +516,9 @@ class Soldier_Bodyguard_AA12_PMC_DZ: SoldierLight_Base_DZ { }; class Soldier_Sniper_PMC_DZ: Soldier_Bodyguard_AA12_PMC_DZ { - displayName = $STR_EPOCH_SKINS_MARKSMAN; + displayName = $STR_EPOCH_SKINS_HERO; model = "\dayz\characters\man_hero"; HiddenSelectionsTextures[] = {"ca\characters_pmc\pmc_soldier\data\bauer_co.paa","ca\characters_pmc\pmc_soldier\data\bauer_gear_co.paa","ca\characters_pmc\pmc_soldier\data\headgear_co.paa"}; - class EventHandlers - { - init = "(_this select 0) setObjectTexture [0,[""\Ca\Characters_PMC\PMC_soldier\Data\bauer_2_co.paa"",""\Ca\Characters_PMC\PMC_soldier\Data\bauer_3_co.paa"",""\Ca\Characters_PMC\PMC_soldier\Data\bauer_4_co.paa"",""\Ca\Characters_PMC\PMC_soldier\Data\bauer_5_co.paa""] select floor random 4]; (_this select 0) setObjectTexture [1,[""ca\characters_pmc\pmc_soldier\data\bauer_gear_co.paa"",""\Ca\Characters_PMC\PMC_soldier\Data\Bauer_Gear_1_co.paa"",""\Ca\Characters_PMC\PMC_soldier\Data\Bauer_Gear_2_co.paa"",""\Ca\Characters_PMC\PMC_soldier\Data\Bauer_Gear_3_co.paa""] select floor random 4]; (_this select 0) setObjectTexture [2,[""\Ca\Characters_PMC\PMC_soldier\Data\HeadGear_CO.paa"",""\Ca\Characters_PMC\PMC_soldier\Data\HeadGear_1_CO.paa""] select floor random 2]"; - }; }; class Soldier_TL_PMC_DZ: Soldier_Bodyguard_AA12_PMC_DZ { @@ -535,10 +526,6 @@ class Soldier_TL_PMC_DZ: Soldier_Bodyguard_AA12_PMC_DZ { model = "\Ca\Characters_PMC\Gracenko\Gracenko.p3d"; HiddenSelections[] = {"camo"}; HiddenSelectionsTextures[] = {"ca\characters_pmc\gracenko\data\gracenko_co.paa"}; - class EventHandlers: EventHandlers - { - init = "(_this select 0) setObjectTexture [0,[""\Ca\Characters_PMC\Gracenko\Data\Gracenko_1_co.paa"",""\Ca\Characters_PMC\Gracenko\Data\Gracenko_2_co.paa"",""\Ca\Characters_PMC\Gracenko\Data\Gracenko_3_co.paa"",""\Ca\Characters_PMC\Gracenko\Data\Gracenko_4_co.paa""] select floor random 4];"; - }; class Wounds { tex[] = {}; @@ -822,10 +809,6 @@ class TK_CIV_Takistani01_EP1_DZ: Survivor_DZ { mat[] = {"CA\characters_E\civil\Tak_civil01\Data\Tak_civil01.rvmat","CA\characters_E\civil\Tak_civil01\Data\W1_Tak_civil01.rvmat","CA\characters_E\civil\Tak_civil01\Data\W2_Tak_civil01.rvmat"}; }; hiddenSelectionsTextures[] = {"\CA\characters_E\civil\Tak_civil01\Data\Tak_civil01_1_co.paa"}; - class EventHandlers: EventHandlers - { - init = "(_this select 0) setObjectTexture [0,[""\CA\characters_E\civil\Tak_civil01\Data\Tak_civil01_1_co.paa"",""\CA\characters_E\civil\Tak_civil01\Data\Tak_civil01_2_co.paa"",""\CA\characters_E\civil\Tak_civil01\Data\Tak_civil01_3_co.paa"",""\CA\characters_E\civil\Tak_civil01\Data\Tak_civil01_4_co.paa"",""\CA\characters_E\civil\Tak_civil01\Data\Tak_civil01_5_co.paa""] select floor random 5]"; - }; }; class TK_CIV_Takistani03_EP1_DZ: TK_CIV_Takistani01_EP1_DZ { @@ -836,10 +819,6 @@ class TK_CIV_Takistani03_EP1_DZ: TK_CIV_Takistani01_EP1_DZ { mat[] = {"CA\characters_E\civil\Tak_civil03\Data\Tak_civil03.rvmat","CA\characters_E\civil\Tak_civil03\Data\W1_Tak_civil03.rvmat","CA\characters_E\civil\Tak_civil03\Data\W2_Tak_civil03.rvmat"}; }; hiddenSelectionsTextures[] = {"\CA\characters_E\civil\Tak_civil03\Data\Tak_civil03_1_co.paa"}; - class EventHandlers: EventHandlers - { - init = "(_this select 0) setObjectTexture [0,[""\CA\characters_E\civil\Tak_civil03\Data\Tak_civil03_1_co.paa"",""\CA\characters_E\civil\Tak_civil03\Data\Tak_civil03_2_co.paa"",""\CA\characters_E\civil\Tak_civil03\Data\Tak_civil03_3_co.paa"",""\CA\characters_E\civil\Tak_civil03\Data\Tak_civil03_4_co.paa"",""\CA\characters_E\civil\Tak_civil03\Data\Tak_civil03_5_co.paa""] select floor random 5]"; - }; }; class TK_CIV_Takistani04_EP1_DZ: TK_CIV_Takistani01_EP1_DZ { @@ -850,10 +829,6 @@ class TK_CIV_Takistani04_EP1_DZ: TK_CIV_Takistani01_EP1_DZ { mat[] = {"CA\characters_E\civil\Tak_civil04\Data\Tak_civil04.rvmat","CA\characters_E\civil\Tak_civil04\Data\W1_Tak_civil04.rvmat","CA\characters_E\civil\Tak_civil04\Data\W2_Tak_civil04.rvmat"}; }; hiddenSelectionsTextures[] = {"\CA\characters_E\civil\Tak_civil04\Data\Tak_civil04_1_co.paa"}; - class EventHandlers: EventHandlers - { - init = "(_this select 0) setObjectTexture [0,[""\CA\characters_E\civil\Tak_civil04\Data\Tak_civil04_1_co.paa"",""\CA\characters_E\civil\Tak_civil04\Data\Tak_civil04_2_co.paa"",""\CA\characters_E\civil\Tak_civil04\Data\Tak_civil04_3_co.paa"",""\CA\characters_E\civil\Tak_civil04\Data\Tak_civil04_4_co.paa"",""\CA\characters_E\civil\Tak_civil04\Data\Tak_civil04_5_co.paa""] select floor random 5]"; - }; }; class TK_CIV_Takistani06_EP1_DZ: TK_CIV_Takistani01_EP1_DZ { @@ -864,10 +839,6 @@ class TK_CIV_Takistani06_EP1_DZ: TK_CIV_Takistani01_EP1_DZ { mat[] = {"CA\characters_E\civil\Tak_civil06\Data\Tak_civil06.rvmat","CA\characters_E\civil\Tak_civil06\Data\W1_Tak_civil06.rvmat","CA\characters_E\civil\Tak_civil06\Data\W2_Tak_civil06.rvmat"}; }; hiddenSelectionsTextures[] = {"\CA\characters_E\civil\Tak_civil06\Data\Tak_civil06_1_co.paa"}; - class EventHandlers: EventHandlers - { - init = "(_this select 0) setObjectTexture [0,[""\CA\characters_E\civil\Tak_civil06\Data\Tak_civil06_1_co.paa"",""\CA\characters_E\civil\Tak_civil06\Data\Tak_civil06_2_co.paa"",""\CA\characters_E\civil\Tak_civil06\Data\Tak_civil06_3_co.paa"",""\CA\characters_E\civil\Tak_civil06\Data\Tak_civil06_4_co.paa"",""\CA\characters_E\civil\Tak_civil06\Data\Tak_civil06_5_co.paa""] select floor random 5]"; - }; }; class TK_INS_Soldier_AR_EP1_DZ: SoldierLight_Base_DZ { @@ -882,10 +853,6 @@ class TK_INS_Soldier_AR_EP1_DZ: SoldierLight_Base_DZ { }; hiddenSelections[] = {"Camo"}; hiddenSelectionsTextures[] = {"\CA\characters_E\LOC\Data\LOC_opfor05_1_co.paa"}; - class EventHandlers: EventHandlers - { - init = "(_this select 0) setObjectTexture [0,[""\CA\characters_E\LOC\Data\LOC_opfor05_1_co.paa"",""\CA\characters_E\LOC\Data\LOC_opfor05_2_co.paa"",""\CA\characters_E\LOC\Data\LOC_opfor05_3_co.paa""] select floor random 3]"; - }; }; class TK_GUE_Soldier_EP1_DZ: SoldierLight_Base_DZ { @@ -900,10 +867,6 @@ class TK_GUE_Soldier_EP1_DZ: SoldierLight_Base_DZ { }; hiddenSelections[] = {"Camo"}; hiddenSelectionsTextures[] = {"\CA\characters_E\LOC\Data\LOC_ind01_1_co.paa"}; - class EventHandlers: EventHandlers - { - init = "(_this select 0) setObjectTexture [0,[""\CA\characters_E\LOC\Data\LOC_ind01_1_co.paa"",""\CA\characters_E\LOC\Data\LOC_ind01_2_co.paa"",""\CA\characters_E\LOC\Data\LOC_ind01_3_co.paa""] select floor random 3]"; - }; }; class CZ_Soldier_SL_DES_EP1_DZ: SoldierHeavy_Base_DZ { diff --git a/SQF/dayz_code/Configs/CfgVehicles/Zeds/Zeds.hpp b/SQF/dayz_code/Configs/CfgVehicles/Zeds/Zeds.hpp index 6e897f890..32da45219 100644 --- a/SQF/dayz_code/Configs/CfgVehicles/Zeds/Zeds.hpp +++ b/SQF/dayz_code/Configs/CfgVehicles/Zeds/Zeds.hpp @@ -1424,20 +1424,36 @@ class z_soldier_baf_w_soldier_w : z_soldier_baf_w_soldier { hiddenSelectionsTextures[] = {"\ca\characters_W_baf\data\camo_dpm_co.paa","\ca\characters_W_baf\data\armour_dpm_co.paa","\ca\characters_W_baf\data\equip_dpm_co.paa"}; }; -class z_soldier_pmc_soldier : z_soldier { +class z_bodyguard1 : z_soldier { displayName = $STR_ZNAME_BODYGUARD; zombieLoot = ZombieBodyguard; - model = "\Ca\Characters_PMC\PMC_soldier\PMC_soldier.p3d"; + model = "\Ca\Characters_PMC\Asano\Asano.p3d"; HiddenSelections[] = {"camo1","camo2","camo3"}; - HiddenSelectionsTextures[] = {"ca\characters_pmc\pmc_soldier\data\bauer_co.paa","ca\characters_pmc\pmc_soldier\data\bauer_gear_co.paa","ca\characters_pmc\pmc_soldier\data\headgear_co.paa"}; - + HiddenSelectionsTextures[] = {"ca\characters_pmc\asano\data\tex1_co.paa","ca\characters_pmc\pmc_soldier\data\headgear_co.paa","ca\characters_pmc\asano\data\tex2_co.paa"}; + class Wounds { tex[] = {}; - mat[] = {"Ca\Characters_PMC\PMC_soldier\Data\acr_equip.rvmat","Ca\Characters_PMC\PMC_soldier\Data\w1_acr_equip.rvmat","Ca\Characters_PMC\PMC_soldier\Data\w2_acr_equip.rvmat","Ca\Characters_PMC\PMC_soldier\Data\Bauer.rvmat","Ca\Characters_PMC\PMC_soldier\Data\w1_Bauer.rvmat","Ca\Characters_PMC\PMC_soldier\Data\w2_Bauer.rvmat","Ca\Characters_PMC\PMC_soldier\Data\Bauer_Gear.rvmat","Ca\Characters_PMC\PMC_soldier\Data\w1_Bauer_Gear.rvmat","Ca\Characters_PMC\PMC_soldier\Data\w2_Bauer_Gear.rvmat","Ca\Characters_PMC\PMC_soldier\Data\HeadGear.rvmat","Ca\Characters_PMC\PMC_soldier\Data\w1_HeadGear.rvmat","Ca\Characters_PMC\PMC_soldier\Data\w2_HeadGear.rvmat"}; + mat[] = {"Ca\Characters_PMC\Asano\Data\tex1.rvmat","Ca\Characters_PMC\Asano\Data\w1_tex1.rvmat","Ca\Characters_PMC\Asano\Data\w2_tex1.rvmat","Ca\Characters_PMC\Asano\Data\tex2.rvmat","Ca\Characters_PMC\Asano\Data\w1_tex2.rvmat","Ca\Characters_PMC\Asano\Data\w2_tex2.rvmat"}; }; }; +class z_bodyguard2 : z_bodyguard1 { + HiddenSelectionsTextures[] = {"\Ca\Characters_PMC\Asano\Data\tex1_1_co.paa","\Ca\Characters_PMC\PMC_soldier\Data\HeadGear_1_CO.paa","ca\characters_pmc\asano\data\tex2_1_co.paa"}; +}; +class z_bodyguard3 : z_bodyguard1 { + HiddenSelectionsTextures[] = {"\Ca\Characters_PMC\Asano\Data\tex1_2_co.paa","\Ca\Characters_PMC\PMC_soldier\Data\HeadGear_1_CO.paa","ca\characters_pmc\asano\data\tex2_co.paa"}; +}; +class z_bodyguard4 : z_bodyguard1 { + HiddenSelectionsTextures[] = {"\Ca\Characters_PMC\Asano\Data\tex1_3_co.paa","\ca\characters_pmc\pmc_soldier\data\headgear_co.paa","ca\characters_pmc\asano\data\tex2_1_co.paa"}; +}; +class z_bodyguard5 : z_bodyguard1 { + HiddenSelectionsTextures[] = {"\Ca\Characters_PMC\Asano\Data\tex1_4_co.paa","\ca\characters_pmc\pmc_soldier\data\headgear_co.paa","ca\characters_pmc\asano\data\tex2_co.paa"}; +}; +class z_bodyguard6 : z_bodyguard1 { + HiddenSelectionsTextures[] = {"\Ca\Characters_PMC\Asano\Data\tex1_5_co.paa","\Ca\Characters_PMC\PMC_soldier\Data\HeadGear_1_CO.paa","ca\characters_pmc\asano\data\tex2_co.paa"}; +}; + class z_soldier_pmc_engineer : z_soldier { displayName = $STR_ZNAME_BODYGUARD; zombieLoot = ZombieBodyguard; @@ -1974,3 +1990,58 @@ class z_dealer : zZombie_Base { mat[] = {"ca\characters\heads\male\defaulthead\data\hhl.rvmat","ca\characters\heads\male\defaulthead\data\hhl_wounds.rvmat","ca\characters\heads\male\defaulthead\data\hhl_wounds2.rvmat","sra_civilian\dealer\suit_bodysnake.rvmat","sra_civilian\dealer\suit_bodysnake_wound1.rvmat","sra_civilian\dealer\suit_bodysnake_wound2.rvmat"}; }; }; + +class z_bandit1 : zZombie_Base { + displayName = $STR_ZNAME_BANDIT; + zombieLoot = ZombieBandit; + model = "\dayz\characters\man_bandit"; + HiddenSelections[] = {"camo"}; + HiddenSelectionsTextures[] = {"ca\characters_pmc\frost\data\frost_co.paa"}; + + class Wounds + { + tex[] = {}; + mat[] = {"Ca\Characters_PMC\Frost\Data\frost.rvmat","Ca\Characters_PMC\Frost\Data\w1_frost.rvmat","Ca\Characters_PMC\Frost\Data\w2_frost.rvmat"}; + }; +}; +class z_bandit2 : z_bandit1 { + model = "\ca\characters_E\GER\GER_rifleman"; + hiddenSelectionsTextures[] = {"\dayz\textures\clothes\bandit_tex1_co.paa"}; +}; + +class z_bandit3 : z_bandit1 { + HiddenSelectionsTextures[] = {"\Ca\Characters_PMC\Frost\Data\Frost_1_co.paa"}; +}; +class z_bandit4 : z_bandit1 { + HiddenSelectionsTextures[] = {"\Ca\Characters_PMC\Frost\Data\Frost_2_co.paa"}; +}; +class z_bandit5 : z_bandit1 { + HiddenSelectionsTextures[] = {"\Ca\Characters_PMC\Frost\Data\Frost_3_co.paa"}; +}; + +class z_hero1 : zZombie_Base { + displayName = $STR_ZNAME_HERO; + zombieLoot = ZombieHero; + model = "\Ca\Characters_PMC\PMC_soldier\PMC_soldier.p3d"; + HiddenSelections[] = {"camo1","camo2","camo3"}; + HiddenSelectionsTextures[] = {"ca\characters_pmc\pmc_soldier\data\bauer_co.paa","ca\characters_pmc\pmc_soldier\data\bauer_gear_co.paa","ca\characters_pmc\pmc_soldier\data\headgear_co.paa"}; + + class Wounds + { + tex[] = {}; + mat[] = {"Ca\Characters_PMC\PMC_soldier\Data\acr_equip.rvmat","Ca\Characters_PMC\PMC_soldier\Data\w1_acr_equip.rvmat","Ca\Characters_PMC\PMC_soldier\Data\w2_acr_equip.rvmat","Ca\Characters_PMC\PMC_soldier\Data\Bauer.rvmat","Ca\Characters_PMC\PMC_soldier\Data\w1_Bauer.rvmat","Ca\Characters_PMC\PMC_soldier\Data\w2_Bauer.rvmat","Ca\Characters_PMC\PMC_soldier\Data\Bauer_Gear.rvmat","Ca\Characters_PMC\PMC_soldier\Data\w1_Bauer_Gear.rvmat","Ca\Characters_PMC\PMC_soldier\Data\w2_Bauer_Gear.rvmat","Ca\Characters_PMC\PMC_soldier\Data\HeadGear.rvmat","Ca\Characters_PMC\PMC_soldier\Data\w1_HeadGear.rvmat","Ca\Characters_PMC\PMC_soldier\Data\w2_HeadGear.rvmat"}; + }; +}; + +class z_hero2 : z_hero1 { + HiddenSelectionsTextures[] = {"\Ca\Characters_PMC\PMC_soldier\Data\bauer_2_co.paa","\ca\characters_pmc\pmc_soldier\data\bauer_gear_co.paa"}; +}; +class z_hero3 : z_hero1 { + HiddenSelectionsTextures[] = {"\Ca\Characters_PMC\PMC_soldier\Data\bauer_3_co.paa","\Ca\Characters_PMC\PMC_soldier\Data\Bauer_Gear_1_co.paa","\Ca\Characters_PMC\PMC_soldier\Data\HeadGear_1_CO.paa"}; +}; +class z_hero4 : z_hero1 { + HiddenSelectionsTextures[] = {"\Ca\Characters_PMC\PMC_soldier\Data\bauer_4_co.paa","\Ca\Characters_PMC\PMC_soldier\Data\Bauer_Gear_2_co.paa"}; +}; +class z_hero5 : z_hero1 { + HiddenSelectionsTextures[] = {"\Ca\Characters_PMC\PMC_soldier\Data\bauer_5_co.paa","\Ca\Characters_PMC\PMC_soldier\Data\Bauer_Gear_3_co.paa","\Ca\Characters_PMC\PMC_soldier\Data\HeadGear_CO.paa"}; +}; \ No newline at end of file diff --git a/SQF/dayz_code/compile/fn_damageActions.sqf b/SQF/dayz_code/compile/fn_damageActions.sqf index 15613da16..4df140990 100644 --- a/SQF/dayz_code/compile/fn_damageActions.sqf +++ b/SQF/dayz_code/compile/fn_damageActions.sqf @@ -8,18 +8,16 @@ scriptName "Functions\misc\fn_damageActions.sqf"; - [] call fnc_usec_damageActions; ************************************************************/ -private ["_hasABWipes","_dragged","_menClose","_hasPatient","_vehicle","_inVehicle","_isClose","_assignedRole","_driver","_action","_turret","_weapons","_weaponName","_crew","_unconscious_crew","_patients","_vehType","_unit","_antibiotics","_bloodBags","_unconscious","_lowBlood","_injured","_hasSepsis","_inPain","_legsBroke","_armsBroke","_infected","_hasBandage","_hasSepsisBandage","_hasEpi","_hasMorphine","_hasSplint","_hasPainkillers","_hasAntibiotics","_hasBloodBag","_vehClose","_action1","_action2","_action3","_playerMagazines","_isFriendly","_action4","_painkillers"]; - -_menClose = cursorTarget; -_hasPatient = alive _menClose; -_vehicle = vehicle player; -_inVehicle = (_vehicle != player); -_isClose = ((player distance _menClose) < ((sizeOf typeOf _menClose) / 2)); +local _menClose = cursorTarget; +local _hasPatient = alive _menClose; +local _vehicle = vehicle player; +local _inVehicle = (_vehicle != player); +local _isClose = ((player distance _menClose) < ((sizeOf typeOf _menClose) / 2)); if (_inVehicle) then { r_player_lastVehicle = _vehicle; - _assignedRole = assignedVehicleRole player; - _driver = driver (vehicle player); + local _assignedRole = assignedVehicleRole player; + local _driver = driver (vehicle player); if (str (_assignedRole) != str (r_player_lastSeat)) then { call r_player_removeActions2; if (_vehicle isKindOf "ArmoredSUV_Base_PMC" && {_vehicle animationPhase "HideGun_01" != 0} && {_vehicle emptyPositions "Gunner" == 0}) then { @@ -30,6 +28,7 @@ if (_inVehicle) then { if (!r_player_unconscious && !r_action2) then { r_player_lastSeat = _assignedRole; + local _action = []; if (_vehicle isKindOf "helicopter" || {_inVehicle && {{(isPlayer _x) && (alive _x)} count (crew _vehicle) > 1}}) then { //allow switch to pilot @@ -62,14 +61,14 @@ if (_inVehicle) then { }; }; if ((count _assignedRole) > 1 || {(_assignedRole select 0) == "driver"}) then { - _turret = [-1]; + local _turret = [-1]; if ((count _assignedRole) > 1) then { _turret = _assignedRole select 1; }; - _weapons = _vehicle weaponsTurret _turret; + local _weapons = _vehicle weaponsTurret _turret; _weapons = _weapons - ["CarHorn","MiniCarHorn","SportCarHorn","BikeHorn","TruckHorn","TruckHorn2"]; { - _weaponName = getText (configFile >> "cfgWeapons" >> _x >> "displayName"); + local _weaponName = getText (configFile >> "cfgWeapons" >> _x >> "displayName"); _action = _vehicle addAction [format[localize "str_actions_addammo",_weaponName], "\z\addons\dayz_code\actions\ammo.sqf",[_vehicle,_x,_turret], 0, false, true]; r_player_actions2 set [count r_player_actions2,_action]; r_action2 = true; @@ -77,19 +76,19 @@ if (_inVehicle) then { }; }; //Check if patients - _crew = crew _vehicle; - if (count _crew > 0 && {!r_player_unconscious}) then { - _unconscious_crew = []; + local _crew = crew _vehicle; + if (count _crew > 0 && !r_player_unconscious) then { + local _unconscious_crew = []; { if (_x getVariable "NORRN_unconscious") then { _unconscious_crew set [(count _unconscious_crew), _x] }; } forEach _crew; - _patients = count _unconscious_crew; + local _patients = count _unconscious_crew; if (_patients > 0) then { if (!r_action_unload) then { r_action_unload = true; - _vehType = typeOf _vehicle; + local _vehType = typeOf _vehicle; _action = _vehicle addAction [format[localize "str_actions_medical_14",_vehType], "\z\addons\dayz_code\medical\load\unLoad_act.sqf",[player,_unconscious_crew,_vehicle], 0, false, true]; r_player_actions2 set [count r_player_actions2,_action]; }; @@ -115,52 +114,53 @@ if (r_player_unconscious) then { //Lets make sure the player is looking at the target if (isPlayer cursorTarget) then { - if (!r_drag_sqf && {!r_action} && {!_inVehicle} && {!r_player_unconscious} && {player distance _menClose < 3}) then { - _unit = cursorTarget; + if (!r_player_unconscious && !_inVehicle && {!r_drag_sqf && !r_action && player distance _menClose < 3}) then { + local _unit = cursorTarget; player reveal _unit; //Arrays - _antibiotics = ["ItemAntibiotic","ItemAntibiotic1","ItemAntibiotic2","ItemAntibiotic3","ItemAntibiotic4","ItemAntibiotic5","ItemAntibiotic6"]; - _painkillers = ["ItemPainkiller","ItemPainkiller1","ItemPainkiller2","ItemPainkiller3","ItemPainkiller4","ItemPainkiller5","ItemPainkiller6"]; - _bloodBags = ["bloodBagANEG","bloodBagAPOS","bloodBagBNEG","bloodBagBPOS","bloodBagABNEG","bloodBagABPOS","bloodBagONEG","bloodBagOPOS","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"]; + local _antibiotics = ["ItemAntibiotic","ItemAntibiotic1","ItemAntibiotic2","ItemAntibiotic3","ItemAntibiotic4","ItemAntibiotic5","ItemAntibiotic6"]; + local _painkillers = ["ItemPainkiller","ItemPainkiller1","ItemPainkiller2","ItemPainkiller3","ItemPainkiller4","ItemPainkiller5","ItemPainkiller6"]; + local _bloodBags = ["bloodBagANEG","bloodBagAPOS","bloodBagBNEG","bloodBagBPOS","bloodBagABNEG","bloodBagABPOS","bloodBagONEG","bloodBagOPOS","wholeBloodBagANEG","wholeBloodBagAPOS","wholeBloodBagBNEG","wholeBloodBagBPOS","wholeBloodBagABNEG","wholeBloodBagABPOS","wholeBloodBagONEG","wholeBloodBagOPOS"]; //Var checks - _unconscious = _unit getVariable ["NORRN_unconscious", false]; - _dragged = _unit getVariable ["NORRN_unit_dragged", false]; - _lowBlood = _unit getVariable ["USEC_lowBlood", false]; - _injured = _unit getVariable ["USEC_injured", false]; - _hasSepsis = _unit getVariable ["USEC_Sepsis", false]; - _inPain = _unit getVariable ["USEC_inPain", false]; - _legsBroke = _unit getVariable ["hit_legs", 0] >= 1; - _armsBroke = _unit getVariable ["hit_hands", 0] >= 1; - _infected = _unit getVariable ["USEC_infected", false]; + local _unconscious = _unit getVariable ["NORRN_unconscious", false]; + local _dragged = _unit getVariable ["NORRN_unit_dragged", false]; + local _lowBlood = _unit getVariable ["USEC_lowBlood", false]; + local _injured = _unit getVariable ["USEC_injured", false]; + local _hasSepsis = _unit getVariable ["USEC_Sepsis", false]; + local _inPain = _unit getVariable ["USEC_inPain", false]; + local _legsBroke = _unit getVariable ["hit_legs", 0] >= 1; + local _armsBroke = _unit getVariable ["hit_hands", 0] >= 1; + local _infected = _unit getVariable ["USEC_infected", false]; //Magazine checks - _playerMagazines = magazines player; - _hasBandage = "ItemBandage" in _playerMagazines; - _hasSepsisBandage = "ItemSepsisBandage" in _playerMagazines; - _hasEpi = "ItemEpinephrine" in _playerMagazines; - _hasMorphine = "ItemMorphine" in _playerMagazines; - _hasSplint = "equip_woodensplint" in _playerMagazines; - _hasPainkillers = Array_Any(_playerMagazines, {_this in _painkillers}); - _hasAntibiotics = Array_Any(_playerMagazines, {_this in _antibiotics}); - _hasABWipes = "ItemAntibacterialWipe" in _playerMagazines; - if (dayz_classicBloodBagSystem) then { - _hasBloodBag = "ItemBloodbag" in _playerMagazines; - } else { + local _playerMagazines = magazines player; + local _hasBandage = "ItemBandage" in _playerMagazines; + local _hasSepsisBandage = "ItemSepsisBandage" in _playerMagazines; + local _hasEpi = "ItemEpinephrine" in _playerMagazines; + local _hasMorphine = "ItemMorphine" in _playerMagazines; + local _hasSplint = "equip_woodensplint" in _playerMagazines; + local _hasPainkillers = Array_Any(_playerMagazines, {_this in _painkillers}); + local _hasAntibiotics = Array_Any(_playerMagazines, {_this in _antibiotics}); + local _hasABWipes = "ItemAntibacterialWipe" in _playerMagazines; + local _hasBloodBag = "ItemBloodbag" in _playerMagazines; + + if !(dayz_classicBloodBagSystem) then { _hasBloodBag = Array_Any(_playerMagazines, {_this in _bloodBags}); }; - _vehClose = (getPosATL player) nearEntities [["Car","Tank","Helicopter","Plane","StaticWeapon","Ship"],5]; + local _vehClose = (getPosATL player) nearEntities [["Car","Tank","Helicopter","Plane","StaticWeapon","Ship"],5]; if (_hasPatient) then { + local _action = []; //Allow player to drag - if(_unconscious && {!_dragged}) then { + if(_unconscious && !_dragged) then { r_action = true; - _action1 = _unit addAction [localize "STR_UI_GEAR", "\z\addons\dayz_code\actions\openGear.sqf",_unit, 0, true, true]; - _action2 = _unit addAction [localize "str_actions_medical_01", "\z\addons\dayz_code\medical\drag.sqf",_unit, 0, true, true]; - _action3 = _unit addAction [localize "str_actions_medical_02", "\z\addons\dayz_code\medical\pulse.sqf",_unit, 0, true, true]; - _action4 = _unit addAction [localize "str_actions_medical_drag", "\z\addons\dayz_code\medical\carry.sqf",_unit, 0, true, true]; + local _action1 = _unit addAction [localize "STR_UI_GEAR", "\z\addons\dayz_code\actions\openGear.sqf",_unit, 0, true, true]; + local _action2 = _unit addAction [localize "str_actions_medical_01", "\z\addons\dayz_code\medical\drag.sqf",_unit, 0, true, true]; + local _action3 = _unit addAction [localize "str_actions_medical_02", "\z\addons\dayz_code\medical\pulse.sqf",_unit, 0, true, true]; + local _action4 = _unit addAction [localize "str_actions_medical_drag", "\z\addons\dayz_code\medical\carry.sqf",_unit, 0, true, true]; r_player_actions set [count r_player_actions, _action1]; r_player_actions set [count r_player_actions, _action2]; @@ -168,67 +168,66 @@ if (isPlayer cursorTarget) then { r_player_actions set [count r_player_actions, _action4]; }; //Load Vehicle - if (count _vehClose > 0 && {!locked (_vehClose select 0)} && {_unconscious}) then { + if (_unconscious && {(count _vehClose > 0) && !locked (_vehClose select 0)}) then { r_action = true; - _vehicle = _vehClose select 0; - _vehType = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); + local _vehicle = _vehClose select 0; + local _vehType = getText (configFile >> "CfgVehicles" >> typeOf _vehicle >> "displayName"); _action = _unit addAction [format[localize "str_actions_medical_03",_vehType], "\z\addons\dayz_code\medical\load\load_act.sqf",[player,_vehicle,_unit], 0, true, true]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to bandage - if(_injured && {_hasBandage}) then { + if(_injured && _hasBandage) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_04", "\z\addons\dayz_code\medical\bandage.sqf",[_unit,"ItemBandage"], 0, true, true]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to give sepsis bandage - if((_injured || {_hasSepsis}) && {_hasSepsisBandage}) then { + if((_injured || _hasSepsis) && _hasSepsisBandage) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_04_sepsis", "\z\addons\dayz_code\medical\bandage.sqf",[_unit,"ItemSepsisBandage"], 0, true, true]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to give antibacterial wipe - if(_hasSepsis && {_hasABWipes}) then { + if(_hasSepsis && _hasABWipes) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_04_wipes", "\z\addons\dayz_code\medical\wipes.sqf",[_unit], 0, true, true]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to give Epinephrine - if(_unconscious && {_hasEpi}) then { + if(_unconscious && _hasEpi) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_05", "\z\addons\dayz_code\medical\epinephrine.sqf",[_unit], 0, true, true]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to give Morphine - if((_legsBroke || {_armsBroke}) && {_hasMorphine}) then { + if((_legsBroke || _armsBroke) && _hasMorphine) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_06", "\z\addons\dayz_code\medical\brokeBones.sqf",[_unit,"ItemMorphine"], 0, true, true]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to give equip_woodensplint - if((_legsBroke || {_armsBroke}) && {_hasSplint}) then { + if((_legsBroke || _armsBroke) && _hasSplint) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_06_splint", "\z\addons\dayz_code\medical\brokeBones.sqf",[_unit,"equip_woodensplint"], 0, true, true]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to give Painkillers - if(_inPain && {_hasPainkillers}) then { + if(_inPain && _hasPainkillers) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_07", "\z\addons\dayz_code\medical\painkiller.sqf",[_unit], 0, true, true]; r_player_actions set [count r_player_actions,_action]; }; //Allow player to transfuse blood - if(_lowBlood && {_hasBloodBag}) then { - private ["_tempArray","_displayName"]; + if(_lowBlood && _hasBloodBag) then { r_action = true; if (dayz_classicBloodBagSystem) then { _action = _unit addAction [localize "str_actions_medical_08", "\z\addons\dayz_code\medical\transfusion.sqf",[_unit,"ItemBloodbag"], 0, true, true]; r_player_actions set [count r_player_actions,_action]; } else { - _tempArray = []; + local _tempArray = []; { // This was a TODO by the Vanilla Mod devs. if (_x in _playerMagazines && {!(_x in _tempArray)}) then { - _displayName = getText(configFile >> "cfgMagazines" >> _x >> "displayName"); + local _displayName = getText(configFile >> "cfgMagazines" >> _x >> "displayName"); _action = _unit addAction [format[localize "str_actions_medical_08a",_displayName], "\z\addons\dayz_code\medical\transfusion.sqf",[_unit,_x], 0, true, true]; r_player_actions set [count r_player_actions,_action]; _tempArray set [count _tempArray, _x]; @@ -237,7 +236,7 @@ if (isPlayer cursorTarget) then { }; }; //Allow player to give antibiotics - if (_infected && {_hasAntibiotics}) then { + if (_infected && _hasAntibiotics) then { r_action = true; _action = _unit addAction [localize "str_actions_medical_give_antibiotics", "\z\addons\dayz_code\medical\antibiotics.sqf",[_unit], 0, true, true]; r_player_actions set [count r_player_actions, _action]; @@ -260,7 +259,7 @@ if (isPlayer cursorTarget) then { }; //Remove Actions -if ((!_isClose || {!_hasPatient}) && {r_action}) then { +if ((!_isClose || !_hasPatient) && r_action) then { call fnc_usec_medic_removeActions; r_action = false; }; diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index 414a348aa..43de6709b 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -4,34 +4,27 @@ scriptName "Functions\misc\fn_selfActions.sqf"; - Function - [] call fnc_usec_selfActions; ************************************************************/ -private ["_canPickLight","_text","_unlock","_lock","_totalKeys","_temp_keys","_temp_keys_names","_restrict", -"_hasKey","_oldOwner","_hasAttached","_isZombie","_isHarvested","_isMan","_isFuel","_hasRawMeat","_player_deleteBuild", -"_player_lockUnlock_crtl","_hasIgnitors","_menu","_menu1","_allowTow","_liftHeli","_found","_posL","_posC","_height","_attached", -"_combi","_findNearestGen","_humanity_logic","_low_high","_cancel","_buy","_buyV","_humanity","_traderMenu","_warn","_typeOfCursorTarget", -"_isVehicle","_isBicycle","_isDestructable","_isGenerator","_ownerID","_hasBarrel","_hasFuel20","_hasFuel5","_hasEmptyFuelCan", -"_itemsPlayer","_hasToolbox","_hasbottleitem","_isAlive","_isPlant","_istypeTent","_isDisallowRefuel","_isDog", -"_isModular","_isModularDoor","_speed","_dog","_vehicle","_inVehicle","_cursorTarget","_primaryWeapon","_currentWeapon","_magazinesPlayer","_onLadder","_canDo", -"_nearLight","_vehicleOwnerID","_hasHotwireKit","_isPZombie","_dogHandle","_allowedDistance","_id","_upgrade","_weaponsPlayer","_hasCrowbar", -"_allowed","_hasAccess","_uid","_myCharID","_isLocked","_isClose","_hasunboiledwater","_characterID","_text2"]; -_vehicle = vehicle player; -_inVehicle = (_vehicle != player); -_cursorTarget = cursorTarget; -_primaryWeapon = primaryWeapon player; -_currentWeapon = currentWeapon player; -_magazinesPlayer = magazines player; -_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; -_canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder); -_uid = getPlayerUID player; -_nearLight = nearestObject [player,"LitObject"]; -_canPickLight = false; -_myCharID = player getVariable ["CharacterID","0"]; -_vehicleOwnerID = _vehicle getVariable ["CharacterID","0"]; -_hasHotwireKit = "ItemHotwireKit" in _magazinesPlayer; -_isZombie = _cursorTarget isKindOf "zZombie_base"; -_isPZombie = player isKindOf "PZombie_VB"; -_isClose = (player distance _cursorTarget < 3); -_dogHandle = player getVariable ["dogID",0]; +local _vehicle = vehicle player; +local _inVehicle = (_vehicle != player); +local _cursorTarget = cursorTarget; +local _primaryWeapon = primaryWeapon player; +local _currentWeapon = currentWeapon player; +local _magazinesPlayer = magazines player; +local _onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; +local _canDo = (!r_drag_sqf && !r_player_unconscious && !_onLadder); +local _uid = getPlayerUID player; +local _nearLight = nearestObject [player,"LitObject"]; +local _canPickLight = false; +local _myCharID = player getVariable ["CharacterID","0"]; +local _vehicleOwnerID = _vehicle getVariable ["CharacterID","0"]; +local _hasHotwireKit = "ItemHotwireKit" in _magazinesPlayer; +local _isMan = _cursorTarget isKindOf "Man"; //includes animals and zombies +local _isZombie = _cursorTarget isKindOf "zZombie_base"; +local _isPZombie = player isKindOf "PZombie_VB"; +local _isClose = (player distance _cursorTarget < 3); +local _dogHandle = player getVariable ["dogID",0]; +local _text = ""; if (!isNull _nearLight) then { if (_nearLight distance player < 4) then { @@ -99,13 +92,14 @@ if (_canDo && !_inVehicle && !dayz_isSwimming && ((call fn_nearWaterHole) select if (_inVehicle) then { DZE_myVehicle = _vehicle; - if ((_vehicleOwnerID != "0") && {_canDo}) then { + if ((_vehicleOwnerID != "0") && _canDo) then { if (s_player_lockUnlockInside_ctrl < 0) then { - _totalKeys = call epoch_tempKeys; - _temp_keys = _totalKeys select 0; - _temp_keys_names = _totalKeys select 1; - _hasKey = _vehicleOwnerID in _temp_keys; - _oldOwner = (_vehicleOwnerID == _uid); + local _totalKeys = call epoch_tempKeys; + local _temp_keys = _totalKeys select 0; + local _temp_keys_names = _totalKeys select 1; + local _hasKey = _vehicleOwnerID in _temp_keys; + local _oldOwner = (_vehicleOwnerID == _uid); + local _unlock = []; _text = getText (configFile >> "CfgVehicles" >> (typeOf DZE_myVehicle) >> "displayName"); if (locked DZE_myVehicle) then { @@ -140,7 +134,7 @@ if (_inVehicle) then { }; if (DZE_HeliLift) then { - _hasAttached = _vehicle getVariable["hasAttached",false]; + local _hasAttached = _vehicle getVariable["hasAttached",false]; if (_inVehicle && {_vehicle isKindOf "Air"} && {(([_vehicle] call FNC_getPos) select 2) < 30} && {speed _vehicle < 5} && {typeName _hasAttached == "OBJECT"}) then { if (s_player_heli_detach < 0) then { dayz_myLiftVehicle = _vehicle; @@ -187,8 +181,7 @@ if (_isPZombie) then { s_player_pzombiesvision = player addAction [localize "STR_EPOCH_ACTIONS_NIGHTVIS", "\z\addons\dayz_code\actions\pzombie\pz_vision.sqf", [], 4, false, true, "nightVision", "_this == _target"]; }; if (!isNull _cursorTarget && _isClose) then { - _isHarvested = _cursorTarget getVariable["meatHarvested",false]; - _isMan = _cursorTarget isKindOf "Man"; //includes animals and zombies + local _isHarvested = _cursorTarget getVariable["meatHarvested",false]; if (!alive _cursorTarget && _isMan && !_isZombie && !_isHarvested) then { if (s_player_pzombiesfeed < 0) then { s_player_pzombiesfeed = player addAction [localize "STR_EPOCH_ACTIONS_FEED", "\z\addons\dayz_code\actions\pzombie\pz_feed.sqf",_cursorTarget, 3, true, false]; @@ -204,30 +197,32 @@ if (_isPZombie) then { }; // Increase distance only if AIR, SHIP or TANK -_allowedDistance = [4, 8] select ((_cursorTarget isKindOf "Air") || {_cursorTarget isKindOf "Ship"} || {_cursorTarget isKindOf "Tank"}); +local _allowedDistance = [4, 8] select ((_cursorTarget isKindOf "Air") || {_cursorTarget isKindOf "Ship"} || {_cursorTarget isKindOf "Tank"}); if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player distance _cursorTarget < _allowedDistance}) then { - _typeOfCursorTarget = typeOf _cursorTarget; - _isVehicle = _cursorTarget isKindOf "AllVehicles"; - _isBicycle = _cursorTarget isKindOf "Bicycle"; - _isMan = _cursorTarget isKindOf "Man"; //includes animals and zombies - _isDestructable = _cursorTarget isKindOf "BuiltItems"; - _isGenerator = _typeOfCursorTarget == "Generator_DZ"; - _isLocked = locked _cursorTarget; - _isFuel = false; - _hasBarrel = "ItemFuelBarrel" in _magazinesPlayer; - _hasFuel20 = "ItemJerrycan" in _magazinesPlayer; - _hasFuel5 = "ItemFuelcan" in _magazinesPlayer; - _hasEmptyFuelCan = (("ItemJerrycanEmpty" in _magazinesPlayer) || ("ItemFuelcanEmpty" in _magazinesPlayer) || ("ItemFuelBarrelEmpty" in _magazinesPlayer)); - _itemsPlayer = items player; - _weaponsPlayer = weapons player; - _hasCrowbar = "ItemCrowbar" in _itemsPlayer or "MeleeCrowbar" in _weaponsPlayer or dayz_onBack == "MeleeCrowbar"; - _hasToolbox = "ItemToolbox" in _itemsPlayer; - _isAlive = alive _cursorTarget; - _text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName"); - _isPlant = _typeOfCursorTarget in Dayz_plants; - _istypeTent = (_cursorTarget isKindOf "TentStorage_base") or (_cursorTarget isKindOf "IC_Tent"); - _characterID = _cursorTarget getVariable ["CharacterID","0"]; + local _typeOfCursorTarget = typeOf _cursorTarget; + local _isVehicle = _cursorTarget isKindOf "AllVehicles"; + local _isBicycle = _cursorTarget isKindOf "Bicycle"; + local _isDestructable = _cursorTarget isKindOf "BuiltItems"; + local _isGenerator = _typeOfCursorTarget == "Generator_DZ"; + local _isLocked = locked _cursorTarget; + local _isFuel = false; + local _hasBarrel = "ItemFuelBarrel" in _magazinesPlayer; + local _hasFuel20 = "ItemJerrycan" in _magazinesPlayer; + local _hasFuel5 = "ItemFuelcan" in _magazinesPlayer; + local _hasEmptyFuelCan = (("ItemJerrycanEmpty" in _magazinesPlayer) || ("ItemFuelcanEmpty" in _magazinesPlayer) || ("ItemFuelBarrelEmpty" in _magazinesPlayer)); + local _itemsPlayer = items player; + local _weaponsPlayer = weapons player; + local _hasCrowbar = "ItemCrowbar" in _itemsPlayer || "MeleeCrowbar" in _weaponsPlayer || dayz_onBack == "MeleeCrowbar"; + local _hasToolbox = "ItemToolbox" in _itemsPlayer; + local _isAlive = alive _cursorTarget; + local _text = getText (configFile >> "CfgVehicles" >> _typeOfCursorTarget >> "displayName"); + local _isPlant = _typeOfCursorTarget in Dayz_plants; + local _istypeTent = (_cursorTarget isKindOf "TentStorage_base") or (_cursorTarget isKindOf "IC_Tent"); + local _characterID = _cursorTarget getVariable ["CharacterID","0"]; + local _id = ""; + local _ownerID = ""; + local _hasAccess = []; if (DZE_permanentPlot) then { _id = _uid; @@ -237,11 +232,11 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis _ownerID = _characterID; }; - _isDog = (_cursorTarget isKindOf "Pastor" || _cursorTarget isKindOf "Fin"); - _isModular = _cursorTarget isKindOf "ModularItems"; - _isModularDoor = _typeOfCursorTarget in ["Land_DZE_WoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_GarageWoodDoor","CinderWallDoor_DZ","CinderWallDoorSmall_DZ","WoodenGate_foundation_DZ","WoodenGate_1_DZ","WoodenGate_2_DZ","WoodenGate_3_DZ","WoodenGate_4_DZ"]; - _player_deleteBuild = false; - _player_lockUnlock_crtl = false; + local _isDog = (_cursorTarget isKindOf "Pastor" || _cursorTarget isKindOf "Fin"); + local _isModular = _cursorTarget isKindOf "ModularItems"; + local _isModularDoor = _typeOfCursorTarget in ["Land_DZE_WoodDoor","Land_DZE_LargeWoodDoor","Land_DZE_GarageWoodDoor","CinderWallDoor_DZ","CinderWallDoorSmall_DZ","WoodenGate_foundation_DZ","WoodenGate_1_DZ","WoodenGate_2_DZ","WoodenGate_3_DZ","WoodenGate_4_DZ","Land_DZE_WoodGate","Land_DZE_WoodOpenTopGarageDoor","CinderGate_DZ","CinderGarageOpenTop_DZ","CinderDoorHatch_DZ","Door_DZ","Concrete_Bunker_DZ","Metal_Drawbridge_DZ"]; + local _player_deleteBuild = false; + local _player_lockUnlock_crtl = false; //fuel tanks if (_hasEmptyFuelCan) then { @@ -277,7 +272,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis if (_isVehicle && {!_isMan && damage _cursorTarget < 1}) then { - _isDisallowRefuel = _typeOfCursorTarget in ["M240Nest_DZ","MMT_Civ","MMT_USMC","Old_bike_TK_CIV_EP1","Old_bike_TK_INS_EP1"]; + local _isDisallowRefuel = _typeOfCursorTarget in ["M240Nest_DZ","MMT_Civ","MMT_USMC","Old_bike_TK_CIV_EP1","Old_bike_TK_INS_EP1"]; //Allow player to fill vehicle 210L if (_hasBarrel && {fuel _cursorTarget < 1 && !_isDisallowRefuel}) then { if (s_player_fillfuel210 < 0) then { @@ -330,8 +325,8 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis //Fireplace Actions check if ((_cursorTarget call isInflamed) or (inflamed _cursorTarget)) then { - _hasRawMeat = {_x in Dayz_meatraw} count _magazinesPlayer > 0; - _hasunboiledwater = {_x in ["ItemWaterBottleInfected","ItemWaterBottle","ItemWaterBottleSafe","ItemWaterbottle1oz","ItemWaterbottle2oz","ItemWaterbottle3oz","ItemWaterbottle4oz","ItemWaterbottle5oz","ItemWaterbottle6oz","ItemWaterbottle7oz","ItemWaterbottle8oz","ItemWaterbottle9oz","ItemPlasticWaterBottle","ItemPlasticWaterBottleInfected","ItemPlasticWaterBottleSafe","ItemPlasticWaterbottle1oz","ItemPlasticWaterbottle2oz","ItemPlasticWaterbottle3oz","ItemPlasticWaterbottle4oz","ItemPlasticWaterbottle5oz","ItemPlasticWaterbottle6oz","ItemPlasticWaterbottle7oz","ItemPlasticWaterbottle8oz","ItemPlasticWaterbottle9oz"]} count _magazinesPlayer > 0; + local _hasRawMeat = {_x in Dayz_meatraw} count _magazinesPlayer > 0; + local _hasunboiledwater = {_x in ["ItemWaterBottleInfected","ItemWaterBottle","ItemWaterBottleSafe","ItemWaterbottle1oz","ItemWaterbottle2oz","ItemWaterbottle3oz","ItemWaterbottle4oz","ItemWaterbottle5oz","ItemWaterbottle6oz","ItemWaterbottle7oz","ItemWaterbottle8oz","ItemWaterbottle9oz","ItemPlasticWaterBottle","ItemPlasticWaterBottleInfected","ItemPlasticWaterBottleSafe","ItemPlasticWaterbottle1oz","ItemPlasticWaterbottle2oz","ItemPlasticWaterbottle3oz","ItemPlasticWaterbottle4oz","ItemPlasticWaterbottle5oz","ItemPlasticWaterbottle6oz","ItemPlasticWaterbottle7oz","ItemPlasticWaterbottle8oz","ItemPlasticWaterbottle9oz"]} count _magazinesPlayer > 0; //Cook Meat @@ -358,7 +353,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis }; if (_isAlive) then { - _restrict = _typeOfCursorTarget in DZE_restrictRemoval; + local _restrict = _typeOfCursorTarget in DZE_restrictRemoval; //Allow player to remove objects with no ownership or access required if (!_restrict && {_isDestructable || {_typeOfCursorTarget in DZE_isWreck} || {_typeOfCursorTarget in DZE_isWreckBuilding} || {_typeOfCursorTarget in DZE_isRemovable}}) then { @@ -376,7 +371,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis }; }; if (_isVehicle) then { - if ((_characterID != "0") && {!_isMan}) then { + if ((_characterID != "0") && !_isMan) then { _player_lockUnlock_crtl = true; }; }; @@ -409,7 +404,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis //other tents if (_istypeTent) then { - _hasIgnitors = {_x in DayZ_Ignitors} count _itemsPlayer > 0; + local _hasIgnitors = {_x in DayZ_Ignitors} count _itemsPlayer > 0; if ((_hasFuel20 || _hasFuel5 || _hasBarrel) && _hasIgnitors) then { if (s_player_destroytent < 0) then { s_player_destroytent = player addAction [localize "str_actions_self_destroytent", "\z\addons\dayz_code\actions\player_destroyTent.sqf",_cursorTarget, 0, false, true]; @@ -446,7 +441,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis }; /* //Carbomb - _hasCarBomb = "ItemCarBomb" in _magazinesPlayer; + local _hasCarBomb = "ItemCarBomb" in _magazinesPlayer; if (((_cursorTarget isKindOf "Car") || (_cursorTarget isKindOf "Air") || (_cursorTarget isKindOf "Motorcycle")) && _hasCarBomb) then { if (s_player_attach_bomb < 0) then { s_player_attach_bomb = player addAction [localize "str_bombAttach", "\z\addons\dayz_code\actions\player_attach_bomb.sqf",_cursorTarget, 3, true, true]; @@ -460,8 +455,9 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis if (_isVehicle && {!_isMan && _hasToolbox && {dayz_myCursorTarget != _cursorTarget} && {damage _cursorTarget < 1} && {_typeOfCursorTarget != "M240Nest_DZ"}}) then { if (s_player_repair_crtl < 0) then { dayz_myCursorTarget = _cursorTarget; - _menu = dayz_myCursorTarget addAction [localize "str_actions_repairveh", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false]; + local _menu = dayz_myCursorTarget addAction [localize "str_actions_repairveh", "\z\addons\dayz_code\actions\repair_vehicle.sqf",_cursorTarget, 0, true, false]; if (!_isBicycle) then { //Bike wheels should not give full size tires. Also model does not update to show removed wheels. + local _menu1 = []; if (!DZE_salvageLocked) then { if (!_isLocked) then { _menu1 = dayz_myCursorTarget addAction [localize "str_actions_salvageveh", "\z\addons\dayz_code\actions\salvage_vehicle.sqf",_cursorTarget, 0, true, false]; @@ -483,7 +479,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis if ((_typeOfCursorTarget == "Plastic_Pole_EP1_DZ") && {speed player <= 1}) then { _hasAccess = [player, _cursorTarget] call FNC_check_access; - _allowed = ((_hasAccess select 0) || _hasAccess select 2 || _hasAccess select 3 || _hasAccess select 4); + local _allowed = ((_hasAccess select 0) || _hasAccess select 2 || _hasAccess select 3 || _hasAccess select 4); if (DZE_permanentPlot) then { if (s_player_plotManagement < 0 && _allowed) then { s_player_plotManagement = player addAction [format["%1",localize "STR_EPOCH_ACTIONS_MANAGEPLOT"], "\z\addons\dayz_code\actions\plotManagement\initPlotManagement.sqf", [], 5, false]; @@ -512,9 +508,9 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis }; if (DZE_HeliLift) then { - _liftHeli = objNull; - _found = false; - _allowTow = false; + local _liftHeli = objNull; + local _found = false; + local _allowTow = false; if ((count (crew _cursorTarget)) == 0) then { { if (!_allowTow) then { @@ -526,10 +522,10 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis if (_allowTow) then { { if (!_found) then { - _posL = [_x] call FNC_getPos; - _posC = [_cursorTarget] call FNC_getPos; - _height = (_posL select 2) - (_posC select 2); - _hasAttached = _x getVariable["hasAttached",false]; + local _posL = [_x] call FNC_getPos; + local _posC = [_cursorTarget] call FNC_getPos; + local _height = (_posL select 2) - (_posC select 2); + local _hasAttached = _x getVariable["hasAttached",false]; if ((_height < 15) && {_height > 5} && {typeName _hasAttached != "OBJECT"}) then { if (((abs((_posL select 0) - (_posC select 0))) < 10) && {(abs((_posL select 1) - (_posC select 1))) < 10}) then { _liftHeli = _x; @@ -540,7 +536,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis } count (player nearEntities [DZE_HeliAllowTowFrom,15]); }; - _attached = _cursorTarget getVariable["attached",false]; + local _attached = _cursorTarget getVariable["attached",false]; if (_found && _allowTow && !_isLocked && {typeName _attached != "OBJECT"}) then { if (s_player_heli_lift < 0) then { s_player_heli_lift = player addAction [localize "STR_EPOCH_ACTIONS_ATTACHTOHELI", "\z\addons\dayz_code\actions\player_heliLift.sqf",[_liftHeli,_cursorTarget], -10, false, true]; @@ -554,11 +550,13 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis // Allow Owner to lock and unlock vehicle if (_player_lockUnlock_crtl) then { if (s_player_lockUnlock_crtl < 0) then { - _totalKeys = call epoch_tempKeys; - _temp_keys = _totalKeys select 0; - _temp_keys_names = _totalKeys select 1; - _hasKey = _characterID in _temp_keys; - _oldOwner = (_characterID == _uid); + local _totalKeys = call epoch_tempKeys; + local _temp_keys = _totalKeys select 0; + local _temp_keys_names = _totalKeys select 1; + local _hasKey = _characterID in _temp_keys; + local _oldOwner = (_characterID == _uid); + local _unlock = []; + if (_isLocked) then { if (_hasKey || _oldOwner) then { _unlock = player addAction [format[localize "STR_EPOCH_ACTIONS_UNLOCK",_text], "\z\addons\dayz_code\actions\unlock_veh.sqf",[_cursorTarget,(_temp_keys_names select (_temp_keys find _characterID))], 2, true, true]; @@ -586,7 +584,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis s_player_lockUnlock_crtl = -1; }; - if (DZE_Hide_Body && _isMan && !_isAlive) then { + if (DZE_Hide_Body && {_isMan && !_isAlive}) then { if (s_player_hide_body < 0) then { s_player_hide_body = player addAction [localize "str_action_hide_body", "\z\addons\dayz_code\actions\hide_body.sqf",_cursorTarget, 1, true, true]; }; @@ -620,6 +618,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis //Allow owner to unlock vault if (_isClose && !keypadCancel && {(_typeOfCursorTarget in DZE_LockedStorage) && {_characterID != "0"}}) then { if (s_player_unlockvault < 0) then { + local _combi = []; if (_typeOfCursorTarget in DZE_LockedStorage) then { if ((_characterID == dayz_combination) || {_ownerID == _uid}) then { _combi = player addAction [format[localize "STR_EPOCH_ACTIONS_OPEN",_text], "\z\addons\dayz_code\actions\vault_unlock.sqf",_cursorTarget, 0, false, true]; @@ -675,7 +674,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis //Fuel Pump if (_typeOfCursorTarget in dayz_fuelpumparray) then { if (s_player_fuelauto < 0) then { - _findNearestGen = {((alive _x) && (_x getVariable ["GeneratorRunning",false]))} count (([player] call FNC_getPos) nearObjects ["Generator_DZ",30]); + local _findNearestGen = {((alive _x) && (_x getVariable ["GeneratorRunning",false]))} count (([player] call FNC_getPos) nearObjects ["Generator_DZ",30]); if (_findNearestGen > 0) then { s_player_fuelauto = player addAction [localize "STR_EPOCH_ACTIONS_FILLVEH", "\z\addons\dayz_code\actions\fill_nearestVehicle.sqf",objNull, 0, false, true]; } else { @@ -709,7 +708,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis s_player_upgrade_build = -1; }; }; - _upgrade = getArray (configFile >> "CfgVehicles" >> (typeOf _cursorTarget) >> "upgradeBuilding"); + local _upgrade = getArray (configFile >> "CfgVehicles" >> (typeOf _cursorTarget) >> "upgradeBuilding"); if ((s_player_upgrade_build < 0) && {(count _upgrade) > 0}) then { _hasAccess = [player, _cursorTarget] call FNC_check_access; if ((_hasAccess select 0) || (_hasAccess select 2) || (_hasAccess select 3) || (_typeOfCursorTarget in DZE_UpgradableStorage) || (_typeOfCursorTarget isKindOf "DZ_storage_base")) then { @@ -760,7 +759,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis if (s_player_maint_build < 0) then { _hasAccess = [player, _cursorTarget] call FNC_check_access; if ((_hasAccess select 0) || {_hasAccess select 2} || {_hasAccess select 3}) then { - _text2 = _text + " (" + str(round ((damage _cursorTarget) * 100)) + "% damaged)"; + local _text2 = _text + " (" + str(round ((damage _cursorTarget) * 100)) + "% damaged)"; s_player_lastTarget set [2,_cursorTarget]; s_player_maint_build = player addAction [format["%1 %2",localize "STR_EPOCH_ACTIONS_MAINTAIN",_text2], "\z\addons\dayz_code\actions\player_buildingMaint.sqf",_cursorTarget, -2, false, true]; }; @@ -868,10 +867,10 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis // All Traders if (_isMan && {!(isPlayer _cursorTarget)} && {_typeOfCursorTarget in serverTraders}) then { if (s_player_parts_crtl < 0) then { - _humanity = player getVariable ["humanity",0]; - _traderMenu = call compile format["menu_%1;",_typeOfCursorTarget]; - _low_high = localize "STR_EPOCH_ACTIONS_HUMANITY_LOW"; - _humanity_logic = false; + local _humanity = player getVariable ["humanity",0]; + local _traderMenu = call compile format["menu_%1;",_typeOfCursorTarget]; + local _low_high = localize "STR_EPOCH_ACTIONS_HUMANITY_LOW"; + local _humanity_logic = false; if ((_traderMenu select 2) == "friendly") then { _humanity_logic = (_humanity < DZE_Bandit); }; @@ -883,21 +882,21 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis _humanity_logic = (_humanity < DZE_Hero); }; if (_humanity_logic) then { - _cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "","", 0, true, false]; + local _cancel = player addAction [format[localize "STR_EPOCH_ACTIONS_HUMANITY",_low_high], "","", 0, true, false]; s_player_parts set [count s_player_parts,_cancel]; } else { - private ["_itemName1","_itemName2"]; + local _buy = []; { - _itemName2 = getText (configFile >> "CfgMagazines" >> (_x select 1) >> "displayName"); + local _itemName2 = getText (configFile >> "CfgMagazines" >> (_x select 1) >> "displayName"); if (_x select 1 in ["ItemDogTagBandit","ItemDogTagHero"]) then { _buy = player addAction [format[localize "STR_EPOCH_TRADER_CATEGORY_TRADE_ITEMS",(_x select 3),_itemName2,(_x select 4),localize "str_actions_stats_hm"], "\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)],1, true, true]; } else { - _itemName1 = getText (configFile >> "CfgMagazines" >> (_x select 0) >> "displayName"); + local _itemName1 = getText (configFile >> "CfgMagazines" >> (_x select 0) >> "displayName"); _buy = player addAction [format[localize "STR_EPOCH_TRADER_CATEGORY_TRADE_ITEMS",(_x select 3),_itemName2,(_x select 2),_itemName1], "\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)],1, true, true]; }; s_player_parts set [count s_player_parts,_buy]; } count (_traderMenu select 1); - _buyV = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\AdvancedTrading\init.sqf",(_traderMenu select 0), 999, true, false]; + local _buyV = player addAction [localize "STR_EPOCH_PLAYER_289", "\z\addons\dayz_code\actions\AdvancedTrading\init.sqf",(_traderMenu select 0), 999, true, false]; s_player_parts set [count s_player_parts,_buyV]; }; s_player_parts_crtl = 1; @@ -909,7 +908,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis //Dog if (dayz_tameDogs) then { - _hasRawMeat = {_x in Dayz_meatraw} count _magazinesPlayer > 0; + local _hasRawMeat = {_x in Dayz_meatraw} count _magazinesPlayer > 0; if (_isDog && {_hasRawMeat && _isAlive && {_ownerID == "0"} && {player getVariable ["dogID",0] == 0}}) then { if (s_player_tamedog < 0) then { @@ -920,7 +919,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis s_player_tamedog = -1; }; if (_isDog && _isAlive && {_ownerID == _id}) then { - _hasbottleitem = ({_x in ["ItemWaterBottle","ItemWaterBottleInfected","ItemWaterBottleSafe","ItemWaterBottleBoiled","ItemPlasticWaterBottle","ItemPlasticWaterBottleInfected","ItemPlasticWaterBottleSafe","ItemPlasticWaterBottleBoiled"]} count _magazinesPlayer) > 0; + local _hasbottleitem = ({_x in ["ItemWaterBottle","ItemWaterBottleInfected","ItemWaterBottleSafe","ItemWaterBottleBoiled","ItemPlasticWaterBottle","ItemPlasticWaterBottleInfected","ItemPlasticWaterBottleSafe","ItemPlasticWaterBottleBoiled"]} count _magazinesPlayer) > 0; if (s_player_feeddog < 0 && _hasRawMeat) then { s_player_feeddog = player addAction [localize "str_actions_feeddog","\z\addons\dayz_code\actions\dog\feed.sqf",[_dogHandle,0], 0, false, true]; @@ -939,7 +938,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis s_player_barkdog = player addAction [localize "str_actions_barkdog","\z\addons\dayz_code\actions\dog\speak.sqf", _cursorTarget, 3, false, true]; }; if (s_player_warndog < 0) then { - _warn = _dogHandle getFSMVariable "_watchDog"; + local _warn = _dogHandle getFSMVariable "_watchDog"; if (_warn) then { _text = localize "str_epoch_player_247"; _warn = false; } else { _text = localize "str_epoch_player_248"; _warn = true; }; s_player_warndog = player addAction [format[localize "str_actions_warndog",_text],"\z\addons\dayz_code\actions\dog\warn.sqf",[_dogHandle, _warn], 2, false, true]; }; @@ -1084,7 +1083,7 @@ if (!isNull _cursorTarget && {!_inVehicle && !_isPZombie && _canDo && player dis //Dog actions on player self if (_dogHandle > 0) then { - _dog = _dogHandle getFSMVariable "_dog"; + local _dog = _dogHandle getFSMVariable "_dog"; if (isNil "_dog") exitWith {}; if (isNil "_ownerID") then {_ownerID = "0"}; if (_canDo && !_inVehicle && {alive _dog} && {!(_ownerID in [_myCharID,_uid])}) then { @@ -1093,7 +1092,7 @@ if (_dogHandle > 0) then { }; if (s_player_speeddog < 0) then { _text = localize "str_epoch_player_249"; - _speed = 0; + local _speed = 0; if (_dog getVariable ["currentSpeed",1] == 0) then { _speed = 1; _text = localize "str_epoch_player_250"; }; s_player_speeddog = player addAction [format[localize "str_actions_speeddog", _text], "\z\addons\dayz_code\actions\dog\speed.sqf",[player getVariable ["dogID",0],_speed], 0, false, true]; }; @@ -1111,4 +1110,4 @@ if (_dogHandle > 0) then { }; //Monitor -player setVariable ["selfActions", diag_ticktime, false]; +player setVariable ["selfActions", diag_ticktime, false]; \ No newline at end of file diff --git a/SQF/dayz_code/compile/keyboard.sqf b/SQF/dayz_code/compile/keyboard.sqf index af7244a72..ddfc3083d 100644 --- a/SQF/dayz_code/compile/keyboard.sqf +++ b/SQF/dayz_code/compile/keyboard.sqf @@ -2,46 +2,41 @@ #include "\ca\editor\Data\Scripts\dikCodes.h" -//private ["_dikCode","_shiftState","_ctrlState","_altState","_handled","_cancelBuild","_dze_f","_dze_q","_dze_z","_autoRun","_filterCheat","_openGroups","_muteSound","_statusUI","_rifle","_pistol","_melee","_surrender","_gear","_forcesave","_drop","_interrupt","_noise","_journal","_build_left","_build_right","_build_str8OnOff","_block","_addArray","_code"]; -//Keyboard.sqf gets called very often - -_dikCode = _this select 1; -_shiftState = _this select 2; -_ctrlState = _this select 3; -_altState = _this select 4; -_handled = false; +local _dikCode = _this select 1; +local _shiftState = _this select 2; +local _ctrlState = _this select 3; +local _altState = _this select 4; +local _handled = false; if (isNil "keyboard_keys") then { - _cancelBuild = { + local _cancelBuild = { DZE_cancelBuilding = true; call dayz_EjectPlayer; _handled = false; if (r_player_dead) then {_handled = true;}; // Disable ESC after death }; - _dze_f = { - if (!_ctrlState && {!_altState}) then {DZE_F = true;}; + local _dze_f = { + if (!_ctrlState && !_altState) then {DZE_F = true;}; }; - _dze_q = { - if (!_ctrlState && {!_altState}) then {DZE_Q = true;}; - if (!_ctrlState && {_altState}) then {DZE_Q_alt = true;}; - if (_ctrlState && {!_altState}) then {DZE_Q_ctrl = true;}; + local _dze_q = { + if (!_ctrlState && !_altState) then {DZE_Q = true;}; + if (!_ctrlState && {_altState}) then {DZE_Q_alt = true;}; + if (_ctrlState && !_altState) then {DZE_Q_ctrl = true;}; }; - _dze_z = { - if (!_ctrlState && {!_altState}) then {DZE_Z = true;}; - if (!_ctrlState && {_altState}) then {DZE_Z_alt = true;}; - if (_ctrlState && {!_altState}) then {DZE_Z_ctrl = true;}; + local _dze_z = { + if (!_ctrlState && !_altState) then {DZE_Z = true;}; + if (!_ctrlState && _altState) then {DZE_Z_alt = true;}; + if (_ctrlState && !_altState) then {DZE_Z_ctrl = true;}; }; - _autoRun = { + local _autoRun = { if (!dayz_autoRun) then { dayz_autoRun = true; dayz_autoRunThread = [] spawn { - private "_weapon"; - - _weapon = currentWeapon player; + local _weapon = currentWeapon player; while {dayz_autoRun} do { // SurfaceIsWater does not work for ponds // Check weapon to detect Arma action (dayz action is handled in dz_fn_switchWeapon) - if (player != vehicle player or {r_fracture_legs} or {surfaceIsWater getPosASL player} or {currentWeapon player != _weapon} or {(call fn_nearWaterHole) select 0}) exitWith { + if (player != vehicle player || {r_fracture_legs || {surfaceIsWater getPosASL player} || {currentWeapon player != _weapon} || {(call fn_nearWaterHole) select 0}}) exitWith { call dayz_autoRunOff; }; player playAction "FastF"; @@ -53,11 +48,11 @@ if (isNil "keyboard_keys") then { }; _handled = true; }; - _filterCheat = { + local _filterCheat = { //Overriding default engine handling does not stop cheat input, need manual disableUserInput too _handled = [displayNull,_dikCode,_shiftState] call dze_filterCheats; }; - _openGroups = { + local _openGroups = { if (dayz_requireRadio && {!("ItemRadio" in items player)}) then { localize "STR_EPOCH_NEED_RADIO" call dayz_rollingMessages; } else { @@ -69,11 +64,11 @@ if (isNil "keyboard_keys") then { }; _handled = true; }; - _muteSound = { + local _muteSound = { call player_toggleSoundMute; _handled = true; }; - _statusUI = { + local _statusUI = { DZE_UI = DZE_UI + 1; if (DZE_UI == 6) then {DZE_UI = 0; [format[localize "STR_UI_STATUS_ICONS" + " %1",localize "STR_DISABLED"],1] call dayz_rollingMessages;}; if (DZE_UI == 1) then {[format[localize "STR_UI_STATUS_ICONS" + " %1",localize "STR_ENABLED"],1] call dayz_rollingMessages;}; @@ -82,59 +77,24 @@ if (isNil "keyboard_keys") then { call ui_changeDisplay; _handled = true; }; - _rifle = { + local _rifle = { 2 call dz_fn_switchWeapon; _handled = true; }; - _pistol = { + local _pistol = { 3 call dz_fn_switchWeapon; _handled = true; }; - _melee = { // Also works for rifle on back if DZE_TwoPrimaries = 2; + local _melee = { // Also works for rifle on back if DZE_TwoPrimaries = 2; 4 call dz_fn_switchWeapon; _handled = true; }; - /* - _throwable = { // select next non empty throwable weapon - if (vehicle player == player) then { - _ammo_throwable = []; - _muzzles_throwable = []; - _weapon_throwable = []; - { - _weapon = _x; - _muzzles = getArray(configFile >> "cfgWeapons" >> _weapon >> "muzzles"); - if (count _muzzles == 0) then { _muzzles = [_weapon ]; }; - { - _muzz = _x; - { - if (_x in magazines player) then { - _ammo_throwable set [ count _ammo_throwable, getText(configFile >> "cfgMagazines" >> _x >> "ammo") ]; - _muzzles_throwable set [ count _muzzles_throwable, _muzz ]; - _weapon_throwable set [ count _weapon_throwable, _weapon ]; - }; - } forEach getArray(configFile >> "cfgWeapons" >> _weapon >> _muzz >> "magazines"); - } forEach _muzzles; - } forEach ["Throw"]; - - _magCount = count _ammo_throwable; - if (_magCount > 0) then { - if (isNil "KB_CurrentThrowable") then { KB_CurrentThrowable = -1; }; - _currentAmmo = (weaponState player) select 3; - _idx = _ammo_throwable find _currentAmmo; - if (_idx >= 0) then { KB_CurrentThrowable = _idx; }; - KB_CurrentThrowable = (KB_CurrentThrowable + 1) mod _magCount; - player selectWeapon (_muzzles_throwable select KB_CurrentThrowable); - _handled = true; - }; - }; - }; - */ - _surrender = { + local _surrender = { call player_surrender; _handled = true; }; - _gear = { - if ((vehicle player != player) && {!_shiftState} && {!_ctrlState} && {!_altState} && {!dialog}) then { + local _gear = { + if ((vehicle player != player) && {!_shiftState && !_ctrlState && !_altState && !dialog}) then { createGearDialog [player, "RscDisplayGear"]; _handled = true; } else { @@ -144,20 +104,13 @@ if (isNil "keyboard_keys") then { }; }; }; - _forcesave = { + local _forcesave = { if (diag_tickTime - dayz_lastSave > 10) then { call player_forceSave; }; }; - /* - _forcesave2 = { - if ((!isNull (findDisplay 106)) OR dialog) then { - call player_forceSave; - }; - }; - */ - _drop = { - private "_doors"; + local _drop = { + local _doors = []; if (r_drag_sqf) then { _doors = nearestObjects [player, DayZ_DropDrageeObjects, 3]; //Prevent dropping dragged player through objects if (count _doors > 0) then {_handled = true;}; @@ -167,13 +120,13 @@ if (isNil "keyboard_keys") then { if (count _doors > 0 && {speed player > 0}) then {_handled = true;}; //Prevent sprint and prone through doors glitch }; }; - _interrupt = { + local _interrupt = { r_interrupt = true; if (DZE_Surrender) then {call dze_surrender_off}; if (dayz_autoRun) then {call dayz_autoRunOff;}; }; // TODO: left/right, when gear open: onKeyDown = "[_this,'onKeyDown',0,107,0,107] execVM '\z\addons\dayz_code\system\handleGear.sqf'"; - _noise = { + local _noise = { //Overriding default engine handling does not stop combination binds, need manual disableUserInput too _handled = [displayNull,_dikCode,_shiftState] call dze_filterCheats; @@ -182,60 +135,17 @@ if (isNil "keyboard_keys") then { [player,20,true,(getPosATL player)] call player_alertZombies; }; }; - _journal = { - if (!dayz_isSwimming && {!dialog}) then { + local _journal = { + if (!dayz_isSwimming && !dialog) then { [player,4,true,(getPosATL player)] call player_alertZombies; createDialog 'horde_journal_front_cover'; }; _handled = true; }; - _build_left = { - DZE_4 = true; - // fence construction - if (0 != count Dayz_constructionContext) then { - private ["_angleRef", "_dir","_new"]; - - _angleRef = Dayz_constructionContext select 1; - _dir = _angleRef - (getDir player) -5; - if (_dir > 180) then {_dir = _dir - 360}; - if (_dir < -180) then {_dir = _dir + 360}; - if ( _dir > -75) then { - _new = floor((_angleRef - 5)/5)*5; - Dayz_constructionContext set [ 1, _new]; // favorite angle - r_interrupt = true; - }; - _handled = true; - }; - dayz_dodge = true; - }; - _build_right = { - DZE_6 = true; - if (0 != count Dayz_constructionContext) then { - private ["_angleRef", "_dir","_new"]; - - _angleRef = Dayz_constructionContext select 1; - _dir = _angleRef - (getDir player) +5; - if (_dir > 180) then { _dir = _dir - 360; }; - if (_dir < -180) then { _dir = _dir + 360; }; - if (_dir < 75) then { - _new = ceil((_angleRef + 5)/5)*5; - Dayz_constructionContext set [ 1, _new]; // favorite angle - r_interrupt = true; - }; - _handled = true; - }; - dayz_dodge = true; - }; - - _build_str8OnOff = { + local _bunnyhop = { r_interrupt = true; - if (0 != count Dayz_constructionContext) then { - Dayz_constructionContext set [ 5, !(Dayz_constructionContext select 5) ]; - _handled = true; - }; - if (animationState player in ["bunnyhopunarmed","bunnyhoprifle"]) then { //Fixes invisible weapon switch glitch if double tapping vault with no weapon in hands _handled = true; @@ -243,9 +153,7 @@ if (isNil "keyboard_keys") then { if (player isKindOf "PZombie_VB") then { _handled = true; // do not allow player zombies to vault or jump } else { - private "_nearbyObjects"; - - _nearbyObjects = nearestObjects [getPosATL player, dayz_disallowedVault, 8]; + local _nearbyObjects = nearestObjects [getPosATL player, dayz_disallowedVault, 8]; if (count _nearbyObjects > 0) then { if (diag_tickTime - dayz_lastCheckBit > 4) then { [objNull, player, rSwitchMove,"GetOver"] call RE; @@ -258,11 +166,11 @@ if (isNil "keyboard_keys") then { }; }; - _block = { + local _block = { _handled = true; }; - _addArray = { + local _addArray = { { if (_x <= 999999) then { keyboard_keys set [_x, _this select 1]; @@ -301,7 +209,6 @@ if (isNil "keyboard_keys") then { [[DIK_1], _rifle] call _addArray; [[DIK_2], _pistol] call _addArray; [[DIK_3], _melee] call _addArray; - //[[DIK_4], _throwable] call _addArray; [actionKeys "Gear", _gear] call _addArray; [actionKeys "Prone", _drop] call _addArray; [actionKeys "Crouch", _drop] call _addArray; @@ -329,10 +236,9 @@ if (isNil "keyboard_keys") then { [[DIK_F3], _statusUI] call _addArray; [[DIK_F4], {if (diag_tickTime - dayz_lastSave > 10) then {call player_forceSave;};_handled = true;}] call _addArray; [[DIK_TAB,DIK_DELETE], _forcesave] call _addArray; - //[[DIK_F4, DIK_RMENU, DIK_LMENU,DIK_LSHIFT,DIK_RSHIFT,DIK_ESCAPE], _forcesave2] call _addArray; - [actionKeys "LeanLeft", _build_left ] call _addArray; - [actionKeys "LeanRight", _build_right ] call _addArray; - [actionKeys "GetOver", _build_str8OnOff ] call _addArray; // V + [actionKeys "LeanLeft", {DZE_4 = true; dayz_dodge = true;}] call _addArray; + [actionKeys "LeanRight", {DZE_6 = true; dayz_dodge = true;}] call _addArray; + [actionKeys "GetOver", _bunnyhop] call _addArray; // V [actionKeys "ForceCommandingMode", {DZE_5 = true;_handled = true;}] call _addArray; [[ DIK_F9,DIK_F10,DIK_F11,DIK_F12, DIK_F8,DIK_F7,DIK_F6,DIK_F5, @@ -345,13 +251,13 @@ if (isNil "keyboard_keys") then { }; [actionKeys "DSInterface", _block] call _addArray; [[DIK_P], {if (_shiftState) then {_handled = true;};}] call _addArray; - diag_log "keyboard_keys reset"; + //diag_log "keyboard_keys reset"; }; if (r_player_unconsciousInputDisabled) exitWith {true}; -_code = keyboard_keys select _dikCode; +local _code = keyboard_keys select _dikCode; if (!isNil "_code") then { call _code; }; -_handled +_handled \ No newline at end of file diff --git a/SQF/dayz_code/compile/player_spawnCheck.sqf b/SQF/dayz_code/compile/player_spawnCheck.sqf index 5a0180448..7cff6dea9 100644 --- a/SQF/dayz_code/compile/player_spawnCheck.sqf +++ b/SQF/dayz_code/compile/player_spawnCheck.sqf @@ -1,11 +1,10 @@ -private ["_zeds","_isWreck","_looted","_zombied","_doNothing","_spawnZedRadius","_serverTime","_age","_position","_radius","_inVehicle","_Controlledzeddivided","_nearby","_type","_config","_canSpawn","_dis","_checkLoot","_islocal","_bPos","_zombiesNum","_vehicle"]; -_age = -1; -_position = [player] call fnc_getPos; -_radius = 200; // distance from player to perform checks. -_spawnZedRadius = 20; +local _age = -1; +local _position = [player] call fnc_getPos; +local _radius = 200; // distance from player to perform checks. +local _spawnZedRadius = 20; // Current zombies -_zeds = entities "zZombie_Base"; +local _zeds = entities "zZombie_Base"; dayz_currentGlobalZombies = count _zeds; dayz_spawnZombies = 0; dayz_CurrentNearByZombies = 0; @@ -23,12 +22,12 @@ dayz_maxControlledZombies = dayz_maxLocalZombies; // This variable is also used dayz_currentWeaponHolders = count (_position nearObjects ["ReammoBox",_radius]); // In vehicle check -_vehicle = vehicle player; -_inVehicle = (_vehicle != player); +local _vehicle = vehicle player; +local _inVehicle = (_vehicle != player); +local _doNothing = false; -_doNothing = false; if (_inVehicle) then { - _Controlledzeddivided = 0; + local _Controlledzeddivided = 0; //exit if too fast if ((speed _vehicle) > 25) exitwith {_doNothing = true;}; @@ -96,27 +95,28 @@ if (_doNothing) exitWith {}; // nearObjects is faster than nearestObjects when sorting by distance isn't needed // "Building" includes House and all of its child classes (Crashsite, IC_Fireplace1, IC_Tent, etc.) -_nearby = _position nearObjects ["Building",_radius]; +local _nearby = _position nearObjects ["Building",_radius]; dayz_spawnZombies = dayz_spawnZombies max floor(dayz_maxControlledZombies*.8); if (dayz_spawnZombies > 0) then { _spawnZedRadius = _spawnZedRadius * 3;}; //Spawn Zeds & loot in buildings -_serverTime = serverTime; // Get the current time once per cycle. +local _serverTime = serverTime; // Get the current time once per cycle. { - _type = typeOf _x; - _config = missionConfigFile >> "CfgLoot" >> "Buildings" >> _type; - _canSpawn = isClass (_config); + local _type = typeOf _x; + local _config = missionConfigFile >> "CfgLoot" >> "Buildings" >> _type; + local _canSpawn = isClass (_config); if (_canSpawn) then { - _dis = _x distance player; - _islocal = _x getVariable ["", false]; // object created locally via TownGenerator. + local _dis = _x distance player; + local _islocal = _x getVariable ["", false]; // object created locally via TownGenerator. //Loot if (dayz_currentWeaponHolders < dayz_maxMaxWeaponHolders) then { // Check this first - _checkLoot = (count (getArray (_config >> "lootPos"))) > 0; - if ((_dis < 125) && {_dis > 15} && {!_inVehicle} && {_checkLoot}) then { - _looted = (_x getVariable ["looted",_serverTime]); - _age = _serverTime - _looted; // if age is zero then the building hasn't been looted before. + local _checkLoot = (count (getArray (_config >> "lootPos"))) > 0; + if (!_inVehicle && {(_dis < 125) && (_dis > 15) && _checkLoot}) then { + local _looted = (_x getVariable ["looted",_serverTime]); + local _age = _serverTime - _looted; // if age is zero then the building hasn't been looted before. + if ((_age == 0) || {_age > getNumber(_config >> "lootRefreshTimer")}) then { _x setVariable ["looted",_serverTime,!_islocal]; [_x,_type,_config] call building_spawnLoot; @@ -127,12 +127,14 @@ _serverTime = serverTime; // Get the current time once per cycle. //Zeds if (getNumber(_config >> "zombieChance") > 0) then { if (_dis > _spawnZedRadius) then { - _zombied = (_x getVariable ["zombieSpawn",_serverTime]); - _age = _serverTime - _zombied; + local _zombied = (_x getVariable ["zombieSpawn",_serverTime]); + local _age = _serverTime - _zombied; if ((_age == 0) || {_age > 300}) then { //Make sure crash sites always spawn Zeds - _isWreck = _x isKindOf "CrashSite"; - _bPos = getPosATL _x; + local _isWreck = _x isKindOf "CrashSite"; + local _bPos = getPosATL _x; + local _zombiesNum = 0; + if (!_isWreck) then { if ((dayz_spawnZombies < dayz_maxControlledZombies) && {dayz_CurrentNearByZombies < dayz_maxNearByZombies} && {dayz_currentGlobalZombies < dayz_maxGlobalZeds}) then { _zombiesNum = count (_bPos nearEntities ["zZombie_Base",(((sizeOf _type) * 2) + 10)]); diff --git a/SQF/dayz_code/compile/player_updateGui.sqf b/SQF/dayz_code/compile/player_updateGui.sqf index dfaf9d3bc..9474b099e 100644 --- a/SQF/dayz_code/compile/player_updateGui.sqf +++ b/SQF/dayz_code/compile/player_updateGui.sqf @@ -1,10 +1,9 @@ -private ["_combatVal","_ctrlCombatBorder","_ctrlCombat","_uiNumber","_bloodText","_blood","_bloodType","_rhFactor","_thirstLvl","_foodLvl","_tempImg","_tempText","_visual","_audible","_id","_rID","_color","_string","_humanity","_size","_friendlies","_rfriendlies","_rfriendlyTo","_distance","_targetControl","_flash","_foodVal","_thirstVal","_tempVal","_display","_ctrlBloodOuter","_ctrlFoodBorder","_ctrlThirstBorder","_ctrlTempBorder","_ctrlBlood","_ctrlBloodType","_ctrlBleed","_bloodVal","_ctrlFood","_ctrlThirst","_ctrlTemp","_ctrlEar","_ctrlEye","_ctrlFracture","_ctrlMuteBackground","_ctrlMuteIcon","_thirst","_food","_temp","_bloodLvl","_tempLvl","_bloodTestdone","_humanityTarget"]; disableSerialization; -_display = uiNamespace getVariable 'DAYZ_GUI_display'; +local _display = uiNamespace getVariable 'DAYZ_GUI_display'; if (isNil "_display") exitWith {}; // not ready -_flash = { +local _flash = { if (ctrlShown _this) then { _this ctrlShow false; } else { @@ -12,11 +11,20 @@ _flash = { }; }; -_foodVal = 1 - (dayz_hunger / SleepFood); -_thirstVal = 1 - (dayz_thirst / SleepWater); -_tempVal = 1 - ((dayz_temperatur - dayz_temperaturmin)/(dayz_temperaturmax - dayz_temperaturmin)); // Normalise to [0,1] -_bloodVal = r_player_blood / r_player_bloodTotal; -_combatVal = if (player getVariable["combattimeout",0] >= diag_tickTime) then {0} else {1}; +local _foodVal = 1 - (dayz_hunger / SleepFood); +local _thirstVal = 1 - (dayz_thirst / SleepWater); +local _tempVal = 1 - ((dayz_temperatur - dayz_temperaturmin)/(dayz_temperaturmax - dayz_temperaturmin)); // Normalise to [0,1] +local _bloodVal = r_player_blood / r_player_bloodTotal; +local _combatVal = if (player getVariable["combattimeout",0] >= diag_tickTime) then {0} else {1}; +local _ctrlBloodOuter = 0; +local _ctrlFoodBorder = 0; +local _ctrlThirstBorder = 0; +local _ctrlTempBorder = 0; +local _ctrlCombatBorder = 0; +local _ctrlCombatBG = 0; +local _ctrlCombat = 0; +local _ctrlEar = 0; +local _ctrlEye = 0; if (DZE_UI in [1,3,4]) then { // White borders _ctrlBloodOuter = _display displayCtrl 1200; @@ -57,14 +65,14 @@ if (DZE_UI in [1,3]) then { _ctrlEye = _display displayCtrl 1309; }; -_ctrlBlood = _display displayCtrl 1300; -_ctrlBleed = _display displayCtrl 1303; -_ctrlFood = _display displayCtrl 1301; -_ctrlThirst = _display displayCtrl 1302; -_ctrlTemp = _display displayCtrl 1306; -_ctrlFracture = _display displayCtrl 1203; -_ctrlMuteBackground = _display displayCtrl 1904; -_ctrlMuteIcon = _display displayCtrl 1204; +local _ctrlBlood = _display displayCtrl 1300; +local _ctrlBleed = _display displayCtrl 1303; +local _ctrlFood = _display displayCtrl 1301; +local _ctrlThirst = _display displayCtrl 1302; +local _ctrlTemp = _display displayCtrl 1306; +local _ctrlFracture = _display displayCtrl 1203; +local _ctrlMuteBackground = _display displayCtrl 1904; +local _ctrlMuteIcon = _display displayCtrl 1204; if (dayz_soundMuted) then { _ctrlMuteBackground ctrlShow true; @@ -88,16 +96,16 @@ if (DZE_UI == 3) then { // Dark _ctrlThirst ctrlSetTextColor [(Dayz_GUI_R + (0.3 * (1-_thirstVal))),(Dayz_GUI_G * _thirstVal),(Dayz_GUI_B * _thirstVal), 1]; }; -_blood = ""; -_thirst = ""; -_food = ""; -_temp = ""; -_visualtext = ""; -_audibletext = ""; -_bloodLvl = 6 min (0 max (round((r_player_blood / 2) / 1000 + 0.49))); -_thirstLvl = round(_thirstVal / 0.25); -_foodLvl = round(_foodVal / 0.25); -_tempLvl = round(dayz_temperatur); +local _blood = ""; +local _thirst = ""; +local _food = ""; +local _temp = ""; +local _visualtext = ""; +local _audibletext = ""; +local _bloodLvl = 6 min (0 max (round((r_player_blood / 2) / 1000 + 0.49))); +local _thirstLvl = round(_thirstVal / 0.25); +local _foodLvl = round(_foodVal / 0.25); +local _tempLvl = round(dayz_temperatur); /* //Debugging Stuff would be usefull diag_log format["DEBUG: bloodlvl: %1 r_player_blood: %2 bloodval: %3",_bloodLvl, r_player_blood, _bloodVal]; @@ -108,7 +116,7 @@ diag_log format["DEBUG: templvl: %1 dayz_temperatur: %2 tempval: %3",_tempLvl, d if (DZE_UI == 1) then { // Vanilla // Blood Regen & BloodLoss: - _uiNumber = call { + local _uiNumber = call { if (r_player_bloodpersec <= -50) exitWith {-3}; if ((r_player_bloodpersec <= -25) && {r_player_bloodpersec > -50}) exitWith {-2}; if ((r_player_bloodpersec < 0) && {r_player_bloodpersec > -25}) exitWith {-1}; @@ -118,7 +126,7 @@ if (DZE_UI == 1) then { // Vanilla 0; }; - _bloodText = "\z\addons\dayz_code\gui\status\status_blood_border"; + local _bloodText = "\z\addons\dayz_code\gui\status\status_blood_border"; if (r_player_infected) then { _bloodText = call { @@ -136,7 +144,7 @@ if (DZE_UI == 1) then { // Vanilla _ctrlBloodOuter ctrlSetText _bloodText; - _tempText = "\z\addons\dayz_code\gui\status\status_temp_border"; + local _tempText = "\z\addons\dayz_code\gui\status\status_temp_border"; _tempText = call { if (r_player_temp_factor <= r_player_temp_min_factor) exitWith {_tempText + "_down3_ca.paa"}; @@ -150,16 +158,16 @@ if (DZE_UI == 1) then { // Vanilla _ctrlTempBorder ctrlSetText _tempText; - _bloodTestdone = player getVariable ["blood_testdone", false]; + local _bloodTestdone = player getVariable ["blood_testdone", false]; if (_bloodTestdone) then { - _bloodType = player getVariable ["blood_type", "O"]; - _rhFactor = if (player getVariable ["rh_factor", false]) then { "pos" } else { "neg" }; + local _bloodType = player getVariable ["blood_type", "O"]; + local _rhFactor = if (player getVariable ["rh_factor", false]) then { "pos" } else { "neg" }; _ctrlBloodType = _display displayCtrl 1310; _ctrlBloodType ctrlSetText ("\z\addons\dayz_code\gui\status\status_blood_type_"+_bloodType+"_"+_rhFactor+"_ca.paa"); }; }; -_path = if (DZE_UI == 1) then {"\z\addons\dayz_code\gui\status\"} else {"\z\addons\dayz_code\gui\status_epoch\"}; +local _path = if (DZE_UI == 1) then {"\z\addons\dayz_code\gui\status\"} else {"\z\addons\dayz_code\gui\status_epoch\"}; if (_bloodLvl <= 0) then { _blood = _path + "status_blood_inside_1_ca.paa"; @@ -176,7 +184,7 @@ if (_foodLvl < 0) then { _foodLvl = 0 }; _food = _path + "status_food_inside_" + str(_foodLvl) + "_ca.paa"; _ctrlFood ctrlSetText _food; -_tempImg = call { +local _tempImg = call { if (_tempLvl >= 36) exitWith {4}; if (_tempLvl > 33 && {_tempLvl < 36}) exitWith {3}; if (_tempLvl >= 30 && {_tempLvl <= 33}) exitWith {2}; @@ -185,6 +193,8 @@ _tempImg = call { }; _temp = _path + "status_temp_" + str(_tempImg) + "_ca.paa"; _ctrlTemp ctrlSetText _temp; +local _visual = 0; +local _audible = 0; if (DZE_UI in [1,3]) then { _visual = (dayz_disVisual / 185) min 1; @@ -205,7 +215,7 @@ if (DZE_UI in [1,3]) then { }; // Fracture/Broken Legs -if !(canStand player) then { //&& !(ctrlShown _ctrlFracture) makes icon flash non-stop until leg is fixed +if !(canStand player) then { _ctrlFracture ctrlShow true; } else { _ctrlFracture ctrlShow false; @@ -263,18 +273,21 @@ if (r_player_injured) then { /* Opt-in tag system with friend tagging */ -_string = ""; -_humanityTarget = cursorTarget; +local _string = ""; +local _humanityTarget = cursorTarget; if (!isNull _humanityTarget && {isPlayer _humanityTarget} && {alive _humanityTarget}) then { - _distance = player distance _humanityTarget; + local _distance = player distance _humanityTarget; if (_distance < DZE_HumanityTargetDistance) then { - _size = (1-(floor(_distance/5)*0.1)) max 0.1; + local _size = (1-(floor(_distance/5)*0.1)) max 0.1; // Display name if player opt-in or if friend - _friendlies = player getVariable ["friendlies", []]; + local _friendlies = player getVariable ["friendlies", []]; + local _id = ""; + local _rID = ""; + if (DZE_permanentPlot) then { _id = dayz_playerUID; _rID = getPlayerUID _humanityTarget; @@ -282,8 +295,9 @@ if (!isNull _humanityTarget && {isPlayer _humanityTarget} && {alive _humanityTar _id = dayz_characterID; _rID = _humanityTarget getVariable ["CharacterID","0"]; }; - _rfriendlies = _humanityTarget getVariable ["friendlies", []]; - _rfriendlyTo = _humanityTarget getVariable ["friendlyTo", []]; + local _rfriendlies = _humanityTarget getVariable ["friendlies", []]; + local _rfriendlyTo = _humanityTarget getVariable ["friendlyTo", []]; + local _color = ""; if ((_rID in _friendlies) && {_id in _rfriendlies}) then { @@ -301,7 +315,7 @@ if (!isNull _humanityTarget && {isPlayer _humanityTarget} && {alive _humanityTar } else { // Humanity checks - _humanity = _humanityTarget getVariable ["humanity",0]; + local _humanity = _humanityTarget getVariable ["humanity",0]; _color = "color='#ffffff'"; if(_humanity < -5000) then { @@ -320,7 +334,7 @@ if (!isNull _humanityTarget && {isPlayer _humanityTarget} && {alive _humanityTar // update gui if changed if (dayz_humanitytarget != _string) then { - _targetControl = _display displayCtrl 1199; + local _targetControl = _display displayCtrl 1199; _targetControl ctrlSetStructuredText (parseText _string); dayz_humanitytarget = _string; }; @@ -329,14 +343,14 @@ if (dayz_humanitytarget != _string) then { if (Z_singleCurrency) then { _display = uiNameSpace getVariable "ZSC_Money_Display"; if (isNil "_display") exitWith {}; // not ready - _ctrlZSC = _display displayCtrl 4900; + local _ctrlZSC = _display displayCtrl 4900; _string = ""; if (Z_showCurrencyUI) then { - _cashAmt = player getVariable[(["cashMoney","globalMoney"] select Z_persistentMoney),0]; + local _cashAmt = player getVariable[(["cashMoney","globalMoney"] select Z_persistentMoney),0]; _string = format ["%1
",[_cashAmt] call BIS_fnc_numberText]; }; if (Z_globalBanking && Z_showBankUI) then { - _bankAmt = player getVariable ["bankMoney",0]; + local _bankAmt = player getVariable ["bankMoney",0]; _string = _string + format ["%1
",[_bankAmt] call BIS_fnc_numberText]; }; _ctrlZSC ctrlSetStructuredText parseText _string; diff --git a/SQF/dayz_code/init/variables.sqf b/SQF/dayz_code/init/variables.sqf index 069ea1390..567756b07 100644 --- a/SQF/dayz_code/init/variables.sqf +++ b/SQF/dayz_code/init/variables.sqf @@ -14,12 +14,12 @@ dayz_traps_trigger = []; USEC_typeOfWounds = ["Pelvis","aimpoint","lelbow","relbow","RightFoot","LeftFoot","neck","pilot"]; // Player classes -AllPlayers = ["Survivor_DZ","Survivor1_DZ","SurvivorW2_DZ","Survivor2_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","BanditW1_DZ","Bandit1_DZ","Survivor3_DZ","SurvivorWcombat_DZ","SurvivorWdesert_DZ","SurvivorWurban_DZ","SurvivorWpink_DZ","SurvivorWwinter_DZ","SurvivorW3_DZ","Bandit2_DZ","BanditW2_DZ","Soldier_Crew_PMC","Rocket_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","Priest_DZ","Functionary1_EP1_DZ","GUE_Commander_DZ","Ins_Soldier_GL_DZ","Haris_Press_EP1_DZ","Pilot_EP1_DZ","RU_Policeman_DZ","pz_policeman","pz_suit1","pz_suit2","pz_worker1","pz_worker2","pz_worker3","pz_doctor","pz_teacher","pz_hunter","pz_villager1","pz_villager2","pz_villager3","pz_priest","Soldier_TL_PMC_DZ","Soldier_Sniper_PMC_DZ","Soldier_Bodyguard_AA12_PMC_DZ","Drake_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Warlord_EP1_DZ","FR_OHara_DZ","FR_Rodriguez_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_2_DZ","TK_Special_Forces_MG_EP1_DZ","TK_Soldier_Sniper_EP1_DZ","TK_Commander_EP1_DZ","RU_Soldier_Crew_DZ","INS_Lopotev_DZ","INS_Soldier_AR_DZ","INS_Soldier_CO_DZ","INS_Bardak_DZ","INS_Worker2_DZ","USMC_Soldier_Officer_DZ","USMC_Soldier_MG_DZ","USMC_Soldier_Pilot_DZ","FR_TL_DZ","FR_R_DZ","FR_Marksman_DZ","FR_Assault_R_DZ","RU_Soldier_DZ","RU_Soldier_Officer_DZ","RUS_Soldier1_DZ","RUS_Commander_DZ","MVD_Soldier_DZ","Ins_Soldier_2_DZ","Ins_Commander_DZ","Ins_Soldier_Crew_DZ","CDF_Soldier_DZ","Doctor_DZ","Assistant_DZ","Worker1_DZ","Worker3_DZ","Worker4_DZ","TK_CIV_Takistani01_EP1_DZ","TK_CIV_Takistani03_EP1_DZ","TK_CIV_Takistani04_EP1_DZ","TK_CIV_Takistani06_EP1_DZ","TK_INS_Soldier_AR_EP1_DZ","TK_GUE_Soldier_EP1_DZ","CZ_Soldier_SL_DES_EP1_DZ","US_Soldier_EP1_DZ","UN_CDF_Soldier_Guard_EP1_DZ","UN_CDF_Soldier_EP1_DZ","GER_Soldier_TL_EP1_DZ","BAF_Soldier_Officer_MTP_DZ","BAF_Soldier_N_MTP_DZ","FR_Sapper_DZ","CamoWinter1_DZ","CamoWinter2_DZ","SniperWinter_DZ","Nac_Soldier_DZ","Tamika_DZ","gsc_military_helmet_wdl_DZ","gsc_military_head_wdl_DZ","gsc_military_helmet_grey_DZ","gsc_military_head_grey_DZ","gsc_scientist1_DZ","gsc_scientist1_head_DZ","gsc_scientist2_DZ","gsc_scientist2_head_DZ","gsc_cloth_loner_head_DZ","gsc_eco_stalker_mask_neutral_DZ","gsc_eco_stalker_head_neutral_DZ","gsc_eco_stalker_mask_fred_DZ","gsc_eco_stalker_head_fred_DZ","gsc_eco_stalker_mask_duty_DZ","gsc_eco_stalker_head_duty_DZ","gsc_eco_stalker_mask_camo_DZ","gsc_eco_stalker_head_camo_DZ","GhillieFull_Desert01_DZ","GhillieFull_Desert02_DZ","GhillieFull_Desert03_DZ","GhillieFull_Desert04_DZ","GhillieFull_Desert05_DZ","GhillieFull_Desert06_DZ","GhillieFull_Desert07_DZ","GhillieFull_Desert08_DZ","GhillieFull_Snow01_DZ","GhillieFull_Snow02_DZ","GhillieFull_Snow03_DZ","GhillieFull_Snow04_DZ","GhillieFull_Snow05_DZ","GhillieFull_Urban01_DZ","GhillieFull_Wood01_DZ","GhillieFull_Wood02_DZ","GhillieFull_Wood03_DZ","GhillieFull_Wood04_DZ","GhillieFull_Wood05_DZ","GhillieFull_Wood06_DZ","GhillieFull_Wood07_DZ","GhillieFull_Wood08_DZ","GhillieFull_Wood09_DZ","GhillieFull_Wood10_DZ","GhillieFull_Wood11_DZ","GhillieFull_Wood12_DZ","GhillieFull_Wood13_DZ","GhillieFull_Wood14_DZ","GhillieFull_Wood15_DZ","GhillieFull_Wood16_DZ","GER_Soldier_EP1_des_DZ","GER_Soldier_TL_EP1_des_DZ","GER_Soldier_EP1_wdl_DZ","GER_Soldier_TL_EP1_wdl_DZ","Apo_Rifleman_01_DZ","Apo_Rifleman_02_DZ","Apo_Rifleman_03_DZ","Apo_Rifleman_04_DZ","Apo_Rifleman_05_DZ","Apo_Rifleman_06_DZ","SG_GRU_TL_DZ","SG_GRU_Scout_DZ","SG_GRU_Sniper_DZ","SG_GRU_Spotter_DZ","SG_GRU_TL_W_DZ","SG_GRU_Scout_W_DZ","SG_GRU_Assaultman_W_DZ","SG_GRU_Medic_W_DZ","SG_GRU_TL_D_DZ","SG_GRU_Scout_D_DZ","SG_GRU_Marksman_D_DZ","SG_GRU_Operator_D_DZ","SG_GRU_MG_D_DZ","CZ_Soldier805_DES_ACR_DZ","CZ_Soldier_805_Wdl_ACR_DZ","CZ_Soldier_Crew_Dst_ACR_DZ","CZ_Soldier_Officer_Wdl_ACR_DZ","CZ_Soldier_Recon_Wdl_ACR_DZ","CZ_Soldier_Spec1_Wdl_ACR_DZ","CZ_Soldier_Spec2_Wdl_ACR_DZ","CZ_Soldier_Spec3_Wdl_ACR_DZ","CZ_Soldier_Spec_Demo_Dst_ACR_DZ","CZ_Soldier_Sniper_ACR_DZ","CZ_Soldier_Light_Wdl_ACR_DZ","Firefighter1_DZ","Firefighter2_DZ","Firefighter3_DZ","Firefighter4_DZ","Firefighter5_DZ","Firefighter_Officer1_DZ","Firefighter_Officer2_DZ","Postman1_DZ","Postman2_DZ","Postman3_DZ","Postman4_DZ","SchoolTeacher_DZ","Gardener_DZ","RU_Policeman2_DZ","Hunter_DZ","Civilian1_DZ","Civilian2_DZ","Civilian3_DZ","Civilian4_DZ","Civilian5_DZ","Civilian6_DZ","Civilian7_DZ","Civilian8_DZ","Civilian9_DZ","Civilian10_DZ","Civilian11_DZ","Civilian12_DZ","Civilian13_DZ","Civilian14_DZ","Prisoner1_DZ","Prisoner2_DZ","Prisoner3_DZ","Reporter_DZ","MafiaBoss_DZ","Dealer_DZ","BusinessMan_DZ","CamoWinter1W_DZ","CamoWinter2W_DZ","OperatorW_DZ","GunnerW_DZ","DoctorW_DZ","WorkerW_DZ","PolicemanW_DZ","PriestW_DZ","HookerW_DZ","SniperW_DZ","SniperBanditW_DZ","SniperWinterW_DZ","Sniper1W_DZ","TK_Soldier_Sniper_EP1W_DZ","CZ_Soldier_Sniper_EP1W_DZ","GhillieFull_Desert01W_DZ","GhillieFull_Desert02W_DZ","GhillieFull_Desert03W_DZ","GhillieFull_Desert04W_DZ","GhillieFull_Desert05W_DZ","GhillieFull_Desert06W_DZ","GhillieFull_Desert07W_DZ","GhillieFull_Desert08W_DZ","GhillieFull_Snow01W_DZ","GhillieFull_Snow02W_DZ","GhillieFull_Snow03W_DZ","GhillieFull_Snow04W_DZ","GhillieFull_Snow05W_DZ","GhillieFull_Urban01W_DZ","GhillieFull_Wood01W_DZ","GhillieFull_Wood02W_DZ","GhillieFull_Wood03W_DZ","GhillieFull_Wood04W_DZ","GhillieFull_Wood05W_DZ","GhillieFull_Wood06W_DZ","GhillieFull_Wood07W_DZ","GhillieFull_Wood08W_DZ","GhillieFull_Wood09W_DZ","GhillieFull_Wood10W_DZ","GhillieFull_Wood11W_DZ","GhillieFull_Wood12W_DZ","GhillieFull_Wood13W_DZ","GhillieFull_Wood14W_DZ","GhillieFull_Wood15W_DZ","GhillieFull_Wood16W_DZ","CZ_Soldier_Sniper_ACRW_DZ","Nac_SoldierW_DZ","gsc_military_helmet_wdlW_DZ","gsc_military_helmet_greyW_DZ","gsc_scientist1W_DZ","gsc_scientist2W_DZ","gsc_eco_stalker_mask_neutralW_DZ","gsc_eco_stalker_mask_fredW_DZ","gsc_eco_stalker_mask_dutyW_DZ","gsc_eco_stalker_mask_camoW_DZ"]; +AllPlayers = ["SurvivorW2_DZ","Survivor2_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","BanditW1_DZ","Bandit1_DZ","SurvivorWcombat_DZ","SurvivorWdesert_DZ","SurvivorWurban_DZ","SurvivorWpink_DZ","SurvivorWwinter_DZ","SurvivorW3_DZ","Bandit2_DZ","Bandit3_DZ","Bandit4_DZ","Bandit5_DZ","BanditW2_DZ","Soldier_Crew_PMC","Rocket_DZ","Rocker1_DZ","Rocker2_DZ","Rocker3_DZ","Rocker4_DZ","Priest_DZ","Functionary1_EP1_DZ","GUE_Commander_DZ","Ins_Soldier_GL_DZ","Haris_Press_EP1_DZ","Pilot_EP1_DZ","RU_Policeman_DZ","pz_policeman","pz_suit1","pz_suit2","pz_worker1","pz_worker2","pz_worker3","pz_doctor","pz_teacher","pz_hunter","pz_villager1","pz_villager2","pz_villager3","pz_priest","Soldier_TL_PMC_DZ","Soldier_Sniper_PMC_DZ","Soldier_Bodyguard_AA12_PMC_DZ","Drake_Light_DZ","CZ_Special_Forces_GL_DES_EP1_DZ","TK_INS_Soldier_EP1_DZ","TK_INS_Soldier_EP2_DZ","TK_INS_Soldier_EP3_DZ","TK_INS_Warlord_EP1_DZ","FR_OHara_DZ","FR_Rodriguez_DZ","CZ_Soldier_Sniper_EP1_DZ","Graves_Light_DZ","GUE_Soldier_MG_DZ","GUE_Soldier_Sniper_DZ","GUE_Soldier_Crew_DZ","GUE_Soldier_CO_DZ","GUE_Soldier_2_DZ","TK_Special_Forces_MG_EP1_DZ","TK_Soldier_Sniper_EP1_DZ","TK_Commander_EP1_DZ","RU_Soldier_Crew_DZ","INS_Lopotev_DZ","INS_Soldier_AR_DZ","INS_Soldier_CO_DZ","INS_Bardak_DZ","INS_Worker2_DZ","USMC_Soldier_Officer_DZ","USMC_Soldier_MG_DZ","USMC_Soldier_Pilot_DZ","FR_TL_DZ","FR_R_DZ","FR_Marksman_DZ","FR_Assault_R_DZ","RU_Soldier_DZ","RU_Soldier_Officer_DZ","RUS_Soldier1_DZ","RUS_Commander_DZ","MVD_Soldier_DZ","Ins_Soldier_2_DZ","Ins_Commander_DZ","Ins_Soldier_Crew_DZ","CDF_Soldier_DZ","Doctor_DZ","Assistant_DZ","Worker1_DZ","Worker3_DZ","Worker4_DZ","TK_CIV_Takistani01_EP1_DZ","TK_CIV_Takistani03_EP1_DZ","TK_CIV_Takistani04_EP1_DZ","TK_CIV_Takistani06_EP1_DZ","TK_INS_Soldier_AR_EP1_DZ","TK_GUE_Soldier_EP1_DZ","CZ_Soldier_SL_DES_EP1_DZ","US_Soldier_EP1_DZ","UN_CDF_Soldier_Guard_EP1_DZ","UN_CDF_Soldier_EP1_DZ","GER_Soldier_TL_EP1_DZ","BAF_Soldier_Officer_MTP_DZ","BAF_Soldier_N_MTP_DZ","FR_Sapper_DZ","CamoWinter1_DZ","CamoWinter2_DZ","SniperWinter_DZ","Nac_Soldier_DZ","Tamika_DZ","gsc_military_helmet_wdl_DZ","gsc_military_head_wdl_DZ","gsc_military_helmet_grey_DZ","gsc_military_head_grey_DZ","gsc_scientist1_DZ","gsc_scientist1_head_DZ","gsc_scientist2_DZ","gsc_scientist2_head_DZ","gsc_cloth_loner_head_DZ","gsc_eco_stalker_mask_neutral_DZ","gsc_eco_stalker_head_neutral_DZ","gsc_eco_stalker_mask_fred_DZ","gsc_eco_stalker_head_fred_DZ","gsc_eco_stalker_mask_duty_DZ","gsc_eco_stalker_head_duty_DZ","gsc_eco_stalker_mask_camo_DZ","gsc_eco_stalker_head_camo_DZ","GhillieFull_Desert01_DZ","GhillieFull_Desert02_DZ","GhillieFull_Desert03_DZ","GhillieFull_Desert04_DZ","GhillieFull_Desert05_DZ","GhillieFull_Desert06_DZ","GhillieFull_Desert07_DZ","GhillieFull_Desert08_DZ","GhillieFull_Snow01_DZ","GhillieFull_Snow02_DZ","GhillieFull_Snow03_DZ","GhillieFull_Snow04_DZ","GhillieFull_Snow05_DZ","GhillieFull_Urban01_DZ","GhillieFull_Wood01_DZ","GhillieFull_Wood02_DZ","GhillieFull_Wood03_DZ","GhillieFull_Wood04_DZ","GhillieFull_Wood05_DZ","GhillieFull_Wood06_DZ","GhillieFull_Wood07_DZ","GhillieFull_Wood08_DZ","GhillieFull_Wood09_DZ","GhillieFull_Wood10_DZ","GhillieFull_Wood11_DZ","GhillieFull_Wood12_DZ","GhillieFull_Wood13_DZ","GhillieFull_Wood14_DZ","GhillieFull_Wood15_DZ","GhillieFull_Wood16_DZ","GER_Soldier_EP1_des_DZ","GER_Soldier_TL_EP1_des_DZ","GER_Soldier_EP1_wdl_DZ","GER_Soldier_TL_EP1_wdl_DZ","Apo_Rifleman_01_DZ","Apo_Rifleman_02_DZ","Apo_Rifleman_03_DZ","Apo_Rifleman_04_DZ","Apo_Rifleman_05_DZ","Apo_Rifleman_06_DZ","SG_GRU_TL_DZ","SG_GRU_Scout_DZ","SG_GRU_Sniper_DZ","SG_GRU_Spotter_DZ","SG_GRU_TL_W_DZ","SG_GRU_Scout_W_DZ","SG_GRU_Assaultman_W_DZ","SG_GRU_Medic_W_DZ","SG_GRU_TL_D_DZ","SG_GRU_Scout_D_DZ","SG_GRU_Marksman_D_DZ","SG_GRU_Operator_D_DZ","SG_GRU_MG_D_DZ","CZ_Soldier805_DES_ACR_DZ","CZ_Soldier_805_Wdl_ACR_DZ","CZ_Soldier_Crew_Dst_ACR_DZ","CZ_Soldier_Officer_Wdl_ACR_DZ","CZ_Soldier_Recon_Wdl_ACR_DZ","CZ_Soldier_Spec1_Wdl_ACR_DZ","CZ_Soldier_Spec2_Wdl_ACR_DZ","CZ_Soldier_Spec3_Wdl_ACR_DZ","CZ_Soldier_Spec_Demo_Dst_ACR_DZ","CZ_Soldier_Sniper_ACR_DZ","CZ_Soldier_Light_Wdl_ACR_DZ","Firefighter1_DZ","Firefighter2_DZ","Firefighter3_DZ","Firefighter4_DZ","Firefighter5_DZ","Firefighter_Officer1_DZ","Firefighter_Officer2_DZ","Postman1_DZ","Postman2_DZ","Postman3_DZ","Postman4_DZ","SchoolTeacher_DZ","Gardener_DZ","RU_Policeman2_DZ","Hunter_DZ","Civilian1_DZ","Civilian2_DZ","Civilian3_DZ","Civilian4_DZ","Civilian5_DZ","Civilian6_DZ","Civilian7_DZ","Civilian8_DZ","Civilian9_DZ","Civilian10_DZ","Civilian11_DZ","Civilian12_DZ","Civilian13_DZ","Civilian14_DZ","Prisoner1_DZ","Prisoner2_DZ","Prisoner3_DZ","Reporter_DZ","MafiaBoss_DZ","Dealer_DZ","BusinessMan_DZ","CamoWinter1W_DZ","CamoWinter2W_DZ","OperatorW_DZ","GunnerW_DZ","DoctorW_DZ","WorkerW_DZ","PolicemanW_DZ","PriestW_DZ","HookerW_DZ","SniperW_DZ","SniperBanditW_DZ","SniperWinterW_DZ","Sniper1W_DZ","TK_Soldier_Sniper_EP1W_DZ","CZ_Soldier_Sniper_EP1W_DZ","GhillieFull_Desert01W_DZ","GhillieFull_Desert02W_DZ","GhillieFull_Desert03W_DZ","GhillieFull_Desert04W_DZ","GhillieFull_Desert05W_DZ","GhillieFull_Desert06W_DZ","GhillieFull_Desert07W_DZ","GhillieFull_Desert08W_DZ","GhillieFull_Snow01W_DZ","GhillieFull_Snow02W_DZ","GhillieFull_Snow03W_DZ","GhillieFull_Snow04W_DZ","GhillieFull_Snow05W_DZ","GhillieFull_Urban01W_DZ","GhillieFull_Wood01W_DZ","GhillieFull_Wood02W_DZ","GhillieFull_Wood03W_DZ","GhillieFull_Wood04W_DZ","GhillieFull_Wood05W_DZ","GhillieFull_Wood06W_DZ","GhillieFull_Wood07W_DZ","GhillieFull_Wood08W_DZ","GhillieFull_Wood09W_DZ","GhillieFull_Wood10W_DZ","GhillieFull_Wood11W_DZ","GhillieFull_Wood12W_DZ","GhillieFull_Wood13W_DZ","GhillieFull_Wood14W_DZ","GhillieFull_Wood15W_DZ","GhillieFull_Wood16W_DZ","CZ_Soldier_Sniper_ACRW_DZ","Nac_SoldierW_DZ","gsc_military_helmet_wdlW_DZ","gsc_military_helmet_greyW_DZ","gsc_scientist1W_DZ","gsc_scientist2W_DZ","gsc_eco_stalker_mask_neutralW_DZ","gsc_eco_stalker_mask_fredW_DZ","gsc_eco_stalker_mask_dutyW_DZ","gsc_eco_stalker_mask_camoW_DZ"]; // Epoch Additions dayz_activeInvites = []; DZE_DoorsLocked = ["Land_DZE_GarageWoodDoorLocked","Land_DZE_LargeWoodDoorLocked","Land_DZE_WoodDoorLocked","CinderWallDoorLocked_DZ","CinderWallDoorSmallLocked_DZ","WoodenGate_1_DZ","WoodenGate_2_DZ","WoodenGate_3_DZ","WoodenGate_4_DZ","Land_DZE_WoodGateLocked","CinderGateLocked_DZ","Metal_DrawbridgeLocked_DZ","Land_DZE_WoodOpenTopGarageLocked","CinderGarageOpenTopLocked_DZ","DoorLocked_DZ","CinderWallWindowLocked_DZ","CinderDoorHatchLocked_DZ","Concrete_Bunker_Locked_DZ"]; -DZE_isWreckBuilding = ["Land_wreck_cinder","Land_wood_wreck_quarter","Land_wood_wreck_floor","Land_wood_wreck_third","Land_wood_wreck_frame","Land_iron_vein_wreck","Land_silver_vein_wreck","Land_gold_vein_wreck","Land_ammo_supply_wreck"]; +DZE_isWreckBuilding = ["Land_metal_floor_2x2_wreck","Land_wreck_cinder","Land_wood_wreck_quarter","Land_wood_wreck_floor","Land_wood_wreck_third","Land_wood_wreck_frame","Land_iron_vein_wreck","Land_silver_vein_wreck","Land_gold_vein_wreck","Land_ammo_supply_wreck"]; DZE_LockedStorage = ["VaultStorageLocked","VaultStorage2Locked","LockboxStorageLocked","LockboxStorage2Locked","LockboxStorageWinterLocked","LockboxStorageWinter2Locked","TallSafeLocked"]; DZE_UnLockedStorage = ["VaultStorage","VaultStorage2","LockboxStorage","LockboxStorage2","LockboxStorageWinter","LockboxStorageWinter2","TallSafe"]; DZE_isNewStorage = ["OutHouse_DZ","Wooden_shed_DZ","Wooden_shed2_DZ","WoodShack_DZ","WoodShack2_DZ","StorageShed_DZ","StorageShed2_DZ","GunRack_DZ","GunRack2_DZ","WoodCrate_DZ","WoodCrate2_DZ","Advanced_WorkBench_DZ","CookTripod_DZ","Stoneoven_DZ","Commode_DZ","Wardrobe_DZ","Fridge_DZ","Washing_Machine_DZ","Server_Rack_DZ","ATM_DZ","Armchair_DZ","Sofa_DZ","Arcade_DZ","Vendmachine1_DZ","Vendmachine2_DZ","StorageCrate_DZ","CamoStorageCrate_DZ"]; @@ -250,7 +250,6 @@ if (!isDedicated) then { dayz_fishingInprogress = false; NORRN_dropAction = -1; dayz_dodge = false; - Dayz_constructionContext = []; Dayz_freefall = [ time, 0, 0.1 ]; dayz_getoutTime = 0; dayz_hitByTime = 0; diff --git a/SQF/dayz_code/stringtable.xml b/SQF/dayz_code/stringtable.xml index 95499675f..cb28df8aa 100644 --- a/SQF/dayz_code/stringtable.xml +++ b/SQF/dayz_code/stringtable.xml @@ -14401,6 +14401,14 @@ Infizierter Drogenhändler Инфицированный Драгдилер + + Infected Bandit + Infizierter Bandit + + + Infected Hero + Infizierter Held + @@ -29005,11 +29013,26 @@ Rocker (grün) Рокер (Зелёный цвет) - - Bandit Outfit - Бандитская одежда - Banditen Kleidung + + Bandit Outfit 1 + Бандитская одежда 1 + Banditen Kleidung 1 + + Bandit Outfit 2 + Бандитская одежда 2 + Banditen Kleidung 2 + + + Bandit Outfit 3 + Бандитская одежда 3 + Banditen Kleidung 3 + + + Bandit Outfit 4 + Бандитская одежда 4 + Banditen Kleidung 4 + Bandit Camo Бандитский камуфляж @@ -29161,6 +29184,21 @@ Takistani Soldier Takistan Soldat Такистанский солдат + + + Takistani Soldier 1 + Takistan Soldat 1 + Такистанский солдат 1 + + + Takistani Soldier 2 + Takistan Soldat 2 + Такистанский солдат 2 + + + Takistani Soldier 3 + Takistan Soldat 3 + Такистанский солдат 3 Special Forces @@ -29201,16 +29239,9 @@ Stadt Tarn Городской камуфляж - - Marksman - Меткий стрелок - Scharfschütze - Tiratore scelto - Tirador - Tireur d'élite - Ostřelovač - Snajper - Lövész + + Hero + Held Team Leader @@ -31839,7 +31870,7 @@ Бросить / Поднять. - Drop / Pick up object. + Snap / Pick up object. Objekt snappen / aufnehmen. diff --git a/SQF/dayz_code/system/scheduler/sched_antiTeleport.sqf b/SQF/dayz_code/system/scheduler/sched_antiTeleport.sqf index c01a5c900..c5ddba27b 100644 --- a/SQF/dayz_code/system/scheduler/sched_antiTeleport.sqf +++ b/SQF/dayz_code/system/scheduler/sched_antiTeleport.sqf @@ -11,14 +11,11 @@ sched_antiTP_init = { }; sched_antiTP = { - private ["_lastpos","_lastheight","_lasttime","_lastVehicle","_debug","_curpos","_distance","_curtime","_difftime", - "_curheight","_speed","_topSpeed","_terrainHeight","_safetyVehicle","_curPos"]; - - _lastpos = _this select 1; - _lastheight = _this select 2; - _lasttime = _this select 3; - _lastVehicle = _this select 4; - _debug = _this select 5; + local _lastpos = _this select 1; + local _lastheight = _this select 2; + local _lasttime = _this select 3; + local _lastVehicle = _this select 4; + local _debug = _this select 5; if (typeName player == "OBJECT" && {(player in playableUnits) && (alive player)}) then { if (count _lastpos != 3) then { @@ -27,22 +24,22 @@ sched_antiTP = { _lasttime = diag_ticktime; _lastVehicle = vehicle player; }; - _curpos = getPosATL (vehicle player); - _distance = _lastpos distance _curpos; - _curtime = diag_ticktime; - _difftime = _curtime - _lasttime; + local _curpos = getPosATL (vehicle player); + local _distance = _lastpos distance _curpos; + local _curtime = diag_ticktime; + local _difftime = _curtime - _lasttime; if ((_distance > 10) OR {(_difftime > 1)}) then { - _curheight = (ATLtoASL _curpos) select 2; - _speed = _distance / _difftime; - _topSpeed = 10; + local _curheight = (ATLtoASL _curpos) select 2; + local _speed = _distance / _difftime; + local _topSpeed = 10; if (vehicle player != player) then { _topSpeed = (getNumber (configFile >> "CfgVehicles" >> typeOf (vehicle player) >> "maxSpeed")) min 500; }; - _terrainHeight = getTerrainHeightASL [_curpos select 0, _curpos select 1]; - _safetyVehicle = vehicle player; + local _terrainHeight = getTerrainHeightASL [_curpos select 0, _curpos select 1]; + local _safetyVehicle = vehicle player; if (_lastVehicle == vehicle player) then { if ((_speed > _topSpeed) && (alive player) && ((driver (vehicle player) == player) or (isNull (driver (vehicle player)))) && (_debug distance _lastpos > 3000) && !((vehicle player == player) && (_curheight < _lastheight) && ((_curheight - _terrainHeight) > 1))) then { diff --git a/SQF/dayz_code/system/scheduler/sched_gravity.sqf b/SQF/dayz_code/system/scheduler/sched_gravity.sqf index d2e6e1226..e650658d0 100644 --- a/SQF/dayz_code/system/scheduler/sched_gravity.sqf +++ b/SQF/dayz_code/system/scheduler/sched_gravity.sqf @@ -6,26 +6,24 @@ sched_gravity_init = { }; sched_gravity = { - private ["_otime","_opos","_offtime","_offpos","_oid","_idTrickCount","_timeTrickCount","_time","_ppos","_fftime","_ffpos","_pid","_netid","_initDone"]; - if ((!(_this select 5) and !isNil 'Dayz_loginCompleted') and {(Dayz_loginCompleted)}) then { _this = [ time, VisiblePositionASL player, time, VisiblePositionASL player, false, true]; //diag_log [ diag_tickTime, __FILE__, "freefall inited" ]; }; - _otime = _this select 0; - _opos = _this select 1; - _offtime = _this select 2; - _offpos = _this select 3; - _inprogress = _this select 4; - _initDone = _this select 5; + local _otime = _this select 0; + local _opos = _this select 1; + local _offtime = _this select 2; + local _offpos = _this select 3; + local _inprogress = _this select 4; + local _initDone = _this select 5; if (_initDone) then { // detect and save freefall start - _time = time; - _ppos = VisiblePositionASL player; - _fftime = _time; - _ffpos = +(_ppos); + local _time = time; + local _ppos = VisiblePositionASL player; + local _fftime = _time; + local _ffpos = +(_ppos); if ((_opos select 2) - (_ppos select 2) >= if (_inprogress) then {0.1} else {0.39} ) then { _fftime = _offtime; _ffpos = +(_offpos); diff --git a/SQF/dayz_code/system/scheduler/sched_gui.sqf b/SQF/dayz_code/system/scheduler/sched_gui.sqf index deafe3ee5..c5e372610 100644 --- a/SQF/dayz_code/system/scheduler/sched_gui.sqf +++ b/SQF/dayz_code/system/scheduler/sched_gui.sqf @@ -4,13 +4,11 @@ sched_gui_init = { [false] }; sched_gui = { HIDE_FSM_VARS - private [ "_array", "_initDone", "_ui"]; + local _initDone = _this select 0; - _initDone = _this select 0; - - if ((!_initDone and !isNil 'Dayz_loginCompleted') and {(Dayz_loginCompleted)}) then { + if (!_initDone && !isNil 'Dayz_loginCompleted' && {Dayz_loginCompleted}) then { if !(DZE_UI == 0) then { - _ui = call { + local _ui = call { if (DZE_UI == 1) exitWith {"playerStatusGUI"}; if (DZE_UI == 2) exitWith {"playerStatusGUI_epoch"}; "playerStatusGUI_legacy"; @@ -28,7 +26,7 @@ sched_gui = { // diag_log [ diag_Ticktime, __FILE__, "waiting", _initDone,Dayz_loginCompleted]; //}; if (_initDone) then { - _array = player call world_surfaceNoise; + local _array = player call world_surfaceNoise; dayz_surfaceNoise = _array select 1; dayz_surfaceType = _array select 0; call player_checkStealth; diff --git a/SQF/dayz_code/system/scheduler/sched_medical.sqf b/SQF/dayz_code/system/scheduler/sched_medical.sqf index c1416a146..56be9f3f0 100644 --- a/SQF/dayz_code/system/scheduler/sched_medical.sqf +++ b/SQF/dayz_code/system/scheduler/sched_medical.sqf @@ -17,10 +17,8 @@ sched_medical_slow = { // 10 seconds sched_medical_init = { [ []spawn{} ] }; sched_medical = { // 1 second HIDE_FSM_VARS - - private ["_unconHdlr","_lowBlood"]; - _unconHdlr = _this select 0; + local _unconHdlr = _this select 0; if (r_player_blood == r_player_bloodTotal) then { r_player_foodstack = 0; @@ -33,7 +31,7 @@ sched_medical = { // 1 second }; if (!canStand player) then { // be consistant with player_updateGui.sqf - if ((player getVariable ["hit_legs", 0] < 1) OR !r_fracture_legs) then { + if ((player getVariable ["hit_legs", 0] < 1) || !r_fracture_legs) then { player setVariable ["hit_legs",1,true]; r_fracture_legs = true; }; @@ -50,8 +48,8 @@ sched_medical = { // 1 second }; "dynamicBlur" ppEffectEnable true;"dynamicBlur" ppEffectAdjust [random 4]; "dynamicBlur" ppEffectCommit 0.2; }; - _lowBlood = player getVariable ["USEC_lowBlood", false]; - if ((r_player_blood < r_player_bloodTotal) and {!_lowBlood}) then { + local _lowBlood = player getVariable ["USEC_lowBlood", false]; + if ((r_player_blood < r_player_bloodTotal) && !_lowBlood) then { player setVariable["USEC_lowBlood",true,true]; }; @@ -61,7 +59,7 @@ sched_medical = { // 1 second }; //Handle Unconscious player - if ((r_player_unconscious) and {!r_player_unconsciousInProgress} and {scriptDone _unconHdlr}) then { + if ((r_player_unconscious) && !r_player_unconsciousInProgress && (scriptDone _unconHdlr)) then { //localize "CLIENT: Start Unconscious Function"; _unconHdlr = [] spawn fnc_usec_unconscious; }; @@ -79,13 +77,11 @@ sched_medical = { // 1 second }; sched_medical_effects_init = { - private ["_hndCC", "_hndDB", "_hndRB"]; - - _hndCC = ppEffectCreate ["colorCorrections", 3]; + local _hndCC = ppEffectCreate ["colorCorrections", 3]; _hndCC ppEffectEnable true; - _hndDB = ppEffectCreate ["dynamicBlur", 2]; + local _hndDB = ppEffectCreate ["dynamicBlur", 2]; _hndDB ppEffectEnable true; - _hndRB = ppEffectCreate ["radialBlur", 1]; + local _hndRB = ppEffectCreate ["radialBlur", 1]; _hndRB ppEffectEnable true; _hndRB ppEffectAdjust [0, 0, 0.5, 0.5]; _hndRB ppEffectCommit 0; @@ -97,12 +93,12 @@ sched_medical_effects = { // every 2 seconds: // change saturation, blur and vignetting according to blood level // Shivering if character temperature is near the minimum - - private ["_hndCC", "_hndDB", "_tmp1", "_tmp2", "_tmp3","_hndRB"]; - - _hndCC = _this select 0; - _hndDB = _this select 1; - _hndRB = _this select 2; + local _hndCC = _this select 0; + local _hndDB = _this select 1; + local _hndRB = _this select 2; + local _tmp1 = 0; + local _tmp2 = 0; + local _tmp3 = 0; if (r_player_infected) then { _tmp1 = 0.4 + 0.06 * cos(diag_tickTime * 360 / 12); @@ -131,7 +127,7 @@ sched_medical_effects = { [_hndCC, _hndDB, _hndRB] ppEffectCommit 1.5; //Add Shivering - if (dayz_temperatur <= (0.125 * (dayz_temperaturmax - dayz_temperaturmin) + dayz_temperaturmin) and {(vehicle player == player and speed player < 5) or (vehicle player != player)}) then { + if (dayz_temperatur <= (0.125 * (dayz_temperaturmax - dayz_temperaturmin) + dayz_temperaturmin) && {((vehicle player == player) && (speed player < 5)) || (vehicle player != player)}) then { addCamShake [0.6 * (dayz_temperaturmin / dayz_temperatur), 2, 30]; }; @@ -142,7 +138,7 @@ sched_medical_effectsSlow = { // every 10 seconds HIDE_FSM_VARS - if (!r_player_unconscious && {r_player_infected or r_player_inpain}) then { + if (!r_player_unconscious && {r_player_infected || r_player_inpain}) then { //Original pain shake was stronger [2, 1, 25] //Low blood still uses strong shake in init_medical.sqf addCamShake [1, 1, 20]; @@ -150,7 +146,7 @@ sched_medical_effectsSlow = { if (!r_player_infected) then { playSound "breath_1"; //In pain } else { - if ((1 > random 2) && {speed player < 5 or {vehicle player != player}}) then { + if ((1 > random 2) && {speed player < 5 || {vehicle player != player}}) then { [player,"cough",1,false] call dayz_zombieSpeak; }; }; diff --git a/SQF/dayz_code/system/scheduler/sched_oneachframe.sqf b/SQF/dayz_code/system/scheduler/sched_oneachframe.sqf index e6889913f..0265b02bc 100644 --- a/SQF/dayz_code/system/scheduler/sched_oneachframe.sqf +++ b/SQF/dayz_code/system/scheduler/sched_oneachframe.sqf @@ -10,8 +10,7 @@ sched_onEachFrame_init = { }; sched_onEachFrame = { - private ["_ret"]; - _ret = (1==0); + local _ret = (1==0); if (diag_fpsmin < 10) then { sched_ef_lowFPSctr = sched_ef_lowFPSctr +1; diff --git a/SQF/dayz_code/system/scheduler/sched_security.sqf b/SQF/dayz_code/system/scheduler/sched_security.sqf index 129d1e89e..16f328393 100644 --- a/SQF/dayz_code/system/scheduler/sched_security.sqf +++ b/SQF/dayz_code/system/scheduler/sched_security.sqf @@ -6,14 +6,12 @@ sched_security_init = { }; sched_security = { - private ["_netid","_timeTrickCount","_idTrickCount","_time","_otime","_pid", "_quit", "_list"]; - - _netid = _this select 0; - _otime = _this select 1; - _idTrickCount = _this select 2; - _timeTrickCount = _this select 3; - _grp = _this select 4; - _time = time; + local _netid = _this select 0; + local _otime = _this select 1; + local _idTrickCount = _this select 2; + local _timeTrickCount = _this select 3; + local _grp = _this select 4; + local _time = time; if (typeName player != "OBJECT") then { PVDZ_sec_atp = format["WARNING typename error for play3r UID#%1", getPlayerUID player]; @@ -38,7 +36,7 @@ sched_security = { }; }; - _pid = netid player; + local _pid = netid player; _idTrickCount = _idTrickCount * 0.8; if (_pid != _netid) then { _idTrickCount = _idTrickCount +1; @@ -50,13 +48,13 @@ sched_security = { if (isNull _grp) then { _grp = group ((entities 'FunctionsManager') select 0); }; if (!isNull _grp) then { - _list = units _grp; + local _list = units _grp; if (count _list > 1) then { - _quit = false; + local _quit = false; for "_i" from 2 to (count _list)-1 do { - _u = (_list select _i); + local _u = (_list select _i); if (!isNull _u) then { - _pos = getPosATL _u; + local _pos = getPosATL _u; PVDZ_sec_atp = format ["From play3r UID#%1: illegal gr0up m3mber %2 at %3,%4... Server may be compromised!", getPlayerUID player, typeOf _u, _pos select 0, _pos select 1]; publicVariableServer "PVDZ_sec_atp"; deleteVehicle _u; diff --git a/SQF/dayz_code/system/scheduler/sched_throwable.sqf b/SQF/dayz_code/system/scheduler/sched_throwable.sqf index a2c65f722..350fe5287 100644 --- a/SQF/dayz_code/system/scheduler/sched_throwable.sqf +++ b/SQF/dayz_code/system/scheduler/sched_throwable.sqf @@ -12,10 +12,8 @@ sched_throwable_init = { }; sched_throwable = { - private ["_stance","_cur_muzz","_type", "_x"]; - if ((!isNil "player") and {(!isNull player)}) then { - _cur_muzz = currentMuzzle player; + local _cur_muzz = currentMuzzle player; if (((!isNil "_cur_muzz") and {(_cur_muzz != "")}) AND {(0 == getNumber(configFile >> "CfgWeapons" >> _cur_muzz >> "type"))}) then { if (sched_throwable_prevmuzz != _cur_muzz) then { sched_throwable_prevmuzz = currentMuzzle player; @@ -26,9 +24,9 @@ sched_throwable = { }; }; if (abs(sched_throwable_time-diag_tickTime)<2) then { - _stance = toArray (animationState player); + local _stance = toArray (animationState player); _stance = if ((!isNil "_stance") and {(count _stance>17)}) then {toString [_stance select 17]} else {""}; - _type = 4096; + local _type = 4096; switch _stance do { case "p": { _type = 2; }; case "r": { _type = 1; }; diff --git a/SQF/dayz_server/compile/server_playerSync.sqf b/SQF/dayz_server/compile/server_playerSync.sqf index c85032263..3ae756a3d 100644 --- a/SQF/dayz_server/compile/server_playerSync.sqf +++ b/SQF/dayz_server/compile/server_playerSync.sqf @@ -1,25 +1,18 @@ #include "\z\addons\dayz_server\compile\server_toggle_debug.hpp" -private ["_distanceFoot","_playerPos","_lastPos","_playerGear","_medical","_currentModel","_currentAnim", -"_currentWpn","_muzzles","_array","_coins","_key","_globalCoins","_bankCoins","_playerBackp","_exitReason", -"_backpack","_kills","_killsB","_killsH","_headShots","_humanity","_lastTime","_timeGross","_timeSince", -"_timeLeft","_config","_onLadder","_isTerminal","_modelChk","_temp","_currentState","_character", -"_magazines","_characterID","_charPos","_isInVehicle","_name","_inDebug","_newPos","_count","_maxDist","_relocate","_playerUID","_statsDiff"]; -//[player,array] - -_character = _this select 0; -_magazines = _this select 1; +local _character = _this select 0; +local _magazines = _this select 1; local _dayz_onBack = _this select 2; -_characterID = _character getVariable ["characterID","0"]; -_playerUID = getPlayerUID _character; -_charPos = getPosATL _character; -_isInVehicle = vehicle _character != _character; -_timeSince = 0; -_humanity = 0; -_name = if (alive _character) then {name _character} else {"Dead Player"}; -_inDebug = (respawn_west_original distance _charPos) < 1500; +local _characterID = _character getVariable ["characterID","0"]; +local _playerUID = getPlayerUID _character; +local _charPos = getPosATL _character; +local _isInVehicle = vehicle _character != _character; +local _timeSince = 0; +local _humanity = 0; +local _name = if (alive _character) then {name _character} else {"Dead Player"}; +local _inDebug = (respawn_west_original distance _charPos) < 1500; -_exitReason = call { +local _exitReason = call { if (isNil "_characterID") exitwith {("ERROR: Cannot Sync Character " + _name + " has nil characterID")}; //Unit is null if (_inDebug) exitwith {format["INFO: Cannot Sync Character %1 near respawn_west %2. This is normal when relogging or changing clothes.",_name,_charPos]}; if (_characterID == "0") exitwith {("ERROR: Cannot Sync Character " + _name + " has no characterID")}; @@ -32,31 +25,32 @@ if (_exitReason != "none") exitWith { }; //Check for player initiated updates -_playerPos = []; -_playerGear = []; -_playerBackp = []; -_medical = []; -_distanceFoot = 0; +local _playerPos = []; +local _playerGear = []; +local _playerBackp = []; +local _medical = []; +local _distanceFoot = 0; //all getVariable immediately -_globalCoins = _character getVariable ["globalMoney", -1]; -_bankCoins = _character getVariable ["bankMoney", -1]; -_coins = _character getVariable ["cashMoney", -1]; //should getting coins fail set the variable to an invalid value to prevent overwritting the in the DB -_lastPos = _character getVariable ["lastPos",_charPos]; -_usec_Dead = _character getVariable ["USEC_isDead",false]; -_lastTime = _character getVariable ["lastTime",-1]; -_modelChk = _character getVariable ["model_CHK",""]; -_temp = round (_character getVariable ["temperature",100]); -_lastMagazines = _character getVariable ["ServerMagArray",[[],""]]; +local _globalCoins = _character getVariable ["globalMoney", -1]; +local _bankCoins = _character getVariable ["bankMoney", -1]; +local _coins = _character getVariable ["cashMoney", -1]; //should getting coins fail set the variable to an invalid value to prevent overwritting the in the DB +local _lastPos = _character getVariable ["lastPos",_charPos]; +local _usec_Dead = _character getVariable ["USEC_isDead",false]; +local _lastTime = _character getVariable ["lastTime",-1]; +local _modelChk = _character getVariable ["model_CHK",""]; +local _temp = round (_character getVariable ["temperature",100]); +local _lastMagazines = _character getVariable ["ServerMagArray",[[],""]]; //Get difference between current stats and stats at last sync -_statsDiff = [_character,_playerUID] call server_getStatsDiff; +local _statsDiff = [_character,_playerUID] call server_getStatsDiff; _humanity = _statsDiff select 0; -_kills = _statsDiff select 1; -_headShots = _statsDiff select 2; -_killsH = _statsDiff select 3; -_killsB = _statsDiff select 4; +local _kills = _statsDiff select 1; +local _headShots = _statsDiff select 2; +local _killsH = _statsDiff select 3; +local _killsB = _statsDiff select 4; -_charPosLen = count _charPos; +local _charPosLen = count _charPos; +local _magTemp = []; if (!isNil "_magazines") then { _playerGear = [weapons _character,_magazines,_dayz_onBack]; @@ -67,13 +61,13 @@ if (!isNil "_magazines") then { if (count _magTemp > 0) then { _magazines = [(magazines _character),20] call array_reduceSize; { - _class = _x; + local _class = _x; if (typeName _x == "ARRAY") then { _class = _x select 0; }; if (_class in _magazines) then { - _MatchedCount = {_compare = if (typeName _x == "ARRAY") then {_x select 0;} else {_x}; _compare == _class} count _magTemp; - _CountedActual = {_x == _class} count _magazines; + local _MatchedCount = {_compare = if (typeName _x == "ARRAY") then {_x select 0;} else {_x}; _compare == _class} count _magTemp; + local _CountedActual = {_x == _class} count _magazines; if (_MatchedCount > _CountedActual) then { _magTemp set [_forEachIndex, "0"]; }; @@ -100,7 +94,7 @@ if !((_charPos select 0 == 0) && (_charPos select 1 == 0)) then { }; //Check player backpack each time sync runs -_backpack = unitBackpack _character; +local _backpack = unitBackpack _character; _playerBackp = [typeOf _backpack,getWeaponCargo _backpack,getMagazineCargo _backpack]; if (!_usec_Dead) then { @@ -112,23 +106,24 @@ _character addScore _kills; Assess how much time has passed, for recording total time on server Note "lastTime" is -1 after clothes change */ +local _timeLeft = 0; if (_lastTime == -1) then { _character setVariable ["lastTime",diag_tickTime,false]; } else { - _timeGross = (diag_tickTime - _lastTime); + local _timeGross = (diag_tickTime - _lastTime); _timeSince = floor (_timeGross / 60); _timeLeft = (_timeGross - (_timeSince * 60)); }; /* Get character state details */ -_currentWpn = currentMuzzle _character; -_currentAnim = animationState _character; -_config = configFile >> "CfgMovesMaleSdr" >> "States" >> _currentAnim; -_onLadder = (getNumber (_config >> "onLadder")) == 1; -_isTerminal = (getNumber (_config >> "terminal")) == 1; +local _currentWpn = currentMuzzle _character; +local _currentAnim = animationState _character; +local _config = configFile >> "CfgMovesMaleSdr" >> "States" >> _currentAnim; +local _onLadder = (getNumber (_config >> "onLadder")) == 1; +local _isTerminal = (getNumber (_config >> "terminal")) == 1; //_wpnDisabled = (getNumber (_config >> "disableWeapons")) == 1; -_currentModel = typeOf _character; +local _currentModel = typeOf _character; if (_currentModel == _modelChk) then { _currentModel = ""; } else { @@ -152,14 +147,14 @@ if (count _this > 4) then { //calling from player_onDisconnect }; if (_isInVehicle) then { //if the player object is inside a vehicle lets eject the player - _relocate = ((vehicle _character isKindOf "Air") && (_charPos select 2 > 1.5)); + local _relocate = ((vehicle _character isKindOf "Air") && (_charPos select 2 > 1.5)); _character action ["eject", vehicle _character]; // Prevent relog in parachute, heli or plane above base exploit to get inside if (_relocate) then { - _count = 0; - _maxDist = 800; - _newPos = [_charPos, 80, _maxDist, 10, 1, 0, 0, [], [_charPos,_charPos]] call BIS_fnc_findSafePos; + local _count = 0; + local _maxDist = 800; + local _newPos = [_charPos, 80, _maxDist, 10, 1, 0, 0, [], [_charPos,_charPos]] call BIS_fnc_findSafePos; while {_newPos distance _charPos == 0} do { _count = _count + 1; @@ -168,7 +163,7 @@ if (count _this > 4) then { //calling from player_onDisconnect }; _newPos set [2,0]; //findSafePos only returns two elements _charPos = _newPos; - diag_log format["%1(%2) logged out in air vehicle. Relocated to safePos.",_name,_playerUID]; + diag_log format["%1(%2) logged out in air vehicle. Relocated to safePos %3 - %4.",_name,_playerUID,mapGridPosition _charPos,_charPos]; }; }; }; @@ -184,14 +179,14 @@ if (_isInVehicle) then { _currentWpn = ""; } else { if (typeName _currentWpn == "STRING") then { - _muzzles = getArray (configFile >> "cfgWeapons" >> _currentWpn >> "muzzles"); + local _muzzles = getArray (configFile >> "cfgWeapons" >> _currentWpn >> "muzzles"); if (count _muzzles > 1) then {_currentWpn = currentMuzzle _character;}; } else { //diag_log ("DW_DEBUG: _currentWpn: " + str(_currentWpn)); _currentWpn = ""; }; }; -_currentState = [[_currentWpn,_currentAnim,_temp],[]]; +local _currentState = [[_currentWpn,_currentAnim,_temp],[]]; //Reset timer if (_timeSince > 0) then { @@ -203,7 +198,7 @@ if (_timeSince > 0) then { Low priority code below this point where _character object is no longer needed and may be Null. */ if (count _playerPos > 0) then { - _array = []; + local _array = []; { if (_x > dayz_minpos && _x < dayz_maxpos) then {_array set [count _array,_x];}; } forEach (_playerPos select 1); @@ -211,7 +206,7 @@ if (count _playerPos > 0) then { }; //Wait for HIVE to be free and send request -_key = if (Z_SingleCurrency) then { +local _key = if (Z_SingleCurrency) then { str formatText["CHILD:201:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:",_characterID,_playerPos,_playerGear,_playerBackp,_medical,false,false,_kills,_headShots,_distanceFoot,_timeSince,_currentState,_killsH,_killsB,_currentModel,_humanity,_coins] } else { str formatText["CHILD:201:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:",_characterID,_playerPos,_playerGear,_playerBackp,_medical,false,false,_kills,_headShots,_distanceFoot,_timeSince,_currentState,_killsH,_killsB,_currentModel,_humanity]