From a02b021dafac3edde4b57d9a802b3c50baff9656 Mon Sep 17 00:00:00 2001 From: vbawol Date: Sat, 22 Jun 2013 11:59:43 -0500 Subject: [PATCH] increase chances to catch fish from boat and add fish to boat --- dayz_code/actions/player_goFishing.sqf | 25 ++++++++++++++++++++++--- dayz_code/config.cpp | 2 +- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/dayz_code/actions/player_goFishing.sqf b/dayz_code/actions/player_goFishing.sqf index 0ba764e81..f8e20ed7d 100644 --- a/dayz_code/actions/player_goFishing.sqf +++ b/dayz_code/actions/player_goFishing.sqf @@ -36,13 +36,32 @@ while {_isOk} do { sleep 2; - // TODO: increase chance the deaper the water. + _rnd = 100; + + // check if player is in boat + _vehicle = vehicle player; + _inVehicle = (_vehicle != player); + if(_inVehicle) then { + if(_vehicle isKindOf "Ship") then { + _rnd = 50; + }; + }; + // 1% chance to catch anything - if((random 100) <= 1) then { + if((random _rnd) <= 1) then { // Just the one fish for now _itemOut = ["ItemTrout","ItemTrout","ItemTrout","ItemTrout","ItemTrout","ItemTrout","ItemTrout","ItemSeaBass","ItemSeaBass","ItemTuna"] call BIS_fnc_selectRandom; - player addMagazine _itemOut; + + if(_inVehicle) then { + _item = _vehicle; + _itemtodrop = _itemOut; + _item addMagazineCargoGlobal [_itemtodrop,1]; + } else { + player addMagazine _itemOut; + }; + + cutText ["You caught a fish.", "PLAIN DOWN"]; _isOk = false; } else { diff --git a/dayz_code/config.cpp b/dayz_code/config.cpp index a397c2b42..a0a4d5ff6 100644 --- a/dayz_code/config.cpp +++ b/dayz_code/config.cpp @@ -21,7 +21,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = 0.1; - requiredAddons[] = {"dayz_equip","dayz_weapons","dayz_sfx","CAMisc3","CABuildingParts","CABuildingParts_Signs","CAStructuresHouse","CAStructuresLand_Ind_Stack_Big","CAStructures_Misc_Powerlines","CAStructures","CABuildings","CABuildings2","Ind_MalyKomin","CAStructures_A_CraneCon","CAStructures_Mil","CAStructures_Nav","CAStructures_Rail","A_Crane_02","A_TVTower","CAStructures_Railway","CAStructuresHouse","CAStructuresHouse_HouseBT","asc_eu_lights","vilas_pl_cars"}; + requiredAddons[] = {"dayz_equip","dayz_weapons","dayz_sfx","CAMisc3","CABuildingParts","CABuildingParts_Signs","CAStructuresHouse","CAStructuresLand_Ind_Stack_Big","CAStructures_Misc_Powerlines","CAStructures","CABuildings","CABuildings2","Ind_MalyKomin","CAStructures_A_CraneCon","CAStructures_Mil","CAStructures_Nav","CAStructures_Rail","A_Crane_02","A_TVTower","CAStructures_Railway","CAStructuresHouse","CAStructuresHouse_HouseBT","asc_eu_lights","vilas_pl_cars","gnt_c185"}; }; class DZ_DebriefingRemoved {