Commit Graph

135 Commits

Author SHA1 Message Date
AirwavesMan
e5af93b50b Add weight to items at traders
If the weight system is active all weights of the items will be displayed on the trader infos.

Also update the trading files and replace switch with call and exitwith which is faster.
2020-09-12 03:10:31 +02:00
worldwidesorrow
e6c036454a Update z_at_sellItems.sqf 2020-07-29 15:22:52 -05:00
worldwidesorrow
fa78c3a4cc Update z_at_buyItems.sqf 2020-07-29 15:22:20 -05:00
A Man
637358b78c Add and update backapacks
-	5 new backpacks
-	19 new textures for the Czech backpack
-	2 new textures for the coyote backpack
-	reconfigured weapon count of all old backpacks
-	30 new backpack types included an upgraded version

This adds 5 new backpacks. 4 from the ice apo mod 1 from Arma 2 ACR.
This also adds many different skins for the Czech backpack thx @lennard91 and 2 new skins for the coyote backpack from the KSK Mod.
I’ve reconfigured the weapon count of the old backpacks. A weapon can be a pistol with 5 slots too. So, a Large Gunbag can hold 6 weapons or 12 pistols now. This is more intuitive as it was before. 6x10 = 60, 12x5=60 The backpack has still the same gear count as before. I removed the display info in the trader menu how many weapons a backpack can hold. This information is obsolete with this commit because a backpack with a gear count of 20 can hold 4 weapons now and it could be confusing for players if they consider only large weapons but no pistols.

We added 15 reconfigured backpack types with DZE1 as indicator. Those new backpack types have an upgraded version with DZE2 as indicator. The gear count, the names and descriptions of all new backpacks got changed.

This commit was made by @seelenapparat, @DeVloek, @airwavesman
2020-01-17 17:15:16 +01:00
icomrade
f03f2454c9 Update for A2 1.64 GetHit
Replaced vehicle sethit/setvariable method with sethit/gethit and removed setvariable "Hit_" commands for vehicles (hit_partname can now probably be added to the setvariable filters list).

Modified object_getHit.sqf return to now provide the selection name in order to reduce redundant config lookups. Returns '[Damage, Part Name]', instead of just 'Damage'

Modified vehicle_GetHitpoints.sqf to remove incorrect hipoints from returning. Previously this script would return all hitpoints from any vehicle the current vehicle config inherited from, even if the hitpoint didn't exist in the calling vehicle. this posed a problem since getHit on an invalid part name returns Nil
2018-01-21 17:26:35 -05:00
ebayShopper
2a2198af68 Fix #2007
Oversight in e1b6125
2017-12-19 13:27:11 -05:00
oiad
1941832b3b Fix https://github.com/EpochModTeam/DayZ-Epoch/issues/2006
Partial revert
9b96ddd2c3
Thanks @ndavalos
2017-12-19 19:10:49 +13:00
ebayShopper
13c90993fc Sync Zupa dialog colors
Heights on the trader menu filter search box and amount box have also
been fixed.
Old: https://imgur.com/a/ld4XF
New: https://imgur.com/a/9T8VP
2017-12-08 18:03:23 -05:00
oiad
9b96ddd2c3 Consolidate ItemKeyXXX/Colors to arrays.
Tidies up scripts inside epoch and for script creators.
Moved z_at_buyItems to epoch_generateKey.
2017-11-19 11:27:02 +13:00
ebayShopper
89d10fc973 Revert "Only allow lock removal if door is unlocked"
This reverts commit b8dba25

As discussed with oiad on Discord, this serves no purpose now, since
DZE_lockDoor == charID means the player either just unlocked, built,
upgraded or downgraded the door, so they want to see the action.
Logically a combo lock can be removed while a door is open. In case of
it being locked, you already know the code, so it is assumed you put it
in before removing it. Completing two-three steps at once is more
convenient for the player.

Also removed _isDestructable because there are no classes which inherit
from "BuiltItems" and have a lock
2017-11-08 14:15:25 -05:00
ebayShopper
e1b6125761 Fix Javelin selling and _HasKey check again
@oiad Add the Javelin magazine as trade_items to a trader which only
sells magazines (like FriendlyAssaultRifleAmmo) and the Javelin weapon
as trade_weapons to a trader which only sells weapons (like
FriendlyAssaultRifle), then test your changes from f8a230e with both in
your gear. You will see it allows you to sell all the magazines and the
weapon at both traders. This is because the only condition to add the
item to the sellable array is that it exists as an entry in the
category. It never checks the entry type. This commit will check to make
sure the type matches in the config and the player's inventory.

I changed your static "trade_any_vehicle" to find the type in the
config, because it could also be "trade_any_boat/bicycle/vehicle_free".
Boats are handled differently for the hitpoints check in sellItems.sqf.

Also I noticed that both the _HasKey check and your new _y == _myVehType
check were not working for upgraded vehicles _DZE[1-4] because they had
been swapped out to  _baseVehicle. I forgot to account for that when I
added that feature.

This should resolve both problems. I tested both and everything looks
good. It can do with some more thorough testing though. Note
DZE_SaleRequiresKey is false by default.
2017-11-07 16:53:33 -05:00
ebayShopper
42e00475d6 Add sender verification to publish and swap object
Continuation of 8035df0

This is important to have on publish to identify cheaters who spam
create objects in the database or create objects with bad inventory.

- Renamed variables to backport to vanilla
- Removed % and & due to code filtering in publicvariableval.txt

Changes in modular_build.sqf were the same as player_build.sqf.

Tested with building, upgrading buildable/vehicle/tent, downgrading,
buying a vehicle, destroying tent and removing an object.
2017-11-03 16:09:14 -04:00
ebayShopper
97a30adc3b Fix gem sell currency typo
@icomrade Correct me if I'm wrong, but it looks like this was a copy paste typo from https://github.com/EpochModTeam/DayZ-Epoch/blob/master/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_calcBuyableList.sqf#L57

in 83694a4
2017-10-25 14:12:01 -04:00
icomrade
e079381931 move deleteVehicle to server 2017-09-26 16:18:47 -04:00
icomrade
894ea80c16 Merge pull request #1974 from oiad/patch-3
Add support for keeping the key on vehicle sale
2017-09-08 10:04:35 -04:00
oiad
7a40f5d621 Add support for keeping the key on vehicle sale 2017-08-30 23:48:48 +12:00
oiad
f8a230e3b1 Fix javelin/stinger selling
The previous fix 4fa36dfd94 was not working correctly, if you had say the a stinger launcher and a stinger ammo it would detect them both as weapons, this properly classifies them and all others as how they should be.

Moved to use epoch_tempKeys also

This forces the player to only be able to sell a vehicle from the gear menu instead of backpack and vehicle menu since most of the time you would be using add all.

From: https://epochmod.com/forum/topic/44413-prevent-selling-vehicles-from-backpack/?tab=comments#comment-297328
2017-08-26 09:56:28 +12:00
ebayShopper
84556c9d03 Revert group menu color scheme to A2OA default 2017-07-30 12:44:58 -04:00
icomrade
8035df0ba0 Rudimentary auth for DeleteObj
limits distance to object, as well as validating random auth key.  added server_deleteObjDirect which is only for direct execution on the server, whereas server_deleteObj should be used for PVEH execution only
2017-07-29 21:09:20 -04:00
oiad
bf6a980d4c Dont show you have the item if it's not nearby (#1937)
* Dont show you have the item if it's not nearby

This was showing you had a vehicle in the trader menu even if it was
over the other side of the map, I think this works better only showing
it if it's within the trader zone.

* Forgot missing operator
2017-04-10 20:03:37 -04:00
ebayShopper
75cf8648d7 Fix error from 95ab6a2 2017-04-05 15:59:15 -04:00
ebayShopper
4b14397c7b Fix purchased boat not spawning on helipad
https://epochmod.com/forum/topic/43644-problem-with-napf-boat-spawn-in-1061/
2017-04-05 15:49:16 -04:00
ebayShopper
95ab6a28ab Fix unable to sell _DZE1-4 cars when base is removed from trader
https://epochmod.com/forum/topic/43643-vehicle-dze4-can-not-be-sell/
2017-04-05 12:04:00 -04:00
oiad
088945e074 Remove public variable event handler when using config traders. (#1930)
* Remove public variable event handler when using config traders.

This stops the public variable event handler from being loaded when
you're using config based traders, it's not needed in this situation

* Change nearestObjects to nearEntities in z_checkCloseVehicle.sqf

* Fixes vehicle selling not able to sell correctly

If more than 1 vehicle of the same classname was in a trader and the
local vehicle was further away it would not be able to be sold till
moved closer. We are using DZE_myVehicle for everything and we do
previous checks to make sure it's not null and local so we can assume it
is okay to use.

Fixes
https://epochmod.com/forum/topic/43643-vehicle-dze4-can-not-be-sell/#comment-290036
2017-04-01 13:02:51 -04:00
ebayShopper
30d961931f Fix unable to sell classic 'ItemBloodbag' at traders
Mistake from 4fa36df
2017-03-29 12:22:31 -04:00
ebaydayz
8c1caa9c1c Remove some redundant checks
Vanilla commits:

da7061429a

da55eaa53e
2017-01-29 19:36:48 -05:00
ebaydayz
92ee58900c Fix trader menu server RPT logs partially localized on client 2017-01-17 14:39:31 -05:00
ebaydayz
0d2f91f3aa Fix trader menu server RPT log partially localized on client 2017-01-11 16:12:17 -05:00
oiad
d0257b3c7d Add logging failed safe/lockbox and door lock/unlock/failed code attempts (#1853)
* Add logging failed safe/lockbox and door lock/unlock/failed code attempts

This adds logging for both safes and lockboxes for failed code attempts.

Also adds logging for locking, unlocking and failed code attempts for
doors.

"salival (playerUID) FAILED unlocking LockBox with code: Red11 (actual:
Red57) @110069 [11044.4,8438.32,0.652]"
"salival (playerUID) UNLOCKED LockBox with code: Green22 @110069
[11040.6,8438.91,0.834]"
"salival (playerUID) PACKED LockBox with code: Green22 @110069
[11040.6,8438.91,0.834]"
"salival (playerUID) UNLOCKED CinderWallDoorSmallLocked_DZ with code:
559 @110069 [11015.4,8458.74,5.272]"
"salival (playerUID) LOCKED CinderWallDoorSmallLocked_DZ with code: 559
@110069 [11015.4,8458.74,5.272]"
"salival (playerUID) FAILED unlocking CinderWallDoorSmallLocked_DZ with
code: EYESCAN (actual: 559) @110069 [11015.4,8458.74,5.272]"
"salival (playerUID) FAILED unlocking CinderWallDoorSmallLocked_DZ with
code: 100 (actual: 559) @110069 [11015.4,8458.74,5.272]"
"salival (playerUID) UNLOCKED CinderWallDoorSmallLocked_DZ with code:
559 @110069 [11015.4,8458.74,5.272]"
"salival (playerUID) LOCKED CinderWallDoorSmallLocked_DZ with code: 559
@110069 [11015.4,8458.74,5.272]"

* Revert wrong hinge type

* Remove unused DZE_Lock_Door

* Rework

* Remove redundant code, Make single currency costs use BIS_fnc_numberText

* Rework

* Add changelog line
2017-01-05 16:45:10 -05:00
ebaydayz
5cb485ccfb Prevent purchasing negative number of items
Fixes mistake from ffef031 @icomrade . _amount here is the quantity the
player enters in the quantity box when buying. The only time it is less
than or equal to zero is if the player enters zero or a negative number.
It has nothing to do with the buy or sell price.

Thanks Sercan for reporting.
2017-01-01 18:32:20 -05:00
ebaydayz
4fa36dfd94 Fix selling of Javelin, Stinger and some other items
Fixes #1844
2016-12-31 17:14:16 -05:00
Kobayashi
79bbc2c5a4 Backwards array call to Z_checkArrayInConfig (#1845)
Z_checkArrayInConfig is expecting weapons in position 0 for _this, all other stuff like get z_at_getGearItems.sqf and z_at_getVehicleItems.sqf passes the weapons array in position 0.
2016-12-31 16:03:16 -05:00
oiad
9889c8cd76 Merge z_calcDefaultCurrency and z_calcDefaultCurrencyNoImg (#1824)
* server_updateObject force update for single currency

This modifies server_updateObject to force update/save to the hive if
the item being saved is in the DZE_MoneyStorageClasses array.

Previously if you force saved the object multiple times, the coins would
not get updated until the inventory changed, which if this was for a
bank object it would never update.

(This applies if you are using PVDZ_veh_Save to save the object)

* z_at_calcDefaultCurrencyNoImg prettyfication

This fixes a long standing issue in my brain about how this text was
always displayed, to me it seemed very untidy and just thrown together
(since I borrowed it from the IMG version)

Changes the output from this example: 7 Ruby 1 Amethyst 3 Gold 4 10oz
Silver 5 Silver
To this prettier and more logical example: 7 Ruby, 1 Amethyst, 3 Gold, 4
10oz Silver and 5 Silver

Make texts great again!

* z_at_logtrade fixes

Removes hard coded "Coins" text and replaces it with configVariables
version.

Also removes duplicate code and simplifies it.

* Merge z_calcDefaultCurrency and z_calcDefaultCurrencyNoImg

This merges these two files together since they are largely the same,
this also adds an optional argument to change the font size which is
useful for custom scripts that use this function.

Examples of use:

[_number,true] call z_calcCurrency; // Return a string of text with no
images
[_number,false] call z_calcCurrency; // Return a string of text with
images
[_number,false,0.7] call z_calcCurrency; // Return a string of text with
the currency in it and sets the font size to 0.7
2016-12-22 14:16:38 -05:00
ebaydayz
5e97435d7b Fix can't sell classic bloodbag 2016-11-20 21:24:27 -05:00
ebaydayz
01307f9a42 Remove some common and duplicate translations 2016-11-07 16:14:20 -05:00
oiad
497b065663 Localization changes/additions. (#1787)
* Localization changes/additions.

Fixes a few localizations, extends range for removing camo nets from
toolbox by 10m, I have found that 5m is just not enough.

* Toolbox change

Update camonet removal to 10m instead of 5m

* Safe zone no building near/blacklisted buildings no building near

Adds a check in dze_buildChecks to disallow building within a certain
distance of a safezone or a blacklisted object name.

* typo

fix typo

* Safezone/blacklisted changes

As per requests.

* Rework

Rework

* Remove unused variables

as per subject

* Misc changes

Fix unprivated var in calcfreespace
Made single currency buy/sell reporting more englishery
Localization cleanup of extra spaces

* rework

rework
2016-11-04 12:08:47 -04:00
ebaydayz
3a3413caf5 Allow tools to exceed transportMaxWeapons when buying in bag 2016-10-31 13:54:40 -04:00
ebaydayz
866358e4d0 Add launcher handling to advanced trading 2016-10-31 13:07:07 -04:00
oiad
1c7e96a0ff Advanced trading modifications, maintain_area modifications (#1780)
* Advanced trading modifications, maintain_area modifications

This lot of changes brings forth the following:

Sets up a "default" set of compiles that are the minimum needed for
maintain_area.sqf and custom scripts to utilize the gem based currency
that @icomrade added.

maintain_area.sqf: This will now utilize the gem based currency system.

Removed the redundant Z_Vehicle and replaced it with the Epoch built in
DZE_myVehicle

z_at_buyItems: Code tidying and optimization

z_at_checkCloseVehicle: Tidied up the code since removing Z_Vehicle
allowed us to remove some now useless code.

z_at_getVehicleItems: Removed the nearestObjects check for your vehicle
since we now do z_checkCloseVehicle on Advanced trading start up.

* Advanced trading missed redundant variables

As per description

* Advanced trading rework

We don't need to check for close vehicle anymore now for backpack money
since we've made z_vehicle redundant.

* Revert "Advanced trading rework"

This reverts commit a589bd19b9.

* Advanced trading rework

We don't need to check for close vehicle anymore now for backpack money
since we've made z_vehicle redundant.

* Advanced trading rework

More rework

* Remove single currency add/remove coins functions

at request of @ebaydayz.
2016-10-28 19:29:04 -04:00
ebaydayz
f770b0a85d Add group system
Initial commit, not tested in multiplayer yet. Some revisions still left
to do.
2016-10-27 16:06:49 -04:00
ebaydayz
84d549d0a1 Revisions for #1777 (#1778)
* Update z_at_buyItems.sqf

* Update z_at_buyItems.sqf

* Update z_at_canAfford.sqf

* Update z_at_fillBuyableList.sqf

All of this is already checked in z_checkCloseVehicle at startup. If Z_VehicleChanges between the time the menu is started and the buyable list is filled it's not a big deal, since it only affects the highlighted color.

* Update server_handleSafeGear.sqf

* Update snappoints.hpp

* Update z_at_buyItems.sqf
2016-10-25 13:59:56 -04:00
oiad
bef2506653 Advanced trading fixes, server_handleSafeGear human readibility (#1777)
* Advanced trading fixes

Fixes a few issues and a dupe with advanced trading as well as some
localization of where a vehicle key is going.

Z_at_buyItems: Now adds localization for the key getting added to your
toolbelt, backpack and vehicle, this stops players thinking they didn't
get a key when infact it was added to their backpack/vehicle.

Z_at_canAfford.sqf: This fixes a dupe from a bad copy paste for whomever
wrote this script, it was using _backpackMoney in the
z_allowTakingMoneyFromVehicle part, changed to the proper variable
_vehicleMoney.

z_at_fillBuyableList.sqf: this fixes a bug where a vehicle would show
green even when it isn't local, just basically added more checking to
make sure the vehicle it's making green in the list is a) local, b)
alive and that the typeOf == _name.

z_at_logTrade.sqf: fixes some tidyness.

advancedTrading/init.sqf: adds a z_checkCloseVehicle call otherwise even
with Z_AllowTakingMoneyFromVehicle = true it will not get currency from
your vehicle until you clicked on the "Vehicle" tab.

dayz_server/server_tradeObject.sqf: More tidying as per the
z_at_logTrade and removes the useless Player:, as it is obvious a player
has bought something not an AI.

dayz_server/server_handleSafeGear.sqf: Makes the diag_log at the end
more human readable with GPS coordinates as well as the lock code for
the safe or the lockbox.

* advanced trading fixes. I hate you github

WHY U GET MISSED?? STUPID GITHUB.

* snappoints changes

Fixes the issue @SmokeyBR reported
https://github.com/EpochModTeam/DayZ-Epoch/issues/1766#issuecomment-253864795
Adds all floor types to snap list for all barriers so you can snap a
sandbag etc to a floor instead of manually lining it up
2016-10-25 13:10:48 -04:00
ebaydayz
869e95eb2c Fix wrong variable name in z_at_calcFreeSpace
I didn't catch this mistake before because _backpack was not in the private array, so it was still defined from the script that called this function. Thanks @oiad
2016-10-18 15:56:45 -04:00
ebaydayz
2109fdba03 Prevent sell from vehicle dupe
Prevents dupe described here:

https://epochmod.com/forum/topic/41891-resource-a-collection-of-anti-dupes/#comment-281324
2016-10-05 12:17:17 -04:00
ebaydayz
de219116a8 Optimize save after trade
See my comment on b806043

Veh_setFixServer only runs on the server, so the client does not need to
compile it.

The PVDZ_veh_Save PVEH is only added on the server, so it should never
be sent with regular publicVariable anymore.
2016-10-02 15:44:51 -04:00
ebaydayz
91f168011c Remove unused variable from #1770
_inventoryMoney was unused @oiad
2016-10-02 14:11:20 -04:00
oiad
9fd2f2270b Advance trading gem fixes/localizations (#1771)
* Advanced trading combine/return change

Fixes combining/returnChange to squash gems into usable currency so they
can properly be used in the economy
Stringtable fixes for duplicates

* Localization additions

More localizations
2016-10-02 13:06:31 -04:00
ebaydayz
15b05dc84b Fix return change free space check when buying into vehicle
This fixes incorrect return of "not enough space to accept change" when
purchasing large quantities of magazines into a vehicle.

Thanks @oiad for noticing this.
2016-09-27 19:09:54 -04:00
oiad
c02053176d Advanced trading bugfix, Snap building typo and snap point fixes
Fixes a bug with advanced trading green "you have this item" text in
buyables list, this was showing you had the item when you didn't.
Snap building typo
Snap building snap points for large cinder walls as reported by
@SmokeyBR
https://github.com/EpochModTeam/DayZ-Epoch/issues/1766#issuecomment-248021073
2016-09-24 18:53:02 +12:00
ebaydayz
cc03256475 Update purchased vehicle spawn location
If there was no helipad available findSafePos was called. If that failed
it spawned the vehicle in the debug zone.

Calling findSafePos is no longer necessary since we are now using
createVehicle "NONE".
2016-09-22 18:12:52 -04:00