From aa70eedaf9a2f15ccd05df240480fe7927c3be47 Mon Sep 17 00:00:00 2001 From: vbawol Date: Mon, 14 Dec 2015 12:09:09 -0600 Subject: [PATCH] 0.3.6.011 --- Changelogs/0.3.6.0.txt | 3 +- Server_Install_Pack/sc/battleye/scripts.txt | 2 +- .../compile/setup/masterLoop/Event2.sqf | 3 + .../traders/EPOCH_NPCTraderMenuFilter.sqf | 44 +++++++++++- .../compile/traders/EPOCH_startNpcTrade.sqf | 72 +++++++++++++++++-- 5 files changed, 113 insertions(+), 11 deletions(-) diff --git a/Changelogs/0.3.6.0.txt b/Changelogs/0.3.6.0.txt index d6957dd6..559b1fe7 100644 --- a/Changelogs/0.3.6.0.txt +++ b/Changelogs/0.3.6.0.txt @@ -1,5 +1,6 @@ **Client** - +[Added] Added ability to sell Primary weapon from hands and empty backpacks. Thanks to @He-Man +[Fixed] Unable to sell after attempting to sell a temporary vehicle. Thanks to @He-Man [Fixed] Updated Hitpoints to 1.54 for all custom Epoch characters, this fixes the hitpoint .rpt errors since 1.54 as well. [Fixed] Reduce run speed of Sappers since 1.54 update. [Fixed] Wood tower "add/remove wall" options are now only available when build mode is enabled. diff --git a/Server_Install_Pack/sc/battleye/scripts.txt b/Server_Install_Pack/sc/battleye/scripts.txt index fc477658..42041867 100644 --- a/Server_Install_Pack/sc/battleye/scripts.txt +++ b/Server_Install_Pack/sc/battleye/scripts.txt @@ -25,7 +25,7 @@ 7 addMagazine !"addMagazineCargo" !="player addMagazine _craftItem;" !="player addMagazine \"jerrycanE_epoch\";" !="player addMagazine \"emptyjar_epoch\";" !="player addMagazine \"jerrycan_epoch\";" !="player addMagazine \"Hatchet_swing\";" !="player addMagazine [(_x select 0),(_x select 1)]" !="player addMagazine _x;" !="if !(player canAdd (_x select 0)) exitWith {};\nplayer addMagazine[_x select 0, _x select 1];" 7 addMagazineCargo !"_dogHolder addMagazineCargo [\"RabbitCarcass_EPOCH\", 1]" !"_dogHolder addMagazineCargo [\"Pelt_EPOCH\", 1]" !"_dogHolder addMagazineCargo [\"Venom_EPOCH\", 1]" !"_dogHolder addMagazineCargo [\"SnakeCarcass_EPOCH\", 1]" !"_dogHolder addMagazineCargo [\"ChickenCarcass_EPOCH\", 1]" !="_acceptHolder addMagazineCargo [_wAmmo, 1] ;" 7 addItem !="player addItem _item;" !="player addItem _craftItem;" !="player addItem _x;" !="_plyr addItemToVest _missionItem;" !="axeVIP addItemToVest _item;" !="_plyr addItemToVest _missionItem;" !="EPOCH_fnc_addItemOverflow" -7 addBackPack +7 addBackPack !="if (backpack player == "") then {\nplayer addbackpack _x;\n}\nelse {\n_x createvehicle getpos player;\n};" 7 addMissionEventHandler !="addMissionEventHandler ['Draw3D',_var + \"call Epoch_gui3DCooldownEH;\"];" !="addMissionEventHandler ['Draw3D',_var + \"call epoch_gui3dModelPosEH;\"];" !="addMissionEventHandler ['Draw3D',_var + \"call epoch_gui3dWorldPosEH;\"];" !="addMissionEventHandler [\n"ended",\n{\n\nBIS_fnc_missionHandlers_end = _this;" 7 removeMissionEventHandler !="removeMissionEventHandler [\"Draw3D\", _id];" 7 removeAllWeapons !="removeAllWeapons axeGeneral;" diff --git a/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf b/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf index 7afca83a..b0148650 100644 --- a/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf +++ b/Sources/epoch_code/compile/setup/masterLoop/Event2.sqf @@ -92,3 +92,6 @@ call _lootBubble; EPOCH_playerStaminaMax = (100 * (round(EPOCH_playerAliveTime/360)/10)) min 2500; + + //player setAnimSpeedCoef 0.75; + //player setCustomAimCoef 1; diff --git a/Sources/epoch_code/compile/traders/EPOCH_NPCTraderMenuFilter.sqf b/Sources/epoch_code/compile/traders/EPOCH_NPCTraderMenuFilter.sqf index 3283eae5..4b215fa2 100644 --- a/Sources/epoch_code/compile/traders/EPOCH_NPCTraderMenuFilter.sqf +++ b/Sources/epoch_code/compile/traders/EPOCH_NPCTraderMenuFilter.sqf @@ -1,3 +1,27 @@ +/* + Author: Aaron Clark - EpochMod.com + + Contributors: He-Man + + Description: + NPC trade filter code + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/master/Sources/epoch_code/traders/EPOCH_NPCTraderMenuFilter.sqf + + Example: + onLBSelChanged = "_this call EPOCH_NPCTraderMenuFilter"; + + Parameter(s): + _this select 0: CONTROL + _this select 1: NUMBER - Index ID + + Returns: + NOTHING +*/ private ["_item","_index","_itemCount","_itemOfferCount","_config","_name","_picture","_type","_vehicles","_sizeOut","_offerArray","_itemName","_itemIcon","_qty","_items","_qtys","_aiItems","_filterArray","_filterWeapons","_filterMagazines","_filterItems","_filterVehicle","_slot","_control","_isPlayerFilter"]; disableSerialization; @@ -54,7 +78,7 @@ if !(isNull EPOCH_lastNPCtradeTarget) then { }; } forEach magazines player; }; - + /* not used currently if (_filterWeapons) then { }; @@ -72,6 +96,20 @@ if !(isNull EPOCH_lastNPCtradeTarget) then { lbSetPicture [41500, _index, _x call EPOCH_itemPicture]; }; } forEach items player; + if (primaryWeapon player != "") then { + _wpn = primaryWeapon player; + _offerArray pushback _wpn; + _index = lbAdd [41500, _wpn call EPOCH_itemDisplayName]; + lbSetData [41500, _index, _wpn]; + lbSetPicture [41500, _index, _wpn call EPOCH_itemPicture]; + }; + if (count backpackItems player == 0 && count backpackmagazines player == 0 && backpack player != "") then { + _bpck = Backpack player; + _offerArray pushback _bpck; + _index = lbAdd [41500, _bpck call EPOCH_itemDisplayName]; + lbSetData [41500, _index, _bpck]; + lbSetPicture [41500, _index, _bpck call EPOCH_itemPicture]; + }; }; if (_filterVehicle) then { @@ -98,7 +136,7 @@ if !(isNull EPOCH_lastNPCtradeTarget) then { }; } else { - + lbClear 41503; _sizeOut = lbSize 41502; @@ -157,4 +195,4 @@ if !(isNull EPOCH_lastNPCtradeTarget) then { }; } else { closeDialog 0; -}; \ No newline at end of file +}; diff --git a/Sources/epoch_code/compile/traders/EPOCH_startNpcTrade.sqf b/Sources/epoch_code/compile/traders/EPOCH_startNpcTrade.sqf index c295825e..e9cf10f4 100644 --- a/Sources/epoch_code/compile/traders/EPOCH_startNpcTrade.sqf +++ b/Sources/epoch_code/compile/traders/EPOCH_startNpcTrade.sqf @@ -1,3 +1,26 @@ +/* + Author: Aaron Clark - EpochMod.com + + Contributors: He-Man + + Description: + NPC trade code + + Licence: + Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike + + Github: + https://github.com/EpochModTeam/Epoch/tree/master/Sources/epoch_code/traders/EPOCH_startNpcTrade.sqf + + Example: + cursorTarget call EPOCH_startNpcTrade; + + Parameter(s): + _this: OBJECT + + Returns: + NOTHING +*/ private["_item", "_currQty", "_tradeType", "_itemWorth", "_aiItems", "_itemClasses", "_itemQtys", "_qtyIndex", "_tradeTotal", "_tradeQtyTotal", "_errorMsg", "_target", "_sizeOut", "_array", "_makeTrade", "_vehSlot", "_vehicle", "_vehicles", "_display", "_addWeaponToHands", "_type", "_tax"]; if (!isNil "EPOCH_TRADE_COMPLETE") exitWith {}; @@ -5,7 +28,6 @@ if (!isNil "EPOCH_TRADE_STARTED") exitWith{}; if (!isNull _this) then { - EPOCH_TRADE_STARTED = true; _config = 'CfgPricing' call EPOCH_returnConfig; @@ -25,9 +47,21 @@ if (!isNull _this) then { if (_item in items player) then { player removeItem _item; _arrayIn pushBack _item; + } + else { + if (_item == primaryweapon player) then { + player removeweapon _item; + _arrayIn pushBack _item; }; - } else { + }; + } + else { if ([_item, "CfgVehicles"] call EPOCH_fnc_isAny) then { + if (_item == backpack player) then { + removeBackpack player; + _arrayIn pushBack _item; + } + else { _vehicles = _this nearEntities[[_item], 30]; if (!(_vehicles isEqualTo[])) then { _vehicle = _vehicles select 0; @@ -41,7 +75,9 @@ if (!isNull _this) then { }; }; }; - } else { + }; + } + else { if (_item in magazines player) then { player removeMagazine _item; _arrayIn pushBack _item; @@ -78,6 +114,7 @@ if (!isNull _this) then { }; if (!(_arrayIn isEqualTo[]) || !(_arrayOut isEqualTo[])) then { + EPOCH_TRADE_STARTED = true; // make trade EPOCH_MAKENPCTRADE = [_this, _arrayIn, _arrayOut, player, Epoch_personalToken]; @@ -133,17 +170,40 @@ if (!isNull _this) then { }; if (_addWeaponToHands) then { player addWeapon _x; - } else { + } + else { _x call EPOCH_fnc_addItemOverflow; }; - } else { + } + else { + _backpack = ["backpack", _x] call BIS_fnc_inString; + _Assaultpack = ["Assaultpack", _x] call BIS_fnc_inString; + _Assault_Diver = ["Assault_Diver", _x] call BIS_fnc_inString; + _TacticalPack = ["TacticalPack", _x] call BIS_fnc_inString; + _FieldPack = ["FieldPack", _x] call BIS_fnc_inString; + _Carryall = ["Carryall", _x] call BIS_fnc_inString; + _OutdoorPack = ["OutdoorPack", _x] call BIS_fnc_inString; + _Bergen = ["Bergen", _x] call BIS_fnc_inString; + _bag = ["bag", _x] call BIS_fnc_inString; + _parachute = ["Parachute", _x] call BIS_fnc_inString; + if (_backpack || _Assaultpack || _Assault_Diver || _TacticalPack || _FieldPack || _Carryall || _OutdoorPack || _Bergen || _bag || _parachute) then { + if (backpack player == "") then { + player addbackpack _x; + } + else { + _x createvehicle getpos player; + }; + } + else { if ([_x, "CfgMagazines"] call EPOCH_fnc_isAny) then { _errorMsg = _errorMsg + format["%1, ", getText(configfile >> "CfgMagazines" >> (_x) >> "displayName")]; _x call EPOCH_fnc_addItemOverflow; - } else { + } + else { _errorMsg = _errorMsg + format["%1, ", getText(configfile >> "CfgVehicles" >> (_x) >> "displayName")]; }; }; + }; } forEach(_this select 1);