diff --git a/dayz_code/CfgWeapons.hpp b/dayz_code/CfgWeapons.hpp index fd4ada34f..514d5a4a8 100644 --- a/dayz_code/CfgWeapons.hpp +++ b/dayz_code/CfgWeapons.hpp @@ -10,8 +10,12 @@ class CfgWeapons { libtextdesc = "Debug Map - Admin use only"; }; }; - class ItemSmeltingKit: ItemCore { - displayname = "Smelting Kit"; + class ItemKeyKit: ItemCore { + scope = 2; + displayname = "Keymakers kit"; + model="\dayz_equip\models\keykit.p3d"; + descriptionShort="Kit including the tools required to smelt, mold and shape keys."; + picture="\dayz_equip\textures\equip_keykit_ca.paa"; }; class ItemAnvil: ItemCore { displayname = "Anvil"; @@ -298,6 +302,14 @@ class CfgWeapons { displayname = "Black Key"; keyid = 0; scope = 2; + class ItemActions + { + class Toolbelt + { + text="Make Copy"; + script="spawn player_copyKey;"; + }; + }; }; class ItemKeyBlack: ItemKey { keyid = 0; diff --git a/dayz_code/actions/player_copyKey.sqf b/dayz_code/actions/player_copyKey.sqf new file mode 100644 index 000000000..bfc105977 --- /dev/null +++ b/dayz_code/actions/player_copyKey.sqf @@ -0,0 +1,68 @@ +private["_item","_config","_onLadder","_create","_isOk","_config2","_consume"]; + +if(TradeInprogress) exitWith { cutText ["Copy key already in progress." , "PLAIN DOWN"]; }; +TradeInprogress = true; + +_item = _this; +_config = configFile >> "cfgWeapons" >> _item; + +_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1; +if (_onLadder) exitWith {TradeInprogress = false; cutText [(localize "str_player_21") , "PLAIN DOWN"]}; + +_text = getText (_config >> "displayName"); +_haskey = _this in weapons player; +if (!_haskey) exitWith {TradeInprogress = false; cutText [format[(localize "str_player_30"),_text] , "PLAIN DOWN"]}; + +_hastoolweapon = "ItemKeyKit" in weapons player; +if (!_hastoolweapon) exitWith {TradeInprogress = false; cutText ["Need Keymakers kit to make a copy of a key." , "PLAIN DOWN"]}; + +_isNear = {inflamed _x} count (position player nearObjects 2); +if(_isNear == 0) exitWith {TradeInprogress = false; cutText ["Key crafting needs a fire within 2 meters." , "PLAIN DOWN"]}; + +call gear_ui_init; + +// require one tin bar per key +_hasTinBar = "ItemTinBar" in _magazinesPlayer; +if(!_hasTinBar) exitWith {TradeInprogress = false; cutText ["Key crafting requires a 1oz Tin Bar." , "PLAIN DOWN"]}; + +player playActionNow "Medic"; + +[player,"repair",0,false] call dayz_zombieSpeak; +[player,50,true,(getPosATL player)] spawn player_alertZombies; + +r_interrupt = false; +_animState = animationState player; +r_doLoop = true; +_started = false; +_finished = false; + +while {r_doLoop} do { + _animState = animationState player; + _isMedic = ["medic",_animState] call fnc_inString; + if (_isMedic) then { + _started = true; + }; + if (_started and !_isMedic) then { + r_doLoop = false; + _finished = true; + }; + if (r_interrupt) then { + r_doLoop = false; + }; + sleep 0.1; +}; +r_doLoop = false; + +_num_removed = ([player,"ItemTinBar"] call BIS_fnc_invRemove); + +if(_finished and _num_removed == 1) then { + // output key to backpack if space + _create = _item; + _qty = 1; + _box = unitBackpack player; + _box addWeaponCargoGlobal [_create,_qty]; + cutText ["Copied key has been added to your backpack." , "PLAIN DOWN"]; +} else { + cutText ["Canceled Key Crafting." , "PLAIN DOWN"]; +}; +TradeInprogress = false; diff --git a/dayz_code/cfgVehicles.hpp b/dayz_code/cfgVehicles.hpp index 3f08b08b6..b9d4b92c3 100644 --- a/dayz_code/cfgVehicles.hpp +++ b/dayz_code/cfgVehicles.hpp @@ -1391,13 +1391,13 @@ class Citizen1; // External class reference model = "\ibr\ibr_plants\fuelstation_army"; transportFuel = 0; nameSound = "fuelstation"; - } + }; // lingor class Land_fuelstation : Strategic { model = "\ibr\ibr_plants\fuelstation"; transportFuel = 0; nameSound = "fuelstation"; - } + }; // Lingor hangars class land_ibr_hangar : House { model = "\ibr\ibr_hangars\ibr_hangar"; diff --git a/dayz_code/config.cpp b/dayz_code/config.cpp index 479fcec62..8a5126172 100644 --- a/dayz_code/config.cpp +++ b/dayz_code/config.cpp @@ -584,7 +584,8 @@ class CfgBuildingLoot { { "ItemKnife","military" }, { "ItemToolbox","weapon" }, { "ItemWire","magazine" }, - {"ItemTankTrap","magazine"} + {"ItemTankTrap","magazine"}, + {"ItemKeyKit","weapon"} }; itemChance[] = { 0.005, @@ -603,7 +604,8 @@ class CfgBuildingLoot { 0.07, 0.06, 0.01, - 0.04 + 0.04, + 0.005 }; }; class Farm: Default { @@ -680,7 +682,8 @@ class CfgBuildingLoot { {"Crossbow_DZ","weapon"}, { "Binocular","weapon" }, { "PartWoodPile","magazine" }, - {"MR43","weapon"} + {"MR43","weapon"}, + {"ItemKeyKit","weapon"} }; itemChance[] = { 0.15, @@ -710,7 +713,8 @@ class CfgBuildingLoot { 0.01, 0.05, 0.02, - 0.01 + 0.01, + 0.005 }; }; class HeliCrash: Default { @@ -1591,7 +1595,7 @@ class HeliCrash_No50s: Default { { maxRoaming = 1; lootPos[] = {{-0.582031,1.65479,1.35687},{0.116211,0.839355,1.39404},{-0.0498047,1.93262,1.3551}}; - } + }; class Land_Shed_W03_EP1: Residential { maxRoaming = 3; diff --git a/dayz_code/init/compiles.sqf b/dayz_code/init/compiles.sqf index 3284d0b26..766eeb871 100644 --- a/dayz_code/init/compiles.sqf +++ b/dayz_code/init/compiles.sqf @@ -73,6 +73,7 @@ if (!isDedicated) then { //actions player_countmagazines = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_countmagazines.sqf"; player_addToolbelt = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_addToolbelt.sqf"; + player_copyKey = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_copyKey.sqf"; player_reloadMag = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_reloadMags.sqf"; player_loadCrate = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_loadCrate.sqf"; player_craftItem = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\player_craftItem.sqf"; diff --git a/dayz_code/rscTitles.hpp b/dayz_code/rscTitles.hpp index ecef03e62..a2b9dbf08 100644 --- a/dayz_code/rscTitles.hpp +++ b/dayz_code/rscTitles.hpp @@ -8,6 +8,9 @@ class RscIGUIShortcutButton; class RscGearShortcutButton; class RscIGUIListNBox; class RscActiveText; +class RscStructuredText; +class RscPictureGUI; +class RscStructuredTextGUI; class RscPictureKeepAspect; class RscStandardDisplay; diff --git a/dayz_equip/config.cpp b/dayz_equip/config.cpp index 724bfbc47..fcca37492 100644 --- a/dayz_equip/config.cpp +++ b/dayz_equip/config.cpp @@ -2780,7 +2780,7 @@ class CfgMagazines displayName = "Rainbow Trout (Cooked)"; descriptionShort = "Rainbow Trout: A small fish that can be fairly easy to catch."; model = "\dayz_equip\models\trout_cooked.p3d"; - picture = "\dayz_equip\textures\equip_rainbowtrout_cooked_CA.paa"; + picture = "\dayz_equip\textures\equip_trout_cooked_CA.paa"; bloodRegen = 800; }; class ItemSeaBassCooked : FoodEdible { @@ -2934,7 +2934,7 @@ class CfgVehicles destrType = "DestructTent"; armor = 100; GhostPreview = "Fort_RazorWirePreview"; - } + }; class Sandbag1_DZ: BuiltItems { diff --git a/dayz_equip/models/keykit.p3d b/dayz_equip/models/keykit.p3d new file mode 100644 index 000000000..3a2358dfe Binary files /dev/null and b/dayz_equip/models/keykit.p3d differ diff --git a/dayz_equip/textures/equip_keykit_ca.paa b/dayz_equip/textures/equip_keykit_ca.paa new file mode 100644 index 000000000..56e1fd7f1 Binary files /dev/null and b/dayz_equip/textures/equip_keykit_ca.paa differ diff --git a/dayz_equip/textures/keykit.rvmat b/dayz_equip/textures/keykit.rvmat new file mode 100644 index 000000000..d96dcbfaa --- /dev/null +++ b/dayz_equip/textures/keykit.rvmat @@ -0,0 +1,45 @@ +ambient[]={0.74650967,0.74192148,0.74213719,0.87}; +diffuse[]={1,1,1,0.92000002}; +forcedDiffuse[]={0,0,0,0}; +emmisive[]={0,0,0,1}; +specular[]={0.34901962,0.4509804,0.68235296,1}; +specularPower=66.599998; +PixelShaderID="NormalMapSpecularDIMap"; +VertexShaderID="NormalMap"; +class Stage1 +{ + texture="dayz_equip\textures\keykit_norm.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,1}; + pos[]={0,0,0}; + }; +}; +class Stage2 +{ + texture="dayz_equip\textures\keykit_spec.paa"; + uvSource="tex"; + class uvTransform + { + aside[]={0,0,0}; + up[]={0,0,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; + Filter="Point"; +}; +class Stage3 +{ + texture="#(ai,64,64,1)fresnel(2.68,3.69)"; + uvSource="tex"; + class uvTransform + { + aside[]={1,0,0}; + up[]={0,1,0}; + dir[]={0,0,0}; + pos[]={0,0,0}; + }; +}; diff --git a/dayz_equip/textures/keykit_diffuse.paa b/dayz_equip/textures/keykit_diffuse.paa new file mode 100644 index 000000000..89559b786 Binary files /dev/null and b/dayz_equip/textures/keykit_diffuse.paa differ diff --git a/dayz_equip/textures/keykit_norm.paa b/dayz_equip/textures/keykit_norm.paa new file mode 100644 index 000000000..6a4d40e27 Binary files /dev/null and b/dayz_equip/textures/keykit_norm.paa differ diff --git a/dayz_equip/textures/keykit_spec.paa b/dayz_equip/textures/keykit_spec.paa new file mode 100644 index 000000000..fa15ad5f6 Binary files /dev/null and b/dayz_equip/textures/keykit_spec.paa differ